Cesium.js 4.7 MB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495
/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.110.1
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */

var Cesium=(()=>{var C_e=Object.create;var i9=Object.defineProperty;var V_e=Object.getOwnPropertyDescriptor;var L_e=Object.getOwnPropertyNames;var R_e=Object.getPrototypeOf,Z_e=Object.prototype.hasOwnProperty;var Q0=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var yc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G_e=(e,t)=>{for(var n in t)i9(e,n,{get:t[n],enumerable:!0})},k8=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of L_e(t))!Z_e.call(e,o)&&o!==n&&i9(e,o,{get:()=>t[o],enumerable:!(i=V_e(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?C_e(R_e(e)):{},k8(t||!e||!e.__esModule?i9(n,"default",{value:e,enumerable:!0}):n,e)),E_e=e=>k8(i9({},"__esModule",{value:!0}),e);var S=yc(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIEdTPU9iamVjdC5jcmVhdGU7dmFyIEJsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgelM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgalM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIEhTPU9iamVjdC5nZXRQcm90b3R5cGVPZixxUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBEbz0odD0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkodCx7Z2V0OihlLG4pPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6ZSlbbl19KTp0KShmdW5jdGlvbih0KXtpZih0eXBlb2YgcmVxdWlyZTwidSIpcmV0dXJuIHJlcXVpcmUuYXBwbHkodGhpcyxhcmd1bWVudHMpO3Rocm93IEVycm9yKCdEeW5hbWljIHJlcXVpcmUgb2YgIicrdCsnIiBpcyBub3Qgc3VwcG9ydGVkJyl9KSxpMT10PT5lPT57dmFyIG49dFtlXTtpZihuKXJldHVyb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bUFycmF5PXZ0LnVucGFjazt2dC5tYXhpbXVtQ29tcG9uZW50PWZ1bmN0aW9uKHQpe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsdCksTWF0aC5tYXgodC54LHQueSx0LnosdC53KX07dnQubWluaW11bUNvbXBvbmVudD1mdW5jdGlvbih0KXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJjYXJ0ZXNpYW4iLHQpLE1hdGgubWluKHQueCx0LnksdC56LHQudyl9O3Z0Lm1pbmltdW1CeUNvbXBvbmVudD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLHQpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWluKHQueCxlLngpLG4ueT1NYXRoLm1pbih0LnksZS55KSxuLno9TWF0aC5taW4odC56LGUueiksbi53PU1hdGgubWluKHQudyxlLncpLG59O3Z0Lm1heGltdW1CeUNvbXBvbmVudD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLHQpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWF4KHQueCxlLngpLG4ueT1NYXRoLm1heCh0LnksZS55KSxuLno9TWF0aC5tYXgodC56LGUueiksbi53PU1hdGgubWF4KHQudyxlLncpLG59O3Z0LmNsYW1wPWZ1bmN0aW9uKHQsZSxuLG8pe3kudHlwZU9mLm9iamVjdCgidmFsdWUiLHQpLHkudHlwZU9mLm9iamVjdCgibWluIixlKSx5LnR5cGVPZi5vYmplY3QoIm1heCIsbikseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG8pO2xldCByPU0uY2xhbXAodC54LGUueCxuLngpLGk9TS5jbGFtcCh0LnksZS55LG4ueSkscz1NLmNsYW1wKHQueixlLn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vYmplY3QoInJpZ2h0IixlKSx0LngqZS54K3QueSplLnkrdC56KmUueit0LncqZS53fTt2dC5tdWx0aXBseUNvbXBvbmVudHM9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54KmUueCxuLnk9dC55KmUueSxuLno9dC56KmUueixuLnc9dC53KmUudyxufTt2dC5kaXZpZGVDb21wb25lbnRzPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJsZWZ0Iix0KSx5LnR5cGVPZi5vYmplY3QoInJpZ2h0IixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PXQueC9lLngsbi55PXQueS9lLnksbi56PXQuei9lLnosbi53PXQudy9lLncsbn07dnQuYWRkPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJsZWZ0Iix0KSx5LnR5cGVPZi5vYmplY3QoInJpZ2h0IixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PXQueCtlLngsbi55PXQueStlLnksbi56PXQueitlLnosbi53PXQudytlLncsbn07dnQuc3VidHJhY3Q9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54LWUueCxuLnk9dC55LWUueSxuLno9dC56LWUueixuLnc9dC53LWUudyxufTt2dC5tdWx0aXBseUJ5U2NhbGFyPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJjYXJ0ZXNpYW4iLHQpLHkudHlwZU9mLm51bWJlcigic2NhbGFyIixlKSx5LnR5cGVPZi5vYmpl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TtKcigpO0F0LnBhY2tlZExlbmd0aD0xNjtBdC5wYWNrPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJ2YWx1ZSIsdCkseS5kZWZpbmVkKCJhcnJheSIsZSksbj14KG4sMCksZVtuKytdPXRbMF0sZVtuKytdPXRbMV0sZVtuKytdPXRbMl0sZVtuKytdPXRbM10sZVtuKytdPXRbNF0sZVtuKytdPXRbNV0sZVtuKytdPXRbNl0sZVtuKytdPXRbN10sZVtuKytdPXRbOF0sZVtuKytdPXRbOV0sZVtuKytdPXRbMTBdLGVbbisrXT10WzExXSxlW24rK109dFsxMl0sZVtuKytdPXRbMTNdLGVbbisrXT10WzE0XSxlW25dPXRbMTVdLGV9O0F0LnVucGFjaz1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkuZGVmaW5lZCgiYXJyYXkiLHQpLGU9eChlLDApLGgobil8fChuPW5ldyBBdCksblswXT10W2UrK10sblsxXT10W2UrK10sblsyXT10W2UrK10sblszXT10W2UrK10sbls0XT10W2UrK10sbls1XT10W2UrK10sbls2XT10W2UrK10sbls3XT10W2UrK10sbls4XT10W2UrK10sbls5XT10W2UrK10sblsxMF09dFtlKytdLG5bMTFdPXRbZSsrXSxuWzEyXT10W2UrK10sblsxM109dFtlKytdLG5bMTRdPXRbZSsrXSxuWzE1XT10W2VdLG59O0F0LnBhY2tBcnJheT1mdW5jdGlvbih0LGUpe3kuZGVmaW5lZCgiYXJyYXkiLHQpO2xldCBuPXQubGVuZ3RoLG89bioxNjtpZighaChlKSllPW5ldyBBcnJheShvKTtlbHNle2lmKCFBcnJheS5pc0FycmF5KGUpJiZlLmxlbmd0aCE9PW8pdGhyb3cgbmV3IEIoIklmIHJlc3VsdCBpcyBhIHR5cGVkIGFycmF5LCBpdCBtdXN0IGhhdmUgZXhhY3RseSBhcnJheS5sZW5ndGggKiAxNiBlbGVtZW50cyIpO2UubGVuZ3RoIT09byYmKGUubGVuZ3RoPW8pfWZv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tfPSEwO2xldCB2PWEubXVsdGlwbHlCeVNjYWxhcihhLlVOSVRfWSxvTSxlTSk7VC55PDAmJihhLm5lZ2F0ZSh2LHYpLHc9bC5hdHRyaWJ1dGVzLEM9bC5pbmRpY2VzLE49Yy5hdHRyaWJ1dGVzLEk9Yy5pbmRpY2VzKTtsZXQgRD1hLmFkZChMLHYsbk0pO3cucG9zaXRpb24udmFsdWVzLnB1c2goVC54LFQueSxULnosVC54LFQueSxULnopLHcucG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLHcucG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLHcucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKHJbYiozXSxyW2IqMysxXSxyW2IqMysyXSksdy5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2gocltiKjMrM10scltiKjMrNF0scltiKjMrNV0pLHcucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKFQueCxULnksVC56LFQueCxULnksVC56KSx3Lm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksdy5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLHcubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEQueCxELnksRC56KSx3Lm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksYS5uZWdhdGUodix2KSxhLmFkZChMLHYsRCksTi5wb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksTi5wb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksTi5wb3NpdGlvbi52YWx1ZXMucHVzaChFLngsRS55LEUueixFLngsRS55LEUueiksTi5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEQueCxELnksRC56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksTi5wcmV2UG9zaXRpb24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4XT1uLnosc1s5XT1lLngsc1sxMF09bi55LHNbMTFdPW4ueixzWzEyXT1lLngsc1sxM109ZS55LHNbMTRdPWUueixzWzE1XT1uLngsc1sxNl09ZS55LHNbMTddPWUueixzWzE4XT1uLngsc1sxOV09bi55LHNbMjBdPWUueixzWzIxXT1lLngsc1syMl09bi55LHNbMjNdPWUueixzWzI0XT1uLngsc1syNV09ZS55LHNbMjZdPWUueixzWzI3XT1uLngsc1syOF09bi55LHNbMjldPWUueixzWzMwXT1uLngsc1szMV09bi55LHNbMzJdPW4ueixzWzMzXT1uLngsc1szNF09ZS55LHNbMzVdPW4ueixzWzM2XT1lLngsc1szN109ZS55LHNbMzhdPWUueixzWzM5XT1lLngsc1s0MF09bi55LHNbNDFdPWUueixzWzQyXT1lLngsc1s0M109bi55LHNbNDRdPW4ueixzWzQ1XT1lLngsc1s0Nl09ZS55LHNbNDddPW4ueixzWzQ4XT1lLngsc1s0OV09bi55LHNbNTBdPWUueixzWzUxXT1uLngsc1s1Ml09bi55LHNbNTNdPWUueixzWzU0XT1uLngsc1s1NV09bi55LHNbNTZdPW4ueixzWzU3XT1lLngsc1s1OF09bi55LHNbNTldPW4ueixzWzYwXT1lLngsc1s2MV09ZS55LHNbNjJdPWUueixzWzYzXT1uLngsc1s2NF09ZS55LHNbNjVdPWUueixzWzY2XT1uLngsc1s2N109ZS55LHNbNjhdPW4ueixzWzY5XT1lLngsc1s3MF09ZS55LHNbNzFdPW4ueixyLnBvc2l0aW9uPW5ldyBydCh7Y29tcG9uZW50RGF0YXR5cGU6b3QuRE9VQkxFLGNvbXBvbmVudHNQZXJBdHRyaWJ1dGU6Myx2YWx1ZXM6c30pKSxvLm5vcm1hbCl7bGV0IGM9bmV3IEZsb2F0MzJBcnJheSg3Mik7Y1swXT0wLGNbMV09MCxjWzJdPTEsY1szXT0wLGNbNF09MCxjWzVdPTEsY1s2XT0wLGNbN109MCxjWzhdPTEsY1s5XT0wLGNbMTBdPTAsY1sxMV09MSxjWzEyX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aWJ1dGU9PT1hZS5UT1ApRj1GLmZpbGwoMSwwLGMvMik7ZWxzZXtsZXQgaj1lLm9mZnNldEF0dHJpYnV0ZT09PWFlLk5PTkU/MDoxO0Y9Ri5maWxsKGopfVAuYXBwbHlPZmZzZXQ9bmV3IHJ0KHtjb21wb25lbnREYXRhdHlwZTpvdC5VTlNJR05FRF9CWVRFLGNvbXBvbmVudHNQZXJBdHRyaWJ1dGU6MSx2YWx1ZXM6Rn0pfXJldHVybiBQfWZ1bmN0aW9uIE93KHQpe2xldCBlPW5ldyBBcnJheSgxMioodCoodCsxKSktNiksbj0wLG8scixpLHMsZjtmb3Iobz0wLGk9MSxzPTA7czwzO3MrKyllW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pO2ZvcihzPTI7czx0KzE7KytzKXtmb3IoaT1zKihzKzEpLTEsbz0ocy0xKSpzLTEsZVtuKytdPWkrKyxlW24rK109byxlW24rK109aSxyPTIqcyxmPTA7ZjxyLTE7KytmKWVbbisrXT1pLGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pfWZvcihyPXQqMiwrK2ksKytvLHM9MDtzPHItMTsrK3MpZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pO2ZvcihlW24rK109aSxlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pKyssZVtuKytdPW8rKyxlW24rK109bywrK28scz10LTE7cz4xOy0tcyl7Zm9yKGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkscj0yKnMsZj0wO2Y8ci0xOysrZillW24rK109aSxlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWk7ZVtuKytdPW8rKyxlW24rK109bysrLGVbbisrXT1pKyt9Zm9yKHM9MDtzPDM7cysrKWVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPW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5nZW50JiYoRj1hLm5vcm1hbGl6ZShhLmNyb3NzKEEsUCxGKSxGKSxtW0QrK109Ri54LG1bRCsrXT1GLnksbVtEKytdPUYueixtW0QrK109Ri54LG1bRCsrXT1GLnksbVtEKytdPUYueikpfWZvcihfPTA7XzxpO18rKylyLm5vcm1hbCYmKHBbTCsrXT0wLHBbTCsrXT0wLHBbTCsrXT0tMSksci50YW5nZW50JiYoZFt2KytdPTEsZFt2KytdPTAsZFt2KytdPTApLHIuYml0YW5nZW50JiYobVtEKytdPTAsbVtEKytdPS0xLG1bRCsrXT0wKTtmb3IoXz0wO188aTtfKyspci5ub3JtYWwmJihwW0wrK109MCxwW0wrK109MCxwW0wrK109MSksci50YW5nZW50JiYoZFt2KytdPTEsZFt2KytdPTAsZFt2KytdPTApLHIuYml0YW5nZW50JiYobVtEKytdPTAsbVtEKytdPTEsbVtEKytdPTApfWxldCBiPTEyKmktMTIsTz1EdC5jcmVhdGVUeXBlZEFycmF5KHUsYiksVD0wLEU9MDtmb3IoXz0wO188aS0xO18rKylPW1QrK109RSxPW1QrK109RSsyLE9bVCsrXT1FKzMsT1tUKytdPUUsT1tUKytdPUUrMyxPW1QrK109RSsxLEUrPTI7Zm9yKE9bVCsrXT1zLTIsT1tUKytdPTAsT1tUKytdPTEsT1tUKytdPXMtMixPW1QrK109MSxPW1QrK109cy0xLF89MTtfPGktMTtfKyspT1tUKytdPXMrXysxLE9bVCsrXT1zK18sT1tUKytdPXM7Zm9yKF89MTtfPGktMTtfKyspT1tUKytdPWYsT1tUKytdPWYrXyxPW1QrK109ZitfKzE7bGV0IHc9MDtpZihyLnN0KXtsZXQgST1NYXRoLm1heChuLG8pO2ZvcihfPTA7Xzx1O18rKyl7bGV0IEw9YS5mcm9tQXJyYXkoYyxfKjMsbkQpO2xbdysrXT0oTC54K0kpLygyKkkpLGxbdysrXT0oTC55K0kpLygyKkkpfX1sZXQgQz1uZXcgcmU7ci5wb3NpdGlvbiYmKEMucG9zaXRpb249bmV3IH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0IGs9VSozLEs9YS5mcm9tQXJyYXkoYyxrLGZnKSxYPWEuZnJvbUFycmF5KHUsayxubSk7aWYoci5wb3NpdGlvbiYmKG1bVCsrXT1YLngsbVtUKytdPVgueSxtW1QrK109WC56LG1bVCsrXT1LLngsbVtUKytdPUsueSxtW1QrK109Sy56KSxyLnN0JiYoT1tOKytdPUEsT1tOKytdPTAsT1tOKytdPUEsT1tOKytdPTEpLHIubm9ybWFsfHxyLnRhbmdlbnR8fHIuYml0YW5nZW50KXtsZXQgUj1hLmNsb25lKGEuWkVSTyxyMiksUT1hLnN1YnRyYWN0KEsscy5nZW9kZXRpY1N1cmZhY2VOb3JtYWwoSyxubSksbm0pO2lmKFUrMTxwJiYoUj1hLmZyb21BcnJheShjLGsrMyxyMikpLEQpe2xldCBmdD1hLnN1YnRyYWN0KFIsSyxUVSkscHQ9YS5zdWJ0cmFjdChRLEssZmcpO0k9YS5ub3JtYWxpemUoYS5jcm9zcyhwdCxmdCxJKSxJKSxEPSExfWEuZXF1YWxzRXBzaWxvbihLLFIsTS5FUFNJTE9OMTApP0Q9ITA6KEErPVMsci50YW5nZW50JiYoTD1hLm5vcm1hbGl6ZShhLnN1YnRyYWN0KFIsSyxMKSxMKSksci5iaXRhbmdlbnQmJih2PWEubm9ybWFsaXplKGEuY3Jvc3MoSSxMLHYpLHYpKSksci5ub3JtYWwmJihfW0UrK109SS54LF9bRSsrXT1JLnksX1tFKytdPUkueixfW0UrK109SS54LF9bRSsrXT1JLnksX1tFKytdPUkueiksci50YW5nZW50JiYoZ1tDKytdPUwueCxnW0MrK109TC55LGdbQysrXT1MLnosZ1tDKytdPUwueCxnW0MrK109TC55LGdbQysrXT1MLnopLHIuYml0YW5nZW50JiYoYlt3KytdPXYueCxiW3crK109di55LGJbdysrXT12LnosYlt3KytdPXYueCxiW3crK109di55LGJbdysrXT12LnopfX1sZXQgUD1uZXcgcmU7ci5wb3NpdGlvbiYmKFAucG9zaXRpb249bmV3IHJ0KHtjb21wb25lbn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mVzb2x2ZSgpLnRoZW4oKCk9Pld5KCkpfSxzVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PiR5KCkpfSxjVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmVnKCkpfSxhVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnJnKCkpfSxmVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmNnKCkpfSx1Vj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnBnKCkpfSxsVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmhnKCkpfSxwVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PndnKCkpfSxkVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PlVnKCkpfSxtVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnpnKCkpfSxoVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PlhnKCkpfSxfVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PllnKCkpfSx5Vj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PlpnKCkpfTtyZXR1cm4gS1MoZ1YpO30pKCk7Cg==")});var o9=yc((Bgt,B8)=>{var Ygt=T(S()),Bf=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Bf.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Bf.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Bf.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Bf.prototype.random_int31=function(){return this.random_int()>>>1};Bf.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Bf.prototype.random=function(){return this.random_int()*(1/4294967296)};Bf.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Bf.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};B8.exports=Bf});var a6=yc((eS,tS)=>{var DCt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof eS=="object"&&eS&&!eS.nodeType&&eS,n=typeof tS=="object"&&tS&&!tS.nodeType&&tS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,l=38,u=700,m=72,p=128,y="-",f=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,Z=String.fromCharCode,G;function X(k){throw new RangeError(C[k])}function P(k,O){for(var U=k.length,J=[];U--;)J[U]=O(k[U]);return J}function v(k,O){var U=k.split("@"),J="";U.length>1&&(J=U[0]+"@",k=U[1]),k=k.replace(_,".");var z=k.split("."),ee=P(z,O).join(".");return J+ee}function A(k){for(var O=[],U=0,J=k.length,z,ee;U<J;)z=k.charCodeAt(U++),z>=55296&&z<=56319&&U<J?(ee=k.charCodeAt(U++),(ee&64512)==56320?O.push(((z&1023)<<10)+(ee&1023)+65536):(O.push(z),U--)):O.push(z);return O}function M(k){return P(k,function(O){var U="";return O>65535&&(O-=65536,U+=Z(O>>>10&1023|55296),O=56320|O&1023),U+=Z(O),U}).join("")}function b(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function R(k,O){return k+22+75*(k<26)-((O!=0)<<5)}function E(k,O,U){var J=0;for(k=U?L(k/u):k>>1,k+=L(k/O);k>V*c>>1;J+=s)k=L(k/V);return L(J+(V+1)*k/(k+l))}function I(k){var O=[],U=k.length,J,z=0,ee=p,K=m,j,q,be,Te,ae,xe,_e,Ve,Ie;for(j=k.lastIndexOf(y),j<0&&(j=0),q=0;q<j;++q)k.charCodeAt(q)>=128&&X("not-basic"),O.push(k.charCodeAt(q));for(be=j>0?j+1:0;be<U;){for(Te=z,ae=1,xe=s;be>=U&&X("invalid-input"),_e=b(k.charCodeAt(be++)),(_e>=s||_e>L((r-z)/ae))&&X("overflow"),z+=_e*ae,Ve=xe<=K?a:xe>=K+c?c:xe-K,!(_e<Ve);xe+=s)Ie=s-Ve,ae>L(r/Ie)&&X("overflow"),ae*=Ie;J=O.length+1,K=E(z-Te,J,Te==0),L(z/J)>r-ee&&X("overflow"),ee+=L(z/J),z%=J,O.splice(z++,0,ee)}return M(O)}function w(k){var O,U,J,z,ee,K,j,q,be,Te,ae,xe=[],_e,Ve,Ie,Me;for(k=A(k),_e=k.length,O=p,U=0,ee=m,K=0;K<_e;++K)ae=k[K],ae<128&&xe.push(Z(ae));for(J=z=xe.length,z&&xe.push(y);J<_e;){for(j=r,K=0;K<_e;++K)ae=k[K],ae>=O&&ae<j&&(j=ae);for(Ve=J+1,j-O>L((r-U)/Ve)&&X("overflow"),U+=(j-O)*Ve,O=j,K=0;K<_e;++K)if(ae=k[K],ae<O&&++U>r&&X("overflow"),ae==O){for(q=U,be=s;Te=be<=ee?a:be>=ee+c?c:be-ee,!(q<Te);be+=s)Me=q-Te,Ie=s-Te,xe.push(Z(R(Te+Me%Ie,0))),q=L(Me/Ie);xe.push(Z(R(q,0))),ee=E(U,Ve,J==z),U=0,++J}++U,++O}return xe.join("")}function N(k){return v(k,function(O){return f.test(O)?I(O.slice(4).toLowerCase()):O})}function Y(k){return v(k,function(O){return x.test(O)?"xn--"+w(O):O})}if(o={version:"1.3.2",ucs2:{decode:A,encode:M},decode:I,encode:w,toASCII:Y,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(tS.exports==t)n.exports=o;else for(G in o)o.hasOwnProperty(G)&&(t[G]=o[G]);else e.punycode=o})(eS)});var l6=yc((c6,W9)=>{var BCt=T(S());/*!
 * URI.js - Mutating URLs
 * IPv6 Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof W9=="object"&&W9.exports?W9.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(c6,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var l;for(l=0;l<a&&s[l]!=="";l++);if(l<c)for(s.splice(l,1,"0000");s.length<c;)s.splice(l,0,"0000");for(var u,m=0;m<c;m++){u=s[m].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[m]=u.join("")}var y=-1,f=0,x=0,_=-1,C=!1;for(m=0;m<c;m++)C?s[m]==="0"?x+=1:(C=!1,x>f&&(y=_,f=x)):s[m]==="0"&&(C=!0,_=m,x=1);x>f&&(y=_,f=x),f>1&&s.splice(y,f,""),a=s.length;var V="";for(s[0]===""&&(V=":"),m=0;m<a&&(V+=s[m],m!==a-1);m++)V+=":";return s[a-1]===""&&(V+=":"),V}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var u6=yc((d6,P9)=>{var YCt=T(S());/*!
 * URI.js - Mutating URLs
 * Second Level Domain (SLD) Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof P9=="object"&&P9.exports?P9.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(d6,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Dl=yc((m6,v9)=>{var OCt=T(S());/*!
 * URI.js - Mutating URLs
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */(function(e,t){"use strict";typeof v9=="object"&&v9.exports?v9.exports=t(a6(),l6(),u6()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(m6,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,E){var I=arguments.length>=1,w=arguments.length>=2;if(!(this instanceof r))return I?w?new r(R,E):new r(R):new r;if(R===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(R),E!==void 0?this.absoluteTo(E):this}function s(R){return/^[0-9]+$/.test(R)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function l(R){return R.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(R){return R===void 0?"Undefined":String(Object.prototype.toString.call(R)).slice(8,-1)}function m(R){return u(R)==="Array"}function p(R,E){var I={},w,N;if(u(E)==="RegExp")I=null;else if(m(E))for(w=0,N=E.length;w<N;w++)I[E[w]]=!0;else I[E]=!0;for(w=0,N=R.length;w<N;w++){var Y=I&&I[R[w]]!==void 0||!I&&E.test(R[w]);Y&&(R.splice(w,1),N--,w--)}return R}function y(R,E){var I,w;if(m(E)){for(I=0,w=E.length;I<w;I++)if(!y(R,E[I]))return!1;return!0}var N=u(E);for(I=0,w=R.length;I<w;I++)if(N==="RegExp"){if(typeof R[I]=="string"&&R[I].match(E))return!0}else if(R[I]===E)return!0;return!1}function f(R,E){if(!m(R)||!m(E)||R.length!==E.length)return!1;R.sort(),E.sort();for(var I=0,w=R.length;I<w;I++)if(R[I]!==E[I])return!1;return!0}function x(R){var E=/^\/+|\/+$/g;return R.replace(E,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_exp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0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(R){if(!(!R||!R.nodeName)){var E=R.nodeName.toLowerCase();if(!(E==="input"&&R.type!=="image"))return r.domAttributes[E]}};function _(R){return escape(R)}function C(R){return encodeURIComponent(R).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(R,E){var I=r.encode(R+"");return E===void 0&&(E=r.escapeQuerySpace),E?I.replace(/%20/g,"+"):I},r.decodeQuery=function(R,E){R+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?R.replace(/\+/g,"%20"):R)}catch{return R}};var V={encode:"encode",decode:"decode"},L,Z=function(R,E){return function(I){try{return r[E](I+"").replace(r.characters[R][E].expression,function(w){return r.characters[R][E].map[w]})}catch{return I}}};for(L in V)r[L+"PathSegment"]=Z("pathname",V[L]),r[L+"UrnPathSegment"]=Z("urnpath",V[L]);var G=function(R,E,I){return function(w){var N;I?N=function(U){return r[E](r[I](U))}:N=r[E];for(var Y=(w+"").split(R),k=0,O=Y.length;k<O;k++)Y[k]=N(Y[k]);return Y.join(R)}};r.decodePath=G("/","decodePathSegment"),r.decodeUrnPath=G(":","decodeUrnPathSegment"),r.recodePath=G("/","encodePathSegment","decode"),r.recodeUrnPath=G(":","encodeUrnPathSegment","decode"),r.encodeReserved=Z("reserved","encode"),r.parse=function(R,E){var I;return E||(E={preventInvalidHostname:r.preventInvalidHostname}),R=R.replace(r.leading_whitespace_expression,""),R=R.replace(r.ascii_tab_whitespace,""),I=R.indexOf("#"),I>-1&&(E.fragment=R.substring(I+1)||null,R=R.substring(0,I)),I=R.indexOf("?"),I>-1&&(E.query=R.substring(I+1)||null,R=R.substring(0,I)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(E.protocol=null,R=R.substring(2),R=r.parseAuthority(R,E)):(I=R.indexOf(":"),I>-1&&(E.protocol=R.substring(0,I)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:R.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(R=R.substring(I+3),R=r.parseAuthority(R,E)):(R=R.substring(I+1),E.urn=!0))),E.path=R,E},r.parseHost=function(R,E){R||(R=""),R=R.replace(/\\/g,"/");var I=R.indexOf("/"),w,N;if(I===-1&&(I=R.length),R.charAt(0)==="[")w=R.indexOf("]"),E.hostname=R.substring(1,w)||null,E.port=R.substring(w+2,I)||null,E.port==="/"&&(E.port=null);else{var Y=R.indexOf(":"),k=R.indexOf("/"),O=R.indexOf(":",Y+1);O!==-1&&(k===-1||O<k)?(E.hostname=R.substring(0,I)||null,E.port=null):(N=R.substring(0,I).split(":"),E.hostname=N[0]||null,E.port=N[1]||null)}return E.hostname&&R.substring(I).charAt(0)!=="/"&&(I++,R="/"+R),E.preventInvalidHostname&&r.ensureValidHostname(E.hostname,E.protocol),E.port&&r.ensureValidPort(E.port),R.substring(I)||"/"},r.parseAuthority=function(R,E){return R=r.parseUserinfo(R,E),r.parseHost(R,E)},r.parseUserinfo=function(R,E){var I=R,w=R.indexOf("\\");w!==-1&&(R=R.replace(/\\/g,"/"));var N=R.indexOf("/"),Y=R.lastIndexOf("@",N>-1?N:R.length-1),k;return Y>-1&&(N===-1||Y<N)?(k=R.substring(0,Y).split(":"),E.username=k[0]?r.decode(k[0]):null,k.shift(),E.password=k[0]?r.decode(k.join(":")):null,R=I.substring(Y+1)):(E.username=null,E.password=null),R},r.parseQuery=function(R,E){if(!R)return{};if(R=R.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!R)return{};for(var I={},w=R.split("&"),N=w.length,Y,k,O,U=0;U<N;U++)Y=w[U].split("="),k=r.decodeQuery(Y.shift(),E),O=Y.length?r.decodeQuery(Y.join("="),E):null,k!=="__proto__"&&(c.call(I,k)?((typeof I[k]=="string"||I[k]===null)&&(I[k]=[I[k]]),I[k].push(O)):I[k]=O);return I},r.build=function(R){var E="",I=!1;return R.protocol&&(E+=R.protocol+":"),!R.urn&&(E||R.hostname)&&(E+="//",I=!0),E+=r.buildAuthority(R)||"",typeof R.path=="string"&&(R.path.charAt(0)!=="/"&&I&&(E+="/"),E+=R.path),typeof R.query=="string"&&R.query&&(E+="?"+R.query),typeof R.fragment=="string"&&R.fragment&&(E+="#"+R.fragment),E},r.buildHost=function(R){var E="";if(R.hostname)r.ip6_expression.test(R.hostname)?E+="["+R.hostname+"]":E+=R.hostname;else return"";return R.port&&(E+=":"+R.port),E},r.buildAuthority=function(R){return r.buildUserinfo(R)+r.buildHost(R)},r.buildUserinfo=function(R){var E="";return R.username&&(E+=r.encode(R.username)),R.password&&(E+=":"+r.encode(R.password)),E&&(E+="@"),E},r.buildQuery=function(R,E,I){var w="",N,Y,k,O;for(Y in R)if(Y!=="__proto__"&&c.call(R,Y))if(m(R[Y]))for(N={},k=0,O=R[Y].length;k<O;k++)R[Y][k]!==void 0&&N[R[Y][k]+""]===void 0&&(w+="&"+r.buildQueryParameter(Y,R[Y][k],I),E!==!0&&(N[R[Y][k]+""]=!0));else R[Y]!==void 0&&(w+="&"+r.buildQueryParameter(Y,R[Y],I));return w.substring(1)},r.buildQueryParameter=function(R,E,I){return r.encodeQuery(R,I)+(E!==null?"="+r.encodeQuery(E,I):"")},r.addQuery=function(R,E,I){if(typeof E=="object")for(var w in E)c.call(E,w)&&r.addQuery(R,w,E[w]);else if(typeof E=="string"){if(R[E]===void 0){R[E]=I;return}else typeof R[E]=="string"&&(R[E]=[R[E]]);m(I)||(I=[I]),R[E]=(R[E]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(R,E,I){if(typeof E=="object")for(var w in E)c.call(E,w)&&r.setQuery(R,w,E[w]);else if(typeof E=="string")R[E]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(R,E,I){var w,N,Y;if(m(E))for(w=0,N=E.length;w<N;w++)R[E[w]]=void 0;else if(u(E)==="RegExp")for(Y in R)E.test(Y)&&(R[Y]=void 0);else if(typeof E=="object")for(Y in E)c.call(E,Y)&&r.removeQuery(R,Y,E[Y]);else if(typeof E=="string")I!==void 0?u(I)==="RegExp"?!m(R[E])&&I.test(R[E])?R[E]=void 0:R[E]=p(R[E],I):R[E]===String(I)&&(!m(I)||I.length===1)?R[E]=void 0:m(R[E])&&(R[E]=p(R[E],I)):R[E]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(R,E,I,w){switch(u(E)){case"String":break;case"RegExp":for(var N in R)if(c.call(R,N)&&E.test(N)&&(I===void 0||r.hasQuery(R,N,I)))return!0;return!1;case"Object":for(var Y in E)if(c.call(E,Y)&&!r.hasQuery(R,Y,E[Y]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(I)){case"Undefined":return E in R;case"Boolean":var k=!!(m(R[E])?R[E].length:R[E]);return I===k;case"Function":return!!I(R[E],E,R);case"Array":if(!m(R[E]))return!1;var O=w?y:f;return O(R[E],I);case"RegExp":return m(R[E])?w?y(R[E],I):!1:!!(R[E]&&R[E].match(I));case"Number":I=String(I);case"String":return m(R[E])?w?y(R[E],I):!1:R[E]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var R=[],E=[],I=0,w=0;w<arguments.length;w++){var N=new r(arguments[w]);R.push(N);for(var Y=N.segment(),k=0;k<Y.length;k++)typeof Y[k]=="string"&&E.push(Y[k]),Y[k]&&I++}if(!E.length||!I)return new r("");var O=new r("").segment(E);return(R[0].path()===""||R[0].path().slice(0,1)==="/")&&O.path("/"+O.path()),O.normalize()},r.commonPath=function(R,E){var I=Math.min(R.length,E.length),w;for(w=0;w<I;w++)if(R.charAt(w)!==E.charAt(w)){w--;break}return w<1?R.charAt(0)===E.charAt(0)&&R.charAt(0)==="/"?"/":"":((R.charAt(w)!=="/"||E.charAt(w)!=="/")&&(w=R.substring(0,w).lastIndexOf("/")),R.substring(0,w+1))},r.withinString=function(R,E,I){I||(I={});var w=I.start||r.findUri.start,N=I.end||r.findUri.end,Y=I.trim||r.findUri.trim,k=I.parens||r.findUri.parens,O=/[a-z0-9-]=["']?$/i;for(w.lastIndex=0;;){var U=w.exec(R);if(!U)break;var J=U.index;if(I.ignoreHtml){var z=R.slice(Math.max(J-3,0),J);if(z&&O.test(z))continue}for(var ee=J+R.slice(J).search(N),K=R.slice(J,ee),j=-1;;){var q=k.exec(K);if(!q)break;var be=q.index+q[0].length;j=Math.max(j,be)}if(j>-1?K=K.slice(0,j)+K.slice(j).replace(Y,""):K=K.replace(Y,""),!(K.length<=U[0].length)&&!(I.ignore&&I.ignore.test(K))){ee=J+K.length;var Te=E(K,J,ee,R);if(Te===void 0){w.lastIndex=ee;continue}Te=String(Te),R=R.slice(0,J)+Te+R.slice(ee),w.lastIndex=J+Te.length}}return w.lastIndex=0,R},r.ensureValidHostname=function(R,E){var I=!!R,w=!!E,N=!1;if(w&&(N=y(r.hostProtocols,E)),N&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(R&&R.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(R).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(R){if(R){var E=Number(R);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(R){return R===!0?this._deferred_build=!0:(R===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function X(R){return function(E,I){return E===void 0?this._parts[R]||"":(this._parts[R]=E||null,this.build(!I),this)}}function P(R,E){return function(I,w){return I===void 0?this._parts[R]||"":(I!==null&&(I=I+"",I.charAt(0)===E&&(I=I.substring(1))),this._parts[R]=I,this.build(!w),this)}}a.protocol=X("protocol"),a.username=X("username"),a.password=X("password"),a.hostname=X("hostname"),a.port=X("port"),a.query=P("query","?"),a.fragment=P("fragment","#"),a.search=function(R,E){var I=this.query(R,E);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(R,E){var I=this.fragment(R,E);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(R,E){if(R===void 0||R===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!E),this},a.path=a.pathname,a.href=function(R,E){var I;if(R===void 0)return this.toString();this._string="",this._parts=r._parts();var w=R instanceof r,N=typeof R=="object"&&(R.hostname||R.path||R.pathname);if(R.nodeName){var Y=r.getDomAttribute(R);R=R[Y]||"",N=!1}if(!w&&N&&R.pathname!==void 0&&(R=R.toString()),typeof R=="string"||R instanceof String)this._parts=r.parse(String(R),this._parts);else if(w||N){var k=w?R._parts:R;for(I in k)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=k[I]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},a.is=function(R){var E=!1,I=!1,w=!1,N=!1,Y=!1,k=!1,O=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),w=r.ip6_expression.test(this._parts.hostname),E=I||w,N=!E,Y=N&&n&&n.has(this._parts.hostname),k=N&&r.idn_expression.test(this._parts.hostname),O=N&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return N;case"sld":return Y;case"ip":return E;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return w;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return O}return null};var v=a.protocol,A=a.port,M=a.hostname;a.protocol=function(R,E){if(R&&(R=R.replace(/:(\/\/)?$/,""),!R.match(r.protocol_expression)))throw new TypeError('Protocol "'+R+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return v.call(this,R,E)},a.scheme=a.protocol,a.port=function(R,E){return this._parts.urn?R===void 0?"":this:(R!==void 0&&(R===0&&(R=null),R&&(R+="",R.charAt(0)===":"&&(R=R.substring(1)),r.ensureValidPort(R))),A.call(this,R,E))},a.hostname=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},w=r.parseHost(R,I);if(w!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return M.call(this,R,E)},a.origin=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var I=this.protocol(),w=this.authority();return w?(I?I+"://":"")+this.authority():""}else{var N=r(R);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(R,this._parts);if(I!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(R,this._parts);if(I!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!E),this},a.resource=function(R,E){var I;return R===void 0?this.path()+this.search()+this.hash():(I=r.parse(R),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!E),this)},a.subdomain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var w=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,w),Y=new RegExp("^"+l(N));if(R&&R.charAt(R.length-1)!=="."&&(R+="."),R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return R&&r.ensureValidHostname(R,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(Y,R),this.build(!E),this}},a.domain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var w=this._parts.hostname.length-this.tld(E).length-1;return w=this._parts.hostname.lastIndexOf(".",w-1)+1,this._parts.hostname.substring(w)||""}else{if(!R)throw new TypeError("cannot set domain empty");if(R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(R,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=R;else{var N=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,R)}return this.build(!E),this}},a.tld=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),w=this._parts.hostname.substring(I+1);return E!==!0&&n&&n.list[w.toLowerCase()]&&n.get(this._parts.hostname)||w}else{var N;if(R)if(R.match(/[^a-zA-Z0-9-]/))if(n&&n.is(R))N=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R);else throw new TypeError('TLD "'+R+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,w=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return R?r.decodePath(w):w}else{var N=this._parts.path.length-this.filename().length,Y=this._parts.path.substring(0,N),k=new RegExp("^"+l(Y));return this.is("relative")||(R||(R="/"),R.charAt(0)!=="/"&&(R="/"+R)),R&&R.charAt(R.length-1)!=="/"&&(R+="/"),R=r.recodePath(R),this._parts.path=this._parts.path.replace(k,R),this.build(!E),this}},a.filename=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),w=this._parts.path.substring(I+1);return R?r.decodePathSegment(w):w}else{var N=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(N=!0);var Y=new RegExp(l(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(Y,R),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),w=I.lastIndexOf("."),N,Y;return w===-1?"":(N=I.substring(w+1),Y=/^[a-z0-9%]+$/i.test(N)?N:"",R?r.decodePathSegment(Y):Y)}else{R.charAt(0)==="."&&(R=R.substring(1));var k=this.suffix(),O;if(k)R?O=new RegExp(l(k)+"$"):O=new RegExp(l("."+k)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return O&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(O,R)),this.build(!E),this}},a.segment=function(R,E,I){var w=this._parts.urn?":":"/",N=this.path(),Y=N.substring(0,1)==="/",k=N.split(w);if(R!==void 0&&typeof R!="number"&&(I=E,E=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(Y&&k.shift(),R<0&&(R=Math.max(k.length+R,0)),E===void 0)return R===void 0?k:k[R];if(R===null||k[R]===void 0)if(m(E)){k=[];for(var O=0,U=E.length;O<U;O++)!E[O].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(x(E[O])))}else(E||typeof E=="string")&&(E=x(E),k[k.length-1]===""?k[k.length-1]=E:k.push(E));else E?k[R]=x(E):k.splice(R,1);return Y&&k.unshift(""),this.path(k.join(w),I)},a.segmentCoded=function(R,E,I){var w,N,Y;if(typeof R!="number"&&(I=E,E=R,R=void 0),E===void 0){if(w=this.segment(R,E,I),!m(w))w=w!==void 0?r.decode(w):void 0;else for(N=0,Y=w.length;N<Y;N++)w[N]=r.decode(w[N]);return w}if(!m(E))E=typeof E=="string"||E instanceof String?r.encode(E):E;else for(N=0,Y=E.length;N<Y;N++)E[N]=r.encode(E[N]);return this.segment(R,E,I)};var b=a.query;return a.query=function(R,E){if(R===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),w=R.call(this,I);return this._parts.query=r.buildQuery(w||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this}else return R!==void 0&&typeof R!="string"?(this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this):b.call(this,R,E)},a.setQuery=function(R,E,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="string"||R instanceof String)w[R]=E!==void 0?E:null;else if(typeof R=="object")for(var N in R)c.call(R,N)&&(w[N]=R[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=E),this.build(!I),this},a.addQuery=function(R,E,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(w,R,E===void 0?null:E),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=E),this.build(!I),this},a.removeQuery=function(R,E,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(w,R,E),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=E),this.build(!I),this},a.hasQuery=function(R,E,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(w,R,E,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(R){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!R)),this},a.normalizeHostname=function(R){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!R)),this},a.normalizePort=function(R){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!R)),this},a.normalizePath=function(R){var E=this._parts.path;if(!E)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!R),this;if(this._parts.path==="/")return this;E=r.recodePath(E);var I,w="",N,Y;for(E.charAt(0)!=="/"&&(I=!0,E="/"+E),(E.slice(-3)==="/.."||E.slice(-2)==="/.")&&(E+="/"),E=E.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(w=E.substring(1).match(/^(\.\.\/)+/)||"",w&&(w=w[0]));N=E.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){E=E.substring(3);continue}Y=E.substring(0,N).lastIndexOf("/"),Y===-1&&(Y=N),E=E.substring(0,Y)+E.substring(N+3)}return I&&this.is("relative")&&(E=w+E.substring(1)),this._parts.path=E,this.build(!R),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(R){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!R)),this},a.normalizeFragment=function(R){return this._parts.fragment||(this._parts.fragment=null,this.build(!R)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var R=r.encode,E=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=R,r.decode=E}return this},a.unicode=function(){var R=r.encode,E=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=R,r.decode=E}return this},a.readable=function(){var R=this.clone();R.username("").password("").normalize();var E="";if(R._parts.protocol&&(E+=R._parts.protocol+"://"),R._parts.hostname&&(R.is("punycode")&&e?(E+=e.toUnicode(R._parts.hostname),R._parts.port&&(E+=":"+R._parts.port)):E+=R.host()),R._parts.hostname&&R._parts.path&&R._parts.path.charAt(0)!=="/"&&(E+="/"),E+=R.path(!0),R._parts.query){for(var I="",w=0,N=R._parts.query.split("&"),Y=N.length;w<Y;w++){var k=(N[w]||"").split("=");I+="&"+r.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(I+="="+r.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}E+="?"+I.substring(1)}return E+=r.decodeQuery(R.hash(),!0),E},a.absoluteTo=function(R){var E=this.clone(),I=["protocol","username","password","hostname","port"],w,N,Y;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R instanceof r||(R=new r(R)),E._parts.protocol||(E._parts.protocol=R._parts.protocol,this._parts.hostname))return E;for(N=0;Y=I[N];N++)E._parts[Y]=R._parts[Y];return E._parts.path?(E._parts.path.substring(-2)===".."&&(E._parts.path+="/"),E.path().charAt(0)!=="/"&&(w=R.directory(),w=w||(R.path().indexOf("/")===0?"/":""),E._parts.path=(w?w+"/":"")+E._parts.path,E.normalizePath())):(E._parts.path=R._parts.path,E._parts.query||(E._parts.query=R._parts.query)),E.build(),E},a.relativeTo=function(R){var E=this.clone().normalize(),I,w,N,Y,k;if(E._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R=new r(R).normalize(),I=E._parts,w=R._parts,Y=E.path(),k=R.path(),Y.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===w.protocol&&(I.protocol=null),I.username!==w.username||I.password!==w.password||I.protocol!==null||I.username!==null||I.password!==null)return E.build();if(I.hostname===w.hostname&&I.port===w.port)I.hostname=null,I.port=null;else return E.build();if(Y===k)return I.path="",E.build();if(N=r.commonPath(Y,k),!N)return E.build();var O=w.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=O+I.path.substring(N.length)||"./",E.build()},a.equals=function(R){var E=this.clone(),I=new r(R),w={},N={},Y={},k,O,U;if(E.normalize(),I.normalize(),E.toString()===I.toString())return!0;if(k=E.query(),O=I.query(),E.query(""),I.query(""),E.toString()!==I.toString()||k.length!==O.length)return!1;w=r.parseQuery(k,this._parts.escapeQuerySpace),N=r.parseQuery(O,this._parts.escapeQuerySpace);for(U in w)if(c.call(w,U)){if(m(w[U])){if(!f(w[U],N[U]))return!1}else if(w[U]!==N[U])return!1;Y[U]=!0}for(U in N)if(c.call(N,U)&&!Y[U])return!1;return!0},a.preventInvalidHostname=function(R){return this._parts.preventInvalidHostname=!!R,this},a.duplicateQueryParameters=function(R){return this._parts.duplicateQueryParameters=!!R,this},a.escapeQuerySpace=function(R){return this._parts.escapeQuerySpace=!!R,this},r})});var lte=yc((rY,sY)=>{var Hjt=T(S());/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */(function(e,t){typeof rY=="object"&&typeof sY<"u"?sY.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(rY,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:l}=typeof Reflect<"u"&&Reflect;r||(r=function(ke){return ke}),s||(s=function(ke){return ke}),c||(c=function(ke,ct,yt){return ke.apply(ct,yt)}),l||(l=function(ke,ct){return new ke(...ct)});let u=G(Array.prototype.forEach),m=G(Array.prototype.pop),p=G(Array.prototype.push),y=G(String.prototype.toLowerCase),f=G(String.prototype.toString),x=G(String.prototype.match),_=G(String.prototype.replace),C=G(String.prototype.indexOf),V=G(String.prototype.trim),L=G(RegExp.prototype.test),Z=X(TypeError);function G(ve){return function(ke){for(var ct=arguments.length,yt=new Array(ct>1?ct-1:0),ot=1;ot<ct;ot++)yt[ot-1]=arguments[ot];return c(ve,ke,yt)}}function X(ve){return function(){for(var ke=arguments.length,ct=new Array(ke),yt=0;yt<ke;yt++)ct[yt]=arguments[yt];return l(ve,ct)}}function P(ve,ke){let ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;t&&t(ve,null);let yt=ke.length;for(;yt--;){let ot=ke[yt];if(typeof ot=="string"){let ln=ct(ot);ln!==ot&&(n(ke)||(ke[yt]=ln),ot=ln)}ve[ot]=!0}return ve}function v(ve){let ke=a(null);for(let[ct,yt]of e(ve))o(ve,ct)!==void 0&&(ke[ct]=yt);return ke}function A(ve,ke){for(;ve!==null;){let yt=o(ve,ke);if(yt){if(yt.get)return G(yt.get);if(typeof yt.value=="function")return G(yt.value)}ve=i(ve)}function ct(yt){return console.warn("fallback value for",yt),null}return ct}let M=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),b=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),R=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),E=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),w=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=r(["#text"]),Y=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),k=r(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),O=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),J=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),ee=s(/\${[\w\W]*}/gm),K=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),q=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),be=s(/^(?:\w+script|data):/i),Te=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ae=s(/^html$/i);var xe=Object.freeze({__proto__:null,MUSTACHE_EXPR:J,ERB_EXPR:z,TMPLIT_EXPR:ee,DATA_ATTR:K,ARIA_ATTR:j,IS_ALLOWED_URI:q,IS_SCRIPT_OR_DATA:be,ATTR_WHITESPACE:Te,DOCTYPE_NAME:ae});let _e=function(){return typeof window>"u"?null:window},Ve=function(ke,ct){if(typeof ke!="object"||typeof ke.createPolicy!="function")return null;let yt=null,ot="data-tt-policy-suffix";ct&&ct.hasAttribute(ot)&&(yt=ct.getAttribute(ot));let ln="dompurify"+(yt?"#"+yt:"");try{return ke.createPolicy(ln,{createHTML(vn){return vn},createScriptURL(vn){return vn}})}catch{return console.warn("TrustedTypes policy "+ln+" could not be created."),null}};function Ie(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_e(),ke=Ln=>Ie(Ln);if(ke.version="3.0.6",ke.removed=[],!ve||!ve.document||ve.document.nodeType!==9)return ke.isSupported=!1,ke;let{document:ct}=ve,yt=ct,ot=yt.currentScript,{DocumentFragment:ln,HTMLTemplateElement:vn,Node:Dt,Element:Nt,NodeFilter:pe,NamedNodeMap:Ce=ve.NamedNodeMap||ve.MozNamedAttrMap,HTMLFormElement:Ht,DOMParser:ut,trustedTypes:hi}=ve,ji=Nt.prototype,pc=A(ji,"cloneNode"),bs=A(ji,"nextSibling"),ys=A(ji,"childNodes"),$r=A(ji,"parentNode");if(typeof vn=="function"){let Ln=ct.createElement("template");Ln.content&&Ln.content.ownerDocument&&(ct=Ln.content.ownerDocument)}let we,je="",{implementation:qe,createNodeIterator:Qe,createDocumentFragment:pt,getElementsByTagName:Bt}=ct,{importNode:Vn}=yt,di={};ke.isSupported=typeof e=="function"&&typeof $r=="function"&&qe&&qe.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:bo,ERB_EXPR:es,TMPLIT_EXPR:ts,DATA_ATTR:Mo,ARIA_ATTR:Ki,IS_SCRIPT_OR_DATA:ns,ATTR_WHITESPACE:zn}=xe,{IS_ALLOWED_URI:wn}=xe,mn=null,_i=P({},[...M,...b,...R,...I,...N]),ui=null,As=P({},[...Y,...k,...O,...U]),fi=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),vr=null,Sh=null,cr=!0,kd=!0,qc=!1,pg=!0,Or=!1,bc=!1,Dd=!1,Ga=!1,Ch=!1,DT=!1,KV=!1,C8=!0,V8=!1,f_e="user-content-",UD=!0,HV=!1,BT={},YT=null,L8=P({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),R8=null,Z8=P({},["audio","video","img","source","image","track"]),kD=null,G8=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),e9="http://www.w3.org/1998/Math/MathML",t9="http://www.w3.org/2000/svg",kf="http://www.w3.org/1999/xhtml",OT=kf,DD=!1,BD=null,p_e=P({},[e9,t9,kf],f),bg=null,b_e=["application/xhtml+xml","text/html"],y_e="text/html",Ms=null,KT=null,g_e=ct.createElement("form"),E8=function(Ge){return Ge instanceof RegExp||Ge instanceof Function},YD=function(){let Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(KT&&KT===Ge)){if((!Ge||typeof Ge!="object")&&(Ge={}),Ge=v(Ge),bg=b_e.indexOf(Ge.PARSER_MEDIA_TYPE)===-1?bg=y_e:bg=Ge.PARSER_MEDIA_TYPE,Ms=bg==="application/xhtml+xml"?f:y,mn="ALLOWED_TAGS"in Ge?P({},Ge.ALLOWED_TAGS,Ms):_i,ui="ALLOWED_ATTR"in Ge?P({},Ge.ALLOWED_ATTR,Ms):As,BD="ALLOWED_NAMESPACES"in Ge?P({},Ge.ALLOWED_NAMESPACES,f):p_e,kD="ADD_URI_SAFE_ATTR"in Ge?P(v(G8),Ge.ADD_URI_SAFE_ATTR,Ms):G8,R8="ADD_DATA_URI_TAGS"in Ge?P(v(Z8),Ge.ADD_DATA_URI_TAGS,Ms):Z8,YT="FORBID_CONTENTS"in Ge?P({},Ge.FORBID_CONTENTS,Ms):L8,vr="FORBID_TAGS"in Ge?P({},Ge.FORBID_TAGS,Ms):{},Sh="FORBID_ATTR"in Ge?P({},Ge.FORBID_ATTR,Ms):{},BT="USE_PROFILES"in Ge?Ge.USE_PROFILES:!1,cr=Ge.ALLOW_ARIA_ATTR!==!1,kd=Ge.ALLOW_DATA_ATTR!==!1,qc=Ge.ALLOW_UNKNOWN_PROTOCOLS||!1,pg=Ge.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Or=Ge.SAFE_FOR_TEMPLATES||!1,bc=Ge.WHOLE_DOCUMENT||!1,Ch=Ge.RETURN_DOM||!1,DT=Ge.RETURN_DOM_FRAGMENT||!1,KV=Ge.RETURN_TRUSTED_TYPE||!1,Ga=Ge.FORCE_BODY||!1,C8=Ge.SANITIZE_DOM!==!1,V8=Ge.SANITIZE_NAMED_PROPS||!1,UD=Ge.KEEP_CONTENT!==!1,HV=Ge.IN_PLACE||!1,wn=Ge.ALLOWED_URI_REGEXP||q,OT=Ge.NAMESPACE||kf,fi=Ge.CUSTOM_ELEMENT_HANDLING||{},Ge.CUSTOM_ELEMENT_HANDLING&&E8(Ge.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fi.tagNameCheck=Ge.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ge.CUSTOM_ELEMENT_HANDLING&&E8(Ge.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fi.attributeNameCheck=Ge.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ge.CUSTOM_ELEMENT_HANDLING&&typeof Ge.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fi.allowCustomizedBuiltInElements=Ge.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Or&&(kd=!1),DT&&(Ch=!0),BT&&(mn=P({},[...N]),ui=[],BT.html===!0&&(P(mn,M),P(ui,Y)),BT.svg===!0&&(P(mn,b),P(ui,k),P(ui,U)),BT.svgFilters===!0&&(P(mn,R),P(ui,k),P(ui,U)),BT.mathMl===!0&&(P(mn,I),P(ui,O),P(ui,U))),Ge.ADD_TAGS&&(mn===_i&&(mn=v(mn)),P(mn,Ge.ADD_TAGS,Ms)),Ge.ADD_ATTR&&(ui===As&&(ui=v(ui)),P(ui,Ge.ADD_ATTR,Ms)),Ge.ADD_URI_SAFE_ATTR&&P(kD,Ge.ADD_URI_SAFE_ATTR,Ms),Ge.FORBID_CONTENTS&&(YT===L8&&(YT=v(YT)),P(YT,Ge.FORBID_CONTENTS,Ms)),UD&&(mn["#text"]=!0),bc&&P(mn,["html","head","body"]),mn.table&&(P(mn,["tbody"]),delete vr.tbody),Ge.TRUSTED_TYPES_POLICY){if(typeof Ge.TRUSTED_TYPES_POLICY.createHTML!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ge.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');we=Ge.TRUSTED_TYPES_POLICY,je=we.createHTML("")}else we===void 0&&(we=Ve(hi,ot)),we!==null&&typeof je=="string"&&(je=we.createHTML(""));r&&r(Ge),KT=Ge}},X8=P({},["mi","mo","mn","ms","mtext"]),I8=P({},["foreignobject","desc","title","annotation-xml"]),x_e=P({},["title","style","font","a","script"]),n9=P({},b);P(n9,R),P(n9,E);let OD=P({},I);P(OD,w);let __e=function(Ge){let Zt=$r(Ge);(!Zt||!Zt.tagName)&&(Zt={namespaceURI:OT,tagName:"template"});let bn=y(Ge.tagName),No=y(Zt.tagName);return BD[Ge.namespaceURI]?Ge.namespaceURI===t9?Zt.namespaceURI===kf?bn==="svg":Zt.namespaceURI===e9?bn==="svg"&&(No==="annotation-xml"||X8[No]):!!n9[bn]:Ge.namespaceURI===e9?Zt.namespaceURI===kf?bn==="math":Zt.namespaceURI===t9?bn==="math"&&I8[No]:!!OD[bn]:Ge.namespaceURI===kf?Zt.namespaceURI===t9&&!I8[No]||Zt.namespaceURI===e9&&!X8[No]?!1:!OD[bn]&&(x_e[bn]||!n9[bn]):!!(bg==="application/xhtml+xml"&&BD[Ge.namespaceURI]):!1},yg=function(Ge){p(ke.removed,{element:Ge});try{Ge.parentNode.removeChild(Ge)}catch{Ge.remove()}},KD=function(Ge,Zt){try{p(ke.removed,{attribute:Zt.getAttributeNode(Ge),from:Zt})}catch{p(ke.removed,{attribute:null,from:Zt})}if(Zt.removeAttribute(Ge),Ge==="is"&&!ui[Ge])if(Ch||DT)try{yg(Zt)}catch{}else try{Zt.setAttribute(Ge,"")}catch{}},W8=function(Ge){let Zt=null,bn=null;if(Ga)Ge="<remove></remove>"+Ge;else{let Xa=x(Ge,/^[\r\n\t ]+/);bn=Xa&&Xa[0]}bg==="application/xhtml+xml"&&OT===kf&&(Ge='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ge+"</body></html>");let No=we?we.createHTML(Ge):Ge;if(OT===kf)try{Zt=new ut().parseFromString(No,bg)}catch{}if(!Zt||!Zt.documentElement){Zt=qe.createDocument(OT,"template",null);try{Zt.documentElement.innerHTML=DD?je:No}catch{}}let Ea=Zt.body||Zt.documentElement;return Ge&&bn&&Ea.insertBefore(ct.createTextNode(bn),Ea.childNodes[0]||null),OT===kf?Bt.call(Zt,bc?"html":"body")[0]:bc?Zt.documentElement:Ea},P8=function(Ge){return Qe.call(Ge.ownerDocument||Ge,Ge,pe.SHOW_ELEMENT|pe.SHOW_COMMENT|pe.SHOW_TEXT,null)},T_e=function(Ge){return Ge instanceof Ht&&(typeof Ge.nodeName!="string"||typeof Ge.textContent!="string"||typeof Ge.removeChild!="function"||!(Ge.attributes instanceof Ce)||typeof Ge.removeAttribute!="function"||typeof Ge.setAttribute!="function"||typeof Ge.namespaceURI!="string"||typeof Ge.insertBefore!="function"||typeof Ge.hasChildNodes!="function")},v8=function(Ge){return typeof Dt=="function"&&Ge instanceof Dt},Df=function(Ge,Zt,bn){di[Ge]&&u(di[Ge],No=>{No.call(ke,Zt,bn,KT)})},w8=function(Ge){let Zt=null;if(Df("beforeSanitizeElements",Ge,null),T_e(Ge))return yg(Ge),!0;let bn=Ms(Ge.nodeName);if(Df("uponSanitizeElement",Ge,{tagName:bn,allowedTags:mn}),Ge.hasChildNodes()&&!v8(Ge.firstElementChild)&&L(/<[/\w]/g,Ge.innerHTML)&&L(/<[/\w]/g,Ge.textContent))return yg(Ge),!0;if(!mn[bn]||vr[bn]){if(!vr[bn]&&A8(bn)&&(fi.tagNameCheck instanceof RegExp&&L(fi.tagNameCheck,bn)||fi.tagNameCheck instanceof Function&&fi.tagNameCheck(bn)))return!1;if(UD&&!YT[bn]){let No=$r(Ge)||Ge.parentNode,Ea=ys(Ge)||Ge.childNodes;if(Ea&&No){let Xa=Ea.length;for(let $c=Xa-1;$c>=0;--$c)No.insertBefore(pc(Ea[$c],!0),bs(Ge))}}return yg(Ge),!0}return Ge instanceof Nt&&!__e(Ge)||(bn==="noscript"||bn==="noembed"||bn==="noframes")&&L(/<\/no(script|embed|frames)/i,Ge.innerHTML)?(yg(Ge),!0):(Or&&Ge.nodeType===3&&(Zt=Ge.textContent,u([bo,es,ts],No=>{Zt=_(Zt,No," ")}),Ge.textContent!==Zt&&(p(ke.removed,{element:Ge.cloneNode()}),Ge.textContent=Zt)),Df("afterSanitizeElements",Ge,null),!1)},F8=function(Ge,Zt,bn){if(C8&&(Zt==="id"||Zt==="name")&&(bn in ct||bn in g_e))return!1;if(!(kd&&!Sh[Zt]&&L(Mo,Zt))){if(!(cr&&L(Ki,Zt))){if(!ui[Zt]||Sh[Zt]){if(!(A8(Ge)&&(fi.tagNameCheck instanceof RegExp&&L(fi.tagNameCheck,Ge)||fi.tagNameCheck instanceof Function&&fi.tagNameCheck(Ge))&&(fi.attributeNameCheck instanceof RegExp&&L(fi.attributeNameCheck,Zt)||fi.attributeNameCheck instanceof Function&&fi.attributeNameCheck(Zt))||Zt==="is"&&fi.allowCustomizedBuiltInElements&&(fi.tagNameCheck instanceof RegExp&&L(fi.tagNameCheck,bn)||fi.tagNameCheck instanceof Function&&fi.tagNameCheck(bn))))return!1}else if(!kD[Zt]){if(!L(wn,_(bn,zn,""))){if(!((Zt==="src"||Zt==="xlink:href"||Zt==="href")&&Ge!=="script"&&C(bn,"data:")===0&&R8[Ge])){if(!(qc&&!L(ns,_(bn,zn,"")))){if(bn)return!1}}}}}}return!0},A8=function(Ge){return Ge.indexOf("-")>0},M8=function(Ge){Df("beforeSanitizeAttributes",Ge,null);let{attributes:Zt}=Ge;if(!Zt)return;let bn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ui},No=Zt.length;for(;No--;){let Ea=Zt[No],{name:Xa,namespaceURI:$c,value:gg}=Ea,zV=Ms(Xa),el=Xa==="value"?gg:V(gg);if(bn.attrName=zV,bn.attrValue=el,bn.keepAttr=!0,bn.forceKeepAttr=void 0,Df("uponSanitizeAttribute",Ge,bn),el=bn.attrValue,bn.forceKeepAttr||(KD(Xa,Ge),!bn.keepAttr))continue;if(!pg&&L(/\/>/i,el)){KD(Xa,Ge);continue}Or&&u([bo,es,ts],U8=>{el=_(el,U8," ")});let N8=Ms(Ge.nodeName);if(F8(N8,zV,el)){if(V8&&(zV==="id"||zV==="name")&&(KD(Xa,Ge),el=f_e+el),we&&typeof hi=="object"&&typeof hi.getAttributeType=="function"&&!$c)switch(hi.getAttributeType(N8,zV)){case"TrustedHTML":{el=we.createHTML(el);break}case"TrustedScriptURL":{el=we.createScriptURL(el);break}}try{$c?Ge.setAttributeNS($c,Xa,el):Ge.setAttribute(Xa,el),m(ke.removed)}catch{}}}Df("afterSanitizeAttributes",Ge,null)},S_e=function Ln(Ge){let Zt=null,bn=P8(Ge);for(Df("beforeSanitizeShadowDOM",Ge,null);Zt=bn.nextNode();)Df("uponSanitizeShadowNode",Zt,null),!w8(Zt)&&(Zt.content instanceof ln&&Ln(Zt.content),M8(Zt));Df("afterSanitizeShadowDOM",Ge,null)};return ke.sanitize=function(Ln){let Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Zt=null,bn=null,No=null,Ea=null;if(DD=!Ln,DD&&(Ln="<!-->"),typeof Ln!="string"&&!v8(Ln))if(typeof Ln.toString=="function"){if(Ln=Ln.toString(),typeof Ln!="string")throw Z("dirty is not a string, aborting")}else throw Z("toString is not a function");if(!ke.isSupported)return Ln;if(Dd||YD(Ge),ke.removed=[],typeof Ln=="string"&&(HV=!1),HV){if(Ln.nodeName){let gg=Ms(Ln.nodeName);if(!mn[gg]||vr[gg])throw Z("root node is forbidden and cannot be sanitized in-place")}}else if(Ln instanceof Dt)Zt=W8("<!---->"),bn=Zt.ownerDocument.importNode(Ln,!0),bn.nodeType===1&&bn.nodeName==="BODY"||bn.nodeName==="HTML"?Zt=bn:Zt.appendChild(bn);else{if(!Ch&&!Or&&!bc&&Ln.indexOf("<")===-1)return we&&KV?we.createHTML(Ln):Ln;if(Zt=W8(Ln),!Zt)return Ch?null:KV?je:""}Zt&&Ga&&yg(Zt.firstChild);let Xa=P8(HV?Ln:Zt);for(;No=Xa.nextNode();)w8(No)||(No.content instanceof ln&&S_e(No.content),M8(No));if(HV)return Ln;if(Ch){if(DT)for(Ea=pt.call(Zt.ownerDocument);Zt.firstChild;)Ea.appendChild(Zt.firstChild);else Ea=Zt;return(ui.shadowroot||ui.shadowrootmode)&&(Ea=Vn.call(yt,Ea,!0)),Ea}let $c=bc?Zt.outerHTML:Zt.innerHTML;return bc&&mn["!doctype"]&&Zt.ownerDocument&&Zt.ownerDocument.doctype&&Zt.ownerDocument.doctype.name&&L(ae,Zt.ownerDocument.doctype.name)&&($c="<!DOCTYPE "+Zt.ownerDocument.doctype.name+`>
`+$c),Or&&u([bo,es,ts],gg=>{$c=_($c,gg," ")}),we&&KV?we.createHTML($c):$c},ke.setConfig=function(){let Ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};YD(Ln),Dd=!0},ke.clearConfig=function(){KT=null,Dd=!1},ke.isValidAttribute=function(Ln,Ge,Zt){KT||YD({});let bn=Ms(Ln),No=Ms(Ge);return F8(bn,No,Zt)},ke.addHook=function(Ln,Ge){typeof Ge=="function"&&(di[Ln]=di[Ln]||[],p(di[Ln],Ge))},ke.removeHook=function(Ln){if(di[Ln])return m(di[Ln])},ke.removeHooks=function(Ln){di[Ln]&&(di[Ln]=[])},ke.removeAllHooks=function(){di={}},ke}var Me=Ie();return Me})});var gre=yc((TLn,yre)=>{"use strict";var SLn=T(S());yre.exports=RDe;var tW=1e20;function RDe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,l,u,m,p,y,f,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,m=p.getContext("2d"),r=p.width,s=p.height,y=m.getImageData(0,0,r,s),c=y.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,y=m.getImageData(0,0,r,s),c=y.data,u=4):window.ImageData&&e instanceof window.ImageData&&(y=e,r=e.width,s=e.height,c=y.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(l=c,c=Array(r*s),f=0,x=Math.floor(l.length/u);f<x;f++)c[f]=l[f*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var _=Array(r*s),C=Array(r*s),V=Array(a),L=Array(a),Z=Array(a+1),G=Array(a);for(f=0,x=r*s;f<x;f++){var X=c[f];_[f]=X===1?0:X===0?tW:Math.pow(Math.max(0,.5-X),2),C[f]=X===1?tW:X===0?0:Math.pow(Math.max(0,X-.5),2)}pre(_,r,s,V,L,G,Z),pre(C,r,s,V,L,G,Z);var P=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,x=r*s;f<x;f++)P[f]=Math.min(Math.max(1-((_[f]-C[f])/i+n),0),1);return P}function pre(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(bre(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(bre(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function bre(e,t,n,i,o){n[0]=0,i[0]=-tW,i[1]=+tW;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+tW}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Cre=yc((kLn,l5)=>{var DLn=T(S());function ADe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,l=9,u=10,m=11,p=12,y=13,f=14,x=15,_=16,C=17,V=0,L=1,Z=2,G=3,X=4;function P(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function v(b,R){R===void 0&&(R=0);var E=b.charCodeAt(R);if(55296<=E&&E<=56319&&R<b.length-1){var I=E,w=b.charCodeAt(R+1);return 56320<=w&&w<=57343?(I-55296)*1024+(w-56320)+65536:I}if(56320<=E&&E<=57343&&R>=1){var I=b.charCodeAt(R-1),w=E;return 55296<=I&&I<=56319?(I-55296)*1024+(w-56320)+65536:w}return E}function A(b,R,E){var I=[b].concat(R).concat([E]),w=I[I.length-2],N=E,Y=I.lastIndexOf(f);if(Y>1&&I.slice(1,Y).every(function(U){return U==i})&&[i,y,C].indexOf(b)==-1)return Z;var k=I.lastIndexOf(o);if(k>0&&I.slice(1,k).every(function(U){return U==o})&&[p,o].indexOf(w)==-1)return I.filter(function(U){return U==o}).length%2==1?G:X;if(w==e&&N==t)return V;if(w==n||w==e||w==t)return N==f&&R.every(function(U){return U==i})?Z:L;if(N==n||N==e||N==t)return L;if(w==s&&(N==s||N==a||N==l||N==u))return V;if((w==l||w==a)&&(N==a||N==c))return V;if((w==u||w==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(w==p)return V;var O=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[y,C].indexOf(I[O])!=-1&&I.slice(O+1,-1).every(function(U){return U==i})&&N==f||w==x&&[_,C].indexOf(N)!=-1?V:R.indexOf(o)!=-1?Z:w==o&&N==o?V:L}this.nextBreak=function(b,R){if(R===void 0&&(R=0),R<0)return 0;if(R>=b.length-1)return b.length;for(var E=M(v(b,R)),I=[],w=R+1;w<b.length;w++)if(!P(b,w-1)){var N=M(v(b,w));if(A(E,I,N))return w;I.push(N)}return b.length},this.splitGraphemes=function(b){for(var R=[],E=0,I;(I=this.nextBreak(b,E))<b.length;)R.push(b.slice(E,I)),E=I;return E<b.length&&R.push(b.slice(E)),R},this.iterateGraphemes=function(b){var R=0,E={next:function(){var I,w;return(w=this.nextBreak(b,R))<b.length?(I=b.slice(R,w),R=w,{value:I,done:!1}):R<b.length?(I=b.slice(R),R=b.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(E[Symbol.iterator]=function(){return E}),E},this.countGraphemes=function(b){for(var R=0,E=0,I;(I=this.nextBreak(b,E))<b.length;)E=I,R++;return E<b.length&&R++,R};function M(b){return 1536<=b&&b<=1541||b==1757||b==1807||b==2274||b==3406||b==69821||70082<=b&&b<=70083||b==72250||72326<=b&&b<=72329||b==73030?p:b==13?e:b==10?t:0<=b&&b<=9||11<=b&&b<=12||14<=b&&b<=31||127<=b&&b<=159||b==173||b==1564||b==6158||b==8203||8206<=b&&b<=8207||b==8232||b==8233||8234<=b&&b<=8238||8288<=b&&b<=8292||b==8293||8294<=b&&b<=8303||55296<=b&&b<=57343||b==65279||65520<=b&&b<=65528||65529<=b&&b<=65531||113824<=b&&b<=113827||119155<=b&&b<=119162||b==917504||b==917505||917506<=b&&b<=917535||917632<=b&&b<=917759||918e3<=b&&b<=921599?n:768<=b&&b<=879||1155<=b&&b<=1159||1160<=b&&b<=1161||1425<=b&&b<=1469||b==1471||1473<=b&&b<=1474||1476<=b&&b<=1477||b==1479||1552<=b&&b<=1562||1611<=b&&b<=1631||b==1648||1750<=b&&b<=1756||1759<=b&&b<=1764||1767<=b&&b<=1768||1770<=b&&b<=1773||b==1809||1840<=b&&b<=1866||1958<=b&&b<=1968||2027<=b&&b<=2035||2070<=b&&b<=2073||2075<=b&&b<=2083||2085<=b&&b<=2087||2089<=b&&b<=2093||2137<=b&&b<=2139||2260<=b&&b<=2273||2275<=b&&b<=2306||b==2362||b==2364||2369<=b&&b<=2376||b==2381||2385<=b&&b<=2391||2402<=b&&b<=2403||b==2433||b==2492||b==2494||2497<=b&&b<=2500||b==2509||b==2519||2530<=b&&b<=2531||2561<=b&&b<=2562||b==2620||2625<=b&&b<=2626||2631<=b&&b<=2632||2635<=b&&b<=2637||b==2641||2672<=b&&b<=2673||b==2677||2689<=b&&b<=2690||b==2748||2753<=b&&b<=2757||2759<=b&&b<=2760||b==2765||2786<=b&&b<=2787||2810<=b&&b<=2815||b==2817||b==2876||b==2878||b==2879||2881<=b&&b<=2884||b==2893||b==2902||b==2903||2914<=b&&b<=2915||b==2946||b==3006||b==3008||b==3021||b==3031||b==3072||3134<=b&&b<=3136||3142<=b&&b<=3144||3146<=b&&b<=3149||3157<=b&&b<=3158||3170<=b&&b<=3171||b==3201||b==3260||b==3263||b==3266||b==3270||3276<=b&&b<=3277||3285<=b&&b<=3286||3298<=b&&b<=3299||3328<=b&&b<=3329||3387<=b&&b<=3388||b==3390||3393<=b&&b<=3396||b==3405||b==3415||3426<=b&&b<=3427||b==3530||b==3535||3538<=b&&b<=3540||b==3542||b==3551||b==3633||3636<=b&&b<=3642||3655<=b&&b<=3662||b==3761||3764<=b&&b<=3769||3771<=b&&b<=3772||3784<=b&&b<=3789||3864<=b&&b<=3865||b==3893||b==3895||b==3897||3953<=b&&b<=3966||3968<=b&&b<=3972||3974<=b&&b<=3975||3981<=b&&b<=3991||3993<=b&&b<=4028||b==4038||4141<=b&&b<=4144||4146<=b&&b<=4151||4153<=b&&b<=4154||4157<=b&&b<=4158||4184<=b&&b<=4185||4190<=b&&b<=4192||4209<=b&&b<=4212||b==4226||4229<=b&&b<=4230||b==4237||b==4253||4957<=b&&b<=4959||5906<=b&&b<=5908||5938<=b&&b<=5940||5970<=b&&b<=5971||6002<=b&&b<=6003||6068<=b&&b<=6069||6071<=b&&b<=6077||b==6086||6089<=b&&b<=6099||b==6109||6155<=b&&b<=6157||6277<=b&&b<=6278||b==6313||6432<=b&&b<=6434||6439<=b&&b<=6440||b==6450||6457<=b&&b<=6459||6679<=b&&b<=6680||b==6683||b==6742||6744<=b&&b<=6750||b==6752||b==6754||6757<=b&&b<=6764||6771<=b&&b<=6780||b==6783||6832<=b&&b<=6845||b==6846||6912<=b&&b<=6915||b==6964||6966<=b&&b<=6970||b==6972||b==6978||7019<=b&&b<=7027||7040<=b&&b<=7041||7074<=b&&b<=7077||7080<=b&&b<=7081||7083<=b&&b<=7085||b==7142||7144<=b&&b<=7145||b==7149||7151<=b&&b<=7153||7212<=b&&b<=7219||7222<=b&&b<=7223||7376<=b&&b<=7378||7380<=b&&b<=7392||7394<=b&&b<=7400||b==7405||b==7412||7416<=b&&b<=7417||7616<=b&&b<=7673||7675<=b&&b<=7679||b==8204||8400<=b&&b<=8412||8413<=b&&b<=8416||b==8417||8418<=b&&b<=8420||8421<=b&&b<=8432||11503<=b&&b<=11505||b==11647||11744<=b&&b<=11775||12330<=b&&b<=12333||12334<=b&&b<=12335||12441<=b&&b<=12442||b==42607||42608<=b&&b<=42610||42612<=b&&b<=42621||42654<=b&&b<=42655||42736<=b&&b<=42737||b==43010||b==43014||b==43019||43045<=b&&b<=43046||43204<=b&&b<=43205||43232<=b&&b<=43249||43302<=b&&b<=43309||43335<=b&&b<=43345||43392<=b&&b<=43394||b==43443||43446<=b&&b<=43449||b==43452||b==43493||43561<=b&&b<=43566||43569<=b&&b<=43570||43573<=b&&b<=43574||b==43587||b==43596||b==43644||b==43696||43698<=b&&b<=43700||43703<=b&&b<=43704||43710<=b&&b<=43711||b==43713||43756<=b&&b<=43757||b==43766||b==44005||b==44008||b==44013||b==64286||65024<=b&&b<=65039||65056<=b&&b<=65071||65438<=b&&b<=65439||b==66045||b==66272||66422<=b&&b<=66426||68097<=b&&b<=68099||68101<=b&&b<=68102||68108<=b&&b<=68111||68152<=b&&b<=68154||b==68159||68325<=b&&b<=68326||b==69633||69688<=b&&b<=69702||69759<=b&&b<=69761||69811<=b&&b<=69814||69817<=b&&b<=69818||69888<=b&&b<=69890||69927<=b&&b<=69931||69933<=b&&b<=69940||b==70003||70016<=b&&b<=70017||70070<=b&&b<=70078||70090<=b&&b<=70092||70191<=b&&b<=70193||b==70196||70198<=b&&b<=70199||b==70206||b==70367||70371<=b&&b<=70378||70400<=b&&b<=70401||b==70460||b==70462||b==70464||b==70487||70502<=b&&b<=70508||70512<=b&&b<=70516||70712<=b&&b<=70719||70722<=b&&b<=70724||b==70726||b==70832||70835<=b&&b<=70840||b==70842||b==70845||70847<=b&&b<=70848||70850<=b&&b<=70851||b==71087||71090<=b&&b<=71093||71100<=b&&b<=71101||71103<=b&&b<=71104||71132<=b&&b<=71133||71219<=b&&b<=71226||b==71229||71231<=b&&b<=71232||b==71339||b==71341||71344<=b&&b<=71349||b==71351||71453<=b&&b<=71455||71458<=b&&b<=71461||71463<=b&&b<=71467||72193<=b&&b<=72198||72201<=b&&b<=72202||72243<=b&&b<=72248||72251<=b&&b<=72254||b==72263||72273<=b&&b<=72278||72281<=b&&b<=72283||72330<=b&&b<=72342||72344<=b&&b<=72345||72752<=b&&b<=72758||72760<=b&&b<=72765||b==72767||72850<=b&&b<=72871||72874<=b&&b<=72880||72882<=b&&b<=72883||72885<=b&&b<=72886||73009<=b&&b<=73014||b==73018||73020<=b&&b<=73021||73023<=b&&b<=73029||b==73031||92912<=b&&b<=92916||92976<=b&&b<=92982||94095<=b&&b<=94098||113821<=b&&b<=113822||b==119141||119143<=b&&b<=119145||119150<=b&&b<=119154||119163<=b&&b<=119170||119173<=b&&b<=119179||119210<=b&&b<=119213||119362<=b&&b<=119364||121344<=b&&b<=121398||121403<=b&&b<=121452||b==121461||b==121476||121499<=b&&b<=121503||121505<=b&&b<=121519||122880<=b&&b<=122886||122888<=b&&b<=122904||122907<=b&&b<=122913||122915<=b&&b<=122916||122918<=b&&b<=122922||125136<=b&&b<=125142||125252<=b&&b<=125258||917536<=b&&b<=917631||917760<=b&&b<=917999?i:127462<=b&&b<=127487?o:b==2307||b==2363||2366<=b&&b<=2368||2377<=b&&b<=2380||2382<=b&&b<=2383||2434<=b&&b<=2435||2495<=b&&b<=2496||2503<=b&&b<=2504||2507<=b&&b<=2508||b==2563||2622<=b&&b<=2624||b==2691||2750<=b&&b<=2752||b==2761||2763<=b&&b<=2764||2818<=b&&b<=2819||b==2880||2887<=b&&b<=2888||2891<=b&&b<=2892||b==3007||3009<=b&&b<=3010||3014<=b&&b<=3016||3018<=b&&b<=3020||3073<=b&&b<=3075||3137<=b&&b<=3140||3202<=b&&b<=3203||b==3262||3264<=b&&b<=3265||3267<=b&&b<=3268||3271<=b&&b<=3272||3274<=b&&b<=3275||3330<=b&&b<=3331||3391<=b&&b<=3392||3398<=b&&b<=3400||3402<=b&&b<=3404||3458<=b&&b<=3459||3536<=b&&b<=3537||3544<=b&&b<=3550||3570<=b&&b<=3571||b==3635||b==3763||3902<=b&&b<=3903||b==3967||b==4145||4155<=b&&b<=4156||4182<=b&&b<=4183||b==4228||b==6070||6078<=b&&b<=6085||6087<=b&&b<=6088||6435<=b&&b<=6438||6441<=b&&b<=6443||6448<=b&&b<=6449||6451<=b&&b<=6456||6681<=b&&b<=6682||b==6741||b==6743||6765<=b&&b<=6770||b==6916||b==6965||b==6971||6973<=b&&b<=6977||6979<=b&&b<=6980||b==7042||b==7073||7078<=b&&b<=7079||b==7082||b==7143||7146<=b&&b<=7148||b==7150||7154<=b&&b<=7155||7204<=b&&b<=7211||7220<=b&&b<=7221||b==7393||7410<=b&&b<=7411||b==7415||43043<=b&&b<=43044||b==43047||43136<=b&&b<=43137||43188<=b&&b<=43203||43346<=b&&b<=43347||b==43395||43444<=b&&b<=43445||43450<=b&&b<=43451||43453<=b&&b<=43456||43567<=b&&b<=43568||43571<=b&&b<=43572||b==43597||b==43755||43758<=b&&b<=43759||b==43765||44003<=b&&b<=44004||44006<=b&&b<=44007||44009<=b&&b<=44010||b==44012||b==69632||b==69634||b==69762||69808<=b&&b<=69810||69815<=b&&b<=69816||b==69932||b==70018||70067<=b&&b<=70069||70079<=b&&b<=70080||70188<=b&&b<=70190||70194<=b&&b<=70195||b==70197||70368<=b&&b<=70370||70402<=b&&b<=70403||b==70463||70465<=b&&b<=70468||70471<=b&&b<=70472||70475<=b&&b<=70477||70498<=b&&b<=70499||70709<=b&&b<=70711||70720<=b&&b<=70721||b==70725||70833<=b&&b<=70834||b==70841||70843<=b&&b<=70844||b==70846||b==70849||71088<=b&&b<=71089||71096<=b&&b<=71099||b==71102||71216<=b&&b<=71218||71227<=b&&b<=71228||b==71230||b==71340||71342<=b&&b<=71343||b==71350||71456<=b&&b<=71457||b==71462||72199<=b&&b<=72200||b==72249||72279<=b&&b<=72280||b==72343||b==72751||b==72766||b==72873||b==72881||b==72884||94033<=b&&b<=94078||b==119142||b==119149?r:4352<=b&&b<=4447||43360<=b&&b<=43388?s:4448<=b&&b<=4519||55216<=b&&b<=55238?a:4520<=b&&b<=4607||55243<=b&&b<=55291?c:b==44032||b==44060||b==44088||b==44116||b==44144||b==44172||b==44200||b==44228||b==44256||b==44284||b==44312||b==44340||b==44368||b==44396||b==44424||b==44452||b==44480||b==44508||b==44536||b==44564||b==44592||b==44620||b==44648||b==44676||b==44704||b==44732||b==44760||b==44788||b==44816||b==44844||b==44872||b==44900||b==44928||b==44956||b==44984||b==45012||b==45040||b==45068||b==45096||b==45124||b==45152||b==45180||b==45208||b==45236||b==45264||b==45292||b==45320||b==45348||b==45376||b==45404||b==45432||b==45460||b==45488||b==45516||b==45544||b==45572||b==45600||b==45628||b==45656||b==45684||b==45712||b==45740||b==45768||b==45796||b==45824||b==45852||b==45880||b==45908||b==45936||b==45964||b==45992||b==46020||b==46048||b==46076||b==46104||b==46132||b==46160||b==46188||b==46216||b==46244||b==46272||b==46300||b==46328||b==46356||b==46384||b==46412||b==46440||b==46468||b==46496||b==46524||b==46552||b==46580||b==46608||b==46636||b==46664||b==46692||b==46720||b==46748||b==46776||b==46804||b==46832||b==46860||b==46888||b==46916||b==46944||b==46972||b==47e3||b==47028||b==47056||b==47084||b==47112||b==47140||b==47168||b==47196||b==47224||b==47252||b==47280||b==47308||b==47336||b==47364||b==47392||b==47420||b==47448||b==47476||b==47504||b==47532||b==47560||b==47588||b==47616||b==47644||b==47672||b==47700||b==47728||b==47756||b==47784||b==47812||b==47840||b==47868||b==47896||b==47924||b==47952||b==47980||b==48008||b==48036||b==48064||b==48092||b==48120||b==48148||b==48176||b==48204||b==48232||b==48260||b==48288||b==48316||b==48344||b==48372||b==48400||b==48428||b==48456||b==48484||b==48512||b==48540||b==48568||b==48596||b==48624||b==48652||b==48680||b==48708||b==48736||b==48764||b==48792||b==48820||b==48848||b==48876||b==48904||b==48932||b==48960||b==48988||b==49016||b==49044||b==49072||b==49100||b==49128||b==49156||b==49184||b==49212||b==49240||b==49268||b==49296||b==49324||b==49352||b==49380||b==49408||b==49436||b==49464||b==49492||b==49520||b==49548||b==49576||b==49604||b==49632||b==49660||b==49688||b==49716||b==49744||b==49772||b==49800||b==49828||b==49856||b==49884||b==49912||b==49940||b==49968||b==49996||b==50024||b==50052||b==50080||b==50108||b==50136||b==50164||b==50192||b==50220||b==50248||b==50276||b==50304||b==50332||b==50360||b==50388||b==50416||b==50444||b==50472||b==50500||b==50528||b==50556||b==50584||b==50612||b==50640||b==50668||b==50696||b==50724||b==50752||b==50780||b==50808||b==50836||b==50864||b==50892||b==50920||b==50948||b==50976||b==51004||b==51032||b==51060||b==51088||b==51116||b==51144||b==51172||b==51200||b==51228||b==51256||b==51284||b==51312||b==51340||b==51368||b==51396||b==51424||b==51452||b==51480||b==51508||b==51536||b==51564||b==51592||b==51620||b==51648||b==51676||b==51704||b==51732||b==51760||b==51788||b==51816||b==51844||b==51872||b==51900||b==51928||b==51956||b==51984||b==52012||b==52040||b==52068||b==52096||b==52124||b==52152||b==52180||b==52208||b==52236||b==52264||b==52292||b==52320||b==52348||b==52376||b==52404||b==52432||b==52460||b==52488||b==52516||b==52544||b==52572||b==52600||b==52628||b==52656||b==52684||b==52712||b==52740||b==52768||b==52796||b==52824||b==52852||b==52880||b==52908||b==52936||b==52964||b==52992||b==53020||b==53048||b==53076||b==53104||b==53132||b==53160||b==53188||b==53216||b==53244||b==53272||b==53300||b==53328||b==53356||b==53384||b==53412||b==53440||b==53468||b==53496||b==53524||b==53552||b==53580||b==53608||b==53636||b==53664||b==53692||b==53720||b==53748||b==53776||b==53804||b==53832||b==53860||b==53888||b==53916||b==53944||b==53972||b==54e3||b==54028||b==54056||b==54084||b==54112||b==54140||b==54168||b==54196||b==54224||b==54252||b==54280||b==54308||b==54336||b==54364||b==54392||b==54420||b==54448||b==54476||b==54504||b==54532||b==54560||b==54588||b==54616||b==54644||b==54672||b==54700||b==54728||b==54756||b==54784||b==54812||b==54840||b==54868||b==54896||b==54924||b==54952||b==54980||b==55008||b==55036||b==55064||b==55092||b==55120||b==55148||b==55176?l:44033<=b&&b<=44059||44061<=b&&b<=44087||44089<=b&&b<=44115||44117<=b&&b<=44143||44145<=b&&b<=44171||44173<=b&&b<=44199||44201<=b&&b<=44227||44229<=b&&b<=44255||44257<=b&&b<=44283||44285<=b&&b<=44311||44313<=b&&b<=44339||44341<=b&&b<=44367||44369<=b&&b<=44395||44397<=b&&b<=44423||44425<=b&&b<=44451||44453<=b&&b<=44479||44481<=b&&b<=44507||44509<=b&&b<=44535||44537<=b&&b<=44563||44565<=b&&b<=44591||44593<=b&&b<=44619||44621<=b&&b<=44647||44649<=b&&b<=44675||44677<=b&&b<=44703||44705<=b&&b<=44731||44733<=b&&b<=44759||44761<=b&&b<=44787||44789<=b&&b<=44815||44817<=b&&b<=44843||44845<=b&&b<=44871||44873<=b&&b<=44899||44901<=b&&b<=44927||44929<=b&&b<=44955||44957<=b&&b<=44983||44985<=b&&b<=45011||45013<=b&&b<=45039||45041<=b&&b<=45067||45069<=b&&b<=45095||45097<=b&&b<=45123||45125<=b&&b<=45151||45153<=b&&b<=45179||45181<=b&&b<=45207||45209<=b&&b<=45235||45237<=b&&b<=45263||45265<=b&&b<=45291||45293<=b&&b<=45319||45321<=b&&b<=45347||45349<=b&&b<=45375||45377<=b&&b<=45403||45405<=b&&b<=45431||45433<=b&&b<=45459||45461<=b&&b<=45487||45489<=b&&b<=45515||45517<=b&&b<=45543||45545<=b&&b<=45571||45573<=b&&b<=45599||45601<=b&&b<=45627||45629<=b&&b<=45655||45657<=b&&b<=45683||45685<=b&&b<=45711||45713<=b&&b<=45739||45741<=b&&b<=45767||45769<=b&&b<=45795||45797<=b&&b<=45823||45825<=b&&b<=45851||45853<=b&&b<=45879||45881<=b&&b<=45907||45909<=b&&b<=45935||45937<=b&&b<=45963||45965<=b&&b<=45991||45993<=b&&b<=46019||46021<=b&&b<=46047||46049<=b&&b<=46075||46077<=b&&b<=46103||46105<=b&&b<=46131||46133<=b&&b<=46159||46161<=b&&b<=46187||46189<=b&&b<=46215||46217<=b&&b<=46243||46245<=b&&b<=46271||46273<=b&&b<=46299||46301<=b&&b<=46327||46329<=b&&b<=46355||46357<=b&&b<=46383||46385<=b&&b<=46411||46413<=b&&b<=46439||46441<=b&&b<=46467||46469<=b&&b<=46495||46497<=b&&b<=46523||46525<=b&&b<=46551||46553<=b&&b<=46579||46581<=b&&b<=46607||46609<=b&&b<=46635||46637<=b&&b<=46663||46665<=b&&b<=46691||46693<=b&&b<=46719||46721<=b&&b<=46747||46749<=b&&b<=46775||46777<=b&&b<=46803||46805<=b&&b<=46831||46833<=b&&b<=46859||46861<=b&&b<=46887||46889<=b&&b<=46915||46917<=b&&b<=46943||46945<=b&&b<=46971||46973<=b&&b<=46999||47001<=b&&b<=47027||47029<=b&&b<=47055||47057<=b&&b<=47083||47085<=b&&b<=47111||47113<=b&&b<=47139||47141<=b&&b<=47167||47169<=b&&b<=47195||47197<=b&&b<=47223||47225<=b&&b<=47251||47253<=b&&b<=47279||47281<=b&&b<=47307||47309<=b&&b<=47335||47337<=b&&b<=47363||47365<=b&&b<=47391||47393<=b&&b<=47419||47421<=b&&b<=47447||47449<=b&&b<=47475||47477<=b&&b<=47503||47505<=b&&b<=47531||47533<=b&&b<=47559||47561<=b&&b<=47587||47589<=b&&b<=47615||47617<=b&&b<=47643||47645<=b&&b<=47671||47673<=b&&b<=47699||47701<=b&&b<=47727||47729<=b&&b<=47755||47757<=b&&b<=47783||47785<=b&&b<=47811||47813<=b&&b<=47839||47841<=b&&b<=47867||47869<=b&&b<=47895||47897<=b&&b<=47923||47925<=b&&b<=47951||47953<=b&&b<=47979||47981<=b&&b<=48007||48009<=b&&b<=48035||48037<=b&&b<=48063||48065<=b&&b<=48091||48093<=b&&b<=48119||48121<=b&&b<=48147||48149<=b&&b<=48175||48177<=b&&b<=48203||48205<=b&&b<=48231||48233<=b&&b<=48259||48261<=b&&b<=48287||48289<=b&&b<=48315||48317<=b&&b<=48343||48345<=b&&b<=48371||48373<=b&&b<=48399||48401<=b&&b<=48427||48429<=b&&b<=48455||48457<=b&&b<=48483||48485<=b&&b<=48511||48513<=b&&b<=48539||48541<=b&&b<=48567||48569<=b&&b<=48595||48597<=b&&b<=48623||48625<=b&&b<=48651||48653<=b&&b<=48679||48681<=b&&b<=48707||48709<=b&&b<=48735||48737<=b&&b<=48763||48765<=b&&b<=48791||48793<=b&&b<=48819||48821<=b&&b<=48847||48849<=b&&b<=48875||48877<=b&&b<=48903||48905<=b&&b<=48931||48933<=b&&b<=48959||48961<=b&&b<=48987||48989<=b&&b<=49015||49017<=b&&b<=49043||49045<=b&&b<=49071||49073<=b&&b<=49099||49101<=b&&b<=49127||49129<=b&&b<=49155||49157<=b&&b<=49183||49185<=b&&b<=49211||49213<=b&&b<=49239||49241<=b&&b<=49267||49269<=b&&b<=49295||49297<=b&&b<=49323||49325<=b&&b<=49351||49353<=b&&b<=49379||49381<=b&&b<=49407||49409<=b&&b<=49435||49437<=b&&b<=49463||49465<=b&&b<=49491||49493<=b&&b<=49519||49521<=b&&b<=49547||49549<=b&&b<=49575||49577<=b&&b<=49603||49605<=b&&b<=49631||49633<=b&&b<=49659||49661<=b&&b<=49687||49689<=b&&b<=49715||49717<=b&&b<=49743||49745<=b&&b<=49771||49773<=b&&b<=49799||49801<=b&&b<=49827||49829<=b&&b<=49855||49857<=b&&b<=49883||49885<=b&&b<=49911||49913<=b&&b<=49939||49941<=b&&b<=49967||49969<=b&&b<=49995||49997<=b&&b<=50023||50025<=b&&b<=50051||50053<=b&&b<=50079||50081<=b&&b<=50107||50109<=b&&b<=50135||50137<=b&&b<=50163||50165<=b&&b<=50191||50193<=b&&b<=50219||50221<=b&&b<=50247||50249<=b&&b<=50275||50277<=b&&b<=50303||50305<=b&&b<=50331||50333<=b&&b<=50359||50361<=b&&b<=50387||50389<=b&&b<=50415||50417<=b&&b<=50443||50445<=b&&b<=50471||50473<=b&&b<=50499||50501<=b&&b<=50527||50529<=b&&b<=50555||50557<=b&&b<=50583||50585<=b&&b<=50611||50613<=b&&b<=50639||50641<=b&&b<=50667||50669<=b&&b<=50695||50697<=b&&b<=50723||50725<=b&&b<=50751||50753<=b&&b<=50779||50781<=b&&b<=50807||50809<=b&&b<=50835||50837<=b&&b<=50863||50865<=b&&b<=50891||50893<=b&&b<=50919||50921<=b&&b<=50947||50949<=b&&b<=50975||50977<=b&&b<=51003||51005<=b&&b<=51031||51033<=b&&b<=51059||51061<=b&&b<=51087||51089<=b&&b<=51115||51117<=b&&b<=51143||51145<=b&&b<=51171||51173<=b&&b<=51199||51201<=b&&b<=51227||51229<=b&&b<=51255||51257<=b&&b<=51283||51285<=b&&b<=51311||51313<=b&&b<=51339||51341<=b&&b<=51367||51369<=b&&b<=51395||51397<=b&&b<=51423||51425<=b&&b<=51451||51453<=b&&b<=51479||51481<=b&&b<=51507||51509<=b&&b<=51535||51537<=b&&b<=51563||51565<=b&&b<=51591||51593<=b&&b<=51619||51621<=b&&b<=51647||51649<=b&&b<=51675||51677<=b&&b<=51703||51705<=b&&b<=51731||51733<=b&&b<=51759||51761<=b&&b<=51787||51789<=b&&b<=51815||51817<=b&&b<=51843||51845<=b&&b<=51871||51873<=b&&b<=51899||51901<=b&&b<=51927||51929<=b&&b<=51955||51957<=b&&b<=51983||51985<=b&&b<=52011||52013<=b&&b<=52039||52041<=b&&b<=52067||52069<=b&&b<=52095||52097<=b&&b<=52123||52125<=b&&b<=52151||52153<=b&&b<=52179||52181<=b&&b<=52207||52209<=b&&b<=52235||52237<=b&&b<=52263||52265<=b&&b<=52291||52293<=b&&b<=52319||52321<=b&&b<=52347||52349<=b&&b<=52375||52377<=b&&b<=52403||52405<=b&&b<=52431||52433<=b&&b<=52459||52461<=b&&b<=52487||52489<=b&&b<=52515||52517<=b&&b<=52543||52545<=b&&b<=52571||52573<=b&&b<=52599||52601<=b&&b<=52627||52629<=b&&b<=52655||52657<=b&&b<=52683||52685<=b&&b<=52711||52713<=b&&b<=52739||52741<=b&&b<=52767||52769<=b&&b<=52795||52797<=b&&b<=52823||52825<=b&&b<=52851||52853<=b&&b<=52879||52881<=b&&b<=52907||52909<=b&&b<=52935||52937<=b&&b<=52963||52965<=b&&b<=52991||52993<=b&&b<=53019||53021<=b&&b<=53047||53049<=b&&b<=53075||53077<=b&&b<=53103||53105<=b&&b<=53131||53133<=b&&b<=53159||53161<=b&&b<=53187||53189<=b&&b<=53215||53217<=b&&b<=53243||53245<=b&&b<=53271||53273<=b&&b<=53299||53301<=b&&b<=53327||53329<=b&&b<=53355||53357<=b&&b<=53383||53385<=b&&b<=53411||53413<=b&&b<=53439||53441<=b&&b<=53467||53469<=b&&b<=53495||53497<=b&&b<=53523||53525<=b&&b<=53551||53553<=b&&b<=53579||53581<=b&&b<=53607||53609<=b&&b<=53635||53637<=b&&b<=53663||53665<=b&&b<=53691||53693<=b&&b<=53719||53721<=b&&b<=53747||53749<=b&&b<=53775||53777<=b&&b<=53803||53805<=b&&b<=53831||53833<=b&&b<=53859||53861<=b&&b<=53887||53889<=b&&b<=53915||53917<=b&&b<=53943||53945<=b&&b<=53971||53973<=b&&b<=53999||54001<=b&&b<=54027||54029<=b&&b<=54055||54057<=b&&b<=54083||54085<=b&&b<=54111||54113<=b&&b<=54139||54141<=b&&b<=54167||54169<=b&&b<=54195||54197<=b&&b<=54223||54225<=b&&b<=54251||54253<=b&&b<=54279||54281<=b&&b<=54307||54309<=b&&b<=54335||54337<=b&&b<=54363||54365<=b&&b<=54391||54393<=b&&b<=54419||54421<=b&&b<=54447||54449<=b&&b<=54475||54477<=b&&b<=54503||54505<=b&&b<=54531||54533<=b&&b<=54559||54561<=b&&b<=54587||54589<=b&&b<=54615||54617<=b&&b<=54643||54645<=b&&b<=54671||54673<=b&&b<=54699||54701<=b&&b<=54727||54729<=b&&b<=54755||54757<=b&&b<=54783||54785<=b&&b<=54811||54813<=b&&b<=54839||54841<=b&&b<=54867||54869<=b&&b<=54895||54897<=b&&b<=54923||54925<=b&&b<=54951||54953<=b&&b<=54979||54981<=b&&b<=55007||55009<=b&&b<=55035||55037<=b&&b<=55063||55065<=b&&b<=55091||55093<=b&&b<=55119||55121<=b&&b<=55147||55149<=b&&b<=55175||55177<=b&&b<=55203?u:b==9757||b==9977||9994<=b&&b<=9997||b==127877||127938<=b&&b<=127940||b==127943||127946<=b&&b<=127948||128066<=b&&b<=128067||128070<=b&&b<=128080||b==128110||128112<=b&&b<=128120||b==128124||128129<=b&&b<=128131||128133<=b&&b<=128135||b==128170||128372<=b&&b<=128373||b==128378||b==128400||128405<=b&&b<=128406||128581<=b&&b<=128583||128587<=b&&b<=128591||b==128675||128692<=b&&b<=128694||b==128704||b==128716||129304<=b&&b<=129308||129310<=b&&b<=129311||b==129318||129328<=b&&b<=129337||129341<=b&&b<=129342||129489<=b&&b<=129501?y:127995<=b&&b<=127999?f:b==8205?x:b==9792||b==9794||9877<=b&&b<=9878||b==9992||b==10084||b==127752||b==127806||b==127859||b==127891||b==127908||b==127912||b==127979||b==127981||b==128139||128187<=b&&b<=128188||b==128295||b==128300||b==128488||b==128640||b==128658?_:128102<=b&&b<=128105?C:m}return this}typeof l5<"u"&&l5.exports&&(l5.exports=ADe)});var rse=yc((eIn,OO)=>{"use strict";var tIn=T(S());OO.exports=b5;OO.exports.default=b5;function b5(e,t,n){n=n||2;var i=t&&t.length,o=i?t[0]*n:e.length,r=nse(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;var a,c,l,u,m,p,y;if(i&&(r=k3e(e,t,r,n)),e.length>80*n){a=l=e[0],c=u=e[1];for(var f=n;f<o;f+=n)m=e[f],p=e[f+1],m<a&&(a=m),p<c&&(c=p),m>l&&(l=m),p>u&&(u=p);y=Math.max(l-a,u-c),y=y!==0?32767/y:0}return LW(r,s,n,a,c,y,0),s}function nse(e,t,n,i,o){var r,s;if(o===YO(e,t,n,i)>0)for(r=t;r<n;r+=i)s=tse(r,e[r],e[r+1],s);else for(r=n-i;r>=t;r-=i)s=tse(r,e[r],e[r+1],s);return s&&y5(s,s.next)&&(ZW(s),s=s.next),s}function $x(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(y5(n,n.next)||Sr(n.prev,n,n.next)===0)){if(ZW(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function LW(e,t,n,i,o,r,s){if(e){!s&&r&&K3e(e,i,o,r);for(var a=e,c,l;e.prev!==e.next;){if(c=e.prev,l=e.next,r?M3e(e,i,o,r):A3e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),ZW(e),e=l.next,a=l.next;continue}if(e=l,e===a){s?s===1?(e=N3e($x(e),t,n),LW(e,t,n,i,o,r,2)):s===2&&U3e(e,t,n,i,o,r):LW($x(e),t,n,i,o,r,1);break}}}}function A3e(e){var t=e.prev,n=e,i=e.next;if(Sr(t,n,i)>=0)return!1;for(var o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,l=i.y,u=o<r?o<s?o:s:r<s?r:s,m=a<c?a<l?a:l:c<l?c:l,p=o>r?o>s?o:s:r>s?r:s,y=a>c?a>l?a:l:c>l?c:l,f=i.next;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=y&&hC(o,a,r,c,s,l,f.x,f.y)&&Sr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function M3e(e,t,n,i){var o=e.prev,r=e,s=e.next;if(Sr(o,r,s)>=0)return!1;for(var a=o.x,c=r.x,l=s.x,u=o.y,m=r.y,p=s.y,y=a<c?a<l?a:l:c<l?c:l,f=u<m?u<p?u:p:m<p?m:p,x=a>c?a>l?a:l:c>l?c:l,_=u>m?u>p?u:p:m>p?m:p,C=DO(y,f,t,n,i),V=DO(x,_,t,n,i),L=e.prevZ,Z=e.nextZ;L&&L.z>=C&&Z&&Z.z<=V;){if(L.x>=y&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&hC(a,u,c,m,l,p,L.x,L.y)&&Sr(L.prev,L,L.next)>=0||(L=L.prevZ,Z.x>=y&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&hC(a,u,c,m,l,p,Z.x,Z.y)&&Sr(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;L&&L.z>=C;){if(L.x>=y&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&hC(a,u,c,m,l,p,L.x,L.y)&&Sr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;Z&&Z.z<=V;){if(Z.x>=y&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&hC(a,u,c,m,l,p,Z.x,Z.y)&&Sr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function N3e(e,t,n){var i=e;do{var o=i.prev,r=i.next.next;!y5(o,r)&&ise(o,i,i.next,r)&&RW(o,r)&&RW(r,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),ZW(i),ZW(i.next),i=e=r),i=i.next}while(i!==e);return $x(i)}function U3e(e,t,n,i,o,r){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&J3e(s,a)){var c=ose(s,a);s=$x(s,s.next),c=$x(c,c.next),LW(s,t,n,i,o,r,0),LW(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function k3e(e,t,n,i){var o=[],r,s,a,c,l;for(r=0,s=t.length;r<s;r++)a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,l=nse(e,a,c,i,!1),l===l.next&&(l.steiner=!0),o.push(z3e(l));for(o.sort(D3e),r=0;r<o.length;r++)n=B3e(o[r],n);return n}function D3e(e,t){return e.x-t.x}function B3e(e,t){var n=Y3e(e,t);if(!n)return t;var i=ose(n,e);return $x(i,i.next),$x(n,n.next)}function Y3e(e,t){var n=t,i=e.x,o=e.y,r=-1/0,s;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>r&&(r=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,l=s.x,u=s.y,m=1/0,p;n=s;do i>=n.x&&n.x>=l&&i!==n.x&&hC(o<u?i:r,o,l,u,o<u?r:i,o,n.x,n.y)&&(p=Math.abs(o-n.y)/(i-n.x),RW(n,e)&&(p<m||p===m&&(n.x>s.x||n.x===s.x&&O3e(s,n)))&&(s=n,m=p)),n=n.next;while(n!==c);return s}function O3e(e,t){return Sr(e.prev,e,t.prev)<0&&Sr(t.next,e,e.next)<0}function K3e(e,t,n,i){var o=e;do o.z===0&&(o.z=DO(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,H3e(o)}function H3e(e){var t,n,i,o,r,s,a,c,l=1;do{for(n=e,e=null,r=null,s=0;n;){for(s++,i=n,a=0,t=0;t<l&&(a++,i=i.nextZ,!!i);t++);for(c=l;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(o=n,n=n.nextZ,a--):(o=i,i=i.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;n=i}r.nextZ=null,l*=2}while(s>1);return e}function DO(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function z3e(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function hC(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function J3e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Q3e(e,t)&&(RW(e,t)&&RW(t,e)&&j3e(e,t)&&(Sr(e.prev,e,t.prev)||Sr(e,t.prev,t))||y5(e,t)&&Sr(e.prev,e,e.next)>0&&Sr(t.prev,t,t.next)>0)}function Sr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function y5(e,t){return e.x===t.x&&e.y===t.y}function ise(e,t,n,i){var o=p5(Sr(e,t,n)),r=p5(Sr(e,t,i)),s=p5(Sr(n,i,e)),a=p5(Sr(n,i,t));return!!(o!==r&&s!==a||o===0&&f5(e,n,t)||r===0&&f5(e,i,t)||s===0&&f5(n,e,i)||a===0&&f5(n,t,i))}function f5(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function p5(e){return e>0?1:e<0?-1:0}function Q3e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ise(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function RW(e,t){return Sr(e.prev,e,e.next)<0?Sr(e,t,e.next)>=0&&Sr(e,e.prev,t)>=0:Sr(e,t,e.prev)<0||Sr(e,e.next,t)<0}function j3e(e,t){var n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function ose(e,t){var n=new BO(e.i,e.x,e.y),i=new BO(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function tse(e,t,n,i){var o=new BO(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function ZW(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function BO(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}b5.deviation=function(e,t,n,i){var o=t&&t.length,r=o?t[0]*n:e.length,s=Math.abs(YO(e,0,r,n));if(o)for(var a=0,c=t.length;a<c;a++){var l=t[a]*n,u=a<c-1?t[a+1]*n:e.length;s-=Math.abs(YO(e,l,u,n))}var m=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,y=i[a+1]*n,f=i[a+2]*n;m+=Math.abs((e[p]-e[f])*(e[y+1]-e[p+1])-(e[p]-e[y])*(e[f+1]-e[p+1]))}return s===0&&m===0?0:Math.abs((m-s)/s)};function YO(e,t,n,i){for(var o=0,r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}b5.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,o=0;o<e.length;o++){for(var r=0;r<e[o].length;r++)for(var s=0;s<t;s++)n.vertices.push(e[o][r][s]);o>0&&(i+=e[o-1].length,n.holes.push(i))}return n}});var Gde=yc((xH,_H)=>{var Njn=T(S());(function(e,t){typeof xH=="object"&&typeof _H<"u"?_H.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(xH,function(){"use strict";function e(_,C,V,L,Z){(function G(X,P,v,A,M){for(;A>v;){if(A-v>600){var b=A-v+1,R=P-v+1,E=Math.log(b),I=.5*Math.exp(2*E/3),w=.5*Math.sqrt(E*I*(b-I)/b)*(R-b/2<0?-1:1),N=Math.max(v,Math.floor(P-R*I/b+w)),Y=Math.min(A,Math.floor(P+(b-R)*I/b+w));G(X,P,N,Y,M)}var k=X[P],O=v,U=A;for(t(X,v,P),M(X[A],k)>0&&t(X,v,A);O<U;){for(t(X,O,U),O++,U--;M(X[O],k)<0;)O++;for(;M(X[U],k)>0;)U--}M(X[v],k)===0?t(X,v,U):t(X,++U,A),U<=P&&(v=U+1),P<=U&&(A=U-1)}})(_,C,V||0,L||_.length-1,Z||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _<C?-1:_>C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L<C.length;L++)if(V(_,C[L]))return L;return-1}function r(_,C){s(_,0,_.children.length,C,_)}function s(_,C,V,L,Z){Z||(Z=f(null)),Z.minX=1/0,Z.minY=1/0,Z.maxX=-1/0,Z.maxY=-1/0;for(var G=C;G<V;G++){var X=_.children[G];a(Z,_.leaf?L(X):X)}return Z}function a(_,C){return _.minX=Math.min(_.minX,C.minX),_.minY=Math.min(_.minY,C.minY),_.maxX=Math.max(_.maxX,C.maxX),_.maxY=Math.max(_.maxY,C.maxY),_}function c(_,C){return _.minX-C.minX}function l(_,C){return _.minY-C.minY}function u(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function m(_){return _.maxX-_.minX+(_.maxY-_.minY)}function p(_,C){return _.minX<=C.minX&&_.minY<=C.minY&&C.maxX<=_.maxX&&C.maxY<=_.maxY}function y(_,C){return C.minX<=_.maxX&&C.minY<=_.maxY&&C.maxX>=_.minX&&C.maxY>=_.minY}function f(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,Z){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var X=C+Math.ceil((V-C)/L/2)*L;e(_,X,C,V,Z),G.push(C,X,X,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!y(_,C))return V;for(var L=this.toBBox,Z=[];C;){for(var G=0;G<C.children.length;G++){var X=C.children[G],P=C.leaf?L(X):X;y(_,P)&&(C.leaf?V.push(X):p(_,P)?this._all(X,V):Z.push(X))}C=Z.pop()}return V},i.prototype.collides=function(_){var C=this.data;if(!y(_,C))return!1;for(var V=[];C;){for(var L=0;L<C.children.length;L++){var Z=C.children[L],G=C.leaf?this.toBBox(Z):Z;if(y(_,G)){if(C.leaf||p(_,G))return!0;V.push(Z)}}C=V.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var C=0;C<_.length;C++)this.insert(_[C]);return this}var V=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===V.height)this._splitRoot(this.data,V);else{if(this.data.height<V.height){var L=this.data;this.data=V,V=L}this._insert(V,this.data.height-V.height-1,!0)}else this.data=V;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(_,C){if(!_)return this;for(var V,L,Z,G=this.data,X=this.toBBox(_),P=[],v=[];G||P.length;){if(G||(G=P.pop(),L=P[P.length-1],V=v.pop(),Z=!0),G.leaf){var A=o(_,G.children,C);if(A!==-1)return G.children.splice(A,1),P.push(G),this._condense(P),this}Z||G.leaf||!p(G,X)?L?(V++,G=L.children[V],Z=!1):G=null:(P.push(G),v.push(V),V=0,L=G,G=G.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,C){return _.minX-C.minX},i.prototype.compareMinY=function(_,C){return _.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,C){for(var V=[];_;)_.leaf?C.push.apply(C,_.children):V.push.apply(V,_.children),_=V.pop();return C},i.prototype._build=function(_,C,V,L){var Z,G=V-C+1,X=this._maxEntries;if(G<=X)return r(Z=f(_.slice(C,V+1)),this.toBBox),Z;L||(L=Math.ceil(Math.log(G)/Math.log(X)),X=Math.ceil(G/Math.pow(X,L-1))),(Z=f([])).leaf=!1,Z.height=L;var P=Math.ceil(G/X),v=P*Math.ceil(Math.sqrt(X));x(_,C,V,v,this.compareMinX);for(var A=C;A<=V;A+=v){var M=Math.min(A+v-1,V);x(_,A,M,P,this.compareMinY);for(var b=A;b<=M;b+=P){var R=Math.min(b+P-1,M);Z.children.push(this._build(_,b,R,L-1))}}return r(Z,this.toBBox),Z},i.prototype._chooseSubtree=function(_,C,V,L){for(;L.push(C),!C.leaf&&L.length-1!==V;){for(var Z=1/0,G=1/0,X=void 0,P=0;P<C.children.length;P++){var v=C.children[P],A=u(v),M=(b=_,R=v,(Math.max(R.maxX,b.maxX)-Math.min(R.minX,b.minX))*(Math.max(R.maxY,b.maxY)-Math.min(R.minY,b.minY))-A);M<G?(G=M,Z=A<Z?A:Z,X=v):M===G&&A<Z&&(Z=A,X=v)}C=X||C.children[0]}var b,R;return C},i.prototype._insert=function(_,C,V){var L=V?_:this.toBBox(_),Z=[],G=this._chooseSubtree(L,this.data,C,Z);for(G.children.push(_),a(G,L);C>=0&&Z[C].children.length>this._maxEntries;)this._split(Z,C),C--;this._adjustParentBBoxes(L,Z,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,Z=this._minEntries;this._chooseSplitAxis(V,Z,L);var G=this._chooseSplitIndex(V,Z,L),X=f(V.children.splice(G,V.children.length-G));X.height=V.height,X.leaf=V.leaf,r(V,this.toBBox),r(X,this.toBBox),C?_[C-1].children.push(X):this._splitRoot(V,X)},i.prototype._splitRoot=function(_,C){this.data=f([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,Z,G,X,P,v,A,M=1/0,b=1/0,R=C;R<=V-C;R++){var E=s(_,0,R,this.toBBox),I=s(_,R,V,this.toBBox),w=(Z=E,G=I,X=void 0,P=void 0,v=void 0,A=void 0,X=Math.max(Z.minX,G.minX),P=Math.max(Z.minY,G.minY),v=Math.min(Z.maxX,G.maxX),A=Math.min(Z.maxY,G.maxY),Math.max(0,v-X)*Math.max(0,A-P)),N=u(E)+u(I);w<M?(M=w,L=R,b=N<b?N:b):w===M&&N<b&&(b=N,L=R)}return L||V-C},i.prototype._chooseSplitAxis=function(_,C,V){var L=_.leaf?this.compareMinX:c,Z=_.leaf?this.compareMinY:l;this._allDistMargin(_,C,V,L)<this._allDistMargin(_,C,V,Z)&&_.children.sort(L)},i.prototype._allDistMargin=function(_,C,V,L){_.children.sort(L);for(var Z=this.toBBox,G=s(_,0,C,Z),X=s(_,V-C,V,Z),P=m(G)+m(X),v=C;v<V-C;v++){var A=_.children[v];a(G,_.leaf?Z(A):A),P+=m(G)}for(var M=V-C-1;M>=C;M--){var b=_.children[M];a(X,_.leaf?Z(b):b),P+=m(X)}return P},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var y4=yc((exports,module)=>{var IFi=T(S());/*!
 * protobuf.js v7.2.5 (c) 2016, daniel wirtz
 * compiled tue, 22 aug 2023 00:04:28 utc
 * licensed under the bsd-3-clause license
 * see: https://github.com/dcodeio/protobuf.js for details
 */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,l=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(m,p){s[a]=function(f){if(l)if(l=!1,f)p(f);else{for(var x=new Array(arguments.length-1),_=0;_<x.length;)x[_++]=arguments[_];m.apply(null,x)}};try{o.apply(r||null,s)}catch(y){l&&(l=!1,p(y))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(l){var u=l.length;if(!u)return 0;for(var m=0;--u%4>1&&l.charAt(u)==="=";)++m;return Math.ceil(l.length*3)/4-m};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(l,u,m){for(var p=null,y=[],f=0,x=0,_;u<m;){var C=l[u++];switch(x){case 0:y[f++]=o[C>>2],_=(C&3)<<4,x=1;break;case 1:y[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:y[f++]=o[_|C>>6],y[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,y)),f=0)}return x&&(y[f++]=o[_],y[f++]=61,x===1&&(y[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,y.slice(0,f))),p.join("")):String.fromCharCode.apply(String,y.slice(0,f))};var a="invalid encoding";i.decode=function(l,u,m){for(var p=m,y=0,f,x=0;x<l.length;){var _=l.charCodeAt(x++);if(_===61&&y>1)break;if((_=r[_])===undefined)throw Error(a);switch(y){case 0:f=_,y=1;break;case 1:u[m++]=f<<2|(_&48)>>4,f=_,y=2;break;case 2:u[m++]=(f&15)<<4|(_&60)>>2,f=_,y=3;break;case 3:u[m++]=(f&3)<<6|_,y=0;break}}if(y===1)throw Error(a);return m-p},i.test=function(l){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(l)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var l=new Float32Array([-0]),u=new Uint8Array(l.buffer),m=u[3]===128;function p(_,C,V){l[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3]}function y(_,C,V){l[0]=_,C[V]=u[3],C[V+1]=u[2],C[V+2]=u[1],C[V+3]=u[0]}c.writeFloatLE=m?p:y,c.writeFloatBE=m?y:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],l[0]}function x(_,C){return u[3]=_[C],u[2]=_[C+1],u[1]=_[C+2],u[0]=_[C+3],l[0]}c.readFloatLE=m?f:x,c.readFloatBE=m?x:f}():function(){function l(m,p,y,f){var x=p<0?1:0;if(x&&(p=-p),p===0)m(1/p>0?0:2147483648,y,f);else if(isNaN(p))m(2143289344,y,f);else if(p>34028234663852886e22)m((x<<31|2139095040)>>>0,y,f);else if(p<11754943508222875e-54)m((x<<31|Math.round(p/1401298464324817e-60))>>>0,y,f);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;m((x<<31|_+127<<23|C)>>>0,y,f)}}c.writeFloatLE=l.bind(null,o),c.writeFloatBE=l.bind(null,r);function u(m,p,y){var f=m(p,y),x=(f>>31)*2+1,_=f>>>23&255,C=f&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var l=new Float64Array([-0]),u=new Uint8Array(l.buffer),m=u[7]===128;function p(_,C,V){l[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3],C[V+4]=u[4],C[V+5]=u[5],C[V+6]=u[6],C[V+7]=u[7]}function y(_,C,V){l[0]=_,C[V]=u[7],C[V+1]=u[6],C[V+2]=u[5],C[V+3]=u[4],C[V+4]=u[3],C[V+5]=u[2],C[V+6]=u[1],C[V+7]=u[0]}c.writeDoubleLE=m?p:y,c.writeDoubleBE=m?y:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],u[4]=_[C+4],u[5]=_[C+5],u[6]=_[C+6],u[7]=_[C+7],l[0]}function x(_,C){return u[7]=_[C],u[6]=_[C+1],u[5]=_[C+2],u[4]=_[C+3],u[3]=_[C+4],u[2]=_[C+5],u[1]=_[C+6],u[0]=_[C+7],l[0]}c.readDoubleLE=m?f:x,c.readDoubleBE=m?x:f}():function(){function l(m,p,y,f,x,_){var C=f<0?1:0;if(C&&(f=-f),f===0)m(0,x,_+p),m(1/f>0?0:2147483648,x,_+y);else if(isNaN(f))m(0,x,_+p),m(2146959360,x,_+y);else if(f>17976931348623157e292)m(0,x,_+p),m((C<<31|2146435072)>>>0,x,_+y);else{var V;if(f<22250738585072014e-324)V=f/5e-324,m(V>>>0,x,_+p),m((C<<31|V/4294967296)>>>0,x,_+y);else{var L=Math.floor(Math.log(f)/Math.LN2);L===1024&&(L=1023),V=f*Math.pow(2,-L),m(V*4503599627370496>>>0,x,_+p),m((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+y)}}}c.writeDoubleLE=l.bind(null,o,0,4),c.writeDoubleBE=l.bind(null,r,4,0);function u(m,p,y,f,x){var _=m(f,x+p),C=m(f,x+y),V=(C>>31)*2+1,L=C>>>20&2047,Z=4294967296*(C&1048575)+_;return L===2047?Z?NaN:V*(1/0):L===0?V*5e-324*Z:V*Math.pow(2,L-1075)*(Z+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,l,u){l[u]=c&255,l[u+1]=c>>>8&255,l[u+2]=c>>>16&255,l[u+3]=c>>>24}function r(c,l,u){l[u]=c>>>24,l[u+1]=c>>>16&255,l[u+2]=c>>>8&255,l[u+3]=c&255}function s(c,l){return(c[l]|c[l+1]<<8|c[l+2]<<16|c[l+3]<<24)>>>0}function a(c,l){return(c[l]<<24|c[l+1]<<16|c[l+2]<<8|c[l+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,l=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(l=o(a),u=0);var y=r.call(l,u,u+=p);return u&7&&(u=(u|7)+1),y}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var l=null,u=[],m=0,p;s<a;)p=r[s++],p<128?u[m++]=p:p>191&&p<224?u[m++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[m++]=55296+(p>>10),u[m++]=56320+(p&1023)):u[m++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,m>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,u)),m=0);return l?(m&&l.push(String.fromCharCode.apply(String,u.slice(0,m))),l.join("")):String.fromCharCode.apply(String,u.slice(0,m))},i.write=function(r,s,a){for(var c=a,l,u,m=0;m<r.length;++m)l=r.charCodeAt(m),l<128?s[a++]=l:l<2048?(s[a++]=l>>6|192,s[a++]=l&63|128):(l&64512)===55296&&((u=r.charCodeAt(m+1))&64512)===56320?(l=65536+((l&1023)<<10)+(u&1023),++m,s[a++]=l>>18|240,s[a++]=l>>12&63|128,s[a++]=l>>6&63|128,s[a++]=l&63|128):(s[a++]=l>>12|224,s[a++]=l>>6&63|128,s[a++]=l&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,x){return RangeError("index out of range: "+f.pos+" + "+(x||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var l=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},u=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):l(V)})(_)}:l};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function m(){var f=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,f}if(this.len-this.pos>4){for(;x<5;++x)if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,x){return(f[x-4]|f[x-3]<<8|f[x-2]<<16|f[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return m.call(this)[x](!1)},uint64:function(){return m.call(this)[x](!0)},sint64:function(){return m.call(this).zzDecode()[x](!1)},fixed64:function(){return y.call(this)[x](!0)},sfixed64:function(){return y.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,l,u){if(!l)throw TypeError("request must be specified");var m=this;if(!u)return i.asPromise(r,m,s,a,c,l);if(!m.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return m.rpcImpl(s,a[m.requestDelimited?"encodeDelimited":"encode"](l).finish(),function(y,f){if(y)return m.emit("error",y,s),u(y);if(f===null)return m.end(!0),undefined;if(!(f instanceof c))try{f=c[m.responseDelimited?"decodeDelimited":"decode"](f)}catch(x){return m.emit("error",x,s),u(x)}return m.emit("data",f,s),u(null,f)})}catch(p){return m.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,l){this.lo=c>>>0,this.hi=l>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(l){if(l===0)return r;var u=l<0;u&&(l=-l);var m=l>>>0,p=(l-m)/4294967296>>>0;return u&&(p=~p>>>0,m=~m>>>0,++m>4294967295&&(m=0,++p>4294967295&&(p=0))),new o(m,p)},o.from=function(l){if(typeof l=="number")return o.fromNumber(l);if(i.isString(l))if(i.Long)l=i.Long.fromString(l);else return o.fromNumber(parseInt(l,10));return l.low||l.high?new o(l.low>>>0,l.high>>>0):r},o.prototype.toNumber=function(l){if(!l&&this.hi>>>31){var u=~this.lo+1>>>0,m=~this.hi>>>0;return u||(m=m+1>>>0),-(u+m*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(l){return i.Long?new i.Long(this.lo|0,this.hi|0,!!l):{low:this.lo|0,high:this.hi|0,unsigned:!!l}};var a=String.prototype.charCodeAt;o.fromHash=function(l){return l===s?r:new o((a.call(l,0)|a.call(l,1)<<8|a.call(l,2)<<16|a.call(l,3)<<24)>>>0,(a.call(l,4)|a.call(l,5)<<8|a.call(l,6)<<16|a.call(l,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var l=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^l)>>>0,this.lo=(this.lo<<1^l)>>>0,this},o.prototype.zzDecode=function(){var l=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^l)>>>0,this.hi=(this.hi>>>1^l)>>>0,this},o.prototype.length=function(){var l=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,m=this.hi>>>24;return m===0?u===0?l<16384?l<128?1:2:l<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:m<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var l=a[c];return l!=null&&a.hasOwnProperty(c)?typeof l!="object"||(Array.isArray(l)?l.length:Object.keys(l).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var l=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(l.lo,l.hi,c):l.toNumber(!!c)};function o(s,a,c){for(var l=Object.keys(a),u=0;u<l.length;++u)(s[l[u]]===undefined||!c)&&(s[l[u]]=a[l[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,l){if(!(this instanceof a))return new a(c,l);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),l&&o(this,l)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},l=0;l<a.length;++l)c[a[l]]=1;return function(){for(var u=Object.keys(this),m=u.length-1;m>-1;--m)if(c[u[m]]===1&&this[u[m]]!==undefined&&this[u[m]]!==null)return u[m]}},i.oneOfSetter=function(a){return function(c){for(var l=0;l<a.length;++l)a[l]!==c&&delete this[a[l]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,l){return new s(c,l)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=m;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(L,Z,G){this.fn=L,this.len=Z,this.next=undefined,this.val=G}function l(){}function u(L){this.head=L.head,this.tail=L.tail,this.len=L.len,this.next=L.states}function m(){this.len=0,this.head=new c(l,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(m.create=function(){return new o})()}:function(){return new m}};m.create=p(),m.alloc=function(Z){return new i.Array(Z)},i.Array!==Array&&(m.alloc=i.pool(m.alloc,i.Array.prototype.subarray)),m.prototype._push=function(Z,G,X){return this.tail=this.tail.next=new c(Z,G,X),this.len+=G,this};function y(L,Z,G){Z[G]=L&255}function f(L,Z,G){for(;L>127;)Z[G++]=L&127|128,L>>>=7;Z[G]=L}function x(L,Z){this.len=L,this.next=undefined,this.val=Z}x.prototype=Object.create(c.prototype),x.prototype.fn=f,m.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new x((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this},m.prototype.int32=function(Z){return Z<0?this._push(_,10,r.fromNumber(Z)):this.uint32(Z)},m.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function _(L,Z,G){for(;L.hi;)Z[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[G++]=L.lo&127|128,L.lo=L.lo>>>7;Z[G++]=L.lo}m.prototype.uint64=function(Z){var G=r.from(Z);return this._push(_,G.length(),G)},m.prototype.int64=m.prototype.uint64,m.prototype.sint64=function(Z){var G=r.from(Z).zzEncode();return this._push(_,G.length(),G)},m.prototype.bool=function(Z){return this._push(y,1,Z?1:0)};function C(L,Z,G){Z[G]=L&255,Z[G+1]=L>>>8&255,Z[G+2]=L>>>16&255,Z[G+3]=L>>>24}m.prototype.fixed32=function(Z){return this._push(C,4,Z>>>0)},m.prototype.sfixed32=m.prototype.fixed32,m.prototype.fixed64=function(Z){var G=r.from(Z);return this._push(C,4,G.lo)._push(C,4,G.hi)},m.prototype.sfixed64=m.prototype.fixed64,m.prototype.float=function(Z){return this._push(i.float.writeFloatLE,4,Z)},m.prototype.double=function(Z){return this._push(i.float.writeDoubleLE,8,Z)};var V=i.Array.prototype.set?function(Z,G,X){G.set(Z,X)}:function(Z,G,X){for(var P=0;P<Z.length;++P)G[X+P]=Z[P]};m.prototype.bytes=function(Z){var G=Z.length>>>0;if(!G)return this._push(y,1,0);if(i.isString(Z)){var X=m.alloc(G=s.length(Z));s.decode(Z,X,0),Z=X}return this.uint32(G)._push(V,G,Z)},m.prototype.string=function(Z){var G=a.length(Z);return G?this.uint32(G)._push(a.write,G,Z):this._push(y,1,0)},m.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(l,0,0),this.len=0,this},m.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(l,0,0),this.len=0),this},m.prototype.ldelim=function(){var Z=this.head,G=this.tail,X=this.len;return this.reset().uint32(X),X&&(this.tail.next=Z.next,this.tail=G,this.len+=X),this},m.prototype.finish=function(){for(var Z=this.head.next,G=this.constructor.alloc(this.len),X=0;Z;)Z.fn(Z.val,G,X),X+=Z.len,Z=Z.next;return G},m._configure=function(L){o=L,m.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,l,u){l.set(c,u)}:function(c,l,u){if(c.copy)c.copy(l,u,0,c.length);else for(var m=0;m<c.length;)l[u++]=c[m++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var l=c.length>>>0;return this.uint32(l),l&&this._push(r.writeBytesBuffer,l,c),this};function s(a,c,l){a.length<40?o.utf8.write(a,c,l):c.utf8Write?c.utf8Write(a,l):c.write(a,l)}r.prototype.string=function(c){var l=o.Buffer.byteLength(c);return this.uint32(l),l&&this._push(s,l,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var jge=yc((WDi,oD)=>{var PDi=T(S());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,y=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,x=r(y,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:y.width,height:y.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:y.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),m.returnEncodedMask&&y.mask&&(_.encodedMaskData=y.mask.bitset?y.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(y),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(y))),_};var r=function(u,m,p,y,f){var x=0,_=u.pixels.numBlocksX,C=u.pixels.numBlocksY,V=Math.floor(u.width/_),L=Math.floor(u.height/C),Z=2*u.maxZError,G=Number.MAX_VALUE,X;p=p||(u.mask?u.mask.bitset:null);var P,v;P=new m(u.width*u.height),f&&p&&(v=new Uint8Array(u.width*u.height));for(var A=new Float32Array(V*L),M,b,R=0;R<=C;R++){var E=R!==C?L:u.height%C;if(E!==0)for(var I=0;I<=_;I++){var w=I!==_?V:u.width%_;if(w!==0){var N=R*u.width*L+I*V,Y=u.width-w,k=u.pixels.blocks[x],O,U,J;k.encoding<2?(k.encoding===0?O=k.rawData:(l(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,Z,A,u.pixels.maxValue),O=A),U=0):k.encoding===2?J=0:J=k.offset;var z;if(p)for(b=0;b<E;b++){for(N&7&&(z=p[N>>3],z<<=N&7),M=0;M<w;M++)N&7||(z=p[N>>3]),z&128?(v&&(v[N]=1),X=k.encoding<2?O[U++]:J,G=G>X?X:G,P[N++]=X):(v&&(v[N]=0),P[N++]=y),z<<=1;N+=Y}else if(k.encoding<2)for(b=0;b<E;b++){for(M=0;M<w;M++)X=O[U++],G=G>X?X:G,P[N++]=X;N+=Y}else for(G=G>J?J:G,b=0;b<E;b++){for(M=0;M<w;M++)P[N++]=J;N+=Y}if(k.encoding===1&&U!==k.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:P,resultMask:v,minValue:G}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var m=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},y=0;y<m;y++){var f=u.pixels.blocks[y];f.encoding===0?p.float32=!0:f.encoding===1?p[f.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(u,m,p){var y={},f=new Uint8Array(u,m,10);if(y.fileIdentifierString=String.fromCharCode.apply(null,f),y.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+y.fileIdentifierString;m+=10;var x=new DataView(u,m,24);if(y.fileVersion=x.getInt32(0,!0),y.imageType=x.getInt32(4,!0),y.height=x.getUint32(8,!0),y.width=x.getUint32(12,!0),y.maxZError=x.getFloat64(16,!0),m+=24,!p)if(x=new DataView(u,m,16),y.mask={},y.mask.numBlocksY=x.getUint32(0,!0),y.mask.numBlocksX=x.getUint32(4,!0),y.mask.numBytes=x.getUint32(8,!0),y.mask.maxValue=x.getFloat32(12,!0),m+=16,y.mask.numBytes>0){var _=new Uint8Array(Math.ceil(y.width*y.height/8));x=new DataView(u,m,y.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var Z=x.getUint8(V++);for(C=-C;C--;)_[L++]=Z}C=x.getInt16(V,!0),V+=2}while(V<y.mask.numBytes);if(C!==-32768||L<_.length)throw"Unexpected end of mask RLE encoding";y.mask.bitset=_,m+=y.mask.numBytes}else y.mask.numBytes|y.mask.numBlocksY|y.mask.maxValue||(y.mask.bitset=new Uint8Array(Math.ceil(y.width*y.height/8)));x=new DataView(u,m,16),y.pixels={},y.pixels.numBlocksY=x.getUint32(0,!0),y.pixels.numBlocksX=x.getUint32(4,!0),y.pixels.numBytes=x.getUint32(8,!0),y.pixels.maxValue=x.getFloat32(12,!0),m+=16;var G=y.pixels.numBlocksX,X=y.pixels.numBlocksY,P=G+(y.width%G>0?1:0),v=X+(y.height%X>0?1:0);y.pixels.blocks=new Array(P*v);for(var A=0,M=0;M<v;M++)for(var b=0;b<P;b++){var R=0,E=u.byteLength-m;x=new DataView(u,m,Math.min(10,E));var I={};y.pixels.blocks[A++]=I;var w=x.getUint8(0);if(R++,I.encoding=w&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){m++;continue}if(w!==0&&w!==2){if(w>>=6,I.offsetType=w,w===2)I.offset=x.getInt8(1),R++;else if(w===1)I.offset=x.getInt16(1,!0),R+=2;else if(w===0)I.offset=x.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(I.encoding===1)if(w=x.getUint8(R),R++,I.bitsPerPixel=w&63,w>>=6,I.numValidPixelsType=w,w===2)I.numValidPixels=x.getUint8(R),R++;else if(w===1)I.numValidPixels=x.getUint16(R,!0),R+=2;else if(w===0)I.numValidPixels=x.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(m+=R,I.encoding!==3){var N,Y;if(I.encoding===0){var k=(y.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";N=new ArrayBuffer(k*4),Y=new Uint8Array(N),Y.set(new Uint8Array(u,m,k*4));var O=new Float32Array(N);I.rawData=O,m+=k*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),J=Math.ceil(U/4);N=new ArrayBuffer(J*4),Y=new Uint8Array(N),Y.set(new Uint8Array(u,m,U)),I.stuffedData=new Uint32Array(N),m+=U}}}return y.eofOffset=m,y},l=function(u,m,p,y,f,x,_){var C=(1<<m)-1,V=0,L,Z=0,G,X,P=Math.ceil((_-y)/f),v=u.length*4-Math.ceil(m*p/8);for(u[u.length-1]<<=8*v,L=0;L<p;L++){if(Z===0&&(X=u[V++],Z=32),Z>=m)G=X>>>Z-m&C,Z-=m;else{var A=m-Z;G=(X&C)<<A&C,X=u[V++],Z=32-A,G+=X>>>Z}x[L]=G<P?y+G*f:_}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,l,u,m,p,y,f,x){var _=(1<<u)-1,C=0,V,L=0,Z,G,X,P,v=c.length*4-Math.ceil(u*m/8);if(c[c.length-1]<<=8*v,p)for(V=0;V<m;V++)L===0&&(G=c[C++],L=32),L>=u?(Z=G>>>L-u&_,L-=u):(X=u-L,Z=(G&_)<<X&_,G=c[C++],L=32-X,Z+=G>>>L),l[V]=p[Z];else for(P=Math.ceil((x-y)/f),V=0;V<m;V++)L===0&&(G=c[C++],L=32),L>=u?(Z=G>>>L-u&_,L-=u):(X=u-L,Z=(G&_)<<X&_,G=c[C++],L=32-X,Z+=G>>>L),l[V]=Z<P?y+Z*f:x},unstuffLUT:function(c,l,u,m,p,y){var f=(1<<l)-1,x=0,_=0,C=0,V=0,L=0,Z,G=[],X=c.length*4-Math.ceil(l*u/8);c[c.length-1]<<=8*X;var P=Math.ceil((y-m)/p);for(_=0;_<u;_++)V===0&&(Z=c[x++],V=32),V>=l?(L=Z>>>V-l&f,V-=l):(C=l-V,L=(Z&f)<<C&f,Z=c[x++],V=32-C,L+=Z>>>V),G[_]=L<P?m+L*p:y;return G.unshift(m),G},unstuff2:function(c,l,u,m,p,y,f,x){var _=(1<<u)-1,C=0,V,L=0,Z=0,G,X,P;if(p)for(V=0;V<m;V++)L===0&&(X=c[C++],L=32,Z=0),L>=u?(G=X>>>Z&_,L-=u,Z+=u):(P=u-L,G=X>>>Z&_,X=c[C++],L=32-P,G|=(X&(1<<P)-1)<<u-P,Z=P),l[V]=p[G];else{var v=Math.ceil((x-y)/f);for(V=0;V<m;V++)L===0&&(X=c[C++],L=32,Z=0),L>=u?(G=X>>>Z&_,L-=u,Z+=u):(P=u-L,G=X>>>Z&_,X=c[C++],L=32-P,G|=(X&(1<<P)-1)<<u-P,Z=P),l[V]=G<v?y+G*f:x}return l},unstuffLUT2:function(c,l,u,m,p,y){var f=(1<<l)-1,x=0,_=0,C=0,V=0,L=0,Z=0,G,X=[],P=Math.ceil((y-m)/p);for(_=0;_<u;_++)V===0&&(G=c[x++],V=32,Z=0),V>=l?(L=G>>>Z&f,V-=l,Z+=l):(C=l-V,L=G>>>Z&f,G=c[x++],V=32-C,L|=(G&(1<<C)-1)<<l-C,Z=C),X[_]=L<P?m+L*p:y;return X.unshift(m),X},originalUnstuff:function(c,l,u,m){var p=(1<<u)-1,y=0,f,x=0,_,C,V,L=c.length*4-Math.ceil(u*m/8);for(c[c.length-1]<<=8*L,f=0;f<m;f++)x===0&&(C=c[y++],x=32),x>=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<<V&p,C=c[y++],x=32-V,_+=C>>>x),l[f]=_;return l},originalUnstuff2:function(c,l,u,m){var p=(1<<u)-1,y=0,f,x=0,_=0,C,V,L;for(f=0;f<m;f++)x===0&&(V=c[y++],x=32,_=0),x>=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[y++],x=32-L,C|=(V&(1<<L)-1)<<u-L,_=L),l[f]=C;return l}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var l=65535,u=65535,m=c.length,p=Math.floor(m/2),y=0;p;){var f=p>=359?359:p;p-=f;do l+=c[y++]<<8,u+=l+=c[y++];while(--f);l=(l&65535)+(l>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=l+=c[y]<<8),l=(l&65535)+(l>>>16),u=(u&65535)+(u>>>16),(u<<16|l)>>>0},readHeaderInfo:function(c,l){var u=l.ptr,m=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var y=new DataView(c,u,8),f=y.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=y.getUint32(4,!0),u+=4),y=new DataView(c,u,12),p.height=y.getUint32(0,!0),p.width=y.getUint32(4,!0),u+=8,f>=4?(p.numDims=y.getUint32(8,!0),u+=4):p.numDims=1,y=new DataView(c,u,40),p.numValidPixel=y.getUint32(0,!0),p.microBlockSize=y.getInt32(4,!0),p.blobSize=y.getInt32(8,!0),p.imageType=y.getInt32(12,!0),p.maxZError=y.getFloat64(16,!0),p.zMin=y.getFloat64(24,!0),p.zMax=y.getFloat64(32,!0),u+=40,l.headerInfo=p,l.ptr=u;var x,_;if(f>=3&&(_=f>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,l){var u=l.headerInfo,m=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),y=this.readSubArray(c,l.ptr,m,p),f=this.readSubArray(c,l.ptr+p,m,p);l.ptr+=2*p;var x,_=!0;for(x=0;x<u.numDims;x++)if(y[x]!==f[x]){_=!1;break}return u.minValues=y,u.maxValues=f,_},readSubArray:function(c,l,u,m){var p;if(u===Uint8Array)p=new Uint8Array(c,l,m);else{var y=new ArrayBuffer(m),f=new Uint8Array(y);f.set(new Uint8Array(c,l,m)),p=new u(y)}return p},readMask:function(c,l){var u=l.ptr,m=l.headerInfo,p=m.width*m.height,y=m.numValidPixel,f=new DataView(c,u,4),x={};if(x.numBytes=f.getUint32(0,!0),u+=4,(y===0||p===y)&&x.numBytes!==0)throw"invalid mask";var _,C;if(y===0)_=new Uint8Array(Math.ceil(p/8)),x.bitset=_,C=new Uint8Array(p),l.pixels.resultMask=C,u+=x.numBytes;else if(x.numBytes>0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,x.numBytes);var V=f.getInt16(0,!0),L=2,Z=0,G=0;do{if(V>0)for(;V--;)_[Z++]=f.getUint8(L++);else for(G=f.getUint8(L++),V=-V;V--;)_[Z++]=G;V=f.getInt16(L,!0),L+=2}while(L<x.numBytes);if(V!==-32768||Z<_.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var X=0,P=0;for(P=0;P<p;P++)P&7?(X=_[P>>3],X<<=P&7):X=_[P>>3],X&128&&(C[P]=1);l.pixels.resultMask=C,x.bitset=_,u+=x.numBytes}return l.ptr=u,l.mask=x,!0},readDataOneSweep:function(c,l,u){var m=l.ptr,p=l.headerInfo,y=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*y,C,V=l.pixels.resultMask;if(u===Uint8Array)C=new Uint8Array(c,m,_);else{var L=new ArrayBuffer(_),Z=new Uint8Array(L);Z.set(new Uint8Array(c,m,_)),C=new u(L)}if(C.length===f*y)l.pixels.resultPixels=C;else{l.pixels.resultPixels=new u(f*y);var G=0,X=0,P=0,v=0;if(y>1)for(P=0;P<y;P++)for(v=P*f,X=0;X<f;X++)V[X]&&(l.pixels.resultPixels[v+X]=C[G++]);else for(X=0;X<f;X++)V[X]&&(l.pixels.resultPixels[X]=C[G++])}return m+=_,l.ptr=m,!0},readHuffmanTree:function(c,l){var u=this.HUFFMAN_LUT_BITS_MAX,m=new DataView(c,l.ptr,16);l.ptr+=16;var p=m.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var y=m.getInt32(4,!0),f=m.getInt32(8,!0),x=m.getInt32(12,!0);if(f>=x)return!1;var _=new Uint32Array(x-f);r.decodeBits(c,l,_);var C=[],V,L,Z,G;for(V=f;V<x;V++)L=V-(V<y?0:y),C[L]={first:_[V-f],second:null};var X=c.byteLength-l.ptr,P=Math.ceil(X/4),v=new ArrayBuffer(P*4),A=new Uint8Array(v);A.set(new Uint8Array(c,l.ptr,X));var M=new Uint32Array(v),b=0,R,E=0;for(R=M[0],V=f;V<x;V++)L=V-(V<y?0:y),G=C[L].first,G>0&&(C[L].second=R<<b>>>32-G,32-b>=G?(b+=G,b===32&&(b=0,E++,R=M[E])):(b+=G-32,E++,R=M[E],C[L].second|=R>>>32-b));var I=0,w=0,N=new s;for(V=0;V<C.length;V++)C[V]!==void 0&&(I=Math.max(I,C[V].first));I>=u?w=u:w=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var Y=[],k,O,U,J,z,ee;for(V=f;V<x;V++)if(L=V-(V<y?0:y),G=C[L].first,G>0)if(k=[G,L],G<=w)for(O=C[L].second<<w-G,U=1<<w-G,Z=0;Z<U;Z++)Y[O|Z]=k;else for(O=C[L].second,ee=N,J=G-1;J>=0;J--)z=O>>>J&1,z?(ee.right||(ee.right=new s),ee=ee.right):(ee.left||(ee.left=new s),ee=ee.left),J===0&&!ee.val&&(ee.val=k[1]);return{decodeLut:Y,numBitsLUTQick:w,numBitsLUT:I,tree:N,stuffedData:M,srcPtr:E,bitPos:b}},readHuffman:function(c,l,u){var m=l.headerInfo,p=m.numDims,y=l.headerInfo.height,f=l.headerInfo.width,x=f*y,_=this.readHuffmanTree(c,l),C=_.decodeLut,V=_.tree,L=_.stuffedData,Z=_.srcPtr,G=_.bitPos,X=_.numBitsLUTQick,P=_.numBitsLUT,v=l.headerInfo.imageType===0?128:0,A,M,b,R=l.pixels.resultMask,E,I,w,N,Y,k,O,U=0;G>0&&(Z++,G=0);var J=L[Z],z=l.encodeMode===1,ee=new u(x*p),K=ee,j;for(j=0;j<m.numDims;j++){if(p>1&&(K=new u(ee.buffer,x*j,x),U=0),l.headerInfo.numValidPixel===f*y)for(k=0,N=0;N<y;N++)for(Y=0;Y<f;Y++,k++){if(M=0,E=J<<G>>>32-X,I=E,32-G<X&&(E|=L[Z+1]>>>64-G-X,I=E),C[I])M=C[I][1],G+=C[I][0];else for(E=J<<G>>>32-P,I=E,32-G<P&&(E|=L[Z+1]>>>64-G-P,I=E),A=V,O=0;O<P;O++)if(w=E>>>P-O-1&1,A=w?A.right:A.left,!(A.left||A.right)){M=A.val,G=G+O+1;break}G>=32&&(G-=32,Z++,J=L[Z]),b=M-v,z?(Y>0?b+=U:N>0?b+=K[k-f]:b+=U,b&=255,K[k]=b,U=b):K[k]=b}else for(k=0,N=0;N<y;N++)for(Y=0;Y<f;Y++,k++)if(R[k]){if(M=0,E=J<<G>>>32-X,I=E,32-G<X&&(E|=L[Z+1]>>>64-G-X,I=E),C[I])M=C[I][1],G+=C[I][0];else for(E=J<<G>>>32-P,I=E,32-G<P&&(E|=L[Z+1]>>>64-G-P,I=E),A=V,O=0;O<P;O++)if(w=E>>>P-O-1&1,A=w?A.right:A.left,!(A.left||A.right)){M=A.val,G=G+O+1;break}G>=32&&(G-=32,Z++,J=L[Z]),b=M-v,z?(Y>0&&R[k-1]?b+=U:N>0&&R[k-f]?b+=K[k-f]:b+=U,b&=255,K[k]=b,U=b):K[k]=b}l.ptr=l.ptr+(Z+1)*4+(G>0?4:0)}l.pixels.resultPixels=ee},decodeBits:function(c,l,u,m,p){{var y=l.headerInfo,f=y.fileVersion,x=0,_=new DataView(c,l.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,Z=(C&32)>0,G=C&31,X=0;if(L===1)X=_.getUint8(x),x++;else if(L===2)X=_.getUint16(x,!0),x+=2;else if(L===4)X=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var P=2*y.maxZError,v,A,M,b,R,E,I,w,N,Y,k=y.numDims>1?y.maxValues[p]:y.zMax;if(Z){for(l.counter.lut++,w=_.getUint8(x),N=G,x++,b=Math.ceil((w-1)*G/8),R=Math.ceil(b/4),A=new ArrayBuffer(R*4),M=new Uint8Array(A),l.ptr+=x,M.set(new Uint8Array(c,l.ptr,b)),I=new Uint32Array(A),l.ptr+=b,Y=0;w-1>>>Y;)Y++;b=Math.ceil(X*Y/8),R=Math.ceil(b/4),A=new ArrayBuffer(R*4),M=new Uint8Array(A),M.set(new Uint8Array(c,l.ptr,b)),v=new Uint32Array(A),l.ptr+=b,f>=3?E=o.unstuffLUT2(I,G,w-1,m,P,k):E=o.unstuffLUT(I,G,w-1,m,P,k),f>=3?o.unstuff2(v,u,Y,X,E):o.unstuff(v,u,Y,X,E)}else l.counter.bitstuffer++,Y=G,l.ptr+=x,Y>0&&(b=Math.ceil(X*Y/8),R=Math.ceil(b/4),A=new ArrayBuffer(R*4),M=new Uint8Array(A),M.set(new Uint8Array(c,l.ptr,b)),v=new Uint32Array(A),l.ptr+=b,f>=3?m==null?o.originalUnstuff2(v,u,Y,X):o.unstuff2(v,u,Y,X,!1,m,P,k):m==null?o.originalUnstuff(v,u,Y,X):o.unstuff(v,u,Y,X,!1,m,P,k))}},readTiles:function(c,l,u){var m=l.headerInfo,p=m.width,y=m.height,f=m.microBlockSize,x=m.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(y/f);l.pixels.numBlocksY=V,l.pixels.numBlocksX=C,l.pixels.ptr=0;var L=0,Z=0,G=0,X=0,P=0,v=0,A=0,M=0,b=0,R=0,E=0,I=0,w=0,N=0,Y=0,k=0,O,U,J,z,ee,K,j=new u(f*f),q=y%f||f,be=p%f||f,Te,ae,xe=m.numDims,_e,Ve=l.pixels.resultMask,Ie=l.pixels.resultPixels;for(G=0;G<V;G++)for(P=G!==V-1?f:q,X=0;X<C;X++)for(v=X!==C-1?f:be,E=G*p*f+X*f,I=p-v,_e=0;_e<xe;_e++){if(xe>1&&(Ie=new u(l.pixels.resultPixels.buffer,p*y*_e*_,p*y)),A=c.byteLength-l.ptr,O=new DataView(c,l.ptr,Math.min(10,A)),U={},k=0,M=O.getUint8(0),k++,b=M>>6&255,R=M>>2&15,R!==(X*f>>3&15))throw"integrity issue";if(K=M&3,K>3)throw l.ptr+=k,"Invalid block encoding ("+K+")";if(K===2){l.counter.constant++,l.ptr+=k;continue}else if(K===0){if(l.counter.uncompressed++,l.ptr+=k,w=P*v*_,N=c.byteLength-l.ptr,w=w<N?w:N,J=new ArrayBuffer(w%_===0?w:w+_-w%_),z=new Uint8Array(J),z.set(new Uint8Array(c,l.ptr,w)),ee=new u(J),Y=0,Ve)for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ve[E]&&(Ie[E]=ee[Y++]),E++;E+=I}else for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ie[E++]=ee[Y++];E+=I}l.ptr+=Y*_}else if(Te=r.getDataTypeUsed(x,b),ae=r.getOnePixel(U,k,Te,O),k+=r.getDataTypeSize(Te),K===3)if(l.ptr+=k,l.counter.constantoffset++,Ve)for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ve[E]&&(Ie[E]=ae),E++;E+=I}else for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ie[E++]=ae;E+=I}else if(l.ptr+=k,r.decodeBits(c,l,j,ae,_e),k=0,Ve)for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ve[E]&&(Ie[E]=j[k++]),E++;E+=I}else for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ie[E++]=j[k++];E+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var l=c.headerInfo.zMax,u=c.headerInfo.numDims,m=c.headerInfo.height*c.headerInfo.width,p=m*u,y=0,f=0,x=0,_=c.pixels.resultMask;if(_)if(u>1)for(y=0;y<u;y++)for(x=y*m,f=0;f<m;f++)_[f]&&(c.pixels.resultPixels[x+f]=l);else for(f=0;f<m;f++)_[f]&&(c.pixels.resultPixels[f]=l);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(l);else for(f=0;f<p;f++)c.pixels.resultPixels[f]=l},getDataTypeArray:function(c){var l;switch(c){case 0:l=Int8Array;break;case 1:l=Uint8Array;break;case 2:l=Int16Array;break;case 3:l=Uint16Array;break;case 4:l=Int32Array;break;case 5:l=Uint32Array;break;case 6:l=Float32Array;break;case 7:l=Float64Array;break;default:l=Float32Array}return l},getPixelType:function(c){var l;switch(c){case 0:l="S8";break;case 1:l="U8";break;case 2:l="S16";break;case 3:l="U16";break;case 4:l="S32";break;case 5:l="U32";break;case 6:l="F32";break;case 7:l="F64";break;default:l="F32"}return l},isValidPixelValue:function(c,l){if(l==null)return!1;var u;switch(c){case 0:u=l>=-128&&l<=127;break;case 1:u=l>=0&&l<=255;break;case 2:u=l>=-32768&&l<=32767;break;case 3:u=l>=0&&l<=65536;break;case 4:u=l>=-2147483648&&l<=2147483647;break;case 5:u=l>=0&&l<=4294967296;break;case 6:u=l>=-34027999387901484e22&&l<=34027999387901484e22;break;case 7:u=l>=5e-324&&l<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var l=0;switch(c){case 0:case 1:l=1;break;case 2:case 3:l=2;break;case 4:case 5:case 6:l=4;break;case 7:l=8;break;default:l=c}return l},getDataTypeUsed:function(c,l){var u=c;switch(c){case 2:case 4:u=c-l;break;case 3:case 5:u=c-2*l;break;case 6:l===0?u=c:l===1?u=2:u=1;break;case 7:l===0?u=c:u=c-2*l+1;break;default:u=c;break}return u},getOnePixel:function(c,l,u,m){var p=0;switch(u){case 0:p=m.getInt8(l);break;case 1:p=m.getUint8(l);break;case 2:p=m.getInt16(l,!0);break;case 3:p=m.getUint16(l,!0);break;case 4:p=m.getInt32(l,!0);break;case 5:p=m.getUInt32(l,!0);break;case 6:p=m.getFloat32(l,!0);break;case 7:p=m.getFloat64(l,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,l,u){this.val=c,this.left=l,this.right=u},a={decode:function(c,l){l=l||{};var u=l.noDataValue,m=0,p={};if(p.ptr=l.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var y=p.headerInfo,f=y.fileVersion,x=r.getDataTypeArray(y.imageType);r.readMask(c,p),y.numValidPixel!==y.width*y.height&&!p.pixels.resultMask&&(p.pixels.resultMask=l.maskData);var _=y.width*y.height;if(p.pixels.resultPixels=new x(_*y.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},y.numValidPixel!==0)if(y.zMax===y.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(f>1&&y.imageType<=1&&Math.abs(y.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||f<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var Z;l.inputOffset?(Z=p.headerInfo.blobSize+l.inputOffset-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=l.inputOffset+p.headerInfo.blobSize)):(Z=p.headerInfo.blobSize-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:y.width,height:y.height,pixelData:p.pixels.resultPixels,minValue:y.zMin,maxValue:y.zMax,validPixelCount:y.numValidPixel,dimCount:y.numDims,dimStats:{minValues:y.minValues,maxValues:y.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(y.imageType,u)){var X=p.pixels.resultMask;for(m=0;m<_;m++)X[m]||(G.pixelData[m]=u);G.noDataValue=u}return p.noDataValue=u,l.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var l=0,u=0,m={};for(m.ptr=0,m.pixels={};u<c.byteLength-58;)r.readHeaderInfo(c,m),u+=m.headerInfo.blobSize,l++,m.ptr=u;return l}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),l,u;if(c.trim()==="CntZImage")l=e,u=1;else if(c.substring(0,5)==="Lerc2")l=t,u=2;else throw"Unexpected file identifier string: "+c;for(var m=0,p=o.byteLength-10,y,f=[],x,_,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var V=l.decode(o,{inputOffset:s,encodedMaskData:y,maskData:_,returnMask:m===0,returnEncodedMask:m===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=V.fileInfo.eofOffset,m===0&&(y=V.encodedMaskData,_=V.maskData,C.width=V.width,C.height=V.height,C.dimCount=V.dimCount||1,C.pixelType=V.pixelType||V.fileInfo.pixelType,C.mask=V.maskData),u>1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&f.push(V.maskData),m++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,Z,G;if(u>1&&f.length>1){for(G=C.width*C.height,C.bandMasks=f,_=new Uint8Array(G),_.set(f[0]),L=1;L<f.length;L++)for(x=f[L],Z=0;Z<G;Z++)_[Z]=_[Z]&x[Z];C.maskData=_}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof oD<"u"&&oD.exports?oD.exports=i:this.Lerc=i})()});var n_e=yc((i0o,t_e)=>{var o0o=T(S());t_e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNv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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCi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AABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var o_e=yc((r0o,i_e)=>{var s0o=T(S()),{webm:ngt,mp4:igt}=n_e(),m8=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,h8=()=>"wakeLock"in navigator,f8=class{constructor(){if(this.enabled=!1,h8()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else m8()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",ngt),this._addSourceToVideo(this.noSleepVideo,"mp4",igt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return h8()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):m8()?(this.disable(),console.warn(`
        NoSleep enabled for older iOS devices. This can interrupt
        active or long-running network requests from completing successfully.
        See https://github.com/richtr/NoSleep.js/issues/15 for more details.
      `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){h8()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):m8()?this.noSleepTimer&&(console.warn(`
          NoSleep now disabled for older iOS devices.
        `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};i_e.exports=f8});var Ggt={};G_e(Ggt,{AlphaMode:()=>Oh,AlphaPipelineStage:()=>JX,Animation:()=>fA,AnimationViewModel:()=>pA,Appearance:()=>to,ApproximateTerrainHeights:()=>li,ArcGISTiledElevationTerrainProvider:()=>e4,ArcGisBaseMapType:()=>ch,ArcGisMapServerImageryProvider:()=>X0,ArcGisMapService:()=>Rd,ArcType:()=>Jt,ArticulationStageType:()=>za,AssociativeArray:()=>Tt,AttributeCompression:()=>Kn,AttributeType:()=>an,AutoExposure:()=>Tw,AutomaticUniforms:()=>Yf,Axis:()=>Zo,AxisAlignedBoundingBox:()=>ub,B3dmLoader:()=>hX,B3dmParser:()=>dX,BaseLayerPicker:()=>yA,BaseLayerPickerViewModel:()=>bA,BatchTable:()=>Bg,BatchTableHierarchy:()=>bx,BatchTexture:()=>Wc,BatchTexturePipelineStage:()=>QX,Billboard:()=>uo,BillboardCollection:()=>od,BillboardGraphics:()=>Ua,BillboardVisualizer:()=>iG,BingMapsGeocoderService:()=>n4,BingMapsImageryProvider:()=>DP,BingMapsStyle:()=>B1,BlendEquation:()=>ma,BlendFunction:()=>_o,BlendOption:()=>So,BlendingState:()=>un,BoundingRectangle:()=>He,BoundingSphere:()=>ce,BoundingSphereState:()=>lt,BoundingVolumeSemantics:()=>Px,BoxEmitter:()=>O4,BoxGeometry:()=>cl,BoxGeometryUpdater:()=>_E,BoxGraphics:()=>nx,BoxOutlineGeometry:()=>sm,BrdfLutGenerator:()=>Tv,Buffer:()=>mt,BufferLoader:()=>Sx,BufferUsage:()=>Ne,CPUStylingPipelineStage:()=>eI,CallbackProperty:()=>fm,Camera:()=>co,CameraEventAggregator:()=>Ew,CameraEventType:()=>vi,CameraFlightPath:()=>Cv,Cartesian2:()=>D,Cartesian3:()=>h,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>o4,CatmullRomSpline:()=>r4,Cesium3DContentGroup:()=>px,Cesium3DTile:()=>xu,Cesium3DTileBatchTable:()=>gp,Cesium3DTileColorBlendMode:()=>fl,Cesium3DTileContent:()=>K4,Cesium3DTileContentFactory:()=>Qx,Cesium3DTileContentState:()=>wo,Cesium3DTileContentType:()=>cs,Cesium3DTileFeature:()=>Ss,Cesium3DTileFeatureTable:()=>Zm,Cesium3DTileOptimizationHint:()=>hu,Cesium3DTileOptimizations:()=>WW,Cesium3DTilePass:()=>Xo,Cesium3DTilePassState:()=>Du,Cesium3DTilePointFeature:()=>Dp,Cesium3DTileRefine:()=>Wo,Cesium3DTileStyle:()=>CT,Cesium3DTileStyleEngine:()=>MW,Cesium3DTilesInspector:()=>CA,Cesium3DTilesInspectorViewModel:()=>SA,Cesium3DTilesVoxelProvider:()=>Q4,Cesium3DTileset:()=>zs,Cesium3DTilesetBaseTraversal:()=>YW,Cesium3DTilesetCache:()=>wW,Cesium3DTilesetGraphics:()=>lx,Cesium3DTilesetHeatmap:()=>FW,Cesium3DTilesetMetadata:()=>c_,Cesium3DTilesetMostDetailedTraversal:()=>kW,Cesium3DTilesetSkipTraversal:()=>HW,Cesium3DTilesetStatistics:()=>o0,Cesium3DTilesetTraversal:()=>Gs,Cesium3DTilesetVisualizer:()=>zW,CesiumInspector:()=>RA,CesiumInspectorViewModel:()=>LA,CesiumTerrainProvider:()=>sF,CesiumWidget:()=>qw,Check:()=>tl,CheckerboardMaterialProperty:()=>ZC,CircleEmitter:()=>_F,CircleGeometry:()=>u4,CircleOutlineGeometry:()=>m4,ClassificationModelDrawCommand:()=>EX,ClassificationPipelineStage:()=>jX,ClassificationPrimitive:()=>TS,ClassificationType:()=>kn,ClearCommand:()=>ti,ClippingPlane:()=>vx,ClippingPlaneCollection:()=>ss,Clock:()=>Dm,ClockRange:()=>Xr,ClockStep:()=>mo,ClockViewModel:()=>dA,CloudCollection:()=>nj,CloudType:()=>ZV,Color:()=>B,ColorBlendMode:()=>Ha,ColorGeometryInstanceAttribute:()=>Ut,ColorMaterialProperty:()=>At,Command:()=>$j,ComponentDatatype:()=>Q,Composite3DTileContent:()=>ZE,CompositeEntityCollection:()=>yK,CompositeMaterialProperty:()=>EC,CompositePositionProperty:()=>Js,CompositeProperty:()=>$a,CompressedTextureBuffer:()=>bL,ComputeCommand:()=>Kd,ComputeEngine:()=>nL,ConditionsExpression:()=>bF,ConeEmitter:()=>oj,ConstantPositionProperty:()=>Gc,ConstantProperty:()=>qn,ConstantSpline:()=>yX,ContentMetadata:()=>TW,Context:()=>QZ,ContextLimits:()=>kt,CoplanarPolygonGeometry:()=>W2,CoplanarPolygonGeometryLibrary:()=>qp,CoplanarPolygonOutlineGeometry:()=>yu,CornerType:()=>Ii,CorridorGeometry:()=>f_,CorridorGeometryLibrary:()=>Mi,CorridorGeometryUpdater:()=>i2,CorridorGraphics:()=>ox,CorridorOutlineGeometry:()=>n2,Credit:()=>St,CreditDisplay:()=>Zv,CubeMap:()=>Ma,CubeMapFace:()=>Wh,CubicRealPolynomial:()=>kg,CullFace:()=>yi,CullingVolume:()=>Qr,CumulusCloud:()=>Ad,CustomDataSource:()=>l2,CustomHeightmapTerrainProvider:()=>h4,CustomShader:()=>wT,CustomShaderMode:()=>Up,CustomShaderPipelineStage:()=>aI,CustomShaderTranslucencyMode:()=>Yb,CylinderGeometry:()=>d2,CylinderGeometryLibrary:()=>p_,CylinderGeometryUpdater:()=>m2,CylinderGraphics:()=>rx,CylinderOutlineGeometry:()=>u2,CzmlDataSource:()=>S2,DataSource:()=>Gr,DataSourceClock:()=>Bm,DataSourceCollection:()=>C2,DataSourceDisplay:()=>lP,DebugAppearance:()=>rj,DebugCameraPrimitive:()=>Zf,DebugInspector:()=>Aw,DebugModelMatrixPrimitive:()=>SF,DefaultProxy:()=>f4,DepthFunction:()=>ka,DepthPlane:()=>wv,DequantizationPipelineStage:()=>lI,DerivedCommand:()=>F0,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>Av,DirectionalLight:()=>sj,DiscardEmptyTileImagePolicy:()=>Y1,DiscardMissingTileImagePolicy:()=>UP,DistanceDisplayCondition:()=>Gt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Un,DoubleEndedPriorityQueue:()=>gT,DoublyLinkedList:()=>vW,DracoLoader:()=>Rp,DrawCommand:()=>nt,DynamicGeometryBatch:()=>C_,DynamicGeometryUpdater:()=>ii,EarthOrientationParameters:()=>fL,EarthOrientationParametersSample:()=>$0,EasingFunction:()=>Wr,EllipseGeometry:()=>Uc,EllipseGeometryLibrary:()=>Gl,EllipseGeometryUpdater:()=>L2,EllipseGraphics:()=>sx,EllipseOutlineGeometry:()=>hd,Ellipsoid:()=>re,EllipsoidGeodesic:()=>eu,EllipsoidGeometry:()=>Is,EllipsoidGeometryUpdater:()=>Z2,EllipsoidGraphics:()=>ax,EllipsoidOutlineGeometry:()=>sd,EllipsoidPrimitive:()=>pv,EllipsoidRhumbLine:()=>ha,EllipsoidSurfaceAppearance:()=>aj,EllipsoidTangentPlane:()=>xr,EllipsoidTerrainProvider:()=>Cf,EllipsoidalOccluder:()=>d0,Empty3DTileContent:()=>mC,EncodedCartesian3:()=>On,Entity:()=>Oo,EntityCluster:()=>ad,EntityCollection:()=>Es,EntityView:()=>uP,Event:()=>ye,EventHelper:()=>Lr,Expression:()=>nu,ExpressionNodeType:()=>ft,ExtrapolationType:()=>ld,FeatureDetection:()=>Mt,FeatureIdPipelineStage:()=>Bb,Fog:()=>Mv,ForEach:()=>Xe,FrameRateMonitor:()=>LF,FrameState:()=>Nv,Framebuffer:()=>Us,FramebufferManager:()=>mi,FrustumCommands:()=>Bv,FrustumGeometry:()=>Q_,FrustumOutlineGeometry:()=>Xv,Fullscreen:()=>lr,FullscreenButton:()=>GA,FullscreenButtonViewModel:()=>ZA,GeoJsonDataSource:()=>fP,GeoJsonLoader:()=>fX,GeocodeType:()=>ng,Geocoder:()=>WA,GeocoderService:()=>SV,GeocoderViewModel:()=>IA,GeographicProjection:()=>Zi,GeographicTilingScheme:()=>Di,Geometry:()=>dt,Geometry3DTileContent:()=>EE,GeometryAttribute:()=>Ze,GeometryAttributes:()=>hn,GeometryFactory:()=>b4,GeometryInstance:()=>_t,GeometryInstanceAttribute:()=>Da,GeometryOffsetAttribute:()=>rn,GeometryPipeline:()=>An,GeometryPipelineStage:()=>hI,GeometryType:()=>Hd,GeometryUpdater:()=>oi,GeometryVisualizer:()=>Q2,GetFeatureInfoFormat:()=>K_,Globe:()=>uv,GlobeDepth:()=>Yv,GlobeSurfaceShaderSet:()=>NP,GlobeSurfaceTile:()=>Nu,GlobeSurfaceTileProvider:()=>tv,GlobeTranslucency:()=>nv,GlobeTranslucencyFramebuffer:()=>Ov,GlobeTranslucencyState:()=>Uv,GltfBufferViewLoader:()=>vS,GltfDracoLoader:()=>wS,GltfImageLoader:()=>FS,GltfIndexBufferLoader:()=>AS,GltfJsonLoader:()=>NS,GltfLoader:()=>Ip,GltfLoaderUtil:()=>gl,GltfStructuralMetadataLoader:()=>sX,GltfTextureLoader:()=>US,GltfVertexBufferLoader:()=>kS,GoogleEarthEnterpriseImageryProvider:()=>lj,GoogleEarthEnterpriseMapsProvider:()=>OP,GoogleEarthEnterpriseMetadata:()=>K0,GoogleEarthEnterpriseTerrainData:()=>CV,GoogleEarthEnterpriseTerrainProvider:()=>V4,GoogleEarthEnterpriseTileInformation:()=>cF,GoogleMaps:()=>_T,GpxDataSource:()=>gP,GregorianDate:()=>Jf,GridImageryProvider:()=>dj,GridMaterialProperty:()=>NC,GroundGeometryUpdater:()=>Hn,GroundPolylineGeometry:()=>qg,GroundPolylinePrimitive:()=>dm,GroundPrimitive:()=>Rc,GroupMetadata:()=>VC,HeadingPitchRange:()=>Pu,HeadingPitchRoll:()=>Aa,Heap:()=>dL,HeightReference:()=>Ke,HeightmapEncoding:()=>Fu,HeightmapTerrainData:()=>Sa,HeightmapTessellator:()=>M1,HermitePolynomialApproximation:()=>h2,HermiteSpline:()=>Ub,HilbertOrder:()=>XS,HomeButton:()=>XA,HomeButtonViewModel:()=>EA,HorizontalOrigin:()=>bi,I3SDataProvider:()=>ET,I3SDecoder:()=>RF,I3SFeature:()=>ZF,I3SField:()=>GF,I3SGeometry:()=>EV,I3SLayer:()=>IV,I3SNode:()=>XV,I3dmLoader:()=>bX,I3dmParser:()=>pX,Iau2000Orientation:()=>hv,Iau2006XysData:()=>pL,Iau2006XysSample:()=>Pg,IauOrientationAxes:()=>fv,IauOrientationParameters:()=>mv,ImageBasedLighting:()=>fx,ImageBasedLightingPipelineStage:()=>vX,ImageMaterialProperty:()=>bb,Imagery:()=>Q1,ImageryLayer:()=>na,ImageryLayerCollection:()=>iv,ImageryLayerFeatureInfo:()=>ah,ImageryProvider:()=>Yc,ImageryState:()=>ci,Implicit3DTileContent:()=>BS,ImplicitAvailabilityBitstream:()=>WS,ImplicitMetadataView:()=>PS,ImplicitSubdivisionScheme:()=>Mr,ImplicitSubtree:()=>Ix,ImplicitSubtreeCache:()=>gF,ImplicitSubtreeMetadata:()=>XE,ImplicitTileCoordinates:()=>u_,ImplicitTileset:()=>d_,IndexDatatype:()=>Ue,InfoBox:()=>vA,InfoBoxViewModel:()=>PA,InspectorShared:()=>Za,InstanceAttributeSemantic:()=>Nr,InstancingPipelineStage:()=>OX,InterpolationAlgorithm:()=>L4,InterpolationType:()=>Lm,Intersect:()=>qt,IntersectionTests:()=>Si,Intersections2D:()=>Y0,Interval:()=>Tc,InvertClassification:()=>aV,Ion:()=>bm,IonGeocoderService:()=>uF,IonImageryProvider:()=>I0,IonResource:()=>$l,IonWorldImageryStyle:()=>W0,Iso8601:()=>Ye,JobScheduler:()=>kv,JobType:()=>ba,JsonMetadataTable:()=>Ep,JulianDate:()=>te,KTX2Transcoder:()=>yL,KeyboardEventModifier:()=>ra,KeyframeNode:()=>Qi,KmlCamera:()=>xP,KmlDataSource:()=>wP,KmlLookAt:()=>GP,KmlTour:()=>EP,KmlTourFlyTo:()=>IP,KmlTourWait:()=>WP,Label:()=>Qb,LabelCollection:()=>qh,LabelGraphics:()=>um,LabelStyle:()=>vo,LabelVisualizer:()=>j2,LagrangePolynomialApproximation:()=>f2,LeapSecond:()=>Ui,Light:()=>hj,LightingModel:()=>Hh,LightingPipelineStage:()=>pI,LinearApproximation:()=>y_,LinearSpline:()=>Nb,ManagedArray:()=>Ic,MapMode2D:()=>Fl,MapProjection:()=>G4,MapboxImageryProvider:()=>KP,MapboxStyleImageryProvider:()=>fj,Material:()=>ki,MaterialAppearance:()=>so,MaterialPipelineStage:()=>yI,MaterialProperty:()=>Yo,Math:()=>W,Matrix2:()=>$i,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>PV,MetadataClass:()=>Tm,MetadataClassProperty:()=>Lb,MetadataComponentType:()=>tn,MetadataEntity:()=>Mn,MetadataEnum:()=>HE,MetadataEnumValue:()=>KE,MetadataPipelineStage:()=>ru,MetadataSchema:()=>Sm,MetadataSchemaLoader:()=>DS,MetadataSemantic:()=>Wx,MetadataTable:()=>bl,MetadataTableProperty:()=>WE,MetadataType:()=>Ot,MipmapHint:()=>Ph,Model:()=>Xm,Model3DTileContent:()=>Jh,ModelAlphaOptions:()=>PI,ModelAnimation:()=>TX,ModelAnimationChannel:()=>_X,ModelAnimationCollection:()=>SX,ModelAnimationLoop:()=>Tl,ModelAnimationState:()=>Gm,ModelArticulation:()=>FX,ModelArticulationStage:()=>wX,ModelClippingPlanesPipelineStage:()=>NX,ModelColorPipelineStage:()=>Db,ModelComponents:()=>wt,ModelDrawCommand:()=>XX,ModelFeature:()=>CX,ModelFeatureTable:()=>LX,ModelGraphics:()=>mp,ModelLightingOptions:()=>kI,ModelMatrixUpdateStage:()=>KX,ModelNode:()=>UX,ModelRenderResources:()=>vI,ModelRuntimeNode:()=>zX,ModelRuntimePrimitive:()=>II,ModelSceneGraph:()=>BI,ModelSilhouettePipelineStage:()=>AI,ModelSkin:()=>WI,ModelSplitterPipelineStage:()=>NI,ModelStatistics:()=>YI,ModelType:()=>nr,ModelUtility:()=>nn,ModelVisualizer:()=>$2,Moon:()=>yv,MorphTargetsPipelineStage:()=>xI,MorphWeightSpline:()=>E4,MortonOrder:()=>sy,Multiple3DTileContent:()=>VW,MultisampleFramebuffer:()=>jZ,NavigationHelpButton:()=>FA,NavigationHelpButtonViewModel:()=>wA,NearFarScalar:()=>Pt,NeverTileDiscardPolicy:()=>bj,NodeRenderResources:()=>UI,NodeStatisticsPipelineStage:()=>HX,NodeTransformationProperty:()=>cx,OIT:()=>Hv,Occluder:()=>gv,OctahedralProjectedCubeMap:()=>pm,OffsetGeometryInstanceAttribute:()=>zi,OpenCageGeocoderService:()=>I4,OpenStreetMapImageryProvider:()=>z0,OrderedGroundPrimitiveCollection:()=>V2,OrientedBoundingBox:()=>Wn,OrthographicFrustum:()=>en,OrthographicOffCenterFrustum:()=>yr,Packable:()=>W4,PackableForInterpolation:()=>P4,Particle:()=>vV,ParticleBurst:()=>gj,ParticleEmitter:()=>xj,ParticleSystem:()=>_j,Pass:()=>Re,PassState:()=>Na,PathGraphics:()=>hp,PathVisualizer:()=>tP,PeliasGeocoderService:()=>dF,PerInstanceColorAppearance:()=>sn,PerformanceDisplay:()=>A0,PerformanceWatchdog:()=>MA,PerformanceWatchdogViewModel:()=>AA,PerspectiveFrustum:()=>Ri,PerspectiveOffCenterFrustum:()=>Kc,PickDepth:()=>Dv,PickDepthFramebuffer:()=>Jv,PickFramebuffer:()=>qv,Picking:()=>nw,PickingPipelineStage:()=>_I,PinBuilder:()=>V0,PixelDatatype:()=>Je,PixelFormat:()=>st,Plane:()=>on,PlaneGeometry:()=>G2,PlaneGeometryUpdater:()=>X2,PlaneGraphics:()=>hE,PlaneOutlineGeometry:()=>E2,PntsLoader:()=>KI,PntsParser:()=>Yx,PointCloud:()=>PF,PointCloudEyeDomeLighting:()=>Wp,PointCloudShading:()=>Kh,PointCloudStylingPipelineStage:()=>SI,PointGraphics:()=>dx,PointPrimitive:()=>Xs,PointPrimitiveCollection:()=>vC,PointVisualizer:()=>iP,PolygonGeometry:()=>Z_,PolygonGeometryLibrary:()=>Bn,PolygonGeometryUpdater:()=>v2,PolygonGraphics:()=>mm,PolygonHierarchy:()=>fa,PolygonOutlineGeometry:()=>P2,PolygonPipeline:()=>ai,Polyline:()=>du,PolylineArrowMaterialProperty:()=>kC,PolylineCollection:()=>Pm,PolylineColorAppearance:()=>Fr,PolylineDashMaterialProperty:()=>BC,PolylineGeometry:()=>C0,PolylineGeometryUpdater:()=>sP,PolylineGlowMaterialProperty:()=>OC,PolylineGraphics:()=>Ba,PolylineMaterialAppearance:()=>Ds,PolylineOutlineMaterialProperty:()=>fy,PolylinePipeline:()=>Xi,PolylineVisualizer:()=>cP,PolylineVolumeGeometry:()=>A2,PolylineVolumeGeometryLibrary:()=>Mm,PolylineVolumeGeometryUpdater:()=>k2,PolylineVolumeGraphics:()=>ux,PolylineVolumeOutlineGeometry:()=>U2,PositionProperty:()=>dp,PositionPropertyArray:()=>f0,PostProcessStage:()=>po,PostProcessStageCollection:()=>Lw,PostProcessStageComposite:()=>Hc,PostProcessStageLibrary:()=>Yu,PostProcessStageSampleMode:()=>Ed,PostProcessStageTextureCache:()=>cT,Primitive:()=>Zn,PrimitiveCollection:()=>Zl,PrimitiveLoadPlan:()=>Mx,PrimitiveOutlineGenerator:()=>Ax,PrimitiveOutlinePipelineStage:()=>LI,PrimitivePipeline:()=>Jg,PrimitiveRenderResources:()=>DI,PrimitiveState:()=>mr,PrimitiveStatisticsPipelineStage:()=>RI,PrimitiveType:()=>Fe,ProjectionPicker:()=>UA,ProjectionPickerViewModel:()=>NA,Property:()=>H,PropertyArray:()=>HC,PropertyAttribute:()=>Fx,PropertyAttributeProperty:()=>nX,PropertyBag:()=>ml,PropertyTable:()=>Pc,PropertyTexture:()=>wx,PropertyTextureProperty:()=>tX,ProviderViewModel:()=>Yr,Proxy:()=>v4,QuadraticRealPolynomial:()=>Cc,QuadtreeOccluders:()=>ov,QuadtreePrimitive:()=>dv,QuadtreeTile:()=>rv,QuadtreeTileLoadState:()=>ws,QuadtreeTileProvider:()=>Rj,QuantizedMeshTerrainData:()=>yT,QuarticRealPolynomial:()=>AG,Quaternion:()=>Ae,QuaternionSpline:()=>xX,Queue:()=>ny,Ray:()=>Sn,Rectangle:()=>de,RectangleCollisionChecker:()=>I_,RectangleGeometry:()=>E_,RectangleGeometryLibrary:()=>ls,RectangleGeometryUpdater:()=>D2,RectangleGraphics:()=>hm,RectangleOutlineGeometry:()=>e_,ReferenceFrame:()=>io,ReferenceProperty:()=>p0,RenderState:()=>De,Renderbuffer:()=>Kl,RenderbufferFormat:()=>xc,Request:()=>Uo,RequestErrorEvent:()=>Eh,RequestScheduler:()=>wa,RequestState:()=>$n,RequestType:()=>Jr,Resource:()=>Ee,ResourceCache:()=>Bi,ResourceCacheKey:()=>xl,ResourceCacheStatistics:()=>jE,ResourceLoader:()=>oo,ResourceLoaderState:()=>Rt,Rotation:()=>Vu,RuntimeError:()=>me,S2Cell:()=>Sp,SDFSettings:()=>Rs,SampledPositionProperty:()=>js,SampledProperty:()=>ud,Sampler:()=>dn,ScaledPositionProperty:()=>mf,Scene:()=>Nw,SceneFramebuffer:()=>tT,SceneMode:()=>ie,SceneMode2DPipelineStage:()=>ZI,SceneModePicker:()=>DA,SceneModePickerViewModel:()=>kA,SceneTransforms:()=>Ji,SceneTransitioner:()=>Gw,ScreenSpaceCameraController:()=>Ww,ScreenSpaceEventHandler:()=>Id,ScreenSpaceEventType:()=>_n,SelectedFeatureIdPipelineStage:()=>Ob,SelectionIndicator:()=>OA,SelectionIndicatorViewModel:()=>YA,ShaderBuilder:()=>Ag,ShaderCache:()=>YZ,ShaderDestination:()=>Le,ShaderFunction:()=>eG,ShaderProgram:()=>Qt,ShaderSource:()=>Be,ShaderStruct:()=>$Z,ShadowMap:()=>U0,ShadowMapShader:()=>If,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>Ql,ShowGeometryInstanceAttribute:()=>gn,Simon1994PlanetaryPositions:()=>ab,SimplePolylineGeometry:()=>w4,SingleTileImageryProvider:()=>HP,SkinningPipelineStage:()=>EI,SkyAtmosphere:()=>Dw,SkyBox:()=>Ow,SpatialNode:()=>wF,SphereEmitter:()=>Gj,SphereGeometry:()=>F4,SphereOutlineGeometry:()=>e0,Spherical:()=>p2,Spline:()=>ro,SplitDirection:()=>vc,Splitter:()=>wV,StaticGeometryColorBatch:()=>Gu,StaticGeometryPerMaterialBatch:()=>Eu,StaticGroundGeometryColorBatch:()=>b1,StaticGroundGeometryPerMaterialBatch:()=>B2,StaticGroundPolylinePerMaterialBatch:()=>aP,StaticOutlineGeometryBatch:()=>x1,StencilConstants:()=>Ft,StencilFunction:()=>Dn,StencilOperation:()=>ht,SteppedSpline:()=>gX,Stereographic:()=>ic,StripeMaterialProperty:()=>JC,StripeOrientation:()=>Om,StructuralMetadata:()=>ya,StyleCommandsNeeded:()=>Em,StyleExpression:()=>Ej,Sun:()=>jw,SunLight:()=>tp,SunPostProcess:()=>ww,SupportedImageFormats:()=>aX,SvgPathBindingHandler:()=>cA,TaskProcessor:()=>pi,Terrain:()=>AF,TerrainData:()=>sh,TerrainEncoding:()=>sc,TerrainExaggeration:()=>Vc,TerrainFillMesh:()=>eV,TerrainMesh:()=>Mu,TerrainOffsetProperty:()=>mx,TerrainProvider:()=>Ur,TerrainQuantization:()=>vs,TerrainState:()=>ao,Texture:()=>Wt,TextureAtlas:()=>Jb,TextureCache:()=>OZ,TextureMagnificationFilter:()=>Ti,TextureManager:()=>nA,TextureMinificationFilter:()=>cn,TextureUniform:()=>zj,TextureWrap:()=>Gn,TileAvailability:()=>ph,TileBoundingRegion:()=>bu,TileBoundingS2Cell:()=>XW,TileBoundingSphere:()=>t0,TileBoundingVolume:()=>Xj,TileCoordinatesImageryProvider:()=>NF,TileDiscardPolicy:()=>Wj,TileEdge:()=>yn,TileImagery:()=>j1,TileMapServiceImageryProvider:()=>ky,TileMetadata:()=>SW,TileOrientedBoundingBox:()=>gu,TileProviderError:()=>Vo,TileReplacementQueue:()=>sv,TileSelectionResult:()=>jn,TileState:()=>Pj,Tileset3DTileContent:()=>JI,TilesetMetadata:()=>IW,TilesetPipelineStage:()=>WX,TilingScheme:()=>A4,TimeConstants:()=>Qn,TimeDynamicImagery:()=>H_,TimeDynamicPointCloud:()=>MV,TimeInterval:()=>Tn,TimeIntervalCollection:()=>Zr,TimeIntervalCollectionPositionProperty:()=>b0,TimeIntervalCollectionProperty:()=>y0,TimeStandard:()=>Jn,Timeline:()=>zA,TimelineHighlightRange:()=>KA,TimelineTrack:()=>HA,Tipsify:()=>DG,ToggleButtonViewModel:()=>dg,Tonemapper:()=>Qy,Transforms:()=>vt,TranslationRotationScale:()=>yb,TranslucentTileClassification:()=>ew,TridiagonalSystemSolver:()=>jS,TrustedServers:()=>oS,TweenCollection:()=>mT,UniformState:()=>JZ,UniformType:()=>UV,UrlTemplateImageryProvider:()=>Ca,VERSION:()=>Zgt,VRButton:()=>QA,VRButtonViewModel:()=>JA,VRTheWorldTerrainProvider:()=>M4,VaryingType:()=>Jj,Vector3DTileBatch:()=>Dh,Vector3DTileClampedPolylines:()=>gW,Vector3DTileContent:()=>_W,Vector3DTileGeometry:()=>_p,Vector3DTilePoints:()=>uW,Vector3DTilePolygons:()=>mW,Vector3DTilePolylines:()=>Jx,Vector3DTilePrimitive:()=>xx,VelocityOrientationProperty:()=>y2,VelocityVectorProperty:()=>T_,VertexArray:()=>ni,VertexArrayFacade:()=>ip,VertexAttributeSemantic:()=>Ct,VertexFormat:()=>We,VerticalOrigin:()=>In,VideoSynchronizer:()=>N4,View:()=>oT,Viewer:()=>b8,ViewportQuad:()=>Fj,Visibility:()=>sr,Visualizer:()=>sJ,VoxelBoxShape:()=>Af,VoxelContent:()=>xF,VoxelCylinderShape:()=>Mf,VoxelEllipsoidShape:()=>VT,VoxelInspector:()=>$A,VoxelInspectorViewModel:()=>qA,VoxelPrimitive:()=>DV,VoxelProvider:()=>Uj,VoxelRenderResources:()=>$F,VoxelShape:()=>kj,VoxelShapeType:()=>Oi,VoxelTraversal:()=>NV,VulkanConstants:()=>U4,WallGeometry:()=>O2,WallGeometryLibrary:()=>W_,WallGeometryUpdater:()=>z2,WallGraphics:()=>fp,WallOutlineGeometry:()=>H2,WebGLConstants:()=>ne,WebMapServiceImageryProvider:()=>JP,WebMapTileServiceImageryProvider:()=>jP,WebMercatorProjection:()=>Ei,WebMercatorTilingScheme:()=>kr,WindingOrder:()=>Hr,WireframeIndexGenerator:()=>sC,WireframePipelineStage:()=>XI,_shadersAcesTonemappingStage:()=>iw,_shadersAdditiveBlend:()=>Pw,_shadersAdjustTranslucentFS:()=>cV,_shadersAllMaterialAppearanceFS:()=>sG,_shadersAllMaterialAppearanceVS:()=>aG,_shadersAmbientOcclusionGenerate:()=>ow,_shadersAmbientOcclusionModulate:()=>rw,_shadersAspectRampMaterial:()=>mG,_shadersAtmosphereCommon:()=>G0,_shadersBasicMaterialAppearanceFS:()=>cG,_shadersBasicMaterialAppearanceVS:()=>lG,_shadersBillboardCollectionFS:()=>QI,_shadersBillboardCollectionVS:()=>jI,_shadersBlackAndWhite:()=>sw,_shadersBloomComposite:()=>aw,_shadersBrdfLutGeneratorFS:()=>xv,_shadersBrightPass:()=>vw,_shadersBrightness:()=>cw,_shadersBumpMapMaterial:()=>hG,_shadersCPUStylingStageFS:()=>$X,_shadersCPUStylingStageVS:()=>qX,_shadersCheckerboardMaterial:()=>fG,_shadersCloudCollectionFS:()=>$w,_shadersCloudCollectionVS:()=>eF,_shadersCloudNoiseFS:()=>tF,_shadersCloudNoiseVS:()=>nF,_shadersCompareAndPackTranslucentDepth:()=>$v,_shadersCompositeOITFS:()=>Kv,_shadersCompositeTranslucentClassification:()=>iT,_shadersContrastBias:()=>lw,_shadersCustomShaderStageFS:()=>nI,_shadersCustomShaderStageVS:()=>tI,_shadersCzmBuiltins:()=>vg,_shadersDepthOfField:()=>dw,_shadersDepthPlaneFS:()=>Iv,_shadersDepthPlaneVS:()=>Wv,_shadersDepthView:()=>uw,_shadersDepthViewPacked:()=>Hj,_shadersDotMaterial:()=>pG,_shadersEdgeDetection:()=>mw,_shadersElevationBandMaterial:()=>bG,_shadersElevationContourMaterial:()=>yG,_shadersElevationRampMaterial:()=>gG,_shadersEllipsoidFS:()=>nV,_shadersEllipsoidSurfaceAppearanceFS:()=>CF,_shadersEllipsoidSurfaceAppearanceVS:()=>VF,_shadersEllipsoidVS:()=>iV,_shadersFXAA:()=>fw,_shadersFXAA3_11:()=>_w,_shadersFadeMaterial:()=>xG,_shadersFeatureIdStageFS:()=>iI,_shadersFeatureIdStageVS:()=>oI,_shadersFilmicTonemapping:()=>hw,_shadersGaussianBlur1D:()=>Jy,_shadersGeometryStageFS:()=>dI,_shadersGeometryStageVS:()=>uI,_shadersGlobeFS:()=>AP,_shadersGlobeVS:()=>MP,_shadersGridMaterial:()=>_G,_shadersGroundAtmosphere:()=>U1,_shadersHSBToRGB:()=>hR,_shadersHSLToRGB:()=>fR,_shadersImageBasedLightingStageFS:()=>PX,_shadersInstancingStageCommon:()=>kX,_shadersInstancingStageVS:()=>DX,_shadersIntersectBox:()=>OF,_shadersIntersectClippingPlanes:()=>YF,_shadersIntersectCylinder:()=>KF,_shadersIntersectDepth:()=>BF,_shadersIntersectEllipsoid:()=>HF,_shadersIntersection:()=>PT,_shadersIntersectionUtils:()=>DF,_shadersLegacyInstancingStageVS:()=>BX,_shadersLensFlare:()=>pw,_shadersLightingStageFS:()=>fI,_shadersMaterialStageFS:()=>bI,_shadersMegatexture:()=>qF,_shadersMetadataStageFS:()=>rI,_shadersMetadataStageVS:()=>sI,_shadersModelClippingPlanesStageFS:()=>MX,_shadersModelColorStageFS:()=>AX,_shadersModelFS:()=>RX,_shadersModelSilhouetteStageFS:()=>wI,_shadersModelSilhouetteStageVS:()=>FI,_shadersModelSplitterStageFS:()=>MI,_shadersModelVS:()=>ZX,_shadersModifiedReinhardTonemapping:()=>bw,_shadersMorphTargetsStageVS:()=>gI,_shadersNightVision:()=>yw,_shadersNormalMapMaterial:()=>TG,_shadersOctahedralProjectionAtlasFS:()=>TE,_shadersOctahedralProjectionFS:()=>SE,_shadersOctahedralProjectionVS:()=>CE,_shadersOctree:()=>jF,_shadersPassThrough:()=>Al,_shadersPassThroughDepth:()=>Ky,_shadersPerInstanceColorAppearanceFS:()=>IG,_shadersPerInstanceColorAppearanceVS:()=>WG,_shadersPerInstanceFlatColorAppearanceFS:()=>Ug,_shadersPerInstanceFlatColorAppearanceVS:()=>PG,_shadersPointCloudEyeDomeLighting:()=>cX,_shadersPointCloudStylingStageVS:()=>TI,_shadersPointPrimitiveCollectionFS:()=>hy,_shadersPointPrimitiveCollectionVS:()=>o2,_shadersPolylineArrowMaterial:()=>SG,_shadersPolylineColorAppearanceVS:()=>eE,_shadersPolylineCommon:()=>jl,_shadersPolylineDashMaterial:()=>CG,_shadersPolylineFS:()=>ex,_shadersPolylineGlowMaterial:()=>VG,_shadersPolylineMaterialAppearanceVS:()=>tE,_shadersPolylineOutlineMaterial:()=>LG,_shadersPolylineShadowVolumeFS:()=>QG,_shadersPolylineShadowVolumeMorphFS:()=>jG,_shadersPolylineShadowVolumeMorphVS:()=>qG,_shadersPolylineShadowVolumeVS:()=>$G,_shadersPolylineVS:()=>rW,_shadersPrimitiveOutlineStageFS:()=>VI,_shadersPrimitiveOutlineStageVS:()=>CI,_shadersRGBToHSB:()=>pR,_shadersRGBToHSL:()=>bR,_shadersRGBToXYZ:()=>yR,_shadersReinhardTonemapping:()=>gw,_shadersReprojectWebMercatorFS:()=>qP,_shadersReprojectWebMercatorVS:()=>$P,_shadersRimLightingMaterial:()=>RG,_shadersSelectedFeatureIdStageCommon:()=>rC,_shadersShadowVolumeAppearanceFS:()=>xS,_shadersShadowVolumeAppearanceVS:()=>MG,_shadersShadowVolumeFS:()=>mb,_shadersSilhouette:()=>xw,_shadersSkinningStageVS:()=>GI,_shadersSkyAtmosphereCommon:()=>hV,_shadersSkyAtmosphereFS:()=>Uw,_shadersSkyAtmosphereVS:()=>kw,_shadersSkyBoxFS:()=>Bw,_shadersSkyBoxVS:()=>Yw,_shadersSlopeRampMaterial:()=>ZG,_shadersStripeMaterial:()=>GG,_shadersSunFS:()=>Kw,_shadersSunTextureFS:()=>Hw,_shadersSunVS:()=>zw,_shadersTexturedMaterialAppearanceFS:()=>dG,_shadersTexturedMaterialAppearanceVS:()=>uG,_shadersVector3DTileClampedPolylinesFS:()=>bW,_shadersVector3DTileClampedPolylinesVS:()=>pW,_shadersVector3DTilePolylinesVS:()=>hW,_shadersVectorTileVS:()=>ES,_shadersViewportQuadFS:()=>iF,_shadersViewportQuadVS:()=>Sg,_shadersVoxelFS:()=>UF,_shadersVoxelVS:()=>kF,_shadersWater:()=>EG,_shadersXYZToRGB:()=>gR,_shadersacesTonemapping:()=>xR,_shadersalphaWeight:()=>_R,_shadersantialias:()=>TR,_shadersapproximateSphericalCoordinates:()=>SR,_shadersbackFacing:()=>CR,_shadersbranchFreeTernary:()=>VR,_shaderscascadeColor:()=>LR,_shaderscascadeDistance:()=>RR,_shaderscascadeMatrix:()=>ZR,_shaderscascadeWeights:()=>GR,_shaderscolumbusViewMorph:()=>ER,_shaderscomputePosition:()=>XR,_shadersconvertUvToBox:()=>zF,_shadersconvertUvToCylinder:()=>JF,_shadersconvertUvToEllipsoid:()=>QF,_shaderscosineAndSine:()=>IR,_shadersdecompressTextureCoordinates:()=>WR,_shadersdefaultPbrMaterial:()=>PR,_shadersdegreesPerRadian:()=>_L,_shadersdepthClamp:()=>vR,_shadersdepthRange:()=>TL,_shadersdepthRangeStruct:()=>oR,_shaderseastNorthUpToEyeCoordinates:()=>wR,_shadersellipsoidContainsPoint:()=>FR,_shadersellipsoidWgs84TextureCoordinates:()=>AR,_shadersepsilon1:()=>SL,_shadersepsilon2:()=>CL,_shadersepsilon3:()=>VL,_shadersepsilon4:()=>LL,_shadersepsilon5:()=>RL,_shadersepsilon6:()=>ZL,_shadersepsilon7:()=>GL,_shadersequalsEpsilon:()=>MR,_shaderseyeOffset:()=>NR,_shaderseyeToWindowCoordinates:()=>UR,_shadersfastApproximateAtan:()=>kR,_shadersfog:()=>DR,_shadersgammaCorrect:()=>BR,_shadersgeodeticSurfaceNormal:()=>YR,_shadersgetDefaultMaterial:()=>OR,_shadersgetLambertDiffuse:()=>KR,_shadersgetSpecular:()=>HR,_shadersgetWaterNoise:()=>zR,_shadershue:()=>JR,_shadersinfinity:()=>EL,_shadersinverseGamma:()=>QR,_shadersisEmpty:()=>jR,_shadersisFull:()=>qR,_shaderslatitudeToWebMercatorFraction:()=>$R,_shaderslineDistance:()=>eZ,_shaderslinearToSrgb:()=>tZ,_shadersluminance:()=>nZ,_shadersmaterial:()=>rR,_shadersmaterialInput:()=>sR,_shadersmetersPerPixel:()=>iZ,_shadersmodelMaterial:()=>aR,_shadersmodelToWindowCoordinates:()=>oZ,_shadersmodelVertexOutput:()=>cR,_shadersmultiplyWithColorBalance:()=>rZ,_shadersnearFarScalar:()=>sZ,_shadersoctDecode:()=>aZ,_shadersoneOverPi:()=>XL,_shadersoneOverTwoPi:()=>IL,_shaderspackDepth:()=>cZ,_shaderspassCesium3DTile:()=>WL,_shaderspassCesium3DTileClassification:()=>PL,_shaderspassCesium3DTileClassificationIgnoreShow:()=>vL,_shaderspassClassification:()=>wL,_shaderspassCompute:()=>FL,_shaderspassEnvironment:()=>AL,_shaderspassGlobe:()=>ML,_shaderspassOpaque:()=>NL,_shaderspassOverlay:()=>UL,_shaderspassTerrainClassification:()=>kL,_shaderspassTranslucent:()=>DL,_shaderspassVoxels:()=>BL,_shaderspbrLighting:()=>lZ,_shaderspbrMetallicRoughnessMaterial:()=>dZ,_shaderspbrParameters:()=>lR,_shaderspbrSpecularGlossinessMaterial:()=>uZ,_shadersphong:()=>mZ,_shaderspi:()=>YL,_shaderspiOverFour:()=>OL,_shaderspiOverSix:()=>KL,_shaderspiOverThree:()=>HL,_shaderspiOverTwo:()=>zL,_shadersplaneDistance:()=>hZ,_shaderspointAlongRay:()=>fZ,_shadersradiansPerDegree:()=>JL,_shadersray:()=>dR,_shadersrayEllipsoidIntersectionInterval:()=>pZ,_shadersraySegment:()=>uR,_shadersraySphereIntersectionInterval:()=>bZ,_shadersreadDepth:()=>yZ,_shadersreadNonPerspective:()=>gZ,_shadersreverseLogDepth:()=>xZ,_shadersround:()=>_Z,_shaderssampleOctahedralProjection:()=>TZ,_shaderssaturation:()=>SZ,_shaderssceneMode2D:()=>QL,_shaderssceneMode3D:()=>jL,_shaderssceneModeColumbusView:()=>qL,_shaderssceneModeMorphing:()=>$L,_shadersshadowDepthCompare:()=>CZ,_shadersshadowParameters:()=>mR,_shadersshadowVisibility:()=>VZ,_shaderssignNotZero:()=>LZ,_shaderssolarRadius:()=>eR,_shaderssphericalHarmonics:()=>RZ,_shaderssrgbToLinear:()=>ZZ,_shaderstangentToEyeSpaceMatrix:()=>GZ,_shaderstextureCube:()=>EZ,_shadersthreePiOver2:()=>tR,_shaderstransformPlane:()=>XZ,_shaderstranslateRelativeToEye:()=>IZ,_shaderstranslucentPhong:()=>WZ,_shaderstranspose:()=>PZ,_shaderstwoPi:()=>nR,_shadersunpackDepth:()=>vZ,_shadersunpackFloat:()=>wZ,_shadersunpackUint:()=>FZ,_shadersvalueTransform:()=>AZ,_shadersvertexLogDepth:()=>MZ,_shaderswebMercatorMaxLatitude:()=>iR,_shaderswindowToEyeCoordinates:()=>NZ,_shaderswriteDepthClamp:()=>UZ,_shaderswriteLogDepth:()=>kZ,_shaderswriteNonPerspective:()=>DZ,addBuffer:()=>kE,addDefaults:()=>PE,addExtensionsRequired:()=>ME,addExtensionsUsed:()=>iu,addPipelineExtras:()=>Eb,addToArray:()=>rs,appendForwardSlash:()=>sL,arrayRemoveDuplicates:()=>go,barycentricCoordinates:()=>Yg,binarySearch:()=>Lo,buildDrawCommand:()=>IX,buildModuleUrl:()=>$t,buildVoxelDrawCommands:()=>tA,clone:()=>Oe,combine:()=>xt,computeFlyToLocationForRectangle:()=>AT,createBillboardPointCallback:()=>Ox,createCommand:()=>Cn,createDefaultImageryProviderViewModels:()=>gA,createDefaultTerrainProviderViewModels:()=>xA,createElevationBandMaterial:()=>Bj,createGooglePhotorealistic3DTileset:()=>Yj,createGuid:()=>Yn,createMaterialPropertyDescriptor:()=>Ro,createOsmBuildingsAsync:()=>Oj,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>ul,createTangentSpaceDebugPrimitive:()=>Kj,createTaskProcessorWorker:()=>Qj,createUniform:()=>$V,createUniformArray:()=>eL,createWorldImageryAsync:()=>P0,createWorldTerrainAsync:()=>ST,decodeGoogleEarthEnterpriseData:()=>hF,decodeVectorPolylinePositions:()=>xW,defaultValue:()=>g,defer:()=>il,defined:()=>d,demodernizeShader:()=>BZ,deprecationWarning:()=>zr,destroyObject:()=>ue,exportKml:()=>uJ,findAccessorMinMax:()=>Zx,findContentMetadata:()=>jx,findGroupMetadata:()=>qx,findTileMetadata:()=>CW,forEachTextureInMaterial:()=>MS,formatError:()=>Tf,freezeRenderState:()=>uB,getAbsoluteUri:()=>Zh,getAccessorByteStride:()=>yl,getBaseUri:()=>aL,getBinaryAccessor:()=>ed,getClipAndStyleCode:()=>IF,getClippingFunction:()=>E0,getComponentReader:()=>Gp,getElement:()=>En,getExtensionFromUri:()=>Vg,getFilenameFromUri:()=>m0,getImageFromTypedArray:()=>fF,getImagePixels:()=>nm,getJsonFromTypedArray:()=>Go,getMagic:()=>ym,getStringFromTypedArray:()=>hl,getTimestamp:()=>gi,hasExtension:()=>ri,heightReferenceOnEntityPropertyChanged:()=>pp,isBitSet:()=>hc,isBlobUri:()=>Lg,isCrossOriginUrl:()=>Rg,isDataUri:()=>jf,isLeapYear:()=>Qf,knockout:()=>Se,knockout_3_5_1:()=>MT,knockout_es5:()=>aA,loadAndExecuteScript:()=>Zg,loadCubeMap:()=>tG,loadImageFromTypedArray:()=>Vx,loadKTX2:()=>rl,mergeSort:()=>w0,moveTechniqueRenderStates:()=>AE,moveTechniquesToExtension:()=>NE,numberOfComponentsForType:()=>nd,objectToQuery:()=>Gg,oneTimeWarning:()=>It,parseBatchTable:()=>wp,parseFeatureMetadataLegacy:()=>rX,parseGlb:()=>wE,parseResponseHeaders:()=>cL,parseStructuralMetadata:()=>oX,pointInsideTriangle:()=>D4,preprocess3DTileContent:()=>tf,processVoxelProperties:()=>eA,queryToObject:()=>Bl,readAccessorPacked:()=>DE,removeExtension:()=>Gx,removeExtensionsRequired:()=>vE,removeExtensionsUsed:()=>Rx,removePipelineExtras:()=>FE,removeUnusedElements:()=>UE,resizeImageToNextPowerOfTwo:()=>Wb,sampleTerrain:()=>q2,sampleTerrainMostDetailed:()=>S0,scaleToGeodeticSurface:()=>Tg,subdivideArray:()=>NG,subscribeAndEvaluate:()=>aa,updateAccessorComponentTypes:()=>BE,updateVersion:()=>YE,usesExtension:()=>tr,viewerCesium3DTilesInspectorMixin:()=>y8,viewerCesiumInspectorMixin:()=>g8,viewerDragDropMixin:()=>_8,viewerPerformanceWatchdogMixin:()=>T8,viewerVoxelInspectorMixin:()=>S8,webGLConstantToGlslType:()=>B4,wrapFunction:()=>pF,writeTextToCanvas:()=>Hx});var xyo=T(S(),1);var eJi=T(S(),1);var Gxt=T(S(),1);var qgt=T(S(),1);var Ugt=T(S(),1);var Pgt=T(S(),1);function X_e(e){return e!=null}var d=X_e;var Fgt=T(S(),1);function xg(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}d(Object.create)&&(xg.prototype=Object.create(Error.prototype),xg.prototype.constructor=xg);xg.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return d(this.stack)&&(e+=`
${this.stack.toString()}`),e};xg.throwInstantiationError=function(){throw new xg("This function defines an interface and should not be called directly.")};var fe=xg;var is={};is.typeOf={};function I_e(e){return`${e} is required, actual value was undefined`}function HT(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}is.defined=function(e,t){if(!d(t))throw new fe(I_e(e))};is.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(HT(typeof t,"function",e))};is.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(HT(typeof t,"string",e))};is.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(HT(typeof t,"number",e))};is.typeOf.number.lessThan=function(e,t,n){if(is.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};is.typeOf.number.lessThanOrEquals=function(e,t,n){if(is.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};is.typeOf.number.greaterThan=function(e,t,n){if(is.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};is.typeOf.number.greaterThanOrEquals=function(e,t,n){if(is.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};is.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(HT(typeof t,"object",e))};is.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(HT(typeof t,"boolean",e))};is.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(HT(typeof t,"bigint",e))};is.typeOf.number.equals=function(e,t,n,i){if(is.typeOf.number(e,n),is.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var tl=is;var Dgt=T(S(),1);function D8(e,t){return e??t}D8.EMPTY_OBJECT=Object.freeze({});var g=D8;var Hgt=T(S(),1),HD=T(o9(),1);var at={};at.EPSILON1=.1;at.EPSILON2=.01;at.EPSILON3=.001;at.EPSILON4=1e-4;at.EPSILON5=1e-5;at.EPSILON6=1e-6;at.EPSILON7=1e-7;at.EPSILON8=1e-8;at.EPSILON9=1e-9;at.EPSILON10=1e-10;at.EPSILON11=1e-11;at.EPSILON12=1e-12;at.EPSILON13=1e-13;at.EPSILON14=1e-14;at.EPSILON15=1e-15;at.EPSILON16=1e-16;at.EPSILON17=1e-17;at.EPSILON18=1e-18;at.EPSILON19=1e-19;at.EPSILON20=1e-20;at.EPSILON21=1e-21;at.GRAVITATIONALPARAMETER=3986004418e5;at.SOLAR_RADIUS=6955e5;at.LUNAR_RADIUS=1737400;at.SIXTY_FOUR_KILOBYTES=64*1024;at.FOUR_GIGABYTES=4*1024*1024*1024;at.sign=g(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});at.signNotZero=function(e){return e<0?-1:1};at.toSNorm=function(e,t){return t=g(t,255),Math.round((at.clamp(e,-1,1)*.5+.5)*t)};at.fromSNorm=function(e,t){return t=g(t,255),at.clamp(e,0,t)/t*2-1};at.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:at.clamp((e-t)/n,0,1)};at.sinh=g(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});at.cosh=g(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});at.lerp=function(e,t,n){return(1-n)*e+n*t};at.PI=Math.PI;at.ONE_OVER_PI=1/Math.PI;at.PI_OVER_TWO=Math.PI/2;at.PI_OVER_THREE=Math.PI/3;at.PI_OVER_FOUR=Math.PI/4;at.PI_OVER_SIX=Math.PI/6;at.THREE_PI_OVER_TWO=3*Math.PI/2;at.TWO_PI=2*Math.PI;at.ONE_OVER_TWO_PI=1/(2*Math.PI);at.RADIANS_PER_DEGREE=Math.PI/180;at.DEGREES_PER_RADIAN=180/Math.PI;at.RADIANS_PER_ARCSECOND=at.RADIANS_PER_DEGREE/3600;at.toRadians=function(e){return e*at.RADIANS_PER_DEGREE};at.toDegrees=function(e){return e*at.DEGREES_PER_RADIAN};at.convertLongitudeRange=function(e){let t=at.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};at.clampToLatitudeRange=function(e){return at.clamp(e,-1*at.PI_OVER_TWO,at.PI_OVER_TWO)};at.negativePiToPi=function(e){return e>=-at.PI&&e<=at.PI?e:at.zeroToTwoPi(e+at.PI)-at.PI};at.zeroToTwoPi=function(e){if(e>=0&&e<=at.TWO_PI)return e;let t=at.mod(e,at.TWO_PI);return Math.abs(t)<at.EPSILON14&&Math.abs(e)>at.EPSILON14?at.TWO_PI:t};at.mod=function(e,t){return at.sign(e)===at.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};at.equalsEpsilon=function(e,t,n,i){n=g(n,0),i=g(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};at.lessThan=function(e,t,n){return e-t<-n};at.lessThanOrEquals=function(e,t,n){return e-t<n};at.greaterThan=function(e,t,n){return e-t>n};at.greaterThanOrEquals=function(e,t,n){return e-t>-n};var r9=[1];at.factorial=function(e){let t=r9.length;if(e>=t){let n=r9[t-1];for(let i=t;i<=e;i++){let o=n*i;r9.push(o),n=o}}return r9[e]};at.incrementWrap=function(e,t,n){return n=g(n,0),++e,e>t&&(e=n),e};at.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};at.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};at.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};at.clamp=function(e,t,n){return e<t?t:e>n?n:e};var Y8=new HD.default;at.setRandomNumberSeed=function(e){Y8=new HD.default(e)};at.nextRandomNumber=function(){return Y8.random()};at.randomBetween=function(e,t){return at.nextRandomNumber()*(t-e)+e};at.acosClamped=function(e){return Math.acos(at.clamp(e,-1,1))};at.asinClamped=function(e){return Math.asin(at.clamp(e,-1,1))};at.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};at.logBase=function(e,t){return Math.log(e)/Math.log(t)};at.cbrt=g(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});at.log2=g(Math.log2,function(t){return Math.log(t)*Math.LOG2E});at.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};at.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};at.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=at.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?at.PI_OVER_TWO-i:i,i=e<0?at.PI-i:i,i=t<0?-i:i,i};var W=at;function et(e,t,n){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0)}et.fromSpherical=function(e,t){d(t)||(t=new et);let n=e.clock,i=e.cone,o=g(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};et.fromElements=function(e,t,n,i){return d(i)?(i.x=e,i.y=t,i.z=n,i):new et(e,t,n)};et.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new et(e.x,e.y,e.z)};et.fromCartesian4=et.clone;et.packedLength=3;et.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new et),n.x=e[t++],n.y=e[t++],n.z=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*3;d(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)et.pack(e[o],t,o*3);return t};et.unpackArray=function(e,t){let n=e.length;d(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=et.unpack(e,i,t[o])}return t};et.fromArray=et.unpack;et.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};et.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};et.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};et.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};et.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};et.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};et.magnitude=function(e){return Math.sqrt(et.magnitudeSquared(e))};var a9=new et;et.distance=function(e,t){return et.subtract(e,t,a9),et.magnitude(a9)};et.distanceSquared=function(e,t){return et.subtract(e,t,a9),et.magnitudeSquared(a9)};et.normalize=function(e,t){let n=et.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};et.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};et.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};et.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};et.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};et.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};et.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};et.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};et.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};et.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var O8=new et;et.lerp=function(e,t,n,i){return et.multiplyByScalar(t,n,O8),i=et.multiplyByScalar(e,1-n,i),et.add(O8,i,i)};var s9=new et,zD=new et;et.angleBetween=function(e,t){et.normalize(e,s9),et.normalize(t,zD);let n=et.dot(s9,zD),i=et.magnitude(et.cross(s9,zD,s9));return Math.atan2(i,n)};var W_e=new et;et.mostOrthogonalAxis=function(e,t){let n=et.normalize(e,W_e);return et.abs(n,n),n.x<=n.y?n.x<=n.z?t=et.clone(et.UNIT_X,t):t=et.clone(et.UNIT_Z,t):n.y<=n.z?t=et.clone(et.UNIT_Y,t):t=et.clone(et.UNIT_Z,t),t};et.projectVector=function(e,t,n){let i=et.dot(e,t)/et.dot(t,t);return et.multiplyByScalar(t,i,n)};et.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};et.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};et.equalsEpsilon=function(e,t,n,i){return e===t||d(e)&&d(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)};et.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,l=o*c-r*a,u=r*s-i*c,m=i*a-o*s;return n.x=l,n.y=u,n.z=m,n};et.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};et.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(e),t=W.toRadians(t),et.fromRadians(e,t,n,i,o)};var Bd=new et,zT=new et,P_e=new et(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);et.fromRadians=function(e,t,n,i,o){n=g(n,0);let r=d(i)?i.radiiSquared:P_e,s=Math.cos(t);Bd.x=s*Math.cos(e),Bd.y=s*Math.sin(e),Bd.z=Math.sin(t),Bd=et.normalize(Bd,Bd),et.multiplyComponents(r,Bd,zT);let a=Math.sqrt(et.dot(Bd,zT));return zT=et.divideByScalar(zT,a,zT),Bd=et.multiplyByScalar(Bd,n,Bd),d(o)||(o=new et),et.add(zT,Bd,o)};et.fromDegreesArray=function(e,t,n){let i=e.length;d(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromDegrees(r,s,0,t,n[a])}return n};et.fromRadiansArray=function(e,t,n){let i=e.length;d(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromRadians(r,s,0,t,n[a])}return n};et.fromDegreesArrayHeights=function(e,t,n){let i=e.length;d(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromDegrees(r,s,a,t,n[c])}return n};et.fromRadiansArrayHeights=function(e,t,n){let i=e.length;d(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromRadians(r,s,a,t,n[c])}return n};et.ZERO=Object.freeze(new et(0,0,0));et.ONE=Object.freeze(new et(1,1,1));et.UNIT_X=Object.freeze(new et(1,0,0));et.UNIT_Y=Object.freeze(new et(0,1,0));et.UNIT_Z=Object.freeze(new et(0,0,1));et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.prototype.equalsEpsilon=function(e,t,n){return et.equalsEpsilon(this,e,t,n)};et.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=et;var Txt=T(S(),1);var ixt=T(S(),1);function bt(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}bt.fromElements=function(e,t,n,i,o){return d(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new bt(e,t,n,i)};bt.fromColor=function(e,t){return d(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new bt(e.red,e.green,e.blue,e.alpha)};bt.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new bt(e.x,e.y,e.z,e.w)};bt.packedLength=4;bt.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};bt.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new bt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};bt.packArray=function(e,t){let n=e.length,i=n*4;d(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)bt.pack(e[o],t,o*4);return t};bt.unpackArray=function(e,t){let n=e.length;d(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=bt.unpack(e,i,t[o])}return t};bt.fromArray=bt.unpack;bt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};bt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};bt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};bt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};bt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z),a=W.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};bt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};bt.magnitude=function(e){return Math.sqrt(bt.magnitudeSquared(e))};var c9=new bt;bt.distance=function(e,t){return bt.subtract(e,t,c9),bt.magnitude(c9)};bt.distanceSquared=function(e,t){return bt.subtract(e,t,c9),bt.magnitudeSquared(c9)};bt.normalize=function(e,t){let n=bt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};bt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};bt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};bt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};bt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};bt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};bt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};bt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};bt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};bt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var K8=new bt;bt.lerp=function(e,t,n,i){return bt.multiplyByScalar(t,n,K8),i=bt.multiplyByScalar(e,1-n,i),bt.add(K8,i,i)};var v_e=new bt;bt.mostOrthogonalAxis=function(e,t){let n=bt.normalize(e,v_e);return bt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=bt.clone(bt.UNIT_X,t):t=bt.clone(bt.UNIT_W,t):n.z<=n.w?t=bt.clone(bt.UNIT_Z,t):t=bt.clone(bt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=bt.clone(bt.UNIT_Y,t):t=bt.clone(bt.UNIT_W,t):n.z<=n.w?t=bt.clone(bt.UNIT_Z,t):t=bt.clone(bt.UNIT_W,t),t};bt.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};bt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};bt.equalsEpsilon=function(e,t,n,i){return e===t||d(e)&&d(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)&&W.equalsEpsilon(e.w,t.w,n,i)};bt.ZERO=Object.freeze(new bt(0,0,0,0));bt.ONE=Object.freeze(new bt(1,1,1,1));bt.UNIT_X=Object.freeze(new bt(1,0,0,0));bt.UNIT_Y=Object.freeze(new bt(0,1,0,0));bt.UNIT_Z=Object.freeze(new bt(0,0,1,0));bt.UNIT_W=Object.freeze(new bt(0,0,0,1));bt.prototype.clone=function(e){return bt.clone(this,e)};bt.prototype.equals=function(e){return bt.equals(this,e)};bt.prototype.equalsEpsilon=function(e,t,n){return bt.equalsEpsilon(this,e,t,n)};bt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var JD=new Float32Array(1),Ia=new Uint8Array(JD.buffer),w_e=new Uint32Array([287454020]),F_e=new Uint8Array(w_e.buffer),H8=F_e[0]===68;bt.packFloat=function(e,t){return d(t)||(t=new bt),JD[0]=e,H8?(t.x=Ia[0],t.y=Ia[1],t.z=Ia[2],t.w=Ia[3]):(t.x=Ia[3],t.y=Ia[2],t.z=Ia[1],t.w=Ia[0]),t};bt.unpackFloat=function(e){return H8?(Ia[0]=e.x,Ia[1]=e.y,Ia[2]=e.z,Ia[3]=e.w):(Ia[0]=e.w,Ia[1]=e.z,Ia[2]=e.y,Ia[3]=e.x),JD[0]};var se=bt;var lxt=T(S(),1);function tt(e,t,n,i,o,r,s,a,c){this[0]=g(e,0),this[1]=g(i,0),this[2]=g(s,0),this[3]=g(t,0),this[4]=g(o,0),this[5]=g(a,0),this[6]=g(n,0),this[7]=g(r,0),this[8]=g(c,0)}tt.packedLength=9;tt.pack=function(e,t,n){return n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};tt.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new tt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};tt.packArray=function(e,t){let n=e.length,i=n*9;d(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)tt.pack(e[o],t,o*9);return t};tt.unpackArray=function(e,t){let n=e.length;d(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return d(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,l=e.z*e.z,u=e.z*e.w,m=e.w*e.w,p=n-s-l+m,y=2*(i-u),f=2*(o+c),x=2*(i+u),_=-n+s-l+m,C=2*(a-r),V=2*(o-c),L=2*(a+r),Z=-n-s+l+m;return d(t)?(t[0]=p,t[1]=x,t[2]=V,t[3]=y,t[4]=_,t[5]=L,t[6]=f,t[7]=C,t[8]=Z,t):new tt(p,y,f,x,_,C,V,L,Z)};tt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,l=-o*s+a*r*i,u=a*s+o*r*i,m=n*s,p=o*i+a*r*s,y=-a*i+o*r*s,f=-r,x=a*n,_=o*n;return d(t)?(t[0]=c,t[1]=m,t[2]=f,t[3]=l,t[4]=p,t[5]=x,t[6]=u,t[7]=y,t[8]=_,t):new tt(c,l,u,m,p,y,f,x,_)};tt.fromScale=function(e,t){return d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return d(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return d(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return d(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return d(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};tt.getElementIndex=function(e,t){return e*3+t};tt.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var A_e=new h;tt.setScale=function(e,t,n){let i=tt.getScale(e,A_e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var M_e=new h;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,M_e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var QD=new h;tt.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],QD)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],QD)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],QD)),t};var z8=new h;tt.getMaximumScale=function(e){return tt.getScale(e,z8),h.maximumComponent(z8)};var N_e=new h;tt.setRotation=function(e,t,n){let i=tt.getScale(e,N_e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var U_e=new h;tt.getRotation=function(e,t){let n=tt.getScale(e,U_e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};tt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],l=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],m=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=l,n[7]=u,n[8]=m,n};tt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};tt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};tt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};tt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};tt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};tt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],l=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=l,t[8]=u,t};function k_e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var jD=[1,0,0],qD=[2,2,1];function D_e(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(qD[n],jD[n])];t+=2*i*i}return Math.sqrt(t)}function B_e(e,t){let n=W.EPSILON15,i=0,o=1;for(let l=0;l<3;++l){let u=Math.abs(e[tt.getElementIndex(qD[l],jD[l])]);u>i&&(o=l,i=u)}let r=1,s=0,a=jD[o],c=qD[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let l=e[tt.getElementIndex(c,c)],u=e[tt.getElementIndex(a,a)],m=e[tt.getElementIndex(c,a)],p=(l-u)/2/m,y;p<0?y=-1/(-p+Math.sqrt(1+p*p)):y=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+y*y),s=y*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var l9=new tt,J8=new tt;tt.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;d(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*k_e(a);for(;r<i&&D_e(a)>c;)B_e(a,l9),tt.transpose(l9,J8),tt.multiply(a,l9,a),tt.multiply(J8,a,a),tt.multiply(s,l9,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],l=e[8];return t*(r*l-c*s)+o*(c*i-n*l)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],m=tt.determinant(e);t[0]=s*u-l*a,t[1]=l*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*l-c*s,t[7]=c*i-n*l,t[8]=n*s-r*i;let p=1/m;return tt.multiplyByScalar(t,p,t)};var Y_e=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,Y_e),t)};tt.equals=function(e,t){return e===t||d(e)&&d(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var $=tt;var mxt=T(S(),1);function JV(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}d(Object.create)&&(JV.prototype=Object.create(Error.prototype),JV.prototype.constructor=JV);JV.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return d(this.stack)&&(e+=`
${this.stack.toString()}`),e};var me=JV;function $e(e,t,n,i,o,r,s,a,c,l,u,m,p,y,f,x){this[0]=g(e,0),this[1]=g(o,0),this[2]=g(c,0),this[3]=g(p,0),this[4]=g(t,0),this[5]=g(r,0),this[6]=g(l,0),this[7]=g(y,0),this[8]=g(n,0),this[9]=g(s,0),this[10]=g(u,0),this[11]=g(f,0),this[12]=g(i,0),this[13]=g(a,0),this[14]=g(m,0),this[15]=g(x,0)}$e.packedLength=16;$e.pack=function(e,t,n){return n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};$e.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new $e),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*16;d(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)$e.pack(e[o],t,o*16);return t};$e.unpackArray=function(e,t){let n=e.length;d(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=$e.unpack(e,i,t[o])}return t};$e.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new $e(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};$e.fromArray=$e.unpack;$e.fromColumnMajorArray=function(e,t){return $e.clone(e,t)};$e.fromRowMajorArray=function(e,t){return d(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new $e(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};$e.fromRotationTranslation=function(e,t,n){return t=g(t,h.ZERO),d(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new $e(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};$e.fromTranslationQuaternionRotationScale=function(e,t,n,i){d(i)||(i=new $e);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,l=t.x*t.z,u=t.x*t.w,m=t.y*t.y,p=t.y*t.z,y=t.y*t.w,f=t.z*t.z,x=t.z*t.w,_=t.w*t.w,C=a-m-f+_,V=2*(c-x),L=2*(l+y),Z=2*(c+x),G=-a+m-f+_,X=2*(p-u),P=2*(l-y),v=2*(p+u),A=-a-m+f+_;return i[0]=C*o,i[1]=Z*o,i[2]=P*o,i[3]=0,i[4]=V*r,i[5]=G*r,i[6]=v*r,i[7]=0,i[8]=L*s,i[9]=X*s,i[10]=A*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};$e.fromTranslationRotationScale=function(e,t){return $e.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};$e.fromTranslation=function(e,t){return $e.fromRotationTranslation($.IDENTITY,e,t)};$e.fromScale=function(e,t){return d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};$e.fromUniformScale=function(e,t){return d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};$e.fromRotation=function(e,t){return d(t)||(t=new $e),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var JT=new h,QT=new h,QV=new h;$e.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,JT),h.normalize(h.cross(JT,o,QT),QT),h.normalize(h.cross(QT,JT,QV),QV);let r=QT.x,s=QT.y,a=QT.z,c=JT.x,l=JT.y,u=JT.z,m=QV.x,p=QV.y,y=QV.z,f=n.x,x=n.y,_=n.z,C=r*-f+s*-x+a*-_,V=m*-f+p*-x+y*-_,L=c*f+l*x+u*_;return d(t)?(t[0]=r,t[1]=m,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-l,t[7]=0,t[8]=a,t[9]=y,t[10]=-u,t[11]=0,t[12]=C,t[13]=V,t[14]=L,t[15]=1,t):new $e(r,s,a,C,m,p,y,V,-c,-l,-u,L,0,0,0,1)};$e.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),l=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o};$e.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),l=1/(r-o),u=-(t+e)*a,m=-(i+n)*c,p=-(r+o)*l;return a*=2,c*=2,l*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=l,s[11]=0,s[12]=u,s[13]=m,s[14]=p,s[15]=1,s};$e.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),l=(t+e)/(t-e),u=(i+n)/(i-n),m=-(r+o)/(r-o),p=-1,y=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=l,s[9]=u,s[10]=m,s[11]=p,s[12]=0,s[13]=0,s[14]=y,s[15]=0,s};$e.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),l=(i+n)/(i-n),u=-1,m=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=l,r[10]=u,r[11]=m,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};$e.computeViewportTransformation=function(e,t,n,i){d(i)||(i=new $e),e=g(e,g.EMPTY_OBJECT);let o=g(e.x,0),r=g(e.y,0),s=g(e.width,0),a=g(e.height,0);t=g(t,0),n=g(n,1);let c=s*.5,l=a*.5,u=(n-t)*.5,m=c,p=l,y=u,f=o+c,x=r+l,_=t+u,C=1;return i[0]=m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=y,i[11]=0,i[12]=f,i[13]=x,i[14]=_,i[15]=C,i};$e.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};$e.toArray=function(e,t){return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};$e.getElementIndex=function(e,t){return e*4+t};$e.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};$e.setColumn=function(e,t,n,i){i=$e.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};$e.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};$e.setRow=function(e,t,n,i){return i=$e.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};$e.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var O_e=new h;$e.setScale=function(e,t,n){let i=$e.getScale(e,O_e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var K_e=new h;$e.setUniformScale=function(e,t,n){let i=$e.getScale(e,K_e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var $D=new h;$e.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],$D)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],$D)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],$D)),t};var Q8=new h;$e.getMaximumScale=function(e){return $e.getScale(e,Q8),h.maximumComponent(Q8)};var H_e=new h;$e.setRotation=function(e,t,n){let i=$e.getScale(e,H_e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var z_e=new h;$e.getRotation=function(e,t){let n=$e.getScale(e,z_e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};$e.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],m=e[8],p=e[9],y=e[10],f=e[11],x=e[12],_=e[13],C=e[14],V=e[15],L=t[0],Z=t[1],G=t[2],X=t[3],P=t[4],v=t[5],A=t[6],M=t[7],b=t[8],R=t[9],E=t[10],I=t[11],w=t[12],N=t[13],Y=t[14],k=t[15],O=i*L+a*Z+m*G+x*X,U=o*L+c*Z+p*G+_*X,J=r*L+l*Z+y*G+C*X,z=s*L+u*Z+f*G+V*X,ee=i*P+a*v+m*A+x*M,K=o*P+c*v+p*A+_*M,j=r*P+l*v+y*A+C*M,q=s*P+u*v+f*A+V*M,be=i*b+a*R+m*E+x*I,Te=o*b+c*R+p*E+_*I,ae=r*b+l*R+y*E+C*I,xe=s*b+u*R+f*E+V*I,_e=i*w+a*N+m*Y+x*k,Ve=o*w+c*N+p*Y+_*k,Ie=r*w+l*N+y*Y+C*k,Me=s*w+u*N+f*Y+V*k;return n[0]=O,n[1]=U,n[2]=J,n[3]=z,n[4]=ee,n[5]=K,n[6]=j,n[7]=q,n[8]=be,n[9]=Te,n[10]=ae,n[11]=xe,n[12]=_e,n[13]=Ve,n[14]=Ie,n[15]=Me,n};$e.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};$e.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};$e.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],l=e[8],u=e[9],m=e[10],p=e[12],y=e[13],f=e[14],x=t[0],_=t[1],C=t[2],V=t[4],L=t[5],Z=t[6],G=t[8],X=t[9],P=t[10],v=t[12],A=t[13],M=t[14],b=i*x+s*_+l*C,R=o*x+a*_+u*C,E=r*x+c*_+m*C,I=i*V+s*L+l*Z,w=o*V+a*L+u*Z,N=r*V+c*L+m*Z,Y=i*G+s*X+l*P,k=o*G+a*X+u*P,O=r*G+c*X+m*P,U=i*v+s*A+l*M+p,J=o*v+a*A+u*M+y,z=r*v+c*A+m*M+f;return n[0]=b,n[1]=R,n[2]=E,n[3]=0,n[4]=I,n[5]=w,n[6]=N,n[7]=0,n[8]=Y,n[9]=k,n[10]=O,n[11]=0,n[12]=U,n[13]=J,n[14]=z,n[15]=1,n};$e.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],l=e[8],u=e[9],m=e[10],p=t[0],y=t[1],f=t[2],x=t[3],_=t[4],C=t[5],V=t[6],L=t[7],Z=t[8],G=i*p+s*y+l*f,X=o*p+a*y+u*f,P=r*p+c*y+m*f,v=i*x+s*_+l*C,A=o*x+a*_+u*C,M=r*x+c*_+m*C,b=i*V+s*L+l*Z,R=o*V+a*L+u*Z,E=r*V+c*L+m*Z;return n[0]=G,n[1]=X,n[2]=P,n[3]=0,n[4]=v,n[5]=A,n[6]=M,n[7]=0,n[8]=b,n[9]=R,n[10]=E,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};$e.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?$e.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};$e.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,l=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=l,n.w=u,n};$e.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};$e.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};$e.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};$e.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};$e.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};$e.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};$e.equals=function(e,t){return e===t||d(e)&&d(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};$e.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};$e.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};$e.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var J_e=new $,Q_e=new $,j_e=new se,q_e=new se(0,0,0,1);$e.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],l=e[13],u=e[2],m=e[6],p=e[10],y=e[14],f=e[3],x=e[7],_=e[11],C=e[15],V=p*C,L=y*_,Z=m*C,G=y*x,X=m*_,P=p*x,v=u*C,A=y*f,M=u*_,b=p*f,R=u*x,E=m*f,I=V*a+G*c+X*l-(L*a+Z*c+P*l),w=L*s+v*c+b*l-(V*s+A*c+M*l),N=Z*s+A*a+R*l-(G*s+v*a+E*l),Y=P*s+M*a+E*c-(X*s+b*a+R*c),k=L*i+Z*o+P*r-(V*i+G*o+X*r),O=V*n+A*o+M*r-(L*n+v*o+b*r),U=G*n+v*i+E*r-(Z*n+A*i+R*r),J=X*n+b*i+R*o-(P*n+M*i+E*o);V=o*l,L=r*c,Z=i*l,G=r*a,X=i*c,P=o*a,v=n*l,A=r*s,M=n*c,b=o*s,R=n*a,E=i*s;let z=V*x+G*_+X*C-(L*x+Z*_+P*C),ee=L*f+v*_+b*C-(V*f+A*_+M*C),K=Z*f+A*x+R*C-(G*f+v*x+E*C),j=P*f+M*x+E*_-(X*f+b*x+R*_),q=Z*p+P*y+L*m-(X*y+V*m+G*p),be=M*y+V*u+A*p-(v*p+b*y+L*u),Te=v*m+E*y+G*u-(R*y+Z*u+A*m),ae=R*p+X*u+b*m-(M*m+E*p+P*u),xe=n*I+i*w+o*N+r*Y;if(Math.abs(xe)<W.EPSILON21){if($.equalsEpsilon($e.getMatrix3(e,J_e),Q_e,W.EPSILON7)&&se.equals($e.getRow(e,3,j_e),q_e))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new me("matrix is not invertible because its determinate is zero.")}return xe=1/xe,t[0]=I*xe,t[1]=w*xe,t[2]=N*xe,t[3]=Y*xe,t[4]=k*xe,t[5]=O*xe,t[6]=U*xe,t[7]=J*xe,t[8]=z*xe,t[9]=ee*xe,t[10]=K*xe,t[11]=j*xe,t[12]=q*xe,t[13]=be*xe,t[14]=Te*xe,t[15]=ae*xe,t};$e.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],l=e[9],u=e[10],m=e[12],p=e[13],y=e[14],f=-n*m-i*p-o*y,x=-r*m-s*p-a*y,_=-c*m-l*p-u*y;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=l,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=f,t[13]=x,t[14]=_,t[15]=1,t};var $_e=new $e;$e.inverseTranspose=function(e,t){return $e.inverse($e.transpose(e,$_e),t)};$e.IDENTITY=Object.freeze(new $e(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));$e.ZERO=Object.freeze(new $e(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));$e.COLUMN0ROW0=0;$e.COLUMN0ROW1=1;$e.COLUMN0ROW2=2;$e.COLUMN0ROW3=3;$e.COLUMN1ROW0=4;$e.COLUMN1ROW1=5;$e.COLUMN1ROW2=6;$e.COLUMN1ROW3=7;$e.COLUMN2ROW0=8;$e.COLUMN2ROW1=9;$e.COLUMN2ROW2=10;$e.COLUMN2ROW3=11;$e.COLUMN3ROW0=12;$e.COLUMN3ROW1=13;$e.COLUMN3ROW2=14;$e.COLUMN3ROW3=15;Object.defineProperties($e.prototype,{length:{get:function(){return $e.packedLength}}});$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};$e.prototype.equalsEpsilon=function(e,t){return $e.equalsEpsilon(this,e,t)};$e.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=$e;var Cxt=T(S(),1),eTe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},ne=Object.freeze(eTe);var tTe=new h;function Yt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ns={};Ns[ne.FLOAT]="float";Ns[ne.FLOAT_VEC2]="vec2";Ns[ne.FLOAT_VEC3]="vec3";Ns[ne.FLOAT_VEC4]="vec4";Ns[ne.INT]="int";Ns[ne.INT_VEC2]="ivec2";Ns[ne.INT_VEC3]="ivec3";Ns[ne.INT_VEC4]="ivec4";Ns[ne.BOOL]="bool";Ns[ne.BOOL_VEC2]="bvec2";Ns[ne.BOOL_VEC3]="bvec3";Ns[ne.BOOL_VEC4]="bvec4";Ns[ne.FLOAT_MAT2]="mat2";Ns[ne.FLOAT_MAT3]="mat3";Ns[ne.FLOAT_MAT4]="mat4";Ns[ne.SAMPLER_2D]="sampler2D";Ns[ne.SAMPLER_CUBE]="samplerCube";Yt.prototype.getDeclaration=function(e){let t=`uniform ${Ns[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var nTe={czm_viewport:new Yt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Yt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Yt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Yt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new Yt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Yt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Yt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,tTe)}}),czm_frameNumber:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Yt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Yt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Yt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Yt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new Yt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Yt({size:9,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Yt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Yt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Yt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Yt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Yf=nTe;var Jxt=T(S(),1);var Xxt=T(S(),1);function iTe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Yn=iTe;var Pxt=T(S(),1);function oTe(){return!0}function rTe(e,t){t=g(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=oTe}var ue=rTe;var Mxt=T(S(),1);var gs={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT};gs.getSizeInBytes=function(e){switch(e){case gs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case gs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case gs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};gs.fromSizeInBytes=function(e){switch(e){case 2:return gs.UNSIGNED_SHORT;case 4:return gs.UNSIGNED_INT;case 1:return gs.UNSIGNED_BYTE}};gs.validate=function(e){return d(e)&&(e===gs.UNSIGNED_BYTE||e===gs.UNSIGNED_SHORT||e===gs.UNSIGNED_INT)};gs.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};gs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};gs.fromTypedArray=function(e){if(e instanceof Uint8Array)return gs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return gs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return gs.UNSIGNED_INT};var Ue=Object.freeze(gs);var kxt=T(S(),1);var d9={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,validate:function(e){return e===d9.STREAM_DRAW||e===d9.STATIC_DRAW||e===d9.DYNAMIC_DRAW}},Ne=Object.freeze(d9);function Yd(e){e=g(e,g.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=d(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Yn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Yd.createVertexBuffer=function(e){return new Yd({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yd.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new Yd({context:t,bufferTarget:ne.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Yd.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yd.prototype._getBuffer=function(){return this._buffer};Yd.prototype.copyFromArrayView=function(e,t){t=g(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Yd.prototype.copyFromBuffer=function(e,t,n,i){let o=ne.COPY_READ_BUFFER,r=ne.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};Yd.prototype.getBufferData=function(e,t,n,i){t=g(t,0),n=g(n,0);let o=this._gl,r=ne.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Yd.prototype.isDestroyed=function(){return!1};Yd.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var mt=Yd;var h_t=T(S(),1);var l_t=T(S(),1);var i_t=T(S(),1);var qxt=T(S(),1);var j0,pr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},nl={};Object.defineProperties(nl,{element:{get:function(){if(nl.supportsFullscreen())return document[pr.fullscreenElement]}},changeEventName:{get:function(){if(nl.supportsFullscreen())return pr.fullscreenchange}},errorEventName:{get:function(){if(nl.supportsFullscreen())return pr.fullscreenerror}},enabled:{get:function(){if(nl.supportsFullscreen())return document[pr.fullscreenEnabled]}},fullscreen:{get:function(){if(nl.supportsFullscreen())return nl.element!==null}}});nl.supportsFullscreen=function(){if(d(j0))return j0;j0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return pr.requestFullscreen="requestFullscreen",pr.exitFullscreen="exitFullscreen",pr.fullscreenEnabled="fullscreenEnabled",pr.fullscreenElement="fullscreenElement",pr.fullscreenchange="fullscreenchange",pr.fullscreenerror="fullscreenerror",j0=!0,j0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(pr.requestFullscreen=n,j0=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(pr.requestFullscreen=n,j0=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?pr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(pr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?pr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(pr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?pr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(pr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),pr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),pr.fullscreenerror=n)}return j0};nl.requestFullscreen=function(e,t){nl.supportsFullscreen()&&e[pr.requestFullscreen]({vrDisplay:t})};nl.exitFullscreen=function(){nl.supportsFullscreen()&&document[pr.exitFullscreen]()};nl._names=pr;var lr=nl;var Wa;typeof navigator<"u"?Wa=navigator:Wa={};function _g(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var u9,j8;function rB(){if(!d(u9)&&(u9=!1,!y9())){let e=/ Chrome\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(u9=!0,j8=_g(e[1]))}return u9}function sTe(){return rB()&&j8}var m9,q8;function $8(){if(!d(m9)&&(m9=!1,!rB()&&!y9()&&/ Safari\/[\.0-9]+/.test(Wa.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(m9=!0,q8=_g(e[1]))}return m9}function aTe(){return $8()&&q8}var h9,iB;function e7(){if(!d(h9)){h9=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Wa.userAgent);e!==null&&(h9=!0,iB=_g(e[1]),iB.isNightly=!!e[2])}return h9}function cTe(){return e7()&&iB}var jV,oB;function t7(){if(!d(jV)){jV=!1;let e;Wa.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Wa.userAgent),e!==null&&(jV=!0,oB=_g(e[1]))):Wa.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Wa.userAgent),e!==null&&(jV=!0,oB=_g(e[1])))}return jV}function lTe(){return t7()&&oB}var f9,n7;function y9(){if(!d(f9)){f9=!1;let e=/ Edg\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(f9=!0,n7=_g(e[1]))}return f9}function dTe(){return y9()&&n7}var p9,sB;function g9(){if(!d(p9)){p9=!1;let e=/Firefox\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(p9=!0,sB=_g(e[1]))}return p9}var eB;function uTe(){return d(eB)||(eB=/Windows/i.test(Wa.appVersion)),eB}var tB;function mTe(){return d(tB)||(tB=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),tB}function hTe(){return g9()&&sB}var nB;function fTe(){return d(nB)||(nB=!g9()&&typeof PointerEvent<"u"&&(!d(Wa.pointerEnabled)||Wa.pointerEnabled)),nB}var i7,b9;function o7(){if(!d(b9)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;b9=d(t)&&t!=="",b9&&(i7=t)}return b9}function pTe(){return o7()?i7:void 0}function gc(){return gc._result}gc._promise=void 0;gc._result=void 0;gc.initialize=function(){return d(gc._promise)||(gc._promise=new Promise(e=>{let t=new Image;t.onload=function(){gc._result=t.width>0&&t.height>0,e(gc._result)},t.onerror=function(){gc._result=!1,e(gc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),gc._promise};Object.defineProperties(gc,{initialized:{get:function(){return d(gc._result)}}});var jT=[];typeof ArrayBuffer<"u"&&(jT.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&jT.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&jT.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&jT.push(BigInt64Array),typeof BigUint64Array<"u"&&jT.push(BigUint64Array));var Od={isChrome:rB,chromeVersion:sTe,isSafari:$8,safariVersion:aTe,isWebkit:e7,webkitVersion:cTe,isInternetExplorer:t7,internetExplorerVersion:lTe,isEdge:y9,edgeVersion:dTe,isFirefox:g9,firefoxVersion:hTe,isWindows:uTe,isIPadOrIOS:mTe,hardwareConcurrency:g(Wa.hardwareConcurrency,3),supportsPointerEvents:fTe,supportsImageRenderingPixelated:o7,supportsWebP:gc,imageRenderingValue:pTe,typedArrayTypes:jT};Od.supportsBasis=function(e){return Od.supportsWebAssembly()&&e.context.supportsBasis};Od.supportsFullscreen=function(){return lr.supportsFullscreen()};Od.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Od.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Od.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Od.supportsBigInt=function(){return typeof BigInt<"u"};Od.supportsWebWorkers=function(){return typeof Worker<"u"};Od.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Od.supportsWebgl2=function(e){return e.context.webgl2};Od.supportsEsmWebWorkers=function(){return!g9()||parseInt(sB)>=114};var Mt=Od;function aB(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function oe(e,t,n,i){this.red=g(e,1),this.green=g(t,1),this.blue=g(n,1),this.alpha=g(i,1)}oe.fromCartesian4=function(e,t){return d(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new oe(e.x,e.y,e.z,e.w)};oe.fromBytes=function(e,t,n,i,o){return e=oe.byteToFloat(g(e,255)),t=oe.byteToFloat(g(t,255)),n=oe.byteToFloat(g(n,255)),i=oe.byteToFloat(g(i,255)),d(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new oe(e,t,n,i)};oe.fromAlpha=function(e,t,n){return d(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new oe(e.red,e.green,e.blue,t)};var cB,lB,Of;Mt.supportsTypedArrays()&&(cB=new ArrayBuffer(4),lB=new Uint32Array(cB),Of=new Uint8Array(cB));oe.fromRgba=function(e,t){return lB[0]=e,oe.fromBytes(Of[0],Of[1],Of[2],Of[3],t)};oe.fromHsl=function(e,t,n,i,o){e=g(e,0)%1,t=g(t,0),n=g(n,0),i=g(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let l=2*n-c;r=aB(l,c,e+1/3),s=aB(l,c,e),a=aB(l,c,e-1/3)}return d(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new oe(r,s,a,i)};oe.fromRandom=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.red;if(!d(n)){let s=g(e.minimumRed,0),a=g(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!d(i)){let s=g(e.minimumGreen,0),a=g(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!d(o)){let s=g(e.minimumBlue,0),a=g(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!d(r)){let s=g(e.minimumAlpha,0),a=g(e.maximumAlpha,1);r=s+W.nextRandomNumber()*(a-s)}return d(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new oe(n,i,o,r)};var bTe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,yTe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,gTe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,xTe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;oe.fromCssColorString=function(e,t){d(t)||(t=new oe),e=e.trim();let n=oe[e.toUpperCase()];if(d(n))return oe.clone(n,t),t;let i=bTe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(g(i[4],"f"),16)/15,t):(i=yTe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(g(i[4],"ff"),16)/255,t):(i=gTe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(g(i[4],"1.0")),t):(i=xTe.exec(e),i!==null?oe.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(g(i[4],"1.0")),t):(t=void 0,t))))};oe.packedLength=4;oe.pack=function(e,t,n){return n=g(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};oe.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new oe),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};oe.byteToFloat=function(e){return e/255};oe.floatToByte=function(e){return e===1?255:e*256|0};oe.clone=function(e,t){if(d(e))return d(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new oe(e.red,e.green,e.blue,e.alpha)};oe.equals=function(e,t){return e===t||d(e)&&d(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};oe.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};oe.prototype.clone=function(e){return oe.clone(this,e)};oe.prototype.equals=function(e){return oe.equals(this,e)};oe.prototype.equalsEpsilon=function(e,t){return this===e||d(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};oe.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};oe.prototype.toCssColorString=function(){let e=oe.floatToByte(this.red),t=oe.floatToByte(this.green),n=oe.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};oe.prototype.toCssHexString=function(){let e=oe.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=oe.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=oe.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=oe.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};oe.prototype.toBytes=function(e){let t=oe.floatToByte(this.red),n=oe.floatToByte(this.green),i=oe.floatToByte(this.blue),o=oe.floatToByte(this.alpha);return d(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};oe.prototype.toRgba=function(){return Of[0]=oe.floatToByte(this.red),Of[1]=oe.floatToByte(this.green),Of[2]=oe.floatToByte(this.blue),Of[3]=oe.floatToByte(this.alpha),lB[0]};oe.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};oe.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};oe.prototype.withAlpha=function(e,t){return oe.fromAlpha(this,e,t)};oe.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};oe.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};oe.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};oe.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};oe.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};oe.lerp=function(e,t,n,i){return i.red=W.lerp(e.red,t.red,n),i.green=W.lerp(e.green,t.green,n),i.blue=W.lerp(e.blue,t.blue,n),i.alpha=W.lerp(e.alpha,t.alpha,n),i};oe.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};oe.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};oe.ALICEBLUE=Object.freeze(oe.fromCssColorString("#F0F8FF"));oe.ANTIQUEWHITE=Object.freeze(oe.fromCssColorString("#FAEBD7"));oe.AQUA=Object.freeze(oe.fromCssColorString("#00FFFF"));oe.AQUAMARINE=Object.freeze(oe.fromCssColorString("#7FFFD4"));oe.AZURE=Object.freeze(oe.fromCssColorString("#F0FFFF"));oe.BEIGE=Object.freeze(oe.fromCssColorString("#F5F5DC"));oe.BISQUE=Object.freeze(oe.fromCssColorString("#FFE4C4"));oe.BLACK=Object.freeze(oe.fromCssColorString("#000000"));oe.BLANCHEDALMOND=Object.freeze(oe.fromCssColorString("#FFEBCD"));oe.BLUE=Object.freeze(oe.fromCssColorString("#0000FF"));oe.BLUEVIOLET=Object.freeze(oe.fromCssColorString("#8A2BE2"));oe.BROWN=Object.freeze(oe.fromCssColorString("#A52A2A"));oe.BURLYWOOD=Object.freeze(oe.fromCssColorString("#DEB887"));oe.CADETBLUE=Object.freeze(oe.fromCssColorString("#5F9EA0"));oe.CHARTREUSE=Object.freeze(oe.fromCssColorString("#7FFF00"));oe.CHOCOLATE=Object.freeze(oe.fromCssColorString("#D2691E"));oe.CORAL=Object.freeze(oe.fromCssColorString("#FF7F50"));oe.CORNFLOWERBLUE=Object.freeze(oe.fromCssColorString("#6495ED"));oe.CORNSILK=Object.freeze(oe.fromCssColorString("#FFF8DC"));oe.CRIMSON=Object.freeze(oe.fromCssColorString("#DC143C"));oe.CYAN=Object.freeze(oe.fromCssColorString("#00FFFF"));oe.DARKBLUE=Object.freeze(oe.fromCssColorString("#00008B"));oe.DARKCYAN=Object.freeze(oe.fromCssColorString("#008B8B"));oe.DARKGOLDENROD=Object.freeze(oe.fromCssColorString("#B8860B"));oe.DARKGRAY=Object.freeze(oe.fromCssColorString("#A9A9A9"));oe.DARKGREEN=Object.freeze(oe.fromCssColorString("#006400"));oe.DARKGREY=oe.DARKGRAY;oe.DARKKHAKI=Object.freeze(oe.fromCssColorString("#BDB76B"));oe.DARKMAGENTA=Object.freeze(oe.fromCssColorString("#8B008B"));oe.DARKOLIVEGREEN=Object.freeze(oe.fromCssColorString("#556B2F"));oe.DARKORANGE=Object.freeze(oe.fromCssColorString("#FF8C00"));oe.DARKORCHID=Object.freeze(oe.fromCssColorString("#9932CC"));oe.DARKRED=Object.freeze(oe.fromCssColorString("#8B0000"));oe.DARKSALMON=Object.freeze(oe.fromCssColorString("#E9967A"));oe.DARKSEAGREEN=Object.freeze(oe.fromCssColorString("#8FBC8F"));oe.DARKSLATEBLUE=Object.freeze(oe.fromCssColorString("#483D8B"));oe.DARKSLATEGRAY=Object.freeze(oe.fromCssColorString("#2F4F4F"));oe.DARKSLATEGREY=oe.DARKSLATEGRAY;oe.DARKTURQUOISE=Object.freeze(oe.fromCssColorString("#00CED1"));oe.DARKVIOLET=Object.freeze(oe.fromCssColorString("#9400D3"));oe.DEEPPINK=Object.freeze(oe.fromCssColorString("#FF1493"));oe.DEEPSKYBLUE=Object.freeze(oe.fromCssColorString("#00BFFF"));oe.DIMGRAY=Object.freeze(oe.fromCssColorString("#696969"));oe.DIMGREY=oe.DIMGRAY;oe.DODGERBLUE=Object.freeze(oe.fromCssColorString("#1E90FF"));oe.FIREBRICK=Object.freeze(oe.fromCssColorString("#B22222"));oe.FLORALWHITE=Object.freeze(oe.fromCssColorString("#FFFAF0"));oe.FORESTGREEN=Object.freeze(oe.fromCssColorString("#228B22"));oe.FUCHSIA=Object.freeze(oe.fromCssColorString("#FF00FF"));oe.GAINSBORO=Object.freeze(oe.fromCssColorString("#DCDCDC"));oe.GHOSTWHITE=Object.freeze(oe.fromCssColorString("#F8F8FF"));oe.GOLD=Object.freeze(oe.fromCssColorString("#FFD700"));oe.GOLDENROD=Object.freeze(oe.fromCssColorString("#DAA520"));oe.GRAY=Object.freeze(oe.fromCssColorString("#808080"));oe.GREEN=Object.freeze(oe.fromCssColorString("#008000"));oe.GREENYELLOW=Object.freeze(oe.fromCssColorString("#ADFF2F"));oe.GREY=oe.GRAY;oe.HONEYDEW=Object.freeze(oe.fromCssColorString("#F0FFF0"));oe.HOTPINK=Object.freeze(oe.fromCssColorString("#FF69B4"));oe.INDIANRED=Object.freeze(oe.fromCssColorString("#CD5C5C"));oe.INDIGO=Object.freeze(oe.fromCssColorString("#4B0082"));oe.IVORY=Object.freeze(oe.fromCssColorString("#FFFFF0"));oe.KHAKI=Object.freeze(oe.fromCssColorString("#F0E68C"));oe.LAVENDER=Object.freeze(oe.fromCssColorString("#E6E6FA"));oe.LAVENDAR_BLUSH=Object.freeze(oe.fromCssColorString("#FFF0F5"));oe.LAWNGREEN=Object.freeze(oe.fromCssColorString("#7CFC00"));oe.LEMONCHIFFON=Object.freeze(oe.fromCssColorString("#FFFACD"));oe.LIGHTBLUE=Object.freeze(oe.fromCssColorString("#ADD8E6"));oe.LIGHTCORAL=Object.freeze(oe.fromCssColorString("#F08080"));oe.LIGHTCYAN=Object.freeze(oe.fromCssColorString("#E0FFFF"));oe.LIGHTGOLDENRODYELLOW=Object.freeze(oe.fromCssColorString("#FAFAD2"));oe.LIGHTGRAY=Object.freeze(oe.fromCssColorString("#D3D3D3"));oe.LIGHTGREEN=Object.freeze(oe.fromCssColorString("#90EE90"));oe.LIGHTGREY=oe.LIGHTGRAY;oe.LIGHTPINK=Object.freeze(oe.fromCssColorString("#FFB6C1"));oe.LIGHTSEAGREEN=Object.freeze(oe.fromCssColorString("#20B2AA"));oe.LIGHTSKYBLUE=Object.freeze(oe.fromCssColorString("#87CEFA"));oe.LIGHTSLATEGRAY=Object.freeze(oe.fromCssColorString("#778899"));oe.LIGHTSLATEGREY=oe.LIGHTSLATEGRAY;oe.LIGHTSTEELBLUE=Object.freeze(oe.fromCssColorString("#B0C4DE"));oe.LIGHTYELLOW=Object.freeze(oe.fromCssColorString("#FFFFE0"));oe.LIME=Object.freeze(oe.fromCssColorString("#00FF00"));oe.LIMEGREEN=Object.freeze(oe.fromCssColorString("#32CD32"));oe.LINEN=Object.freeze(oe.fromCssColorString("#FAF0E6"));oe.MAGENTA=Object.freeze(oe.fromCssColorString("#FF00FF"));oe.MAROON=Object.freeze(oe.fromCssColorString("#800000"));oe.MEDIUMAQUAMARINE=Object.freeze(oe.fromCssColorString("#66CDAA"));oe.MEDIUMBLUE=Object.freeze(oe.fromCssColorString("#0000CD"));oe.MEDIUMORCHID=Object.freeze(oe.fromCssColorString("#BA55D3"));oe.MEDIUMPURPLE=Object.freeze(oe.fromCssColorString("#9370DB"));oe.MEDIUMSEAGREEN=Object.freeze(oe.fromCssColorString("#3CB371"));oe.MEDIUMSLATEBLUE=Object.freeze(oe.fromCssColorString("#7B68EE"));oe.MEDIUMSPRINGGREEN=Object.freeze(oe.fromCssColorString("#00FA9A"));oe.MEDIUMTURQUOISE=Object.freeze(oe.fromCssColorString("#48D1CC"));oe.MEDIUMVIOLETRED=Object.freeze(oe.fromCssColorString("#C71585"));oe.MIDNIGHTBLUE=Object.freeze(oe.fromCssColorString("#191970"));oe.MINTCREAM=Object.freeze(oe.fromCssColorString("#F5FFFA"));oe.MISTYROSE=Object.freeze(oe.fromCssColorString("#FFE4E1"));oe.MOCCASIN=Object.freeze(oe.fromCssColorString("#FFE4B5"));oe.NAVAJOWHITE=Object.freeze(oe.fromCssColorString("#FFDEAD"));oe.NAVY=Object.freeze(oe.fromCssColorString("#000080"));oe.OLDLACE=Object.freeze(oe.fromCssColorString("#FDF5E6"));oe.OLIVE=Object.freeze(oe.fromCssColorString("#808000"));oe.OLIVEDRAB=Object.freeze(oe.fromCssColorString("#6B8E23"));oe.ORANGE=Object.freeze(oe.fromCssColorString("#FFA500"));oe.ORANGERED=Object.freeze(oe.fromCssColorString("#FF4500"));oe.ORCHID=Object.freeze(oe.fromCssColorString("#DA70D6"));oe.PALEGOLDENROD=Object.freeze(oe.fromCssColorString("#EEE8AA"));oe.PALEGREEN=Object.freeze(oe.fromCssColorString("#98FB98"));oe.PALETURQUOISE=Object.freeze(oe.fromCssColorString("#AFEEEE"));oe.PALEVIOLETRED=Object.freeze(oe.fromCssColorString("#DB7093"));oe.PAPAYAWHIP=Object.freeze(oe.fromCssColorString("#FFEFD5"));oe.PEACHPUFF=Object.freeze(oe.fromCssColorString("#FFDAB9"));oe.PERU=Object.freeze(oe.fromCssColorString("#CD853F"));oe.PINK=Object.freeze(oe.fromCssColorString("#FFC0CB"));oe.PLUM=Object.freeze(oe.fromCssColorString("#DDA0DD"));oe.POWDERBLUE=Object.freeze(oe.fromCssColorString("#B0E0E6"));oe.PURPLE=Object.freeze(oe.fromCssColorString("#800080"));oe.RED=Object.freeze(oe.fromCssColorString("#FF0000"));oe.ROSYBROWN=Object.freeze(oe.fromCssColorString("#BC8F8F"));oe.ROYALBLUE=Object.freeze(oe.fromCssColorString("#4169E1"));oe.SADDLEBROWN=Object.freeze(oe.fromCssColorString("#8B4513"));oe.SALMON=Object.freeze(oe.fromCssColorString("#FA8072"));oe.SANDYBROWN=Object.freeze(oe.fromCssColorString("#F4A460"));oe.SEAGREEN=Object.freeze(oe.fromCssColorString("#2E8B57"));oe.SEASHELL=Object.freeze(oe.fromCssColorString("#FFF5EE"));oe.SIENNA=Object.freeze(oe.fromCssColorString("#A0522D"));oe.SILVER=Object.freeze(oe.fromCssColorString("#C0C0C0"));oe.SKYBLUE=Object.freeze(oe.fromCssColorString("#87CEEB"));oe.SLATEBLUE=Object.freeze(oe.fromCssColorString("#6A5ACD"));oe.SLATEGRAY=Object.freeze(oe.fromCssColorString("#708090"));oe.SLATEGREY=oe.SLATEGRAY;oe.SNOW=Object.freeze(oe.fromCssColorString("#FFFAFA"));oe.SPRINGGREEN=Object.freeze(oe.fromCssColorString("#00FF7F"));oe.STEELBLUE=Object.freeze(oe.fromCssColorString("#4682B4"));oe.TAN=Object.freeze(oe.fromCssColorString("#D2B48C"));oe.TEAL=Object.freeze(oe.fromCssColorString("#008080"));oe.THISTLE=Object.freeze(oe.fromCssColorString("#D8BFD8"));oe.TOMATO=Object.freeze(oe.fromCssColorString("#FF6347"));oe.TURQUOISE=Object.freeze(oe.fromCssColorString("#40E0D0"));oe.VIOLET=Object.freeze(oe.fromCssColorString("#EE82EE"));oe.WHEAT=Object.freeze(oe.fromCssColorString("#F5DEB3"));oe.WHITE=Object.freeze(oe.fromCssColorString("#FFFFFF"));oe.WHITESMOKE=Object.freeze(oe.fromCssColorString("#F5F5F5"));oe.YELLOW=Object.freeze(oe.fromCssColorString("#FFFF00"));oe.YELLOWGREEN=Object.freeze(oe.fromCssColorString("#9ACD32"));oe.TRANSPARENT=Object.freeze(new oe(0,0,0,0));var B=oe;function x9(e){e=g(e,g.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}x9.ALL=Object.freeze(new x9({color:new B(0,0,0,0),depth:1,stencil:0}));x9.prototype.execute=function(e,t){e.clear(this,t)};var ti=x9;var x_t=T(S(),1);var p_t=T(S(),1),_Te={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Re=Object.freeze(_Te);function r7(e){e=g(e,g.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=g(e.persists,!1),this.pass=Re.COMPUTE,this.owner=e.owner}r7.prototype.execute=function(e){e.execute(this)};var Kd=r7;var JSt=T(S(),1);var pTt=T(S(),1);var V_t=T(S(),1);function Xt(e,t){this.x=g(e,0),this.y=g(t,0)}Xt.fromElements=function(e,t,n){return d(n)?(n.x=e,n.y=t,n):new Xt(e,t)};Xt.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t):new Xt(e.x,e.y)};Xt.fromCartesian3=Xt.clone;Xt.fromCartesian4=Xt.clone;Xt.packedLength=2;Xt.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n]=e.y,t};Xt.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new Xt),n.x=e[t++],n.y=e[t],n};Xt.packArray=function(e,t){let n=e.length,i=n*2;d(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Xt.pack(e[o],t,o*2);return t};Xt.unpackArray=function(e,t){let n=e.length;d(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Xt.unpack(e,i,t[o])}return t};Xt.fromArray=Xt.unpack;Xt.maximumComponent=function(e){return Math.max(e.x,e.y)};Xt.minimumComponent=function(e){return Math.min(e.x,e.y)};Xt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Xt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Xt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Xt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Xt.magnitude=function(e){return Math.sqrt(Xt.magnitudeSquared(e))};var _9=new Xt;Xt.distance=function(e,t){return Xt.subtract(e,t,_9),Xt.magnitude(_9)};Xt.distanceSquared=function(e,t){return Xt.subtract(e,t,_9),Xt.magnitudeSquared(_9)};Xt.normalize=function(e,t){let n=Xt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Xt.dot=function(e,t){return e.x*t.x+e.y*t.y};Xt.cross=function(e,t){return e.x*t.y-e.y*t.x};Xt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Xt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Xt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Xt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Xt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Xt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Xt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Xt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s7=new Xt;Xt.lerp=function(e,t,n,i){return Xt.multiplyByScalar(t,n,s7),i=Xt.multiplyByScalar(e,1-n,i),Xt.add(s7,i,i)};var a7=new Xt,c7=new Xt;Xt.angleBetween=function(e,t){return Xt.normalize(e,a7),Xt.normalize(t,c7),W.acosClamped(Xt.dot(a7,c7))};var TTe=new Xt;Xt.mostOrthogonalAxis=function(e,t){let n=Xt.normalize(e,TTe);return Xt.abs(n,n),n.x<=n.y?t=Xt.clone(Xt.UNIT_X,t):t=Xt.clone(Xt.UNIT_Y,t),t};Xt.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y};Xt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Xt.equalsEpsilon=function(e,t,n,i){return e===t||d(e)&&d(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)};Xt.ZERO=Object.freeze(new Xt(0,0));Xt.ONE=Object.freeze(new Xt(1,1));Xt.UNIT_X=Object.freeze(new Xt(1,0));Xt.UNIT_Y=Object.freeze(new Xt(0,1));Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t,n){return Xt.equalsEpsilon(this,e,t,n)};Xt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var D=Xt;var F_t=T(S(),1);var E_t=T(S(),1);var STe=new h,CTe=new h;function VTe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,l=t.y,u=t.z,m=r*r*c*c,p=s*s*l*l,y=a*a*u*u,f=m+p+y,x=Math.sqrt(1/f),_=h.multiplyByScalar(e,x,STe);if(f<i)return isFinite(x)?h.clone(_,o):void 0;let C=n.x,V=n.y,L=n.z,Z=CTe;Z.x=_.x*C*2,Z.y=_.y*V*2,Z.z=_.z*L*2;let G=(1-x)*h.magnitude(e)/(.5*h.magnitude(Z)),X=0,P,v,A,M,b,R,E,I,w,N,Y;do{G-=X,A=1/(1+G*C),M=1/(1+G*V),b=1/(1+G*L),R=A*A,E=M*M,I=b*b,w=R*A,N=E*M,Y=I*b,P=m*R+p*E+y*I-1,v=m*w*C+p*N*V+y*Y*L;let k=-2*v;X=P/k}while(Math.abs(P)>W.EPSILON12);return d(o)?(o.x=r*A,o.y=s*M,o.z=a*b,o):new h(r*A,s*M,a*b)}var Tg=VTe;function Kr(e,t,n){this.longitude=g(e,0),this.latitude=g(t,0),this.height=g(n,0)}Kr.fromRadians=function(e,t,n,i){return n=g(n,0),d(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Kr(e,t,n)};Kr.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),Kr.fromRadians(e,t,n,i)};var LTe=new h,RTe=new h,ZTe=new h,GTe=new h(1/6378137,1/6378137,1/6356752314245179e-9),ETe=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),XTe=W.EPSILON1;Kr.fromCartesian=function(e,t,n){let i=d(t)?t.oneOverRadii:GTe,o=d(t)?t.oneOverRadiiSquared:ETe,r=d(t)?t._centerToleranceSquared:XTe,s=Tg(e,i,o,r,RTe);if(!d(s))return;let a=h.multiplyComponents(s,o,LTe);a=h.normalize(a,a);let c=h.subtract(e,s,ZTe),l=Math.atan2(a.y,a.x),u=Math.asin(a.z),m=W.sign(h.dot(c,e))*h.magnitude(c);return d(n)?(n.longitude=l,n.latitude=u,n.height=m,n):new Kr(l,u,m)};Kr.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};Kr.clone=function(e,t){if(d(e))return d(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Kr(e.longitude,e.latitude,e.height)};Kr.equals=function(e,t){return e===t||d(e)&&d(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Kr.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Kr.ZERO=Object.freeze(new Kr(0,0,0));Kr.prototype.clone=function(e){return Kr.clone(this,e)};Kr.prototype.equals=function(e){return Kr.equals(this,e)};Kr.prototype.equalsEpsilon=function(e,t){return Kr.equalsEpsilon(this,e,t)};Kr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Kr;var j_t=T(S(),1);var Y_t=T(S(),1);function d7(e,t,n,i){t=g(t,0),n=g(n,0),i=g(i,0),e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function qi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,d7(this,e,t,n)}Object.defineProperties(qi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});qi.clone=function(e,t){if(!d(e))return;let n=e._radii;return d(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new qi(n.x,n.y,n.z)};qi.fromCartesian3=function(e,t){return d(t)||(t=new qi),d(e)&&d7(t,e.x,e.y,e.z),t};qi.WGS84=Object.freeze(new qi(6378137,6378137,6356752314245179e-9));qi.UNIT_SPHERE=Object.freeze(new qi(1,1,1));qi.MOON=Object.freeze(new qi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));qi.prototype.clone=function(e){return qi.clone(this,e)};qi.packedLength=h.packedLength;qi.pack=function(e,t,n){return n=g(n,0),h.pack(e._radii,t,n),t};qi.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t);return qi.fromCartesian3(i,n)};qi.prototype.geocentricSurfaceNormal=h.normalize;qi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return d(t)||(t=new h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};qi.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,W.EPSILON14))return d(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var ITe=new h,WTe=new h;qi.prototype.cartographicToCartesian=function(e,t){let n=ITe,i=WTe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),d(t)||(t=new h),h.add(i,n,t)};qi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;d(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var PTe=new h,vTe=new h,wTe=new h;qi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,vTe);if(!d(n))return;let i=this.geodeticSurfaceNormal(n,PTe),o=h.subtract(e,n,wTe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=W.sign(h.dot(o,e))*h.magnitude(o);return d(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};qi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;d(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};qi.prototype.scaleToGeodeticSurface=function(e,t){return Tg(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};qi.prototype.scaleToGeocentricSurface=function(e,t){d(t)||(t=new h);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return h.multiplyByScalar(e,s,t)};qi.prototype.transformPositionToScaledSpace=function(e,t){return d(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};qi.prototype.transformPositionFromScaledSpace=function(e,t){return d(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};qi.prototype.equals=function(e){return this===e||d(e)&&h.equals(this._radii,e._radii)};qi.prototype.toString=function(){return this._radii.toString()};qi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=g(t,0);let i=this._squaredXOverSquaredZ;if(d(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var FTe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],ATe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function l7(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*FTe[s];r+=ATe[s]*(n(i+a)+n(i-a))}return r*=o,r}qi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=W.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,l=s*a;return l7(i,o,function(u){let m=Math.cos(u),p=Math.sin(u);return Math.cos(u)*l7(t,n,function(y){let f=Math.cos(y),x=Math.sin(y);return Math.sqrt(l*p*p+c*(a*f*f+s*x*x)*m*m)})})};var re=qi;function T9(e){this._ellipsoid=g(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(T9.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});T9.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return d(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};T9.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return d(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Zi=T9;var $_t=T(S(),1),MTe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},qt=Object.freeze(MTe);var sTt=T(S(),1);function Nn(e,t,n,i){this.west=g(e,0),this.south=g(t,0),this.east=g(n,0),this.north=g(i,0)}Object.defineProperties(Nn.prototype,{width:{get:function(){return Nn.computeWidth(this)}},height:{get:function(){return Nn.computeHeight(this)}}});Nn.packedLength=4;Nn.pack=function(e,t,n){return n=g(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Nn.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new Nn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Nn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=W.TWO_PI),t-n};Nn.computeHeight=function(e){return e.north-e.south};Nn.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(g(e,0)),t=W.toRadians(g(t,0)),n=W.toRadians(g(n,0)),i=W.toRadians(g(i,0)),d(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Nn(e,t,n,i)};Nn.fromRadians=function(e,t,n,i,o){return d(o)?(o.west=g(e,0),o.south=g(t,0),o.east=g(n,0),o.north=g(i,0),o):new Nn(e,t,n,i)};Nn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,l=e.length;c<l;c++){let u=e[c];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let m=u.longitude>=0?u.longitude:u.longitude+W.TWO_PI;o=Math.min(o,m),r=Math.max(r,m)}return i-n>r-o&&(n=o,i=r,i>W.PI&&(i=i-W.TWO_PI),n>W.PI&&(n=n-W.TWO_PI)),d(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Nn(n,s,i,a)};Nn.fromCartesianArray=function(e,t,n){t=g(t,re.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let l=0,u=e.length;l<u;l++){let m=t.cartesianToCartographic(e[l]);i=Math.min(i,m.longitude),o=Math.max(o,m.longitude),a=Math.min(a,m.latitude),c=Math.max(c,m.latitude);let p=m.longitude>=0?m.longitude:m.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),d(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new Nn(i,a,o,c)};Nn.clone=function(e,t){if(d(e))return d(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Nn(e.west,e.south,e.east,e.north)};Nn.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Nn.prototype.clone=function(e){return Nn.clone(this,e)};Nn.prototype.equals=function(e){return Nn.equals(this,e)};Nn.equals=function(e,t){return e===t||d(e)&&d(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Nn.prototype.equalsEpsilon=function(e,t){return Nn.equalsEpsilon(this,e,t)};Nn.validate=function(e){};Nn.southwest=function(e,t){return d(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};Nn.northwest=function(e,t){return d(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};Nn.northeast=function(e,t){return d(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};Nn.southeast=function(e,t){return d(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};Nn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=W.TWO_PI);let o=W.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return d(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};Nn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.max(o,s)),c=W.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let l=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(l>=u))return d(n)?(n.west=a,n.south=l,n.east=c,n.north=u,n):new Nn(a,l,c,u)};Nn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return d(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new Nn(i,o,r,s)};Nn.union=function(e,t,n){d(n)||(n=new Nn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.min(o,s)),c=W.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Nn.expand=function(e,t,n){return d(n)||(n=new Nn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};Nn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=W.TWO_PI,n<0&&(n+=W.TWO_PI)),(n>o||W.equalsEpsilon(n,o,W.EPSILON14))&&(n<r||W.equalsEpsilon(n,r,W.EPSILON14))&&i>=e.south&&i<=e.north};var NTe=new he;Nn.subsample=function(e,t,n,i){t=g(t,re.WGS84),n=g(n,0),d(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,l=NTe;l.height=n,l.longitude=c,l.latitude=r,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.longitude=a,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.latitude=s,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.longitude=c,i[o]=t.cartographicToCartesian(l,i[o]),o++,r<0?l.latitude=r:s>0?l.latitude=s:l.latitude=0;for(let u=1;u<8;++u)l.longitude=-Math.PI+u*W.PI_OVER_TWO,Nn.contains(e,l)&&(i[o]=t.cartographicToCartesian(l,i[o]),o++);return l.latitude===0&&(l.longitude=c,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.longitude=a,i[o]=t.cartographicToCartesian(l,i[o]),o++),i.length=o,i};Nn.subsection=function(e,t,n,i,o,r){if(d(r)||(r=new Nn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=W.TWO_PI+e.east-e.west;r.west=W.negativePiToPi(e.west+t*a),r.east=W.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};Nn.MAX_VALUE=Object.freeze(new Nn(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var de=Nn;function br(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.width=g(n,0),this.height=g(i,0)}br.packedLength=4;br.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};br.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new br),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};br.fromPoints=function(e,t){if(d(t)||(t=new br),!d(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],l=c.x,u=c.y;i=Math.min(l,i),r=Math.max(l,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var UTe=new Zi,kTe=new he,DTe=new he;br.fromRectangle=function(e,t,n){if(d(n)||(n=new br),!d(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=g(t,UTe);let i=t.project(de.southwest(e,kTe)),o=t.project(de.northeast(e,DTe));return D.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};br.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new br(e.x,e.y,e.width,e.height)};br.union=function(e,t,n){d(n)||(n=new br);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};br.expand=function(e,t,n){n=br.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};br.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?qt.OUTSIDE:qt.INTERSECTING};br.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};br.prototype.clone=function(e){return br.clone(this,e)};br.prototype.intersect=function(e){return br.intersect(this,e)};br.prototype.equals=function(e){return br.equals(this,e)};var He=br;var gTt=T(S(),1);var la={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};la.isLines=function(e){return e===la.LINES||e===la.LINE_LOOP||e===la.LINE_STRIP};la.isTriangles=function(e){return e===la.TRIANGLES||e===la.TRIANGLE_STRIP||e===la.TRIANGLE_FAN};la.validate=function(e){return e===la.POINTS||e===la.LINES||e===la.LINE_LOOP||e===la.LINE_STRIP||e===la.TRIANGLES||e===la.TRIANGLE_STRIP||e===la.TRIANGLE_FAN};var Fe=Object.freeze(la);var _Tt=T(S(),1),Sg=`in vec4 position;
in vec2 textureCoordinates;

out vec2 v_textureCoordinates;

void main() 
{
    gl_Position = position;
    v_textureCoordinates = textureCoordinates;
}
`;var LTt=T(S(),1);var dr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function qV(e){e=g(e,g.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=g(e.primitiveType,Fe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=g(e.offset,0),this._instanceCount=g(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=g(e.cull,!0),this.occlude=g(e.occlude,!0),this.executeInClosestFrustum=g(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.castShadows=g(e.castShadows,!1),this.receiveShadows=g(e.receiveShadows,!1),this.pickOnly=g(e.pickOnly,!1),this.depthForTranslucentClassification=g(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Pa(e,t){return(e._flags&t)===t}function q0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(qV.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Pa(this,dr.CULL)},set:function(e){Pa(this,dr.CULL)!==e&&(q0(this,dr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Pa(this,dr.OCCLUDE)},set:function(e){Pa(this,dr.OCCLUDE)!==e&&(q0(this,dr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Pa(this,dr.CAST_SHADOWS)},set:function(e){Pa(this,dr.CAST_SHADOWS)!==e&&(q0(this,dr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Pa(this,dr.RECEIVE_SHADOWS)},set:function(e){Pa(this,dr.RECEIVE_SHADOWS)!==e&&(q0(this,dr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Pa(this,dr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Pa(this,dr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(q0(this,dr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Pa(this,dr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Pa(this,dr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(q0(this,dr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return Pa(this,dr.PICK_ONLY)},set:function(e){Pa(this,dr.PICK_ONLY)!==e&&(q0(this,dr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Pa(this,dr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Pa(this,dr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(q0(this,dr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});qV.shallowClone=function(e,t){if(d(e))return d(t)||(t=new qV),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};qV.prototype.execute=function(e,t){e.draw(this,t)};var nt=qV;var UTt=T(S(),1);var WTt=T(S(),1);var GTt=T(S(),1);var Gi={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};Gi.toWebGLConstant=function(e,t){switch(e){case Gi.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case Gi.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case Gi.UNSIGNED_INT:return ne.UNSIGNED_INT;case Gi.FLOAT:return ne.FLOAT;case Gi.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case Gi.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case Gi.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case Gi.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case Gi.UNSIGNED_SHORT_5_6_5:return Gi.UNSIGNED_SHORT_5_6_5}};Gi.isPacked=function(e){return e===Gi.UNSIGNED_INT_24_8||e===Gi.UNSIGNED_SHORT_4_4_4_4||e===Gi.UNSIGNED_SHORT_5_5_5_1||e===Gi.UNSIGNED_SHORT_5_6_5};Gi.sizeInBytes=function(e){switch(e){case Gi.UNSIGNED_BYTE:return 1;case Gi.UNSIGNED_SHORT:case Gi.UNSIGNED_SHORT_4_4_4_4:case Gi.UNSIGNED_SHORT_5_5_5_1:case Gi.UNSIGNED_SHORT_5_6_5:case Gi.HALF_FLOAT:return 2;case Gi.UNSIGNED_INT:case Gi.FLOAT:case Gi.UNSIGNED_INT_24_8:return 4}};Gi.validate=function(e){return e===Gi.UNSIGNED_BYTE||e===Gi.UNSIGNED_SHORT||e===Gi.UNSIGNED_INT||e===Gi.FLOAT||e===Gi.HALF_FLOAT||e===Gi.UNSIGNED_INT_24_8||e===Gi.UNSIGNED_SHORT_4_4_4_4||e===Gi.UNSIGNED_SHORT_5_5_5_1||e===Gi.UNSIGNED_SHORT_5_6_5};var Je=Object.freeze(Gi);var rt={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Je.isPacked(t)&&(o=1),o*Je.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o,r=Je.sizeInBytes(t);r===Uint8Array.BYTES_PER_ELEMENT?o=Uint8Array:r===Uint16Array.BYTES_PER_ELEMENT?o=Uint16Array:r===Float32Array.BYTES_PER_ELEMENT&&t===Je.FLOAT?o=Float32Array:o=Uint32Array;let s=rt.componentsLength(e)*n*i;return new o(s)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let l=c*i*s,u=(o-c-1)*i*s;for(let m=0;m<a;++m)r[u+m]=e[l+m]}return r};rt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===rt.DEPTH_STENCIL)return ne.DEPTH24_STENCIL8;if(e===rt.DEPTH_COMPONENT){if(t===Je.UNSIGNED_SHORT)return ne.DEPTH_COMPONENT16;if(t===Je.UNSIGNED_INT)return ne.DEPTH_COMPONENT24}if(t===Je.FLOAT)switch(e){case rt.RGBA:return ne.RGBA32F;case rt.RGB:return ne.RGB32F;case rt.RG:return ne.RG32F;case rt.RED:return ne.R32F}if(t===Je.HALF_FLOAT)switch(e){case rt.RGBA:return ne.RGBA16F;case rt.RGB:return ne.RGB16F;case rt.RG:return ne.RG16F;case rt.RED:return ne.R16F}return e};var st=Object.freeze(rt);var vTt=T(S(),1),ur={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(ur,{maximumCombinedTextureImageUnits:{get:function(){return ur._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return ur._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return ur._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return ur._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return ur._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return ur._maximumTextureSize}},maximumVaryingVectors:{get:function(){return ur._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return ur._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return ur._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return ur._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return ur._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return ur._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return ur._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return ur._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return ur._maximumViewportWidth}},maximumViewportHeight:{get:function(){return ur._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return ur._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return ur._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return ur._maximumColorAttachments}},maximumSamples:{get:function(){return ur._maximumSamples}},highpFloatSupported:{get:function(){return ur._highpFloatSupported}},highpIntSupported:{get:function(){return ur._highpIntSupported}}});var kt=ur;function dB(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function S9(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function em(e){e=g(e,g.EMPTY_OBJECT);let n=e.context._gl,i=kt.maximumColorAttachments;this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=g(e.destroyAttachments,!0);let o=d(e.depthTexture)||d(e.depthRenderbuffer),r=d(e.depthStencilTexture)||d(e.depthStencilRenderbuffer);this._bind();let s,a,c,l,u;if(d(e.colorTextures)){let m=e.colorTextures;for(l=this._colorTextures.length=this._activeColorAttachments.length=m.length,c=0;c<l;++c)s=m[c],u=this._gl.COLOR_ATTACHMENT0+c,dB(this,u,s),this._activeColorAttachments[c]=u,this._colorTextures[c]=s}if(d(e.colorRenderbuffers)){let m=e.colorRenderbuffers;for(l=this._colorRenderbuffers.length=this._activeColorAttachments.length=m.length,c=0;c<l;++c)a=m[c],u=this._gl.COLOR_ATTACHMENT0+c,S9(this,u,a),this._activeColorAttachments[c]=u,this._colorRenderbuffers[c]=a}d(e.depthTexture)&&(s=e.depthTexture,dB(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),d(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,S9(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),d(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,S9(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),d(e.depthStencilTexture)&&(s=e.depthStencilTexture,dB(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),d(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,S9(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(em.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});em.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};em.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};em.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};em.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};em.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};em.prototype.getColorTexture=function(e){return this._colorTextures[e]};em.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};em.prototype.isDestroyed=function(){return!1};em.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let o=t[e];d(o)&&o.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let o=i[e];d(o)&&o.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var Us=em;var $Tt=T(S(),1);var BTt=T(S(),1);var C9={CLOCKWISE:ne.CW,COUNTER_CLOCKWISE:ne.CCW};C9.validate=function(e){return e===C9.CLOCKWISE||e===C9.COUNTER_CLOCKWISE};var Hr=Object.freeze(C9);var OTt=T(S(),1);function u7(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=u7(e[t]));return Object.freeze(e)}var uB=u7;function Lh(e){let t=g(e,g.EMPTY_OBJECT),n=g(t.cull,g.EMPTY_OBJECT),i=g(t.polygonOffset,g.EMPTY_OBJECT),o=g(t.scissorTest,g.EMPTY_OBJECT),r=g(o.rectangle,g.EMPTY_OBJECT),s=g(t.depthRange,g.EMPTY_OBJECT),a=g(t.depthTest,g.EMPTY_OBJECT),c=g(t.colorMask,g.EMPTY_OBJECT),l=g(t.blending,g.EMPTY_OBJECT),u=g(l.color,g.EMPTY_OBJECT),m=g(t.stencilTest,g.EMPTY_OBJECT),p=g(m.frontOperation,g.EMPTY_OBJECT),y=g(m.backOperation,g.EMPTY_OBJECT),f=g(t.sampleCoverage,g.EMPTY_OBJECT),x=t.viewport;this.frontFace=g(t.frontFace,Hr.COUNTER_CLOCKWISE),this.cull={enabled:g(n.enabled,!1),face:g(n.face,ne.BACK)},this.lineWidth=g(t.lineWidth,1),this.polygonOffset={enabled:g(i.enabled,!1),factor:g(i.factor,0),units:g(i.units,0)},this.scissorTest={enabled:g(o.enabled,!1),rectangle:He.clone(r)},this.depthRange={near:g(s.near,0),far:g(s.far,1)},this.depthTest={enabled:g(a.enabled,!1),func:g(a.func,ne.LESS)},this.colorMask={red:g(c.red,!0),green:g(c.green,!0),blue:g(c.blue,!0),alpha:g(c.alpha,!0)},this.depthMask=g(t.depthMask,!0),this.stencilMask=g(t.stencilMask,-1),this.blending={enabled:g(l.enabled,!1),color:new B(g(u.red,0),g(u.green,0),g(u.blue,0),g(u.alpha,0)),equationRgb:g(l.equationRgb,ne.FUNC_ADD),equationAlpha:g(l.equationAlpha,ne.FUNC_ADD),functionSourceRgb:g(l.functionSourceRgb,ne.ONE),functionSourceAlpha:g(l.functionSourceAlpha,ne.ONE),functionDestinationRgb:g(l.functionDestinationRgb,ne.ZERO),functionDestinationAlpha:g(l.functionDestinationAlpha,ne.ZERO)},this.stencilTest={enabled:g(m.enabled,!1),frontFunction:g(m.frontFunction,ne.ALWAYS),backFunction:g(m.backFunction,ne.ALWAYS),reference:g(m.reference,0),mask:g(m.mask,-1),frontOperation:{fail:g(p.fail,ne.KEEP),zFail:g(p.zFail,ne.KEEP),zPass:g(p.zPass,ne.KEEP)},backOperation:{fail:g(y.fail,ne.KEEP),zFail:g(y.zFail,ne.KEEP),zPass:g(y.zPass,ne.KEEP)}},this.sampleCoverage={enabled:g(f.enabled,!1),value:g(f.value,1),invert:g(f.invert,!1)},this.viewport=d(x)?new He(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var BTe=0,Vh={};Lh.fromCache=function(e){let t=JSON.stringify(e),n=Vh[t];if(d(n))return++n.referenceCount,n.state;let i=new Lh(e),o=JSON.stringify(i);return n=Vh[o],d(n)||(i.id=BTe++,n={referenceCount:0,state:i},Vh[o]=n),++n.referenceCount,Vh[t]={referenceCount:1,state:n.state},n.state};Lh.removeFromCache=function(e){let t=new Lh(e),n=JSON.stringify(t),i=Vh[n],o=JSON.stringify(e),r=Vh[o];d(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Vh[o],d(i)&&--i.referenceCount)),d(i)&&i.referenceCount===0&&delete Vh[n]};Lh.getCache=function(){return Vh};Lh.clearCache=function(){Vh={}};function Cg(e,t,n){n?e.enable(t):e.disable(t)}function m7(e,t){e.frontFace(t.frontFace)}function h7(e,t){let n=t.cull,i=n.enabled;Cg(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function f7(e,t){e.lineWidth(t.lineWidth)}function p7(e,t){let n=t.polygonOffset,i=n.enabled;Cg(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function b7(e,t,n){let i=t.scissorTest,o=d(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Cg(e,e.SCISSOR_TEST,o),o){let r=d(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function y7(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function g7(e,t){let n=t.depthTest,i=n.enabled;Cg(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function x7(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function _7(e,t){e.depthMask(t.depthMask)}function T7(e,t){e.stencilMask(t.stencilMask)}function YTe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function S7(e,t,n){let i=t.blending,o=d(n.blendingEnabled)?n.blendingEnabled:i.enabled;Cg(e,e.BLEND,o),o&&(YTe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function C7(e,t){let n=t.stencilTest,i=n.enabled;if(Cg(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,l=c.fail,u=c.zFail,m=c.zPass;e.stencilOpSeparate(e.FRONT,l,u,m);let p=n.backOperation,y=p.fail,f=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,y,f,x)}}function V7(e,t){let n=t.sampleCoverage,i=n.enabled;Cg(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var OTe=new He;function L7(e,t,n){let i=g(t.viewport,n.viewport);d(i)||(i=OTe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Lh.apply=function(e,t,n){m7(e,t),h7(e,t),f7(e,t),p7(e,t),y7(e,t),g7(e,t),x7(e,t),_7(e,t),T7(e,t),C7(e,t),V7(e,t),b7(e,t,n),S7(e,t,n),L7(e,t,n)};function KTe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(m7),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(h7),e.lineWidth!==t.lineWidth&&n.push(f7),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(p7),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(y7),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(g7),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(x7),e.depthMask!==t.depthMask&&n.push(_7),e.stencilMask!==t.stencilMask&&n.push(T7),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(C7),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(V7),n}Lh.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];d(u)||(u=KTe(t,n),n._applyFunctions[t.id]=u);let m=u.length;for(let p=0;p<m;++p)u[p](e,n)}let s=d(i.scissorTest)?i.scissorTest:t.scissorTest,a=d(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&b7(e,n,o);let c=d(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,l=d(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==l||l&&t.blending!==n.blending)&&S7(e,n,o),(t!==n||i!==o||i.context!==o.context)&&L7(e,n,o)};Lh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:He.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:B.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:d(e.viewport)?He.clone(e.viewport):void 0}};var De=Lh;var FSt=T(S(),1);var pSt=T(S(),1);var oSt=T(S(),1);function zt(e,t,n,i){this[0]=g(e,0),this[1]=g(n,0),this[2]=g(t,0),this[3]=g(i,0)}zt.packedLength=4;zt.pack=function(e,t,n){return n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};zt.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new zt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};zt.packArray=function(e,t){let n=e.length,i=n*4;d(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)zt.pack(e[o],t,o*4);return t};zt.unpackArray=function(e,t){let n=e.length;d(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=zt.unpack(e,i,t[o])}return t};zt.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new zt(e[0],e[2],e[1],e[3])};zt.fromArray=zt.unpack;zt.fromColumnMajorArray=function(e,t){return zt.clone(e,t)};zt.fromRowMajorArray=function(e,t){return d(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new zt(e[0],e[1],e[2],e[3])};zt.fromScale=function(e,t){return d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new zt(e.x,0,0,e.y)};zt.fromUniformScale=function(e,t){return d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new zt(e,0,0,e)};zt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return d(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new zt(n,-i,i,n)};zt.toArray=function(e,t){return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};zt.getElementIndex=function(e,t){return e*2+t};zt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};zt.setColumn=function(e,t,n,i){i=zt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};zt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};zt.setRow=function(e,t,n,i){return i=zt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var HTe=new D;zt.setScale=function(e,t,n){let i=zt.getScale(e,HTe),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var zTe=new D;zt.setUniformScale=function(e,t,n){let i=zt.getScale(e,zTe),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var R7=new D;zt.getScale=function(e,t){return t.x=D.magnitude(D.fromElements(e[0],e[1],R7)),t.y=D.magnitude(D.fromElements(e[2],e[3],R7)),t};var Z7=new D;zt.getMaximumScale=function(e){return zt.getScale(e,Z7),D.maximumComponent(Z7)};var JTe=new D;zt.setRotation=function(e,t,n){let i=zt.getScale(e,JTe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var QTe=new D;zt.getRotation=function(e,t){let n=zt.getScale(e,QTe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};zt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};zt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};zt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};zt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};zt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};zt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};zt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};zt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};zt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};zt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};zt.equals=function(e,t){return e===t||d(e)&&d(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};zt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};zt.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};zt.IDENTITY=Object.freeze(new zt(1,0,0,1));zt.ZERO=Object.freeze(new zt(0,0,0,0));zt.COLUMN0ROW0=0;zt.COLUMN0ROW1=1;zt.COLUMN1ROW0=2;zt.COLUMN1ROW1=3;Object.defineProperties(zt.prototype,{length:{get:function(){return zt.packedLength}}});zt.prototype.clone=function(e){return zt.clone(this,e)};zt.prototype.equals=function(e){return zt.equals(this,e)};zt.prototype.equalsEpsilon=function(e,t){return zt.equalsEpsilon(this,e,t)};zt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var $i=zt;function jTe(e,t,n,i){switch(t.type){case e.FLOAT:return new G7(e,t,n,i);case e.FLOAT_VEC2:return new E7(e,t,n,i);case e.FLOAT_VEC3:return new X7(e,t,n,i);case e.FLOAT_VEC4:return new I7(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new mB(e,t,n,i);case e.INT:case e.BOOL:return new W7(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new P7(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new v7(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new w7(e,t,n,i);case e.FLOAT_MAT2:return new F7(e,t,n,i);case e.FLOAT_MAT3:return new A7(e,t,n,i);case e.FLOAT_MAT4:return new M7(e,t,n,i);default:throw new me(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function G7(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}G7.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function E7(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}E7.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function X7(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}X7.prototype.set=function(){let e=this.value;d(e.red)?B.equals(e,this._value)||(this._value=B.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):d(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function I7(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}I7.prototype.set=function(){let e=this.value;d(e.red)?B.equals(e,this._value)||(this._value=B.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):d(e.x)&&(se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function mB(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}mB.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};mB.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function W7(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}W7.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function P7(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}P7.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function v7(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}v7.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function w7(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}w7.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var qTe=new Float32Array(4);function F7(e,t,n,i){this.name=n,this.value=void 0,this._value=new $i,this._gl=e,this._location=i}F7.prototype.set=function(){if(!$i.equalsArray(this.value,this._value,0)){$i.clone(this.value,this._value);let e=$i.toArray(this.value,qTe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var $Te=new Float32Array(9);function A7(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}A7.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,$Te);this._gl.uniformMatrix3fv(this._location,!1,e)}};var eSe=new Float32Array(16);function M7(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}M7.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,eSe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var $V=jTe;var RSt=T(S(),1);function tSe(e,t,n,i){switch(t.type){case e.FLOAT:return new N7(e,t,n,i);case e.FLOAT_VEC2:return new U7(e,t,n,i);case e.FLOAT_VEC3:return new k7(e,t,n,i);case e.FLOAT_VEC4:return new D7(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new hB(e,t,n,i);case e.INT:case e.BOOL:return new B7(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Y7(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new O7(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new K7(e,t,n,i);case e.FLOAT_MAT2:return new H7(e,t,n,i);case e.FLOAT_MAT3:return new z7(e,t,n,i);case e.FLOAT_MAT4:return new J7(e,t,n,i);default:throw new me(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function N7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}N7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function U7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}U7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function k7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}k7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];d(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):d(s.x)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function D7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}D7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];d(s.red)?B.equalsArray(s,n,o)||(B.pack(s,n,o),i=!0):d(s.x)&&(se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function hB(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}hB.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};hB.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function B7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}B7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function Y7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}Y7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function O7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}O7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function K7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}K7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function H7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}H7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$i.equalsArray(s,n,o)||($i.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function z7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}z7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function J7(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}J7.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var eL=tSe;var nSe=0;function Kf(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=iSe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=nSe++}Kf.fromCache=function(e){return e=g(e,g.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};Kf.replaceCache=function(e){return e=g(e,g.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Kf.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return V9(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return V9(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return V9(this),this._uniformsByName}}});function Q7(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(d(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function iSe(e,t){let n={};if(!kt.highpFloatSupported||!kt.highpIntSupported){let i,o,r,s,a=Q7(e),c=Q7(t),l=a.length,u=c.length;for(i=0;i<l;i++)for(o=0;o<u;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let m=new RegExp(`${r}\\b`,"g");t=t.replace(m,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Rh="[Cesium WebGL] ";function oSe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(d(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),d(c)&&c.length>0&&console.log(`${Rh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),d(c)&&c.length>0&&console.log(`${Rh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),d(c)&&c.length>0&&console.log(`${Rh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let l,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Rh}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),l=`Program failed to link.  Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Rh}Vertex shader compile log: ${c}`),console.error(`${Rh} Vertex shader source:
${n}`),l=`Vertex shader failed to compile.  Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Rh}Fragment shader compile log: ${c}`),console.error(`${Rh} Fragment shader source:
${i}`),l=`Fragment shader failed to compile.  Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new me(l);function m(p,y){if(!d(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${Rh}${y} shader translation failed.`);return}console.error(`${Rh}Translated ${y} shaderSource:
${f}`)}}function rSe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function sSe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",l=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(l.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,l);if(u!==null){let m=$V(e,a,l,u);n[l]=m,i.push(m),m._setSampler&&o.push(m)}}else{let u,m,p,y,f=l.indexOf("[");if(f>=0){if(u=n[l.slice(0,f)],!d(u))continue;m=u._locations,m.length<=1&&(p=u.value,y=e.getUniformLocation(t,l),y!==null&&(m.push(y),p.push(e.getUniform(t,y))))}else{m=[];for(let x=0;x<a.size;++x)y=e.getUniformLocation(t,`${l}[${x}]`),y!==null&&m.push(y);u=eL(e,a,l,m),n[l]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function aSe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];d(a)&&(r.name=a,s=a);let c=Yf[s];d(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function cSe(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function V9(e){d(e._program)||j7(e)}function j7(e){let t=e._program,n=e._gl,i=oSe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=sSe(n,i),s=aSe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=rSe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=cSe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,l,u){let m=e._vertexShaderText,p=e._fragmentShaderText,y=/ ! = /g;e._vertexShaderText=a.replace(y," != "),e._fragmentShaderText=c.replace(y," != ");try{j7(e),l(e._program)}catch(f){e._vertexShaderText=m,e._fragmentShaderText=p;let _=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(_?_[1]:f.message)}})}Kf.prototype._bind=function(){V9(this),this._gl.useProgram(this._program)};Kf.prototype._setUniforms=function(e,t,n){let i,o;if(d(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Kf.prototype.isDestroyed=function(){return!1};Kf.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Kf.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=Kf;function L9(e){this._context=e}var tL,lSe=new nt({primitiveType:Fe.TRIANGLES}),dSe=new ti({color:new B(0,0,0,0)});function uSe(e,t){return new Us({context:e,colorTextures:[t],destroyAttachments:!1})}function mSe(e,t){return Qt.fromCache({context:e,vertexShaderSource:Sg,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function hSe(e,t){return(!d(tL)||tL.viewport.width!==e||tL.viewport.height!==t)&&(tL=De.fromCache({viewport:new He(0,0,e,t)})),tL}L9.prototype.execute=function(e){d(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=d(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=d(e.shaderProgram)?e.shaderProgram:mSe(o,e.fragmentShaderSource),a=uSe(o,t),c=hSe(n,i),l=e.uniformMap,u=dSe;u.framebuffer=a,u.renderState=c,u.execute(o);let m=lSe;m.vertexArray=r,m.renderState=c,m.shaderProgram=s,m.uniformMap=l,m.framebuffer=a,m.execute(o),a.destroy(),e.persists||(s.destroy(),d(e.vertexArray)&&r.destroy()),d(e.postExecute)&&e.postExecute(t)};L9.prototype.isDestroyed=function(){return!1};L9.prototype.destroy=function(){return ue(this)};var nL=L9;var dFt=T(S(),1);var eCt=T(S(),1);var Rn={BYTE:ne.BYTE,UNSIGNED_BYTE:ne.UNSIGNED_BYTE,SHORT:ne.SHORT,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,INT:ne.INT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,DOUBLE:ne.DOUBLE};Rn.getSizeInBytes=function(e){switch(e){case Rn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Rn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Rn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Rn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Rn.INT:return Int32Array.BYTES_PER_ELEMENT;case Rn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Rn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Rn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Rn.fromTypedArray=function(e){if(e instanceof Int8Array)return Rn.BYTE;if(e instanceof Uint8Array)return Rn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Rn.SHORT;if(e instanceof Uint16Array)return Rn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Rn.INT;if(e instanceof Uint32Array)return Rn.UNSIGNED_INT;if(e instanceof Float32Array)return Rn.FLOAT;if(e instanceof Float64Array)return Rn.DOUBLE};Rn.validate=function(e){return d(e)&&(e===Rn.BYTE||e===Rn.UNSIGNED_BYTE||e===Rn.SHORT||e===Rn.UNSIGNED_SHORT||e===Rn.INT||e===Rn.UNSIGNED_INT||e===Rn.FLOAT||e===Rn.DOUBLE)};Rn.createTypedArray=function(e,t){switch(e){case Rn.BYTE:return new Int8Array(t);case Rn.UNSIGNED_BYTE:return new Uint8Array(t);case Rn.SHORT:return new Int16Array(t);case Rn.UNSIGNED_SHORT:return new Uint16Array(t);case Rn.INT:return new Int32Array(t);case Rn.UNSIGNED_INT:return new Uint32Array(t);case Rn.FLOAT:return new Float32Array(t);case Rn.DOUBLE:return new Float64Array(t)}};Rn.createArrayBufferView=function(e,t,n,i){switch(n=g(n,0),i=g(i,(t.byteLength-n)/Rn.getSizeInBytes(e)),e){case Rn.BYTE:return new Int8Array(t,n,i);case Rn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Rn.SHORT:return new Int16Array(t,n,i);case Rn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Rn.INT:return new Int32Array(t,n,i);case Rn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Rn.FLOAT:return new Float32Array(t,n,i);case Rn.DOUBLE:return new Float64Array(t,n,i)}};Rn.fromName=function(e){switch(e){case"BYTE":return Rn.BYTE;case"UNSIGNED_BYTE":return Rn.UNSIGNED_BYTE;case"SHORT":return Rn.SHORT;case"UNSIGNED_SHORT":return Rn.UNSIGNED_SHORT;case"INT":return Rn.INT;case"UNSIGNED_INT":return Rn.UNSIGNED_INT;case"FLOAT":return Rn.FLOAT;case"DOUBLE":return Rn.DOUBLE}};var Q=Object.freeze(Rn);var aCt=T(S(),1);var oCt=T(S(),1);var q7={};function iL(e,t){d(q7[e])||(q7[e]=!0,console.warn(g(t,e)))}iL.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";iL.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored";iL.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored";iL.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var It=iL;function fSe(e,t){It(e,t)}var zr=fSe;var jLt=T(S(),1);var lCt=T(S(),1),pSe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Hd=Object.freeze(pSe);var yCt=T(S(),1);function it(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}var oL=new h;it.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);oL=h.normalize(e,oL);let r=oL.x*o,s=oL.y*o,a=oL.z*o,c=Math.cos(i);return d(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new it(r,s,a,c)};var bSe=[1,2,0],ySe=new Array(3);it.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],l=e[$.COLUMN2ROW2],u=a+c+l;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let m=bSe,p=0;c>a&&(p=1),l>a&&l>c&&(p=2);let y=m[p],f=m[y];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(y,y)]-e[$.getElementIndex(f,f)]+1);let x=ySe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,y)]-e[$.getElementIndex(y,f)])*n,x[y]=(e[$.getElementIndex(y,p)]+e[$.getElementIndex(p,y)])*n,x[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-x[0],o=-x[1],r=-x[2]}return d(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new it(i,o,r,s)};var $7=new it,e6=new it,fB=new it,t6=new it;it.fromHeadingPitchRoll=function(e,t){return t6=it.fromAxisAngle(h.UNIT_X,e.roll,$7),fB=it.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=it.multiply(fB,t6,fB),e6=it.fromAxisAngle(h.UNIT_Z,-e.heading,$7),it.multiply(e6,t,t)};var R9=new h,pB=new h,tm=new it,n6=new it,Z9=new it;it.packedLength=4;it.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};it.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,Z9),it.conjugate(Z9,Z9);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;it.unpack(e,(t+o)*4,tm),it.multiply(tm,Z9,tm),tm.w<0&&it.negate(tm,tm),it.computeAxis(tm,R9);let a=it.computeAngle(tm);d(i)||(i=[]),i[s]=R9.x*a,i[s+1]=R9.y*a,i[s+2]=R9.z*a}};it.unpackInterpolationResult=function(e,t,n,i,o){d(o)||(o=new it),h.fromArray(e,0,pB);let r=h.magnitude(pB);return it.unpack(t,i*4,n6),r===0?it.clone(it.IDENTITY,tm):it.fromAxisAngle(pB,r,tm),it.multiply(tm,n6,o)};it.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new it(e.x,e.y,e.z,e.w)};it.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};it.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};it.magnitude=function(e){return Math.sqrt(it.magnitudeSquared(e))};it.normalize=function(e,t){let n=1/it.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};it.inverse=function(e,t){let n=it.magnitudeSquared(e);return t=it.conjugate(e,t),it.multiplyByScalar(t,1/n,t)};it.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};it.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};it.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};it.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};it.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,l=t.z,u=t.w,m=s*a+i*u+o*l-r*c,p=s*c-i*l+o*u+r*a,y=s*l+i*c-o*a+r*u,f=s*u-i*a-o*c-r*l;return n.x=m,n.y=p,n.z=y,n.w=f,n};it.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};it.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};it.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<W.EPSILON6)return t.x=t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};it.computeAngle=function(e){return Math.abs(e.w-1)<W.EPSILON6?0:2*Math.acos(e.w)};var bB=new it;it.lerp=function(e,t,n,i){return bB=it.multiplyByScalar(t,n,bB),i=it.multiplyByScalar(e,1-n,i),it.add(bB,i,i)};var i6=new it,yB=new it,gB=new it;it.slerp=function(e,t,n,i){let o=it.dot(e,t),r=t;if(o<0&&(o=-o,r=i6=it.negate(t,i6)),1-o<W.EPSILON6)return it.lerp(e,r,n,i);let s=Math.acos(o);return yB=it.multiplyByScalar(e,Math.sin((1-n)*s),yB),gB=it.multiplyByScalar(r,Math.sin(n*s),gB),i=it.add(yB,gB,i),it.multiplyByScalar(i,1/Math.sin(s),i)};it.log=function(e,t){let n=W.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};it.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var gSe=new h,xSe=new h,rL=new it,qT=new it;it.computeInnerQuadrangle=function(e,t,n,i){let o=it.conjugate(t,rL);it.multiply(o,n,qT);let r=it.log(qT,gSe);it.multiply(o,e,qT);let s=it.log(qT,xSe);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),it.exp(r,rL),it.multiply(t,rL,i)};it.squad=function(e,t,n,i,o,r){let s=it.slerp(e,t,o,rL),a=it.slerp(n,i,o,qT);return it.slerp(s,a,2*o*(1-o),r)};var _Se=new it,o6=1.9011074535173003,G9=Mt.supportsTypedArrays()?new Float32Array(8):[],E9=Mt.supportsTypedArrays()?new Float32Array(8):[],Hf=Mt.supportsTypedArrays()?new Float32Array(8):[],zf=Mt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;G9[e]=1/(t*n),E9[e]=t/n}G9[7]=o6/(8*17);E9[7]=o6*8/17;it.fastSlerp=function(e,t,n,i){let o=it.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,l=a*a;for(let y=7;y>=0;--y)Hf[y]=(G9[y]*c-E9[y])*s,zf[y]=(G9[y]*l-E9[y])*s;let u=r*n*(1+Hf[0]*(1+Hf[1]*(1+Hf[2]*(1+Hf[3]*(1+Hf[4]*(1+Hf[5]*(1+Hf[6]*(1+Hf[7])))))))),m=a*(1+zf[0]*(1+zf[1]*(1+zf[2]*(1+zf[3]*(1+zf[4]*(1+zf[5]*(1+zf[6]*(1+zf[7])))))))),p=it.multiplyByScalar(e,m,_Se);return it.multiplyByScalar(t,u,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,o,r){let s=it.fastSlerp(e,t,o,rL),a=it.fastSlerp(n,i,o,qT);return it.fastSlerp(s,a,2*o*(1-o),r)};it.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};it.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ae=it;var FLt=T(S(),1);var HVt=T(S(),1);var xCt=T(S(),1);function TSe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Lo=TSe;var TCt=T(S(),1);function SSe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var $0=SSe;var kCt=T(S(),1);var CCt=T(S(),1);function CSe(e,t,n,i,o,r,s,a){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a}var Jf=CSe;var LCt=T(S(),1);function VSe(e){return e%4===0&&e%100!==0||e%400===0}var Qf=VSe;var ZCt=T(S(),1);function LSe(e,t){this.julianDate=e,this.offset=t}var Ui=LSe;var ECt=T(S(),1),RSe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Qn=Object.freeze(RSe);var ICt=T(S(),1),ZSe={UTC:0,TAI:1},Jn=Object.freeze(ZSe);var s6=new Jf,xB=[31,28,31,30,31,30,31,31,30,31,30,31],_B=29;function TB(e,t){return Lt.compare(e.julianDate,t.julianDate)}var $T=new Ui;function I9(e){$T.julianDate=e;let t=Lt.leapSeconds,n=Lo(t,$T,TB);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Lt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Lt.addSeconds(e,i,e)}function r6(e,t){$T.julianDate=e;let n=Lt.leapSeconds,i=Lo(n,$T,TB);if(i<0&&(i=~i),i===0)return Lt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Lt.addSeconds(e,-n[i-1].offset,t);let o=Lt.secondsDifference(n[i].julianDate,e);if(o===0)return Lt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Lt.addSeconds(e,-n[--i].offset,t)}function eb(e,t,n){let i=t/Qn.SECONDS_PER_DAY|0;return e+=i,t-=Qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function SB(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,l=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*Qn.SECONDS_PER_HOUR+o*Qn.SECONDS_PER_MINUTE+s*Qn.SECONDS_PER_MILLISECOND);return u>=43200&&(l-=1),[l,u]}var GSe=/^(\d{4})$/,ESe=/^(\d{4})-(\d{2})$/,XSe=/^(\d{4})-?(\d{3})$/,ISe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,WSe=/^(\d{4})-?(\d{2})-?(\d{2})$/,CB=/([Z+\-])?(\d{2})?:?(\d{2})?$/,PSe=/^(\d{2})(\.\d+)?/.source+CB.source,vSe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+CB.source,wSe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+CB.source;function Lt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=g(e,0),t=g(t,0),n=g(n,Jn.UTC);let i=e|0;t=t+(e-i)*Qn.SECONDS_PER_DAY,eb(i,t,this),n===Jn.UTC&&I9(this)}Lt.fromGregorianDate=function(e,t){let n=SB(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return d(t)?(eb(n[0],n[1],t),I9(t),t):new Lt(n[0],n[1],Jn.UTC)};Lt.fromDate=function(e,t){let n=SB(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return d(t)?(eb(n[0],n[1],t),I9(t),t):new Lt(n[0],n[1],Jn.UTC)};Lt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,l=0,u=n[0],m=n[1],p,y;if(n=u.match(WSe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(ESe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(GSe),n!==null)i=+n[1];else{let C;if(n=u.match(XSe),n!==null)i=+n[1],C=+n[2],y=Qf(i);else if(n=u.match(ISe),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,Z=new Date(Date.UTC(i,0,4));C=V*7+L-Z.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}y=Qf(i);let f;if(d(m)){n=m.match(wSe),n!==null?(s=+n[1],a=+n[2],c=+n[3],l=+(n[4]||0)*1e3,f=5):(n=m.match(vSe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=m.match(PSe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let C=n[f],V=+n[f+1],L=+(n[f+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=y&&o===2?_B:xB[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=y&&o===2?_B:xB[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=y&&o===2?_B:xB[o-1],r+=p;let _=SB(i,o,r,s,a,c,l);return d(t)?(eb(_[0],_[1],t),I9(t)):t=new Lt(_[0],_[1],Jn.UTC),x&&Lt.addSeconds(t,1,t),t};Lt.now=function(e){return Lt.fromDate(new Date,e)};var X9=new Lt(0,0,Jn.TAI);Lt.toGregorianDate=function(e,t){let n=!1,i=r6(e,X9);d(i)||(Lt.addSeconds(e,-1,X9),i=r6(X9,X9),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let l=80*s/2447|0,u=s-(2447*l/80|0)|0;s=l/11|0;let m=l+2-12*s|0,p=100*(a-49)+c+s|0,y=r/Qn.SECONDS_PER_HOUR|0,f=r-y*Qn.SECONDS_PER_HOUR,x=f/Qn.SECONDS_PER_MINUTE|0;f=f-x*Qn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/Qn.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(_+=1),d(t)?(t.year=p,t.month=m,t.day=u,t.hour=y,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new Jf(p,m,u,y,x,_,C,n)};Lt.toDate=function(e){let t=Lt.toGregorianDate(e,s6),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Lt.toIso8601=function(e,t){let n=Lt.toGregorianDate(e,s6),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,l=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&l===0&&(i=9999,o=12,r=31,s=24);let u;return!d(t)&&l!==0?(u=(l*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`):!d(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(l*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};Lt.clone=function(e,t){if(d(e))return d(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Lt(e.dayNumber,e.secondsOfDay,Jn.TAI)};Lt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Lt.equals=function(e,t){return e===t||d(e)&&d(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Lt.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(Lt.secondsDifference(e,t))<=n};Lt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Qn.SECONDS_PER_DAY};Lt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Lt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Qn.SECONDS_PER_DAY;return n+i};Lt.computeTaiMinusUtc=function(e){$T.julianDate=e;let t=Lt.leapSeconds,n=Lo(t,$T,TB);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Lt.addSeconds=function(e,t,n){return eb(e.dayNumber,e.secondsOfDay+t,n)};Lt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_MINUTE;return eb(e.dayNumber,i,n)};Lt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_HOUR;return eb(e.dayNumber,i,n)};Lt.addDays=function(e,t,n){let i=e.dayNumber+t;return eb(i,e.secondsOfDay,n)};Lt.lessThan=function(e,t){return Lt.compare(e,t)<0};Lt.lessThanOrEquals=function(e,t){return Lt.compare(e,t)<=0};Lt.greaterThan=function(e,t){return Lt.compare(e,t)>0};Lt.greaterThanOrEquals=function(e,t){return Lt.compare(e,t)>=0};Lt.prototype.clone=function(e){return Lt.clone(this,e)};Lt.prototype.equals=function(e){return Lt.equals(this,e)};Lt.prototype.equalsEpsilon=function(e,t){return Lt.equalsEpsilon(this,e,t)};Lt.prototype.toString=function(){return Lt.toIso8601(this)};Lt.leapSeconds=[new Ui(new Lt(2441317,43210,Jn.TAI),10),new Ui(new Lt(2441499,43211,Jn.TAI),11),new Ui(new Lt(2441683,43212,Jn.TAI),12),new Ui(new Lt(2442048,43213,Jn.TAI),13),new Ui(new Lt(2442413,43214,Jn.TAI),14),new Ui(new Lt(2442778,43215,Jn.TAI),15),new Ui(new Lt(2443144,43216,Jn.TAI),16),new Ui(new Lt(2443509,43217,Jn.TAI),17),new Ui(new Lt(2443874,43218,Jn.TAI),18),new Ui(new Lt(2444239,43219,Jn.TAI),19),new Ui(new Lt(2444786,43220,Jn.TAI),20),new Ui(new Lt(2445151,43221,Jn.TAI),21),new Ui(new Lt(2445516,43222,Jn.TAI),22),new Ui(new Lt(2446247,43223,Jn.TAI),23),new Ui(new Lt(2447161,43224,Jn.TAI),24),new Ui(new Lt(2447892,43225,Jn.TAI),25),new Ui(new Lt(2448257,43226,Jn.TAI),26),new Ui(new Lt(2448804,43227,Jn.TAI),27),new Ui(new Lt(2449169,43228,Jn.TAI),28),new Ui(new Lt(2449534,43229,Jn.TAI),29),new Ui(new Lt(2450083,43230,Jn.TAI),30),new Ui(new Lt(2450630,43231,Jn.TAI),31),new Ui(new Lt(2451179,43232,Jn.TAI),32),new Ui(new Lt(2453736,43233,Jn.TAI),33),new Ui(new Lt(2454832,43234,Jn.TAI),34),new Ui(new Lt(2456109,43235,Jn.TAI),35),new Ui(new Lt(2457204,43236,Jn.TAI),36),new Ui(new Lt(2457754,43237,Jn.TAI),37)];var te=Lt;var wVt=T(S(),1),R6=T(Dl(),1);var HCt=T(S(),1);function FSe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var sL=FSe;var QCt=T(S(),1);function h6(e,t){if(e===null||typeof e!="object")return e;t=g(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=h6(o,t)),n[i]=o}return n}var Oe=h6;var e1t=T(S(),1);function f6(e,t,n){n=g(n,!1);let i={},o=d(e),r=d(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=f6(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var xt=f6;var n1t=T(S(),1);function ASe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var il=ASe;var s1t=T(S(),1),p6=T(Dl(),1);function VB(e,t){let n;return typeof document<"u"&&(n=document),VB._implementation(e,t,n)}VB._implementation=function(e,t,n){if(!d(t)){if(typeof n>"u")return e;t=g(n.baseURI,n.location.href)}let i=new p6.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Zh=VB;var c1t=T(S(),1),b6=T(Dl(),1);function MSe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new b6.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var aL=MSe;var d1t=T(S(),1),y6=T(Dl(),1);function NSe(e){let t=new y6.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var Vg=NSe;var h1t=T(S(),1);var g6={};function USe(e,t,n){d(t)||(t=e.width),d(n)||(n=e.height);let i=g6[t];d(i)||(i={},g6[t]=i);let o=i[n];if(!d(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var nm=USe;var p1t=T(S(),1);var kSe=/^blob:/i;function DSe(e){return kSe.test(e)}var Lg=DSe;var g1t=T(S(),1);var Gh;function BSe(e){d(Gh)||(Gh=document.createElement("a")),Gh.href=window.location.href;let t=Gh.host,n=Gh.protocol;return Gh.href=e,Gh.href=Gh.href,n!==Gh.protocol||t!==Gh.host}var Rg=BSe;var _1t=T(S(),1);var YSe=/^data:/i;function OSe(e){return YSe.test(e)}var jf=OSe;var S1t=T(S(),1);function KSe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var Zg=KSe;var V1t=T(S(),1);function HSe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var Gg=HSe;var Z1t=T(S(),1);function zSe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];d(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Bl=zSe;var A1t=T(S(),1);var E1t=T(S(),1),JSe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},$n=Object.freeze(JSe);var I1t=T(S(),1),QSe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Jr=Object.freeze(QSe);function w9(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.throttleByServer,!1),n=g(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=g(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=g(e.type,Jr.OTHER),this.serverKey=e.serverKey,this.state=$n.UNISSUED,this.deferred=void 0,this.cancelled=!1}w9.prototype.cancel=function(){this.cancelled=!0};w9.prototype.clone=function(e){return d(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=$n.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new w9(this)};var Uo=w9;var B1t=T(S(),1);var N1t=T(S(),1);function jSe(e){let t={};if(!e)return t;let n=e.split(`\r
`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var cL=jSe;function x6(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=cL(this.responseHeaders))}x6.prototype.toString=function(){let e="Request has failed.";return d(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Eh=x6;var sVt=T(S(),1),F9=T(Dl(),1);var K1t=T(S(),1);function lL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lL.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function qSe(e,t){return t-e}lL.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];d(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(qSe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var ye=lL;var Q1t=T(S(),1);function Eg(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Eg.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function LB(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Eg.prototype.reserve=function(e){e=g(e,this._length),this._array.length=e};Eg.prototype.heapify=function(e){e=g(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(LB(i,o,e),e=o):r=!1}};Eg.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Eg.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)LB(t,o,s),o=s;else break}let r;return d(i)&&this._length>i&&(r=t[i],this._length=i),r};Eg.prototype.pop=function(e){if(e=g(e,0),this._length===0)return;let t=this._array,n=t[e];return LB(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var dL=Eg;function $Se(e,t){return e.priority-t.priority}var eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},nS=20,va=new dL({comparator:$Se});va.maximumLength=nS;va.reserve(nS);var Xh=[],qf={},eCe=typeof document<"u"?new F9.default(document.location.href):new F9.default,A9=new ye;function Do(){}Do.maximumRequests=50;Do.maximumRequestsPerServer=6;Do.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18,"tile.googleapis.com:443":18,"tile.openstreetmap.org:443":18};Do.throttleRequests=!0;Do.debugShowStatistics=!1;Do.requestCompletedEvent=A9;Object.defineProperties(Do,{statistics:{get:function(){return eo}},priorityHeapLength:{get:function(){return nS},set:function(e){if(e<nS)for(;va.length>e;){let t=va.pop();Xg(t)}nS=e,va.maximumLength=e,va.reserve(e)}}});function _6(e){d(e.priorityFunction)&&(e.priority=e.priorityFunction())}Do.serverHasOpenSlots=function(e,t){t=g(t,1);let n=g(Do.requestsByServer[e],Do.maximumRequestsPerServer);return qf[e]+t<=n};Do.heapHasOpenSlots=function(e){return va.length+e<=nS};function T6(e){return e.state===$n.UNISSUED&&(e.state=$n.ISSUED,e.deferred=il()),e.deferred.promise}function tCe(e){return function(t){if(e.state===$n.CANCELLED)return;let n=e.deferred;--eo.numberOfActiveRequests,--qf[e.serverKey],A9.raiseEvent(),e.state=$n.RECEIVED,e.deferred=void 0,n.resolve(t)}}function nCe(e){return function(t){e.state!==$n.CANCELLED&&(++eo.numberOfFailedRequests,--eo.numberOfActiveRequests,--qf[e.serverKey],A9.raiseEvent(t),e.state=$n.FAILED,e.deferred.reject(t))}}function S6(e){let t=T6(e);return e.state=$n.ACTIVE,Xh.push(e),++eo.numberOfActiveRequests,++eo.numberOfActiveRequestsEver,++qf[e.serverKey],e.requestFunction().then(tCe(e)).catch(nCe(e)),t}function Xg(e){let t=e.state===$n.ACTIVE;if(e.state=$n.CANCELLED,++eo.numberOfCancelledRequests,d(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--eo.numberOfActiveRequests,--qf[e.serverKey],++eo.numberOfCancelledActiveRequests),d(e.cancelFunction)&&e.cancelFunction()}Do.update=function(){let e,t,n=0,i=Xh.length;for(e=0;e<i;++e){if(t=Xh[e],t.cancelled&&Xg(t),t.state!==$n.ACTIVE){++n;continue}n>0&&(Xh[e-n]=t)}Xh.length-=n;let o=va.internalArray,r=va.length;for(e=0;e<r;++e)_6(o[e]);va.resort();let s=Math.max(Do.maximumRequests-Xh.length,0),a=0;for(;a<s&&va.length>0;){if(t=va.pop(),t.cancelled){Xg(t);continue}if(t.throttleByServer&&!Do.serverHasOpenSlots(t.serverKey)){Xg(t);continue}S6(t),++a}iCe()};Do.getServerKey=function(e){let t=new F9.default(e);t.scheme()===""&&(t=t.absoluteTo(eCe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=qf[n];return d(i)||(qf[n]=0),n};Do.request=function(e){if(jf(e.url)||Lg(e.url))return A9.raiseEvent(),e.state=$n.RECEIVED,e.requestFunction();if(++eo.numberOfAttemptedRequests,d(e.serverKey)||(e.serverKey=Do.getServerKey(e.url)),Do.throttleRequests&&e.throttleByServer&&!Do.serverHasOpenSlots(e.serverKey))return;if(!Do.throttleRequests||!e.throttle)return S6(e);if(Xh.length>=Do.maximumRequests)return;_6(e);let t=va.insert(e);if(d(t)){if(t===e)return;Xg(t)}return T6(e)};function iCe(){Do.debugShowStatistics&&(eo.numberOfActiveRequests===0&&eo.lastNumberOfActiveRequests>0&&(eo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${eo.numberOfAttemptedRequests}`),eo.numberOfAttemptedRequests=0),eo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${eo.numberOfCancelledRequests}`),eo.numberOfCancelledRequests=0),eo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${eo.numberOfCancelledActiveRequests}`),eo.numberOfCancelledActiveRequests=0),eo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${eo.numberOfFailedRequests}`),eo.numberOfFailedRequests=0)),eo.lastNumberOfActiveRequests=eo.numberOfActiveRequests)}Do.clearForSpecs=function(){for(;va.length>0;){let t=va.pop();Xg(t)}let e=Xh.length;for(let t=0;t<e;++t)Xg(Xh[t]);Xh.length=0,qf={},eo.numberOfAttemptedRequests=0,eo.numberOfActiveRequests=0,eo.numberOfCancelledRequests=0,eo.numberOfCancelledActiveRequests=0,eo.numberOfFailedRequests=0,eo.numberOfActiveRequestsEver=0,eo.lastNumberOfActiveRequests=0};Do.numberOfActiveRequestsByServer=function(e){return qf[e]};Do.requestHeap=va;var wa=Do;var lVt=T(S(),1),C6=T(Dl(),1);var uL={},iS={};uL.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;d(iS[n])||(iS[n]=!0)};uL.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;d(iS[n])&&delete iS[n]};function oCe(e){let t=new C6.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}uL.contains=function(e){let t=oCe(e);return!!(d(t)&&d(iS[t]))};uL.clear=function(){iS={}};var oS=uL;var Z6=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Vt(e){e=g(e,g.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Ih(e.templateValues,{}),this._queryParameters=Ih(e.queryParameters,{}),this.headers=Ih(e.headers,{}),this.request=g(e.request,new Uo),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=g(e.retryAttempts,0),this._retryCount=0,g(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ih(e,t){return d(e)?Oe(e):t}Vt.createIfNeeded=function(e){return e instanceof Vt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Vt({url:e})};var rS;Vt.supportsImageBitmapOptions=function(){if(d(rS))return rS;if(typeof createImageBitmap!="function")return rS=Promise.resolve(!1),rS;let e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";return rS=Vt.fetchBlob({url:e}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=nm(t[0]),i=nm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),rS};Object.defineProperties(Vt,{isBlobSupported:{get:function(){return Z6}}});Object.defineProperties(Vt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Vg(this._url)}},isDataUri:{get:function(){return jf(this._url)}},isBlobUri:{get:function(){return Lg(this._url)}},isCrossOriginUrl:{get:function(){return Rg(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Vt.prototype.parseUrl=function(e,t,n,i){let o=new R6.default(e),r=rCe(o.query());this._queryParameters=t?N9(r,this.queryParameters,n):r,o.search(""),o.fragment(""),d(i)&&o.scheme()===""&&(o=o.absoluteTo(Zh(i))),this._url=o.toString()};function rCe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Bl(e)}function N9(e,t,n){if(!n)return xt(e,t);let i=Oe(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];d(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${sCe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return d(s)?encodeURIComponent(s):o})),t&&d(this.proxy)&&(n=this.proxy.getURL(n)),n};function sCe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!d(e[t[0]])?`?${t[0]}`:`?${Gg(e)}`}Vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=N9(this._queryParameters,e,!1):this._queryParameters=N9(e,this._queryParameters,!1)};Vt.prototype.appendQueryParameters=function(e){this._queryParameters=N9(e,this._queryParameters,!0)};Vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};Vt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,d(e.url)){let n=g(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return d(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),d(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),d(e.headers)&&(t.headers=xt(e.headers,t.headers)),d(e.proxy)&&(t.proxy=e.proxy),d(e.request)&&(t.request=e.request),d(e.retryCallback)&&(t.retryCallback=e.retryCallback),d(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Vt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Vt.prototype.clone=function(e){return d(e)?(e._url=this._url,e._queryParameters=Oe(this._queryParameters),e._templateValues=Oe(this._templateValues),e.headers=Oe(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Vt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:d(this.credits)?this.credits.slice():void 0})};Vt.prototype.getBaseUri=function(e){return aL(this.getUrlComponent(e),e)};Vt.prototype.appendForwardSlash=function(){this._url=sL(this._url)};Vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Vt.fetchArrayBuffer=function(e){return new Vt(e).fetchArrayBuffer()};Vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Vt.fetchBlob=function(e){return new Vt(e).fetchBlob()};Vt.prototype.fetchImage=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.preferImageBitmap,!1),n=g(e.preferBlob,!1),i=g(e.flipY,!1),o=g(e.skipColorSpaceConversion,!1);if(ZB(this.request),!Z6||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return RB({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!d(r))return;let s,a,c,l;return Vt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!d(u))return;if(l=u,a)return Vt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Vt({url:m}),RB({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(d(u))return u.blob=l,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return d(c)&&window.URL.revokeObjectURL(c.url),u.blob=l,Promise.reject(u)})};function RB(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=il();return Vt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=wa.request(r);if(d(s))return s.catch(function(a){return r.state!==$n.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=$n.UNISSUED,r.deferred=void 0,RB({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Vt.fetchImage=function(e){return new Vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Vt.fetchText=function(e){return new Vt(e).fetchText()};Vt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(d(e))return e.then(function(t){if(d(t))return JSON.parse(t)})};Vt.fetchJson=function(e){return new Vt(e).fetchJson()};Vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Vt.fetchXML=function(e){return new Vt(e).fetchXML()};Vt.prototype.fetchJsonp=function(e){e=g(e,"callback"),ZB(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(d(window[t]));return G6(this,e,t)};function G6(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=il();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=wa.request(o);if(d(s))return s.catch(function(a){return o.state!==$n.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=$n.UNISSUED,o.deferred=void 0,G6(e,t,n)):Promise.reject(a)})})}Vt.fetchJsonp=function(e){return new Vt(e).fetchJsonp(e.callbackParameterName)};Vt.prototype._makeRequest=function(e){let t=this;ZB(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,l=e.data,u=il(),m=Vt._Implementations.loadWithXhr(i,r,c,l,s,u,a);return d(m)&&d(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=wa.request(n);if(d(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==$n.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=$n.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function ZB(e){if(e.state===$n.ISSUED||e.state===$n.ACTIVE)throw new me("The Resource is already being fetched.");e.state=$n.UNISSUED,e.deferred=void 0}var aCe=/^data:(.*?)(;base64)?,(.*)$/;function M9(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function V6(e,t){let n=M9(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function cCe(e,t){t=g(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return M9(i,o);case"arraybuffer":return V6(i,o);case"blob":return r=V6(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(M9(i,o),n);case"json":return JSON.parse(M9(i,o));default:}}Vt.prototype.fetch=function(e){return e=Ih(e,{}),e.method="GET",this._makeRequest(e)};Vt.fetch=function(e){return new Vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Vt.prototype.delete=function(e){return e=Ih(e,{}),e.method="DELETE",this._makeRequest(e)};Vt.delete=function(e){return new Vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Vt.prototype.head=function(e){return e=Ih(e,{}),e.method="HEAD",this._makeRequest(e)};Vt.head=function(e){return new Vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Vt.prototype.options=function(e){return e=Ih(e,{}),e.method="OPTIONS",this._makeRequest(e)};Vt.options=function(e){return new Vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Vt.prototype.post=function(e,t){return tl.defined("data",e),t=Ih(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Vt.post=function(e){return new Vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Vt.prototype.put=function(e,t){return tl.defined("data",e),t=Ih(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Vt.put=function(e){return new Vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Vt.prototype.patch=function(e,t){return tl.defined("data",e),t=Ih(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Vt.patch=function(e){return new Vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Vt._Implementations={};Vt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(oS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Vt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Vt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Vt._Implementations.loadImageElement(s,t,n);return}let c="blob",l="GET",u=il(),m=Vt._Implementations.loadWithXhr(s,c,l,void 0,void 0,u,void 0,void 0,void 0);return d(m)&&d(m.abort)&&(e.cancelFunction=function(){m.abort()}),u.promise.then(function(p){if(!d(p)){n.reject(new me(`Successfully retrieved ${s} but it contained no content.`));return}return Vt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Vt.createImageBitmapFromBlob=function(e,t){return tl.defined("options",t),tl.typeOf.bool("options.flipY",t.flipY),tl.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),tl.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function L6(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function lCe(e,t,n,i,o,r,s){let a,c;Promise.all([import("url"),import("zlib")]).then(([l,u])=>(a=l.parse(e),c=u,a.protocol==="https:"?import("https"):import("http"))).then(l=>{let u={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:o};l.request(u).on("response",function(m){if(m.statusCode<200||m.statusCode>=300){r.reject(new Eh(m.statusCode,m,m.headers));return}let p=[];m.on("data",function(y){p.push(y)}),m.on("end",function(){let y=Buffer.concat(p);m.headers["content-encoding"]==="gzip"?c.gunzip(y,function(f,x){f?r.reject(new me("Error decompressing response.")):r.resolve(L6(x,t))}):r.resolve(L6(y,t))})}).on("error",function(m){r.reject(new Eh)}).end()})}var dCe=typeof XMLHttpRequest>"u";Vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=aCe.exec(e);if(a!==null){r.resolve(cCe(a,t));return}if(dCe){lCe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(oS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),d(s)&&d(c.overrideMimeType)&&c.overrideMimeType(s),d(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);d(t)&&(c.responseType=t);let l=!1;return typeof e=="string"&&(l=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(l&&c.status===0)){r.reject(new Eh(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let y=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};y.forEach(function(x){let _=x.split(": "),C=_.shift();f[C]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve();else if(d(u)&&(!d(t)||m===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(m===""||m==="document")&&d(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&d(c.responseText)?r.resolve(c.responseText):r.reject(new me("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Eh)},c.send(i),c};Vt._Implementations.loadAndExecuteScript=function(e,t,n){return Zg(e,t).catch(function(i){n.reject(i)})};Vt._DefaultImplementations={};Vt._DefaultImplementations.createImage=Vt._Implementations.createImage;Vt._DefaultImplementations.loadWithXhr=Vt._Implementations.loadWithXhr;Vt._DefaultImplementations.loadAndExecuteScript=Vt._Implementations.loadAndExecuteScript;Vt.DEFAULT=Object.freeze(new Vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ee=Vt;function hL(e){e=g(e,g.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=g(e.addNewLeapSeconds,!0),d(e.data)?E6(this,e.data):E6(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}hL.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new me(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new hL({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};hL.NONE=Object.freeze({compute:function(e,t){return d(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new $0(0,0,0,0,0),t}});hL.prototype.compute=function(e,t){if(!d(this._samples))return;if(d(t)||(t=new $0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(d(i)){let a=n[i],c=n[i+1],l=te.lessThanOrEquals(a,e),u=!d(c),m=u||te.greaterThanOrEquals(c,e);if(l&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,I6(this,n,this._samples,e,o,r,t),t}let s=Lo(n,e,te.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,I6(this,n,this._samples,e,o,r,t),t};function uCe(e,t){return te.compare(e.julianDate,t)}function E6(e,t){if(!d(t.columnNames))throw new me("Error in loaded EOP data: The columnNames property is required.");if(!d(t.samples))throw new me("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new me("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let l=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let m,p=e._addNewLeapSeconds;for(let y=0,f=l.length;y<f;y+=e._columnCount){let x=l[y+n],_=l[y+c],C=x+Qn.MODIFIED_JULIAN_DATE_DIFFERENCE,V=new te(C,_,Jn.TAI);if(u.push(V),p){if(_!==m&&d(m)){let L=te.leapSeconds,Z=Lo(L,V,uCe);if(Z<0){let G=new Ui(V,_);L.splice(~Z,0,G)}}m=_}}}function X6(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function mL(e,t,n){return t+e*(n-t)}function I6(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],l=t[r];if(c.equals(l)||i.equals(c))return X6(e,n,o,a,s),s;if(i.equals(l))return X6(e,n,r,a,s),s;let u=te.secondsDifference(i,c)/te.secondsDifference(l,c),m=o*a,p=r*a,y=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-y;if(x>.5||x<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(l.equals(i)?y=f:f-=C-_)}return s.xPoleWander=mL(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=mL(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=mL(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=mL(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=mL(u,y,f),s}var fL=hL;var qVt=T(S(),1);function Fa(e,t,n){this.heading=g(e,0),this.pitch=g(t,0),this.roll=g(n,0)}Fa.fromQuaternion=function(e,t){d(t)||(t=new Fa);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};Fa.fromDegrees=function(e,t,n,i){return d(i)||(i=new Fa),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};Fa.clone=function(e,t){if(d(e))return d(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Fa(e.heading,e.pitch,e.roll)};Fa.equals=function(e,t){return e===t||d(e)&&d(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Fa.equalsEpsilon=function(e,t,n,i){return e===t||d(e)&&d(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};Fa.prototype.clone=function(e){return Fa.clone(this,e)};Fa.prototype.equals=function(e){return Fa.equals(this,e)};Fa.prototype.equalsEpsilon=function(e,t,n){return Fa.equalsEpsilon(this,e,t,n)};Fa.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Aa=Fa;var pLt=T(S(),1);var iLt=T(S(),1);var W6={};var P6=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function mCe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=P6.exec(i);if(o!==null)return o[1]}}var U9;function v6(e){return typeof document>"u"?e:(d(U9)||(U9=document.createElement("a")),U9.href=e,U9.href)}var Ig;function w6(){if(d(Ig))return Ig;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:d(W6?.url)?e=Zh(".",W6.url):typeof define=="object"&&d(define.amd)&&!define.amd.toUrlUndefined&&d(Q0.toUrl)?e=Zh("..",Wg("Core/buildModuleUrl.js")):e=mCe(),Ig=new Ee({url:v6(e)}),Ig.appendForwardSlash(),Ig}function hCe(e){return v6(Q0.toUrl(`../${e}`))}function F6(e){return w6().getDerivedResource({url:e}).url}var k9;function Wg(e){return d(k9)||(typeof define=="object"&&d(define.amd)&&!define.amd.toUrlUndefined&&d(Q0.toUrl)?k9=hCe:k9=F6),k9(e)}Wg._cesiumScriptRegex=P6;Wg._buildModuleUrlFromBaseUrl=F6;Wg._clearBaseResource=function(){Ig=void 0};Wg.setBaseUrl=function(e){Ig=Ee.DEFAULT.getDerivedResource({url:e})};Wg.getCesiumBaseUrl=w6;var $t=Wg;var sLt=T(S(),1);function fCe(e,t,n){this.x=e,this.y=t,this.s=n}var Pg=fCe;function XB(e){e=g(e,g.EMPTY_OBJECT),this._xysFileUrlTemplate=Ee.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=g(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=g(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new te(this._sampleZeroJulianEphemerisDate,0,Jn.TAI),this._stepSizeDays=g(e.stepSizeDays,1),this._samplesPerXysFile=g(e.samplesPerXysFile,1e3),this._totalSamples=g(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var pCe=new te(0,0,Jn.TAI);function GB(e,t,n){let i=pCe;return i.dayNumber=t,i.secondsOfDay=n,te.daysDifference(i,e._sampleZeroDateTT)}XB.prototype.preload=function(e,t,n,i){let o=GB(this,e,t),r=GB(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,l=a/this._samplesPerXysFile|0,u=[];for(let m=c;m<=l;++m)u.push(EB(this,m));return Promise.all(u)};XB.prototype.computeXysRadians=function(e,t,n){let i=GB(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,l=this._samples;if(d(l[s*3])||(EB(this,s/this._samplesPerXysFile|0),c=!0),d(l[a*3])||(EB(this,a/this._samplesPerXysFile|0),c=!0),c)return;d(n)?(n.x=0,n.y=0,n.s=0):n=new Pg(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,y=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)m[x]=u-f[x];for(x=0;x<=r;++x){for(y[x]=1,_=0;_<=r;++_)_!==x&&(y[x]*=m[_]);y[x]*=p[x];let C=(s+x)*3;n.x+=y[x]*l[C++],n.y+=y[x]*l[C++],n.s+=y[x]*l[C]}return n};function EB(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;d(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ee({url:$t(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let l=0,u=a.length;l<u;++l)s[c+l]=a[l]});return e._chunkDownloadsInProgress[t]=o,o}var pL=XB;var Hi={},IB={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},sS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},WB={},ol={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},tb=new h,nb=new h,ib=new h;Hi.localFrameToFixedFrameGenerator=function(e,t){if(!IB.hasOwnProperty(e)||!IB[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=IB[e][t],i,o=e+t;return d(WB[o])?i=WB[o]:(i=function(r,s,a){if(d(a)||(a=new F),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(sS[e],0,tb),h.unpack(sS[t],0,nb),h.unpack(sS[n],0,ib);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(sS[e],0,tb),e!=="east"&&e!=="west"&&h.multiplyByScalar(tb,c,tb),h.unpack(sS[t],0,nb),t!=="east"&&t!=="west"&&h.multiplyByScalar(nb,c,nb),h.unpack(sS[n],0,ib),n!=="east"&&n!=="west"&&h.multiplyByScalar(ib,c,ib)}else{s=g(s,re.WGS84),s.geodeticSurfaceNormal(r,ol.up);let c=ol.up,l=ol.east;l.x=-r.y,l.y=r.x,l.z=0,h.normalize(l,ol.east),h.cross(c,l,ol.north),h.multiplyByScalar(ol.up,-1,ol.down),h.multiplyByScalar(ol.east,-1,ol.west),h.multiplyByScalar(ol.north,-1,ol.south),tb=ol[e],nb=ol[t],ib=ol[n]}return a[0]=tb.x,a[1]=tb.y,a[2]=tb.z,a[3]=0,a[4]=nb.x,a[5]=nb.y,a[6]=nb.z,a[7]=0,a[8]=ib.x,a[9]=ib.y,a[10]=ib.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},WB[o]=i),i};Hi.eastNorthUpToFixedFrame=Hi.localFrameToFixedFrameGenerator("east","north");Hi.northEastDownToFixedFrame=Hi.localFrameToFixedFrameGenerator("north","east");Hi.northUpEastToFixedFrame=Hi.localFrameToFixedFrameGenerator("north","up");Hi.northWestUpToFixedFrame=Hi.localFrameToFixedFrameGenerator("north","west");var bCe=new Ae,yCe=new h(1,1,1),gCe=new F;Hi.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=g(i,Hi.eastNorthUpToFixedFrame);let r=Ae.fromHeadingPitchRoll(t,bCe),s=F.fromTranslationQuaternionRotationScale(h.ZERO,r,yCe,gCe);return o=i(e,n,o),F.multiply(o,s,o)};var xCe=new F,_Ce=new $;Hi.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Hi.headingPitchRollToFixedFrame(e,t,n,i,xCe),s=F.getMatrix3(r,_Ce);return Ae.fromRotationMatrix(s,o)};var TCe=new h(1,1,1),SCe=new h,A6=new F,CCe=new F,VCe=new $,LCe=new Ae;Hi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=g(t,re.WGS84),n=g(n,Hi.eastNorthUpToFixedFrame),d(i)||(i=new Aa);let o=F.getTranslation(e,SCe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,A6),A6),s=F.setScale(e,TCe,CCe);s=F.setTranslation(s,h.ZERO,s),r=F.multiply(r,s,r);let a=Ae.fromRotationMatrix(F.getMatrix3(r,VCe),LCe);return a=Ae.normalize(a,a),Aa.fromQuaternion(a,i)};var RCe=6*3600+41*60+50.54841,ZCe=8640184812866e-6,GCe=.093104,ECe=-62e-7,XCe=11772758384668e-32,ICe=72921158553e-15,WCe=W.TWO_PI/86400,D9=new te;Hi.computeTemeToPseudoFixedMatrix=function(e,t){D9=te.addSeconds(e,-te.computeTaiMinusUtc(e),D9);let n=D9.dayNumber,i=D9.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Qn.DAYS_PER_JULIAN_CENTURY;let a=(RCe+o*(ZCe+o*(GCe+o*ECe)))*WCe%W.TWO_PI,c=ICe+XCe*(n-24515455e-1),l=(i+Qn.SECONDS_PER_DAY*.5)%Qn.SECONDS_PER_DAY,u=a+c*l,m=Math.cos(u),p=Math.sin(u);return d(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(m,p,0,-p,m,0,0,0,1)};Hi.iau2006XysData=new pL;Hi.earthOrientationParameters=fL.NONE;var wB=32.184,PCe=2451545;Hi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+wB,i=e.stop.dayNumber,o=e.stop.secondsOfDay+wB;return Hi.iau2006XysData.preload(t,n,i,o)};Hi.computeIcrfToFixedMatrix=function(e,t){d(t)||(t=new $);let n=Hi.computeFixedToIcrfMatrix(e,t);if(d(n))return $.transpose(n,t)};var vCe=new Pg(0,0,0),wCe=new $0(0,0,0,0,0,0),PB=new $,vB=new $;Hi.computeFixedToIcrfMatrix=function(e,t){d(t)||(t=new $);let n=Hi.earthOrientationParameters.compute(e,wCe);if(!d(n))return;let i=e.dayNumber,o=e.secondsOfDay+wB,r=Hi.iau2006XysData.computeXysRadians(i,o,vCe);if(!d(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),l=PB;l[0]=1-c*s*s,l[3]=-c*s*a,l[6]=s,l[1]=-c*s*a,l[4]=1-c*a*a,l[7]=a,l[2]=-s,l[5]=-a,l[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,vB),m=$.multiply(l,u,PB),p=e.dayNumber,y=e.secondsOfDay-te.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=y/Qn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=$.fromRotationZ(_,vB),V=$.multiply(m,C,PB),L=Math.cos(n.xPoleWander),Z=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),X=Math.sin(n.yPoleWander),P=i-PCe+o/Qn.SECONDS_PER_DAY;P/=36525;let v=-47e-6*P*W.RADIANS_PER_DEGREE/3600,A=Math.cos(v),M=Math.sin(v),b=vB;return b[0]=L*A,b[1]=L*M,b[2]=G,b[3]=-Z*M+X*G*A,b[4]=Z*A+X*G*M,b[5]=-X*L,b[6]=-X*M-Z*G*A,b[7]=X*A-Z*G*M,b[8]=Z*L,$.multiply(V,b,t)};var FCe=new se;Hi.pointToWindowCoordinates=function(e,t,n,i){return i=Hi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Hi.pointToGLWindowCoordinates=function(e,t,n,i){d(i)||(i=new D);let o=FCe;return F.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var ACe=new h,MCe=new h,NCe=new h;Hi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=g(n,re.WGS84).geodeticSurfaceNormal(e,ACe),r=h.cross(t,o,MCe);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,NCe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),d(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var M6=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),N6=new he,U6=new h,UCe=new h,kCe=new $,FB=new F,k6=new F;Hi.basisTo2D=function(e,t,n){let i=F.getTranslation(t,UCe),o=e.ellipsoid,r=o.cartesianToCartographic(i,N6),s=e.project(r,U6);h.fromElements(s.z,s.x,s.y,s);let a=Hi.eastNorthUpToFixedFrame(i,o,FB),c=F.inverseTransformation(a,k6),l=F.getMatrix3(t,kCe),u=F.multiplyByMatrix3(c,l,n);return F.multiply(M6,u,n),F.setTranslation(n,s,n),n};Hi.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Hi.eastNorthUpToFixedFrame(t,i,FB),r=F.inverseTransformation(o,k6),s=i.cartesianToCartographic(t,N6),a=e.project(s,U6);h.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,FB);return F.multiply(M6,r,n),F.multiply(c,n,n),n};var vt=Hi;function AB(e){e=g(e,g.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=g(e.primitiveType,Fe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=g(e.geometryType,Hd.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}AB.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&d(e.attributes[n])&&d(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var DCe=new he,BCe=new h,D6=new F,YCe=[new he,new he,new he],OCe=[new D,new D,new D],KCe=[new D,new D,new D],HCe=new h,zCe=new Ae,JCe=new F,QCe=new $i;AB._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=de.center(i,DCe),s=he.toCartesian(r,n,BCe),a=vt.eastNorthUpToFixedFrame(s,n,D6),c=F.inverse(a,D6),l=OCe,u=YCe;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let m=HCe;for(o=0;o<3;o++)he.toCartesian(u[o],n,m),m=F.multiplyByPointAsVector(c,m,m),l[o].x=m.x,l[o].y=m.y;let p=Ae.fromAxisAngle(h.UNIT_Z,-t,zCe),y=$.fromQuaternion(p,JCe),f=e.length,x=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(o=0;o<f;o++)m=F.multiplyByPointAsVector(c,e[o],m),m=$.multiplyByVector(y,m,m),x=Math.min(x,m.x),_=Math.min(_,m.y),C=Math.max(C,m.x),V=Math.max(V,m.y);let L=$i.fromRotation(t,QCe),Z=KCe;Z[0].x=x,Z[0].y=_,Z[1].x=x,Z[1].y=V,Z[2].x=C,Z[2].y=_;let G=l[0],X=l[2].x-G.x,P=l[1].y-G.y;for(o=0;o<3;o++){let R=Z[o];$i.multiplyByVector(L,R,R),R.x=(R.x-G.x)/X,R.y=(R.y-G.y)/P}let v=Z[0],A=Z[1],M=Z[2],b=new Array(6);return D.pack(v,b),D.pack(A,b,2),D.pack(M,b,4),b};var dt=AB;var eRt=T(S(),1);function jCe(e){e=g(e,g.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.values=e.values}var Ze=jCe;var LRt=T(S(),1);var TRt=T(S(),1);var iRt=T(S(),1);function aS(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(aS.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});aS.clone=function(e){if(d(e))return new aS(e._format,e._datatype,e._width,e._height,e._buffer)};aS.prototype.clone=function(){return aS.clone(this)};var bL=aS;var pRt=T(S(),1),B6=T(Dl(),1);function Y6(){if(!d(da._canTransferArrayBuffer)){let e=UB("transferTypedArrayTest");e.postMessage=g(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return da._canTransferArrayBuffer=!1,da._canTransferArrayBuffer}da._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=d(r)&&r[0]===t;i(s),e.terminate(),da._canTransferArrayBuffer=s}})}return da._canTransferArrayBuffer}var NB=new ye;function MB(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function UB(e){let t=new B6.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i={},o;if(Rg(e)){let s=`importScripts("${e}");`;return o=MB(s),new Worker(o,i)}let r=e.replace(/\.js$/,"");if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
      importScripts("${MB(CESIUM_WORKERS)}");
      CesiumWorkers["${r}"]();
    `;return o=MB(s),new Worker(o,i)}if(o=e,n||(o=$t(`${da._workerModulePrefix+r}.js`)),!Mt.supportsEsmWebWorkers())throw new me("This browser is not supported. Please update your browser to continue.");return i.type="module",new Worker(o,i)}async function qCe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Mt.supportsWebAssembly()){if(!d(t.fallbackModulePath))throw new me(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=$t(t.fallbackModulePath),n}n.wasmBinaryFile=$t(t.wasmBinaryFile);let i=await Ee.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function da(e,t){this._workerPath=e,this._maximumActiveTasks=g(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var $Ce=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(d(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new me(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new fe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),NB.raiseEvent(s),i(s)}else NB.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},e1e=[];async function t1e(e,t,n){let i=await Promise.resolve(Y6());d(n)?i||(n.length=0):n=e1e;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",$Ce(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:$t.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function n1e(e,t,n){++e._activeTasks;try{let i=await t1e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}da.prototype.scheduleTask=function(e,t){if(d(this._worker)||(this._worker=UB(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return n1e(this,e,t)};da.prototype.initWebAssemblyModule=async function(e){if(d(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=UB(this._workerPath),i=await qCe(this,e),o=await Promise.resolve(Y6()),r,s=i.wasmBinary;d(s)&&o&&(r=[s]);let a=new Promise((c,l)=>{n.onmessage=function({data:u}){d(u)?c(u.result):l(new me("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};da.prototype.isDestroyed=function(){return!1};da.prototype.destroy=function(){return d(this._worker)&&this._worker.terminate(),ue(this)};da.taskCompletedEvent=NB;da._defaultWorkerModulePrefix="Workers/";da._workerModulePrefix=da._defaultWorkerModulePrefix;da._canTransferArrayBuffer=void 0;var pi=da;function $f(){}$f._transcodeTaskProcessor=new pi("transcodeKTX2",Number.POSITIVE_INFINITY);$f._readyPromise=void 0;function i1e(){let e=$f._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return $f._transcodeTaskProcessor;throw new me("KTX2 transcoder could not be initialized.")});$f._readyPromise=e}$f.transcode=function(e,t){return d($f._readyPromise)||i1e(),$f._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let o=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:o},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]),r=o.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<r;c++){let l=a[o[c]];a[o[c]]=new bL(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(r===1){for(s=0;s<i;++s)n[s]=n[s][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var yL=$f;var O6;K6.setKTX2SupportedFormats=function(e,t,n,i,o,r){O6={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function K6(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ee.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return yL.transcode(n,O6)})}var rl=K6;var cZt=T(S(),1);var IRt=T(S(),1);function B9(e,t,n,i,o,r,s,a,c,l,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=l,this._initialized=u}Object.defineProperties(B9.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});B9.prototype.copyFrom=function(e){let t=g(e.xOffset,0),n=g(e.yOffset,0),i=e.source,o=this._context._gl,r=this._textureTarget,s=this._targetFace;o.activeTexture(o.TEXTURE0),o.bindTexture(r,this._texture);let a=i.width,c=i.height,l=i.arrayBufferView,u=this._size,m=this._pixelFormat,p=this._internalFormat,y=this._pixelDatatype,f=this._preMultiplyAlpha,x=this._flipY,_=g(e.skipColorSpaceConversion,!1),C=4;d(l)&&(C=st.alignmentInBytes(m,y,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,C),_?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){if(t===0&&n===0&&a===u&&c===u)d(l)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(l=st.flipY(l,m,y,u,u)),o.texImage2D(s,0,p,u,u,0,m,Je.toWebGLConstant(y,this._context),l)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texImage2D(s,0,p,m,Je.toWebGLConstant(y,this._context),i)),V=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let L=st.createTypedArray(m,y,u,u);o.texImage2D(s,0,p,u,u,0,m,Je.toWebGLConstant(y,this._context),L)}this._initialized=!0}V||(d(l)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(l=st.flipY(l,m,y,a,c)),o.texSubImage2D(s,0,t,n,a,c,m,Je.toWebGLConstant(y,this._context),l)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texSubImage2D(s,0,t,n,m,Je.toWebGLConstant(y,this._context),i))),o.bindTexture(r,null)};B9.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._size),r=g(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};var Wh=B9;var vRt=T(S(),1);var Y9={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===Y9.DONT_CARE||e===Y9.FASTEST||e===Y9.NICEST}},Ph=Object.freeze(Y9);var QRt=T(S(),1);var ARt=T(S(),1);var O9={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};O9.validate=function(e){return e===O9.NEAREST||e===O9.LINEAR};var Ti=Object.freeze(O9);var URt=T(S(),1);var ob={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};ob.validate=function(e){return e===ob.NEAREST||e===ob.LINEAR||e===ob.NEAREST_MIPMAP_NEAREST||e===ob.LINEAR_MIPMAP_NEAREST||e===ob.NEAREST_MIPMAP_LINEAR||e===ob.LINEAR_MIPMAP_LINEAR};var cn=Object.freeze(ob);var BRt=T(S(),1);var K9={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===K9.CLAMP_TO_EDGE||e===K9.REPEAT||e===K9.MIRRORED_REPEAT}},Gn=Object.freeze(K9);function gL(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.wrapS,Gn.CLAMP_TO_EDGE),n=g(e.wrapT,Gn.CLAMP_TO_EDGE),i=g(e.minificationFilter,cn.LINEAR),o=g(e.magnificationFilter,Ti.LINEAR),r=d(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(gL.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});gL.equals=function(e,t){return e===t||d(e)&&d(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};gL.NEAREST=Object.freeze(new gL({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST}));var dn=gL;function xL(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=e.source,i,o;if(d(n)){let V=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=V[0].width,o=V[0].height}else i=e.width,o=e.height;let r=i,s=g(e.pixelDatatype,Je.UNSIGNED_BYTE),a=g(e.pixelFormat,st.RGBA),c=st.toInternalFormat(a,s,t),l=st.textureSizeInBytes(a,s,r,r)*6,u=e.preMultiplyAlpha||a===st.RGB||a===st.LUMINANCE,m=g(e.flipY,!0),p=g(e.skipColorSpaceConversion,!1),y=t._gl,f=y.TEXTURE_CUBE_MAP,x=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(f,x);function _(V,L,Z,G,X){let P=L.arrayBufferView;d(P)||(P=L.bufferView);let v=4;d(P)&&(v=st.alignmentInBytes(a,s,i)),y.pixelStorei(y.UNPACK_ALIGNMENT,v),X?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),d(P)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,!1),G&&(P=st.flipY(P,a,s,r,r)),y.texImage2D(V,0,c,r,r,0,a,Je.toWebGLConstant(s,t),P)):(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,G),y.texImage2D(V,0,c,a,Je.toWebGLConstant(s,t),L))}d(n)?(_(y.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,u,m,p),_(y.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,u,m,p),_(y.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,u,m,p),_(y.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,u,m,p),_(y.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,u,m,p),_(y.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,u,m,p)):(y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,r,r,0,a,Je.toWebGLConstant(s,t),null)),y.bindTexture(f,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f,this._texture=x,this._pixelFormat=a,this._pixelDatatype=s,this._size=r,this._hasMipmap=!1,this._sizeInBytes=l,this._preMultiplyAlpha=u,this._flipY=m,this._sampler=void 0;let C=d(n);this._positiveX=new Wh(t,x,f,y.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,r,u,m,C),this._negativeX=new Wh(t,x,f,y.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,r,u,m,C),this._positiveY=new Wh(t,x,f,y.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,r,u,m,C),this._negativeY=new Wh(t,x,f,y.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,r,u,m,C),this._positiveZ=new Wh(t,x,f,y.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,r,u,m,C),this._negativeZ=new Wh(t,x,f,y.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,r,u,m,C),this.sampler=d(e.sampler)?e.sampler:new dn}Object.defineProperties(xL.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=t===cn.NEAREST_MIPMAP_NEAREST||t===cn.NEAREST_MIPMAP_LINEAR||t===cn.LINEAR_MIPMAP_NEAREST||t===cn.LINEAR_MIPMAP_LINEAR,o=this._context,r=this._pixelDatatype;(r===Je.FLOAT&&!o.textureFloatLinear||r===Je.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(t=i?cn.NEAREST_MIPMAP_NEAREST:cn.NEAREST,n=Ti.NEAREST);let s=o._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),d(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});xL.prototype.generateMipmap=function(e){e=g(e,Ph.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};xL.prototype.isDestroyed=function(){return!1};xL.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Ma=xL;var dZt=T(S(),1);function o1e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Na=o1e;var DPt=T(S(),1);var FPt=T(S(),1);var ZPt=T(S(),1);var mZt=T(S(),1),_L=`/**
 * A built-in GLSL floating-point constant for converting radians to degrees.
 *
 * @alias czm_degreesPerRadian
 * @glslConstant
 *
 * @see CesiumMath.DEGREES_PER_RADIAN
 *
 * @example
 * // GLSL declaration
 * const float czm_degreesPerRadian = ...;
 *
 * // Example
 * float deg = czm_degreesPerRadian * rad;
 */
const float czm_degreesPerRadian = 57.29577951308232;
`;var fZt=T(S(),1),TL=`/**
 * A built-in GLSL vec2 constant for defining the depth range.
 * This is a workaround to a bug where IE11 does not implement gl_DepthRange.
 *
 * @alias czm_depthRange
 * @glslConstant
 *
 * @example
 * // GLSL declaration
 * float depthRangeNear = czm_depthRange.near;
 * float depthRangeFar = czm_depthRange.far;
 *
 */
const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
`;var bZt=T(S(),1),SL=`/**
 * 0.1
 *
 * @name czm_epsilon1
 * @glslConstant
 */
const float czm_epsilon1 = 0.1;
`;var gZt=T(S(),1),CL=`/**
 * 0.01
 *
 * @name czm_epsilon2
 * @glslConstant
 */
const float czm_epsilon2 = 0.01;
`;var _Zt=T(S(),1),VL=`/**
 * 0.001
 *
 * @name czm_epsilon3
 * @glslConstant
 */
const float czm_epsilon3 = 0.001;
`;var SZt=T(S(),1),LL=`/**
 * 0.0001
 *
 * @name czm_epsilon4
 * @glslConstant
 */
const float czm_epsilon4 = 0.0001;
`;var VZt=T(S(),1),RL=`/**
 * 0.00001
 *
 * @name czm_epsilon5
 * @glslConstant
 */
const float czm_epsilon5 = 0.00001;
`;var RZt=T(S(),1),ZL=`/**
 * 0.000001
 *
 * @name czm_epsilon6
 * @glslConstant
 */
const float czm_epsilon6 = 0.000001;
`;var GZt=T(S(),1),GL=`/**
 * 0.0000001
 *
 * @name czm_epsilon7
 * @glslConstant
 */
const float czm_epsilon7 = 0.0000001;
`;var XZt=T(S(),1),EL=`/**
 * DOC_TBA
 *
 * @name czm_infinity
 * @glslConstant
 */
const float czm_infinity = 5906376272000.0;  // Distance from the Sun to Pluto in meters.  TODO: What is best given lowp, mediump, and highp?
`;var WZt=T(S(),1),XL=`/**
 * A built-in GLSL floating-point constant for <code>1/pi</code>.
 *
 * @alias czm_oneOverPi
 * @glslConstant
 *
 * @see CesiumMath.ONE_OVER_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_oneOverPi = ...;
 *
 * // Example
 * float pi = 1.0 / czm_oneOverPi;
 */
const float czm_oneOverPi = 0.3183098861837907;
`;var vZt=T(S(),1),IL=`/**
 * A built-in GLSL floating-point constant for <code>1/2pi</code>.
 *
 * @alias czm_oneOverTwoPi
 * @glslConstant
 *
 * @see CesiumMath.ONE_OVER_TWO_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_oneOverTwoPi = ...;
 *
 * // Example
 * float pi = 2.0 * czm_oneOverTwoPi;
 */
const float czm_oneOverTwoPi = 0.15915494309189535;
`;var FZt=T(S(),1),WL=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
 *
 * @name czm_passCesium3DTile
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTile = 4.0;
`;var MZt=T(S(),1),PL=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
 *
 * @name czm_passCesium3DTileClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileClassification = 5.0;
`;var UZt=T(S(),1),vL=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
 *
 * @name czm_passCesium3DTileClassificationIgnoreShow
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
`;var DZt=T(S(),1),wL=`/**
 * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
 *
 * @name czm_passClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passClassification = 7.0;
`;var YZt=T(S(),1),FL=`/**
 * The automatic GLSL constant for {@link Pass#COMPUTE}
 *
 * @name czm_passCompute
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCompute = 1.0;
`;var KZt=T(S(),1),AL=`/**
 * The automatic GLSL constant for {@link Pass#ENVIRONMENT}
 *
 * @name czm_passEnvironment
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passEnvironment = 0.0;
`;var zZt=T(S(),1),ML=`/**
 * The automatic GLSL constant for {@link Pass#GLOBE}
 *
 * @name czm_passGlobe
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passGlobe = 2.0;
`;var QZt=T(S(),1),NL=`/**
 * The automatic GLSL constant for {@link Pass#OPAQUE}
 *
 * @name czm_passOpaque
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOpaque = 7.0;
`;var qZt=T(S(),1),UL=`/**
 * The automatic GLSL constant for {@link Pass#OVERLAY}
 *
 * @name czm_passOverlay
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOverlay = 10.0;
`;var eGt=T(S(),1),kL=`/**
 * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
 *
 * @name czm_passTerrainClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTerrainClassification = 3.0;
`;var nGt=T(S(),1),DL=`/**
 * The automatic GLSL constant for {@link Pass#TRANSLUCENT}
 *
 * @name czm_passTranslucent
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTranslucent = 8.0;
`;var oGt=T(S(),1),BL=`/**
 * The automatic GLSL constant for {@link Pass#VOXELS}
 *
 * @name czm_passVoxels
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passVoxels = 9.0;
`;var sGt=T(S(),1),YL=`/**
 * A built-in GLSL floating-point constant for <code>Math.PI</code>.
 *
 * @alias czm_pi
 * @glslConstant
 *
 * @see CesiumMath.PI
 *
 * @example
 * // GLSL declaration
 * const float czm_pi = ...;
 *
 * // Example
 * float twoPi = 2.0 * czm_pi;
 */
const float czm_pi = 3.141592653589793;
`;var cGt=T(S(),1),OL=`/**
 * A built-in GLSL floating-point constant for <code>pi/4</code>.
 *
 * @alias czm_piOverFour
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_FOUR
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverFour = ...;
 *
 * // Example
 * float pi = 4.0 * czm_piOverFour;
 */
const float czm_piOverFour = 0.7853981633974483;
`;var dGt=T(S(),1),KL=`/**
 * A built-in GLSL floating-point constant for <code>pi/6</code>.
 *
 * @alias czm_piOverSix
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_SIX
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverSix = ...;
 *
 * // Example
 * float pi = 6.0 * czm_piOverSix;
 */
const float czm_piOverSix = 0.5235987755982988;
`;var mGt=T(S(),1),HL=`/**
 * A built-in GLSL floating-point constant for <code>pi/3</code>.
 *
 * @alias czm_piOverThree
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_THREE
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverThree = ...;
 *
 * // Example
 * float pi = 3.0 * czm_piOverThree;
 */
const float czm_piOverThree = 1.0471975511965976;
`;var fGt=T(S(),1),zL=`/**
 * A built-in GLSL floating-point constant for <code>pi/2</code>.
 *
 * @alias czm_piOverTwo
 * @glslConstant
 *
 * @see CesiumMath.PI_OVER_TWO
 *
 * @example
 * // GLSL declaration
 * const float czm_piOverTwo = ...;
 *
 * // Example
 * float pi = 2.0 * czm_piOverTwo;
 */
const float czm_piOverTwo = 1.5707963267948966;
`;var bGt=T(S(),1),JL=`/**
 * A built-in GLSL floating-point constant for converting degrees to radians.
 *
 * @alias czm_radiansPerDegree
 * @glslConstant
 *
 * @see CesiumMath.RADIANS_PER_DEGREE
 *
 * @example
 * // GLSL declaration
 * const float czm_radiansPerDegree = ...;
 *
 * // Example
 * float rad = czm_radiansPerDegree * deg;
 */
const float czm_radiansPerDegree = 0.017453292519943295;
`;var gGt=T(S(),1),QL=`/**
 * The constant identifier for the 2D {@link SceneMode}
 *
 * @name czm_sceneMode2D
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneModeColumbusView
 * @see czm_sceneMode3D
 * @see czm_sceneModeMorphing
 */
const float czm_sceneMode2D = 2.0;
`;var _Gt=T(S(),1),jL=`/**
 * The constant identifier for the 3D {@link SceneMode}
 *
 * @name czm_sceneMode3D
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneModeColumbusView
 * @see czm_sceneModeMorphing
 */
const float czm_sceneMode3D = 3.0;
`;var SGt=T(S(),1),qL=`/**
 * The constant identifier for the Columbus View {@link SceneMode}
 *
 * @name czm_sceneModeColumbusView
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneMode3D
 * @see czm_sceneModeMorphing
 */
const float czm_sceneModeColumbusView = 1.0;
`;var VGt=T(S(),1),$L=`/**
 * The constant identifier for the Morphing {@link SceneMode}
 *
 * @name czm_sceneModeMorphing
 * @glslConstant
 * @see czm_sceneMode
 * @see czm_sceneMode2D
 * @see czm_sceneModeColumbusView
 * @see czm_sceneMode3D
 */
const float czm_sceneModeMorphing = 0.0;
`;var RGt=T(S(),1),eR=`/**
 * A built-in GLSL floating-point constant for one solar radius.
 *
 * @alias czm_solarRadius
 * @glslConstant
 *
 * @see CesiumMath.SOLAR_RADIUS
 *
 * @example
 * // GLSL declaration
 * const float czm_solarRadius = ...;
 */
const float czm_solarRadius = 695500000.0;
`;var GGt=T(S(),1),tR=`/**
 * A built-in GLSL floating-point constant for <code>3pi/2</code>.
 *
 * @alias czm_threePiOver2
 * @glslConstant
 *
 * @see CesiumMath.THREE_PI_OVER_TWO
 *
 * @example
 * // GLSL declaration
 * const float czm_threePiOver2 = ...;
 *
 * // Example
 * float pi = (2.0 / 3.0) * czm_threePiOver2;
 */
const float czm_threePiOver2 = 4.71238898038469;
`;var XGt=T(S(),1),nR=`/**
 * A built-in GLSL floating-point constant for <code>2pi</code>.
 *
 * @alias czm_twoPi
 * @glslConstant
 *
 * @see CesiumMath.TWO_PI
 *
 * @example
 * // GLSL declaration
 * const float czm_twoPi = ...;
 *
 * // Example
 * float pi = czm_twoPi / 2.0;
 */
const float czm_twoPi = 6.283185307179586;
`;var WGt=T(S(),1),iR=`/**
 * The maximum latitude, in radians, both North and South, supported by a Web Mercator
 * (EPSG:3857) projection.  Technically, the Mercator projection is defined
 * for any latitude up to (but not including) 90 degrees, but it makes sense
 * to cut it off sooner because it grows exponentially with increasing latitude.
 * The logic behind this particular cutoff value, which is the one used by
 * Google Maps, Bing Maps, and Esri, is that it makes the projection
 * square.  That is, the rectangle is equal in the X and Y directions.
 *
 * The constant value is computed as follows:
 *   czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
 *
 * @name czm_webMercatorMaxLatitude
 * @glslConstant
 */
const float czm_webMercatorMaxLatitude = 1.4844222297453324;
`;var vGt=T(S(),1),oR=`/**
 * @name czm_depthRangeStruct
 * @glslStruct
 */
struct czm_depthRangeStruct
{
    float near;
    float far;
};
`;var FGt=T(S(),1),rR=`/**
 * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
 *
 * @name czm_material
 * @glslStruct
 *
 * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
 * @property {float} specular Intensity of incoming light reflecting in a single direction.
 * @property {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.
 * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
 * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
 * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
 */
struct czm_material
{
    vec3 diffuse;
    float specular;
    float shininess;
    vec3 normal;
    vec3 emission;
    float alpha;
};
`;var MGt=T(S(),1),sR=`/**
 * Used as input to every material's czm_getMaterial function.
 *
 * @name czm_materialInput
 * @glslStruct
 *
 * @property {float} s 1D texture coordinates.
 * @property {vec2} st 2D texture coordinates.
 * @property {vec3} str 3D texture coordinates.
 * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
 * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
 * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates.  The magnitude is the distance in meters from the fragment to the eye.
 * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid.  Only available for globe materials.
 * @property {float} slope The slope of the terrain in radians.  0 is flat; pi/2 is vertical.  Only available for globe materials.
 * @property {float} aspect The aspect of the terrain in radians.  0 is East, pi/2 is North, pi is West, 3pi/2 is South.  Only available for globe materials.
 */
struct czm_materialInput
{
    float s;
    vec2 st;
    vec3 str;
    vec3 normalEC;
    mat3 tangentToEyeMatrix;
    vec3 positionToEyeEC;
    float height;
    float slope;
    float aspect;
};
`;var UGt=T(S(),1),aR=`/**
 * Struct for representing a material for a {@link Model}. The model
 * rendering pipeline will pass this struct between material, custom shaders,
 * and lighting stages. This is not to be confused with {@link czm_material}
 * which is used by the older Fabric materials system, although they are similar.
 * <p>
 * All color values (diffuse, specular, emissive) are in linear color space.
 * </p>
 *
 * @name czm_modelMaterial
 * @glslStruct
 *
 * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
 * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
 * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
 * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
 * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
 * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
 * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
 */
struct czm_modelMaterial {
    vec3 diffuse;
    float alpha;
    vec3 specular;
    float roughness;
    vec3 normalEC;
    float occlusion;
    vec3 emissive;
};
`;var DGt=T(S(),1),cR=`/**
 * Struct for representing the output of a custom vertex shader.
 * 
 * @name czm_modelVertexOutput
 * @glslStruct
 *
 * @see {@link CustomShader}
 * @see {@link Model}
 *
 * @property {vec3} positionMC The position of the vertex in model coordinates
 * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. 
 */
struct czm_modelVertexOutput {
  vec3 positionMC;
  float pointSize;
};
`;var YGt=T(S(),1),lR=`/**
 * Parameters for {@link czm_pbrLighting}
 *
 * @name czm_material
 * @glslStruct
 *
 * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation
 * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is.
 * @property {vec3} f0 The reflectance of the material at normal incidence
 */
struct czm_pbrParameters
{
    vec3 diffuseColor;
    float roughness;
    vec3 f0;
};
`;var KGt=T(S(),1),dR=`/**
 * DOC_TBA
 *
 * @name czm_ray
 * @glslStruct
 */
struct czm_ray
{
    vec3 origin;
    vec3 direction;
};
`;var zGt=T(S(),1),uR=`/**
 * DOC_TBA
 *
 * @name czm_raySegment
 * @glslStruct
 */
struct czm_raySegment
{
    float start;
    float stop;
};

/**
 * DOC_TBA
 *
 * @name czm_emptyRaySegment
 * @glslConstant 
 */
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);

/**
 * DOC_TBA
 *
 * @name czm_fullRaySegment
 * @glslConstant 
 */
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
`;var QGt=T(S(),1),mR=`struct czm_shadowParameters
{
#ifdef USE_CUBE_MAP_SHADOW
    vec3 texCoords;
#else
    vec2 texCoords;
#endif

    float depthBias;
    float depth;
    float nDotL;
    vec2 texelStepSize;
    float normalShadingSmooth;
    float darkness;
};
`;var qGt=T(S(),1),hR=`/**
 * Converts an HSB color (hue, saturation, brightness) to RGB
 * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
 *
 * @name czm_HSBToRGB
 * @glslFunction
 * 
 * @param {vec3} hsb The color in HSB.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 hsb = czm_RGBToHSB(rgb);
 * hsb.z *= 0.1;
 * rgb = czm_HSBToRGB(hsb);
 */

const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);

vec3 czm_HSBToRGB(vec3 hsb)
{
    vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
    return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
}
`;var eEt=T(S(),1),fR=`/**
 * Converts an HSL color (hue, saturation, lightness) to RGB
 * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
 *
 * @name czm_HSLToRGB
 * @glslFunction
 * 
 * @param {vec3} rgb The color in HSL.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 hsl = czm_RGBToHSL(rgb);
 * hsl.z *= 0.1;
 * rgb = czm_HSLToRGB(hsl);
 */

vec3 hueToRGB(float hue)
{
    float r = abs(hue * 6.0 - 3.0) - 1.0;
    float g = 2.0 - abs(hue * 6.0 - 2.0);
    float b = 2.0 - abs(hue * 6.0 - 4.0);
    return clamp(vec3(r, g, b), 0.0, 1.0);
}

vec3 czm_HSLToRGB(vec3 hsl)
{
    vec3 rgb = hueToRGB(hsl.x);
    float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
    return (rgb - 0.5) * c + hsl.z;
}
`;var nEt=T(S(),1),pR=`/**
 * Converts an RGB color to HSB (hue, saturation, brightness)
 * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
 *
 * @name czm_RGBToHSB
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in HSB.
 *
 * @example
 * vec3 hsb = czm_RGBToHSB(rgb);
 * hsb.z *= 0.1;
 * rgb = czm_HSBToRGB(hsb);
 */

const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);

vec3 czm_RGBToHSB(vec3 rgb)
{
    vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
    vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));

    float d = q.x - min(q.w, q.y);
    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
}
`;var oEt=T(S(),1),bR=`/**
 * Converts an RGB color to HSL (hue, saturation, lightness)
 * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
 *
 * @name czm_RGBToHSL
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in HSL.
 *
 * @example
 * vec3 hsl = czm_RGBToHSL(rgb);
 * hsl.z *= 0.1;
 * rgb = czm_HSLToRGB(hsl);
 */
 
vec3 RGBtoHCV(vec3 rgb)
{
    // Based on work by Sam Hocevar and Emil Persson
    vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
    vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
    float c = q.x - min(q.w, q.y);
    float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
    return vec3(h, c, q.x);
}

vec3 czm_RGBToHSL(vec3 rgb)
{
    vec3 hcv = RGBtoHCV(rgb);
    float l = hcv.z - hcv.y * 0.5;
    float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
    return vec3(hcv.x, s, l);
}
`;var sEt=T(S(),1),yR=`/**
 * Converts an RGB color to CIE Yxy.
 * <p>The conversion is described in
 * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
 * </p>
 * 
 * @name czm_RGBToXYZ
 * @glslFunction
 * 
 * @param {vec3} rgb The color in RGB.
 *
 * @returns {vec3} The color in CIE Yxy.
 *
 * @example
 * vec3 xyz = czm_RGBToXYZ(rgb);
 * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
 * rgb = czm_XYZToRGB(xyz);
 */
vec3 czm_RGBToXYZ(vec3 rgb)
{
    const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
                              0.3576, 0.7152, 0.1192,
                              0.1805, 0.0722, 0.9505);
    vec3 xyz = RGB2XYZ * rgb;
    vec3 Yxy;
    Yxy.r = xyz.g;
    float temp = dot(vec3(1.0), xyz);
    Yxy.gb = xyz.rg / temp;
    return Yxy;
}
`;var cEt=T(S(),1),gR=`/**
 * Converts a CIE Yxy color to RGB.
 * <p>The conversion is described in
 * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
 * </p>
 * 
 * @name czm_XYZToRGB
 * @glslFunction
 * 
 * @param {vec3} Yxy The color in CIE Yxy.
 *
 * @returns {vec3} The color in RGB.
 *
 * @example
 * vec3 xyz = czm_RGBToXYZ(rgb);
 * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
 * rgb = czm_XYZToRGB(xyz);
 */
vec3 czm_XYZToRGB(vec3 Yxy)
{
    const mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,
                              -1.5371,  1.8760, -0.2040,
                              -0.4985,  0.0416,  1.0572);
    vec3 xyz;
    xyz.r = Yxy.r * Yxy.g / Yxy.b;
    xyz.g = Yxy.r;
    xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
    
    return XYZ2RGB * xyz;
}
`;var dEt=T(S(),1),xR=`// See:
//    https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/

vec3 czm_acesTonemapping(vec3 color) {
    float g = 0.985;
    float a = 0.065;
    float b = 0.0001;
    float c = 0.433;
    float d = 0.238;

    color = (color * (color + a) - b) / (color * (g * color + c) + d);

    color = clamp(color, 0.0, 1.0);

    return color;
}
`;var mEt=T(S(),1),_R=`/**
 * @private
 */
float czm_alphaWeight(float a)
{
    float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];

    // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
    // http://jcgt.org/published/0002/02/09/
    return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
}
`;var fEt=T(S(),1),TR=`/**
 * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
 *
 * @name czm_antialias
 * @glslFunction
 *
 * @param {vec4} color1 The color on one side of the edge.
 * @param {vec4} color2 The color on the other side of the edge.
 * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
 * @param {float} dist The distance to the edge in texture coordinates.
 * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
 * @returns {vec4} The anti-aliased color.
 *
 * @example
 * // GLSL declarations
 * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
 * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
 *
 * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
 * float dist = abs(textureCoordinates.t - 0.5);
 * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
 * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
 */
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
{
    float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
    float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
    val1 = val1 * (1.0 - val2);
    val1 = val1 * val1 * (3.0 - (2.0 * val1));
    val1 = pow(val1, 0.5); //makes the transition nicer
    
    vec4 midColor = (color1 + color2) * 0.5;
    return mix(midColor, currentColor, val1);
}

vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
{
    return czm_antialias(color1, color2, currentColor, dist, 0.1);
}
`;var bEt=T(S(),1),SR=`/**
 * Approximately computes spherical coordinates given a normal.
 * Uses approximate inverse trigonometry for speed and consistency,
 * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
 *
 * @name czm_approximateSphericalCoordinates
 * @glslFunction
 *
 * @param {vec3} normal arbitrary-length normal.
 *
 * @returns {vec2} Approximate latitude and longitude spherical coordinates.
 */
vec2 czm_approximateSphericalCoordinates(vec3 normal) {
    // Project into plane with vertical for latitude
    float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
    float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
    return vec2(latitudeApproximation, longitudeApproximation);
}
`;var gEt=T(S(),1),CR=`/**
 * Determines if the fragment is back facing
 *
 * @name czm_backFacing
 * @glslFunction 
 * 
 * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
 */
bool czm_backFacing()
{
    // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
    return gl_FrontFacing == false;
}
`;var _Et=T(S(),1),VR=`/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a float expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {float} a Value to return if the comparison is true.
 * @param {float} b Value to return if the comparison is false.
 *
 * @returns {float} equivalent of comparison ? a : b
 */
float czm_branchFreeTernary(bool comparison, float a, float b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec2 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec2} a Value to return if the comparison is true.
 * @param {vec2} b Value to return if the comparison is false.
 *
 * @returns {vec2} equivalent of comparison ? a : b
 */
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec3 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec3} a Value to return if the comparison is true.
 * @param {vec3} b Value to return if the comparison is false.
 *
 * @returns {vec3} equivalent of comparison ? a : b
 */
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}

/**
 * Branchless ternary operator to be used when it's inexpensive to explicitly
 * evaluate both possibilities for a vec4 expression.
 *
 * @name czm_branchFreeTernary
 * @glslFunction
 *
 * @param {bool} comparison A comparison statement
 * @param {vec3} a Value to return if the comparison is true.
 * @param {vec3} b Value to return if the comparison is false.
 *
 * @returns {vec3} equivalent of comparison ? a : b
 */
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
    float useA = float(comparison);
    return a * useA + b * (1.0 - useA);
}
`;var SEt=T(S(),1),LR=`
vec4 czm_cascadeColor(vec4 weights)
{
    return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
           vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
           vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
           vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
}
`;var VEt=T(S(),1),RR=`
uniform vec4 shadowMap_cascadeDistances;

float czm_cascadeDistance(vec4 weights)
{
    return dot(shadowMap_cascadeDistances, weights);
}
`;var REt=T(S(),1),ZR=`
uniform mat4 shadowMap_cascadeMatrices[4];

mat4 czm_cascadeMatrix(vec4 weights)
{
    return shadowMap_cascadeMatrices[0] * weights.x +
           shadowMap_cascadeMatrices[1] * weights.y +
           shadowMap_cascadeMatrices[2] * weights.z +
           shadowMap_cascadeMatrices[3] * weights.w;
}
`;var GEt=T(S(),1),GR=`
uniform vec4 shadowMap_cascadeSplits[2];

vec4 czm_cascadeWeights(float depthEye)
{
    // One component is set to 1.0 and all others set to 0.0.
    vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
    vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
    return near * far;
}
`;var XEt=T(S(),1),ER=`/**
 * DOC_TBA
 *
 * @name czm_columbusViewMorph
 * @glslFunction
 */
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
    // Just linear for now.
    vec3 p = mix(position2D.xyz, position3D.xyz, time);
    return vec4(p, 1.0);
}
`;var WEt=T(S(),1),XR=`/**
 * Returns a position in model coordinates relative to eye taking into
 * account the current scene mode: 3D, 2D, or Columbus view.
 * <p>
 * This uses standard position attributes, <code>position3DHigh</code>, 
 * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, 
 * and should be used when writing a vertex shader for an {@link Appearance}.
 * </p>
 *
 * @name czm_computePosition
 * @glslFunction
 *
 * @returns {vec4} The position relative to eye.
 *
 * @example
 * vec4 p = czm_computePosition();
 * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
 * gl_Position = czm_modelViewProjectionRelativeToEye * p;
 *
 * @see czm_translateRelativeToEye
 */
vec4 czm_computePosition();
`;var vEt=T(S(),1),IR=`/**
 * @private
 */
vec2 cordic(float angle)
{
// Scale the vector by the appropriate factor for the 24 iterations to follow.
    vec2 vector = vec2(6.0725293500888267e-1, 0.0);
// Iteration 1
    float sense = (angle < 0.0) ? -1.0 : 1.0;
 //   float factor = sense * 1.0;  // 2^-0
    mat2 rotation = mat2(1.0, sense, -sense, 1.0);
    vector = rotation * vector;
    angle -= sense * 7.8539816339744828e-1;  // atan(2^-0)
// Iteration 2
    sense = (angle < 0.0) ? -1.0 : 1.0;
    float factor = sense * 5.0e-1;  // 2^-1
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.6364760900080609e-1;  // atan(2^-1)
// Iteration 3
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.5e-1;  // 2^-2
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.4497866312686414e-1;  // atan(2^-2)
// Iteration 4
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.25e-1;  // 2^-3
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.2435499454676144e-1;  // atan(2^-3)
// Iteration 5
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 6.25e-2;  // 2^-4
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 6.2418809995957350e-2;  // atan(2^-4)
// Iteration 6
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.125e-2;  // 2^-5
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.1239833430268277e-2;  // atan(2^-5)
// Iteration 7
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.5625e-2;  // 2^-6
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.5623728620476831e-2;  // atan(2^-6)
// Iteration 8
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 7.8125e-3;  // 2^-7
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 7.8123410601011111e-3;  // atan(2^-7)
// Iteration 9
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.90625e-3;  // 2^-8
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.9062301319669718e-3;  // atan(2^-8)
// Iteration 10
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.953125e-3;  // 2^-9
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.9531225164788188e-3;  // atan(2^-9)
// Iteration 11
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 9.765625e-4;  // 2^-10
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 9.7656218955931946e-4;  // atan(2^-10)
// Iteration 12
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 4.8828125e-4;  // 2^-11
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.8828121119489829e-4;  // atan(2^-11)
// Iteration 13
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.44140625e-4;  // 2^-12
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.4414062014936177e-4;  // atan(2^-12)
// Iteration 14
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.220703125e-4;  // 2^-13
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.2207031189367021e-4;  // atan(2^-13)
// Iteration 15
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 6.103515625e-5;  // 2^-14
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 6.1035156174208773e-5;  // atan(2^-14)
// Iteration 16
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.0517578125e-5;  // 2^-15
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.0517578115526096e-5;  // atan(2^-15)
// Iteration 17
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.52587890625e-5;  // 2^-16
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.5258789061315762e-5;  // atan(2^-16)
// Iteration 18
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 7.62939453125e-6;  // 2^-17
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 7.6293945311019700e-6;  // atan(2^-17)
// Iteration 19
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 3.814697265625e-6;  // 2^-18
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 3.8146972656064961e-6;  // atan(2^-18)
// Iteration 20
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.9073486328125e-6;  // 2^-19
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 1.9073486328101870e-6;  // atan(2^-19)
// Iteration 21
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 9.5367431640625e-7;  // 2^-20
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 9.5367431640596084e-7;  // atan(2^-20)
// Iteration 22
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 4.76837158203125e-7;  // 2^-21
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 4.7683715820308884e-7;  // atan(2^-21)
// Iteration 23
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 2.384185791015625e-7;  // 2^-22
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
    angle -= sense * 2.3841857910155797e-7;  // atan(2^-22)
// Iteration 24
    sense = (angle < 0.0) ? -1.0 : 1.0;
    factor = sense * 1.1920928955078125e-7;  // 2^-23
    rotation[0][1] = factor;
    rotation[1][0] = -factor;
    vector = rotation * vector;
//    angle -= sense * 1.1920928955078068e-7;  // atan(2^-23)

    return vector;
}

/**
 * Computes the cosine and sine of the provided angle using the CORDIC algorithm.
 *
 * @name czm_cosineAndSine
 * @glslFunction
 *
 * @param {float} angle The angle in radians.
 *
 * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
 *
 * @example
 * vec2 v = czm_cosineAndSine(czm_piOverSix);
 * float cosine = v.x;
 * float sine = v.y;
 */
vec2 czm_cosineAndSine(float angle)
{
    if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
    {
        if (angle < 0.0)
        {
            return -cordic(angle + czm_pi);
        }
        else
        {
            return -cordic(angle - czm_pi);
        }
    }
    else
    {
        return cordic(angle);
    }
}
`;var FEt=T(S(),1),WR=`/**
 * Decompresses texture coordinates that were packed into a single float.
 *
 * @name czm_decompressTextureCoordinates
 * @glslFunction
 *
 * @param {float} encoded The compressed texture coordinates.
 * @returns {vec2} The decompressed texture coordinates.
 */
 vec2 czm_decompressTextureCoordinates(float encoded)
 {
    float temp = encoded / 4096.0;
    float xZeroTo4095 = floor(temp);
    float stx = xZeroTo4095 / 4095.0;
    float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
    return vec2(stx, sty);
 }
`;var MEt=T(S(),1),PR=`/**
 * Get default parameters for physically based rendering. These defaults
 * describe a rough dielectric (non-metal) surface (e.g. rough plastic).
 *
 * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting}
 */
czm_pbrParameters czm_defaultPbrMaterial()
{
    czm_pbrParameters results;
    results.diffuseColor = vec3(1.0);
    results.roughness = 1.0;

    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
    results.f0 = REFLECTANCE_DIELECTRIC;
    return results;
}
`;var UEt=T(S(),1),vR=`// emulated noperspective
#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
out float v_WindowZ;
#endif

/**
 * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
 * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, 
 * capping the shadow volume. More information here: 
 * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
 *
 * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring 
 * no geometry gets clipped by setting the clip space z value to 0.0 and then
 * sending the unaltered screen space z value (using emulated noperspective
 * interpolation) to the frag shader where it is clamped to [0,1] and then
 * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
 * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
 *
 * When GL_EXT_frag_depth is not available, which is the case on some mobile 
 * devices, we must attempt to fix this only in the vertex shader. 
 * The approach is to clamp the z value to the far plane, which closes the 
 * shadow volume but also distorts the geometry, so there can still be artifacts
 * on frustum seams.
 *
 * @name czm_depthClamp
 * @glslFunction
 *
 * @param {vec4} coords The vertex in clip coordinates.
 * @returns {vec4} The modified vertex.
 *
 * @example
 * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
 *
 * @see czm_writeDepthClamp
 */
vec4 czm_depthClamp(vec4 coords)
{
#ifndef LOG_DEPTH
#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
    v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
    coords.z = 0.0;
#else
    coords.z = min(coords.z, coords.w);
#endif
#endif
    return coords;
}
`;var DEt=T(S(),1),wR=`/**
 * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system 
 * to eye coordinates.  In east-north-up coordinates, x points east, y points north, and z points along the 
 * surface normal.  East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
 * <br /><br />
 * The ellipsoid is assumed to be centered at the model coordinate's origin.
 *
 * @name czm_eastNorthUpToEyeCoordinates
 * @glslFunction
 *
 * @param {vec3} positionMC The position on the ellipsoid in model coordinates.
 * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
 *
 * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
 *
 * @example
 * // Transform a vector defined in the east-north-up coordinate 
 * // system, (0, 0, 1) which is the surface normal, to eye 
 * // coordinates.
 * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
 * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
 */
mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
{
    vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));  // normalized surface tangent in model coordinates
    vec3 tangentEC = normalize(czm_normal3D * tangentMC);                // normalized surface tangent in eye coordinates
    vec3 bitangentEC = normalize(cross(normalEC, tangentEC));            // normalized surface bitangent in eye coordinates

    return mat3(
        tangentEC.x,   tangentEC.y,   tangentEC.z,
        bitangentEC.x, bitangentEC.y, bitangentEC.z,
        normalEC.x,    normalEC.y,    normalEC.z);
}
`;var YEt=T(S(),1),FR=`/**
 * DOC_TBA
 *
 * @name czm_ellipsoidContainsPoint
 * @glslFunction
 *
 */
bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
{
    vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
    return (dot(scaled, scaled) <= 1.0);
}
`;var KEt=T(S(),1),AR=`/**
 * DOC_TBA
 *
 * @name czm_ellipsoidWgs84TextureCoordinates
 * @glslFunction
 */
vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)
{
    return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var zEt=T(S(),1),MR=`/**
 * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
 * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
 * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
 * <code>vec3</code>s, or <code>vec4</code>s.
 *
 * @name czm_equalsEpsilon
 * @glslFunction
 *
 * @param {} left The first vector.
 * @param {} right The second vector.
 * @param {float} epsilon The epsilon to use for equality testing.
 * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
 *
 * @example
 * // GLSL declarations
 * bool czm_equalsEpsilon(float left, float right, float epsilon);
 * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
 * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
 * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
 */
bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec4(epsilon)));
}

bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec3(epsilon)));
}

bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
    return all(lessThanEqual(abs(left - right), vec2(epsilon)));
}

bool czm_equalsEpsilon(float left, float right, float epsilon) {
    return (abs(left - right) <= epsilon);
}
`;var QEt=T(S(),1),NR=`/**
 * DOC_TBA
 *
 * @name czm_eyeOffset
 * @glslFunction
 *
 * @param {vec4} positionEC DOC_TBA.
 * @param {vec3} eyeOffset DOC_TBA.
 *
 * @returns {vec4} DOC_TBA.
 */
vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
{
    // This equation is approximate in x and y.
    vec4 p = positionEC;
    vec4 zEyeOffset = normalize(p) * eyeOffset.z;
    p.xy += eyeOffset.xy + zEyeOffset.xy;
    p.z += zEyeOffset.z;
    return p;
}
`;var qEt=T(S(),1),UR=`/**
 * Transforms a position from eye to window coordinates.  The transformation
 * from eye to clip coordinates is done using {@link czm_projection}.
 * The transform from normalized device coordinates to window coordinates is
 * done using {@link czm_viewportTransformation}, which assumes a depth range
 * of <code>near = 0</code> and <code>far = 1</code>.
 * <br /><br />
 * This transform is useful when there is a need to manipulate window coordinates
 * in a vertex shader as done by {@link BillboardCollection}.
 *
 * @name czm_eyeToWindowCoordinates
 * @glslFunction
 *
 * @param {vec4} position The position in eye coordinates to transform.
 *
 * @returns {vec4} The transformed position in window coordinates.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_projection
 * @see czm_viewportTransformation
 * @see BillboardCollection
 *
 * @example
 * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
 */
vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
{
    vec4 q = czm_projection * positionEC;                        // clip coordinates
    q.xyz /= q.w;                                                // normalized device coordinates
    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
    return q;
}
`;var eXt=T(S(),1),kR=`/**
 * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
 *
 * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
 * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
 * Adapted from ShaderFastLibs under MIT License.
 *
 * Chosen for the following characteristics over range [0, 1]:
 * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
 * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
 *
 * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
 * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
 *
 * @name czm_fastApproximateAtan
 * @glslFunction
 *
 * @param {float} x Value between 0 and 1 inclusive.
 *
 * @returns {float} Approximation of atan(x)
 */
float czm_fastApproximateAtan(float x) {
    return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
}

/**
 * Approximation of atan2.
 *
 * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
 * However, we replaced their atan curve with Michael Drobot's (see above).
 *
 * @name czm_fastApproximateAtan
 * @glslFunction
 *
 * @param {float} x Value between -1 and 1 inclusive.
 * @param {float} y Value between -1 and 1 inclusive.
 *
 * @returns {float} Approximation of atan2(x, y)
 */
float czm_fastApproximateAtan(float x, float y) {
    // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
    // So range-reduce using abs and by flipping whether x or y is on top.
    float t = abs(x); // t used as swap and atan result.
    float opposite = abs(y);
    float adjacent = max(t, opposite);
    opposite = min(t, opposite);

    t = czm_fastApproximateAtan(opposite / adjacent);

    // Undo range reduction
    t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
    t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
    t = czm_branchFreeTernary(y < 0.0, -t, t);
    return t;
}
`;var nXt=T(S(),1),DR=`/**
 * Gets the color with fog at a distance from the camera.
 *
 * @name czm_fog
 * @glslFunction
 *
 * @param {float} distanceToCamera The distance to the camera in meters.
 * @param {vec3} color The original color.
 * @param {vec3} fogColor The color of the fog.
 *
 * @returns {vec3} The color adjusted for fog at the distance from the camera.
 */
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
{
    float scalar = distanceToCamera * czm_fogDensity;
    float fog = 1.0 - exp(-(scalar * scalar));
    return mix(color, fogColor, fog);
}

/**
 * Gets the color with fog at a distance from the camera.
 *
 * @name czm_fog
 * @glslFunction
 *
 * @param {float} distanceToCamera The distance to the camera in meters.
 * @param {vec3} color The original color.
 * @param {vec3} fogColor The color of the fog.
 * @param {float} fogModifierConstant A constant to modify the appearance of fog.
 *
 * @returns {vec3} The color adjusted for fog at the distance from the camera.
 */
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
{
    float scalar = distanceToCamera * czm_fogDensity;
    float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
    return mix(color, fogColor, fog);
}
`;var oXt=T(S(),1),BR=`/**
 * Converts a color from RGB space to linear space.
 *
 * @name czm_gammaCorrect
 * @glslFunction
 *
 * @param {vec3} color The color in RGB space.
 * @returns {vec3} The color in linear space.
 */
vec3 czm_gammaCorrect(vec3 color) {
#ifdef HDR
    color = pow(color, vec3(czm_gamma));
#endif
    return color;
}

vec4 czm_gammaCorrect(vec4 color) {
#ifdef HDR
    color.rgb = pow(color.rgb, vec3(czm_gamma));
#endif
    return color;
}
`;var sXt=T(S(),1),YR=`/**
 * DOC_TBA
 *
 * @name czm_geodeticSurfaceNormal
 * @glslFunction
 *
 * @param {vec3} positionOnEllipsoid DOC_TBA
 * @param {vec3} ellipsoidCenter DOC_TBA
 * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
 * 
 * @returns {vec3} DOC_TBA.
 */
vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
{
    return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
}
`;var cXt=T(S(),1),OR=`/**
 * An czm_material with default values. Every material's czm_getMaterial
 * should use this default material as a base for the material it returns.
 * The default normal value is given by materialInput.normalEC.
 *
 * @name czm_getDefaultMaterial
 * @glslFunction
 *
 * @param {czm_materialInput} input The input used to construct the default material.
 *
 * @returns {czm_material} The default material.
 *
 * @see czm_materialInput
 * @see czm_material
 * @see czm_getMaterial
 */
czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
{
    czm_material material;
    material.diffuse = vec3(0.0);
    material.specular = 0.0;
    material.shininess = 1.0;
    material.normal = materialInput.normalEC;
    material.emission = vec3(0.0);
    material.alpha = 1.0;
    return material;
}
`;var dXt=T(S(),1),KR=`/**
 * Calculates the intensity of diffusely reflected light.
 *
 * @name czm_getLambertDiffuse
 * @glslFunction
 *
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 *
 * @returns {float} The intensity of the diffuse reflection.
 *
 * @see czm_phong
 *
 * @example
 * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
 * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
 * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
 */
float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
{
    return max(dot(lightDirectionEC, normalEC), 0.0);
}
`;var mXt=T(S(),1),HR=`/**
 * Calculates the specular intensity of reflected light.
 *
 * @name czm_getSpecular
 * @glslFunction
 *
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.
 *
 * @returns {float} The intensity of the specular highlight.
 *
 * @see czm_phong
 *
 * @example
 * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
 * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
 * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
 */
float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
{
    vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
    float specular = max(dot(toReflectedLight, toEyeEC), 0.0);

    // pow has undefined behavior if both parameters <= 0.
    // Prevent this by making sure shininess is at least czm_epsilon2.
    return pow(specular, max(shininess, czm_epsilon2));
}
`;var fXt=T(S(),1),zR=`/**
 * @private
 */
vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
{
    float cosAngle = cos(angleInRadians);
    float sinAngle = sin(angleInRadians);

    // time dependent sampling directions
    vec2 s0 = vec2(1.0/17.0, 0.0);
    vec2 s1 = vec2(-1.0/29.0, 0.0);
    vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
    vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);

    // rotate sampling direction by specified angle
    s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
    s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
    s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
    s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));

    vec2 uv0 = (uv/103.0) + (time * s0);
    vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
    vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
    vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);

    uv0 = fract(uv0);
    uv1 = fract(uv1);
    uv2 = fract(uv2);
    uv3 = fract(uv3);
    vec4 noise = (texture(normalMap, uv0)) +
                 (texture(normalMap, uv1)) +
                 (texture(normalMap, uv2)) +
                 (texture(normalMap, uv3));

    // average and scale to between -1 and 1
    return ((noise / 4.0) - 0.5) * 2.0;
}
`;var bXt=T(S(),1),JR=`/**
 * Adjusts the hue of a color.
 * 
 * @name czm_hue
 * @glslFunction
 * 
 * @param {vec3} rgb The color.
 * @param {float} adjustment The amount to adjust the hue of the color in radians.
 *
 * @returns {float} The color with the hue adjusted.
 *
 * @example
 * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
 */
vec3 czm_hue(vec3 rgb, float adjustment)
{
    const mat3 toYIQ = mat3(0.299,     0.587,     0.114,
                            0.595716, -0.274453, -0.321263,
                            0.211456, -0.522591,  0.311135);
    const mat3 toRGB = mat3(1.0,  0.9563,  0.6210,
                            1.0, -0.2721, -0.6474,
                            1.0, -1.107,   1.7046);
    
    vec3 yiq = toYIQ * rgb;
    float hue = atan(yiq.z, yiq.y) + adjustment;
    float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
    
    vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
    return toRGB * color;
}
`;var gXt=T(S(),1),QR=`/**
 * Converts a color in linear space to RGB space.
 *
 * @name czm_inverseGamma
 * @glslFunction
 *
 * @param {vec3} color The color in linear space.
 * @returns {vec3} The color in RGB space.
 */
vec3 czm_inverseGamma(vec3 color) {
    return pow(color, vec3(1.0 / czm_gamma));
}
`;var _Xt=T(S(),1),jR=`/**
 * Determines if a time interval is empty.
 *
 * @name czm_isEmpty
 * @glslFunction 
 * 
 * @param {czm_raySegment} interval The interval to test.
 * 
 * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
 *
 * @example
 * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true
 * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
 * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
 */
bool czm_isEmpty(czm_raySegment interval)
{
    return (interval.stop < 0.0);
}
`;var SXt=T(S(),1),qR=`/**
 * Determines if a time interval is empty.
 *
 * @name czm_isFull
 * @glslFunction 
 * 
 * @param {czm_raySegment} interval The interval to test.
 * 
 * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
 *
 * @example
 * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true
 * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
 * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
 */
bool czm_isFull(czm_raySegment interval)
{
    return (interval.start == 0.0 && interval.stop == czm_infinity);
}
`;var VXt=T(S(),1),$R=`/**
 * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
 *
 * @name czm_latitudeToWebMercatorFraction
 * @glslFunction
 *
 * @param {float} latitude The geodetic latitude, in radians.
 * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
 * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
 *
 * @returns {float} The fraction of the rectangle at which the latitude occurs.  If the latitude is the southern
 *          boundary of the rectangle, the return value will be zero.  If it is the northern boundary, the return
 *          value will be 1.0.  Latitudes in between are mapped according to the Web Mercator projection.
 */ 
float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
{
    float sinLatitude = sin(latitude);
    float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
    
    return (mercatorY - southMercatorY) * oneOverMercatorHeight;
}
`;var RXt=T(S(),1),eZ=`/**
 * Computes distance from an point in 2D to a line in 2D.
 *
 * @name czm_lineDistance
 * @glslFunction
 *
 * param {vec2} point1 A point along the line.
 * param {vec2} point2 A point along the line.
 * param {vec2} point A point that may or may not be on the line.
 * returns {float} The distance from the point to the line.
 */
float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
    return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
}
`;var GXt=T(S(),1),tZ=`/**
 * Converts a linear RGB color to an sRGB color.
 *
 * @param {vec3|vec4} linearIn The color in linear color space.
 * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
 */
vec3 czm_linearToSrgb(vec3 linearIn) 
{
    return pow(linearIn, vec3(1.0/2.2));
}

vec4 czm_linearToSrgb(vec4 linearIn) 
{
    vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
    return vec4(srgbOut, linearIn.a);
}
`;var XXt=T(S(),1),nZ=`/**
 * Computes the luminance of a color. 
 *
 * @name czm_luminance
 * @glslFunction
 *
 * @param {vec3} rgb The color.
 * 
 * @returns {float} The luminance.
 *
 * @example
 * float light = czm_luminance(vec3(0.0)); // 0.0
 * float dark = czm_luminance(vec3(1.0));  // ~1.0 
 */
float czm_luminance(vec3 rgb)
{
    // Algorithm from Chapter 10 of Graphics Shaders.
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    return dot(rgb, W);
}
`;var WXt=T(S(),1),iZ=`/**
 * Computes the size of a pixel in meters at a distance from the eye.
 * <p>
 * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
 * </p>
 * @name czm_metersPerPixel
 * @glslFunction
 *
 * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
 * @param {float} pixelRatio The scaling factor from pixel space to coordinate space
 *
 * @returns {float} The meters per pixel at positionEC.
 */
float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
{
    float width = czm_viewport.z;
    float height = czm_viewport.w;
    float pixelWidth;
    float pixelHeight;

    float top = czm_frustumPlanes.x;
    float bottom = czm_frustumPlanes.y;
    float left = czm_frustumPlanes.z;
    float right = czm_frustumPlanes.w;

    if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
    {
        float frustumWidth = right - left;
        float frustumHeight = top - bottom;
        pixelWidth = frustumWidth / width;
        pixelHeight = frustumHeight / height;
    }
    else
    {
        float distanceToPixel = -positionEC.z;
        float inverseNear = 1.0 / czm_currentFrustum.x;
        float tanTheta = top * inverseNear;
        pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
        tanTheta = right * inverseNear;
        pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
    }

    return max(pixelWidth, pixelHeight) * pixelRatio;
}

/**
 * Computes the size of a pixel in meters at a distance from the eye.
 * <p>
 * Use this version when scaling by pixel ratio.
 * </p>
 * @name czm_metersPerPixel
 * @glslFunction
 *
 * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
 *
 * @returns {float} The meters per pixel at positionEC.
 */
float czm_metersPerPixel(vec4 positionEC)
{
    return czm_metersPerPixel(positionEC, czm_pixelRatio);
}
`;var vXt=T(S(),1),oZ=`/**
 * Transforms a position from model to window coordinates.  The transformation
 * from model to clip coordinates is done using {@link czm_modelViewProjection}.
 * The transform from normalized device coordinates to window coordinates is
 * done using {@link czm_viewportTransformation}, which assumes a depth range
 * of <code>near = 0</code> and <code>far = 1</code>.
 * <br /><br />
 * This transform is useful when there is a need to manipulate window coordinates
 * in a vertex shader as done by {@link BillboardCollection}.
 * <br /><br />
 * This function should not be confused with {@link czm_viewportOrthographic},
 * which is an orthographic projection matrix that transforms from window 
 * coordinates to clip coordinates.
 *
 * @name czm_modelToWindowCoordinates
 * @glslFunction
 *
 * @param {vec4} position The position in model coordinates to transform.
 *
 * @returns {vec4} The transformed position in window coordinates.
 *
 * @see czm_eyeToWindowCoordinates
 * @see czm_modelViewProjection
 * @see czm_viewportTransformation
 * @see czm_viewportOrthographic
 * @see BillboardCollection
 *
 * @example
 * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
 */
vec4 czm_modelToWindowCoordinates(vec4 position)
{
    vec4 q = czm_modelViewProjection * position;                // clip coordinates
    q.xyz /= q.w;                                                // normalized device coordinates
    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
    return q;
}
`;var FXt=T(S(),1),rZ=`/**
 * DOC_TBA
 *
 * @name czm_multiplyWithColorBalance
 * @glslFunction
 */
vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
{
    // Algorithm from Chapter 10 of Graphics Shaders.
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    
    vec3 target = left * right;
    float leftLuminance = dot(left, W);
    float rightLuminance = dot(right, W);
    float targetLuminance = dot(target, W);
    
    return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
}
`;var MXt=T(S(),1),sZ=`/**
 * Computes a value that scales with distance.  The scaling is clamped at the near and
 * far distances, and does not extrapolate.  This function works with the
 * {@link NearFarScalar} JavaScript class.
 *
 * @name czm_nearFarScalar
 * @glslFunction
 *
 * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
 * @param {float} cameraDistSq The square of the current distance from the camera.
 *
 * @returns {float} The value at this distance.
 */
float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
{
    float valueAtMin = nearFarScalar.y;
    float valueAtMax = nearFarScalar.w;
    float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
    float farDistanceSq = nearFarScalar.z * nearFarScalar.z;

    float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);

    t = pow(clamp(t, 0.0, 1.0), 0.2);

    return mix(valueAtMin, valueAtMax, t);
}
`;var UXt=T(S(),1),aZ=` /**
  * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  *
  * @name czm_octDecode
  * @param {vec2} encoded The oct-encoded, unit-length vector
  * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
  * @returns {vec3} The decoded and normalized vector
  */
  vec3 czm_octDecode(vec2 encoded, float range)
  {
      if (encoded.x == 0.0 && encoded.y == 0.0) {
          return vec3(0.0, 0.0, 0.0);
      }

     encoded = encoded / range * 2.0 - 1.0;
     vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
     if (v.z < 0.0)
     {
         v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
     }

     return normalize(v);
  }

/**
 * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {vec2} encoded The oct-encoded, unit-length vector
 * @returns {vec3} The decoded and normalized vector
 */
 vec3 czm_octDecode(vec2 encoded)
 {
    return czm_octDecode(encoded, 255.0);
 }

 /**
 * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {float} encoded The oct-encoded, unit-length vector
 * @returns {vec3} The decoded and normalized vector
 */
 vec3 czm_octDecode(float encoded)
 {
    float temp = encoded / 256.0;
    float x = floor(temp);
    float y = (temp - x) * 256.0;
    return czm_octDecode(vec2(x, y));
 }

/**
 * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
 * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
 * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
 *
 * @name czm_octDecode
 * @param {vec2} encoded The packed oct-encoded, unit-length vectors.
 * @param {vec3} vector1 One decoded and normalized vector.
 * @param {vec3} vector2 One decoded and normalized vector.
 * @param {vec3} vector3 One decoded and normalized vector.
 */
  void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
 {
    float temp = encoded.x / 65536.0;
    float x = floor(temp);
    float encodedFloat1 = (temp - x) * 65536.0;

    temp = encoded.y / 65536.0;
    float y = floor(temp);
    float encodedFloat2 = (temp - y) * 65536.0;

    vector1 = czm_octDecode(encodedFloat1);
    vector2 = czm_octDecode(encodedFloat2);
    vector3 = czm_octDecode(vec2(x, y));
 }

`;var DXt=T(S(),1),cZ=`/**
 * Packs a depth value into a vec3 that can be represented by unsigned bytes.
 *
 * @name czm_packDepth
 * @glslFunction
 *
 * @param {float} depth The floating-point depth.
 * @returns {vec3} The packed depth.
 */
vec4 czm_packDepth(float depth)
{
    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
    vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
    enc = fract(enc);
    enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
    return enc;
}
`;var YXt=T(S(),1),lZ=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
    return diffuseColor / czm_pi;
}

vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
    return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);
}

float smithVisibilityG1(float NdotV, float roughness)
{
    // this is the k value for direct lighting.
    // for image based lighting it will be roughness^2 / 2
    float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;
    return NdotV / (NdotV * (1.0 - k) + k);
}

float smithVisibilityGGX(float roughness, float NdotL, float NdotV)
{
    return (
        smithVisibilityG1(NdotL, roughness) *
        smithVisibilityG1(NdotV, roughness)
    );
}

float GGX(float roughness, float NdotH)
{
    float roughnessSquared = roughness * roughness;
    float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;
    return roughnessSquared / (czm_pi * f * f);
}

/**
 * Compute the diffuse and specular contributions using physically based
 * rendering. This function only handles direct lighting.
 * <p>
 * This function only handles the lighting calculations. Metallic/roughness
 * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial}
 * </p>
 *
 * @name czm_pbrlighting
 * @glslFunction
 *
 * @param {vec3} positionEC The position of the fragment in eye coordinates
 * @param {vec3} normalEC The surface normal in eye coordinates
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value.
 * @param {czm_pbrParameters} The computed PBR parameters.
 * @return {vec3} The computed HDR color
 *
 * @example
 * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial(
 *  baseColor,
 *  metallic,
 *  roughness
 * );
 * vec3 color = czm_pbrlighting(
 *  positionEC,
 *  normalEC,
 *  lightDirectionEC,
 *  lightColorHdr,
 *  pbrParameters);
 */
vec3 czm_pbrLighting(
    vec3 positionEC,
    vec3 normalEC,
    vec3 lightDirectionEC,
    vec3 lightColorHdr,
    czm_pbrParameters pbrParameters
)
{
    vec3 v = -normalize(positionEC);
    vec3 l = normalize(lightDirectionEC);
    vec3 h = normalize(v + l);
    vec3 n = normalEC;
    float NdotL = clamp(dot(n, l), 0.001, 1.0);
    float NdotV = abs(dot(n, v)) + 0.001;
    float NdotH = clamp(dot(n, h), 0.0, 1.0);
    float LdotH = clamp(dot(l, h), 0.0, 1.0);
    float VdotH = clamp(dot(v, h), 0.0, 1.0);

    vec3 f0 = pbrParameters.f0;
    float reflectance = max(max(f0.r, f0.g), f0.b);
    vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
    vec3 F = fresnelSchlick2(f0, f90, VdotH);

    float alpha = pbrParameters.roughness;
    float G = smithVisibilityGGX(alpha, NdotL, NdotV);
    float D = GGX(alpha, NdotH);
    vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);

    vec3 diffuseColor = pbrParameters.diffuseColor;
    // F here represents the specular contribution
    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);

    // Lo = (diffuse + specular) * Li * NdotL
    return (diffuseContribution + specularContribution) * NdotL * lightColorHdr;
}
`;var KXt=T(S(),1),dZ=`/**
 * Compute parameters for physically based rendering using the
 * metallic/roughness workflow. All inputs are linear; sRGB texture values must
 * be decoded beforehand
 *
 * @name czm_pbrMetallicRoughnessMaterial
 * @glslFunction
 *
 * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence)
 * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt);
 * @param {float} roughness A value between 0.0 and 1.0
 * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}
 */
czm_pbrParameters czm_pbrMetallicRoughnessMaterial(
    vec3 baseColor,
    float metallic,
    float roughness
) 
{
    czm_pbrParameters results;

    // roughness is authored as perceptual roughness
    // square it to get material roughness
    roughness = clamp(roughness, 0.0, 1.0);
    results.roughness = roughness * roughness;

    // dielectrics use f0 = 0.04, metals use albedo as f0
    metallic = clamp(metallic, 0.0, 1.0);
    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
    vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);
    results.f0 = f0;

    // diffuse only applies to dielectrics.
    results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);

    return results;
}
`;var zXt=T(S(),1),uZ=`/**
 * Compute parameters for physically based rendering using the
 * specular/glossy workflow. All inputs are linear; sRGB texture values must
 * be decoded beforehand
 *
 * @name czm_pbrSpecularGlossinessMaterial
 * @glslFunction
 *
 * @param {vec3} diffuse The diffuse color for dielectrics (non-metals)
 * @param {vec3} specular The reflectance at normal incidence (f0)
 * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is.
 * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}
 */
czm_pbrParameters czm_pbrSpecularGlossinessMaterial(
    vec3 diffuse,
    vec3 specular,
    float glossiness
) 
{
    czm_pbrParameters results;

    // glossiness is the opposite of roughness, but easier for artists to use.
    float roughness = 1.0 - glossiness;
    results.roughness = roughness * roughness;

    results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));
    results.f0 = specular;

    return results;
}
`;var QXt=T(S(),1),mZ=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
{
    return czm_getLambertDiffuse(lightDirectionEC, material.normal);
}

float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
{
    return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
}

/**
 * Computes a color using the Phong lighting model.
 *
 * @name czm_phong
 * @glslFunction
 *
 * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
 * @param {czm_material} material The fragment's material.
 *
 * @returns {vec4} The computed color.
 *
 * @example
 * vec3 positionToEyeEC = // ...
 * czm_material material = // ...
 * vec3 lightDirectionEC = // ...
 * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
 *
 * @see czm_getMaterial
 */
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    // Diffuse from directional light sources at eye (for top-down)
    float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
    if (czm_sceneMode == czm_sceneMode3D) {
        // (and horizon views in 3D)
        diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
    }

    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);

    // Temporary workaround for adding ambient.
    vec3 materialDiffuse = material.diffuse * 0.5;

    vec3 ambient = materialDiffuse;
    vec3 color = ambient + material.emission;
    color += materialDiffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}

vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);

    vec3 ambient = vec3(0.0);
    vec3 color = ambient + material.emission;
    color += material.diffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}
`;var qXt=T(S(),1),hZ=`/**
 * Computes distance from a point to a plane.
 *
 * @name czm_planeDistance
 * @glslFunction
 *
 * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
 * param {vec3} point A point in the same space as the plane.
 * returns {float} The distance from the point to the plane.
 */
float czm_planeDistance(vec4 plane, vec3 point) {
    return (dot(plane.xyz, point) + plane.w);
}

/**
 * Computes distance from a point to a plane.
 *
 * @name czm_planeDistance
 * @glslFunction
 *
 * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
 * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
 * param {vec3} point A point in the same space as the plane.
 * returns {float} The distance from the point to the plane.
 */
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
    return (dot(planeNormal, point) + planeDistance);
}
`;var eIt=T(S(),1),fZ=`/**
 * Computes the point along a ray at the given time.  <code>time</code> can be positive, negative, or zero.
 *
 * @name czm_pointAlongRay
 * @glslFunction
 *
 * @param {czm_ray} ray The ray to compute the point along.
 * @param {float} time The time along the ray.
 * 
 * @returns {vec3} The point along the ray at the given time.
 * 
 * @example
 * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
 * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
 */
vec3 czm_pointAlongRay(czm_ray ray, float time)
{
    return ray.origin + (time * ray.direction);
}
`;var nIt=T(S(),1),pZ=`/**
 * DOC_TBA
 *
 * @name czm_rayEllipsoidIntersectionInterval
 * @glslFunction
 */
czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
{
   // ray and ellipsoid center in eye coordinates.  radii in model coordinates.
    vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
    vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;

    q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;

    float q2 = dot(q, q);
    float qw = dot(q, w);

    if (q2 > 1.0) // Outside ellipsoid.
    {
        if (qw >= 0.0) // Looking outward or tangent (0 intersections).
        {
            return czm_emptyRaySegment;
        }
        else // qw < 0.0.
        {
            float qw2 = qw * qw;
            float difference = q2 - 1.0; // Positively valued.
            float w2 = dot(w, w);
            float product = w2 * difference;

            if (qw2 < product) // Imaginary roots (0 intersections).
            {
                return czm_emptyRaySegment;
            }
            else if (qw2 > product) // Distinct roots (2 intersections).
            {
                float discriminant = qw * qw - product;
                float temp = -qw + sqrt(discriminant); // Avoid cancellation.
                float root0 = temp / w2;
                float root1 = difference / temp;
                if (root0 < root1)
                {
                    czm_raySegment i = czm_raySegment(root0, root1);
                    return i;
                }
                else
                {
                    czm_raySegment i = czm_raySegment(root1, root0);
                    return i;
                }
            }
            else // qw2 == product.  Repeated roots (2 intersections).
            {
                float root = sqrt(difference / w2);
                czm_raySegment i = czm_raySegment(root, root);
                return i;
            }
        }
    }
    else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
    {
        float difference = q2 - 1.0; // Negatively valued.
        float w2 = dot(w, w);
        float product = w2 * difference; // Negatively valued.
        float discriminant = qw * qw - product;
        float temp = -qw + sqrt(discriminant); // Positively valued.
        czm_raySegment i = czm_raySegment(0.0, temp / w2);
        return i;
    }
    else // q2 == 1.0. On ellipsoid.
    {
        if (qw < 0.0) // Looking inward.
        {
            float w2 = dot(w, w);
            czm_raySegment i = czm_raySegment(0.0, -qw / w2);
            return i;
        }
        else // qw >= 0.0.  Looking outward or tangent.
        {
            return czm_emptyRaySegment;
        }
    }
}
`;var oIt=T(S(),1),bZ=`/**
 * Compute the intersection interval of a ray with a sphere.
 *
 * @name czm_raySphereIntersectionInterval
 * @glslFunction
 *
 * @param {czm_ray} ray The ray.
 * @param {vec3} center The center of the sphere.
 * @param {float} radius The radius of the sphere.
 * @return {czm_raySegment} The intersection interval of the ray with the sphere.
 */
czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
{
    vec3 o = ray.origin;
    vec3 d = ray.direction;

    vec3 oc = o - center;

    float a = dot(d, d);
    float b = 2.0 * dot(d, oc);
    float c = dot(oc, oc) - (radius * radius);

    float det = (b * b) - (4.0 * a * c);

    if (det < 0.0) {
        return czm_emptyRaySegment;
    }

    float sqrtDet = sqrt(det);

    float t0 = (-b - sqrtDet) / (2.0 * a);
    float t1 = (-b + sqrtDet) / (2.0 * a);

    czm_raySegment result = czm_raySegment(t0, t1);
    return result;
}
`;var sIt=T(S(),1),yZ=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
    return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var cIt=T(S(),1),gZ=`/**
 * Reads a value previously transformed with {@link czm_writeNonPerspective}
 * by dividing it by \`w\`, the value used in the perspective divide.
 * This function is intended to be called in a fragment shader to access a
 * \`varying\` that should not be subject to perspective interpolation.
 * For example, screen-space texture coordinates. The value should have been
 * previously written in the vertex shader with a call to
 * {@link czm_writeNonPerspective}.
 *
 * @name czm_readNonPerspective
 * @glslFunction
 *
 * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
 * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
 * @returns {float|vec2|vec3|vec4} The usable value.
 */
float czm_readNonPerspective(float value, float oneOverW) {
    return value * oneOverW;
}

vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
    return value * oneOverW;
}

vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
    return value * oneOverW;
}

vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
    return value * oneOverW;
}
`;var dIt=T(S(),1),xZ=`float czm_reverseLogDepth(float logZ)
{
#ifdef LOG_DEPTH
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = pow(2.0, log2Depth) - 1.0;
    return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
    return logZ;
}
`;var mIt=T(S(),1),_Z=`/**
 * Round a floating point value. This function exists because round() doesn't
 * exist in GLSL 1.00. 
 *
 * @param {float|vec2|vec3|vec4} value The value to round
 * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
 */
float czm_round(float value) {
  return floor(value + 0.5);
}

vec2 czm_round(vec2 value) {
  return floor(value + 0.5);
}

vec3 czm_round(vec3 value) {
  return floor(value + 0.5);
}

vec4 czm_round(vec4 value) {
  return floor(value + 0.5);
}
`;var fIt=T(S(),1),TZ=`/**
 * Samples the 4 neighboring pixels and return the weighted average.
 *
 * @private
 */
vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)
{
    direction /= dot(vec3(1.0), abs(direction));
    vec2 rev = abs(direction.zx) - vec2(1.0);
    vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,
                    direction.z < 0.0 ? rev.y : -rev.y);
    vec2 uv = direction.y < 0.0 ? neg : direction.xz;
    vec2 coord = 0.5 * uv + vec2(0.5);
    vec2 pixel = 1.0 / textureSize;

    if (lod > 0.0)
    {
        // Each subseqeuent mip level is half the size
        float scale = 1.0 / pow(2.0, lod);
        float offset = ((textureSize.y + 1.0) / textureSize.x);

        coord.x *= offset;
        coord *= scale;

        coord.x += offset + pixel.x;
        coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;
    }
    else
    {
        coord.x *= (textureSize.y / textureSize.x);
    }

    // Do bilinear filtering
    #ifndef OES_texture_float_linear
        vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb;
        vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;
        vec3 color3 = texture(projectedMap, coord + pixel).rgb;
        vec3 color4 = texture(projectedMap, coord).rgb;

        vec2 texturePosition = coord * textureSize;

        float fu = fract(texturePosition.x);
        float fv = fract(texturePosition.y);

        vec3 average1 = mix(color4, color2, fu);
        vec3 average2 = mix(color1, color3, fu);

        vec3 color = mix(average1, average2, fv);
    #else
        vec3 color = texture(projectedMap, coord).rgb;
    #endif

    return color;
}


/**
 * Samples from a cube map that has been projected using an octahedral projection from the given direction.
 *
 * @name czm_sampleOctahedralProjection
 * @glslFunction
 *
 * @param {sampler2D} projectedMap The texture with the octahedral projected cube map.
 * @param {vec2} textureSize The width and height dimensions in pixels of the projected map.
 * @param {vec3} direction The normalized direction used to sample the cube map.
 * @param {float} lod The level of detail to sample.
 * @param {float} maxLod The maximum level of detail.
 * @returns {vec3} The color of the cube map at the direction.
 */
vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {
    float currentLod = floor(lod + 0.5);
    float nextLod = min(currentLod + 1.0, maxLod);

    vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);
    vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);

    return mix(colorNextLod, colorCurrentLod, nextLod - lod);
}
`;var bIt=T(S(),1),SZ=`/**
 * Adjusts the saturation of a color.
 * 
 * @name czm_saturation
 * @glslFunction
 * 
 * @param {vec3} rgb The color.
 * @param {float} adjustment The amount to adjust the saturation of the color.
 *
 * @returns {float} The color with the saturation adjusted.
 *
 * @example
 * vec3 greyScale = czm_saturation(color, 0.0);
 * vec3 doubleSaturation = czm_saturation(color, 2.0);
 */
vec3 czm_saturation(vec3 rgb, float adjustment)
{
    // Algorithm from Chapter 16 of OpenGL Shading Language
    const vec3 W = vec3(0.2125, 0.7154, 0.0721);
    vec3 intensity = vec3(dot(rgb, W));
    return mix(intensity, rgb, adjustment);
}
`;var gIt=T(S(),1),CZ=`
float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
{
    return czm_unpackDepth(czm_textureCube(shadowMap, d));
}

float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
{
#ifdef USE_SHADOW_DEPTH_TEXTURE
    return texture(shadowMap, uv).r;
#else
    return czm_unpackDepth(texture(shadowMap, uv));
#endif
}

float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
{
    return step(depth, czm_sampleShadowMap(shadowMap, uv));
}

float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
{
    return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
`;var _It=T(S(),1),VZ=`
float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
{
#ifdef USE_NORMAL_SHADING
#ifdef USE_NORMAL_SHADING_SMOOTH
    float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
#else
    float strength = step(0.0, nDotL);
#endif
    visibility *= strength;
#endif

    visibility = max(visibility, darkness);
    return visibility;
}

#ifdef USE_CUBE_MAP_SHADOW
float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec3 uvw = shadowParameters.texCoords;

    depth -= depthBias;
    float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#else
float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
{
    float depthBias = shadowParameters.depthBias;
    float depth = shadowParameters.depth;
    float nDotL = shadowParameters.nDotL;
    float normalShadingSmooth = shadowParameters.normalShadingSmooth;
    float darkness = shadowParameters.darkness;
    vec2 uv = shadowParameters.texCoords;

    depth -= depthBias;
#ifdef USE_SOFT_SHADOWS
    vec2 texelStepSize = shadowParameters.texelStepSize;
    float radius = 1.0;
    float dx0 = -texelStepSize.x * radius;
    float dy0 = -texelStepSize.y * radius;
    float dx1 = texelStepSize.x * radius;
    float dy1 = texelStepSize.y * radius;
    float visibility = (
        czm_shadowDepthCompare(shadowMap, uv, depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
    ) * (1.0 / 9.0);
#else
    float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
#endif

    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#endif
`;var SIt=T(S(),1),LZ=`/**
 * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.  This is similar to the GLSL
 * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
 * 
 * @name czm_signNotZero
 * @glslFunction
 *
 * @param {} value The value for which to determine the sign.
 * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
 */
float czm_signNotZero(float value)
{
    return value >= 0.0 ? 1.0 : -1.0;
}

vec2 czm_signNotZero(vec2 value)
{
    return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
}

vec3 czm_signNotZero(vec3 value)
{
    return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
}

vec4 czm_signNotZero(vec4 value)
{
    return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
}
`;var VIt=T(S(),1),RZ=`/**
 * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
 * <p>
 * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
 * </p>
 *
 * @name czm_sphericalHarmonics
 * @glslFunction
 *
 * @param {vec3} normal The normalized direction.
 * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
 * @returns {vec3} The color at the direction.
 *
 * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
 */
vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
{
    vec3 L00 = coefficients[0];
    vec3 L1_1 = coefficients[1];
    vec3 L10 = coefficients[2];
    vec3 L11 = coefficients[3];
    vec3 L2_2 = coefficients[4];
    vec3 L2_1 = coefficients[5];
    vec3 L20 = coefficients[6];
    vec3 L21 = coefficients[7];
    vec3 L22 = coefficients[8];

    float x = normal.x;
    float y = normal.y;
    float z = normal.z;

    return
          L00
        + L1_1 * y
        + L10 * z
        + L11 * x
        + L2_2 * (y * x)
        + L2_1 * (y * z)
        + L20 * (3.0 * z * z - 1.0)
        + L21 * (z * x)
        + L22 * (x * x - y * y);
}
`;var RIt=T(S(),1),ZZ=`/**
 * Converts an sRGB color to a linear RGB color.
 *
 * @param {vec3|vec4} srgbIn The color in sRGB space
 * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
 */
vec3 czm_srgbToLinear(vec3 srgbIn)
{
    return pow(srgbIn, vec3(2.2));
}

vec4 czm_srgbToLinear(vec4 srgbIn) 
{
    vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
    return vec4(linearOut, srgbIn.a);
}
`;var GIt=T(S(),1),GZ=`/**
 * Creates a matrix that transforms vectors from tangent space to eye space.
 *
 * @name czm_tangentToEyeSpaceMatrix
 * @glslFunction
 *
 * @param {vec3} normalEC The normal vector in eye coordinates.
 * @param {vec3} tangentEC The tangent vector in eye coordinates.
 * @param {vec3} bitangentEC The bitangent vector in eye coordinates.
 *
 * @returns {mat3} The matrix that transforms from tangent space to eye space.
 *
 * @example
 * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
 * vec3 normal = tangentToEye * texture(normalMap, st).xyz;
 */
mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
{
    vec3 normal = normalize(normalEC);
    vec3 tangent = normalize(tangentEC);
    vec3 bitangent = normalize(bitangentEC);
    return mat3(tangent.x  , tangent.y  , tangent.z,
                bitangent.x, bitangent.y, bitangent.z,
                normal.x   , normal.y   , normal.z);
}
`;var XIt=T(S(),1),EZ=`/**
 * A wrapper around the texture (WebGL2) / textureCube (WebGL1)
 * function to allow for WebGL 1 support.
 * 
 * @name czm_textureCube
 * @glslFunction
 *
 * @param {samplerCube} sampler The sampler.
 * @param {vec3} p The coordinates to sample the texture at.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
    return texture(sampler, p);
#else  
    return textureCube(sampler, p);
#endif
}`;var WIt=T(S(),1),XZ=`/**
 * Transforms a plane.
 * 
 * @name czm_transformPlane
 * @glslFunction
 *
 * @param {vec4} plane The plane in Hessian Normal Form.
 * @param {mat4} transform The inverse-transpose of a transformation matrix.
 */
vec4 czm_transformPlane(vec4 plane, mat4 transform) {
    vec4 transformedPlane = transform * plane;
    // Convert the transformed plane to Hessian Normal Form
    float normalMagnitude = length(transformedPlane.xyz);
    return transformedPlane / normalMagnitude;
}
`;var vIt=T(S(),1),IZ=`/**
 * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
 * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
 * be relative to the eye.  As shown in the example, the position can then be transformed in eye
 * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
 * respectively.
 * <p>
 * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
 * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
 * </p>
 *
 * @name czm_translateRelativeToEye
 * @glslFunction
 *
 * @param {vec3} high The position's high bits.
 * @param {vec3} low The position's low bits.
 * @returns {vec3} The position translated to be relative to the camera's position.
 *
 * @example
 * in vec3 positionHigh;
 * in vec3 positionLow;
 *
 * void main()
 * {
 *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
 *   gl_Position = czm_modelViewProjectionRelativeToEye * p;
 * }
 *
 * @see czm_modelViewRelativeToEye
 * @see czm_modelViewProjectionRelativeToEye
 * @see czm_computePosition
 * @see EncodedCartesian3
 */
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
    vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
    vec3 lowDifference = low - czm_encodedCameraPositionMCLow;

    return vec4(highDifference + lowDifference, 1.0);
}
`;var FIt=T(S(),1),WZ=`/**
 * @private
 */
vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
    // Diffuse from directional light sources at eye (for top-down and horizon views)
    float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);

    if (czm_sceneMode == czm_sceneMode3D) {
        // (and horizon views in 3D)
        diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
    }

    diffuse = clamp(diffuse, 0.0, 1.0);

    float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);

    // Temporary workaround for adding ambient.
    vec3 materialDiffuse = material.diffuse * 0.5;

    vec3 ambient = materialDiffuse;
    vec3 color = ambient + material.emission;
    color += materialDiffuse * diffuse * czm_lightColor;
    color += material.specular * specular * czm_lightColor;

    return vec4(color, material.alpha);
}
`;var MIt=T(S(),1),PZ=`/**
 * Returns the transpose of the matrix.  The input <code>matrix</code> can be
 * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
 *
 * @name czm_transpose
 * @glslFunction
 *
 * @param {} matrix The matrix to transpose.
 *
 * @returns {} The transposed matrix.
 *
 * @example
 * // GLSL declarations
 * mat2 czm_transpose(mat2 matrix);
 * mat3 czm_transpose(mat3 matrix);
 * mat4 czm_transpose(mat4 matrix);
 *
 * // Transpose a 3x3 rotation matrix to find its inverse.
 * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
 *     positionMC, normalEC);
 * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
 */
mat2 czm_transpose(mat2 matrix)
{
    return mat2(
        matrix[0][0], matrix[1][0],
        matrix[0][1], matrix[1][1]);
}

mat3 czm_transpose(mat3 matrix)
{
    return mat3(
        matrix[0][0], matrix[1][0], matrix[2][0],
        matrix[0][1], matrix[1][1], matrix[2][1],
        matrix[0][2], matrix[1][2], matrix[2][2]);
}

mat4 czm_transpose(mat4 matrix)
{
    return mat4(
        matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
        matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
        matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
        matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
}
`;var UIt=T(S(),1),vZ=`/**
 * Unpacks a vec4 depth value to a float in [0, 1) range.
 *
 * @name czm_unpackDepth
 * @glslFunction
 *
 * @param {vec4} packedDepth The packed depth.
 *
 * @returns {float} The floating-point depth in [0, 1) range.
 */
 float czm_unpackDepth(vec4 packedDepth)
 {
    // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
    return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
 }
`;var DIt=T(S(),1),wZ=`/**
 * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
 *
 * @name czm_unpackFloat
 * @glslFunction
 *
 * @param {vec4} packedFloat The packed float.
 *
 * @returns {float} The floating-point depth in arbitrary range.
 */
float czm_unpackFloat(vec4 packedFloat)
{
    // Convert to [0.0, 255.0] and round to integer
    packedFloat = floor(packedFloat * 255.0 + 0.5);
    float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
    float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;    
    if (exponent == -127.0)
    {
        return 0.0;
    }
    float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
    float result = sign * exp2(exponent - 23.0) * mantissa;
    return result;
}
`;var YIt=T(S(),1),FZ=`/**
 * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
 * so the return value is an int.
 * <p>
 * There are also precision limitations in WebGL 1. highp int is still limited
 * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
 * </p>
 *
 * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
 *
 * @return {int} The unpacked value.
 */
 int czm_unpackUint(float packedValue) {
   float rounded = czm_round(packedValue * 255.0);
   return int(rounded);
 }

 int czm_unpackUint(vec2 packedValue) {
   vec2 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec2(1.0, 256.0)));
 }

 int czm_unpackUint(vec3 packedValue) {
   vec3 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
 }

 int czm_unpackUint(vec4 packedValue) {
   vec4 rounded = czm_round(packedValue * 255.0);
   return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
 }
`;var KIt=T(S(),1),AZ=`/**
 * Transform metadata values following the EXT_structural_metadata spec
 * by multiplying by scale and adding the offset. Operations are always
 * performed component-wise, even for matrices.
 * 
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
 * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
 *
 * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
 */
float czm_valueTransform(float offset, float scale, float value) {
  return scale * value + offset;
}

vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
  return scale * value + offset;
}

vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
  return scale * value + offset;
}

vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
  return scale * value + offset;
}

mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
  return matrixCompMult(scale, value) + offset;
}

mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
  return matrixCompMult(scale, value) + offset;
}

mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
  return matrixCompMult(scale, value) + offset;
}
`;var zIt=T(S(),1),MZ=`#ifdef LOG_DEPTH
// 1.0 at the near plane, increasing linearly from there.
out float v_depthFromNearPlusOne;
#ifdef SHADOW_MAP
out vec3 v_logPositionEC;
#endif
#endif

vec4 czm_updatePositionDepth(vec4 coords) {
#if defined(LOG_DEPTH)

#ifdef SHADOW_MAP
    vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
    v_logPositionEC = logPositionEC;
#endif

    // With the very high far/near ratios used with the logarithmic depth
    // buffer, floating point rounding errors can cause linear depth values
    // to end up on the wrong side of the far plane, even for vertices that
    // are really nowhere near it. Since we always write a correct logarithmic
    // depth value in the fragment shader anyway, we just need to make sure
    // such errors don't cause the primitive to be clipped entirely before
    // we even get to the fragment shader.
    coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
#endif

    return coords;
}

/**
 * Writes the logarithmic depth to gl_Position using the already computed gl_Position.
 *
 * @name czm_vertexLogDepth
 * @glslFunction
 */
void czm_vertexLogDepth()
{
#ifdef LOG_DEPTH
    v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
    gl_Position = czm_updatePositionDepth(gl_Position);
#endif
}

/**
 * Writes the logarithmic depth to gl_Position using the provided clip coordinates.
 * <p>
 * An example use case for this function would be moving the vertex in window coordinates
 * before converting back to clip coordinates. Use the original vertex clip coordinates.
 * </p>
 * @name czm_vertexLogDepth
 * @glslFunction
 *
 * @param {vec4} clipCoords The vertex in clip coordinates.
 *
 * @example
 * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
 */
void czm_vertexLogDepth(vec4 clipCoords)
{
#ifdef LOG_DEPTH
    v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
    czm_updatePositionDepth(clipCoords);
#endif
}
`;var QIt=T(S(),1),NZ=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
{
    // Reconstruct NDC coordinates
    float x = 2.0 * screenCoordinate.x - 1.0;
    float y = 2.0 * screenCoordinate.y - 1.0;
    float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
    vec4 q = vec4(x, y, z, 1.0);

    // Reverse the perspective division to obtain clip coordinates.
    q /= screenCoordinate.w;

    // Reverse the projection transformation to obtain eye coordinates.
    if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
    {
        q = czm_inverseProjection * q;
    }
    else
    {
        float top = czm_frustumPlanes.x;
        float bottom = czm_frustumPlanes.y;
        float left = czm_frustumPlanes.z;
        float right = czm_frustumPlanes.w;

        float near = czm_currentFrustum.x;
        float far = czm_currentFrustum.y;

        q.x = (q.x * (right - left) + left + right) * 0.5;
        q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
        q.z = (q.z * (near - far) - near - far) * 0.5;
        q.w = 1.0;
    }

    return q;
}

/**
 * Transforms a position from window to eye coordinates.
 * The transform from window to normalized device coordinates is done using components
 * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
 * the inverse of <code>czm_viewportTransformation</code>. The transformation from
 * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
 * which is expected to be the scalar used in the perspective divide. The transformation
 * from clip to eye coordinates is done using {@link czm_inverseProjection}.
 *
 * @name czm_windowToEyeCoordinates
 * @glslFunction
 *
 * @param {vec4} fragmentCoordinate The position in window coordinates to transform.
 *
 * @returns {vec4} The transformed position in eye coordinates.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_eyeToWindowCoordinates
 * @see czm_inverseProjection
 * @see czm_viewport
 * @see czm_viewportTransformation
 *
 * @example
 * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
 */
vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
{
    vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
    return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
}

vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
{
    // See reverseLogDepth.glsl. This is separate to re-use the pow.
#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = pow(2.0, log2Depth) - 1.0;
    float depthFromCamera = depthFromNear + near;
    vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
    eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
    return eyeCoordinate;
#else
    vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
    vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
#endif
    return eyeCoordinate;
}

/**
 * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
 * This function produces more accurate results for window positions with log depth than
 * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
 * of czm_windowToEyeCoordinates.
 *
 * @name czm_windowToEyeCoordinates
 * @glslFunction
 *
 * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
 * @param {float} depthOrLogDepth A depth or log depth for the fragment.
 *
 * @see czm_modelToWindowCoordinates
 * @see czm_eyeToWindowCoordinates
 * @see czm_inverseProjection
 * @see czm_viewport
 * @see czm_viewportTransformation
 *
 * @returns {vec4} The transformed position in eye coordinates.
 */
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
{
    vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
    return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
}
`;var qIt=T(S(),1),UZ=`// emulated noperspective
#if !defined(LOG_DEPTH)
in float v_WindowZ;
#endif

/**
 * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
 * by writing the fragment's depth. See czm_depthClamp for more details.
 *
 * @name czm_writeDepthClamp
 * @glslFunction
 *
 * @example
 * out_FragColor = color;
 * czm_writeDepthClamp();
 *
 * @see czm_depthClamp
 */
void czm_writeDepthClamp()
{
#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
#endif
}
`;var eWt=T(S(),1),kZ=`#ifdef LOG_DEPTH
in float v_depthFromNearPlusOne;

#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#endif

#endif

/**
 * Writes the fragment depth to the logarithmic depth buffer.
 * <p>
 * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when
 * ray-casting geometry using a full screen quad.
 * </p>
 * @name czm_writeLogDepth
 * @glslFunction
 *
 * @param {float} depth The depth coordinate, where 1.0 is on the near plane and
 *                      depth increases in eye-space units from there
 *
 * @example
 * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
 */
void czm_writeLogDepth(float depth)
{
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    // Discard the vertex if it's not between the near and far planes.
    // We allow a bit of epsilon on the near plane comparison because a 1.0
    // from the vertex shader (indicating the vertex should be _on_ the near
    // plane) will not necessarily come here as exactly 1.0.
    if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
        discard;
    }

#ifdef POLYGON_OFFSET
    // Polygon offset: m * factor + r * units
    float factor = u_polygonOffset[0];
    float units = u_polygonOffset[1];

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    // This factor doesn't work in IE 10
    if (factor != 0.0) {
        // m = sqrt(dZdX^2 + dZdY^2);
        float x = dFdx(depth);
        float y = dFdy(depth);
        float m = sqrt(x * x + y * y);

        // Apply the factor before computing the log depth.
        depth += m * factor;
    }
#endif

#endif

    gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;

#ifdef POLYGON_OFFSET
    // Apply the units after the log depth.
    gl_FragDepth += czm_epsilon7 * units;
#endif

#endif
}

/**
 * Writes the fragment depth to the logarithmic depth buffer.
 * <p>
 * Use this when the vertex shader calls {@link czm_vertexlogDepth}.
 * </p>
 *
 * @name czm_writeLogDepth
 * @glslFunction
 */
void czm_writeLogDepth() {
#ifdef LOG_DEPTH
    czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;var nWt=T(S(),1),DZ=`/**
 * Transforms a value for non-perspective interpolation by multiplying
 * it by w, the value used in the perspective divide. This function is
 * intended to be called in a vertex shader to compute the value of a
 * \`varying\` that should not be subject to perspective interpolation.
 * For example, screen-space texture coordinates. The fragment shader
 * must call {@link czm_readNonPerspective} to retrieve the final
 * non-perspective value.
 *
 * @name czm_writeNonPerspective
 * @glslFunction
 *
 * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
 * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
 * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
 *          fragment shader with {@link czm_readNonPerspective}.
 */
float czm_writeNonPerspective(float value, float w) {
    return value * w;
}

vec2 czm_writeNonPerspective(vec2 value, float w) {
    return value * w;
}

vec3 czm_writeNonPerspective(vec3 value, float w) {
    return value * w;
}

vec4 czm_writeNonPerspective(vec4 value, float w) {
    return value * w;
}
`;var vg={czm_degreesPerRadian:_L,czm_depthRange:TL,czm_epsilon1:SL,czm_epsilon2:CL,czm_epsilon3:VL,czm_epsilon4:LL,czm_epsilon5:RL,czm_epsilon6:ZL,czm_epsilon7:GL,czm_infinity:EL,czm_oneOverPi:XL,czm_oneOverTwoPi:IL,czm_passCesium3DTile:WL,czm_passCesium3DTileClassification:PL,czm_passCesium3DTileClassificationIgnoreShow:vL,czm_passClassification:wL,czm_passCompute:FL,czm_passEnvironment:AL,czm_passGlobe:ML,czm_passOpaque:NL,czm_passOverlay:UL,czm_passTerrainClassification:kL,czm_passTranslucent:DL,czm_passVoxels:BL,czm_pi:YL,czm_piOverFour:OL,czm_piOverSix:KL,czm_piOverThree:HL,czm_piOverTwo:zL,czm_radiansPerDegree:JL,czm_sceneMode2D:QL,czm_sceneMode3D:jL,czm_sceneModeColumbusView:qL,czm_sceneModeMorphing:$L,czm_solarRadius:eR,czm_threePiOver2:tR,czm_twoPi:nR,czm_webMercatorMaxLatitude:iR,czm_depthRangeStruct:oR,czm_material:rR,czm_materialInput:sR,czm_modelMaterial:aR,czm_modelVertexOutput:cR,czm_pbrParameters:lR,czm_ray:dR,czm_raySegment:uR,czm_shadowParameters:mR,czm_HSBToRGB:hR,czm_HSLToRGB:fR,czm_RGBToHSB:pR,czm_RGBToHSL:bR,czm_RGBToXYZ:yR,czm_XYZToRGB:gR,czm_acesTonemapping:xR,czm_alphaWeight:_R,czm_antialias:TR,czm_approximateSphericalCoordinates:SR,czm_backFacing:CR,czm_branchFreeTernary:VR,czm_cascadeColor:LR,czm_cascadeDistance:RR,czm_cascadeMatrix:ZR,czm_cascadeWeights:GR,czm_columbusViewMorph:ER,czm_computePosition:XR,czm_cosineAndSine:IR,czm_decompressTextureCoordinates:WR,czm_defaultPbrMaterial:PR,czm_depthClamp:vR,czm_eastNorthUpToEyeCoordinates:wR,czm_ellipsoidContainsPoint:FR,czm_ellipsoidWgs84TextureCoordinates:AR,czm_equalsEpsilon:MR,czm_eyeOffset:NR,czm_eyeToWindowCoordinates:UR,czm_fastApproximateAtan:kR,czm_fog:DR,czm_gammaCorrect:BR,czm_geodeticSurfaceNormal:YR,czm_getDefaultMaterial:OR,czm_getLambertDiffuse:KR,czm_getSpecular:HR,czm_getWaterNoise:zR,czm_hue:JR,czm_inverseGamma:QR,czm_isEmpty:jR,czm_isFull:qR,czm_latitudeToWebMercatorFraction:$R,czm_lineDistance:eZ,czm_linearToSrgb:tZ,czm_luminance:nZ,czm_metersPerPixel:iZ,czm_modelToWindowCoordinates:oZ,czm_multiplyWithColorBalance:rZ,czm_nearFarScalar:sZ,czm_octDecode:aZ,czm_packDepth:cZ,czm_pbrLighting:lZ,czm_pbrMetallicRoughnessMaterial:dZ,czm_pbrSpecularGlossinessMaterial:uZ,czm_phong:mZ,czm_planeDistance:hZ,czm_pointAlongRay:fZ,czm_rayEllipsoidIntersectionInterval:pZ,czm_raySphereIntersectionInterval:bZ,czm_readDepth:yZ,czm_readNonPerspective:gZ,czm_reverseLogDepth:xZ,czm_round:_Z,czm_sampleOctahedralProjection:TZ,czm_saturation:SZ,czm_shadowDepthCompare:CZ,czm_shadowVisibility:VZ,czm_signNotZero:LZ,czm_sphericalHarmonics:RZ,czm_srgbToLinear:ZZ,czm_tangentToEyeSpaceMatrix:GZ,czm_textureCube:EZ,czm_transformPlane:XZ,czm_translateRelativeToEye:IZ,czm_translucentPhong:WZ,czm_transpose:PZ,czm_unpackDepth:vZ,czm_unpackFloat:wZ,czm_unpackUint:FZ,czm_valueTransform:AZ,czm_vertexLogDepth:MZ,czm_windowToEyeCoordinates:NZ,czm_writeDepthClamp:UZ,czm_writeLogDepth:kZ,czm_writeNonPerspective:DZ};var EPt=T(S(),1);function r1e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable
${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
${n}`,n}var BZ=r1e;function H6(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=`
`;return i})}function z6(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return d(i)||(t=H6(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function J6(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);d(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&xs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=z6(i,xs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),J6(o,t)}}))}function s1e(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function a1e(e){let t=[],n=z6("main",e,t);J6(n,t),s1e(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function Q6(e,t,n){let i,o,r="",s=e.sources;if(d(s))for(i=0,o=s.length;i<o;++i)r+=`
#line 0
${s[i]}`;r=H6(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,_){return a=_,`
`});let c=[];r=r.replace(/#extension.*\n/gm,function(x){return c.push(x),`
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let l=e.pickColorQualifier;d(l)&&(r=xs.createPickFragmentShaderSource(r,l));let u="",m=c.length;for(i=0;i<m;i++)u+=c[i];t&&(u+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
    precision highp float;
    precision highp int;
#else
    precision mediump float;
    precision mediump int;
    #define highp mediump
#endif

`);let p=e.defines;if(d(p))for(i=0,o=p.length;i<o;++i){let x=p[i];x.length!==0&&(u+=`#define ${x}
`)}n.textureFloatLinear&&(u+=`#define OES_texture_float_linear

`),n.floatingPointTexture&&(u+=`#define OES_texture_float

`);let y="";e.includeBuiltIns&&(y=a1e(r)),u+=`
#line 0
`;let f=y+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(f)&&!/czm_out_FragColor/g.test(f)&&/out_FragColor/g.test(f)&&(u+=`layout(location = 0) out vec4 out_FragColor;

`),u+=y,u+=r,n.webgl2?u=`#version 300 es
${u}`:u=BZ(u,t),u}function xs(e){e=g(e,g.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=d(e.defines)?e.defines.slice(0):[],this.sources=d(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=g(e.includeBuiltIns,!0)}xs.prototype.clone=function(){return new xs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};xs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};xs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
`);return`${t}:${n}:${i}:${o}`};xs.prototype.createCombinedVertexShader=function(e){return Q6(this,!1,e)};xs.prototype.createCombinedFragmentShader=function(e){return Q6(this,!0,e)};xs._czmBuiltinsAndUniforms={};for(let e in vg)vg.hasOwnProperty(e)&&(xs._czmBuiltinsAndUniforms[e]=vg[e]);for(let e in Yf)if(Yf.hasOwnProperty(e)){let t=Yf[e];typeof t.getDeclaration=="function"&&(xs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}xs.createPickVertexShaderSource=function(e){return`${xs.replaceMain(e,"czm_old_main")}
in vec4 pickColor; 
out vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    czm_pickColor = pickColor; 
}`};xs.createPickFragmentShaderSource=function(e,t){let n=xs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    if (out_FragColor.a == 0.0) { 
       discard; 
    } 
    out_FragColor = czm_pickColor; 
}`;return`${n}
${i}`};function c1e(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function j6(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function q6(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(j6(e,o))return o}}var l1e=["v_normalEC","v_normal"];xs.findNormalVarying=function(e){return j6(e,"#ifdef HAS_NORMALS")?c1e(e,"HAS_NORMALS")?"v_normalEC":void 0:q6(e,l1e)};var d1e=["v_positionEC"];xs.findPositionVarying=function(e){return q6(e,d1e)};var Be=xs;function im(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(im.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});im.prototype.replaceShaderProgram=function(e){return d(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function u1e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}im.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Be({sources:[t]})),typeof n=="string"&&(n=new Be({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=d(i)?u1e(i):"",a=`${o}:${r}:${s}`,c;if(d(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let l=this._context,u=t.createCombinedVertexShader(l),m=n.createCombinedFragmentShader(l),p=new Qt({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:m,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};im.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(d(r)){kB(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};im.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(d(o))return o.shaderProgram};im.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Be({sources:[r]})),typeof s=="string"&&(s=new Be({sources:[s]}));let c=this._context,l=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),m=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:l,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function kB(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];kB(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}im.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];kB(this,n),--this._numberOfShaders}this._shadersToRelease={}};im.prototype.releaseShaderProgram=function(e){if(d(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var YZ=im;var tvt=T(S(),1);function om(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,o=e.source;d(o)&&(d(n)||(n=g(o.videoWidth,o.width)),d(i)||(i=g(o.videoHeight,o.height)));let r=g(e.pixelFormat,st.RGBA),s=g(e.pixelDatatype,Je.UNSIGNED_BYTE),a=st.toInternalFormat(r,s,t),c=st.isCompressedFormat(a),l=e.preMultiplyAlpha||r===st.RGB||r===st.LUMINANCE,u=g(e.flipY,!0),m=g(e.skipColorSpaceConversion,!1),p=!0,y=t._gl,f=y.TEXTURE_2D,x=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(f,x);let _=4;if(d(o)&&d(o.arrayBufferView)&&!c&&(_=st.alignmentInBytes(r,s,n)),y.pixelStorei(y.UNPACK_ALIGNMENT,_),m?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),d(o))if(d(o.arrayBufferView)){y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,!1);let V=o.arrayBufferView,L,Z,G;if(c){if(y.compressedTexImage2D(f,0,a,n,i,0,V),d(o.mipLevels))for(Z=n,G=i,L=0;L<o.mipLevels.length;++L)Z=Math.floor(Z/2)|0,Z<1&&(Z=1),G=Math.floor(G/2)|0,G<1&&(G=1),y.compressedTexImage2D(f,L+1,a,Z,G,0,o.mipLevels[L])}else if(u&&(V=st.flipY(V,r,s,n,i)),y.texImage2D(f,0,a,n,i,0,r,Je.toWebGLConstant(s,t),V),d(o.mipLevels))for(Z=n,G=i,L=0;L<o.mipLevels.length;++L)Z=Math.floor(Z/2)|0,Z<1&&(Z=1),G=Math.floor(G/2)|0,G<1&&(G=1),y.texImage2D(f,L+1,a,Z,G,0,r,Je.toWebGLConstant(s,t),o.mipLevels[L])}else d(o.framebuffer)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,!1),o.framebuffer!==t.defaultFramebuffer&&o.framebuffer._bind(),y.copyTexImage2D(f,0,a,o.xOffset,o.yOffset,n,i,0),o.framebuffer!==t.defaultFramebuffer&&o.framebuffer._unBind()):(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,u),y.texImage2D(f,0,a,r,Je.toWebGLConstant(s,t),o));else y.texImage2D(f,0,a,n,i,0,r,Je.toWebGLConstant(s,t),null),p=!1;y.bindTexture(f,null);let C;c?C=st.compressedTextureSizeInBytes(r,n,i):C=st.textureSizeInBytes(r,s,n,i),this._id=Yn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f,this._texture=x,this._internalFormat=a,this._pixelFormat=r,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new D(n,i),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=p,this._sampler=void 0,this.sampler=d(e.sampler)?e.sampler:new dn}om.create=function(e){return new om(e)};om.fromFramebuffer=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=t._gl,i=g(e.pixelFormat,st.RGB),o=g(e.framebufferXOffset,0),r=g(e.framebufferYOffset,0),s=g(e.width,n.drawingBufferWidth),a=g(e.height,n.drawingBufferHeight),c=e.framebuffer;return new om({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:d(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(om.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,o=this._pixelFormat,r=this._pixelDatatype,s=t===cn.NEAREST_MIPMAP_NEAREST||t===cn.NEAREST_MIPMAP_LINEAR||t===cn.LINEAR_MIPMAP_NEAREST||t===cn.LINEAR_MIPMAP_LINEAR;(r===Je.FLOAT&&!i.textureFloatLinear||r===Je.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?cn.NEAREST_MIPMAP_NEAREST:cn.NEAREST,n=Ti.NEAREST),i.webgl2&&st.isDepthFormat(o)&&(t=cn.NEAREST,n=Ti.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),d(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});om.prototype.copyFrom=function(e){let t=g(e.xOffset,0),n=g(e.yOffset,0),i=e.source,o=this._context,r=o._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture);let a=i.width,c=i.height,l=i.arrayBufferView,u=this._width,m=this._height,p=this._internalFormat,y=this._pixelFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=g(e.skipColorSpaceConversion,!1),V=4;d(l)&&(V=st.alignmentInBytes(y,f,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,V),C?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let L=!1;if(!this._initialized){if(t===0&&n===0&&a===u&&c===m)d(l)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),_&&(l=st.flipY(l,y,f,u,m)),r.texImage2D(s,0,p,u,m,0,y,Je.toWebGLConstant(f,o),l)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,_),r.texImage2D(s,0,p,y,Je.toWebGLConstant(f,o),i)),L=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let Z=st.createTypedArray(y,f,u,m);r.texImage2D(s,0,p,u,m,0,y,Je.toWebGLConstant(f,o),Z)}this._initialized=!0}L||(d(l)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),_&&(l=st.flipY(l,y,f,a,c)),r.texSubImage2D(s,0,t,n,a,c,y,Je.toWebGLConstant(f,o),l)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,_),r.texSubImage2D(s,0,t,n,y,Je.toWebGLConstant(f,o),i))),r.bindTexture(s,null)};om.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._width),r=g(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};om.prototype.generateMipmap=function(e){e=g(e,Ph.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};om.prototype.isDestroyed=function(){return!1};om.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Wt=om;var rvt=T(S(),1);function wg(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(wg.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});wg.prototype.getTexture=function(e){let t=this._textures[e];if(d(t))return delete this._texturesToRelease[e],++t.count,t.texture};wg.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};wg.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};wg.prototype.isDestroyed=function(){return!1};wg.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var OZ=wg;var xwt=T(S(),1);var lvt=T(S(),1);function vh(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}vh.encode=function(e,t){d(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var ep={high:0,low:0};vh.fromCartesian=function(e,t){d(t)||(t=new vh);let n=t.high,i=t.low;return vh.encode(e.x,ep),n.x=ep.high,i.x=ep.low,vh.encode(e.y,ep),n.y=ep.high,i.y=ep.low,vh.encode(e.z,ep),n.z=ep.high,i.z=ep.low,t};var DB=new vh;vh.writeElements=function(e,t,n){vh.fromCartesian(e,DB);let i=DB.high,o=DB.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var On=vh;var Mvt=T(S(),1);var Wvt=T(S(),1);var Cvt=T(S(),1);var pvt=T(S(),1);function _s(e,t){this.normal=h.clone(e),this.distance=t}_s.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return d(n)?(h.clone(t,n.normal),n.distance=i,n):new _s(t,i)};var m1e=new h;_s.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,m1e),i=e.w;return d(t)?(h.clone(n,t.normal),t.distance=i,t):new _s(n,i)};_s.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var h1e=new h;_s.projectPointOntoPlane=function(e,t,n){d(n)||(n=new h);let i=_s.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,h1e);return h.subtract(t,o,n)};var f1e=new F,p1e=new se,b1e=new h;_s.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,f1e),s=se.fromElements(i.x,i.y,i.z,o,p1e);s=F.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,b1e);return s=se.divideByScalar(s,h.magnitude(a),s),_s.fromCartesian4(s,n)};_s.clone=function(e,t){return d(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new _s(e.normal,e.distance)};_s.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};_s.ORIGIN_XY_PLANE=Object.freeze(new _s(h.UNIT_Z,0));_s.ORIGIN_YZ_PLANE=Object.freeze(new _s(h.UNIT_X,0));_s.ORIGIN_ZX_PLANE=Object.freeze(new _s(h.UNIT_Y,0));var on=_s;function zd(e){this.planes=g(e,[])}var KZ=[new h,new h,new h];h.clone(h.UNIT_X,KZ[0]);h.clone(h.UNIT_Y,KZ[1]);h.clone(h.UNIT_Z,KZ[2]);var rb=new h,y1e=new h,$6=new on(new h(1,0,0),0);zd.fromBoundingSphere=function(e,t){d(t)||(t=new zd);let n=KZ.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=KZ[a],l=i[s],u=i[s+1];d(l)||(l=i[s]=new se),d(u)||(u=i[s+1]=new se),h.multiplyByScalar(c,-r,rb),h.add(o,rb,rb),l.x=c.x,l.y=c.y,l.z=c.z,l.w=-h.dot(c,rb),h.multiplyByScalar(c,r,rb),h.add(o,rb,rb),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-h.dot(h.negate(c,y1e),rb),s+=2}return t};zd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(on.fromCartesian4(t[i],$6));if(r===qt.OUTSIDE)return qt.OUTSIDE;r===qt.INTERSECTING&&(n=!0)}return n?qt.INTERSECTING:qt.INSIDE};zd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===zd.MASK_OUTSIDE||t===zd.MASK_INSIDE)return t;let n=zd.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(on.fromCartesian4(i[o],$6));if(a===qt.OUTSIDE)return zd.MASK_OUTSIDE;a===qt.INTERSECTING&&(n|=s)}return n};zd.MASK_OUTSIDE=4294967295;zd.MASK_INSIDE=0;zd.MASK_INDETERMINATE=2147483647;var Qr=zd;function wh(e){e=g(e,g.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this._cullingVolume=new Qr,this._orthographicMatrix=new F}function eq(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(wh.prototype,{projectionMatrix:{get:function(){return eq(this),this._orthographicMatrix}}});var g1e=new h,x1e=new h,_1e=new h,BB=new h;wh.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,l=this.far,u=h.cross(t,n,g1e);h.normalize(u,u);let m=x1e;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=_1e;h.multiplyByScalar(u,a,p),h.add(m,p,p);let y=i[0];return d(y)||(y=i[0]=new se),y.x=u.x,y.y=u.y,y.z=u.z,y.w=-h.dot(u,p),h.multiplyByScalar(u,s,p),h.add(m,p,p),y=i[1],d(y)||(y=i[1]=new se),y.x=-u.x,y.y=-u.y,y.z=-u.z,y.w=-h.dot(h.negate(u,BB),p),h.multiplyByScalar(n,r,p),h.add(m,p,p),y=i[2],d(y)||(y=i[2]=new se),y.x=n.x,y.y=n.y,y.z=n.z,y.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(m,p,p),y=i[3],d(y)||(y=i[3]=new se),y.x=-n.x,y.y=-n.y,y.z=-n.z,y.w=-h.dot(h.negate(n,BB),p),y=i[4],d(y)||(y=i[4]=new se),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-h.dot(t,m),h.multiplyByScalar(t,l,p),h.add(e,p,p),y=i[5],d(y)||(y=i[5]=new se),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-h.dot(h.negate(t,BB),p),this._cullingVolume};wh.prototype.getPixelDimensions=function(e,t,n,i,o){eq(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};wh.prototype.clone=function(e){return d(e)||(e=new wh),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};wh.prototype.equals=function(e){return d(e)&&e instanceof wh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};wh.prototype.equalsEpsilon=function(e,t,n){return e===this||d(e)&&e instanceof wh&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var yr=wh;function sl(e){e=g(e,g.EMPTY_OBJECT),this._offCenterFrustum=new yr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far}sl.packedLength=4;sl.pack=function(e,t,n){return n=g(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};sl.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new sl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function sb(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(sl.prototype,{projectionMatrix:{get:function(){return sb(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return sb(this),this._offCenterFrustum}}});sl.prototype.computeCullingVolume=function(e,t,n){return sb(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};sl.prototype.getPixelDimensions=function(e,t,n,i,o){return sb(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};sl.prototype.clone=function(e){return d(e)||(e=new sl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};sl.prototype.equals=function(e){return!d(e)||!(e instanceof sl)?!1:(sb(this),sb(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};sl.prototype.equalsEpsilon=function(e,t,n){return!d(e)||!(e instanceof sl)?!1:(sb(this),sb(e),W.equalsEpsilon(this.width,e.width,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var en=sl;var Hvt=T(S(),1);var YB={};function T1e(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var S1e=32.184,C1e=2451545;function xq(e,t){t=te.addSeconds(e,S1e,t);let n=te.totalDays(t)-C1e;return t=te.addSeconds(t,T1e(n),t),t}var H9=new te(2451545,0,Jn.TAI),V1e=1e3,Jd=W.RADIANS_PER_DEGREE,Yl=W.RADIANS_PER_ARCSECOND,ua=14959787e4,tq=new $;function _q(e,t,n,i,o,r,s){n<0&&(n=-n,o+=W.PI);let a=e*(1-t),c=i-o,l=o,u=R1e(r-i,t),m=L1e(t,0);I1e(c,n,l,tq);let p=a*(1+t),y=Math.cos(u),f=Math.sin(u),x=1+t*y,_=p/x;return d(s)?(s.x=_*y,s.y=_*f,s.z=0):s=new h(_*y,_*f,0),$.multiplyByVector(tq,s,s)}function L1e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function R1e(e,t){let n=E1e(e,t);return X1e(n,t)}var Z1e=50,G1e=W.EPSILON8;function E1e(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<Z1e&&Math.abs(o-i)>G1e;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function X1e(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function I1e(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),l=Math.sin(n);return d(i)?(i[0]=c*o-l*r*s,i[1]=l*o+c*r*s,i[2]=r*a,i[3]=-c*r-l*o*s,i[4]=-l*r+c*o*s,i[5]=o*a,i[6]=l*a,i[7]=-c*a,i[8]=s):i=new $(c*o-l*r*s,-c*r-l*o*s,l*a,l*o+c*r*s,-l*r+c*o*s,-c*a,r*a,o*a,s),i}var W1e=1.0000010178*ua,P1e=100.46645683*Jd,v1e=129597742283429e-5*Yl,nq=16002,iq=21863,oq=32004,rq=10931,sq=14529,aq=16368,cq=15318,lq=32794,w1e=64*1e-7*ua,F1e=-152*1e-7*ua,A1e=62*1e-7*ua,M1e=-8*1e-7*ua,N1e=32*1e-7*ua,U1e=-41*1e-7*ua,k1e=19*1e-7*ua,D1e=-11*1e-7*ua,B1e=-150*1e-7*ua,Y1e=-46*1e-7*ua,O1e=68*1e-7*ua,K1e=54*1e-7*ua,H1e=14*1e-7*ua,z1e=24*1e-7*ua,J1e=-28*1e-7*ua,Q1e=22*1e-7*ua,dq=10,uq=16002,mq=21863,hq=10931,fq=1473,pq=32004,bq=4387,yq=73,j1e=-325*1e-7,q1e=-322*1e-7,$1e=-79*1e-7,eVe=232*1e-7,tVe=-52*1e-7,nVe=97*1e-7,iVe=55*1e-7,oVe=-41*1e-7,rVe=-105*1e-7,sVe=-137*1e-7,aVe=258*1e-7,cVe=35*1e-7,lVe=-116*1e-7,dVe=-88*1e-7,uVe=-112*1e-7,mVe=-80*1e-7,cS=new te(0,0,Jn.TAI);function hVe(e,t){xq(e,cS);let i=(cS.dayNumber-H9.dayNumber+(cS.secondsOfDay-H9.secondsOfDay)/Qn.SECONDS_PER_DAY)/(Qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=W1e+w1e*Math.cos(nq*o)+B1e*Math.sin(nq*o)+F1e*Math.cos(iq*o)+Y1e*Math.sin(iq*o)+A1e*Math.cos(oq*o)+O1e*Math.sin(oq*o)+M1e*Math.cos(rq*o)+K1e*Math.sin(rq*o)+N1e*Math.cos(sq*o)+H1e*Math.sin(sq*o)+U1e*Math.cos(aq*o)+z1e*Math.sin(aq*o)+k1e*Math.cos(cq*o)+J1e*Math.sin(cq*o)+D1e*Math.cos(lq*o)+Q1e*Math.sin(lq*o),s=P1e+v1e*i+j1e*Math.cos(dq*o)+rVe*Math.sin(dq*o)+q1e*Math.cos(uq*o)+sVe*Math.sin(uq*o)+$1e*Math.cos(mq*o)+aVe*Math.sin(mq*o)+eVe*Math.cos(hq*o)+cVe*Math.sin(hq*o)+tVe*Math.cos(fq*o)+lVe*Math.sin(fq*o)+nVe*Math.cos(pq*o)+dVe*Math.sin(pq*o)+iVe*Math.cos(bq*o)+uVe*Math.sin(bq*o)+oVe*Math.cos(yq*o)+mVe*Math.sin(yq*o),a=.0167086342-.0004203654*i,c=102.93734808*Jd+11612.3529*Yl*i,l=469.97289*Yl*i,u=174.87317577*Jd-8679.27034*Yl*i;return _q(r,a,l,c,u,s,t)}function Tq(e,t){xq(e,cS);let i=(cS.dayNumber-H9.dayNumber+(cS.secondsOfDay-H9.secondsOfDay)/Qn.SECONDS_PER_DAY)/Qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,l=5.15668983*Jd,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*Jd,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,y=125.04455501*Jd,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Jd,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Jd+Yl*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Jd+Yl*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*Jd+Yl*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),Z=357.52910918*Jd+Yl*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*Jd-Yl*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),X=2*C,P=4*C,v=6*C,A=2*L,M=3*L,b=4*L,R=2*V;a+=3400.4*Math.cos(X)-635.6*Math.cos(X-L)-235.6*Math.cos(L)+218.1*Math.cos(X-Z)+181*Math.cos(X+L),c+=.014216*Math.cos(X-L)+.008551*Math.cos(X-A)-.001383*Math.cos(L)+.001356*Math.cos(X+L)-.001147*Math.cos(P-M)-914e-6*Math.cos(P-A)+869e-6*Math.cos(X-Z-L)-627e-6*Math.cos(X)-394e-6*Math.cos(P-b)+282e-6*Math.cos(X-Z-A)-279e-6*Math.cos(C-L)-236e-6*Math.cos(A)+231e-6*Math.cos(P)+229e-6*Math.cos(v-b)-201e-6*Math.cos(A-R),u+=486.26*Math.cos(X-R)-40.13*Math.cos(X)+37.51*Math.cos(R)+25.73*Math.cos(A-R)+19.97*Math.cos(X-Z-R),p+=-55609*Math.sin(X-L)-34711*Math.sin(X-A)-9792*Math.sin(L)+9385*Math.sin(P-M)+7505*Math.sin(P-A)+5318*Math.sin(X+L)+3484*Math.sin(P-b)-3417*Math.sin(X-Z-L)-2530*Math.sin(v-b)-2376*Math.sin(X)-2075*Math.sin(X-M)-1883*Math.sin(A)-1736*Math.sin(v-5*L)+1626*Math.sin(Z)-1370*Math.sin(v-M),f+=-5392*Math.sin(X-R)-540*Math.sin(Z)-441*Math.sin(X)+423*Math.sin(R)-288*Math.sin(A-R),_+=-3332.9*Math.sin(X)+1197.4*Math.sin(X-L)-662.5*Math.sin(Z)+396.3*Math.sin(L)-218*Math.sin(X-Z);let E=2*G,I=3*G;u+=46.997*Math.cos(G)*i-.614*Math.cos(X-R+G)*i+.614*Math.cos(X-R-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(X-R+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(E)*r;let w=2.116*Math.sin(G)*i-.111*Math.sin(X-R-G)*i-.0015*Math.sin(G)*o;p+=w,_+=w,f+=-520.77*Math.sin(G)*i+13.66*Math.sin(X-R+G)*i+1.12*Math.sin(X-G)*i-1.06*Math.sin(R-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(X-R+E)*o-.015*Math.sin(X-R+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(E)*r,a*=V1e;let N=l+u*Yl,Y=m+p*Yl,k=x+_*Yl,O=y+f*Yl;return _q(a,c,N,Y,O,k,t)}var gq=.012300034,fVe=gq/(gq+1)*-1;function pVe(e,t){return t=Tq(e,t),h.multiplyByScalar(t,fVe,t)}var Sq=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),HZ=new h;YB.computeSunPositionInEarthInertialFrame=function(e,t){return d(e)||(e=te.now()),d(t)||(t=new h),HZ=hVe(e,HZ),t=h.negate(HZ,t),pVe(e,HZ),h.subtract(t,HZ,t),$.multiplyByVector(Sq,t,t),t};YB.computeMoonPositionInEarthInertialFrame=function(e,t){return d(e)||(e=te.now()),t=Tq(e,t),$.multiplyByVector(Sq,t,t),t};var ab=YB;var Jvt=T(S(),1),z9={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};z9.getMorphTime=function(e){return e===z9.SCENE3D?1:e===z9.MORPHING?void 0:0};var ie=Object.freeze(z9);var $vt=T(S(),1);function bVe(e){e=g(e,g.EMPTY_OBJECT),this.color=B.clone(g(e.color,B.WHITE)),this.intensity=g(e.intensity,2)}var tp=bVe;function lS(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new He,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new On,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new D,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new B,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new D,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(lS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!He.equals(e,this._viewport)){He.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Cq(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Cq(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return OB(this),this._view3D}},viewRotation:{get:function(){return OB(this),this._viewRotation}},viewRotation3D:{get:function(){return OB(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Rq(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Rq(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return RVe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ZVe(this),this._modelView}},modelView3D:{get:function(){return GVe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return vVe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return EVe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return XVe(this),this._inverseModelView3D}},viewProjection:{get:function(){return IVe(this),this._viewProjection}},inverseViewProjection:{get:function(){return WVe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return PVe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return wVe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return FVe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return AVe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return MVe(this),this._normal}},normal3D:{get:function(){return NVe(this),this._normal3D}},inverseNormal:{get:function(){return UVe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return kVe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return Lq(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Lq(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return g(this._ellipsoid,re.WGS84)}}});function yVe(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function gVe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function xVe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function _Ve(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function TVe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=t.positionCartographic;d(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}var zZ=new $,SVe=new he;function CVe(e,t){d(vt.computeIcrfToFixedMatrix(t.time,zZ))||(zZ=vt.computeTemeToPseudoFixedMatrix(t.time,zZ));let n=ab.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(zZ,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=ab.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(zZ,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,SVe);i.project(r,e._sunPositionColumbusView)}lS.prototype.updateCamera=function(e){yVe(this,e.viewMatrix),gVe(this,e.inverseViewMatrix),TVe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ie.SCENE2D&&e.frustum instanceof en};lS.prototype.updateFrustum=function(e){xVe(this,e.projectionMatrix),d(e.infiniteProjectionMatrix)&&_Ve(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;d(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};lS.prototype.updatePass=function(e){this._pass=e};var VVe=[],LVe=new tp;lS.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ie.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),CVe(this,e);let n=g(e.light,LVe);n instanceof tp?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=d(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=g(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=g(e.sphericalHarmonicCoefficients,VVe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,d(this._specularEnvironmentMaps)&&D.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=vt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let c=t.frustum.fov,l=this._viewport,u;d(c)?l.height>l.width?u=Math.tan(.5*c)*2/l.height:u=Math.tan(.5*c)*2/l.width:u=1/Math.max(l.width,l.height),this._geometricToleranceOverMeter=u*e.maximumScreenSpaceError,B.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Cq(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function RVe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ie.SCENE2D&&e._mode!==ie.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function ZVe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function GVe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function EVe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function XVe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function IVe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function WVe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function PVe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function vVe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function wVe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function FVe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function AVe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function MVe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.getRotation(t,t),$.transpose(t,t)}}function NVe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.getRotation(t,t),$.transpose(t,t)}}function UVe(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,F.getMatrix3(e.inverseModelView,e._inverseNormal),$.getRotation(e._inverseNormal,e._inverseNormal))}function kVe(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,F.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),$.getRotation(e._inverseNormal3D,e._inverseNormal3D))}var Vq=new h;function Lq(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Vq),On.fromCartesian(Vq,e._encodedCameraPositionMC))}var DVe=new h,BVe=new h,YVe=new h,OVe=new h,KVe=new he,HVe=new h,zVe=new F;function JVe(e,t,n,i,o,r,s,a){let c=DVe;c.x=e.y,c.y=e.z,c.z=e.x;let l=BVe;l.x=n.y,l.y=n.z,l.z=n.x;let u=YVe;u.x=i.y,u.y=i.z,u.z=i.x;let m=OVe;m.x=t.y,m.y=t.z,m.z=t.x,r===ie.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,KVe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let y=s.ellipsoid,f=y.cartographicToCartesian(p,HVe),x=vt.eastNorthUpToFixedFrame(f,y,zVe);return F.multiplyByPointAsVector(x,l,l),F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,m,m),d(a)||(a=new F),a[0]=l.x,a[1]=u.x,a[2]=-m.x,a[3]=0,a[4]=l.y,a[5]=u.y,a[6]=-m.y,a[7]=0,a[8]=l.z,a[9]=u.z,a[10]=-m.z,a[11]=0,a[12]=-h.dot(l,f),a[13]=-h.dot(u,f),a[14]=h.dot(m,f),a[15]=1,a}function OB(e){e._view3DDirty&&(e._mode===ie.SCENE3D?F.clone(e._view,e._view3D):JVe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Rq(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var JZ=lS;var Wwt=T(S(),1);function QVe(e,t,n,i){let o=d(t.vertexBuffer),r=d(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:g(t.index,n),enabled:g(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:g(t.componentDatatype,Q.FLOAT),normalize:g(t.normalize,!1),offsetInBytes:g(t.offsetInBytes,0),strideInBytes:g(t.strideInBytes,0),instanceDivisor:g(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let l=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(l,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(l),this.instanceDivisor>0&&(i.glVertexAttribDivisor(l,this.instanceDivisor),i._vertexAttribDivisors[l]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Gq(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}d(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function np(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,l=!1,u=i.length;for(r=0;r<u;++r)QVe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let p=s[r];if(d(p.vertexBuffer)&&p.instanceDivisor===0){let y=p.strideInBytes||p.componentsPerAttribute*Q.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/y;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(c=!0),d(s[r].value)&&(l=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),Gq(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=l,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function Zq(e){return e.values.length/e.componentsPerAttribute}function jVe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function qVe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&d(e[n])&&d(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=Zq(e[o[0]]),t=1;t<s;++t){let l=Zq(e[o[t]]);if(l!==r)throw new me(`Each attribute list must have the same number of vertices.  Attribute ${o[t]} has a different number of vertices (${l.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(l,u){return Q.getSizeInBytes(e[u].componentDatatype)-Q.getSizeInBytes(e[l].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=jVe(i);if(a>0){let l=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%l;u!==0&&(a+=l-u);let m=r*a,p=new ArrayBuffer(m),y={};for(t=0;t<s;++t){n=o[t];let f=Q.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:Q.createTypedArray(e[n].componentDatatype,p),index:c[n]/f,strideInComponentType:a/f}}for(t=0;t<r;++t)for(let f=0;f<s;++f){n=o[f],i=e[n];let x=i.values,_=y[n],C=_.pointer,V=i.componentsPerAttribute;for(let L=0;L<V;++L)C[_.index+L]=x[t*V+L];_.index+=_.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}np.fromGeometry=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=g(e.geometry,g.EMPTY_OBJECT),i=g(e.bufferUsage,Ne.DYNAMIC_DRAW),o=g(e.attributeLocations,g.EMPTY_OBJECT),r=g(e.interleave,!1),s=e.vertexArrayAttributes,a,c,l,u=d(s)?s:[],m=n.attributes;if(r){let f=qVe(m);if(d(f)){l=mt.createVertexBuffer({context:t,typedArray:f.buffer,usage:i});let x=f.offsetsInBytes,_=f.vertexSizeInBytes;for(a in m)m.hasOwnProperty(a)&&d(m[a])&&(c=m[a],d(c.values)?u.push({index:o[a],vertexBuffer:l,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:_}):u.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in m)if(m.hasOwnProperty(a)&&d(m[a])){c=m[a];let f=c.componentDatatype;f===Q.DOUBLE&&(f=Q.FLOAT),l=void 0,d(c.values)&&(l=mt.createVertexBuffer({context:t,typedArray:Q.createTypedArray(f,c.values),usage:i})),u.push({index:o[a],vertexBuffer:l,value:c.value,componentDatatype:f,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,y=n.indices;return d(y)&&(dt.computeNumberOfVertices(n)>=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=mt.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=mt.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new np({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(np.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});np.prototype.getAttribute=function(e){return this._attributes[e]};function $Ve(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=kt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let l=c.instanceDivisor,u=c.index;l!==i[u]&&(t.glVertexAttribDivisor(u,l),i[u]=l)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function eLe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&d(r.value)&&r.vertexAttrib(t)}}np.prototype._bind=function(){d(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&$Ve(this),this._hasConstantAttributes&&eLe(this,this._gl)):Gq(this._gl,this._attributes,this._indexBuffer)};np.prototype._unBind=function(){if(d(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;d(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return d(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),d(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var ni=np;function Ol(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=g(t,{});o.alpha=g(o.alpha,!1),o.stencil=g(o.stencil,!0),o.powerPreference=g(o.powerPreference,"high-performance");let s=d(n)?n(e,o):tLe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Yn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new YZ(this),this._textureCache=new OZ;let l=s;this._stencilBits=l.getParameter(l.STENCIL_BITS),kt._maximumCombinedTextureImageUnits=l.getParameter(l.MAX_COMBINED_TEXTURE_IMAGE_UNITS),kt._maximumCubeMapSize=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),kt._maximumFragmentUniformVectors=l.getParameter(l.MAX_FRAGMENT_UNIFORM_VECTORS),kt._maximumTextureImageUnits=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),kt._maximumRenderbufferSize=l.getParameter(l.MAX_RENDERBUFFER_SIZE),kt._maximumTextureSize=l.getParameter(l.MAX_TEXTURE_SIZE),kt._maximumVaryingVectors=l.getParameter(l.MAX_VARYING_VECTORS),kt._maximumVertexAttributes=l.getParameter(l.MAX_VERTEX_ATTRIBS),kt._maximumVertexTextureImageUnits=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),kt._maximumVertexUniformVectors=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),kt._maximumSamples=this._webgl2?l.getParameter(l.MAX_SAMPLES):0;let u=l.getParameter(l.ALIASED_LINE_WIDTH_RANGE);kt._minimumAliasedLineWidth=u[0],kt._maximumAliasedLineWidth=u[1];let m=l.getParameter(l.ALIASED_POINT_SIZE_RANGE);kt._minimumAliasedPointSize=m[0],kt._maximumAliasedPointSize=m[1];let p=l.getParameter(l.MAX_VIEWPORT_DIMS);kt._maximumViewportWidth=p[0],kt._maximumViewportHeight=p[1];let y=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT);kt._highpFloatSupported=y.precision!==0;let f=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_INT);kt._highpIntSupported=f.rangeMax!==0,this._antialias=l.getContextAttributes().antialias,this._standardDerivatives=!!gr(l,["OES_standard_derivatives"]),this._blendMinmax=!!gr(l,["EXT_blend_minmax"]),this._elementIndexUint=!!gr(l,["OES_element_index_uint"]),this._depthTexture=!!gr(l,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!gr(l,["EXT_frag_depth"]),this._debugShaders=gr(l,["WEBGL_debug_shaders"]),this._textureFloat=!!gr(l,["OES_texture_float"]),this._textureHalfFloat=!!gr(l,["OES_texture_half_float"]),this._textureFloatLinear=!!gr(l,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!gr(l,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!gr(l,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!gr(l,["EXT_float_blend"]),this._colorBufferHalfFloat=!!gr(l,["EXT_color_buffer_half_float"]),this._s3tc=!!gr(l,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!gr(l,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!gr(l,["WEBGL_compressed_texture_astc"]),this._etc=!!gr(l,["WEBG_compressed_texture_etc"]),this._etc1=!!gr(l,["WEBGL_compressed_texture_etc1"]),this._bc7=!!gr(l,["EXT_texture_compression_bptc"]),rl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?gr(l,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,kt._maximumTextureFilterAnisotropy=d(x)?l.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,Z,G,X,P,v,A;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(I){E._gl.bindVertexArray(I)},V=function(I){E._gl.deleteVertexArray(I)},L=function(I,w,N,Y,k){l.drawElementsInstanced(I,w,N,Y,k)},Z=function(I,w,N,Y){l.drawArraysInstanced(I,w,N,Y)},G=function(I,w){l.vertexAttribDivisor(I,w)},X=function(I){l.drawBuffers(I)}}else P=gr(l,["OES_vertex_array_object"]),d(P)&&(_=function(){return P.createVertexArrayOES()},C=function(E){P.bindVertexArrayOES(E)},V=function(E){P.deleteVertexArrayOES(E)}),v=gr(l,["ANGLE_instanced_arrays"]),d(v)&&(L=function(E,I,w,N,Y){v.drawElementsInstancedANGLE(E,I,w,N,Y)},Z=function(E,I,w,N){v.drawArraysInstancedANGLE(E,I,w,N)},G=function(E,I){v.vertexAttribDivisorANGLE(E,I)}),A=gr(l,["WEBGL_draw_buffers"]),d(A)&&(X=function(E){A.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=Z,this.glVertexAttribDivisor=G,this.glDrawBuffers=X,this._vertexArrayObject=!!P,this._instancedArrays=!!v,this._drawBuffers=!!A,kt._maximumDrawBuffers=this.drawBuffers?l.getParameter(ne.MAX_DRAW_BUFFERS):1,kt._maximumColorAttachments=this.drawBuffers?l.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new B(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let M=new JZ,b=new Na(this),R=De.fromCache();this._defaultPassState=b,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=M,this._currentRenderState=R,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E<kt._maximumVertexAttributes;E++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},De.apply(l,R,b)}function tLe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new me("The browser does not support WebGL.  Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!d(r))throw new me("The browser supports WebGL, but initialization failed.");return r}function nLe(e,t){let n="WebGL Error:  ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function iLe(e,t,n,i){let o=`${nLe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function oLe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new me(iLe(e,t,n,i))}function rLe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function sLe(e,t){if(!d(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,rLe(e,o,t))}return i}function gr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var aLe={};Object.defineProperties(Ol.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=sLe(this._originalGLContext,e?oLe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Wt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Wt({context:this,pixelFormat:st.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Wt({context:this,pixelFormat:st.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Ma({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return aLe}}});function Eq(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,De.partialApply(e._gl,o,t,r,n,i)}var KB;typeof WebGLRenderingContext<"u"&&(KB=[ne.BACK]);function HB(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=KB;if(d(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var cLe=new ti;Ol.prototype.clear=function(e,t){e=g(e,cLe),t=g(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;d(o)&&(B.equals(this._clearColor,o)||(B.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),d(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),d(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=g(e.renderState,this._defaultRenderState);Eq(this,a,t,!0);let c=g(e.framebuffer,t.framebuffer);HB(this,c),n.clear(i)};function lLe(e,t,n,i,o){HB(e,t),Eq(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function dLe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=g(t._modelMatrix,F.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let l=r.indexBuffer;d(l)?(s=s*l.bytesPerIndex,d(a)?a=Math.min(a,l.numberOfIndices):a=l.numberOfIndices,c===0?e._gl.drawElements(o,a,l.indexDatatype,s):e.glDrawElementsInstanced(o,a,l.indexDatatype,s,c)):(d(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Ol.prototype.draw=function(e,t,n,i){t=g(t,this._defaultPassState);let o=g(e._framebuffer,t.framebuffer),r=g(e._renderState,this._defaultRenderState);n=g(n,e._shaderProgram),i=g(i,e._uniformMap),lLe(this,o,t,n,r),dLe(this,e,n,i)};Ol.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=KB;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Ol.prototype.readPixels=function(e){let t=this._gl;e=g(e,g.EMPTY_OBJECT);let n=Math.max(g(e.x,0),0),i=Math.max(g(e.y,0),0),o=g(e.width,t.drawingBufferWidth),r=g(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Je.UNSIGNED_BYTE;d(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=st.createTypedArray(st.RGBA,a,o,r);return HB(this,s),t.readPixels(n,i,o,r,st.RGBA,Je.toWebGLConstant(a,this),c),c};var Xq={position:0,textureCoordinates:1};Ol.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!d(e)){let t=new dt({attributes:{position:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Fe.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:Xq,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Ol.prototype.createViewportQuadCommand=function(e,t){return t=g(t,g.EMPTY_OBJECT),new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Fe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:Sg,fragmentShaderSource:e,attributeLocations:Xq}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Ol.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function zB(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(zB.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});zB.prototype.destroy=function(){delete this._pickObjects[this.key]};Ol.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new me("Out of unique Pick IDs.");return this._pickObjects[t]=e,new zB(this._pickObjects,t,B.fromRgba(t))};Ol.prototype.isDestroyed=function(){return!1};Ol.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];d(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Ol._deprecationWarning=zr;var QZ=Ol;var NFt=T(S(),1);var yFt=T(S(),1);function dS(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let o=e.colorRenderbuffers,r=e.colorTextures;if(d(o)!==d(r))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(d(s)!==d(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Us({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new Us({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}dS.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};dS.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};dS.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),d(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};dS.prototype.isDestroyed=function(){return!1};dS.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var jZ=dS;var ZFt=T(S(),1);var _Ft=T(S(),1);var al={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===al.RGBA4||e===al.RGBA8||e===al.RGBA16F||e===al.RGBA32F||e===al.RGB5_A1||e===al.RGB565||e===al.DEPTH_COMPONENT16||e===al.STENCIL_INDEX8||e===al.DEPTH_STENCIL||e===al.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?al.RGBA32F:e===ne.HALF_FLOAT_OES?al.RGBA16F:al.RGBA8}},xc=Object.freeze(al);function qZ(e){e=g(e,g.EMPTY_OBJECT);let n=e.context._gl,i=kt.maximumRenderbufferSize,o=g(e.format,xc.RGBA4),r=d(e.width)?e.width:n.drawingBufferWidth,s=d(e.height)?e.height:n.drawingBufferHeight,a=g(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(qZ.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});qZ.prototype._getRenderbuffer=function(){return this._renderbuffer};qZ.prototype.isDestroyed=function(){return!1};qZ.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Kl=qZ;function os(e){e=g(e,g.EMPTY_OBJECT),this._numSamples=g(e.numSamples,1),this._colorAttachmentsLength=g(e.colorAttachmentsLength,1),this._color=g(e.color,!0),this._depth=g(e.depth,!1),this._depthStencil=g(e.depthStencil,!1),this._supportsDepthTexture=g(e.supportsDepthTexture,!1),this._createColorAttachments=g(e.createColorAttachments,!0),this._createDepthAttachments=g(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(os.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});os.prototype.isDirty=function(e,t,n,i,o){n=g(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=d(i)&&this._pixelDatatype!==i||d(o)&&this._pixelFormat!==o,c=n===1?d(this._framebuffer):d(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!d(this._colorTextures[0])};os.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?g(i,1):1,o=g(o,this._color?g(this._pixelDatatype,Je.UNSIGNED_BYTE):void 0),r=g(r,this._color?g(this._pixelFormat,st.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Wt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:dn.NEAREST}),this._numSamples>1){let a=xc.getColorFormat(o);this._colorRenderbuffers[s]=new Kl({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Wt({context:e,width:t,height:n,pixelFormat:st.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:dn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Kl({context:e,width:t,height:n,format:xc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Kl({context:e,width:t,height:n,format:xc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Wt({context:e,width:t,height:n,pixelFormat:st.DEPTH_COMPONENT,pixelDatatype:Je.UNSIGNED_INT,sampler:dn.NEAREST}):this._depthRenderbuffer=new Kl({context:e,width:t,height:n,format:xc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new jZ({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Us({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};os.prototype.getColorTexture=function(e){return e=g(e,0),this._colorTextures[e]};os.prototype.setColorTexture=function(e,t){t=g(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};os.prototype.getColorRenderbuffer=function(e){return e=g(e,0),this._colorRenderbuffers[e]};os.prototype.setColorRenderbuffer=function(e,t){t=g(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};os.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};os.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};os.prototype.getDepthTexture=function(){return this._depthTexture};os.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};os.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};os.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};os.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};os.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};os.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};os.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};os.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};os.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&d(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),d(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&d(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),d(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),d(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),d(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),d(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),d(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var mi=os;var tAt=T(S(),1);var kFt=T(S(),1);var Fg={VERTEX:0,FRAGMENT:1,BOTH:2};Fg.includesVertexShader=function(e){return e===Fg.VERTEX||e===Fg.BOTH};Fg.includesFragmentShader=function(e){return e===Fg.FRAGMENT||e===Fg.BOTH};var Le=Object.freeze(Fg);var BFt=T(S(),1);function JB(e){this.name=e,this.fields=[]}JB.prototype.addField=function(e,t){let n=`    ${e} ${t};`;this.fields.push(n)};JB.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=["    float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var $Z=JB;var OFt=T(S(),1);function QB(e){this.signature=e,this.body=[]}QB.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(`    ${e[i]}`)}else t.push(`    ${e}`)};QB.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var eG=QB;function _c(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(_c.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});_c.prototype.addDefine=function(e,t,n){n=g(n,Le.BOTH);let i=e;d(t)&&(i+=` ${t.toString()}`),Le.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),Le.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};_c.prototype.addStruct=function(e,t,n){this._structs[e]=new $Z(t),Le.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),Le.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};_c.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};_c.prototype.addFunction=function(e,t,n){this._functions[e]=new eG(t),Le.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),Le.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};_c.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};_c.prototype.addUniform=function(e,t,n){n=g(n,Le.BOTH);let i=`uniform ${e} ${t};`;Le.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),Le.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};_c.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};_c.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=mLe(e),i};_c.prototype.addVarying=function(e,t){let n=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`out ${n}`),this._fragmentShaderParts.varyingLines.push(`in ${n}`)};_c.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};_c.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};_c.prototype.buildShaderProgram=function(e){let t=d(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=uLe(this),i=hLe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new Be({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new Be({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};_c.prototype.clone=function(){return Oe(this,!0)};function uLe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function mLe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function hLe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var Ag=_c;var uAt=T(S(),1);function Ts(e,t,n,i){let o=Ts._verifyAttributes(t);n=g(n,0);let r=[],s={},a,c,l=o.length;for(let m=0;m<l;++m){let p=o[m];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],d(a)||(a=s[c]=[]),a.push(p)}function u(m,p){return Q.getSizeInBytes(p.componentDatatype)-Q.getSizeInBytes(m.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let m=Ts._vertexSizeInBytes(a),p=a[0].usage,y={vertexSizeInBytes:m,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ts._createArrayViews(a,m)};this._allBuffers.push(y)}this._size=0,this._instanced=g(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ts._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:g(o.index,i),enabled:g(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:g(o.componentDatatype,Q.FLOAT),normalize:g(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:g(o.usage,Ne.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Ts._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Q.getSizeInBytes(a.componentDatatype)}let i=n>0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ts._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Q.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Q.getSizeInBytes(a)}return n};Ts.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Ts._resize(o,this._size),Ts._appendWriters(this.writers,o)}jB(this)};Ts._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(d(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=Q.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var fLe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Ts._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=fLe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ts.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=pLe(this,i)||t;if(t||!d(this.va)){jB(this);let s=this.va=[],a=W.SIXTY_FOUR_KILOBYTES-4,c=d(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let l=0;l<c;++l){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let m=l*(i.vertexSizeInBytes*a);Ts._appendAttributes(u,i,m,this._instanced)}u=u.concat(this._precreated),s.push({va:new ni({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(l!==c-1?a:this._size%a)})}}};function pLe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=d(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=mt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ts._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ts.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)bLe(n[i],e,t)};function bLe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ts.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function jB(e){let t=e.va;if(!d(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ts.prototype.isDestroyed=function(){return!1};Ts.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return jB(this),ue(this)};var ip=Ts;var pAt=T(S(),1);function yLe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ee.createIfNeeded(t.positiveX).fetchImage(i),Ee.createIfNeeded(t.negativeX).fetchImage(i),Ee.createIfNeeded(t.positiveY).fetchImage(i),Ee.createIfNeeded(t.negativeY).fetchImage(i),Ee.createIfNeeded(t.positiveZ).fetchImage(i),Ee.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Ma({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var tG=yLe;var XAt=T(S(),1);var VAt=T(S(),1);var xAt=T(S(),1);function cb(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new ye,this.setValue(e)}Object.defineProperties(cb.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});cb.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};cb.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=d(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};cb.prototype.equals=function(e){return this===e||e instanceof cb&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};cb.prototype.valueOf=function(){return this._value};cb.prototype.toString=function(){return String(this._value)};var qn=cb;function gLe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];d(a)&&(a(),this[n]=void 0),r!==void 0&&(!d(r)||!d(r.getValue))&&d(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),d(r)&&d(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function xLe(e){return new qn(e)}function _Le(e,t,n){return gLe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,g(t,!1),g(n,xLe))}var le=_Le;function nG(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(nG.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});nG.prototype.clone=function(e){return d(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new nG(this)};nG.prototype.merge=function(e){this.show=g(this._show,e.show),this.image=g(this._image,e.image),this.scale=g(this._scale,e.scale),this.pixelOffset=g(this._pixelOffset,e.pixelOffset),this.eyeOffset=g(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this._verticalOrigin,e.verticalOrigin),this.heightReference=g(this._heightReference,e.heightReference),this.color=g(this._color,e.color),this.rotation=g(this._rotation,e.rotation),this.alignedAxis=g(this._alignedAxis,e.alignedAxis),this.sizeInMeters=g(this._sizeInMeters,e.sizeInMeters),this.width=g(this._width,e.width),this.height=g(this._height,e.height),this.scaleByDistance=g(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=g(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=g(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this._disableDepthTestDistance,e.disableDepthTestDistance)};var Ua=nG;var b9t=T(S(),1);var PAt=T(S(),1);function Mg(){this._array=[],this._hash={}}Object.defineProperties(Mg.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Mg.prototype.contains=function(e){return d(this._hash[e])};Mg.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Mg.prototype.get=function(e){return this._hash[e]};Mg.prototype.remove=function(e){let t=this._hash[e],n=d(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Mg.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Tt=Mg;var AAt=T(S(),1);function Hl(e,t){e=g(e,0),this._near=e,t=g(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Hl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Hl.packedLength=2;Hl.pack=function(e,t,n){return n=g(n,0),t[n++]=e.near,t[n]=e.far,t};Hl.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new Hl),n.near=e[t++],n.far=e[t],n};Hl.equals=function(e,t){return e===t||d(e)&&d(t)&&e.near===t.near&&e.far===t.far};Hl.clone=function(e,t){if(d(e))return d(t)||(t=new Hl),t.near=e.near,t.far=e.far,t};Hl.prototype.clone=function(e){return Hl.clone(this,e)};Hl.prototype.equals=function(e){return Hl.equals(this,e)};var Gt=Hl;var kAt=T(S(),1);function Qd(e,t,n,i){this.near=g(e,0),this.nearValue=g(t,0),this.far=g(n,1),this.farValue=g(i,0)}Qd.clone=function(e,t){if(d(e))return d(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Qd(e.near,e.nearValue,e.far,e.farValue)};Qd.packedLength=4;Qd.pack=function(e,t,n){return n=g(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Qd.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new Qd),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Qd.equals=function(e,t){return e===t||d(e)&&d(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Qd.prototype.clone=function(e){return Qd.clone(this,e)};Qd.prototype.equals=function(e){return Qd.equals(this,e)};var Pt=Qd;var BAt=T(S(),1),TLe={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},Ke=Object.freeze(TLe);var OAt=T(S(),1),SLe={CENTER:0,LEFT:1,RIGHT:-1},bi=Object.freeze(SLe);var HAt=T(S(),1),CLe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},In=Object.freeze(CLe);var JAt=T(S(),1),VLe={DONE:0,PENDING:1,FAILED:2},lt=Object.freeze(VLe);var e9t=T(S(),1);function rm(){fe.throwInstantiationError()}Object.defineProperties(rm.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});rm.prototype.getValue=fe.throwInstantiationError;rm.prototype.equals=fe.throwInstantiationError;rm.equals=function(e,t){return e===t||d(e)&&e.equals(t)};rm.arrayEquals=function(e,t){if(e===t)return!0;if(!d(e)||!d(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!rm.equals(e[i],t[i]))return!1;return!0};rm.isConstant=function(e){return!d(e)||e.isConstant};rm.getValueOrUndefined=function(e,t,n){return d(e)?e.getValue(t,n):void 0};rm.getValueOrDefault=function(e,t,n,i){return d(e)?g(e.getValue(t,i),n):n};rm.getValueOrClonedDefault=function(e,t,n,i){let o;return d(e)&&(o=e.getValue(t,i)),d(o)||(o=n.clone(o)),o};var H=rm;var LLe=B.WHITE,RLe=h.ZERO,ZLe=Ke.NONE,GLe=D.ZERO,ELe=1,XLe=0,ILe=h.ZERO,WLe=bi.CENTER,PLe=In.CENTER,vLe=!1,wLe=new h,FLe=new B,ALe=new h,MLe=new D,NLe=new Pt,ULe=new Pt,kLe=new Pt,DLe=new He,BLe=new Gt;function Iq(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function lb(e,t){t.collectionChanged.addEventListener(lb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}lb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,l=r.billboard,u=s.isShowing&&s.isAvailable(e)&&H.getValueOrDefault(a._show,e,!0),m;if(u&&(m=H.getValueOrUndefined(s._position,e,wLe),c=H.getValueOrUndefined(a._image,e),u=d(m)&&d(c)),!u){qB(r,s,n);continue}H.isConstant(s._position)||(n._clusterDirty=!0),d(l)||(l=n.getBillboard(s),l.id=s,l.image=void 0,r.billboard=l),l.show=u,(!d(l.image)||r.textureValue!==c)&&(l.image=c,r.textureValue=c),l.position=m,l.color=H.getValueOrDefault(a._color,e,LLe,FLe),l.eyeOffset=H.getValueOrDefault(a._eyeOffset,e,RLe,ALe),l.heightReference=H.getValueOrDefault(a._heightReference,e,ZLe),l.pixelOffset=H.getValueOrDefault(a._pixelOffset,e,GLe,MLe),l.scale=H.getValueOrDefault(a._scale,e,ELe),l.rotation=H.getValueOrDefault(a._rotation,e,XLe),l.alignedAxis=H.getValueOrDefault(a._alignedAxis,e,ILe),l.horizontalOrigin=H.getValueOrDefault(a._horizontalOrigin,e,WLe),l.verticalOrigin=H.getValueOrDefault(a._verticalOrigin,e,PLe),l.width=H.getValueOrUndefined(a._width,e),l.height=H.getValueOrUndefined(a._height,e),l.scaleByDistance=H.getValueOrUndefined(a._scaleByDistance,e,NLe),l.translucencyByDistance=H.getValueOrUndefined(a._translucencyByDistance,e,ULe),l.pixelOffsetScaleByDistance=H.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,kLe),l.sizeInMeters=H.getValueOrDefault(a._sizeInMeters,e,vLe),l.distanceDisplayCondition=H.getValueOrUndefined(a._distanceDisplayCondition,e,BLe),l.disableDepthTestDistance=H.getValueOrUndefined(a._disableDepthTestDistance,e);let p=H.getValueOrUndefined(a._imageSubRegion,e,DLe);d(p)&&l.setImageSubRegion(l._imageId,p)}return!0};lb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!d(n)||!d(n.billboard))return lt.FAILED;let i=n.billboard;if(i.heightReference===Ke.NONE)t.center=h.clone(i.position,t.center);else{if(!d(i._clampedPosition))return lt.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};lb.prototype.isDestroyed=function(){return!1};lb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(lb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};lb.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],d(r._billboard)&&d(r._position)&&s.set(r.id,new Iq(r));for(o=i.length-1;o>-1;o--)r=i[o],d(r._billboard)&&d(r._position)?s.contains(r.id)||s.set(r.id,new Iq(r)):(qB(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],qB(s.get(r.id),r,a),s.remove(r.id)};function qB(e,t,n){d(e)&&(e.billboard=void 0,n.removeBillboard(t))}var iG=lb;var Kjt=T(S(),1);var tMt=T(S(),1);var P9t=T(S(),1);var x9t=T(S(),1);function YLe(e,t){this.start=g(e,0),this.stop=g(t,0)}var Tc=YLe;function pn(e,t){this.center=h.clone(g(e,h.ZERO)),this.radius=g(t,0)}var t3=new h,n3=new h,i3=new h,o3=new h,r3=new h,s3=new h,a3=new h,ks=new h,c3=new h,l3=new h,d3=new h,u3=new h,OLe=4/3*W.PI;pn.fromPoints=function(e,t){if(d(t)||(t=new pn),!d(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],a3),i=h.clone(n,t3),o=h.clone(n,n3),r=h.clone(n,i3),s=h.clone(n,o3),a=h.clone(n,r3),c=h.clone(n,s3),l=e.length,u;for(u=1;u<l;u++){h.clone(e[u],n);let v=n.x,A=n.y,M=n.z;v<i.x&&h.clone(n,i),v>s.x&&h.clone(n,s),A<o.y&&h.clone(n,o),A>a.y&&h.clone(n,a),M<r.z&&h.clone(n,r),M>c.z&&h.clone(n,c)}let m=h.magnitudeSquared(h.subtract(s,i,ks)),p=h.magnitudeSquared(h.subtract(a,o,ks)),y=h.magnitudeSquared(h.subtract(c,r,ks)),f=i,x=s,_=m;p>_&&(_=p,f=o,x=a),y>_&&(_=y,f=r,x=c);let C=c3;C.x=(f.x+x.x)*.5,C.y=(f.y+x.y)*.5,C.z=(f.z+x.z)*.5;let V=h.magnitudeSquared(h.subtract(x,C,ks)),L=Math.sqrt(V),Z=l3;Z.x=i.x,Z.y=o.y,Z.z=r.z;let G=d3;G.x=s.x,G.y=a.y,G.z=c.z;let X=h.midpoint(Z,G,u3),P=0;for(u=0;u<l;u++){h.clone(e[u],n);let v=h.magnitude(h.subtract(n,X,ks));v>P&&(P=v);let A=h.magnitudeSquared(h.subtract(n,C,ks));if(A>V){let M=Math.sqrt(A);L=(L+M)*.5,V=L*L;let b=M-L;C.x=(L*C.x+b*n.x)/M,C.y=(L*C.y+b*n.y)/M,C.z=(L*C.z+b*n.z)/M}}return L<P?(h.clone(C,t.center),t.radius=L):(h.clone(X,t.center),t.radius=P),t};var KLe=new Zi,HLe=new h,zLe=new h,$B=new he,e3=new he;pn.fromRectangle2D=function(e,t,n){return pn.fromRectangleWithHeights2D(e,t,0,0,n)};pn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(d(o)||(o=new pn),!d(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;t=g(t,KLe),de.southwest(e,$B),$B.height=n,de.northeast(e,e3),e3.height=i;let r=t.project($B,HLe),s=t.project(e3,zLe),a=s.x-r.x,c=s.y-r.y,l=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+l*l)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+c*.5,u.z=r.z+l*.5,o};var JLe=[];pn.fromRectangle3D=function(e,t,n,i){if(t=g(t,re.WGS84),n=g(n,0),d(i)||(i=new pn),!d(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=de.subsample(e,t,n,JLe);return pn.fromPoints(o,i)};pn.fromVertices=function(e,t,n,i){if(d(i)||(i=new pn),!d(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=g(t,h.ZERO),n=g(n,3);let o=a3;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,t3),s=h.clone(o,n3),a=h.clone(o,i3),c=h.clone(o,o3),l=h.clone(o,r3),u=h.clone(o,s3),m=e.length,p;for(p=0;p<m;p+=n){let M=e[p]+t.x,b=e[p+1]+t.y,R=e[p+2]+t.z;o.x=M,o.y=b,o.z=R,M<r.x&&h.clone(o,r),M>c.x&&h.clone(o,c),b<s.y&&h.clone(o,s),b>l.y&&h.clone(o,l),R<a.z&&h.clone(o,a),R>u.z&&h.clone(o,u)}let y=h.magnitudeSquared(h.subtract(c,r,ks)),f=h.magnitudeSquared(h.subtract(l,s,ks)),x=h.magnitudeSquared(h.subtract(u,a,ks)),_=r,C=c,V=y;f>V&&(V=f,_=s,C=l),x>V&&(V=x,_=a,C=u);let L=c3;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let Z=h.magnitudeSquared(h.subtract(C,L,ks)),G=Math.sqrt(Z),X=l3;X.x=r.x,X.y=s.y,X.z=a.z;let P=d3;P.x=c.x,P.y=l.y,P.z=u.z;let v=h.midpoint(X,P,u3),A=0;for(p=0;p<m;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let M=h.magnitude(h.subtract(o,v,ks));M>A&&(A=M);let b=h.magnitudeSquared(h.subtract(o,L,ks));if(b>Z){let R=Math.sqrt(b);G=(G+R)*.5,Z=G*G;let E=R-G;L.x=(G*L.x+E*o.x)/R,L.y=(G*L.y+E*o.y)/R,L.z=(G*L.z+E*o.z)/R}}return G<A?(h.clone(L,i.center),i.radius=G):(h.clone(v,i.center),i.radius=A),i};pn.fromEncodedCartesianVertices=function(e,t,n){if(d(n)||(n=new pn),!d(e)||!d(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=a3;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,t3),r=h.clone(i,n3),s=h.clone(i,i3),a=h.clone(i,o3),c=h.clone(i,r3),l=h.clone(i,s3),u=e.length,m;for(m=0;m<u;m+=3){let A=e[m]+t[m],M=e[m+1]+t[m+1],b=e[m+2]+t[m+2];i.x=A,i.y=M,i.z=b,A<o.x&&h.clone(i,o),A>a.x&&h.clone(i,a),M<r.y&&h.clone(i,r),M>c.y&&h.clone(i,c),b<s.z&&h.clone(i,s),b>l.z&&h.clone(i,l)}let p=h.magnitudeSquared(h.subtract(a,o,ks)),y=h.magnitudeSquared(h.subtract(c,r,ks)),f=h.magnitudeSquared(h.subtract(l,s,ks)),x=o,_=a,C=p;y>C&&(C=y,x=r,_=c),f>C&&(C=f,x=s,_=l);let V=c3;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=h.magnitudeSquared(h.subtract(_,V,ks)),Z=Math.sqrt(L),G=l3;G.x=o.x,G.y=r.y,G.z=s.z;let X=d3;X.x=a.x,X.y=c.y,X.z=l.z;let P=h.midpoint(G,X,u3),v=0;for(m=0;m<u;m+=3){i.x=e[m]+t[m],i.y=e[m+1]+t[m+1],i.z=e[m+2]+t[m+2];let A=h.magnitude(h.subtract(i,P,ks));A>v&&(v=A);let M=h.magnitudeSquared(h.subtract(i,V,ks));if(M>L){let b=Math.sqrt(M);Z=(Z+b)*.5,L=Z*Z;let R=b-Z;V.x=(Z*V.x+R*i.x)/b,V.y=(Z*V.y+R*i.y)/b,V.z=(Z*V.z+R*i.z)/b}}return Z<v?(h.clone(V,n.center),n.radius=Z):(h.clone(P,n.center),n.radius=v),n};pn.fromCornerPoints=function(e,t,n){d(n)||(n=new pn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};pn.fromEllipsoid=function(e,t){return d(t)||(t=new pn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var QLe=new h;pn.fromBoundingSpheres=function(e,t){if(d(t)||(t=new pn),!d(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return pn.clone(e[0],t);if(n===2)return pn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=pn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,QLe)+a.radius)}return t.radius=s,t};var jLe=new h,qLe=new h,$Le=new h;pn.fromOrientedBoundingBox=function(e,t){d(t)||(t=new pn);let n=e.halfAxes,i=$.getColumn(n,0,jLe),o=$.getColumn(n,1,qLe),r=$.getColumn(n,2,$Le);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var eRe=new h,tRe=new h;pn.fromTransformation=function(e,t){d(t)||(t=new pn);let n=F.getTranslation(e,eRe),i=F.getScale(e,tRe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};pn.clone=function(e,t){if(d(e))return d(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new pn(e.center,e.radius)};pn.packedLength=4;pn.pack=function(e,t,n){n=g(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};pn.unpack=function(e,t,n){t=g(t,0),d(n)||(n=new pn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var nRe=new h,iRe=new h;pn.union=function(e,t,n){d(n)||(n=new pn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,nRe),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let l=(o+c+s)*.5,u=h.multiplyByScalar(a,(-o+l)/c,iRe);return h.add(u,i,u),h.clone(u,n.center),n.radius=l,n};var oRe=new h;pn.expand=function(e,t,n){n=pn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,oRe));return i>n.radius&&(n.radius=i),n};pn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?qt.OUTSIDE:r<i?qt.INTERSECTING:qt.INSIDE};pn.transform=function(e,t,n){return d(n)||(n=new pn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var rRe=new h;pn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,rRe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};pn.transformWithoutScale=function(e,t,n){return d(n)||(n=new pn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var sRe=new h;pn.computePlaneDistances=function(e,t,n,i){d(i)||(i=new Tc);let o=h.subtract(e.center,t,sRe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Wq=new h,aRe=new h,cRe=new h,lRe=new h,dRe=new h,uRe=new he,Pq=new Array(8);for(let e=0;e<8;++e)Pq[e]=new h;var mRe=new Zi;pn.projectTo2D=function(e,t,n){t=g(t,mRe);let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,Wq):s=i.geodeticSurfaceNormal(o,Wq);let a=h.cross(h.UNIT_Z,s,aRe);h.normalize(a,a);let c=h.cross(s,a,cRe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let l=h.negate(c,dRe),u=h.negate(a,lRe),m=Pq,p=m[0];h.add(s,c,p),h.add(p,a,p),p=m[1],h.add(s,c,p),h.add(p,u,p),p=m[2],h.add(s,l,p),h.add(p,u,p),p=m[3],h.add(s,l,p),h.add(p,a,p),h.negate(s,s),p=m[4],h.add(s,c,p),h.add(p,a,p),p=m[5],h.add(s,c,p),h.add(p,u,p),p=m[6],h.add(s,l,p),h.add(p,u,p),p=m[7],h.add(s,l,p),h.add(p,a,p);let y=m.length;for(let C=0;C<y;++C){let V=m[C];h.add(o,V,V);let L=i.cartesianToCartographic(V,uRe);t.project(L,V)}n=pn.fromPoints(m,n),o=n.center;let f=o.x,x=o.y,_=o.z;return o.x=_,o.y=f,o.z=x,n};pn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};pn.equals=function(e,t){return e===t||d(e)&&d(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};pn.prototype.intersectPlane=function(e){return pn.intersectPlane(this,e)};pn.prototype.distanceSquaredTo=function(e){return pn.distanceSquaredTo(this,e)};pn.prototype.computePlaneDistances=function(e,t,n){return pn.computePlaneDistances(this,e,t,n)};pn.prototype.isOccluded=function(e){return pn.isOccluded(this,e)};pn.prototype.equals=function(e){return pn.equals(this,e)};pn.prototype.clone=function(e){return pn.clone(this,e)};pn.prototype.volume=function(){let e=this.radius;return OLe*e*e*e};var ce=pn;var F9t=T(S(),1);function hRe(e){e=g(e,g.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var hn=hRe;var M9t=T(S(),1),fRe={NONE:0,TOP:1,ALL:2},rn=Object.freeze(fRe);var D9t=T(S(),1);function jr(e){e=g(e,g.EMPTY_OBJECT),this.position=g(e.position,!1),this.normal=g(e.normal,!1),this.st=g(e.st,!1),this.bitangent=g(e.bitangent,!1),this.tangent=g(e.tangent,!1),this.color=g(e.color,!1)}jr.POSITION_ONLY=Object.freeze(new jr({position:!0}));jr.POSITION_AND_NORMAL=Object.freeze(new jr({position:!0,normal:!0}));jr.POSITION_NORMAL_AND_ST=Object.freeze(new jr({position:!0,normal:!0,st:!0}));jr.POSITION_AND_ST=Object.freeze(new jr({position:!0,st:!0}));jr.POSITION_AND_COLOR=Object.freeze(new jr({position:!0,color:!0}));jr.ALL=Object.freeze(new jr({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));jr.DEFAULT=jr.POSITION_NORMAL_AND_ST;jr.packedLength=6;jr.pack=function(e,t,n){return n=g(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};jr.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new jr),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};jr.clone=function(e,t){if(d(e))return d(t)||(t=new jr),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var We=jr;var pRe=new h;function zl(e){e=g(e,g.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=g(e.vertexFormat,We.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}zl.fromDimensions=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new zl({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};zl.fromAxisAlignedBoundingBox=function(e){return new zl({minimum:e.minimum,maximum:e.maximum})};zl.packedLength=2*h.packedLength+We.packedLength+1;zl.pack=function(e,t,n){return n=g(n,0),h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),We.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+We.packedLength]=g(e._offsetAttribute,-1),t};var wq=new h,Fq=new h,Aq=new We,vq={minimum:wq,maximum:Fq,vertexFormat:Aq,offsetAttribute:void 0};zl.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,wq),o=h.unpack(e,t+h.packedLength,Fq),r=We.unpack(e,t+2*h.packedLength,Aq),s=e[t+2*h.packedLength+We.packedLength];return d(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=We.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(vq.offsetAttribute=s===-1?void 0:s,new zl(vq))};zl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new hn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let l=new Float32Array(72);l[0]=0,l[1]=0,l[2]=1,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=1,l[9]=0,l[10]=0,l[11]=1,l[12]=0,l[13]=0,l[14]=-1,l[15]=0,l[16]=0,l[17]=-1,l[18]=0,l[19]=0,l[20]=-1,l[21]=0,l[22]=0,l[23]=-1,l[24]=1,l[25]=0,l[26]=0,l[27]=1,l[28]=0,l[29]=0,l[30]=1,l[31]=0,l[32]=0,l[33]=1,l[34]=0,l[35]=0,l[36]=-1,l[37]=0,l[38]=0,l[39]=-1,l[40]=0,l[41]=0,l[42]=-1,l[43]=0,l[44]=0,l[45]=-1,l[46]=0,l[47]=0,l[48]=0,l[49]=1,l[50]=0,l[51]=0,l[52]=1,l[53]=0,l[54]=0,l[55]=1,l[56]=0,l[57]=0,l[58]=1,l[59]=0,l[60]=0,l[61]=-1,l[62]=0,l[63]=0,l[64]=-1,l[65]=0,l[66]=0,l[67]=-1,l[68]=0,l[69]=0,l[70]=-1,l[71]=0,o.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:l})}if(i.st){let l=new Float32Array(48);l[0]=0,l[1]=0,l[2]=1,l[3]=0,l[4]=1,l[5]=1,l[6]=0,l[7]=1,l[8]=1,l[9]=0,l[10]=0,l[11]=0,l[12]=0,l[13]=1,l[14]=1,l[15]=1,l[16]=0,l[17]=0,l[18]=1,l[19]=0,l[20]=1,l[21]=1,l[22]=0,l[23]=1,l[24]=1,l[25]=0,l[26]=0,l[27]=0,l[28]=0,l[29]=1,l[30]=1,l[31]=1,l[32]=1,l[33]=0,l[34]=0,l[35]=0,l[36]=0,l[37]=1,l[38]=1,l[39]=1,l[40]=0,l[41]=0,l[42]=1,l[43]=0,l[44]=1,l[45]=1,l[46]=0,l[47]=1,o.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:l})}if(i.tangent){let l=new Float32Array(72);l[0]=1,l[1]=0,l[2]=0,l[3]=1,l[4]=0,l[5]=0,l[6]=1,l[7]=0,l[8]=0,l[9]=1,l[10]=0,l[11]=0,l[12]=-1,l[13]=0,l[14]=0,l[15]=-1,l[16]=0,l[17]=0,l[18]=-1,l[19]=0,l[20]=0,l[21]=-1,l[22]=0,l[23]=0,l[24]=0,l[25]=1,l[26]=0,l[27]=0,l[28]=1,l[29]=0,l[30]=0,l[31]=1,l[32]=0,l[33]=0,l[34]=1,l[35]=0,l[36]=0,l[37]=-1,l[38]=0,l[39]=0,l[40]=-1,l[41]=0,l[42]=0,l[43]=-1,l[44]=0,l[45]=0,l[46]=-1,l[47]=0,l[48]=-1,l[49]=0,l[50]=0,l[51]=-1,l[52]=0,l[53]=0,l[54]=-1,l[55]=0,l[56]=0,l[57]=-1,l[58]=0,l[59]=0,l[60]=1,l[61]=0,l[62]=0,l[63]=1,l[64]=0,l[65]=0,l[66]=1,l[67]=0,l[68]=0,l[69]=1,l[70]=0,l[71]=0,o.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:l})}if(i.bitangent){let l=new Float32Array(72);l[0]=0,l[1]=1,l[2]=0,l[3]=0,l[4]=1,l[5]=0,l[6]=0,l[7]=1,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=0,l[13]=1,l[14]=0,l[15]=0,l[16]=1,l[17]=0,l[18]=0,l[19]=1,l[20]=0,l[21]=0,l[22]=1,l[23]=0,l[24]=0,l[25]=0,l[26]=1,l[27]=0,l[28]=0,l[29]=1,l[30]=0,l[31]=0,l[32]=1,l[33]=0,l[34]=0,l[35]=1,l[36]=0,l[37]=0,l[38]=1,l[39]=0,l[40]=0,l[41]=1,l[42]=0,l[43]=0,l[44]=1,l[45]=0,l[46]=0,l[47]=1,l[48]=0,l[49]=0,l[50]=1,l[51]=0,l[52]=0,l[53]=1,l[54]=0,l[55]=0,l[56]=1,l[57]=0,l[58]=0,l[59]=1,l[60]=0,l[61]=0,l[62]=1,l[63]=0,l[64]=0,l[65]=1,l[66]=0,l[67]=0,l[68]=1,l[69]=0,l[70]=0,l[71]=1,o.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:l})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=4+2,r[7]=4+1,r[8]=4+0,r[9]=4+3,r[10]=4+2,r[11]=4+0,r[12]=8+0,r[13]=8+1,r[14]=8+2,r[15]=8+0,r[16]=8+2,r[17]=8+3,r[18]=12+2,r[19]=12+1,r[20]=12+0,r[21]=12+3,r[22]=12+2,r[23]=12+0,r[24]=16+2,r[25]=16+1,r[26]=16+0,r[27]=16+3,r[28]=16+2,r[29]=16+0,r[30]=20+0,r[31]=20+1,r[32]=20+2,r[33]=20+0,r[34]=20+2,r[35]=20+3}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=h.subtract(n,t,pRe),c=h.magnitude(a)*.5;if(d(e._offsetAttribute)){let l=s.length,u=e._offsetAttribute===rn.NONE?0:1,m=new Uint8Array(l/3).fill(u);o.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return new dt({attributes:o,indices:r,primitiveType:Fe.TRIANGLES,boundingSphere:new ce(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var m3;zl.getUnitBox=function(){return d(m3)||(m3=zl.createGeometry(zl.fromDimensions({dimensions:new h(1,1,1),vertexFormat:We.POSITION_ONLY}))),m3};var cl=zl;var hMt=T(S(),1);var bRe=new h;function Fh(e){e=g(e,g.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Fh.fromDimensions=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Fh({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Fh.fromAxisAlignedBoundingBox=function(e){return new Fh({minimum:e.minimum,maximum:e.maximum})};Fh.packedLength=2*h.packedLength+1;Fh.pack=function(e,t,n){return n=g(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=g(e._offsetAttribute,-1),t};var Nq=new h,Uq=new h,Mq={minimum:Nq,maximum:Uq,offsetAttribute:void 0};Fh.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Nq),o=h.unpack(e,t+h.packedLength,Uq),r=e[t+h.packedLength*2];return d(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Mq.offsetAttribute=r===-1?void 0:r,new Fh(Mq))};Fh.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new hn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=h.subtract(n,t,bRe),a=h.magnitude(s)*.5;if(d(e._offsetAttribute)){let c=r.length,l=e._offsetAttribute===rn.NONE?0:1,u=new Uint8Array(c/3).fill(l);i.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new dt({attributes:i,indices:o,primitiveType:Fe.LINES,boundingSphere:new ce(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var sm=Fh;var xMt=T(S(),1);function uS(e,t,n,i){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,1),this.value=new Uint8Array([B.floatToByte(e),B.floatToByte(t),B.floatToByte(n),B.floatToByte(i)])}Object.defineProperties(uS.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});uS.fromColor=function(e){return new uS(e.red,e.green,e.blue,e.alpha)};uS.toValue=function(e,t){return d(t)?e.toBytes(t):new Uint8Array(e.toBytes())};uS.equals=function(e,t){return e===t||d(e)&&d(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Ut=uS;var VMt=T(S(),1);function oG(e,t){e=g(e,0),t=g(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(oG.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});oG.fromDistanceDisplayCondition=function(e){return new oG(e.near,e.far)};oG.toValue=function(e,t){return d(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Un=oG;var GMt=T(S(),1);function yRe(e){e=g(e,g.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=g(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var _t=yRe;var MMt=T(S(),1);var vMt=T(S(),1);function Bo(e){e=g(e,g.EMPTY_OBJECT),this.start=d(e.start)?te.clone(e.start):new te,this.stop=d(e.stop)?te.clone(e.stop):new te,this.data=e.data,this.isStartIncluded=g(e.isStartIncluded,!0),this.isStopIncluded=g(e.isStopIncluded,!0)}Object.defineProperties(Bo.prototype,{isEmpty:{get:function(){let e=te.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var mS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Bo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=te.fromIso8601(n[0]),o=te.fromIso8601(n[1]),r=g(e.isStartIncluded,!0),s=g(e.isStopIncluded,!0),a=e.data;return d(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(mS.start=i,mS.stop=o,mS.isStartIncluded=r,mS.isStopIncluded=s,mS.data=a,new Bo(mS))};Bo.toIso8601=function(e,t){return`${te.toIso8601(e.start,t)}/${te.toIso8601(e.stop,t)}`};Bo.clone=function(e,t){if(d(e))return d(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Bo(e)};Bo.equals=function(e,t,n){return e===t||d(e)&&d(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&te.equals(e.start,t.start)&&te.equals(e.stop,t.stop)&&(e.data===t.data||d(n)&&n(e.data,t.data)))};Bo.equalsEpsilon=function(e,t,n,i){return n=g(n,0),e===t||d(e)&&d(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&te.equalsEpsilon(e.start,t.start,n)&&te.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||d(i)&&i(e.data,t.data)))};Bo.intersect=function(e,t,n,i){if(!d(t))return Bo.clone(Bo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=te.greaterThanOrEquals(s,o)&&te.greaterThanOrEquals(r,s),l=!c&&te.lessThanOrEquals(s,o)&&te.lessThanOrEquals(o,a);if(!c&&!l)return Bo.clone(Bo.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,y=t.isStopIncluded,f=te.lessThan(r,a);return d(n)||(n=new Bo),n.start=c?s:o,n.isStartIncluded=u&&p||!te.equals(s,o)&&(c&&p||l&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&y||!te.equals(a,r)&&y,n.data=d(i)?i(e.data,t.data):e.data,n};Bo.contains=function(e,t){if(e.isEmpty)return!1;let n=te.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=te.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Bo.prototype.clone=function(e){return Bo.clone(this,e)};Bo.prototype.equals=function(e,t){return Bo.equals(this,e,t)};Bo.prototype.equalsEpsilon=function(e,t,n){return Bo.equalsEpsilon(this,e,t,n)};Bo.prototype.toString=function(){return Bo.toIso8601(this)};Bo.EMPTY=Object.freeze(new Bo({start:new te,stop:new te,isStartIncluded:!1,isStopIncluded:!1}));var Tn=Bo;var kq=Object.freeze(te.fromIso8601("0000-01-01T00:00:00Z")),Dq=Object.freeze(te.fromIso8601("9999-12-31T24:00:00Z")),gRe=Object.freeze(new Tn({start:kq,stop:Dq})),xRe={MINIMUM_VALUE:kq,MAXIMUM_VALUE:Dq,MAXIMUM_INTERVAL:gRe},Ye=xRe;var BMt=T(S(),1);function rG(e,t,n){e=g(e,0),t=g(t,0),n=g(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(rG.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});rG.fromCartesian3=function(e){return new rG(e.x,e.y,e.z)};rG.toValue=function(e,t){return d(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var zi=rG;var zMt=T(S(),1);function J9(e){e=g(e,!0),this.value=J9.toValue(e)}Object.defineProperties(J9.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});J9.toValue=function(e,t){return d(t)?(t[0]=e,t):new Uint8Array([e])};var gn=J9;var sUt=T(S(),1);var QMt=T(S(),1),sG=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec3 v_tangentEC;
in vec3 v_bitangentEC;
in vec2 v_st;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;
    mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
    materialInput.positionToEyeEC = positionToEyeEC;
    materialInput.st = v_st;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var qMt=T(S(),1),aG=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec3 tangent;
in vec3 bitangent;
in vec2 st;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec3 v_tangentEC;
out vec3 v_bitangentEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_tangentEC = czm_normal * tangent;                       // tangent in eye coordinates
    v_bitangentEC = czm_normal * bitangent;                   // bitangent in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var e5t=T(S(),1),cG=`in vec3 v_positionEC;
in vec3 v_normalEC;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var n5t=T(S(),1),lG=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var o5t=T(S(),1),dG=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec2 v_st;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    materialInput.st = v_st;
    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var s5t=T(S(),1),uG=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec2 st;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var Z5t=T(S(),1);var b5t=T(S(),1);var l5t=T(S(),1);var _Re={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},ma=Object.freeze(_Re);var m5t=T(S(),1);var TRe={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},_o=Object.freeze(TRe);var SRe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ma.ADD,equationAlpha:ma.ADD,functionSourceRgb:_o.SOURCE_ALPHA,functionSourceAlpha:_o.ONE,functionDestinationRgb:_o.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:_o.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ma.ADD,equationAlpha:ma.ADD,functionSourceRgb:_o.ONE,functionSourceAlpha:_o.ONE,functionDestinationRgb:_o.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:_o.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:ma.ADD,equationAlpha:ma.ADD,functionSourceRgb:_o.SOURCE_ALPHA,functionSourceAlpha:_o.ONE,functionDestinationRgb:_o.ONE,functionDestinationAlpha:_o.ONE})},un=Object.freeze(SRe);var x5t=T(S(),1);var CRe={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},yi=Object.freeze(CRe);function hS(e){e=g(e,g.EMPTY_OBJECT),this.material=e.material,this.translucent=g(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=g(e.closed,!1)}Object.defineProperties(hS.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});hS.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),d(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
`)};hS.prototype.isTranslucent=function(){return d(this.material)&&this.material.isTranslucent()||!d(this.material)&&this.translucent};hS.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Oe(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};hS.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),d(n)&&(i=xt(n,i,!0)),i};var to=hS;var HNt=T(S(),1);var E5t=T(S(),1),mG=`uniform sampler2D image;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var I5t=T(S(),1),hG=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    vec2 centerPixel = fract(repeat * st);
    float centerBump = texture(image, centerPixel).channel;

    float imageWidth = float(imageDimensions.x);
    vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
    float rightBump = texture(image, rightPixel).channel;

    float imageHeight = float(imageDimensions.y);
    vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
    float topBump = texture(image, leftPixel).channel;

    vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;

    material.normal = normalEC;
    material.diffuse = vec3(0.01);

    return material;
}
`;var P5t=T(S(),1),fG=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
    float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);  // 0.0 or 1.0

    // Find the distance from the closest separator (region between two colors)
    float scaledWidth = fract(repeat.s * st.s);
    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
    float scaledHeight = fract(repeat.t * st.t);
    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
    float value = min(scaledWidth, scaledHeight);

    vec4 currentColor = mix(lightColor, darkColor, b);
    vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);

    color = czm_gammaCorrect(color);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var w5t=T(S(),1),pG=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
    float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));  // 0.0 or 1.0

    vec4 color = mix(lightColor, darkColor, b);
    color = czm_gammaCorrect(color);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var A5t=T(S(),1),bG=`uniform sampler2D heights;
uniform sampler2D colors;

// This material expects heights to be sorted from lowest to highest.

float getHeight(int idx, float invTexSize)
{
    vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
#ifdef OES_texture_float
    return texture(heights, uv).x;
#else
    return czm_unpackFloat(texture(heights, uv));
#endif
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float height = materialInput.height;
    float invTexSize = 1.0 / float(heightsDimensions.x);

    float minHeight = getHeight(0, invTexSize);
    float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);

    // early-out when outside the height range
    if (height < minHeight || height > maxHeight) {
        material.diffuse = vec3(0.0);
        material.alpha = 0.0;
        return material;
    }

    // Binary search to find heights above and below.
    int idxBelow = 0;
    int idxAbove = heightsDimensions.x;
    float heightBelow = minHeight;
    float heightAbove = maxHeight;

    // while loop not allowed, so use for loop with max iterations.
    // maxIterations of 16 supports a texture size up to 65536 (2^16).
    const int maxIterations = 16;
    for (int i = 0; i < maxIterations; i++) {
        if (idxBelow >= idxAbove - 1) {
            break;
        }

        int idxMid = (idxBelow + idxAbove) / 2;
        float heightTex = getHeight(idxMid, invTexSize);

        if (height > heightTex) {
            idxBelow = idxMid;
            heightBelow = heightTex;
        } else {
            idxAbove = idxMid;
            heightAbove = heightTex;
        }
    }

    float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
    vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
    vec4 color = texture(colors, colorUv);

    // undo preumultiplied alpha
    if (color.a > 0.0) 
    {
        color.rgb /= color.a;
    }
    
    color.rgb = czm_gammaCorrect(color.rgb);

    material.diffuse = color.rgb;
    material.alpha = color.a;
    return material;
}
`;var N5t=T(S(),1),yG=`uniform vec4 color;
uniform float spacing;
uniform float width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float distanceToContour = mod(materialInput.height, spacing);

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float dxc = abs(dFdx(materialInput.height));
    float dyc = abs(dFdy(materialInput.height));
    float dF = max(dxc, dyc) * czm_pixelRatio * width;
    float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
#else
    // If no derivatives available (IE 10?), use pixel ratio
    float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
#endif

    vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var k5t=T(S(),1),gG=`uniform sampler2D image;
uniform float minimumHeight;
uniform float maximumHeight;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
    vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var B5t=T(S(),1),xG=`uniform vec4 fadeInColor;
uniform vec4 fadeOutColor;
uniform float maximumDistance;
uniform bool repeat;
uniform vec2 fadeDirection;
uniform vec2 time;

float getTime(float t, float coord)
{
    float scalar = 1.0 / maximumDistance;
    float q  = distance(t, coord) * scalar;
    if (repeat)
    {
        float r = distance(t, coord + 1.0) * scalar;
        float s = distance(t, coord - 1.0) * scalar;
        q = min(min(r, s), q);
    }
    return clamp(q, 0.0, 1.0);
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float s = getTime(time.x, st.s) * fadeDirection.s;
    float t = getTime(time.y, st.t) * fadeDirection.t;

    float u = length(vec2(s, t));
    vec4 color = mix(fadeInColor, fadeOutColor, u);

    color = czm_gammaCorrect(color);
    material.emission = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var O5t=T(S(),1),_G=`uniform vec4 color;
uniform float cellAlpha;
uniform vec2 lineCount;
uniform vec2 lineThickness;
uniform vec2 lineOffset;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

    float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
    float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));

    float value;

    // Fuzz Factor - Controls blurriness of lines
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    const float fuzz = 1.2;
    vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;

    // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
    vec2 dx = abs(dFdx(st));
    vec2 dy = abs(dFdy(st));
    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
    value = min(
        smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
        smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
#else
    // If no derivatives available (IE 10?), revert to view-dependent fuzz
    const float fuzz = 0.05;

    vec2 range = 0.5 - (lineThickness * 0.05);
    value = min(
        1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
        1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
#endif

    // Edges taken from RimLightingMaterial.glsl
    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
    float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
    float sRim = smoothstep(0.8, 1.0, dRim);
    value *= (1.0 - sRim);

    vec4 halfColor;
    halfColor.rgb = color.rgb * 0.5;
    halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
    halfColor = czm_gammaCorrect(halfColor);
    material.diffuse = halfColor.rgb;
    material.emission = halfColor.rgb;
    material.alpha = halfColor.a;

    return material;
}
`;var H5t=T(S(),1),TG=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    
    vec4 textureValue = texture(image, fract(repeat * materialInput.st));
    vec3 normalTangentSpace = textureValue.channels;
    normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
    normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
    normalTangentSpace = normalize(normalTangentSpace);
    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
    
    material.normal = normalEC;
    
    return material;
}
`;var J5t=T(S(),1),SG=`uniform vec4 color;

float getPointOnLine(vec2 p0, vec2 p1, float x)
{
    float slope = (p0.y - p1.y) / (p0.x - p1.x);
    return slope * (x - p0.x) + p0.y;
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
#else
     // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
    float base = 0.975;
#endif

    vec2 center = vec2(1.0, 0.5);
    float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
    float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);

    float halfWidth = 0.15;
    float s = step(0.5 - halfWidth, st.t);
    s *= 1.0 - step(0.5 + halfWidth, st.t);
    s *= 1.0 - step(base, st.s);

    float t = step(base, materialInput.st.s);
    t *= 1.0 - step(ptOnUpperLine, st.t);
    t *= step(ptOnLowerLine, st.t);

    // Find the distance from the closest separator (region between two colors)
    float dist;
    if (st.s < base)
    {
        float d1 = abs(st.t - (0.5 - halfWidth));
        float d2 = abs(st.t - (0.5 + halfWidth));
        dist = min(d1, d2);
    }
    else
    {
        float d1 = czm_infinity;
        if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
        {
            d1 = abs(st.s - base);
        }
        float d2 = abs(st.t - ptOnUpperLine);
        float d3 = abs(st.t - ptOnLowerLine);
        dist = min(min(d1, d2), d3);
    }

    vec4 outsideColor = vec4(0.0);
    vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
    vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);

    outColor = czm_gammaCorrect(outColor);
    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;
    return material;
}
`;var j5t=T(S(),1),CG=`uniform vec4 color;
uniform vec4 gapColor;
uniform float dashLength;
uniform float dashPattern;
in float v_polylineAngle;

const float maskLength = 16.0;

mat2 rotate(float rad) {
    float c = cos(rad);
    float s = sin(rad);
    return mat2(
        c, s,
        -s, c
    );
}

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;

    // Get the relative position within the dash from 0 to 1
    float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
    // Figure out the mask index.
    float maskIndex = floor(dashPosition * maskLength);
    // Test the bit mask.
    float maskTest = floor(dashPattern / pow(2.0, maskIndex));
    vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
    if (fragColor.a < 0.005) {   // matches 0/255 and 1/255
        discard;
    }

    fragColor = czm_gammaCorrect(fragColor);
    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;
    return material;
}
`;var $5t=T(S(),1),VG=`uniform vec4 color;
uniform float glowPower;
uniform float taperPower;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);

    if (taperPower <= 0.99999) {
        glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
    }

    vec4 fragColor;
    fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
    fragColor.a = clamp(0.0, 1.0, glow) * color.a;
    fragColor = czm_gammaCorrect(fragColor);

    material.emission = fragColor.rgb;
    material.alpha = fragColor.a;

    return material;
}
`;var tNt=T(S(),1),LG=`uniform vec4 color;
uniform vec4 outlineColor;
uniform float outlineWidth;

in float v_width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec2 st = materialInput.st;
    float halfInteriorWidth =  0.5 * (v_width - outlineWidth) / v_width;
    float b = step(0.5 - halfInteriorWidth, st.t);
    b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);

    // Find the distance from the closest separator (region between two colors)
    float d1 = abs(st.t - (0.5 - halfInteriorWidth));
    float d2 = abs(st.t - (0.5 + halfInteriorWidth));
    float dist = min(d1, d2);

    vec4 currentColor = mix(outlineColor, color, b);
    vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
    outColor = czm_gammaCorrect(outColor);

    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var iNt=T(S(),1),RG=`uniform vec4 color;
uniform vec4 rimColor;
uniform float width;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
    float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
    float s = smoothstep(1.0 - width, 1.0, d);

    vec4 outColor = czm_gammaCorrect(color);
    vec4 outRimColor = czm_gammaCorrect(rimColor);

    material.diffuse = outColor.rgb;
    material.emission = outRimColor.rgb * s;
    material.alpha = mix(outColor.a, outRimColor.a, s);

    return material;
}
`;var rNt=T(S(),1),ZG=`uniform sampler2D image;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);
    vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
    rampColor = czm_gammaCorrect(rampColor);
    material.diffuse = rampColor.rgb;
    material.alpha = rampColor.a;
    return material;
}
`;var aNt=T(S(),1),GG=`uniform vec4 evenColor;
uniform vec4 oddColor;
uniform float offset;
uniform float repeat;
uniform bool horizontal;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
    float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
    float value = fract((coord - offset) * (repeat * 0.5));
    float dist = min(value, min(abs(value - 0.5), 1.0 - value));

    vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
    vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
    color = czm_gammaCorrect(color);

    material.diffuse = color.rgb;
    material.alpha = color.a;

    return material;
}
`;var lNt=T(S(),1),EG=`// Thanks for the contribution Jonas
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog

uniform sampler2D specularMap;
uniform sampler2D normalMap;
uniform vec4 baseWaterColor;
uniform vec4 blendColor;
uniform float frequency;
uniform float animationSpeed;
uniform float amplitude;
uniform float specularIntensity;
uniform float fadeFactor;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    float time = czm_frameNumber * animationSpeed;

    // fade is a function of the distance from the fragment and the frequency of the waves
    float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);

    float specularMapValue = texture(specularMap, materialInput.st).r;

    // note: not using directional motion at this time, just set the angle to 0.0;
    vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
    vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));

    // fade out the normal perturbation as we move further from the water surface
    normalTangentSpace.xy /= fade;

    // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
    normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);

    normalTangentSpace = normalize(normalTangentSpace);

    // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
    float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);

    // fade out water effect as specular map value decreases
    material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;

    // base color is a blend of the water and non-water color based on the value from the specular map
    // may need a uniform blend factor to better control this
    material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);

    // diffuse highlights are based on how perturbed the normal is
    material.diffuse += (0.1 * tsPerturbationRatio);

    material.diffuse = material.diffuse;

    material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);

    material.specular = specularIntensity;
    material.shininess = 10.0;

    return material;
}
`;function ze(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=g(e.minificationFilter,cn.LINEAR),this._magnificationFilter=g(e.magnificationFilter,Ti.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,VRe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),d(ze._uniformList[this.type])||(ze._uniformList[this.type]=Object.keys(this._uniforms))}ze._uniformList={};ze.fromType=function(e,t){let n=new ze({fabric:{type:e}});if(d(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};ze.prototype.isTranslucent=function(){if(d(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};ze.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let l=c.image,u;Array.isArray(l)&&(u=l.slice(1,l.length).map(function(x){return x.bufferView}),l=l[0]);let m=new dn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;d(l.internalFormat)?p=new Wt({context:e,pixelFormat:l.internalFormat,width:l.width,height:l.height,source:{arrayBufferView:l.bufferView,mipLevels:u},sampler:m}):p=new Wt({context:e,source:l,sampler:m});let y=this._textures[n];d(y)&&y!==this._defaultTexture&&y.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let x=this.uniforms[f];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let l=c.images,u=new Ma({context:e,source:{positiveX:l[0],negativeX:l[1],positiveY:l[2],negativeY:l[3],positiveZ:l[4],negativeZ:l[5]},sampler:new dn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};ze.prototype.isDestroyed=function(){return!1};ze.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function VRe(e,t){e=g(e,g.EMPTY_OBJECT),t._strict=g(e.strict,!1),t._count=g(e.count,0),t._template=Oe(g(e.fabric,g.EMPTY_OBJECT)),t._template.uniforms=Oe(g(t._template.uniforms,g.EMPTY_OBJECT)),t._template.materials=Oe(g(t._template.materials,g.EMPTY_OBJECT)),t.type=d(t._template.type)?t._template.type:Yn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=ze._materialCache.getMaterial(t.type);if(d(i)){let r=Oe(i.fabric,!0);t._template=xt(t._template,r,!0),n=i.translucent}GRe(t),d(i)||ze._materialCache.addMaterial(t.type,t),XRe(t),vRe(t),FRe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=g(n,o),n=g(e.translucent,n),d(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function h3(e,t,n,i){if(d(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Bq(e,t){}function LRe(e,t){}var RRe=["type","materials","uniforms","components","source"],ZRe=["diffuse","specular","shininess","normal","emission","alpha"];function GRe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;h3(t,RRe,Bq,!0),h3(o,ZRe,Bq,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);h3(n,r,LRe,!1)}function ERe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function XRe(e){let t=e._template.components,n=e._template.source;if(d(n))e.shaderSource+=`${n}
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
{
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
`,d(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&ERe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; 
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; 
`:e.shaderSource+=`material.${o} = ${t[o]};
`}e.shaderSource+=`return material;
}
`}}var Yq={mat2:$i,mat3:$,mat4:F},IRe=/\.ktx2$/i;function WRe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!d(r)||r===ze.DefaultImageId;t=r;let c=n._textures[e],l,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&d(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!d(c)||c===i.defaultTexture){let p=new dn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Wt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else d(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Wt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];d(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,l=`${e}Dimensions`,o.hasOwnProperty(l)&&(u=o[l],u.x=r._width,u.y=r._height);return}if(s&&d(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),d(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,l=`${e}Dimensions`,o.hasOwnProperty(l)&&(u=o[l],u.x=c._width,u.y=c._height)),a)return;let m=r instanceof Ee;if(!d(n._texturePaths[e])||m&&r.url!==n._texturePaths[e].url||!m&&r!==n._texturePaths[e]){if(typeof r=="string"||m){let p=m?r:Ee.createIfNeeded(r),y;IRe.test(p.url)?y=rl(p.url):y=p.fetchImage(),Promise.resolve(y).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){d(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function PRe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ma){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(d(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===ze.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ee.createIfNeeded(i.positiveX).fetchImage(),Ee.createIfNeeded(i.negativeX).fetchImage(),Ee.createIfNeeded(i.positiveY).fetchImage(),Ee.createIfNeeded(i.negativeY).fetchImage(),Ee.createIfNeeded(i.positiveZ).fetchImage(),Ee.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function vRe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Oq(e,n)}function Oq(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=wRe(o),s;if(r==="channels")s=XG(e,t,o,!1);else{if(r==="sampler2D"){let l=`${t}Dimensions`;ARe(e,l)>0&&(i[l]={type:"ivec3",x:1,y:1},Oq(e,l))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let l=`uniform ${r} ${t};`;e.shaderSource=l+e.shaderSource}let c=`${t}_${e._count++}`;if(s=XG(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(WRe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(PRe(t));else if(r.indexOf("mat")!==-1){let l=new Yq[r];e._uniforms[c]=function(){return Yq[r].fromColumnMajorArray(e.uniforms[t],l)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function wRe(e){let t=e.type;if(!d(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===ze.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function FRe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new ze({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;XG(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=XG(e,i,a)}}function XG(e,t,n,i){i=g(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,l,u){return l||u?c:(o+=1,n)}),o}function ARe(e,t,n){return XG(e,t,t,n)}ze._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};ze.DefaultImageId="czm_defaultImage";ze.DefaultCubeMapId="czm_defaultCubeMap";ze.ColorType="Color";ze._materialCache.addMaterial(ze.ColorType,{fabric:{type:ze.ColorType,uniforms:{color:new B(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});ze.ImageType="Image";ze._materialCache.addMaterial(ze.ImageType,{fabric:{type:ze.ImageType,uniforms:{image:ze.DefaultImageId,repeat:new D(1,1),color:new B(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});ze.DiffuseMapType="DiffuseMap";ze._materialCache.addMaterial(ze.DiffuseMapType,{fabric:{type:ze.DiffuseMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});ze.AlphaMapType="AlphaMap";ze._materialCache.addMaterial(ze.AlphaMapType,{fabric:{type:ze.AlphaMapType,uniforms:{image:ze.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});ze.SpecularMapType="SpecularMap";ze._materialCache.addMaterial(ze.SpecularMapType,{fabric:{type:ze.SpecularMapType,uniforms:{image:ze.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});ze.EmissionMapType="EmissionMap";ze._materialCache.addMaterial(ze.EmissionMapType,{fabric:{type:ze.EmissionMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});ze.BumpMapType="BumpMap";ze._materialCache.addMaterial(ze.BumpMapType,{fabric:{type:ze.BumpMapType,uniforms:{image:ze.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:hG},translucent:!1});ze.NormalMapType="NormalMap";ze._materialCache.addMaterial(ze.NormalMapType,{fabric:{type:ze.NormalMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:TG},translucent:!1});ze.GridType="Grid";ze._materialCache.addMaterial(ze.GridType,{fabric:{type:ze.GridType,uniforms:{color:new B(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:_G},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});ze.StripeType="Stripe";ze._materialCache.addMaterial(ze.StripeType,{fabric:{type:ze.StripeType,uniforms:{horizontal:!0,evenColor:new B(1,1,1,.5),oddColor:new B(0,0,1,.5),offset:0,repeat:5},source:GG},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});ze.CheckerboardType="Checkerboard";ze._materialCache.addMaterial(ze.CheckerboardType,{fabric:{type:ze.CheckerboardType,uniforms:{lightColor:new B(1,1,1,.5),darkColor:new B(0,0,0,.5),repeat:new D(5,5)},source:fG},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});ze.DotType="Dot";ze._materialCache.addMaterial(ze.DotType,{fabric:{type:ze.DotType,uniforms:{lightColor:new B(1,1,0,.75),darkColor:new B(0,1,1,.75),repeat:new D(5,5)},source:pG},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});ze.WaterType="Water";ze._materialCache.addMaterial(ze.WaterType,{fabric:{type:ze.WaterType,uniforms:{baseWaterColor:new B(.2,.3,.6,1),blendColor:new B(0,1,.699,1),specularMap:ze.DefaultImageId,normalMap:ze.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:EG},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});ze.RimLightingType="RimLighting";ze._materialCache.addMaterial(ze.RimLightingType,{fabric:{type:ze.RimLightingType,uniforms:{color:new B(1,0,0,.7),rimColor:new B(1,1,1,.4),width:.3},source:RG},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});ze.FadeType="Fade";ze._materialCache.addMaterial(ze.FadeType,{fabric:{type:ze.FadeType,uniforms:{fadeInColor:new B(1,0,0,1),fadeOutColor:new B(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:xG},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});ze.PolylineArrowType="PolylineArrow";ze._materialCache.addMaterial(ze.PolylineArrowType,{fabric:{type:ze.PolylineArrowType,uniforms:{color:new B(1,1,1,1)},source:SG},translucent:!0});ze.PolylineDashType="PolylineDash";ze._materialCache.addMaterial(ze.PolylineDashType,{fabric:{type:ze.PolylineDashType,uniforms:{color:new B(1,0,1,1),gapColor:new B(0,0,0,0),dashLength:16,dashPattern:255},source:CG},translucent:!0});ze.PolylineGlowType="PolylineGlow";ze._materialCache.addMaterial(ze.PolylineGlowType,{fabric:{type:ze.PolylineGlowType,uniforms:{color:new B(0,.5,1,1),glowPower:.25,taperPower:1},source:VG},translucent:!0});ze.PolylineOutlineType="PolylineOutline";ze._materialCache.addMaterial(ze.PolylineOutlineType,{fabric:{type:ze.PolylineOutlineType,uniforms:{color:new B(1,1,1,1),outlineColor:new B(1,0,0,1),outlineWidth:1},source:LG},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});ze.ElevationContourType="ElevationContour";ze._materialCache.addMaterial(ze.ElevationContourType,{fabric:{type:ze.ElevationContourType,uniforms:{spacing:100,color:new B(1,0,0,1),width:1},source:yG},translucent:!1});ze.ElevationRampType="ElevationRamp";ze._materialCache.addMaterial(ze.ElevationRampType,{fabric:{type:ze.ElevationRampType,uniforms:{image:ze.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:gG},translucent:!1});ze.SlopeRampMaterialType="SlopeRamp";ze._materialCache.addMaterial(ze.SlopeRampMaterialType,{fabric:{type:ze.SlopeRampMaterialType,uniforms:{image:ze.DefaultImageId},source:ZG},translucent:!1});ze.AspectRampMaterialType="AspectRamp";ze._materialCache.addMaterial(ze.AspectRampMaterialType,{fabric:{type:ze.AspectRampMaterialType,uniforms:{image:ze.DefaultImageId},source:mG},translucent:!1});ze.ElevationBandType="ElevationBand";ze._materialCache.addMaterial(ze.ElevationBandType,{fabric:{type:ze.ElevationBandType,uniforms:{heights:ze.DefaultImageId,colors:ze.DefaultImageId},source:bG},translucent:!0});var ki=ze;function Ng(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=g(e.closed,!1),i=g(e.materialSupport,Ng.MaterialSupport.TEXTURED);this.material=d(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=g(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=g(e.flat,!1),this._faceForward=g(e.faceForward,!n)}Object.defineProperties(Ng.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Ng.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;Ng.prototype.isTranslucent=to.prototype.isTranslucent;Ng.prototype.getRenderState=to.prototype.getRenderState;Ng.MaterialSupport={BASIC:Object.freeze({vertexFormat:We.POSITION_AND_NORMAL,vertexShaderSource:lG,fragmentShaderSource:cG}),TEXTURED:Object.freeze({vertexFormat:We.POSITION_NORMAL_AND_ST,vertexShaderSource:uG,fragmentShaderSource:dG}),ALL:Object.freeze({vertexFormat:We.ALL,vertexShaderSource:aG,fragmentShaderSource:sG})};var so=Ng;var CUt=T(S(),1);var cUt=T(S(),1),IG=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec4 v_color;

void main()
{
    vec3 positionToEyeEC = -v_positionEC;

    vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    vec4 color = czm_gammaCorrect(v_color);

    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getDefaultMaterial(materialInput);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
}
`;var dUt=T(S(),1),WG=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec4 color;
in float batchId;

out vec3 v_positionEC;
out vec3 v_normalEC;
out vec4 v_color;

void main()
{
    vec4 p = czm_computePosition();

    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates
    v_normalEC = czm_normal * normal;                         // normal in eye coordinates
    v_color = color;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var mUt=T(S(),1),Ug=`in vec4 v_color;

void main()
{
    out_FragColor = czm_gammaCorrect(v_color);
}
`;var fUt=T(S(),1),PG=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 color;
in float batchId;

out vec4 v_color;

void main()
{
    vec4 p = czm_computePosition();

    v_color = color;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function op(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=g(e.closed,!1),i=g(e.flat,!1),o=i?PG:WG,r=i?Ug:IG,s=i?op.FLAT_VERTEX_FORMAT:op.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,o),this._fragmentShaderSource=g(e.fragmentShaderSource,r),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=g(e.faceForward,!n)}Object.defineProperties(op.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});op.VERTEX_FORMAT=We.POSITION_AND_NORMAL;op.FLAT_VERTEX_FORMAT=We.POSITION_ONLY;op.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;op.prototype.isTranslucent=to.prototype.isTranslucent;op.prototype.getRenderState=to.prototype.getRenderState;var sn=op;var XUt=T(S(),1);function fS(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(fS.prototype,{isConstant:{get:function(){return H.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});fS.prototype.getType=function(e){return"Color"};fS.prototype.getValue=function(e,t){return d(t)||(t={}),t.color=H.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};fS.prototype.equals=function(e){return this===e||e instanceof fS&&H.equals(this._color,e._color)};var At=fS;var MOt=T(S(),1);var gOt=T(S(),1);var qUt=T(S(),1);var NUt=T(S(),1);function db(e){e=g(e,g.EMPTY_OBJECT),this._ellipsoid=g(e.ellipsoid,re.WGS84),this._rectangle=g(e.rectangle,de.MAX_VALUE),this._projection=new Zi(this._ellipsoid),this._numberOfLevelZeroTilesX=g(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=g(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(db.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});db.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};db.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};db.prototype.rectangleToNativeRectangle=function(e,t){let n=W.toDegrees(e.west),i=W.toDegrees(e.south),o=W.toDegrees(e.east),r=W.toDegrees(e.north);return d(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new de(n,i,o,r)};db.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=W.toDegrees(o.west),o.south=W.toDegrees(o.south),o.east=W.toDegrees(o.east),o.north=W.toDegrees(o.north),o};db.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,l=(e+1)*a+o.west,u=o.height/s,m=o.north-t*u,p=o.north-(t+1)*u;return d(i)||(i=new de(c,p,l,m)),i.west=c,i.south=p,i.east=l,i.north=m,i};db.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=W.TWO_PI);let l=(c-i.west)/s|0;l>=o&&(l=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),d(n)?(n.x=l,n.y=u,n):new D(l,u)};var Di=db;var Kq=new h,Hq=new h,zq=new he,f3=new h,MRe=new h,Jq=new ce,NRe=new Di,vG=[new he,new he,new he,new he],wG=new D,wr={};wr.initialize=function(){let e=wr._initPromise;return d(e)||(e=Ee.fetchJson($t("Assets/approximateTerrainHeights.json")).then(function(t){wr._terrainHeights=t}),wr._initPromise=e),e};wr.getMinimumMaximumHeights=function(e,t){t=g(t,re.WGS84);let n=Qq(e),i=wr._defaultMinTerrainHeight,o=wr._defaultMaxTerrainHeight;if(d(n)){let r=`${n.level}-${n.x}-${n.y}`,s=wr._terrainHeights[r];d(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(de.northeast(e,zq),Kq),t.cartographicToCartesian(de.southwest(e,zq),Hq),h.midpoint(Hq,Kq,f3);let a=t.scaleToGeodeticSurface(f3,MRe);if(d(a)){let c=h.distance(f3,a);i=Math.min(i,-c)}else i=wr._defaultMinTerrainHeight}return i=Math.max(wr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};wr.getBoundingSphere=function(e,t){t=g(t,re.WGS84);let n=Qq(e),i=wr._defaultMaxTerrainHeight;if(d(n)){let r=`${n.level}-${n.x}-${n.y}`,s=wr._terrainHeights[r];d(s)&&(i=s[1])}let o=ce.fromRectangle3D(e,t,0);return ce.fromRectangle3D(e,t,i,Jq),ce.union(o,Jq,o)};function Qq(e){he.fromRadians(e.east,e.north,0,vG[0]),he.fromRadians(e.west,e.north,0,vG[1]),he.fromRadians(e.east,e.south,0,vG[2]),he.fromRadians(e.west,e.south,0,vG[3]);let t=0,n=0,i=0,o=0,r=wr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let l=vG[c];if(NRe.positionToTileXY(l,s,wG),c===0)i=wG.x,o=wG.y;else if(i!==wG.x||o!==wG.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}wr._terrainHeightsMaxLevel=6;wr._defaultMaxTerrainHeight=9e3;wr._defaultMinTerrainHeight=-1e5;wr._terrainHeights=void 0;wr._initPromise=void 0;Object.defineProperties(wr,{initialized:{get:function(){return d(wr._terrainHeights)}}});var li=wr;var lDt=T(S(),1);var Kkt=T(S(),1);var okt=T(S(),1);function Sc(e,t,n){this.minimum=h.clone(g(e,h.ZERO)),this.maximum=h.clone(g(t,h.ZERO)),d(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Sc.fromCorners=function(e,t,n){return d(n)||(n=new Sc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Sc.fromPoints=function(e,t){if(d(t)||(t=new Sc),!d(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let m=1;m<c;m++){let p=e[m],y=p.x,f=p.y,x=p.z;n=Math.min(y,n),r=Math.max(y,r),i=Math.min(f,i),s=Math.max(f,s),o=Math.min(x,o),a=Math.max(x,a)}let l=t.minimum;l.x=n,l.y=i,l.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=h.midpoint(l,u,t.center),t};Sc.clone=function(e,t){if(d(e))return d(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Sc(e.minimum,e.maximum,e.center)};Sc.equals=function(e,t){return e===t||d(e)&&d(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var Q9=new h;Sc.intersectPlane=function(e,t){Q9=h.subtract(e.maximum,e.minimum,Q9);let n=h.multiplyByScalar(Q9,.5,Q9),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?qt.INSIDE:r+o<0?qt.OUTSIDE:qt.INTERSECTING};Sc.prototype.clone=function(e){return Sc.clone(this,e)};Sc.prototype.intersectPlane=function(e){return Sc.intersectPlane(this,e)};Sc.prototype.equals=function(e){return Sc.equals(this,e)};var ub=Sc;var Wkt=T(S(),1);var akt=T(S(),1);var p3={};p3.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function jq(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}p3.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),l=Math.abs(e);if(c<l&&c/l<W.EPSILON14)return[0,0];if(c>l&&l/c<W.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=jq(o,-r,W.EPSILON14);if(s<0)return[];let a=-.5*jq(t,W.sign(t)*Math.sqrt(s),W.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Cc=p3;var pkt=T(S(),1);var dkt=T(S(),1);var y3={};y3.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function b3(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,l=r*a,u=r*r,m=s*s,p=o*s-u,y=o*a-r*s,f=r*a-m,x=4*p*f-y*y,_,C;if(x<0){let J,z,ee;u*l>=c*m?(J=o,z=p,ee=-2*r*p+o*y):(J=a,z=f,ee=-a*y+2*s*f);let j=-(ee<0?-1:1)*Math.abs(J)*Math.sqrt(-x);C=-ee+j;let q=C/2,be=q<0?-Math.pow(-q,1/3):Math.pow(q,1/3),Te=C===j?-be:-z/be;return _=z<=0?be+Te:-ee/(be*be+Te*Te+z),u*l>=c*m?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*y,Z=f,G=-a*y+2*s*f,X=Math.sqrt(x),P=Math.sqrt(3)/2,v=Math.abs(Math.atan2(o*X,-L)/3);_=2*Math.sqrt(-V);let A=Math.cos(v);C=_*A;let M=_*(-A/2-P*Math.sin(v)),b=C+M>2*r?C-r:M-r,R=o,E=b/R;v=Math.abs(Math.atan2(a*X,-G)/3),_=2*Math.sqrt(-Z),A=Math.cos(v),C=_*A,M=_*(-A/2-P*Math.sin(v));let I=-a,w=C+M<2*s?C+s:M+s,N=I/w,Y=R*w,k=-b*w-R*I,O=b*I,U=(s*k-r*O)/(-r*k+s*Y);return E<=U?E<=N?U<=N?[E,U,N]:[E,N,U]:[N,E,U]:E<=N?[U,E,N]:U<=N?[U,N,E]:[N,U,E]}y3.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Cc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Cc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return b3(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):b3(e,t,0,i);if(i===0)return o=Cc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return b3(e,t,n,i)};var kg=y3;var g3={};g3.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,l=n*n,u=l*n,m=i*i,p=m*i,y=o*o,f=y*o;return a*l*m-4*c*p-4*e*u*m+18*e*t*n*p-27*r*m*m+256*s*f+o*(18*c*n*i-4*a*u+16*e*l*l-80*e*t*l*i-6*e*a*m+144*r*n*m)+y*(144*e*a*n-27*a*a-128*r*l-192*r*t*i)};function am(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=kg.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let l=-e/4,u=c[c.length-1];if(Math.abs(u)<W.EPSILON14){let m=Cc.computeRealRoots(1,r,a);if(m.length===2){let p=m[0],y=m[1],f;if(p>=0&&y>=0){let x=Math.sqrt(p),_=Math.sqrt(y);return[l-_,l-x,l+x,l+_]}else{if(p>=0&&y<0)return f=Math.sqrt(p),[l-f,l+f];if(p<0&&y>=0)return f=Math.sqrt(y),[l-f,l+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,y=(r+u+s/m)/2,f=Cc.computeRealRoots(1,m,p),x=Cc.computeRealRoots(1,-m,y);return f.length!==0?(f[0]+=l,f[1]+=l,x.length!==0?(x[0]+=l,x[1]+=l,f[1]<=x[0]?[f[0],f[1],x[0],x[1]]:x[1]<=f[0]?[x[0],x[1],f[0],f[1]]:f[0]>=x[0]&&f[1]<=x[1]?[x[0],f[0],f[1],x[1]]:x[0]>=f[0]&&x[1]<=f[1]?[f[0],x[0],x[1],f[1]]:f[0]>x[0]&&f[0]<x[1]?[x[0],f[0],x[1],f[1]]:[f[0],x[0],f[1],x[1]]):f):x.length!==0?(x[0]+=l,x[1]+=l,x):[]}}return[]}function FG(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,l=s*i-n*t*e+o,u=kg.computeRealRoots(1,a,c,l);if(u.length>0){let m=u[0],p=t-m,y=p*p,f=e/2,x=p/2,_=y-4*i,C=y+4*Math.abs(i),V=s-4*m,L=s+4*Math.abs(m),Z,G;if(m<0||_*L<V*C){let R=Math.sqrt(V);Z=R/2,G=R===0?0:(e*x-n)/R}else{let R=Math.sqrt(_);Z=R===0?0:(e*x-n)/R,G=R/2}let X,P;f===0&&Z===0?(X=0,P=0):W.sign(f)===W.sign(Z)?(X=f+Z,P=m/X):(P=f-Z,X=m/P);let v,A;x===0&&G===0?(v=0,A=0):W.sign(x)===W.sign(G)?(v=x+G,A=i/v):(A=x-G,v=i/A);let M=Cc.computeRealRoots(1,X,v),b=Cc.computeRealRoots(1,P,A);if(M.length!==0)return b.length!==0?M[1]<=b[0]?[M[0],M[1],b[0],b[1]]:b[1]<=M[0]?[b[0],b[1],M[0],M[1]]:M[0]>=b[0]&&M[1]<=b[1]?[b[0],M[0],M[1],b[1]]:b[0]>=M[0]&&b[1]<=M[1]?[M[0],b[0],b[1],M[1]]:M[0]>b[0]&&M[0]<b[1]?[b[0],M[0],b[1],M[1]]:[M[0],b[0],M[1],b[1]]:M;if(b.length!==0)return b}return[]}g3.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<W.EPSILON15)return kg.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,l=r<0?1:0;switch(l+=s<0?l+1:l,l+=a<0?l+1:l,l+=c<0?l+1:l,l){case 0:return am(r,s,a,c);case 1:return FG(r,s,a,c);case 2:return FG(r,s,a,c);case 3:return am(r,s,a,c);case 4:return am(r,s,a,c);case 5:return FG(r,s,a,c);case 6:return am(r,s,a,c);case 7:return am(r,s,a,c);case 8:return FG(r,s,a,c);case 9:return am(r,s,a,c);case 10:return am(r,s,a,c);case 11:return FG(r,s,a,c);case 12:return am(r,s,a,c);case 13:return am(r,s,a,c);case 14:return am(r,s,a,c);case 15:return am(r,s,a,c);default:return}};var AG=g3;var _kt=T(S(),1);function j9(e,t){t=h.clone(g(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(g(e,h.ZERO)),this.direction=t}j9.clone=function(e,t){if(d(e))return d(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new j9(e.origin,e.direction)};j9.getPoint=function(e,t,n){return d(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var Sn=j9;var er={};er.rayPlane=function(e,t,n){d(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<W.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var URe=new h,kRe=new h,r$=new h,qq=new h,$q=new h;er.rayTriangleParametric=function(e,t,n,i,o){o=g(o,!1);let r=e.origin,s=e.direction,a=h.subtract(n,t,URe),c=h.subtract(i,t,kRe),l=h.cross(s,c,r$),u=h.dot(a,l),m,p,y,f,x;if(o){if(u<W.EPSILON6||(m=h.subtract(r,t,qq),y=h.dot(m,l),y<0||y>u)||(p=h.cross(m,a,$q),f=h.dot(s,p),f<0||y+f>u))return;x=h.dot(c,p)/u}else{if(Math.abs(u)<W.EPSILON6)return;let _=1/u;if(m=h.subtract(r,t,qq),y=h.dot(m,l)*_,y<0||y>1||(p=h.cross(m,a,$q),f=h.dot(s,p)*_,f<0||y+f>1))return;x=h.dot(c,p)*_}return x};er.rayTriangle=function(e,t,n,i,o,r){let s=er.rayTriangleParametric(e,t,n,i,o);if(!(!d(s)||s<0))return d(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var DRe=new Sn;er.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=DRe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=er.rayTriangleParametric(a,n,i,o,r);if(!(!d(c)||c<0||c>h.distance(e,t)))return d(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function BRe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,l=(-t-a)*s;return c<l?(i.root0=c,i.root1=l):(i.root0=l,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var YRe={root0:0,root1:0};function s$(e,t,n){d(n)||(n=new Tc);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,r$),c=h.dot(o,o),l=2*h.dot(o,a),u=h.magnitudeSquared(a)-s,m=BRe(c,l,u,YRe);if(d(m))return n.start=m.root0,n.stop=m.root1,n}er.raySphere=function(e,t,n){if(n=s$(e,t,n),!(!d(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var ORe=new Sn;er.lineSegmentSphere=function(e,t,n,i){let o=ORe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=s$(o,n,i),!(!d(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var KRe=new h,HRe=new h;er.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,KRe),o=h.multiplyComponents(n,e.direction,HRe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,l,u,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),l=c*a,p<l)return;if(p>l){u=s*s-l,m=-s+Math.sqrt(u);let f=m/c,x=a/m;return f<x?new Tc(f,x):{start:x,stop:f}}let y=Math.sqrt(a/c);return new Tc(y,y)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),l=c*a,u=s*s-l,m=-s+Math.sqrt(u),new Tc(0,m/c);if(s<0)return c=h.magnitudeSquared(o),new Tc(0,-s/c)};function Dg(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function zRe(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*Dg(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],W.EPSILON15)+t.y),l=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,u=s*Dg(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],W.EPSILON15),m=o*(i*Dg(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,y=[];if(m===0&&u===0){if(p=Cc.computeRealRoots(a,c,l),p.length===0)return y;let v=p[0],A=Math.sqrt(Math.max(1-v*v,0));if(y.push(new h(i,o*v,o*-A)),y.push(new h(i,o*v,o*A)),p.length===2){let M=p[1],b=Math.sqrt(Math.max(1-M*M,0));y.push(new h(i,o*M,o*-b)),y.push(new h(i,o*M,o*b))}return y}let f=m*m,x=u*u,_=a*a,C=m*u,V=_+x,L=2*(c*a+C),Z=2*l*a+c*c-x+f,G=2*(l*c-C),X=l*l-f;if(V===0&&L===0&&Z===0&&G===0)return y;p=AG.computeRealRoots(V,L,Z,G,X);let P=p.length;if(P===0)return y;for(let v=0;v<P;++v){let A=p[v],M=A*A,b=Math.max(1-M,0),R=Math.sqrt(b),E;W.sign(a)===W.sign(l)?E=Dg(a*M+l,c*A,W.EPSILON12):W.sign(l)===W.sign(c*A)?E=Dg(a*M,c*A+l,W.EPSILON12):E=Dg(a*M+c*A,l,W.EPSILON12);let I=Dg(u*A,m,W.EPSILON15),w=E*I;w<0?y.push(new h(i,o*A,o*R)):w>0?y.push(new h(i,o*A,o*-R)):R!==0?(y.push(new h(i,o*A,o*-R)),y.push(new h(i,o*A,o*R)),++v):y.push(new h(i,o*A,o*R))}return y}var x3=new h,e$=new h,t$=new h,q9=new h,JRe=new h,QRe=new $,jRe=new $,qRe=new $,$Re=new $,eZe=new $,n$=new $,i$=new $,o$=new h,tZe=new h,nZe=new he;er.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let X=t.geodeticSurfaceNormal(n,x3);if(h.dot(i,X)>=0)return n}let o=d(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,x3),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,q9),c=h.normalize(h.cross(a,s,e$),e$),l=h.normalize(h.cross(s,c,t$),t$),u=QRe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=l.x,u[7]=l.y,u[8]=l.z;let m=$.transpose(u,jRe),p=$.fromScale(t.radii,qRe),y=$.fromScale(t.oneOverRadii,$Re),f=eZe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let x=$.multiply($.multiply(m,y,n$),f,n$),_=$.multiply($.multiply(x,p,i$),u,i$),C=$.multiplyByVector(x,n,JRe),V=zRe(_,h.negate(C,x3),0,0,1),L,Z,G=V.length;if(G>0){let X=h.clone(h.ZERO,tZe),P=Number.NEGATIVE_INFINITY;for(let A=0;A<G;++A){L=$.multiplyByVector(p,$.multiplyByVector(u,V[A],o$),o$);let M=h.normalize(h.subtract(L,n,q9),q9),b=h.dot(M,i);b>P&&(P=b,X=h.clone(L,X))}let v=t.cartesianToCartographic(X,nZe);return P=W.clamp(P,0,1),Z=h.magnitude(h.subtract(X,n,q9))*Math.sqrt(1-P*P),Z=o?-Z:Z,v.height=Z,t.cartographicToCartesian(v,new h)}};var iZe=new h;er.lineSegmentPlane=function(e,t,n,i){d(i)||(i=new h);let o=h.subtract(t,e,iZe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<W.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};er.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,l=0;l+=s?1:0,l+=a?1:0,l+=c?1:0;let u,m;if((l===1||l===2)&&(u=new h,m=new h),l===1){if(s)return er.lineSegmentPlane(e,t,i,u),er.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return er.lineSegmentPlane(t,n,i,u),er.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return er.lineSegmentPlane(n,e,i,u),er.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,u,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(l===2)if(s)if(a){if(!c)return er.lineSegmentPlane(e,n,i,u),er.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return er.lineSegmentPlane(n,t,i,u),er.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return er.lineSegmentPlane(t,e,i,u),er.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var Si=er;var _3=new se;function Ah(e,t){t=g(t,re.WGS84),e=t.scaleToGeodeticSurface(e);let n=vt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(F.getColumn(n,0,_3)),this._yAxis=h.fromCartesian4(F.getColumn(n,1,_3));let i=h.fromCartesian4(F.getColumn(n,2,_3));this._plane=on.fromPointNormal(e,i)}Object.defineProperties(Ah.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var oZe=new ub;Ah.fromPoints=function(e,t){let n=ub.fromPoints(e,oZe);return new Ah(n.center,t)};var a$=new Sn,$9=new h;Ah.prototype.projectPointOntoPlane=function(e,t){let n=a$;n.origin=e,h.normalize(e,n.direction);let i=Si.rayPlane(n,this._plane,$9);if(d(i)||(h.negate(n.direction,n.direction),i=Si.rayPlane(n,this._plane,$9)),d(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return d(t)?(t.x=r,t.y=s,t):new D(r,s)}};Ah.prototype.projectPointsOntoPlane=function(e,t){d(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);d(r)&&(t[n]=r,n++)}return t.length=n,t};Ah.prototype.projectPointToNearestOnPlane=function(e,t){d(t)||(t=new D);let n=a$;n.origin=e,h.clone(this._plane.normal,n.direction);let i=Si.rayPlane(n,this._plane,$9);d(i)||(h.negate(n.direction,n.direction),i=Si.rayPlane(n,this._plane,$9));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};Ah.prototype.projectPointsToNearestOnPlane=function(e,t){d(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var rZe=new h;Ah.prototype.projectPointOntoEllipsoid=function(e,t){d(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=rZe;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Ah.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;d(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var xr=Ah;function Fi(e,t){this.center=h.clone(g(e,h.ZERO)),this.halfAxes=$.clone(g(t,$.ZERO))}Fi.packedLength=h.packedLength+$.packedLength;Fi.pack=function(e,t,n){return n=g(n,0),h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};Fi.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new Fi),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var sZe=new h,aZe=new h,cZe=new h,lZe=new h,dZe=new h,uZe=new h,mZe=new $,hZe={unitary:new $,diagonal:new $};Fi.fromPoints=function(e,t){if(d(t)||(t=new Fi),!d(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],sZe);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,l=0,u=0,m=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,aZe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,l+=p.y*p.y,u+=p.y*p.z,m+=p.z*p.z;s*=r,a*=r,c*=r,l*=r,u*=r,m*=r;let y=mZe;y[0]=s,y[1]=a,y[2]=c,y[3]=a,y[4]=l,y[5]=u,y[6]=c,y[7]=u,y[8]=m;let f=$.computeEigenDecomposition(y,hZe),x=$.clone(f.unitary,t.halfAxes),_=$.getColumn(x,0,lZe),C=$.getColumn(x,1,dZe),V=$.getColumn(x,2,uZe),L=-Number.MAX_VALUE,Z=-Number.MAX_VALUE,G=-Number.MAX_VALUE,X=Number.MAX_VALUE,P=Number.MAX_VALUE,v=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],L=Math.max(h.dot(_,p),L),Z=Math.max(h.dot(C,p),Z),G=Math.max(h.dot(V,p),G),X=Math.min(h.dot(_,p),X),P=Math.min(h.dot(C,p),P),v=Math.min(h.dot(V,p),v);_=h.multiplyByScalar(_,.5*(X+L),_),C=h.multiplyByScalar(C,.5*(P+Z),C),V=h.multiplyByScalar(V,.5*(v+G),V);let A=h.add(_,C,t.center);h.add(A,V,A);let M=cZe;return M.x=L-X,M.y=Z-P,M.z=G-v,h.multiplyByScalar(M,.5,M),$.multiplyByScale(t.halfAxes,M,t.halfAxes),t};var h$=new h,fZe=new h;function c$(e,t,n,i,o,r,s,a,c,l,u){d(u)||(u=new Fi);let m=u.halfAxes;$.setColumn(m,0,t,m),$.setColumn(m,1,n,m),$.setColumn(m,2,i,m);let p=h$;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+l)/2;let y=fZe;y.x=(r-o)/2,y.y=(a-s)/2,y.z=(l-c)/2;let f=u.center;return p=$.multiplyByVector(m,p,p),h.add(e,p,f),$.multiplyByScale(m,y,m),u}var l$=new he,pZe=new h,bZe=new he,yZe=new he,gZe=new he,xZe=new he,_Ze=new he,TZe=new h,d$=new h,SZe=new h,u$=new h,CZe=new h,VZe=new D,LZe=new D,RZe=new D,ZZe=new D,GZe=new D,EZe=new h,XZe=new h,IZe=new h,WZe=new h,PZe=new D,vZe=new h,wZe=new h,FZe=new h,AZe=new on(h.UNIT_X,0);Fi.fromRectangle=function(e,t,n,i,o){t=g(t,0),n=g(n,0),i=g(i,re.WGS84);let r,s,a,c,l,u,m;if(e.width<=W.PI){let P=de.center(e,l$),v=i.cartographicToCartesian(P,pZe),A=new xr(v,i);m=A.plane;let M=P.longitude,b=e.south<0&&e.north>0?0:P.latitude,R=he.fromRadians(M,e.north,n,bZe),E=he.fromRadians(e.west,e.north,n,yZe),I=he.fromRadians(e.west,b,n,gZe),w=he.fromRadians(e.west,e.south,n,xZe),N=he.fromRadians(M,e.south,n,_Ze),Y=i.cartographicToCartesian(R,TZe),k=i.cartographicToCartesian(E,d$),O=i.cartographicToCartesian(I,SZe),U=i.cartographicToCartesian(w,u$),J=i.cartographicToCartesian(N,CZe),z=A.projectPointToNearestOnPlane(Y,VZe),ee=A.projectPointToNearestOnPlane(k,LZe),K=A.projectPointToNearestOnPlane(O,RZe),j=A.projectPointToNearestOnPlane(U,ZZe),q=A.projectPointToNearestOnPlane(J,GZe);return r=Math.min(ee.x,K.x,j.x),s=-r,c=Math.max(ee.y,z.y),a=Math.min(j.y,q.y),E.height=w.height=t,k=i.cartographicToCartesian(E,d$),U=i.cartographicToCartesian(w,u$),l=Math.min(on.getPointDistance(m,k),on.getPointDistance(m,U)),u=n,c$(A.origin,A.xAxis,A.yAxis,A.zAxis,r,s,a,c,l,u,o)}let p=e.south>0,y=e.north<0,f=p?e.south:y?e.north:0,x=de.center(e,l$).longitude,_=h.fromRadians(x,f,n,i,EZe);_.z=0;let V=Math.abs(_.x)<W.EPSILON10&&Math.abs(_.y)<W.EPSILON10?h.UNIT_X:h.normalize(_,XZe),L=h.UNIT_Z,Z=h.cross(V,L,IZe);m=on.fromPointNormal(_,V,AZe);let G=h.fromRadians(x+W.PI_OVER_TWO,f,n,i,WZe);s=h.dot(on.projectPointOntoPlane(m,G,PZe),Z),r=-s,c=h.fromRadians(0,e.north,y?t:n,i,vZe).z,a=h.fromRadians(0,e.south,p?t:n,i,wZe).z;let X=h.fromRadians(e.east,f,n,i,FZe);return l=on.getPointDistance(m,X),u=0,c$(_,Z,L,V,r,s,a,c,l,u,o)};Fi.fromTransformation=function(e,t){return d(t)||(t=new Fi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Fi.clone=function(e,t){if(d(e))return d(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Fi(e.center,e.halfAxes)};Fi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),l=h.dot(i,n)+t.distance;return l<=-c?qt.OUTSIDE:l>=c?qt.INSIDE:qt.INTERSECTING};var f$=new h,p$=new h,b$=new h,MZe=new h,m$=new h,NZe=new h;Fi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,h$),i=e.halfAxes,o=$.getColumn(i,0,f$),r=$.getColumn(i,1,p$),s=$.getColumn(i,2,b$),a=h.magnitude(o),c=h.magnitude(r),l=h.magnitude(s),u=!0,m=!0,p=!0;a>0?h.divideByScalar(o,a,o):u=!1,c>0?h.divideByScalar(r,c,r):m=!1,l>0?h.divideByScalar(s,l,s):p=!1;let y=!u+!m+!p,f,x,_;if(y===1){let Z=o;f=r,x=s,m?p||(Z=s,x=o):(Z=r,f=o),_=h.cross(f,x,m$),Z===o?o=_:Z===r?r=_:Z===s&&(s=_)}else if(y===2){f=o,m?f=r:p&&(f=s);let Z=h.UNIT_Y;Z.equalsEpsilon(f,W.EPSILON3)&&(Z=h.UNIT_X),x=h.cross(f,Z,MZe),h.normalize(x,x),_=h.cross(f,x,m$),h.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else y===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let C=NZe;C.x=h.dot(n,o),C.y=h.dot(n,r),C.z=h.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-l?(L=C.z+l,V+=L*L):C.z>l&&(L=C.z-l,V+=L*L),V};var UZe=new h,kZe=new h;Fi.computePlaneDistances=function(e,t,n,i){d(i)||(i=new Tc);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,f$),l=$.getColumn(a,1,p$),u=$.getColumn(a,2,b$),m=h.add(c,l,UZe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,kZe),y=h.dot(n,p);return o=Math.min(y,o),r=Math.max(y,r),h.add(s,c,m),h.add(m,l,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.add(s,c,m),h.subtract(m,l,m),h.add(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.add(s,c,m),h.subtract(m,l,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.add(m,l,m),h.add(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.add(m,l,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.subtract(m,l,m),h.add(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.subtract(m,l,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),i.start=o,i.stop=r,i};var DZe=new h,BZe=new h,YZe=new h;Fi.computeCorners=function(e,t){d(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,DZe),r=$.getColumn(i,1,BZe),s=$.getColumn(i,2,YZe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var OZe=new $;Fi.computeTransformation=function(e,t){d(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,OZe);return F.fromRotationTranslation(i,n,t)};var KZe=new ce;Fi.isOccluded=function(e,t){let n=ce.fromOrientedBoundingBox(e,KZe);return!t.isBoundingSphereVisible(n)};Fi.prototype.intersectPlane=function(e){return Fi.intersectPlane(this,e)};Fi.prototype.distanceSquaredTo=function(e){return Fi.distanceSquaredTo(this,e)};Fi.prototype.computePlaneDistances=function(e,t,n){return Fi.computePlaneDistances(this,e,t,n)};Fi.prototype.computeCorners=function(e){return Fi.computeCorners(this,e)};Fi.prototype.computeTransformation=function(e){return Fi.computeTransformation(this,e)};Fi.prototype.isOccluded=function(e){return Fi.isOccluded(this,e)};Fi.equals=function(e,t){return e===t||d(e)&&d(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Fi.prototype.clone=function(e){return Fi.clone(this,e)};Fi.prototype.equals=function(e){return Fi.equals(this,e)};var Wn=Fi;var mDt=T(S(),1);var eM={};eM.getHeight=function(e,t,n){return(e-n)*t+n};var HZe=new h;eM.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,HZe),s=eM.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var Vc=eM;var eOt=T(S(),1);var fDt=T(S(),1),MG=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;

#ifdef EXTRUDED_GEOMETRY
in vec3 extrudeDirection;

uniform float u_globeMinimumAltitude;
#endif // EXTRUDED_GEOMETRY

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif // PER_INSTANCE_COLOR

#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
out vec4 v_sphericalExtents;
#else // SPHERICAL
out vec2 v_inversePlaneExtents;
out vec4 v_westPlane;
out vec4 v_southPlane;
#endif // SPHERICAL
out vec3 v_uvMinAndSphericalLongitudeRotation;
out vec3 v_uMaxAndInverseDistance;
out vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES

void main()
{
    vec4 position = czm_computePosition();

#ifdef EXTRUDED_GEOMETRY
    float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
    delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;

    //extrudeDirection is zero for the top layer
    position = position + vec4(extrudeDirection * delta, 0.0);
#endif

#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
    v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
    v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
#else // SPHERICAL
#ifdef COLUMBUS_VIEW_2D
    vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
    vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);

    // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
    // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
    // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
    // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
    vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
    bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
    planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
    planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);

    // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
    // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
    // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
    idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
    idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
    planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
    planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);

    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
    vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
    vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
#else // COLUMBUS_VIEW_2D
    // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
    vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
    vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
#endif // COLUMBUS_VIEW_2D

    vec3 eastWard = southEastCorner - southWestCorner;
    float eastExtent = length(eastWard);
    eastWard /= eastExtent;

    vec3 northWard = northWestCorner - southWestCorner;
    float northExtent = length(northWard);
    northWard /= northExtent;

    v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
    v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
    v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
#endif // SPHERICAL
    vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
    vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);

    v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
    v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
    v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
#endif // TEXTURE_COORDINATES

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#endif

    gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
}
`;var bDt=T(S(),1),mb=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

void main(void)
{
#ifdef VECTOR_TILE
    out_FragColor = czm_gammaCorrect(u_highlightColor);
#else
    out_FragColor = vec4(1.0);
#endif
    czm_writeDepthClamp();
}
`;var gDt=T(S(),1),y$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};y$.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(y$);var TDt=T(S(),1);var zZe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},ka=Object.freeze(zZe);var Q3t=T(S(),1);var CDt=T(S(),1);function JZe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var NG=JZe;var ADt=T(S(),1);function rp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=QZe(t),o=e.floatingPointTexture,r=i===Je.FLOAT&&!o,s=jZe(t,r),a=qZe(s,t,r),c=Math.floor(kt.maximumTextureSize/a),l=Math.min(n,c),u=a*l,m=Math.ceil(n/l),p=1/u,y=p*.5,f=1/m,x=f*.5;this._textureDimensions=new D(u,m),this._textureStep=new se(p,y,f,x),this._pixelDatatype=r?Je.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let _=4*u*m;this._batchValues=i===Je.FLOAT&&!r?new Float32Array(_):new Uint8Array(_),this._batchValuesDirty=!1}Object.defineProperties(rp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function QZe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Q.UNSIGNED_BYTE){t=!0;break}return t?Je.FLOAT:Je.UNSIGNED_BYTE}function x$(e,t){let n=e[t].componentsPerAttribute;return n===2?D:n===3?h:n===4?se:Number}function jZe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==Q.UNSIGNED_BYTE&&t?i+=4:++i}return n}function qZe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==Q.UNSIGNED_BYTE&&n?o+4:o+1}var UG=new se;function $Ze(e,t,n){let i=se.unpack(e,t,UG),o=se.unpackFloat(i);i=se.unpack(e,t+4,UG);let r=se.unpackFloat(i);i=se.unpack(e,t+8,UG);let s=se.unpackFloat(i);i=se.unpack(e,t+12,UG);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function eGe(e,t,n){let i=se.packFloat(e.x,UG);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var g$=new se;rp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Je.UNSIGNED_BYTE?a=$Ze(this._batchValues,s,g$):a=se.unpack(this._batchValues,s,g$);let c=x$(i,t);return d(c.fromCartesian4)?c.fromCartesian4(a,n):d(c.clone)?c.clone(a,n):a.x};var tGe=[void 0,void 0,new D,new h,new se],nGe=new se;rp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=tGe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=x$(this._attributes,t);if(d(s.equals)?s.equals(r,n):r===n)return;let c=nGe;c.x=d(n.x)?n.x:n,c.y=d(n.y)?n.y:0,c.z=d(n.z)?n.z:0,c.w=d(n.w)?n.w:0;let l=this._offsets[t],m=4*this._stride*e+4*l;this._packFloats&&i[t].componentDatatype!==Je.UNSIGNED_BYTE?eGe(c,this._batchValues,m):se.pack(c,this._batchValues,m),this._batchValuesDirty=!0};function iGe(e,t){let n=e._textureDimensions;e._texture=new Wt({context:t,pixelFormat:st.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:dn.NEAREST,flipY:!1})}function oGe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}rp.prototype.update=function(e){d(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,d(this._texture)||iGe(this,e.context),oGe(this))};rp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function rGe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; 
vec2 computeSt(float batchId) 
{ 
    float stepX = batchTextureStep.x; 
    float centerX = batchTextureStep.y; 
    float numberOfAttributes = float(${t}); 
    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); 
} 
`:`uniform vec4 batchTextureStep; 
uniform vec2 batchTextureDimensions; 
vec2 computeSt(float batchId) 
{ 
    float stepX = batchTextureStep.x; 
    float centerX = batchTextureStep.y; 
    float stepY = batchTextureStep.z; 
    float centerY = batchTextureStep.w; 
    float numberOfAttributes = float(${t}); 
    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); 
    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); 
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); 
} 
`}function sGe(e){return e===1?"float":`vec${e}`}function aGe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function cGe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=sGe(o),a=aGe(o),c=e._offsets[t],l=`${s} ${r}(float batchId) 
{ 
    vec2 st = computeSt(batchId); 
    st.x += batchTextureStep.x * float(${c}); 
`;return e._packFloats&&i.componentDatatype!==Je.UNSIGNED_BYTE?l+=`vec4 textureValue; 
textureValue.x = czm_unpackFloat(texture(batchTexture, st)); 
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); 
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); 
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); 
`:l+=`    vec4 textureValue = texture(batchTexture, st); 
`,l+=`    ${s} value = textureValue${a}; 
`,e._pixelDatatype===Je.UNSIGNED_BYTE&&i.componentDatatype===Q.UNSIGNED_BYTE&&!i.normalize?l+=`value *= 255.0; 
`:e._pixelDatatype===Je.FLOAT&&i.componentDatatype===Q.UNSIGNED_BYTE&&i.normalize&&(l+=`value /= 255.0; 
`),l+=`    return value; 
} 
`,l}rp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; 
`;t+=`${rGe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=cGe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};rp.prototype.isDestroyed=function(){return!1};rp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Bg=rp;var r3t=T(S(),1);var wBt=T(S(),1);var $Dt=T(S(),1);var ODt=T(S(),1);var no={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};no.getMathType=function(e){switch(e){case no.SCALAR:return Number;case no.VEC2:return D;case no.VEC3:return h;case no.VEC4:return se;case no.MAT2:return $i;case no.MAT3:return $;case no.MAT4:return F}};no.getNumberOfComponents=function(e){switch(e){case no.SCALAR:return 1;case no.VEC2:return 2;case no.VEC3:return 3;case no.VEC4:case no.MAT2:return 4;case no.MAT3:return 9;case no.MAT4:return 16}};no.getAttributeLocationCount=function(e){switch(e){case no.SCALAR:case no.VEC2:case no.VEC3:case no.VEC4:return 1;case no.MAT2:return 2;case no.MAT3:return 3;case no.MAT4:return 4}};no.getGlslType=function(e){switch(e){case no.SCALAR:return"float";case no.VEC2:return"vec2";case no.VEC3:return"vec3";case no.VEC4:return"vec4";case no.MAT2:return"mat2";case no.MAT3:return"mat3";case no.MAT4:return"mat4"}};var an=Object.freeze(no);var _$=1/256,T$=256,yo={};yo.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*W.signNotZero(i),n.y=(1-Math.abs(i))*W.signNotZero(o)}return n.x=W.toSNorm(n.x,t),n.y=W.toSNorm(n.y,t),n};yo.octEncode=function(e,t){return yo.octEncodeInRange(e,255,t)};var kG=new D,S$=new Uint8Array(1);function tM(e){return S$[0]=e,S$[0]}yo.octEncodeToCartesian4=function(e,t){return yo.octEncodeInRange(e,65535,kG),t.x=tM(kG.x*_$),t.y=tM(kG.x),t.z=tM(kG.y*_$),t.w=tM(kG.y),t};yo.octDecodeInRange=function(e,t,n,i){if(i.x=W.fromSNorm(e,n),i.y=W.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*W.signNotZero(o),i.y=(1-Math.abs(o))*W.signNotZero(i.y)}return h.normalize(i,i)};yo.octDecode=function(e,t,n){return yo.octDecodeInRange(e,t,255,n)};yo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*T$+i,a=o*T$+r;return yo.octDecodeInRange(s,a,65535,t)};yo.octPackFloat=function(e){return 256*e.x+e.y};var S3=new D;yo.octEncodeFloat=function(e){return yo.octEncode(e,S3),yo.octPackFloat(S3)};yo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return yo.octDecode(i,o,t)};yo.octPack=function(e,t,n,i){let o=yo.octEncodeFloat(e),r=yo.octEncodeFloat(t),s=yo.octEncode(n,S3);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};yo.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;yo.octDecodeFloat(s,t),yo.octDecodeFloat(c,n),yo.octDecode(r,a,i)};yo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};yo.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function T3(e){return e>>1^-(e&1)}yo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=T3(e[a]),r+=T3(t[a]),e[a]=o,t[a]=r,d(n)&&(s+=T3(n[a]),n[a]=s)};yo.dequantize=function(e,t,n,i){let o=an.getNumberOfComponents(n),r;switch(t){case Q.BYTE:r=127;break;case Q.UNSIGNED_BYTE:r=255;break;case Q.SHORT:r=32767;break;case Q.UNSIGNED_SHORT:r=65535;break;case Q.INT:r=2147483647;break;case Q.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let l=a*o+c;s[l]=Math.max(e[l]/r,-1)}return s};yo.decodeRGB565=function(e,t){let n=e.length;d(t)||(t=new Float32Array(n*3));let i=32-1,o=64-1,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],l=c>>11,u=c>>5&o,m=c&i,p=3*a;t[p]=l*r,t[p+1]=u*s,t[p+2]=m*r}return t};var Kn=yo;var rBt=T(S(),1);var C$=new h,V$=new h,L$=new h;function lGe(e,t,n,i,o){d(o)||(o=new h);let r,s,a,c,l,u,m,p;if(d(t.z)){if(h.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,C$),s=h.subtract(i,t,V$),a=h.subtract(e,t,L$),c=h.dot(r,r),l=h.dot(r,s),u=h.dot(r,a),m=h.dot(s,s),p=h.dot(s,a)}else{if(D.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(D.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(D.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=D.subtract(n,t,C$),s=D.subtract(i,t,V$),a=D.subtract(e,t,L$),c=D.dot(r,r),l=D.dot(r,s),u=D.dot(r,a),m=D.dot(s,s),p=D.dot(s,a)}o.y=m*u-l*p,o.z=c*p-l*u;let y=c*m-l*l;if(y!==0)return o.y/=y,o.z/=y,o.x=1-o.y-o.z,o}var Yg=lGe;var lBt=T(S(),1);var C3={};C3.calculateACMR=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=g(e.cacheSize,24),o=t.length;if(!d(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};C3.tipsify=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=g(e.cacheSize,24),o;function r(b,R,E,I){for(;R.length>=1;){let w=R[R.length-1];if(R.splice(R.length-1,1),b[w].numLiveTriangles>0)return w}for(;o<I;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,R,E,I,w,N,Y){let k=-1,O,U=-1,J=0;for(;J<E.length;){let z=E[J];I[z].numLiveTriangles&&(O=0,w-I[z].timeStamp+2*I[z].numLiveTriangles<=R&&(O=w-I[z].timeStamp),(O>U||U===-1)&&(U=O,k=z)),++J}return k===-1?r(I,N,b,Y):k}let a=t.length,c=0,l=0,u=t[l],m=a;if(d(n))c=n+1;else{for(;l<m;)u>c&&(c=u),++l,u=t[l];if(c===-1)return 0;++c}let p=[],y;for(y=0;y<c;y++)p[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};l=0;let f=0;for(;l<m;)p[t[l]].vertexTriangles.push(f),++p[t[l]].numLiveTriangles,p[t[l+1]].vertexTriangles.push(f),++p[t[l+1]].numLiveTriangles,p[t[l+2]].vertexTriangles.push(f),++p[t[l+2]].numLiveTriangles,++f,l+=3;let x=0,_=i+1;o=1;let C=[],V=[],L,Z,G=0,X=[],P=a/3,v=[];for(y=0;y<P;y++)v[y]=!1;let A,M;for(;x!==-1;){C=[],Z=p[x],M=Z.vertexTriangles.length;for(let b=0;b<M;++b)if(f=Z.vertexTriangles[b],!v[f]){v[f]=!0,l=f+f+f;for(let R=0;R<3;++R)A=t[l],C.push(A),V.push(A),X[G]=A,++G,L=p[A],--L.numLiveTriangles,_-L.timeStamp>i&&(L.timeStamp=_,++_),++l}x=s(t,i,C,p,_,V,c)}return X};var DG=C3;var Lc={};function cM(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function dGe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)cM(i,o,e[r],e[r+1],e[r+2]);return i}function uGe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);cM(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)cM(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function mGe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)cM(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Lc.toWireframe=function(e){let t=e.indices;if(d(t)){switch(e.primitiveType){case Fe.TRIANGLES:e.indices=dGe(t);break;case Fe.TRIANGLE_STRIP:e.indices=uGe(t);break;case Fe.TRIANGLE_FAN:e.indices=mGe(t);break}e.primitiveType=Fe.LINES}return e};Lc.createLineSegmentsForVectors=function(e,t,n){t=g(t,"normal"),n=g(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let c,l=e.boundingSphere;return d(l)&&(c=new ce(l.center,l.radius+n)),new dt({attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Fe.LINES,boundingSphere:c})};Lc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];d(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!d(i[a])&&(i[a]=o++);return i};Lc.reorderForPreVertexCache=function(e){let t=dt.computeNumberOfVertices(e),n=e.indices;if(d(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ue.createTypedArray(t,r),a=0,c=0,l=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[c]=u:(u=o[a],i[u]=l,s[c]=l,++l),++a,++c;e.indices=s;let m=e.attributes;for(let p in m)if(m.hasOwnProperty(p)&&d(m[p])&&d(m[p].values)){let y=m[p],f=y.values,x=0,_=y.componentsPerAttribute,C=Q.createTypedArray(y.componentDatatype,l*_);for(;x<t;){let V=i[x];if(V!==-1)for(let L=0;L<_;L++)C[_*V+L]=f[_*x+L];++x}y.values=C}}return e};Lc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Fe.TRIANGLES&&d(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=DG.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function R$(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&d(e[n])&&d(e[n].values)){let i=e[n];t[n]=new Ze({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function hGe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&d(t[i])&&d(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Lc.fitToUnsignedShortIndices=function(e){let t=[],n=dt.computeNumberOfVertices(e);if(d(e.indices)&&n>=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=R$(e.attributes),a=e.indices,c=a.length,l;e.primitiveType===Fe.TRIANGLES?l=3:e.primitiveType===Fe.LINES?l=2:e.primitiveType===Fe.POINTS&&(l=1);for(let u=0;u<c;u+=l){for(let m=0;m<l;++m){let p=a[u+m],y=i[p];d(y)||(y=r++,i[p]=y,hGe(s,e.attributes,p)),o.push(y)}r+l>=W.SIXTY_FOUR_KILOBYTES&&(t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=R$(e.attributes))}o.length!==0&&t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Z$=new h,fGe=new he;Lc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=d(o)?o:new Zi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),l=0;for(let u=0;u<a.length;u+=3){let m=h.fromArray(a,u,Z$),p=s.cartesianToCartographic(m,fGe),y=o.project(p,Z$);c[l++]=y.x,c[l++]=y.y,c[l++]=y.z}return e.attributes[n]=r,e.attributes[i]=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var V3={high:0,low:0};Lc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let u=0;u<s;++u)On.encode(r[u],V3),a[u]=V3.high,c[u]=V3.low;let l=o.componentsPerAttribute;return e.attributes[n]=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:l,values:a}),e.attributes[i]=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:l,values:c}),delete e.attributes[t],e};var lm=new h;function L3(e,t){if(d(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,lm),F.multiplyByPoint(e,lm,lm),h.pack(lm,n,o)}}function R3(e,t){if(d(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,lm),$.multiplyByVector(e,lm,lm),lm=h.normalize(lm,lm),h.pack(lm,n,o)}}var nM=new F,iM=new $;Lc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;L3(t,n.position),L3(t,n.prevPosition),L3(t,n.nextPosition),(d(n.normal)||d(n.tangent)||d(n.bitangent))&&(F.inverse(t,nM),F.transpose(nM,nM),F.getMatrix3(nM,iM),R3(iM,n.normal),R3(iM,n.tangent),R3(iM,n.bitangent));let i=e.geometry.boundingSphere;return d(i)&&(e.geometry.boundingSphere=ce.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function pGe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&d(o[r])&&d(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let l=1;l<n;++l){let u=e[l][t].attributes[r];if(!d(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){c=!1;break}a+=u.values.length}c&&(i[r]=new Ze({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Q.createTypedArray(s.componentDatatype,a)}))}return i}var bGe=new h;function Z3(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=d(e[0][t].indices),l=e[0][t].primitiveType,u=pGe(e,t),m,p,y;for(i in u)if(u.hasOwnProperty(i))for(m=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,y=p.length,r=0;r<y;++r)m[s++]=p[r];let f;if(c){let V=0;for(o=0;o<n;++o)V+=e[o][t].indices.length;let L=dt.computeNumberOfVertices(new dt({attributes:u,primitiveType:Fe.POINTS})),Z=Ue.createTypedArray(L,V),G=0,X=0;for(o=0;o<n;++o){let P=e[o][t].indices,v=P.length;for(s=0;s<v;++s)Z[G++]=X+P[s];X+=dt.computeNumberOfVertices(e[o][t])}f=Z}let x=new h,_=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!d(C)){x=void 0;break}h.add(C.center,x,x)}if(d(x))for(h.divideByScalar(x,n,x),o=0;o<n;++o){C=e[o][t].boundingSphere;let V=h.magnitude(h.subtract(C.center,x,bGe))+C.radius;V>_&&(_=V)}return new dt({attributes:u,indices:f,primitiveType:l,boundingSphere:d(x)?new ce(x,_):void 0})}Lc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];d(s.geometry)?t.push(s):d(s.westHemisphereGeometry)&&d(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(Z3(t,"geometry")),n.length>0&&(o.push(Z3(n,"westHemisphereGeometry")),o.push(Z3(n,"eastHemisphereGeometry"))),o};var jd=new h,BG=new h,pS=new h,bS=new h;Lc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),l;for(l=0;l<o;l++)s[l]={indexOffset:0,count:0,currentCount:0};let u=0;for(l=0;l<r;l+=3){let f=t[l],x=t[l+1],_=t[l+2],C=f*3,V=x*3,L=_*3;BG.x=i[C],BG.y=i[C+1],BG.z=i[C+2],pS.x=i[V],pS.y=i[V+1],pS.z=i[V+2],bS.x=i[L],bS.y=i[L+1],bS.z=i[L+2],s[f].count++,s[x].count++,s[_].count++,h.subtract(pS,BG,pS),h.subtract(bS,BG,bS),a[u]=h.cross(pS,bS,new h),u++}let m=0;for(l=0;l<o;l++)s[l].indexOffset+=m,m+=s[l].count;u=0;let p;for(l=0;l<r;l+=3){p=s[t[l]];let f=p.indexOffset+p.currentCount;c[f]=u,p.currentCount++,p=s[t[l+1]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,p=s[t[l+2]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,u++}let y=new Float32Array(o*3);for(l=0;l<o;l++){let f=l*3;if(p=s[l],h.clone(h.ZERO,jd),p.count>0){for(u=0;u<p.count;u++)h.add(jd,a[c[p.indexOffset+u]],jd);h.equalsEpsilon(h.ZERO,jd,W.EPSILON10)&&h.clone(a[c[p.indexOffset]],jd)}h.equalsEpsilon(h.ZERO,jd,W.EPSILON10)&&(jd.z=1),h.normalize(jd,jd),y[f]=jd.x,y[f+1]=jd.y,y[f+2]=jd.z}return e.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y}),e};var yGe=new h,G$=new h,gGe=new h;Lc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),l;for(l=0;l<c.length;l++)c[l]=0;let u,m,p;for(l=0;l<a;l+=3){let x=n[l],_=n[l+1],C=n[l+2];u=x*3,m=_*3,p=C*3;let V=x*2,L=_*2,Z=C*2,G=i[u],X=i[u+1],P=i[u+2],v=r[V],A=r[V+1],M=r[L+1]-A,b=r[Z+1]-A,R=1/((r[L]-v)*b-(r[Z]-v)*M),E=(b*(i[m]-G)-M*(i[p]-G))*R,I=(b*(i[m+1]-X)-M*(i[p+1]-X))*R,w=(b*(i[m+2]-P)-M*(i[p+2]-P))*R;c[u]+=E,c[u+1]+=I,c[u+2]+=w,c[m]+=E,c[m+1]+=I,c[m+2]+=w,c[p]+=E,c[p+1]+=I,c[p+2]+=w}let y=new Float32Array(s*3),f=new Float32Array(s*3);for(l=0;l<s;l++){u=l*3,m=u+1,p=u+2;let x=h.fromArray(o,u,yGe),_=h.fromArray(c,u,gGe),C=h.dot(x,_);h.multiplyByScalar(x,C,G$),h.normalize(h.subtract(_,G$,_),_),y[u]=_.x,y[m]=_.y,y[p]=_.z,h.normalize(h.cross(x,_,_),_),f[u]=_.x,f[m]=_.y,f[p]=_.z}return e.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f}),e};var YG=new D,cm=new h,E$=new h,X$=new h,oM=new D;Lc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(d(t)){let X=t.values;i=X.length/3;let P=new Float32Array(i*2),v=0;for(n=0;n<i;++n){if(h.fromArray(X,n*3,cm),h.equals(cm,h.ZERO)){v+=2;continue}oM=Kn.octEncodeInRange(cm,65535,oM),P[v++]=oM.x,P[v++]=oM.y}return e.attributes.compressedAttributes=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:P}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=d(o),a=d(r);if(!s&&!a)return e;let c=e.attributes.tangent,l=e.attributes.bitangent,u=d(c),m=d(l),p,y,f,x;s&&(p=o.values),a&&(y=r.values),u&&(f=c.values),m&&(x=l.values),i=(s?p.length:y.length)/(s?3:2);let V=i,L=a&&s?2:1;L+=u||m?1:0,V*=L;let Z=new Float32Array(V),G=0;for(n=0;n<i;++n){a&&(D.fromArray(y,n*2,YG),Z[G++]=Kn.compressTextureCoordinates(YG));let X=n*3;s&&d(f)&&d(x)?(h.fromArray(p,X,cm),h.fromArray(f,X,E$),h.fromArray(x,X,X$),Kn.octPack(cm,E$,X$,YG),Z[G++]=YG.x,Z[G++]=YG.y):(s&&(h.fromArray(p,X,cm),Z[G++]=Kn.octEncodeFloat(cm)),u&&(h.fromArray(f,X,cm),Z[G++]=Kn.octEncodeFloat(cm)),m&&(h.fromArray(x,X,cm),Z[G++]=Kn.octEncodeFloat(cm)))}return e.attributes.compressedAttributes=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:L,values:Z}),s&&delete e.attributes.normal,a&&delete e.attributes.st,m&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function xGe(e){if(d(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function _Ge(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Fe.TRIANGLES,e}function TGe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Fe.TRIANGLES,e}function SGe(e){if(d(e.indices))return e;let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function CGe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Fe.LINES,e}function VGe(e){let t=dt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Fe.LINES,e}function LGe(e){switch(e.primitiveType){case Fe.TRIANGLE_FAN:return _Ge(e);case Fe.TRIANGLE_STRIP:return TGe(e);case Fe.TRIANGLES:return xGe(e);case Fe.LINE_STRIP:return CGe(e);case Fe.LINE_LOOP:return VGe(e);case Fe.LINES:return SGe(e)}return e}function hb(e,t){Math.abs(e.y)<W.EPSILON6&&(t?e.y=-W.EPSILON6:e.y=W.EPSILON6)}function RGe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){hb(e,e.y<0),hb(t,t.y<0),hb(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;hb(e,a),hb(t,a),hb(n,a)}var I$=new h;function qd(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,I$),e.y/(e.y-t.y),I$),n),h.clone(n,i),hb(n,!0),hb(i,!1)}var Og=new h,Kg=new h,Hg=new h,zg=new h,G3={positions:new Array(7),indices:new Array(3*3)};function ZGe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;RGe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=G3.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(qd(e,t,Og,Hg),qd(e,n,Kg,zg),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(qd(t,n,Og,Hg),qd(t,e,Kg,zg),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(qd(n,e,Og,Hg),qd(n,t,Kg,zg),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(qd(n,e,Og,Hg),qd(n,t,Kg,zg),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(qd(t,n,Og,Hg),qd(t,e,Kg,zg),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(qd(e,t,Og,Hg),qd(e,n,Kg,zg),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=G3.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Og,c[4]=Kg,c[5]=Hg,c[6]=zg,c.length=7),G3}function W$(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&d(n[o])&&d(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=dt.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=ce.fromVertices(n.position.values)),e}function gS(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&d(t[i])&&d(t[i].values)){let o=t[i];n[i]=new Ze({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new dt({attributes:n,indices:[],primitiveType:e.primitiveType})}function W3(e,t,n){let i=d(e.geometry.boundingSphere);t=W$(t,i),n=W$(n,i),d(n)&&!d(t)?e.geometry=n:!d(n)&&d(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function P3(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,l,u,m,p){let y=e.fromArray(l,r*t,n),f=e.fromArray(l,s*t,i),x=e.fromArray(l,a*t,o);e.multiplyByScalar(y,c.x,y),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(y,f,y);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var GGe=P3(se,4),aM=P3(h,3),M$=P3(D,2),EGe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,l=o[n]*i.z;r[s]=a+c+l>W.EPSILON6?1:0},OG=new h,E3=new h,X3=new h,XGe=new h;function rM(e,t,n,i,o,r,s,a,c,l,u,m,p,y,f,x){if(!d(r)&&!d(s)&&!d(a)&&!d(c)&&!d(l)&&y===0)return;let _=h.fromArray(o,e*3,OG),C=h.fromArray(o,t*3,E3),V=h.fromArray(o,n*3,X3),L=Yg(i,_,C,V,XGe);if(d(L)){if(d(r)&&aM(e,t,n,L,r,m.normal.values,x,!0),d(l)){let Z=h.fromArray(l,e*3,OG),G=h.fromArray(l,t*3,E3),X=h.fromArray(l,n*3,X3);h.multiplyByScalar(Z,L.x,Z),h.multiplyByScalar(G,L.y,G),h.multiplyByScalar(X,L.z,X);let P;!h.equals(Z,h.ZERO)||!h.equals(G,h.ZERO)||!h.equals(X,h.ZERO)?(P=h.add(Z,G,Z),h.add(P,X,P),h.normalize(P,P)):(P=OG,P.x=0,P.y=0,P.z=0),h.pack(P,m.extrudeDirection.values,x*3)}if(d(u)&&EGe(e,t,n,L,u,m.applyOffset.values,x),d(s)&&aM(e,t,n,L,s,m.tangent.values,x,!0),d(a)&&aM(e,t,n,L,a,m.bitangent.values,x,!0),d(c)&&M$(e,t,n,L,c,m.st.values,x),y>0)for(let Z=0;Z<y;Z++){let G=p[Z];IGe(e,t,n,L,x,f[G],m[G])}}}function IGe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,l=s.values;switch(a){case 4:GGe(e,t,n,i,c,l,o,!1);break;case 3:aM(e,t,n,i,c,l,o,!1);break;case 2:M$(e,t,n,i,c,l,o,!1);break;default:l[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Mh(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var WGe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function P$(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=d(n.normal)?n.normal.values:void 0,r=d(n.bitangent)?n.bitangent.values:void 0,s=d(n.tangent)?n.tangent.values:void 0,a=d(n.st)?n.st.values:void 0,c=d(n.extrudeDirection)?n.extrudeDirection.values:void 0,l=d(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,m=[];for(let P in n)n.hasOwnProperty(P)&&!WGe[P]&&d(n[P])&&m.push(P);let p=m.length,y=gS(t),f=gS(t),x,_,C,V,L,Z=[];Z.length=i.length/3;let G=[];for(G.length=i.length/3,L=0;L<Z.length;++L)Z[L]=-1,G[L]=-1;let X=u.length;for(L=0;L<X;L+=3){let P=u[L],v=u[L+1],A=u[L+2],M=h.fromArray(i,P*3),b=h.fromArray(i,v*3),R=h.fromArray(i,A*3),E=ZGe(M,b,R);if(d(E)&&E.positions.length>3){let I=E.positions,w=E.indices,N=w.length;for(let Y=0;Y<N;++Y){let k=w[Y],O=I[k];O.y<0?(x=f.attributes,_=f.indices,C=Z):(x=y.attributes,_=y.indices,C=G),V=Mh(x,_,C,u,k<3?L+k:-1,O),rM(P,v,A,O,i,o,s,r,a,c,l,x,m,p,n,V)}}else d(E)&&(M=E.positions[0],b=E.positions[1],R=E.positions[2]),M.y<0?(x=f.attributes,_=f.indices,C=Z):(x=y.attributes,_=y.indices,C=G),V=Mh(x,_,C,u,L,M),rM(P,v,A,M,i,o,s,r,a,c,l,x,m,p,n,V),V=Mh(x,_,C,u,L+1,b),rM(P,v,A,b,i,o,s,r,a,c,l,x,m,p,n,V),V=Mh(x,_,C,u,L+2,R),rM(P,v,A,R,i,o,s,r,a,c,l,x,m,p,n,V)}W3(e,f,y)}var N$=on.fromPointNormal(h.ZERO,h.UNIT_Y),PGe=new h,vGe=new h;function yS(e,t,n,i,o,r,s){if(!d(s))return;let a=h.fromArray(i,e*3,OG);h.equalsEpsilon(a,n,W.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function v$(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=d(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=gS(t),a=gS(t),c,l=r.length,u=[];u.length=i.length/3;let m=[];for(m.length=i.length/3,c=0;c<u.length;++c)u[c]=-1,m[c]=-1;for(c=0;c<l;c+=2){let p=r[c],y=r[c+1],f=h.fromArray(i,p*3,OG),x=h.fromArray(i,y*3,E3),_;Math.abs(f.y)<W.EPSILON6&&(f.y<0?f.y=-W.EPSILON6:f.y=W.EPSILON6),Math.abs(x.y)<W.EPSILON6&&(x.y<0?x.y=-W.EPSILON6:x.y=W.EPSILON6);let C=s.attributes,V=s.indices,L=m,Z=a.attributes,G=a.indices,X=u,P=Si.lineSegmentPlane(f,x,N$,X3);if(d(P)){let v=h.multiplyByScalar(h.UNIT_Y,5*W.EPSILON9,PGe);f.y<0&&(h.negate(v,v),C=a.attributes,V=a.indices,L=u,Z=s.attributes,G=s.indices,X=m);let A=h.add(P,v,vGe);_=Mh(C,V,L,r,c,f),yS(p,y,f,i,_,C,o),_=Mh(C,V,L,r,-1,A),yS(p,y,A,i,_,C,o),h.negate(v,v),h.add(P,v,A),_=Mh(Z,G,X,r,-1,A),yS(p,y,A,i,_,Z,o),_=Mh(Z,G,X,r,c+1,x),yS(p,y,x,i,_,Z,o)}else{let v,A,M;f.y<0?(v=a.attributes,A=a.indices,M=u):(v=s.attributes,A=s.indices,M=m),_=Mh(v,A,M,r,c,f),yS(p,y,f,i,_,v,o),_=Mh(v,A,M,r,c+1,x),yS(p,y,x,i,_,v,o)}}W3(e,a,s)}var w$=new D,wGe=new D,U$=new h,k$=new h,I3=new h,FGe=new h,AGe=new h,MGe=new h,F$=new se;function A$(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=h.unpack(n,s,U$);if(a.x>0)continue;let c=h.unpack(i,s,k$);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let l=h.unpack(o,s,I3);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var NGe=5*W.EPSILON9,sM=W.EPSILON6;function UGe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=d(n.st)?n.st.values:void 0,c=d(n.color)?n.color.values:void 0,l=gS(t),u=gS(t),m,p,y,f=!1,x=i.length/3;for(m=0;m<x;m+=4){let _=m,C=m+2,V=h.fromArray(i,_*3,U$),L=h.fromArray(i,C*3,k$);if(Math.abs(V.y)<sM)for(V.y=sM*(L.y<0?-1:1),i[m*3+1]=V.y,i[(m+1)*3+1]=V.y,p=_*3;p<_*3+4*3;p+=3)o[p]=i[m*3],o[p+1]=i[m*3+1],o[p+2]=i[m*3+2];if(Math.abs(L.y)<sM)for(L.y=sM*(V.y<0?-1:1),i[(m+2)*3+1]=L.y,i[(m+3)*3+1]=L.y,p=_*3;p<_*3+4*3;p+=3)r[p]=i[(m+2)*3],r[p+1]=i[(m+2)*3+1],r[p+2]=i[(m+2)*3+2];let Z=l.attributes,G=l.indices,X=u.attributes,P=u.indices,v=Si.lineSegmentPlane(V,L,N$,FGe);if(d(v)){f=!0;let A=h.multiplyByScalar(h.UNIT_Y,NGe,AGe);V.y<0&&(h.negate(A,A),Z=u.attributes,G=u.indices,X=l.attributes,P=l.indices);let M=h.add(v,A,MGe);Z.position.values.push(V.x,V.y,V.z,V.x,V.y,V.z),Z.position.values.push(M.x,M.y,M.z),Z.position.values.push(M.x,M.y,M.z),Z.prevPosition.values.push(o[_*3],o[_*3+1],o[_*3+2]),Z.prevPosition.values.push(o[_*3+3],o[_*3+4],o[_*3+5]),Z.prevPosition.values.push(V.x,V.y,V.z,V.x,V.y,V.z),Z.nextPosition.values.push(M.x,M.y,M.z),Z.nextPosition.values.push(M.x,M.y,M.z),Z.nextPosition.values.push(M.x,M.y,M.z),Z.nextPosition.values.push(M.x,M.y,M.z),h.negate(A,A),h.add(v,A,M),X.position.values.push(M.x,M.y,M.z),X.position.values.push(M.x,M.y,M.z),X.position.values.push(L.x,L.y,L.z,L.x,L.y,L.z),X.prevPosition.values.push(M.x,M.y,M.z),X.prevPosition.values.push(M.x,M.y,M.z),X.prevPosition.values.push(M.x,M.y,M.z),X.prevPosition.values.push(M.x,M.y,M.z),X.nextPosition.values.push(L.x,L.y,L.z,L.x,L.y,L.z),X.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),X.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let b=D.fromArray(s,_*2,w$),R=Math.abs(b.y);Z.expandAndWidth.values.push(-1,R,1,R),Z.expandAndWidth.values.push(-1,-R,1,-R),X.expandAndWidth.values.push(-1,R,1,R),X.expandAndWidth.values.push(-1,-R,1,-R);let E=h.magnitudeSquared(h.subtract(v,V,I3));if(E/=h.magnitudeSquared(h.subtract(L,V,I3)),d(c)){let I=se.fromArray(c,_*4,F$),w=se.fromArray(c,C*4,F$),N=W.lerp(I.x,w.x,E),Y=W.lerp(I.y,w.y,E),k=W.lerp(I.z,w.z,E),O=W.lerp(I.w,w.w,E);for(p=_*4;p<_*4+2*4;++p)Z.color.values.push(c[p]);for(Z.color.values.push(N,Y,k,O),Z.color.values.push(N,Y,k,O),X.color.values.push(N,Y,k,O),X.color.values.push(N,Y,k,O),p=C*4;p<C*4+2*4;++p)X.color.values.push(c[p])}if(d(a)){let I=D.fromArray(a,_*2,w$),w=D.fromArray(a,(m+3)*2,wGe),N=W.lerp(I.x,w.x,E);for(p=_*2;p<_*2+2*2;++p)Z.st.values.push(a[p]);for(Z.st.values.push(N,I.y),Z.st.values.push(N,w.y),X.st.values.push(N,I.y),X.st.values.push(N,w.y),p=C*2;p<C*2+2*2;++p)X.st.values.push(a[p])}y=Z.position.values.length/3-4,G.push(y,y+2,y+1),G.push(y+1,y+2,y+3),y=X.position.values.length/3-4,P.push(y,y+2,y+1),P.push(y+1,y+2,y+3)}else{let A,M;for(V.y<0?(A=u.attributes,M=u.indices):(A=l.attributes,M=l.indices),A.position.values.push(V.x,V.y,V.z),A.position.values.push(V.x,V.y,V.z),A.position.values.push(L.x,L.y,L.z),A.position.values.push(L.x,L.y,L.z),p=m*3;p<m*3+4*3;++p)A.prevPosition.values.push(o[p]),A.nextPosition.values.push(r[p]);for(p=m*2;p<m*2+4*2;++p)A.expandAndWidth.values.push(s[p]),d(a)&&A.st.values.push(a[p]);if(d(c))for(p=m*4;p<m*4+4*4;++p)A.color.values.push(c[p]);y=A.position.values.length/3-4,M.push(y,y+2,y+1),M.push(y+1,y+2,y+3)}}f&&(A$(u),A$(l)),W3(e,u,l)}Lc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(d(n)&&(n.center.x-n.radius>0||ce.intersectPlane(n,on.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==Hd.NONE)switch(t.geometryType){case Hd.POLYLINES:UGe(e);break;case Hd.TRIANGLES:P$(e);break;case Hd.LINES:v$(e);break}else LGe(t),t.primitiveType===Fe.TRIANGLES?P$(e):t.primitiveType===Fe.LINES&&v$(e);return e};var An=Lc;var BBt=T(S(),1);function ll(e){this._ellipsoid=g(e,re.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(ll.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ll.mercatorAngleToGeodeticLatitude=function(e){return W.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};ll.geodeticLatitudeToMercatorAngle=function(e){e>ll.MaximumLatitude?e=ll.MaximumLatitude:e<-ll.MaximumLatitude&&(e=-ll.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};ll.MaximumLatitude=ll.mercatorAngleToGeodeticLatitude(Math.PI);ll.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=ll.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return d(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};ll.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=ll.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return d(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Ei=ll;function kGe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)d(e[r].geometry)&&An.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function v3(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function DGe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];d(i.geometry)?v3(i.geometry,n):d(i.westHemisphereGeometry)&&d(i.eastHemisphereGeometry)&&(v3(i.westHemisphereGeometry,n),v3(i.eastHemisphereGeometry,n))}}function BGe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,l,u,m=t.length;for(c=0;c<m;++c)if(d(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(kGe(t,a,o),!o)for(c=0;c<m;++c)d(t[c].geometry)&&An.splitLongitude(t[c]);if(DGe(t),r)for(c=0;c<m;++c){let y=t[c];d(y.geometry)?(An.reorderForPostVertexCache(y.geometry),An.reorderForPreVertexCache(y.geometry)):d(y.westHemisphereGeometry)&&d(y.eastHemisphereGeometry)&&(An.reorderForPostVertexCache(y.westHemisphereGeometry),An.reorderForPreVertexCache(y.westHemisphereGeometry),An.reorderForPostVertexCache(y.eastHemisphereGeometry),An.reorderForPreVertexCache(y.eastHemisphereGeometry))}let p=An.combineInstances(t);for(m=p.length,c=0;c<m;++c){l=p[c];let y=l.attributes;if(o)for(let f in y)y.hasOwnProperty(f)&&y[f].componentDatatype===Q.DOUBLE&&An.encodeAttribute(l,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in y)if(y.hasOwnProperty(f)&&y[f].componentDatatype===Q.DOUBLE){let x=`${f}3D`,_=`${f}2D`;An.projectTo2D(l,f,x,_,n),d(l.boundingSphere)&&f==="position"&&(l.boundingSphereCV=ce.fromVertices(l.attributes.position2D.values)),An.encodeAttribute(l,x,`${x}High`,`${x}Low`),An.encodeAttribute(l,_,`${_}High`,`${_}Low`)}s&&An.compressVertices(l)}if(!i){let y=[];for(m=p.length,c=0;c<m;++c)l=p[c],y=y.concat(An.fitToUnsignedShortIndices(l));p=y}return p}function w3(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let l=i[a];o=l.offset+l.count,s=l.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let l=0;l<c;++l){let m=e[l][t];if(!d(m))continue;let p=m.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function YGe(e,t){let n=[];return w3(e,"geometry",t,n),w3(e,"westHemisphereGeometry",t,n),w3(e,"eastHemisphereGeometry",t,n),n}var sp={};sp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=BGe(e),t.length>0&&(n=An.createAttributeLocations(t[0]),e.createPickOffsets&&(r=YGe(i,t))),d(i[0].attributes)&&d(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),l=new Array(o);for(let u=0;u<o;++u){let m=i[u],p=m.geometry;d(p)&&(c[u]=p.boundingSphere,l[u]=p.boundingSphereCV,a&&(s[u]=m.geometry.offsetAttribute));let y=m.eastHemisphereGeometry,f=m.westHemisphereGeometry;d(y)&&d(f)&&(d(y.boundingSphere)&&d(f.boundingSphere)&&(c[u]=ce.union(y.boundingSphere,f.boundingSphere)),d(y.boundingSphereCV)&&d(f.boundingSphereCV)&&(l[u]=ce.union(y.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:l}};function OGe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];d(o)&&d(o.values)&&t.push(o.values.buffer)}d(e.indices)&&t.push(e.indices.buffer)}function KGe(e,t){let n=e.length;for(let i=0;i<n;++i)OGe(e[i],t)}function HGe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!d(o))continue;let r=o.attributes;t+=7+2*ce.packedLength+(d(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&d(r[s])){let a=r[s];t+=5+a.values.length}}return t}sp.packCreateGeometryResults=function(e,t){let n=new Float64Array(HGe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],l=d(c);if(n[s++]=l?1:0,!l)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=g(c.offsetAttribute,-1);let u=d(c.boundingSphere)?1:0;n[s++]=u,u&&ce.pack(c.boundingSphere,n,s),s+=ce.packedLength;let m=d(c.boundingSphereCV)?1:0;n[s++]=m,m&&ce.pack(c.boundingSphereCV,n,s),s+=ce.packedLength;let p=c.attributes,y=[];for(let x in p)p.hasOwnProperty(x)&&d(p[x])&&(y.push(x),d(o[x])||(o[x]=i.length,i.push(x)));n[s++]=y.length;for(let x=0;x<y.length;x++){let _=y[x],C=p[_];n[s++]=o[_],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let f=d(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};sp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],l=n[s++],u=n[s++];u===-1&&(u=void 0);let m,p;n[s++]===1&&(m=ce.unpack(n,s)),s+=ce.packedLength,n[s++]===1&&(p=ce.unpack(n,s)),s+=ce.packedLength;let x,_,C,V=new hn,L=n[s++];for(i=0;i<L;i++){let G=t[n[s++]],X=n[s++];C=n[s++];let P=n[s++]!==0;x=n[s++],_=Q.createTypedArray(X,x);for(let v=0;v<x;v++)_[v]=n[s++];V[G]=new Ze({componentDatatype:X,componentsPerAttribute:C,normalize:P,values:_})}let Z;if(x=n[s++],x>0){let G=_.length/C;for(Z=Ue.createTypedArray(G,x),i=0;i<x;i++)Z[i]=n[s++]}o[r++]=new dt({primitiveType:c,geometryType:l,boundingSphere:m,boundingSphereCV:p,indices:Z,attributes:V,offsetAttribute:u})}return o};function zGe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,d(s.attributes)&&d(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function JGe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,d(t[o])&&(s={offset:new zi(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}sp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:zGe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Zi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};sp.unpackCombineGeometryParameters=function(e){let t=JGe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=sp.unpackCreateGeometryResults(n[a]),l=c.length;for(let u=0;u<l;u++){let m=c[u],p=t[o];p.geometry=m,++o}}let r=re.clone(e.ellipsoid),s=e.isGeographic?new Zi(r):new Ei(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function D$(e){let t=e.length,n=1+(ce.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];d(s)?(i[o++]=1,ce.pack(e[r],i,o)):i[o++]=0,o+=ce.packedLength}return i}function B$(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ce.unpack(e,i)),++n,i+=ce.packedLength;return t}sp.packCombineGeometryResults=function(e,t){d(e.geometries)&&KGe(e.geometries,t);let n=D$(e.boundingSpheres),i=D$(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};sp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:B$(e.boundingSpheres),boundingSpheresCV:B$(e.boundingSpheresCV)}};var Jg=sp;var a3t=T(S(),1),QGe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},mr=Object.freeze(QGe);var l3t=T(S(),1),Jl={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Jl.NUMBER_OF_SHADOW_MODES=4;Jl.castShadows=function(e){return e===Jl.ENABLED||e===Jl.CAST_ONLY};Jl.receiveShadows=function(e){return e===Jl.ENABLED||e===Jl.RECEIVE_ONLY};Jl.fromCastReceive=function(e,t){return e&&t?Jl.ENABLED:e?Jl.CAST_ONLY:t?Jl.RECEIVE_ONLY:Jl.DISABLED};var xn=Object.freeze(Jl);function hr(e){e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=g(e.show,!0),this._vertexCacheOptimize=g(e.vertexCacheOptimize,!1),this._interleave=g(e.interleave,!1),this._releaseGeometryInstances=g(e.releaseGeometryInstances,!0),this._allowPicking=g(e.allowPicking,!0),this._asynchronous=g(e.asynchronous,!0),this._compressVertices=g(e.compressVertices,!0),this.cull=g(e.cull,!0),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=g(e.shadows,xn.DISABLED),this._translucent=void 0,this._state=mr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(hr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function jGe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&d(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!d(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var qGe=new D,$Ge=new h,q$=new se;function $$(e){let t=e.length;if(t===1)return e[0];if(t===2)return D.unpack(e,0,qGe);if(t===3)return h.unpack(e,0,$Ge);if(t===4)return se.unpack(e,0,q$)}function eEe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=jGe(i),s=r.length,a=[],c={},l={},u,p=i[0].attributes,y,f,x;for(y=0;y<s;++y)f=r[y],x=p[f],c[f]=y,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:1}),l.center3DHigh=a.length-5,l.center3DLow=a.length-4,l.center2DHigh=a.length-3,l.center2DLow=a.length-2,l.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Q.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let _=a.length,C=new Bg(t,a,o);for(y=0;y<o;++y){let V=i[y];p=V.attributes;for(let P=0;P<s;++P){f=r[P],x=p[f];let v=$$(x.value),A=c[f];C.setBatchedAttribute(y,A,v)}let L={primitive:g(V.pickPrimitive,e)};d(V.id)&&(L.id=V.id);let Z=t.createPickId(L);e._pickIds.push(Z);let G=Z.color,X=q$;X.x=B.floatToByte(G.red),X.y=B.floatToByte(G.green),X.z=B.floatToByte(G.blue),X.w=B.floatToByte(G.alpha),C.setBatchedAttribute(y,_-1,X)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=l,e._batchTableOffsetAttribute2DIndex=u}function tEe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ze({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function nEe(e){let t=e.attributes,n=new hn;for(let o in t)t.hasOwnProperty(o)&&d(t[o])&&(n[o]=tEe(t[o]));let i;if(d(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new dt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ce.clone(e.boundingSphere)})}function iEe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var oEe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;hr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=oEe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
`),d(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
`,r+=`in vec4 position;
`,s+=`${c}
{
    return u_modifiedModelView * position;
}

`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
{
    return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}

`:(r+=`in vec3 ${a}2DHigh;
in vec3 ${a}2DLow;
`,s+=`${c}
{
    vec4 p;
    if (czm_morphTime == 1.0)
    {
        p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
    }
    else if (czm_morphTime == 0.0)
    {
        p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
    }
    else
    {
        p = czm_columbusViewMorph(
                czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
                czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
                czm_morphTime);
    }
    return p;
}

`)}return[o,r,t,s].join(`
`)};hr._appendShowToShader=function(e,t){return d(e._batchTableAttributeIndices.show)?`${Be.replaceMain(t,"czm_non_show_main")}
void main() 
{ 
    czm_non_show_main(); 
    gl_Position *= czm_batchTable_show(batchId); 
}`:t};hr._updateColorAttribute=function(e,t,n){if(!d(e._batchTableAttributeIndices.color)&&!d(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Y$(e){return`${Be.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor; 
void main() 
{ 
    czm_non_pick_main(); 
    v_pickColor = czm_batchTable_pickColor(batchId); 
}`}function O$(e){return`in vec4 v_pickColor;
${e}`}hr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};hr._appendOffsetToShader=function(e,t){if(!d(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
`;return o+=`    if (czm_sceneMode == czm_sceneMode3D)
`,o+=`    {
`,o+="        $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=`    }
`,o+=`    else
`,o+=`    {
`,o+="        $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=`    }
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};hr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!d(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Be.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() 
{ 
    czm_non_distanceDisplayCondition_main(); 
    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
`;return n?o+=`    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
`:o+=`    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
    vec4 centerRTE;
    if (czm_morphTime == 1.0)
    {
        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
    }
    else if (czm_morphTime == 0.0)
    {
        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
    }
    else
    {
        centerRTE = czm_columbusViewMorph(
                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
                czm_morphTime);
    }
`,o+=`    float radiusSq = boundingSphereRadius * boundingSphereRadius; 
    float distanceSq; 
    if (czm_sceneMode == czm_sceneMode2D) 
    { 
        distanceSq = czm_eyeHeight2D.y - radiusSq; 
    } 
    else 
    { 
        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; 
    } 
    distanceSq = max(distanceSq, 0.0); 
    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; 
    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; 
    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; 
    gl_Position *= show; 
}`,`${i}
${o}`};function K$(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",l=`in ${a} ${c};`,u="",m="";if(i){u+=`vec2 st;
`;let f=s>1?`${c}.x`:c;m+=`    st = czm_decompressTextureCoordinates(${f});
`}n&&o&&r?(u+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,m+=`    czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(u+=`vec3 normal;
`,m+=`    normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
`),o&&(u+=`vec3 tangent;
`,m+=`    tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`),r&&(u+=`vec3 bitangent;
`,m+=`    bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Be.replaceMain(p,"czm_non_compressed_main");let y=`void main() 
{ 
${m}    czm_non_compressed_main(); 
}`;return[l,u,p,y].join(`
`)}function rEe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    gl_Position = czm_depthClamp(gl_Position);}
`,t}function sEe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    #if defined(LOG_DEPTH)
        czm_writeLogDepth();
    #else
        czm_writeDepthClamp();
    #endif
}
`,t}function H$(e,t){let n=e.vertexAttributes}function aEe(e,t){return function(){return e[t]}}var F3=Math.max(Mt.hardwareConcurrency-1,1),lM,cEe=new pi("combineGeometry");function lEe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===mr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],l=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),l.push({moduleName:i._workerName,geometry:i});if(!d(lM))for(lM=new Array(F3),o=0;o<F3;o++)lM[o]=new pi("createGeometry");let u;for(l=NG(l,F3),o=0;o<l.length;o++){let m=0,p=l[o],y=p.length;for(r=0;r<y;++r)u=p[r],i=u.geometry,d(i.constructor.pack)&&(u.offset=m,m+=g(i.constructor.packedLength,i.packedLength));let f;if(m>0){let x=new Float64Array(m);for(f=[x.buffer],r=0;r<y;++r)u=p[r],i=u.geometry,d(i.constructor.pack)&&(i.constructor.pack(i,x,u.offset),u.geometry=x)}c.push(lM[o].scheduleTask({subTasks:l[o]},f))}e._state=mr.CREATING,Promise.all(c).then(function(m){e._createGeometryResults=m,e._state=mr.CREATED}).catch(function(m){HG(e,t,mr.FAILED,m)})}else if(e._state===mr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,l=t.mapProjection,u=cEe.scheduleTask(Jg.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:l.ellipsoid,projection:l,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=mr.COMBINING,Promise.resolve(u).then(function(m){let p=Jg.unpackCombineGeometryResults(m);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,d(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=mr.COMBINED):HG(e,t,mr.FAILED,void 0)}).catch(function(m){HG(e,t,mr.FAILED,m)})}}function dEe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,y;d(p.attributes)&&d(p.primitiveType)?y=nEe(p):y=p.constructor.createGeometry(p),o[c++]=iEe(s,y),r.push(s.id)}o.length=c;let l=t.scene3DOnly,u=t.mapProjection,m=Jg.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=F.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,d(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=mr.COMBINED):HG(e,t,mr.FAILED,void 0)}function uEe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!d(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!d(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ce;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],_=e._batchTable.getBatchedAttribute(i,n,new h);x=r[i].clone(x),iee(x,_,o[i])}let c=[],l=[],u=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ce.intersectPlane(x,on.ORIGIN_ZX_PLANE)!==qt.INTERSECTING?c.push(x):(l.push(x),u.push(x))}let m=c[0],p=u[0],y=l[0];for(i=1;i<c.length;i++)m=ce.union(m,c[i]);for(i=1;i<u.length;i++)p=ce.union(p,u[i]);for(i=1;i<l.length;i++)y=ce.union(y,l[i]);let f=[];for(d(m)&&f.push(m),d(p)&&f.push(p),d(y)&&f.push(y),i=0;i<f.length;i++){let x=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ce.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}hr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var z$=new On,eee=new he,tee=new h,nee=new ce;function mEe(e,t){if(!d(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,l=t.mapProjection,u=l.ellipsoid,m=e._batchTable,p=e._instanceBoundingSpheres,y=p.length;for(let f=0;f<y;++f){let x=p[f];if(!d(x))continue;let _=e.modelMatrix;d(_)&&(x=ce.transform(x,_,nee));let C=x.center,V=x.radius,L=On.fromCartesian(C,z$);if(m.setBatchedAttribute(f,o,L.high),m.setBatchedAttribute(f,r,L.low),!t.scene3DOnly){let Z=u.cartesianToCartographic(C,eee),G=l.project(Z,tee);L=On.fromCartesian(G,z$),m.setBatchedAttribute(f,s,L.high),m.setBatchedAttribute(f,a,L.low)}m.setBatchedAttribute(f,c,V)}e._batchTableBoundingSpheresUpdated=!0}var A3=new h,hEe=new h;function J$(e,t){if(!d(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let l=0;l<c;++l){let u=a[l];if(!d(u))continue;let m=s.getBatchedAttribute(l,e._batchTableAttributeIndices.offset);if(h.equals(m,h.ZERO)){s.setBatchedAttribute(l,i,h.ZERO);continue}let p=e.modelMatrix;d(p)&&(u=ce.transform(u,p,nee));let y=u.center;y=r.scaleToGeodeticSurface(y,hEe);let f=r.cartesianToCartographic(y,eee),x=o.project(f,tee),_=h.add(m,y,A3);f=r.cartesianToCartographic(_,f);let C=o.project(f,A3),V=h.subtract(C,x,A3),L=V.x;V.x=V.z,V.z=V.y,V.y=L,s.setBatchedAttribute(l,i,V)}e._batchTableOffsetsUpdated=!0}function fEe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let l=i[c];if(s.push(ni.fromGeometry({context:r,geometry:l,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW,interleave:e._interleave})),d(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,l);else if(e._boundingSpheres.push(ce.clone(l.boundingSphere)),e._boundingSphereWC.push(new ce),!o){let u=l.boundingSphereCV.center,m=u.x,p=u.y,y=u.z;u.x=y,u.y=m,u.z=p,e._boundingSphereCV.push(ce.clone(l.boundingSphereCV)),e._boundingSphere2D.push(new ce),e._boundingSphereMorph.push(new ce)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,HG(e,t,mr.COMPLETE,void 0)}function pEe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Oe(o,!1),r.cull={enabled:!0,face:yi.BACK},e._frontFaceRS=De.fromCache(r),r.cull.face=yi.FRONT,e._backFaceRS=De.fromCache(r)):(e._frontFaceRS=De.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Oe(o,!1),d(e._depthFailAppearance)&&(r.depthTest.enabled=!1),d(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Oe(o,!1),r.depthTest.func=ka.GREATER,i?(r.cull={enabled:!0,face:yi.BACK},e._frontFaceDepthFailRS=De.fromCache(r),r.cull.face=yi.FRONT,e._backFaceDepthFailRS=De.fromCache(r)):(e._frontFaceDepthFailRS=De.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function bEe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=hr._appendOffsetToShader(e,r),r=hr._appendShowToShader(e,r),r=hr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Y$(r),r=hr._updateColorAttribute(e,r,!1),r=K$(e,r),r=hr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=O$(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),H$(e._sp,o),d(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=hr._appendShowToShader(e,r),r=hr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Y$(r),r=hr._updateColorAttribute(e,r,!0),r=K$(e,r),r=hr._modifyShaderPosition(e,r,t.scene3DOnly),r=rEe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=O$(s),s=sEe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),H$(e._spDepthFail,o))}var KG=new F,Q$=new h;function j$(e,t,n,i){let o=d(n)?n._uniforms:void 0,r={},s=t.uniforms;if(d(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=aEe(s,c));let a=xt(r,o);return a=e._batchTable.getUniformMapCallback()(a),d(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,KG),F.multiplyByPoint(KG,e.rtcCenter,Q$),F.setTranslation(KG,Q$,KG),KG}),a}function yEe(e,t,n,i,o,r,s,a){let c=j$(e,t,n,a),l;d(e._depthFailAppearance)&&(l=j$(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Re.TRANSLUCENT:Re.OPAQUE,m=o?2:1;m*=d(e._depthFailAppearance)?2:1,r.length=e._va.length*m;let p=r.length,y=0;for(let f=0;f<p;++f){let x;o&&(x=r[f],d(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,++f),x=r[f],d(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,d(e._depthFailAppearance)&&(o&&(++f,x=r[f],d(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=l,x.pass=u),++f,x=r[f],d(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=l,x.pass=u),++y}}hr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],d(s)&&(e._boundingSphereWC[o]=ce.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ce.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ce.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(d(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function gEe(e,t,n,i,o,r,s,a){hr._updateBoundingVolumes(e,t,o);let c;t.mode===ie.SCENE3D?c=e._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ie.SCENE2D&&d(e._boundingSphere2D)?c=e._boundingSphere2D:d(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let l=t.commandList,u=t.passes;if(u.render||u.pick){let m=e.allowPicking,p=xn.castShadows(e.shadows),y=xn.receiveShadows(e.shadows),f=n.length,x=a?2:1;x*=d(e._depthFailAppearance)?2:1;for(let _=0;_<f;++_){let C=Math.floor(_/x),V=n[_];V.modelMatrix=o,V.boundingVolume=c[C],V.cull=r,V.debugShowBoundingVolume=s,V.castShadows=p,V.receiveShadows=y,m?V.pickId="v_pickColor":V.pickId=void 0,l.push(V)}}}hr.prototype.update=function(e){if(!d(this.geometryInstances)&&this._va.length===0||d(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!d(this.appearance)||e.mode!==ie.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(d(this._error))throw this._error;if(this._state===mr.FAILED)return;let t=e.context;if(d(this._batchTable)||eEe(this,t),this._batchTable.attributes.length>0){if(kt.maximumVertexTextureImageUnits===0)throw new me("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==mr.COMPLETE&&this._state!==mr.COMBINED&&(this.asynchronous?lEe(this,e):dEe(this,e)),this._state===mr.COMBINED&&(mEe(this,e),J$(this,e),fEe(this,e)),!this.show||this._state!==mr.COMPLETE)return;this._batchTableOffsetsUpdated||J$(this,e),this._recomputeBoundingSpheres&&uEe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=d(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),d(this._material)&&this._material.update(t);let l=n.closed&&c;o&&g(this._createRenderStatesFunction,pEe)(this,t,n,l),r&&g(this._createShaderProgramFunction,bEe)(this,e,n),(o||r)&&g(this._createCommandsFunction,yEe)(this,n,i,c,l,this._colorCommands,this._pickCommands,e),g(this._updateAndQueueCommandsFunction,gEe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,l)};var xEe=new ce,_Ee=new ce;function iee(e,t,n){if(n===rn.TOP){let i=ce.clone(e,xEe),o=ce.clone(e,_Ee);o.center=h.add(o.center,t,o.center),e=ce.union(i,o,e)}else n===rn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function TEe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return d(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function SEe(e,t,n,i,o){return function(r){let s=$$(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var CEe=new h;function VEe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(d(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;d(r)&&iee(i,h.fromArray(r.get(),0,CEe),e._offsetInstanceExtend[n]),d(o)&&(i=ce.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function LEe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}hr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(d(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let l=0;l<r;++l){let u=(i+l)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c[l]={get:TEe(s,n,u),set:SEe(s,n,u,this,l)}}return VEe(this,c,n),LEe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};hr.prototype.isDestroyed=function(){return!1};hr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function HG(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){if(e._ready=e._state===mr.COMPLETE||e._state===mr.FAILED,!d(i))return!0})}var Zn=hr;var gYt=T(S(),1);var $3t=T(S(),1);function REe(e){e=g(e,g.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.value=e.value}var Da=REe;var tYt=T(S(),1),xS=`#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
in vec4 v_sphericalExtents;
#else // SPHERICAL
in vec2 v_inversePlaneExtents;
in vec4 v_westPlane;
in vec4 v_southPlane;
#endif // SPHERICAL
in vec3 v_uvMinAndSphericalLongitudeRotation;
in vec3 v_uMaxAndInverseDistance;
in vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif

#ifdef NORMAL_EC
vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
    return eyeCoordinate.xyz / eyeCoordinate.w;
}

vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
    vec2 glFragCoordXY = gl_FragCoord.xy;
    // Sample depths at both offset and negative offset
    float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
    float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
    // Explicitly evaluate both paths
    // Necessary for multifrustum and for edges of the screen
    bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
    float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
    float useDownOrLeft = float(useUpOrRight == 0.0);
    vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
    vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
    return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
}
#endif // NORMAL_EC

void main(void)
{
#ifdef REQUIRES_EC
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
#endif

#ifdef REQUIRES_WC
    vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
    vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
#endif

#ifdef TEXTURE_COORDINATES
    vec2 uv;
#ifdef SPHERICAL
    // Treat world coords as a sphere normal for spherical coordinates
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
    sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
    uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
    uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
#else // SPHERICAL
    // Unpack planes and transform to eye space
    uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
    uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
#endif // SPHERICAL
#endif // TEXTURE_COORDINATES

#ifdef PICK
#ifdef CULL_FRAGMENTS
    // When classifying translucent geometry, logDepthOrDepth == 0.0
    // indicates a region that should not be classified, possibly due to there
    // being opaque pixels there in another buffer.
    // Check for logDepthOrDepth != 0.0 to make sure this should be classified.
    if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
        out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource
        czm_writeDepthClamp();
    }
#else // CULL_FRAGMENTS
        out_FragColor.a = 1.0;
#endif // CULL_FRAGMENTS
#else // PICK

#ifdef CULL_FRAGMENTS
    // When classifying translucent geometry, logDepthOrDepth == 0.0
    // indicates a region that should not be classified, possibly due to there
    // being opaque pixels there in another buffer.
    if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
        discard;
    }
#endif

#ifdef NORMAL_EC
    // Compute normal by sampling adjacent pixels in 2x2 block in screen space
    vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
    vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
    vec3 normalEC = normalize(cross(leftRight, downUp));
#endif


#ifdef PER_INSTANCE_COLOR

    vec4 color = czm_gammaCorrect(v_color);
#ifdef FLAT
    out_FragColor = color;
#else // FLAT
    czm_materialInput materialInput;
    materialInput.normalEC = normalEC;
    materialInput.positionToEyeEC = -eyeCoordinate.xyz;
    czm_material material = czm_getDefaultMaterial(materialInput);
    material.diffuse = color.rgb;
    material.alpha = color.a;

    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

#else // PER_INSTANCE_COLOR

    // Material support.
    // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
    // dependencies for culling but might not actually be used by the material.

    czm_materialInput materialInput;

#ifdef USES_NORMAL_EC
    materialInput.normalEC = normalEC;
#endif

#ifdef USES_POSITION_TO_EYE_EC
    materialInput.positionToEyeEC = -eyeCoordinate.xyz;
#endif

#ifdef USES_TANGENT_TO_EYE
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
#endif

#ifdef USES_ST
    // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
    // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
    // Shader is provided a set of reference points for remapping.
    materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
    materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
#endif

    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else // FLAT
    out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

#endif // PER_INSTANCE_COLOR
    czm_writeDepthClamp();
#endif // PICK
}
`;function $d(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new M3;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new M3;if(o.requiresTextureCoordinates=e,n instanceof sn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}$d.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof sn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof sn||(o=t.material.shaderSource),new Be({defines:i,sources:[o,xS]})};$d.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Be({defines:n,sources:[xS],pickColorQualifier:"in"})};$d.prototype.createVertexShader=function(e,t,n,i){return uee(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};$d.prototype.createPickVertexShader=function(e,t,n,i){return uee(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var oee=new h,ree=new he,see={high:0,low:0};function uee(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let l=ree;l.longitude=W.PI,l.latitude=0,l.height=0;let u=s.project(l,oee),m=On.encode(u.x,see);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`;let p=ree;p.longitude=-W.PI,p.latitude=0,p.height=0;let y=s.project(p,oee);m=On.encode(y.x,see),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),d(r)&&r instanceof sn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Be({defines:c,sources:[o]})}function M3(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(M3.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function aee(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/D.distance(t,e)}var ZEe=[new D,new D,new D,new D];function mee(e,t){let n=ZEe,i=D.unpack(t,0,n[0]),o=D.unpack(t,2,n[1]),r=D.unpack(t,4,n[2]);e.uMaxVmax=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/aee(i,o,r),a=1/aee(i,r,o);e.uvMinAndExtents=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var hee=new he,fee=new h,GEe=new h,EEe=new h,dM={high:0,low:0};function pee(e,t,n){let i=hee;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,fee);i.latitude=e.north;let r=t.project(i,GEe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,EEe),a=[0,0,0,0],c=[0,0,0,0],l=On.encode(o.x,dM);a[0]=l.high,c[0]=l.low,l=On.encode(o.y,dM),a[1]=l.high,c[1]=l.low,l=On.encode(r.y,dM),a[2]=l.high,c[2]=l.low,l=On.encode(s.x,dM),a[3]=l.high,c[3]=l.low,n.planes2D_HIGH=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var XEe=new F,IEe=new F,cee=new h,WEe=new he,PEe=[new he,new he,new he,new he,new he,new he,new he,new he];function vEe(e,t,n,i,o,r){let s=de.center(e,WEe);s.height=n;let a=he.toCartesian(s,t,cee),c=vt.eastNorthUpToFixedFrame(a,t,XEe),l=F.inverse(c,IEe),u=e.west,m=e.east,p=e.north,y=e.south,f=PEe;f[0].latitude=y,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=m,f[3].latitude=y,f[3].longitude=m;let x=(u+m)*.5,_=(p+y)*.5;f[4].latitude=y,f[4].longitude=x,f[5].latitude=p,f[5].longitude=x,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=m;let C=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY;for(let v=0;v<8;v++){f[v].height=n;let A=he.toCartesian(f[v],t,cee);F.multiplyByPoint(l,A,A),A.z=0,C=Math.min(C,A.x),V=Math.max(V,A.x),L=Math.min(L,A.y),Z=Math.max(Z,A.y)}let G=i;G.x=C,G.y=L,G.z=0,F.multiplyByPoint(c,G,G);let X=o;X.x=V,X.y=L,X.z=0,F.multiplyByPoint(c,X,X),h.subtract(X,G,o);let P=r;P.x=C,P.y=Z,P.z=0,F.multiplyByPoint(c,P,P),h.subtract(P,G,r)}var wEe=new h,FEe=new h,AEe=new On;$d.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=fee,s=wEe,a=FEe;vEe(e,n,g(o,0),r,s,a);let c={};mee(c,t);let l=On.fromCartesian(r,AEe);return c.southWest_HIGH=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(l.high,[0,0,0])}),c.southWest_LOW=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(l.low,[0,0,0])}),c.eastward=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),pee(e,i,c),c};var MEe=new h;function lee(e,t,n,i){let o=hee;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,MEe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=W.fastApproximateAtan2(s,r.z),c=W.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var dee=new D;$d.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=lee(e.south,e.west,n,dee),r=o.x,s=o.y,a=lee(e.north,e.east,n,dee),c=a.x,l=a.y,u=0;s>l&&(u=W.PI-s,s=-W.PI,l+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,l+=W.EPSILON5;let m=1/(l-s),p=1/(c-r),y={sphericalExtents:new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new Da({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return mee(y,t),pee(e,i,y),y};$d.hasAttributesForTextureCoordinatePlanes=function(e){return d(e.southWest_HIGH)&&d(e.southWest_LOW)&&d(e.northward)&&d(e.eastward)&&d(e.planes2D_HIGH)&&d(e.planes2D_LOW)&&d(e.uMaxVmax)&&d(e.uvMinAndExtents)};$d.hasAttributesForSphericalExtents=function(e){return d(e.sphericalExtents)&&d(e.longitudeRotation)&&d(e.planes2D_HIGH)&&d(e.planes2D_LOW)&&d(e.uMaxVmax)&&d(e.uvMinAndExtents)};function NEe(e){return Math.max(e.width,e.height)>$d.MAX_WIDTH_FOR_PLANAR_EXTENTS}$d.shouldUseSphericalCoordinates=function(e){return NEe(e)};$d.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var Ql=$d;var GYt=T(S(),1);var TYt=T(S(),1);var UEe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Dn=Object.freeze(UEe);var VYt=T(S(),1);var kEe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},ht=Object.freeze(kEe);var uM={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};uM.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Dn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Dn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:uM.CESIUM_3D_TILE_MASK,mask:uM.CESIUM_3D_TILE_MASK}};var Ft=Object.freeze(uM);function Qg(e){e=g(e,g.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=g(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Qg.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Qg.isSupported=function(e){return e.context.stencilBuffer};function _S(e,t){let n=t?Dn.EQUAL:Dn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},depthMask:!1}}function U3(e){return{stencilTest:{enabled:e,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Dn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var DEe={stencilTest:{enabled:!0,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Dn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function BEe(e,t,n,i){if(d(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=De.fromCache(_S(o,!1)),e._rsStencilDepthPass3DTiles=De.fromCache(_S(o,!0)),e._rsColorPass=De.fromCache(U3(o,!1)),e._rsPickPass=De.fromCache(DEe)}function YEe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
`,r=`    extrudeDirection = czm_octDecode(${n}, 65535.0);
`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Be.replaceMain(s,"czm_non_compressed_main");let a=`void main() 
{ 
${r}    czm_non_compressed_main(); 
}`;return[i,o,s,a].join(`
`)}}function OEe(e,t){let n=t.context,i=e._primitive,o=MG;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Zn._appendDistanceDisplayConditionToShader(i,o),o=Zn._modifyShaderPosition(e,o,t.scene3DOnly),o=Zn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=YEe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Be({defines:[a],sources:[o]}),l=new Be({sources:[mb]}),u=e._primitive._attributeLocations,m=new Ql(s,r,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:u}),e._primitive.allowPicking){let f=Be.createPickVertexShaderSource(o);f=Zn._appendShowToShader(i,f),f=Zn._updatePickColorAttribute(f);let x=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!d(C)){let V=m.createPickFragmentShader(!0),L=m.createPickVertexShader([a],f,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=C}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:u});o=Zn._appendShowToShader(i,o),c=new Be({defines:[a],sources:[o]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:u});let p=m.createFragmentShader(!1),y=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:y,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!d(f)){let x=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u})}e._spColor2D=f}}function KEe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),l=e._needs2DShader;for(o=0;o<i;o+=2){let y=n._va[a++];r=t[o],d(r)||(r=t[o]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=y,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Re.TERRAIN_CLASSIFICATION,s=nt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],d(r)||(r=t[o+1]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=y,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Re.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(d(x)&&(c=xt(c,x._uniforms)),r.uniformMap=c,s=nt.shallowClone(r,r.derivedCommands.tileset),s.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,l){let _=nt.shallowClone(r,r.derivedCommands.appearance2D);_.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=_,_=nt.shallowClone(s,s.derivedCommands.appearance2D),_.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=_}}let u=e._commandsIgnoreShow,m=e._spStencil,p=0;i=u.length=i/2;for(let y=0;y<i;++y){let f=u[y]=nt.shallowClone(t[p],u[y]);f.shaderProgram=m,f.pass=Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function HEe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,l,u,m=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),y=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[m++];if(n&&(a=r[s++],f=i._va[a.index]),l=t[c],d(l)||(l=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),l.vertexArray=f,l.renderState=e._rsStencilDepthPass,l.shaderProgram=e._sp,l.uniformMap=p,l.pass=Re.TERRAIN_CLASSIFICATION,n&&(l.offset=a.offset,l.count=a.count),u=nt.shallowClone(l,l.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,l.derivedCommands.tileset=u,l=t[c+1],d(l)||(l=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),l.vertexArray=f,l.renderState=e._rsPickPass,l.shaderProgram=e._spPick,l.uniformMap=p,l.pass=Re.TERRAIN_CLASSIFICATION,n&&(l.offset=a.offset,l.count=a.count),u=nt.shallowClone(l,l.derivedCommands.tileset),u.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,l.derivedCommands.tileset=u,y){let x=nt.shallowClone(l,l.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,l.derivedCommands.pick2D=x,x=nt.shallowClone(u,u.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x}}}function zEe(e,t,n,i,o,r,s){KEe(e,r),HEe(e,s)}function bee(e,t){return Math.floor(e%t/2)}function N3(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function yee(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function JEe(e,t,n,i,o,r,s,a){let c=e._primitive;Zn._updateBoundingVolumes(c,t,o);let l;t.mode===ie.SCENE3D?l=c._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===ie.SCENE2D&&d(c._boundingSphere2D)?l=c._boundingSphere2D:d(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);let u=e.classificationType,m=u!==kn.CESIUM_3D_TILE,p=u!==kn.TERRAIN,y=t.passes,f,x,_;if(y.render){let C=n.length;for(f=0;f<C;++f)x=l[bee(f,C)],m&&(_=n[f],N3(_,t,o,r,x,s)),p&&(_=n[f].derivedCommands.tileset,N3(_,t,o,r,x,s));if(t.invertClassification){let V=e._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=l[f],_=V[f],N3(_,t,o,r,x,s)}}if(y.pick){let C=i.length,V=c._pickOffsets;for(f=0;f<C;++f){let L=V[bee(f,C)];x=l[L.index],m&&(_=i[f],yee(_,t,o,r,x)),p&&(_=i[f].derivedCommands.tileset,yee(_,t,o,r,x))}}}Qg.prototype.update=function(e){if(!d(this._primitive)&&!d(this.geometryInstances))return;let t=this.appearance;d(t)&&d(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!d(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,l=!1,u=!0,m,p=!1,y=!1;for(r>0&&(c=o[0].attributes,p=Ql.hasAttributesForSphericalExtents(c),y=Ql.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;d(x)&&(l=!0),u=u&&d(x)&&Ut.equals(m,x)}if(!u&&!p&&!y)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");l&&!d(t)&&(t=new sn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!y,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=y,this._hasPerColorAttribute=l;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new _t({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:g(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=f,d(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,_){n._createBoundingVolumeFunction(x,_)}),i._createRenderStatesFunction=function(x,_,C,V){BEe(n,_)},i._createShaderProgramFunction=function(x,_,C){OEe(n,_)},i._createCommandsFunction=function(x,_,C,V,L,Z,G){zEe(n,void 0,void 0,!0,!1,Z,G)},d(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,X){n._updateAndQueueCommandsFunction(x,_,C,V,L,Z,G,X)}:i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,X){JEe(n,_,C,V,L,Z,G,X)},this._primitive=new Zn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=De.fromCache(_S(!1,!1)),this._rsStencilDepthPass3DTiles=De.fromCache(_S(!1,!0)),this._rsColorPass=De.fromCache(U3(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=De.fromCache(_S(!0,!1)),this._rsStencilDepthPass3DTiles=De.fromCache(_S(!0,!0)),this._rsColorPass=De.fromCache(U3(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{d(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Qg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Qg.prototype.isDestroyed=function(){return!1};Qg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var TS=Qg;var QEe={u_globeMinimumAltitude:function(){return 55e3}};function dl(e){e=g(e,g.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!d(t)&&d(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(d(a)&&d(a.color)){t=new sn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=li._defaultMaxTerrainHeight,this._minTerrainHeight=li._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:QEe}}Object.defineProperties(dl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});dl.isSupported=TS.isSupported;function gee(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function xee(e){return function(t,n){return e._minHeight}}var jEe=new h,qEe=new h,$Ee=new h,eXe=new he,tXe=new de;function mM(e,t){let n=e.mapProjection.ellipsoid;if(!d(t.attributes)||!d(t.attributes.position3DHigh))return d(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let m=0;m<r;m+=3){let p=h.unpack(i,m,jEe),y=h.unpack(o,m,qEe),f=h.add(p,y,$Ee),x=n.cartesianToCartographic(f,eXe),_=x.latitude,C=x.longitude;s=Math.min(s,_),a=Math.min(a,C),c=Math.max(c,_),l=Math.max(l,C)}let u=tXe;return u.north=c,u.south=s,u.east=l,u.west=a,u}function nXe(e,t,n){let i=li.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function iXe(e,t,n){let i=t.mapProjection.ellipsoid,o=mM(t,n),r=Wn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ce.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function k3(e,t){return Math.floor(e%t/2)}function D3(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ie.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function _ee(e,t,n,i,o,r){let s=e._primitive;n.mode!==ie.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function oXe(e,t,n,i,o,r,s,a){let c;t.mode===ie.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let l=e.classificationType,u=l!==kn.CESIUM_3D_TILE,m=l!==kn.TERRAIN,p=t.passes,y=e._primitive,f,x,_;if(p.render){let C=n.length;for(f=0;f<C;++f)x=c[k3(f,C)],u&&(_=n[f],D3(e,_,t,o,r,x,s)),m&&(_=n[f].derivedCommands.tileset,D3(e,_,t,o,r,x,s));if(t.invertClassification){let V=y._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=c[f],_=V[f],D3(e,_,t,o,r,x,s)}}if(p.pick){let C=i.length,V;for(e._useFragmentCulling||(V=y._primitive._pickOffsets),f=0;f<C;++f){if(x=c[k3(f,C)],!e._useFragmentCulling){let L=V[k3(f,C)];x=c[L.index]}u&&(_=i[f],_ee(e,_,t,o,r,x)),m&&(_=i[f].derivedCommands.tileset,_ee(e,_,t,o,r,x))}}}dl.initializeTerrainHeights=function(){return li.initialize()};dl.prototype.update=function(e){if(!d(this._primitive)&&!d(this.geometryInstances))return;if(!li.initialized){dl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!d(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,l=new Array(c),u,m;for(u=0;u<c;++u){o=a[u],r=o.geometry;let x=mM(e,r);d(m)?d(x)&&de.union(m,x,m):m=de.clone(x);let _=o.id;if(d(_)&&d(x)){let C=li.getBoundingSphere(x,i);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(C)}s=r.constructor,!d(s)||d(s.createShadowVolume)}nXe(this,m,i);let p=e.terrainExaggeration,y=e.terrainExaggerationRelativeHeight;this._minHeight=Vc.getHeight(this._minTerrainHeight,p,y),this._maxHeight=Vc.getHeight(this._maxTerrainHeight,p,y);let f=dl._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let x,_=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,m=mM(e,r),Ql.shouldUseSphericalCoordinates(m)){_=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let C=mM(e,r),V=r.textureCoordinateRotationPoints;_?x=Ql.getPlanarTextureCoordinateAttributes(C,V,i,e.mapProjection,this._maxHeight):x=Ql.getSphericalExtentGeometryInstanceAttributes(C,V,i,e.mapProjection);let L=o.attributes;for(let Z in L)L.hasOwnProperty(Z)&&(x[Z]=L[Z]);l[u]=new _t({geometry:s.createShadowVolume(r,xee(this),gee(this)),attributes:x,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,l[u]=new _t({geometry:s.createShadowVolume(r,xee(this),gee(this)),attributes:o.attributes,id:o.id});n.geometryInstances=l,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,_){iXe(t,x,_)},n._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,X){oXe(t,_,C,V,L,Z,G,X)},this._primitive=new TS(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&d(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};dl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};dl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};dl.prototype.isDestroyed=function(){return!1};dl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};dl._supportsMaterials=function(e){return e.depthTexture};dl.supportsMaterials=function(e){return dl._supportsMaterials(e.frameState.context)};var Rc=dl;var VOt=T(S(),1);function SS(){fe.throwInstantiationError()}Object.defineProperties(SS.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});SS.prototype.getType=fe.throwInstantiationError;SS.prototype.getValue=fe.throwInstantiationError;SS.prototype.equals=fe.throwInstantiationError;SS.getValue=function(e,t,n){let i;return d(t)&&(i=t.getType(e),d(i))?((!d(n)||n.type!==i)&&(n=ki.fromType(i)),t.getValue(e,n.uniforms),n):((!d(n)||n.type!==ki.ColorType)&&(n=ki.fromType(ki.ColorType)),B.clone(B.WHITE,n.uniforms.color),n)};var Yo=SS;function jg(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}jg.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!H.getValueOrDefault(t.show,n,!0)};jg.prototype._setOptions=fe.throwInstantiationError;jg.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!d(s.fill)||s.fill.getValue(e)){let l=t.fillMaterialProperty,u=l instanceof At,m,p=t._getIsClosed(c);if(u)m=new sn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let y=Yo.getValue(e,l,this._material);this._material=y,m=new so({material:y,translucent:y.isTranslucent(),closed:p})}if(n)c.vertexFormat=sn.VERTEX_FORMAT,this._primitive=o.add(new Rc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),H.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let y=this._geometryUpdater.createFillGeometryInstance(e);u&&(m.translucent=y.attributes.color.value[3]!==255),this._primitive=i.add(new Zn({geometryInstances:y,appearance:m,asynchronous:!1,shadows:a}))}}if(!n&&d(s.outline)&&s.outline.getValue(e)){let l=this._geometryUpdater.createOutlineGeometryInstance(e),u=H.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Zn({geometryInstances:l,appearance:new sn({flat:!0,translucent:l.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};jg.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return d(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),d(o)&&d(o.boundingSphere))?(ce.clone(o.boundingSphere,e),lt.DONE):d(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),d(o)&&d(o.boundingSphere))?(ce.clone(o.boundingSphere,e),lt.DONE):d(n)&&!n.ready||d(i)&&!i.ready?lt.PENDING:lt.FAILED};jg.prototype.isDestroyed=function(){return!1};jg.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ii=jg;var ijt=T(S(),1);var U4t=T(S(),1);var YHt=T(S(),1);var WKt=T(S(),1);var UOt=T(S(),1),rXe={NONE:0,GEODESIC:1,RHUMB:2},Jt=Object.freeze(rXe);var OOt=T(S(),1);var Tee=W.EPSILON10;function sXe(e,t,n,i){if(!d(e))return;n=g(n,!1);let o=d(i),r=e.length;if(r<2)return e;let s,a=e[0],c,l,u=0,m=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Tee)?(d(l)||(l=e.slice(0,s),u=s-1,m=0),o&&i.push(s)):(d(l)&&(l.push(c),u=s,o&&(m=i.length)),a=c);return n&&t(e[0],e[r-1],Tee)&&(o&&(d(l)?i.splice(m,0,u):i.push(r-1)),d(l)?l.length-=1:l=e.slice(0,-1)),d(l)?l:e}var go=sXe;var $Ot=T(S(),1);function aXe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),l=c*a,u=Math.atan2(a,r),m=c*s,p=m*m,y=1-p,f=Math.sqrt(y),x=t/4,_=x*x,C=_*x,V=_*_,L=1+x-3*_/4+5*C/4-175*V/64,Z=1-x+15*_/8-35*C/8,G=1-3*x+35*_/4,X=1-5*x,P=L*u-Z*Math.sin(2*u)*x/2-G*Math.sin(4*u)*_/16-X*Math.sin(6*u)*C/48-Math.sin(8*u)*5*V/512,v=e._constants;v.a=n,v.b=i,v.f=o,v.cosineHeading=r,v.sineHeading=s,v.tanU=a,v.cosineU=c,v.sineU=l,v.sigma=u,v.sineAlpha=m,v.sineSquaredAlpha=p,v.cosineSquaredAlpha=y,v.cosineAlpha=f,v.u2Over4=x,v.u4Over16=_,v.u6Over64=C,v.u8Over256=V,v.a0=L,v.a1=Z,v.a2=G,v.a3=X,v.distanceRatio=P}function cXe(e,t){return e*t*(4+e*(4-3*t))/16}function See(e,t,n,i,o,r,s){let a=cXe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function lXe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,l=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),m=Math.cos(l),p=Math.sin(l),y=Math.cos(u),f=Math.sin(u),x=m*y,_=m*f,C=p*f,V=p*y,L=c,Z=W.TWO_PI,G=Math.cos(L),X=Math.sin(L),P,v,A,M,b;do{G=Math.cos(L),X=Math.sin(L);let U=_-V*G;A=Math.sqrt(y*y*X*X+U*U),v=C+x*G,P=Math.atan2(A,v);let J;A===0?(J=0,M=1):(J=x*X/A,M=1-J*J),Z=L,b=v-2*C/M,isFinite(b)||(b=0),L=c+See(a,J,M,P,A,v,b)}while(Math.abs(L-Z)>W.EPSILON12);let R=M*(t*t-n*n)/(n*n),E=1+R*(4096+R*(R*(320-175*R)-768))/16384,I=R*(256+R*(R*(74-47*R)-128))/1024,w=b*b,N=I*A*(b+I*(v*(2*w-1)-I*b*(4*A*A-3)*(4*w-3)/6)/4),Y=n*E*(P-N),k=Math.atan2(y*X,_-V*G),O=Math.atan2(m*X,_*G-V);e._distance=Y,e._startHeading=k,e._endHeading=O,e._uSquared=R}var dXe=new h,B3=new h;function Cee(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,B3),dXe),r=h.normalize(i.cartographicToCartesian(n,B3),B3);lXe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,aXe(e)}function zG(e,t,n){let i=g(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,d(e)&&d(t)&&Cee(this,e,t,i)}Object.defineProperties(zG.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});zG.prototype.setEndPoints=function(e,t){Cee(this,e,t,this._ellipsoid)};zG.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};zG.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),l=Math.sin(6*i),u=Math.sin(8*i),m=i*i,p=i*m,y=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*y*o/3+i*(1-f+7*_/4-15*x/4+579*y/64-(_-15*x/4+187*y/16)*o-(5*x/4-115*y/16)*r-29*y*s/16)+(f/2-_+71*x/32-85*y/16)*a+(5*_/16-5*x/4+383*y/96)*c-m*((x-11*y/2)*a+5*y*c/2)+(29*x/96-29*y/16)*l+539*y*u/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let Z=Math.cos(2*n.sigma+C),G=Math.sin(C),X=Math.cos(C),P=n.cosineU*X,v=n.sineU*G,M=Math.atan2(G*n.sineHeading,P-v*n.cosineHeading)-See(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,X,Z);return d(t)?(t.longitude=this._start.longitude+M,t.latitude=L,t.height=0,t):new he(this._start.longitude+M,L,0)};var eu=zG;var aKt=T(S(),1);function O3(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,l=n,u=Math.sin(2*l),m=Math.sin(4*l),p=Math.sin(6*l),y=Math.sin(8*l),f=Math.sin(10*l),x=Math.sin(12*l);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*l-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*y-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function uXe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,l=c*c,u=l*c,m=u*c,p=m*c,y=p*c,f=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),Z=Math.sin(8*i),G=Math.cos(8*i),X=Math.sin(10*i),P=Math.cos(10*i),v=Math.sin(12*i);return i+i*c/4+7*i*l/64+15*i*u/256+579*i*m/16384+1515*i*p/65536+16837*i*y/1048576+(3*i*l/16+45*i*u/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*y/5242880)*x+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*y/1048576)*C+(151*i*m/4096+4681*i*p/65536+1479*i*y/16384-453*r*y/32768)*L+(1097*i*p/65536+42783*i*y/1048576)*G+8011*i*y/1048576*P+(3*c/8+3*l/16+213*u/2048-3*o*u/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*y/1048576-471*o*y/8192+9*s*y/4096)*f+(21*l/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*y/16777216-12517*o*y/131072+7*s*y/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*y/786432-8607*o*y/131072)*V+(1097*m/131072+1097*p/65536+225797*y/10485760-1097*o*y/65536)*Z+(8011*p/2621440+8011*y/1048576)*X+293393*y/251658240*v}function CS(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function mXe(e,t,n,i,o){let r=CS(e._ellipticity,n),s=CS(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function hXe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,l=0;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)l=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);l=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=O3(e._ellipticity,t,o);l=(O3(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(l)}var fXe=new h,Y3=new h;function Vee(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,Y3),fXe),r=h.normalize(i.cartographicToCartesian(n,Y3),Y3),s=i.maximumRadius,a=i.minimumRadius,c=s*s,l=a*a;e._ellipticitySquared=(c-l)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=mXe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=hXe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Lee(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,l;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=O3(o,i,e.latitude),m=n*Math.cos(t),p=u+m;c=uXe(p,o,i);let y=CS(o,e.latitude),f=CS(o,c);l=Math.tan(t)*(f-y),a=W.negativePiToPi(e.longitude+l)}else{c=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let m=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*m*m)}l=n/u,t>0?a=W.negativePiToPi(e.longitude+l):a=W.negativePiToPi(e.longitude-l)}return d(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function ap(e,t,n){let i=g(n,re.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,d(e)&&d(t)&&Vee(this,e,t,i)}Object.defineProperties(ap.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});ap.fromStartHeadingDistance=function(e,t,n,i,o){let r=g(i,re.WGS84),s=r.maximumRadius,a=r.minimumRadius,c=s*s,l=a*a,u=Math.sqrt((c-l)/c);t=W.negativePiToPi(t);let m=Lee(e,t,n,r.maximumRadius,u);return!d(o)||d(i)&&!i.equals(o.ellipsoid)?new ap(e,m,r):(o.setEndPoints(e,m),o)};ap.prototype.setEndPoints=function(e,t){Vee(this,e,t,this._ellipsoid)};ap.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};ap.prototype.interpolateUsingSurfaceDistance=function(e,t){return Lee(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};ap.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),d(t)||(t=new he),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),l=(1+a)/(1-a),u=r.latitude,m;do{m=u;let p=n*Math.sin(m),y=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(y/l,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,m,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};ap.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=CS(n,o.latitude),s=CS(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return d(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var ha=ap;var $3=[Zi,Ei],pXe=$3.length,Oee=Math.cos(W.toRadians(30)),Ree=Math.cos(W.toRadians(150)),Kee=0,Hee=1e3;function pb(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions;this.width=g(e.width,1),this._positions=t,this.granularity=g(e.granularity,9999),this.loop=g(e.loop,!1),this.arcType=g(e.arcType,Jt.GEODESIC),this._ellipsoid=re.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(pb.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});pb.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<pXe;i++)if(t instanceof $3[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var bXe=new h,Zee=new h,Gee=new h;function q3(e,t,n,i,o){let r=Zc(i,e,0,bXe),s=Zc(i,e,n,Zee),a=Zc(i,t,0,Gee),c=cp(s,r,Zee),l=cp(a,r,Gee);return h.cross(l,c,o),h.normalize(o,o)}var yXe=new he,gXe=new h,xXe=new h,_Xe=new h;function K3(e,t,n,i,o,r,s,a,c,l,u){if(o===0)return;let m;r===Jt.GEODESIC?m=new eu(e,t,s):r===Jt.RHUMB&&(m=new ha(e,t,s));let p=m.surfaceDistance;if(p<o)return;let y=q3(e,t,i,s,_Xe),f=Math.ceil(p/o),x=p/f,_=x,C=f-1,V=a.length;for(let L=0;L<C;L++){let Z=m.interpolateUsingSurfaceDistance(_,yXe),G=Zc(s,Z,n,gXe),X=Zc(s,Z,i,xXe);h.pack(y,a,V),h.pack(G,c,V),h.pack(X,l,V),u.push(Z.latitude),u.push(Z.longitude),V+=3,_+=x}}var H3=new he;function Zc(e,t,n,i){return he.clone(t,H3),H3.height=n,he.toCartesian(H3,e,i)}pb.pack=function(e,t,n){let i=g(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,re.pack(e._ellipsoid,t,i),i+=re.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};pb.unpack=function(e,t,n){let i=g(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],l=re.unpack(e,i);i+=re.packedLength;let u=e[i++],m=e[i++]===1;return d(n)||(n=new pb({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=l,n._projectionIndex=u,n._scene3DOnly=m,n};function cp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Eee(e,t,n,i){return i=cp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var TXe=new h,SXe=new h,CXe=new h,zee=new h,VXe=0,LXe=-1;function z3(e,t,n,i,o){let r=cp(n,t,zee),s=Eee(e,t,r,TXe),a=Eee(i,t,r,SXe);if(W.equalsEpsilon(h.dot(s,a),LXe,W.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,CXe);return h.dot(a,c)<VXe&&(o=h.negate(o,o)),o}var bM=on.fromPointNormal(h.ZERO,h.UNIT_Y),RXe=new h,ZXe=new h,GXe=new h,EXe=new h,XXe=new h,hM=new h,fM=new he,Xee=new he,Iee=new he;pb.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new $3[e._projectionIndex](i),a=Kee,c=Hee,l,u,m=e._positions,p=m.length;p===2&&(n=!1);let y,f,x,_,C=new ha(void 0,void 0,i),V,L,Z,G=[m[0]];for(u=0;u<p-1;u++)y=m[u],f=m[u+1],V=Si.lineSegmentPlane(y,f,bM,hM),d(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===Jt.GEODESIC?G.push(h.clone(V)):e.arcType===Jt.RHUMB&&(Z=i.cartesianToCartographic(V,fM).longitude,x=i.cartesianToCartographic(y,fM),_=i.cartesianToCartographic(f,Xee),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,Iee),V=i.cartographicToCartesian(L,hM),d(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&G.push(h.clone(V)))),G.push(f);n&&(y=m[p-1],f=m[0],V=Si.lineSegmentPlane(y,f,bM,hM),d(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===Jt.GEODESIC?G.push(h.clone(V)):e.arcType===Jt.RHUMB&&(Z=i.cartesianToCartographic(V,fM).longitude,x=i.cartesianToCartographic(y,fM),_=i.cartesianToCartographic(f,Xee),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,Iee),V=i.cartographicToCartesian(L,hM),d(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&G.push(h.clone(V)))));let X=G.length,P=new Array(X);for(u=0;u<X;u++){let z=he.fromCartesian(G[u],i);z.height=0,P[u]=z}if(P=go(P,he.equalsEpsilon),X=P.length,X<2)return;let v=[],A=[],M=[],b=[],R=RXe,E=ZXe,I=GXe,w=EXe,N=XXe,Y=P[0],k=P[1],O=P[X-1];for(R=Zc(i,O,a,R),w=Zc(i,k,a,w),E=Zc(i,Y,a,E),I=Zc(i,Y,c,I),n?N=z3(R,E,I,w,N):N=q3(Y,k,c,i,N),h.pack(N,A,0),h.pack(E,M,0),h.pack(I,b,0),v.push(Y.latitude),v.push(Y.longitude),K3(Y,k,a,c,o,r,i,A,M,b,v),u=1;u<X-1;++u){R=h.clone(E,R),E=h.clone(w,E);let z=P[u];Zc(i,z,c,I),Zc(i,P[u+1],a,w),z3(R,E,I,w,N),l=A.length,h.pack(N,A,l),h.pack(E,M,l),h.pack(I,b,l),v.push(z.latitude),v.push(z.longitude),K3(P[u],P[u+1],a,c,o,r,i,A,M,b,v)}let U=P[X-1],J=P[X-2];if(E=Zc(i,U,a,E),I=Zc(i,U,c,I),n){let z=P[0];R=Zc(i,J,a,R),w=Zc(i,z,a,w),N=z3(R,E,I,w,N)}else N=q3(J,U,c,i,N);if(l=A.length,h.pack(N,A,l),h.pack(E,M,l),h.pack(I,b,l),v.push(U.latitude),v.push(U.longitude),n){for(K3(U,Y,a,c,o,r,i,A,M,b,v),l=A.length,u=0;u<3;++u)A[l+u]=A[u],M[l+u]=M[u],b[l+u]=b[u];v.push(Y.latitude),v.push(Y.longitude)}return nIe(n,s,M,b,A,v,t)};var IXe=new h,WXe=new $,PXe=new Ae;function Wee(e,t,n,i){let o=cp(n,t,IXe),r=h.dot(o,e);if(r>Oee||r<Ree){let s=cp(i,n,zee),a=r<Ree?W.PI_OVER_TWO:-W.PI_OVER_TWO,c=Ae.fromAxisAngle(s,a,PXe),l=$.fromQuaternion(c,WXe);return $.multiplyByVector(l,e,e),!0}return!1}var Pee=new he,vXe=new h,vee=new h;function JG(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,vXe),s=h.add(r,n,vee),a=!1,c=e._ellipsoid,l=c.cartesianToCartographic(s,Pee);Math.abs(t.longitude-l.longitude)>W.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,vee),l=c.cartesianToCartographic(s,Pee)),l.height=0;let u=e.project(l,o);return o=h.subtract(u,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var wXe=new h,wee=new h;function Fee(e,t,n,i,o,r){let s=h.subtract(t,e,wXe);h.normalize(s,s);let a=n-Kee,c=h.multiplyByScalar(s,a,wee);h.add(e,c,o);let l=i-Hee;c=h.multiplyByScalar(s,l,wee),h.add(t,c,r)}var FXe=new h;function pM(e,t){let n=on.getPointDistance(bM,e),i=on.getPointDistance(bM,t),o=FXe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=cp(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=cp(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function AXe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var Jee=new he,Qee=new he,Aee=new h,J3=new h,Mee=new h,Nee=new h,MXe=new h,Uee=new h,NXe=[Jee,Qee],UXe=new de,kXe=new h,DXe=new h,BXe=new h,YXe=new h,OXe=new h,KXe=new h,Q3=new h,j3=new h,HXe=new h,zXe=new h,JXe=new h,kee=new h,QXe=new h,jXe=new h,qXe=new On,$Xe=new On,Dee=new h,eIe=new h,Bee=new h,tIe=[new ce,new ce],jee=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Yee=jee.length;function nIe(e,t,n,i,o,r,s){let a,c,l=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,y=u*36,f=m>65535?new Uint32Array(y):new Uint16Array(y),x=new Float64Array(m*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z=new Float32Array(p),G,X,P,v;s&&(G=new Float32Array(p),X=new Float32Array(p),P=new Float32Array(p),v=new Float32Array(m*2));let A=r.length/2,M=0,b=Jee;b.height=0;let R=Qee;R.height=0;let E=Aee,I=J3;if(s)for(c=0,a=1;a<A;a++)b.latitude=r[c],b.longitude=r[c+1],R.latitude=r[c+2],R.longitude=r[c+3],E=t.project(b,E),I=t.project(R,I),M+=h.distance(E,I),c+=2;let w=i.length/3;I=h.unpack(i,0,I);let N=0;for(c=3,a=1;a<w;a++)E=h.clone(I,E),I=h.unpack(i,c,I),N+=h.distance(E,I),c+=3;let Y;c=3;let k=0,O=0,U=0,J=0,z=!1,ee=h.unpack(n,0,Nee),K=h.unpack(i,0,J3),j=h.unpack(o,0,Uee);if(e){let Ie=h.unpack(n,n.length-6,Mee);Wee(j,Ie,ee,K)&&(j=h.negate(j,j))}let q=0,be=0,Te=0;for(a=0;a<u;a++){let Ie=h.clone(ee,Mee),Me=h.clone(K,Aee),ve=h.clone(j,MXe);z&&(ve=h.negate(ve,ve)),ee=h.unpack(n,c,Nee),K=h.unpack(i,c,J3),j=h.unpack(o,c,Uee),z=Wee(j,Ie,ee,K),b.latitude=r[k],b.longitude=r[k+1],R.latitude=r[k+2],R.longitude=r[k+3];let ke,ct,yt,ot;if(s){let Ki=AXe(b,R);ke=t.project(b,OXe),ct=t.project(R,KXe);let ns=cp(ct,ke,Dee);ns.y=Math.abs(ns.y),yt=Q3,ot=j3,Ki===0||h.dot(ns,h.UNIT_Y)>Oee?(yt=JG(t,b,ve,ke,Q3),ot=JG(t,R,j,ct,j3)):Ki===1?(ot=JG(t,R,j,ct,j3),yt.x=0,yt.y=W.sign(b.longitude-Math.abs(R.longitude)),yt.z=0):(yt=JG(t,b,ve,ke,Q3),ot.x=0,ot.y=W.sign(b.longitude-R.longitude),ot.z=0)}let ln=h.distance(Me,K),vn=On.fromCartesian(Ie,qXe),Dt=h.subtract(ee,Ie,HXe),Nt=h.normalize(Dt,kee),pe=h.subtract(Me,Ie,zXe);pe=h.normalize(pe,pe);let Ce=h.cross(Nt,pe,kee);Ce=h.normalize(Ce,Ce);let Ht=h.cross(pe,ve,QXe);Ht=h.normalize(Ht,Ht);let ut=h.subtract(K,ee,JXe);ut=h.normalize(ut,ut);let hi=h.cross(j,ut,jXe);hi=h.normalize(hi,hi);let ji=ln/N,pc=q/N,bs=0,ys,$r,we,je=0,qe=0;if(s){bs=h.distance(ke,ct),ys=On.fromCartesian(ke,$Xe),$r=h.subtract(ct,ke,Dee),we=h.normalize($r,eIe);let Ki=we.x;we.x=we.y,we.y=-Ki,je=bs/M,qe=be/M}for(Y=0;Y<8;Y++){let Ki=J+Y*4,ns=O+Y*2,zn=Ki+3,wn=Y<4?1:-1,mn=Y===2||Y===3||Y===6||Y===7?1:-1;h.pack(vn.high,_,Ki),_[zn]=Dt.x,h.pack(vn.low,C,Ki),C[zn]=Dt.y,h.pack(Ht,V,Ki),V[zn]=Dt.z,h.pack(hi,L,Ki),L[zn]=ji*wn,h.pack(Ce,Z,Ki);let _i=pc*mn;_i===0&&mn<0&&(_i=9),Z[zn]=_i,s&&(G[Ki]=ys.high.x,G[Ki+1]=ys.high.y,G[Ki+2]=ys.low.x,G[Ki+3]=ys.low.y,P[Ki]=-yt.y,P[Ki+1]=yt.x,P[Ki+2]=ot.y,P[Ki+3]=-ot.x,X[Ki]=$r.x,X[Ki+1]=$r.y,X[Ki+2]=we.x,X[Ki+3]=we.y,v[ns]=je*wn,_i=qe*mn,_i===0&&mn<0&&(_i=9),v[ns+1]=_i)}let Qe=BXe,pt=YXe,Bt=kXe,Vn=DXe,di=de.fromCartographicArray(NXe,UXe),bo=li.getMinimumMaximumHeights(di,l),es=bo.minimumTerrainHeight,ts=bo.maximumTerrainHeight;Te+=Math.abs(es),Te+=Math.abs(ts),Fee(Ie,Me,es,ts,Qe,Bt),Fee(ee,K,es,ts,pt,Vn);let Mo=h.multiplyByScalar(Ce,W.EPSILON5,Bee);h.add(Qe,Mo,Qe),h.add(pt,Mo,pt),h.add(Bt,Mo,Bt),h.add(Vn,Mo,Vn),pM(Qe,pt),pM(Bt,Vn),h.pack(Qe,x,U),h.pack(pt,x,U+3),h.pack(Vn,x,U+6),h.pack(Bt,x,U+9),Mo=h.multiplyByScalar(Ce,-2*W.EPSILON5,Bee),h.add(Qe,Mo,Qe),h.add(pt,Mo,pt),h.add(Bt,Mo,Bt),h.add(Vn,Mo,Vn),pM(Qe,pt),pM(Bt,Vn),h.pack(Qe,x,U+12),h.pack(pt,x,U+15),h.pack(Vn,x,U+18),h.pack(Bt,x,U+21),k+=2,c+=3,O+=16,U+=24,J+=32,q+=ln,be+=bs}c=0;let ae=0;for(a=0;a<u;a++){for(Y=0;Y<Yee;Y++)f[c+Y]=jee[Y]+ae;ae+=8,c+=Yee}let xe=tIe;ce.fromVertices(n,h.ZERO,3,xe[0]),ce.fromVertices(i,h.ZERO,3,xe[1]);let _e=ce.fromBoundingSpheres(xe);_e.radius+=Te/(u*2);let Ve={position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:fb(_),startLoAndForwardOffsetY:fb(C),startNormalAndForwardOffsetZ:fb(V),endNormalAndTextureCoordinateNormalizationX:fb(L),rightNormalAndTextureCoordinateNormalizationY:fb(Z)};return s&&(Ve.startHiLo2D=fb(G),Ve.offsetAndRight2D=fb(X),Ve.startEndNormals2D=fb(P),Ve.texcoordNormalization2D=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,normalize:!1,values:v})),new dt({attributes:Ve,indices:f,boundingSphere:_e})}function fb(e){return new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}pb._projectNormal=JG;var qg=pb;var vKt=T(S(),1),QG=`in vec4 v_startPlaneNormalEcAndHalfWidth;
in vec4 v_endPlaneNormalEcAndBatchId;
in vec4 v_rightPlaneEC; // Technically can compute distance for this here
in vec4 v_endEcAndStartEcX;
in vec4 v_texcoordNormalizationAndStartEcYZ;

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif

void main(void)
{
    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
    vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);

    // Discard for sky
    if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
    // Check distance of the eye coordinate against the right-facing plane
    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);

    // Check eye coordinate against the mitering planes
    float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
    float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);

    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    // Check distance of the eye coordinate against start and end planes with normals in the right plane.
    // For computing unskewed lengthwise texture coordinate.
    // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.

    // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
    vec3 alignedPlaneNormal;

    // start aligned plane
    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
    distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);

    // end aligned plane
    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
    distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);

#ifdef PER_INSTANCE_COLOR
    out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
    // Clamp - distance to aligned planes may be negative due to mitering,
    // so fragment texture coordinate might be out-of-bounds.
    float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
    s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
    float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);

    czm_materialInput materialInput;

    materialInput.s = s;
    materialInput.st = vec2(s, t);
    materialInput.str = vec3(s, t, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR

    // Premultiply alpha. Required for classification primitives on translucent globe.
    out_FragColor.rgb *= out_FragColor.a;

    czm_writeDepthClamp();
}
`;var FKt=T(S(),1),jG=`in vec3 v_forwardDirectionEC;
in vec3 v_texcoordNormalizationAndHalfWidth;
in float v_batchId;

#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#else
in vec2 v_alignedPlaneDistances;
in float v_texcoordT;
#endif

float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
    // We don't expect the ray to ever be parallel to the plane
    return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
}

void main(void)
{
    vec4 eyeCoordinate = gl_FragCoord;
    eyeCoordinate /= eyeCoordinate.w;

#ifdef PER_INSTANCE_COLOR
    out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
    // Use distances for planes aligned with segment to prevent skew in dashing
    float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
    float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);

    // Clamp - distance to aligned planes may be negative due to mitering
    distanceFromStart = max(0.0, distanceFromStart);
    distanceFromEnd = max(0.0, distanceFromEnd);

    float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
    s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;

    czm_materialInput materialInput;

    materialInput.s = s;
    materialInput.st = vec2(s, v_texcoordT);
    materialInput.str = vec3(s, v_texcoordT, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
}
`;var MKt=T(S(),1),qG=`in vec3 position3DHigh;
in vec3 position3DLow;

in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;

in float batchId;

out vec3 v_forwardDirectionEC;
out vec3 v_texcoordNormalizationAndHalfWidth;
out float v_batchId;

// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#else
out vec2 v_alignedPlaneDistances;
out float v_texcoordT;
#endif

// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
void main()
{
    v_batchId = batchId;

    // Start position
    vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
    vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
    vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
    vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
    vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
    vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;

    // Start plane
    vec4 startPlane2D;
    vec4 startPlane3D;
    startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
    startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
    startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
    startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);

    // Right plane
    vec4 rightPlane2D;
    vec4 rightPlane3D;
    rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
    rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
    rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
    rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);

    // End position
    posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
    posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
    posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
    posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
    posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
    vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
    vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
    vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));

    // End plane
    vec4 endPlane2D;
    vec4 endPlane3D;
    endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
    endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
    endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
    endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);

    // Forward direction
    v_forwardDirectionEC = normalize(endEC - startEC);

    vec2 cleanTexcoordNormalization2D;
    cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
    cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
    vec2 cleanTexcoordNormalization3D;
    cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
    cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
    cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));

    v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#else // PER_INSTANCE_COLOR
    // For computing texture coordinates

    v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
    v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
#endif // PER_INSTANCE_COLOR

#ifdef WIDTH_VARYING
    float width = czm_batchTable_width(batchId);
    float halfWidth = width * 0.5;
    v_width = width;
    v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#else
    float halfWidth = 0.5 * czm_batchTable_width(batchId);
    v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#endif

    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
    // Since this is morphing, compute both 3D and 2D positions and then blend.

    // ****** 3D ******
    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
    float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
    float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
    vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    vec3 normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.

    // Nudge the top vertex upwards to prevent flickering
    vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
    geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
    positionEc3D.xyz += geodeticSurfaceNormal;

    // Determine if this vertex is on the "left" or "right"
    normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);

    // A "perfect" implementation would push along normals according to the angle against forward.
    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
    positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)

    // ****** 2D ******
    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
    absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
    absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
    planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
    upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.

    // Nudge the top vertex upwards to prevent flickering
    geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
    geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
    positionEc2D.xyz += geodeticSurfaceNormal;

    // Determine if this vertex is on the "left" or "right"
    normalEC *= sign(texcoordNormalization2D.x);
#ifndef PER_INSTANCE_COLOR
    // Use vertex's sidedness to compute its texture coordinate.
    v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
#endif

    // A "perfect" implementation would push along normals according to the angle against forward.
    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
    positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)

    // Blend for actual position
    gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);

#ifdef ANGLE_VARYING
    // Approximate relative screen space direction of the line.
    vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var UKt=T(S(),1),$G=`in vec3 position3DHigh;
in vec3 position3DLow;

// In 2D and in 3D, texture coordinate normalization component signs encodes:
// * X sign - sidedness relative to right plane
// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
#ifndef COLUMBUS_VIEW_2D
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
#else
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
#endif

in float batchId;

out vec4 v_startPlaneNormalEcAndHalfWidth;
out vec4 v_endPlaneNormalEcAndBatchId;
out vec4 v_rightPlaneEC;
out vec4 v_endEcAndStartEcX;
out vec4 v_texcoordNormalizationAndStartEcYZ;

// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif

#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif

void main()
{
#ifdef COLUMBUS_VIEW_2D
    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;

    vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
    vec3 ecEnd = forwardDirectionEC + ecStart;
    forwardDirectionEC = normalize(forwardDirectionEC);

    // Right plane
    v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);

    // start plane
    vec4 startPlaneEC;
    startPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.xy);
    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);

    // end plane
    vec4 endPlaneEC;
    endPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.zw);
    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);

    v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
    v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;

#else // COLUMBUS_VIEW_2D
    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
    vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
    vec3 ecEnd = ecStart + offset;

    vec3 forwardDirectionEC = normalize(offset);

    // start plane
    vec4 startPlaneEC;
    startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);

    // end plane
    vec4 endPlaneEC;
    endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);

    // Right plane
    v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);

    v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
    v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;

#endif // COLUMBUS_VIEW_2D

    v_endEcAndStartEcX.xyz = ecEnd;
    v_endEcAndStartEcX.w = ecStart.x;
    v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;

#ifdef PER_INSTANCE_COLOR
    v_color = czm_batchTable_color(batchId);
#endif // PER_INSTANCE_COLOR

    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
    vec4 positionRelativeToEye = czm_computePosition();

    // Check distance to the end plane and start plane, pick the plane that is closer
    vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
    float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
    float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
    vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
    vec3 normalEC = normalize(cross(planeDirection, upOrDown));           // In practice, the opposite seems to work too.

    // Extrude bottom vertices downward for far view distances, like for GroundPrimitives
    upOrDown = cross(forwardDirectionEC, normalEC);
    upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
    upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
    upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
    positionEC.xyz += upOrDown;

    v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));

    // Determine distance along normalEC to push for a volume of appropriate width.
    // Make volumes about double pixel width for a conservative fit - in practice the
    // extra cost here is minimal compared to the loose volume heights.
    //
    // N = normalEC (guaranteed "right-facing")
    // R = rightEC
    // p = angle between N and R
    // w = distance to push along R if R == N
    // d = distance to push along N
    //
    //   N   R
    //  {  p| }      * cos(p) = dot(N, R) = w / d
    //  d  |  |w    * d = w / dot(N, R)
    //    { | }
    //       o---------- polyline segment ---->
    //
    float width = czm_batchTable_width(batchId);
#ifdef WIDTH_VARYING
    v_width = width;
#endif

    v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
    v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;

    v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
    v_endPlaneNormalEcAndBatchId.w = batchId;

    width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
    width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N

    // Determine if this vertex is on the "left" or "right"
#ifdef COLUMBUS_VIEW_2D
        normalEC *= sign(texcoordNormalization2D.x);
#else
        normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
#endif

    positionEC.xyz += width * normalEC;
    gl_Position = czm_depthClamp(czm_projection * positionEC);

#ifdef ANGLE_VARYING
    // Approximate relative screen space direction of the line.
    vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var $Kt=T(S(),1);var DKt=T(S(),1),eE=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec4 color;
in float batchId;

out vec4 v_color;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = czm_computePosition();
    vec4 prev = czm_computePrevPosition();
    vec4 next = czm_computeNextPosition();

    float angle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;

    v_color = color;
}
`;var YKt=T(S(),1),jl=`void clipLineSegmentToNearPlane(
    vec3 p0,
    vec3 p1,
    out vec4 positionWC,
    out bool clipped,
    out bool culledByNearPlane,
    out vec4 clippedPositionEC)
{
    culledByNearPlane = false;
    clipped = false;

    vec3 p0ToP1 = p1 - p0;
    float magnitude = length(p0ToP1);
    vec3 direction = normalize(p0ToP1);

    // Distance that p0 is behind the near plane. Negative means p0 is
    // in front of the near plane.
    float endPoint0Distance =  czm_currentFrustum.x + p0.z;

    // Camera looks down -Z.
    // When moving a point along +Z: LESS VISIBLE
    //   * Points in front of the camera move closer to the camera.
    //   * Points behind the camrea move farther away from the camera.
    // When moving a point along -Z: MORE VISIBLE
    //   * Points in front of the camera move farther away from the camera.
    //   * Points behind the camera move closer to the camera.

    // Positive denominator: -Z, becoming more visible
    // Negative denominator: +Z, becoming less visible
    // Nearly zero: parallel to near plane
    float denominator = -direction.z;

    if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
    {
        // p0 is behind the near plane and the line to p1 is nearly parallel to
        // the near plane, so cull the segment completely.
        culledByNearPlane = true;
    }
    else if (endPoint0Distance > 0.0)
    {
        // p0 is behind the near plane, and the line to p1 is moving distinctly
        // toward or away from it.

        // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
        float t = endPoint0Distance / denominator;
        if (t < 0.0 || t > magnitude)
        {
            // Near plane intersection is not between the two points.
            // We already confirmed p0 is behind the naer plane, so now
            // we know the entire segment is behind it.
            culledByNearPlane = true;
        }
        else
        {
            // Segment crosses the near plane, update p0 to lie exactly on it.
            p0 = p0 + t * direction;

            // Numerical noise might put us a bit on the wrong side of the near plane.
            // Don't let that happen.
            p0.z = min(p0.z, -czm_currentFrustum.x);

            clipped = true;
        }
    }

    clippedPositionEC = vec4(p0, 1.0);
    positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
}

vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
{
    // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.

#ifdef POLYLINE_DASH
    // Compute the window coordinates of the points.
    vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
    vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
    vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);

    // Determine the relative screen space direction of the line.
    vec2 lineDir;
    if (usePrevious) {
        lineDir = normalize(positionWindow.xy - previousWindow.xy);
    }
    else {
        lineDir = normalize(nextWindow.xy - positionWindow.xy);
    }
    angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)

    // Quantize the angle so it doesn't change rapidly between segments.
    angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
#endif

    vec4 clippedPrevWC, clippedPrevEC;
    bool prevSegmentClipped, prevSegmentCulled;
    clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);

    vec4 clippedNextWC, clippedNextEC;
    bool nextSegmentClipped, nextSegmentCulled;
    clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);

    bool segmentClipped, segmentCulled;
    vec4 clippedPositionWC, clippedPositionEC;
    clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);

    if (segmentCulled)
    {
        return vec4(0.0, 0.0, 0.0, 1.0);
    }

    vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
    vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);

    // If a segment was culled, we can't use the corresponding direction
    // computed above. We should never see both of these be true without
    // \`segmentCulled\` above also being true.
    if (prevSegmentCulled)
    {
        directionToPrevWC = -directionToNextWC;
    }
    else if (nextSegmentCulled)
    {
        directionToNextWC = -directionToPrevWC;
    }

    vec2 thisSegmentForwardWC, otherSegmentForwardWC;
    if (usePrevious)
    {
        thisSegmentForwardWC = -directionToPrevWC;
        otherSegmentForwardWC = directionToNextWC;
    }
    else
    {
        thisSegmentForwardWC = directionToNextWC;
        otherSegmentForwardWC =  -directionToPrevWC;
    }

    vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);

    vec2 leftWC = thisSegmentLeftWC;
    float expandWidth = width * 0.5;

    // When lines are split at the anti-meridian, the position may be at the
    // same location as the next or previous position, and we need to handle
    // that to avoid producing NaNs.
    if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
    {
        vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);

        vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
        float leftSumLength = length(leftSumWC);
        leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);

        // The sine of the angle between the two vectors is given by the formula
        //         |a x b| = |a||b|sin(theta)
        // which is
        //     float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
        // Because the z components of both vectors are zero, the x and y coordinate will be zero.
        // Therefore, the sine of the angle is just the z component of the cross product.
        vec2 u = -thisSegmentForwardWC;
        vec2 v = leftWC;
        float sinAngle = abs(u.x * v.y - u.y * v.x);
        expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
    }

    vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
    return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
}

vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
{
    vec4 positionEC = czm_modelViewRelativeToEye * position;
    vec4 prevEC = czm_modelViewRelativeToEye * previous;
    vec4 nextEC = czm_modelViewRelativeToEye * next;
    return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
}
`;var eY=`${jl}
${eE}`,iIe=Ug;Mt.isInternetExplorer()||(eY=`#define CLIP_POLYLINE 
${eY}`);function $g(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=!1,i=$g.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,eY),this._fragmentShaderSource=g(e.fragmentShaderSource,iIe),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties($g.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});$g.VERTEX_FORMAT=We.POSITION_ONLY;$g.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;$g.prototype.isTranslucent=to.prototype.isTranslucent;$g.prototype.getRenderState=to.prototype.getRenderState;var Fr=$g;var fHt=T(S(),1);var tHt=T(S(),1),tE=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec2 st;
in float batchId;

out float v_width;
out vec2 v_st;
out float v_polylineAngle;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = czm_computePosition();
    vec4 prev = czm_computePrevPosition();
    vec4 next = czm_computeNextPosition();

    float angle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;

    v_width = width;
    v_st.s = st.s;
    v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
    v_polylineAngle = angle;
}
`;var iHt=T(S(),1),ex=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_st;

void main()
{
    czm_materialInput materialInput;

    vec2 st = v_st;
    st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);

    materialInput.s = st.s;
    materialInput.st = st;
    materialInput.str = vec3(st, 0.0);

    czm_material material = czm_getMaterial(materialInput);
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#ifdef VECTOR_TILE
    out_FragColor *= u_highlightColor;
#endif

    czm_writeLogDepth();
}
`;var tY=`${jl}
${tE}`,oIe=ex;Mt.isInternetExplorer()||(tY=`#define CLIP_POLYLINE 
${tY}`);function tx(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=!1,i=tx.VERTEX_FORMAT;this.material=d(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,tY),this._fragmentShaderSource=g(e.fragmentShaderSource,oIe),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(tx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});tx.VERTEX_FORMAT=We.POSITION_AND_ST;tx.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;tx.prototype.isTranslucent=to.prototype.isTranslucent;tx.prototype.getRenderState=to.prototype.getRenderState;var Ds=tx;function lp(e){e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;d(t)||(t=new Ds),this.appearance=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=qee(!1),this._renderState3DTiles=qee(!0),this._renderStateMorph=De.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(lp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});lp.initializeTerrainHeights=function(){return li.initialize()};function rIe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()($G);s=Zn._appendShowToShader(o,s),s=Zn._appendDistanceDisplayConditionToShader(o,s),s=Zn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(qG);a=Zn._appendShowToShader(o,a),a=Zn._appendDistanceDisplayConditionToShader(o,a),a=Zn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(QG),l=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",m="";d(n.material)?(m=d(n.material)?n.material.shaderSource:"",m.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&l.push("ANGLE_VARYING"),m.search(/in\s+float\s+v_width;/g)!==-1&&l.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",l.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],y=new Be({defines:l,sources:[s]}),f=new Be({defines:p,sources:[m,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:y,fragmentShaderSource:f,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!d(x)){let C=new Be({defines:l.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=x;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!d(_)){let C=new Be({defines:l.concat([`MAX_TERRAIN_HEIGHT ${li._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(jG);let V=new Be({defines:p,sources:[m,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=_}function qee(e){return De.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Dn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Dn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function sIe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let l=t instanceof Fr?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(l);for(let m=0;m<a;m++){let p=s._va[m],y=o[m];d(y)||(y=o[m]=new nt({owner:e,primitiveType:s._primitiveType})),y.vertexArray=p,y.renderState=e._renderState,y.shaderProgram=e._sp,y.uniformMap=u,y.pass=Re.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=nt.shallowClone(y,y.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=f;let x=nt.shallowClone(y,y.derivedCommands.color2D);x.shaderProgram=e._sp2D,y.derivedCommands.color2D=x;let _=nt.shallowClone(f,f.derivedCommands.color2D);_.shaderProgram=e._sp2D,f.derivedCommands.color2D=_;let C=nt.shallowClone(y,y.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",y.derivedCommands.colorMorph=C}}function $ee(e,t,n,i,o,r,s){n.mode===ie.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ie.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function aIe(e,t,n,i,o,r,s){let a=e._primitive;Zn._updateBoundingVolumes(a,t,o);let c;t.mode===ie.SCENE3D?c=a._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ie.SCENE2D&&d(a._boundingSphere2D)?c=a._boundingSphere2D:d(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let l=t.mode===ie.MORPHING,u=e.classificationType,m=u!==kn.CESIUM_3D_TILE,p=u!==kn.TERRAIN&&!l,y,f=t.passes;if(f.render||f.pick&&a.allowPicking){let x=n.length;for(let _=0;_<x;++_){let C=c[_];m&&(y=n[_],$ee(e,y,t,o,r,C,s)),p&&(y=n[_].derivedCommands.tileset,$ee(e,y,t,o,r,C,s))}}}lp.prototype.update=function(e){if(!d(this._primitive)&&!d(this.geometryInstances))return;if(!li.initialized){lp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!d(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!d(a)||!d(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let l=c.attributes;for(let u in l)l.hasOwnProperty(u)&&(a[u]=l[u]);d(a.width)||(a.width=new Da({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,qg.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new _t({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,l,u){rIe(n,l,u)},i._createCommandsFunction=function(c,l,u,m,p,y,f){sIe(n,l,u,m,y,f)},i._updateAndQueueCommandsFunction=function(c,l,u,m,p,y,f,x){aIe(n,l,u,m,p,y,f)},this._primitive=new Zn(i)}if(this.appearance instanceof Fr&&!this._hasPerInstanceColors)throw new fe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&d(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};lp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};lp.isSupported=function(e){return e.frameState.context.depthTexture};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var dm=lp;var hzt=T(S(),1);var szt=T(S(),1);var $Ht=T(S(),1);var cIe=new D(1,1),lIe=!1,dIe=B.WHITE;function VS(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(VS.prototype,{isConstant:{get:function(){return H.isConstant(this._image)&&H.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});VS.prototype.getType=function(e){return"Image"};VS.prototype.getValue=function(e,t){return d(t)||(t={}),t.image=H.getValueOrUndefined(this._image,e),t.repeat=H.getValueOrClonedDefault(this._repeat,e,cIe,t.repeat),t.color=H.getValueOrClonedDefault(this._color,e,dIe,t.color),H.getValueOrDefault(this._transparent,e,lIe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};VS.prototype.equals=function(e){return this===e||e instanceof VS&&H.equals(this._image,e._image)&&H.equals(this._repeat,e._repeat)&&H.equals(this._color,e._color)&&H.equals(this._transparent,e._transparent)};var bb=VS;function uIe(e){if(e instanceof B)return new At(e);if(typeof e=="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new bb;return t.image=e,t}}function mIe(e,t){return le(e,t,uIe)}var Ro=mIe;function nE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(nE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});nE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new nE(this)};nE.prototype.merge=function(e){this.show=g(this.show,e.show),this.dimensions=g(this.dimensions,e.dimensions),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var nx=nE;var Izt=T(S(),1);var pzt=T(S(),1),hIe={FIXED:0,INERTIAL:1},io=Object.freeze(hIe);var Czt=T(S(),1);function LS(){fe.throwInstantiationError()}Object.defineProperties(LS.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});LS.prototype.getValue=fe.throwInstantiationError;LS.prototype.getValueInReferenceFrame=fe.throwInstantiationError;LS.prototype.equals=fe.throwInstantiationError;var nY=new $;LS.convertToReferenceFrame=function(e,t,n,i,o){if(!d(t))return t;if(d(o)||(o=new h),n===i)return h.clone(t,o);let r=vt.computeIcrfToFixedMatrix(e,nY);if(d(r)||(r=vt.computeTemeToPseudoFixedMatrix(e,nY)),n===io.INERTIAL)return $.multiplyByVector(r,t,o);if(n===io.FIXED)return $.multiplyByVector($.transpose(r,nY),t,o)};var dp=LS;function ix(e,t){this._definitionChanged=new ye,this._value=h.clone(e),this._referenceFrame=g(t,io.FIXED)}Object.defineProperties(ix.prototype,{isConstant:{get:function(){return!d(this._value)||this._referenceFrame===io.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});ix.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,io.FIXED,t)};ix.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),d(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};ix.prototype.getValueInReferenceFrame=function(e,t,n){return dp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};ix.prototype.equals=function(e){return this===e||e instanceof ix&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Gc=ix;var Mzt=T(S(),1);function iE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(iE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});iE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new iE(this)};iE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var ox=iE;var kzt=T(S(),1);function fIe(e){return e}function pIe(e,t){return le(e,t,fIe)}var ul=pIe;var zzt=T(S(),1);function oE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(oE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});oE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new oE(this)};oE.prototype.merge=function(e){this.show=g(this.show,e.show),this.length=g(this.length,e.length),this.topRadius=g(this.topRadius,e.topRadius),this.bottomRadius=g(this.bottomRadius,e.bottomRadius),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=g(this.slices,e.slices),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var rx=oE;var tJt=T(S(),1);function rE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(rE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});rE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new rE(this)};rE.prototype.merge=function(e){this.show=g(this.show,e.show),this.semiMajorAxis=g(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=g(this.semiMinorAxis,e.semiMinorAxis),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var sx=rE;var cJt=T(S(),1);function sE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(sE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});sE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new sE(this)};sE.prototype.merge=function(e){this.show=g(this.show,e.show),this.radii=g(this.radii,e.radii),this.innerRadii=g(this.innerRadii,e.innerRadii),this.minimumClock=g(this.minimumClock,e.minimumClock),this.maximumClock=g(this.maximumClock,e.maximumClock),this.minimumCone=g(this.minimumCone,e.minimumCone),this.maximumCone=g(this.maximumCone,e.maximumCone),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.stackPartitions=g(this.stackPartitions,e.stackPartitions),this.slicePartitions=g(this.slicePartitions,e.slicePartitions),this.subdivisions=g(this.subdivisions,e.subdivisions),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ax=sE;var fJt=T(S(),1);function aE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(aE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});aE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new aE(this)};aE.prototype.merge=function(e){this.show=g(this.show,e.show),this.text=g(this.text,e.text),this.font=g(this.font,e.font),this.style=g(this.style,e.style),this.scale=g(this.scale,e.scale),this.showBackground=g(this.showBackground,e.showBackground),this.backgroundColor=g(this.backgroundColor,e.backgroundColor),this.backgroundPadding=g(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=g(this.pixelOffset,e.pixelOffset),this.eyeOffset=g(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this.verticalOrigin,e.verticalOrigin),this.heightReference=g(this.heightReference,e.heightReference),this.fillColor=g(this.fillColor,e.fillColor),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=g(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance)};var um=aE;var YJt=T(S(),1);var GJt=T(S(),1);var _Jt=T(S(),1);var bIe=new h(1,1,1),yIe=h.ZERO,gIe=Ae.IDENTITY;function ete(e,t,n){this.translation=h.clone(g(e,yIe)),this.rotation=Ae.clone(g(t,gIe)),this.scale=h.clone(g(n,bIe))}ete.prototype.equals=function(e){return this===e||d(e)&&h.equals(this.translation,e.translation)&&Ae.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var yb=ete;var iY=new yb;function cE(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(cE.prototype,{isConstant:{get:function(){return H.isConstant(this._translation)&&H.isConstant(this._rotation)&&H.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});cE.prototype.getValue=function(e,t){return d(t)||(t=new yb),t.translation=H.getValueOrClonedDefault(this._translation,e,iY.translation,t.translation),t.rotation=H.getValueOrClonedDefault(this._rotation,e,iY.rotation,t.rotation),t.scale=H.getValueOrClonedDefault(this._scale,e,iY.scale,t.scale),t};cE.prototype.equals=function(e){return this===e||e instanceof cE&&H.equals(this._translation,e._translation)&&H.equals(this._rotation,e._rotation)&&H.equals(this._scale,e._scale)};var cx=cE;var FJt=T(S(),1);function up(e,t){this._propertyNames=[],this._definitionChanged=new ye,d(e)&&this.merge(e,t)}Object.defineProperties(up.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!H.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});up.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function xIe(e){return new qn(e)}up.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,g(n,xIe))),d(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};up.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};up.prototype.getValue=function(e,t){d(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=H.getValueOrUndefined(this[r],e,t[r])}return t};up.prototype.merge=function(e,t){let n=this._propertyNames,i=d(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?d(a)&&d(a.merge)&&a.merge(c):d(c)&&d(c.merge)&&d(c.clone)?this[s]=c.clone():this[s]=c)}};function _Ie(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!H.equals(e[s],t[s]))return!1}return!0}up.prototype.equals=function(e){return this===e||e instanceof up&&_Ie(this,e)};var ml=up;function tte(e){return new cx(e)}function TIe(e){return new ml(e,tte)}function SIe(e){return new ml(e)}function lE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(lE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,TIe),articulations:le("articulations",void 0,SIe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});lE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new lE(this)};lE.prototype.merge=function(e){this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.scale=g(this.scale,e.scale),this.minimumPixelSize=g(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=g(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=g(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=g(this.runAnimations,e.runAnimations),this.clampAnimations=g(this.clampAnimations,e.clampAnimations),this.shadows=g(this.shadows,e.shadows),this.heightReference=g(this.heightReference,e.heightReference),this.silhouetteColor=g(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=g(this.silhouetteSize,e.silhouetteSize),this.color=g(this.color,e.color),this.colorBlendMode=g(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=g(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=g(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=g(this.lightColor,e.lightColor),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=g(this.clippingPlanes,e.clippingPlanes),this.customShader=g(this.customShader,e.customShader);let t=e.nodeTransformations;if(d(t)){let i=this.nodeTransformations;d(i)?i.merge(t):this.nodeTransformations=new ml(t,tte)}let n=e.articulations;if(d(n)){let i=this.articulations;d(i)?i.merge(n):this.articulations=new ml(n)}};var mp=lE;var QJt=T(S(),1);function dE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(dE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});dE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new dE(this)};dE.prototype.merge=function(e){this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.maximumScreenSpaceError=g(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var lx=dE;var iQt=T(S(),1);function uE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(uE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Ro("material"),distanceDisplayCondition:le("distanceDisplayCondition")});uE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new uE(this)};uE.prototype.merge=function(e){this.show=g(this.show,e.show),this.leadTime=g(this.leadTime,e.leadTime),this.trailTime=g(this.trailTime,e.trailTime),this.width=g(this.width,e.width),this.resolution=g(this.resolution,e.resolution),this.material=g(this.material,e.material),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var hp=uE;var dQt=T(S(),1);function mE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(mE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});mE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new mE(this)};mE.prototype.merge=function(e){this.show=g(this.show,e.show),this.plane=g(this.plane,e.plane),this.dimensions=g(this.dimensions,e.dimensions),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var hE=mE;var bQt=T(S(),1);function fE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(fE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});fE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new fE(this)};fE.prototype.merge=function(e){this.show=g(this.show,e.show),this.pixelSize=g(this.pixelSize,e.pixelSize),this.heightReference=g(this.heightReference,e.heightReference),this.color=g(this.color,e.color),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance)};var dx=fE;var GQt=T(S(),1);var xQt=T(S(),1);function CIe(e,t){this.positions=d(e)?e:[],this.holes=d(t)?t:[]}var fa=CIe;function VIe(e){return Array.isArray(e)&&(e=new fa(e)),new qn(e)}function pE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(pE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,VIe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});pE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new pE(this)};pE.prototype.merge=function(e){this.show=g(this.show,e.show),this.hierarchy=g(this.hierarchy,e.hierarchy),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.perPositionHeight=g(this.perPositionHeight,e.perPositionHeight),this.closeTop=g(this.closeTop,e.closeTop),this.closeBottom=g(this.closeBottom,e.closeBottom),this.arcType=g(this.arcType,e.arcType),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex),this.textureCoordinates=g(this.textureCoordinates,e.textureCoordinates)};var mm=pE;var wQt=T(S(),1);function bE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(bE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Ro("material"),depthFailMaterial:Ro("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});bE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new bE(this)};bE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.granularity=g(this.granularity,e.granularity),this.material=g(this.material,e.material),this.depthFailMaterial=g(this.depthFailMaterial,e.depthFailMaterial),this.arcType=g(this.arcType,e.arcType),this.clampToGround=g(this.clampToGround,e.clampToGround),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var Ba=bE;var DQt=T(S(),1);function yE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(yE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});yE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new yE(this)};yE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.shape=g(this.shape,e.shape),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ux=yE;var JQt=T(S(),1);function gE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(gE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});gE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new gE(this)};gE.prototype.merge=function(e){this.show=g(this.show,e.show),this.coordinates=g(this.coordinates,e.coordinates),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var hm=gE;var n4t=T(S(),1);function xE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(xE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Ro("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});xE.prototype.clone=function(e){return d(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new xE(this)};xE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.minimumHeights=g(this.minimumHeights,e.minimumHeights),this.maximumHeights=g(this.maximumHeights,e.maximumHeights),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var fp=xE;var LIe=new he;function RIe(e){return new Gc(e)}function ZIe(e){return le(e,void 0,RIe)}function Bs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Nh(e){e=g(e,g.EMPTY_OBJECT);let t=e.id;d(t)||(t=Yn()),this._availability=void 0,this._id=t,this._definitionChanged=new ye,this._name=e.name,this._show=g(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function oY(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&oY(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Nh.prototype,{availability:ul("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:ul("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&oY(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!d(this.entityCollection)||this.entityCollection.show)&&(!d(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(d(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,d(e)&&e._children.push(this);let i=this.isShowing;n!==i&&oY(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Bs("billboard",Ua),box:Bs("box",nx),corridor:Bs("corridor",ox),cylinder:Bs("cylinder",rx),description:le("description"),ellipse:Bs("ellipse",sx),ellipsoid:Bs("ellipsoid",ax),label:Bs("label",um),model:Bs("model",mp),tileset:Bs("tileset",lx),orientation:le("orientation"),path:Bs("path",hp),plane:Bs("plane",hE),point:Bs("point",dx),polygon:Bs("polygon",mm),polyline:Bs("polyline",Ba),polylineVolume:Bs("polylineVolume",ux),properties:Bs("properties",ml),position:ZIe("position"),rectangle:Bs("rectangle",hm),viewFrom:le("viewFrom"),wall:Bs("wall",fp)});Nh.prototype.isAvailable=function(e){let t=this._availability;return!d(t)||t.contains(e)};Nh.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,ul(e,!0))};Nh.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Nh.prototype.merge=function(e){this.name=g(this.name,e.name),this.availability=g(this.availability,e.availability);let t=this._propertyNames,n=d(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!d(s)&&t.indexOf(r)===-1&&this.addProperty(r),d(a)&&(d(s)?d(s.merge)&&s.merge(a):d(a.merge)&&d(a.clone)?this[r]=a.clone():this[r]=a)}};var nte=new $,ite=new h,ote=new Ae;Nh.prototype.computeModelMatrix=function(e,t){let n=H.getValueOrUndefined(this._position,e,ite);if(!d(n))return;let i=H.getValueOrUndefined(this._orientation,e,ote);return d(i)?t=F.fromRotationTranslation($.fromQuaternion(i,nte),n,t):t=vt.eastNorthUpToFixedFrame(n,void 0,t),t};Nh.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=H.getValueOrDefault(t,e,Ke.NONE),s=H.getValueOrUndefined(this._position,e,ite);if(r===Ke.NONE||!d(s)||h.equalsEpsilon(s,h.ZERO,W.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,LIe);r===Ke.CLAMP_TO_GROUND?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=H.getValueOrUndefined(this._orientation,e,ote);return d(c)?o=F.fromRotationTranslation($.fromQuaternion(c,nte),s,o):o=vt.eastNorthUpToFixedFrame(s,void 0,o),o};Nh.supportsMaterialsforEntitiesOnTerrain=function(e){return Rc.supportsMaterials(e)};Nh.supportsPolylinesOnTerrain=function(e){return dm.isSupported(e)};var Oo=Nh;var GIe=new At(B.WHITE),EIe=new qn(!0),XIe=new qn(!0),IIe=new qn(!1),WIe=new qn(B.BLACK),PIe=new qn(xn.DISABLED),vIe=new qn(new Gt),wIe=new qn(kn.BOTH);function Ec(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new ye,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Oo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Ec.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!d(this._entity.availability)&&H.isConstant(this._showProperty)&&H.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!d(this._entity.availability)&&H.isConstant(this._showProperty)&&H.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Ec.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return g(n,!1)};Ec.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return g(n,!1)};Ec.prototype.createFillGeometryInstance=fe.throwInstantiationError;Ec.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;Ec.prototype.isDestroyed=function(){return!1};Ec.prototype.destroy=function(){ue(this)};Ec.prototype._isHidden=function(e,t){let n=t.show;return d(n)&&n.isConstant&&!n.getValue(Ye.MINIMUM_VALUE)};Ec.prototype._isOnTerrain=function(e,t){return!1};Ec.prototype._getIsClosed=function(e){return!0};Ec.prototype._isDynamic=fe.throwInstantiationError;Ec.prototype._setStaticOptions=fe.throwInstantiationError;Ec.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!d(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=d(r)&&r.isConstant?r.getValue(Ye.MINIMUM_VALUE):!0,a=o.outline,c=d(a);if(c&&a.isConstant&&(c=a.getValue(Ye.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let l=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=g(o.material,GIe),this._fillProperty=g(r,XIe),this._showProperty=g(l,EIe),this._showOutlineProperty=g(o.outline,IIe),this._outlineColorProperty=c?g(o.outlineColor,WIe):void 0,this._shadowsProperty=g(o.shadows,PIe),this._distanceDisplayConditionProperty=g(o.distanceDisplayCondition,vIe),this._classificationTypeProperty=g(o.classificationType,wIe),this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof At);if(c&&u&&(It(It.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let m=o.outlineWidth;this._outlineWidth=d(m)?m.getValue(Ye.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Ec.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var oi=Ec;var Vjt=T(S(),1);var sjt=T(S(),1);function RS(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(RS.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});RS.prototype.getValue=function(e,t){return this._callback(e,t)};RS.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};RS.prototype.equals=function(e){return this===e||e instanceof RS&&this._callback===e._callback&&this._isConstant===e._isConstant};var fm=RS;var gjt=T(S(),1);var rte=new h,FIe=new he;function ZS(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new ye,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(d(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ye.MINIMUM_VALUE,rte);if(!d(r)||h.equals(r,h.ZERO)||!d(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(ZS.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});ZS.prototype._updateClamping=function(){d(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(!d(t)||h.equals(n,h.ZERO)){this._terrainHeight=0;return}let i=t.ellipsoid,o=t._surface,r=this,s=i.cartesianToCartographic(n,this._cartographicPosition),a=t.getHeight(s);d(a)?this._terrainHeight=a:this._terrainHeight=0;function c(l){if(e.mode===ie.SCENE3D){let u=i.cartesianToCartographic(l,FIe);r._terrainHeight=u.height}else r._terrainHeight=l.x;r.definitionChanged.raiseEvent()}this._removeCallbackFunc=o.updateHeight(s,c)};ZS.prototype.getValue=function(e,t){let n=H.getValueOrDefault(this._heightReference,e,Ke.NONE),i=H.getValueOrDefault(this._extrudedHeightReference,e,Ke.NONE);if(n===Ke.NONE&&i!==Ke.RELATIVE_TO_GROUND)return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,rte);if(!d(r)||h.equals(r,h.ZERO)||!d(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,W.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.globe.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};ZS.prototype.isDestroyed=function(){return!1};ZS.prototype.destroy=function(){return d(this._removeEventListener)&&this._removeEventListener(),d(this._removeModeListener)&&this._removeModeListener(),d(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var mx=ZS;function AIe(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!d(o))return;d(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(d(r)){let s=new fm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new mx(this._scene,s,r)}}var pp=AIe;var ste=h.ZERO,ate=new h,MIe=new h,cte=new B;function NIe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function ql(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new NIe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}d(Object.create)&&(ql.prototype=Object.create(oi.prototype),ql.prototype.constructor=ql);Object.defineProperties(ql.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ql.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof At){let a;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,cte)),d(a)||(a=B.WHITE),s.color=Ut.fromColor(a)}return d(this._options.offsetAttribute)&&(s.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,ste,ate))),new _t({id:t,geometry:cl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};ql.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,cte),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return d(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,ste,ate))),new _t({id:t,geometry:sm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:r})};ql.prototype._computeCenter=function(e,t){return H.getValueOrUndefined(this._entity.position,e,t)};ql.prototype._isHidden=function(e,t){return!d(t.dimensions)||!d(e.position)||oi.prototype._isHidden.call(this,e,t)};ql.prototype._isDynamic=function(e,t){return!e.position.isConstant||!H.isConstant(e.orientation)||!t.dimensions.isConstant||!H.isConstant(t.outlineWidth)};ql.prototype._setStaticOptions=function(e,t){let n=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof At?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ye.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ke.NONE?rn.ALL:void 0};ql.prototype._onEntityPropertyChanged=pp;ql.DynamicGeometryUpdater=GS;function GS(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(GS.prototype=Object.create(ii.prototype),GS.prototype.constructor=GS);GS.prototype._isHidden=function(e,t,n){let i=H.getValueOrUndefined(e.position,n,MIe),o=this._options.dimensions;return!d(i)||!d(o)||ii.prototype._isHidden.call(this,e,t,n)};GS.prototype._setOptions=function(e,t,n){let i=H.getValueOrDefault(t.heightReference,n,Ke.NONE),o=this._options;o.dimensions=H.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ke.NONE?rn.ALL:void 0};var _E=ql;var $Fn=T(S(),1);var DFn=T(S(),1);var jjt=T(S(),1),dte=T(lte(),1);var UIe=0,aY={};function Uh(e,t){let n,i=e;d(aY[i])?n=aY[i]:(n=UIe++,aY[i]=n),t=g(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Uh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!d(this._element)){let e=dte.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});Uh.equals=function(e,t){return e===t||d(e)&&d(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Uh.prototype.equals=function(e){return Uh.equals(this,e)};Uh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};Uh.getIonCredit=function(e){let t=d(e.collapsible)&&!e.collapsible;return new Uh(e.html,t)};Uh.clone=function(e){if(d(e))return new Uh(e.html,e.showOnScreen)};var St=Uh;var W8t=T(S(),1);var L8t=T(S(),1);var $jt=T(S(),1),TE=`in vec2 v_textureCoordinates;

uniform float originalSize;
uniform sampler2D texture0;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
uniform sampler2D texture4;
uniform sampler2D texture5;

const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));
const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));
const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));
const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));

void main()
{
    vec2 uv = v_textureCoordinates;
    vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);
    vec2 pixel = 1.0 / textureSize;

    float mipLevel = 0.0;

    if (uv.x - pixel.x > (textureSize.y / textureSize.x))
    {
        mipLevel = 1.0;
        if (uv.y - pixel.y > yMipLevel1)
        {
            mipLevel = 2.0;
            if (uv.y - pixel.y * 3.0 > yMipLevel2)
            {
                mipLevel = 3.0;
                if (uv.y - pixel.y * 5.0 > yMipLevel3)
                {
                    mipLevel = 4.0;
                    if (uv.y - pixel.y * 7.0 > yMipLevel4)
                    {
                        mipLevel = 5.0;
                    }
                }
            }
        }
    }

    if (mipLevel > 0.0)
    {
        float scale = pow(2.0, mipLevel);

        uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);
        uv.x *= ((textureSize.x - 2.0) / textureSize.y);

        uv.x -= 1.0 + pixel.x;
        uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));
        uv *= scale;
    }
    else
    {
        uv.x *= (textureSize.x / textureSize.y);
    }

    if(mipLevel == 0.0)
    {
        out_FragColor = texture(texture0, uv);
    }
    else if(mipLevel == 1.0)
    {
        out_FragColor = texture(texture1, uv);
    }
    else if(mipLevel == 2.0)
    {
        out_FragColor = texture(texture2, uv);
    }
    else if(mipLevel == 3.0)
    {
        out_FragColor = texture(texture3, uv);
    }
    else if(mipLevel == 4.0)
    {
        out_FragColor = texture(texture4, uv);
    }
    else if(mipLevel == 5.0)
    {
        out_FragColor = texture(texture5, uv);
    }
    else
    {
        out_FragColor = vec4(0.0);
    }
}
`;var t8t=T(S(),1),SE=`in vec3 v_cubeMapCoordinates;
uniform samplerCube cubeMap;

void main()
{
    vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates);
    #ifdef RGBA_NORMALIZED
        out_FragColor = vec4(rgba.rgb, 1.0);
    #else
        float m = rgba.a * 16.0;
        vec3 r = rgba.rgb * m;
        out_FragColor = vec4(r * r, 1.0);
    #endif
}
`;var i8t=T(S(),1),CE=`in vec4 position;
in vec3 cubeMapCoordinates;

out vec3 v_cubeMapCoordinates;

void main()
{
    gl_Position = position;
    v_cubeMapCoordinates = cubeMapCoordinates;
}
`;function hx(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new ye}Object.defineProperties(hx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});hx.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var kIe=new h(1,0,0),DIe=new h(0,0,1),BIe=new h(-1,0,0),YIe=new h(0,0,-1),yM=new h(0,1,0),OIe=new h(0,-1,0),hte=[yM,BIe,DIe,OIe,kIe,yM,YIe,yM,yM],fte=hte.length,pte=new Float32Array(fte*3),ute=0;for(let e=0;e<fte;++e,ute+=3)h.pack(hte[e],pte,ute);var KIe=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),HIe=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function zIe(e){let t=mt.createVertexBuffer({context:e,typedArray:KIe,usage:Ne.STATIC_DRAW}),n=mt.createVertexBuffer({context:e,typedArray:pte,usage:Ne.STATIC_DRAW}),i=mt.createIndexBuffer({context:e,typedArray:HIe,usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:Q.FLOAT}];return new ni({context:e,attributes:o,indexBuffer:i})}function mte(e){return function(){return e}}function cY(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(d(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let o=e._mipTextures;if(d(o))for(n=o.length,t=0;t<n;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}hx.prototype.update=function(e){let t=e.context;if(!hx.isSupported(t)||(d(this._texture)&&d(this._va)&&cY(this),d(this._texture)))return;if(!d(this._texture)&&!this._loading){let y=e.context.textureCache.getTexture(this._url);d(y)&&(cY(this),this._texture=y,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!d(n)&&!this._loading){let y=this;rl(this._url).then(function(f){y._cubeMapBuffers=f,y._loading=!1}).catch(function(f){y.isDestroyed()||y._errorEvent.raiseEvent(f)}),this._loading=!0}if(!d(this._cubeMapBuffers))return;let i=[],o=n[0].positiveX.pixelDatatype;d(o)?i.push("RGBA_NORMALIZED"):o=t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT;let r=st.RGBA,s=new Be({defines:i,sources:[SE]});this._va=zIe(t),this._sp=Qt.fromCache({context:t,vertexShaderSource:CE,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),l=this._mipTextures=new Array(a),u=n[0].positiveX.width*2,m={originalSize:function(){return u}};for(let y=0;y<a;++y){let f=n[y].positiveY;n[y].positiveY=n[y].negativeY,n[y].negativeY=f;let x=c[y]=new Ma({context:t,source:n[y],pixelDatatype:o}),_=c[y].width*2,C=l[y]=new Wt({context:t,width:_,height:_,pixelDatatype:o,pixelFormat:r}),V=new Kd({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:mte(x)},outputTexture:C,persists:!0,owner:this});e.commandList.push(V),m[`texture${y}`]=mte(C)}this._texture=new Wt({context:t,width:u*1.5+2,height:u,pixelDatatype:o,pixelFormat:r}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new Kd({fragmentShaderSource:TE,uniformMap:m,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._ready=!0};hx.prototype.isDestroyed=function(){return!1};hx.prototype.destroy=function(){return cY(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var pm=hx;function VE(e){e=g(e,g.EMPTY_OBJECT);let t=d(e.imageBasedLightingFactor)?D.clone(e.imageBasedLightingFactor):new D(1,1);this._imageBasedLightingFactor=t;let n=g(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=D.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(VE.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=D.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return d(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return d(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function JIe(e,t){if(pm.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),d(e._specularEnvironmentMaps)){let n=new pm(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}VE.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;D.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||d(this._luminanceAtZenith)!==d(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||d(this._previousSphericalHarmonicCoefficients)!==d(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(JIe(this,t),this._specularEnvironmentMapAtlasDirty=!1),d(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!d(this._specularEnvironmentMapAtlas)&&d(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!d(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!d(this._sphericalHarmonicCoefficients)&&d(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!d(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!d(this._specularEnvironmentMapAtlas)&&d(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!d(this._sphericalHarmonicCoefficients)&&d(e.sphericalHarmonicCoefficients)};VE.prototype.isDestroyed=function(){return!1};VE.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var fx=VE;var O8t=T(S(),1),dY=T(Dl(),1);var A8t=T(S(),1);var lY,bte="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhYjVkZWE2Yi05ZjlmLTQyOTAtYjFkOC0xMmFmZTYyMjhmZGIiLCJpZCI6MjU5LCJpYXQiOjE2OTYyNjgyMzN9.iKIgzd7PueqxXsUNSIhk5C6n8uiugH-Dxy9uhOdJ5Zg",gM={};gM.defaultAccessToken=bte;gM.defaultServer=new Ee({url:"https://api.cesium.com/"});gM.getDefaultTokenCredit=function(e){if(e===bte){if(!d(lY)){let t=`<b>             This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i>             with an access token from your ion account before making any Cesium API calls.             You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;lY=new St(t,!0)}return lY}};var bm=gM;function Xc(e,t){let n,i=e.externalType,o=d(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:QIe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new me("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ee.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new dY.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}d(Object.create)&&(Xc.prototype=Object.create(Ee.prototype),Xc.prototype.constructor=Xc);Xc.fromAssetId=function(e,t){let n=Xc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Xc(i,n)})};Object.defineProperties(Xc.prototype,{credits:{get:function(){return d(this._ionRoot)?this._ionRoot.credits:d(this._credits)?this._credits:(this._credits=Xc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Xc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(St.getIonCredit),i=bm.getDefaultTokenCredit(t.queryParameters.access_token);return d(i)&&n.push(St.clone(i)),n};Xc.prototype.clone=function(e){let t=g(this._ionRoot,this);return d(e)||(e=new Xc(t._ionEndpoint,t._ionEndpointResource)),e=Ee.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Xc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},d(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ee.prototype.fetchImage.call(this,e)};Xc.prototype._makeRequest=function(e){return this._isExternal||new dY.default(this.url).authority()!==this._ionEndpointDomain?Ee.prototype._makeRequest.call(this,e):(d(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ee.prototype._makeRequest.call(this,e))};Xc._createEndpointResource=function(e,t){t=g(t,g.EMPTY_OBJECT);let n=g(t.server,bm.defaultServer),i=g(t.accessToken,bm.defaultAccessToken);n=Ee.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return d(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function QIe(e,t){let n=g(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!d(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(d(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var $l=Xc;var z8t=T(S(),1);function kh(e){e=g(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(kh.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});kh.prototype.get=function(e){return this._array[e]};kh.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};kh.prototype.peek=function(){return this._array[this._length-1]};kh.prototype.push=function(e){let t=this.length++;this._array[t]=e};kh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};kh.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};kh.prototype.resize=function(e){this.length=e};kh.prototype.trim=function(e){e=g(e,this._length),this._array.length=e};var Ic=kh;var $8t=T(S(),1);var bp={X:0,Y:1,Z:2};bp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromRotationX(W.PI_OVER_TWO));bp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromRotationX(-W.PI_OVER_TWO));bp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromRotationY(-W.PI_OVER_TWO));bp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromRotationY(W.PI_OVER_TWO));bp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromRotationZ(W.PI_OVER_TWO));bp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromRotationZ(-W.PI_OVER_TWO));bp.fromName=function(e){return bp[e]};var Zo=Object.freeze(bp);var dvn=T(S(),1);var n7t=T(S(),1);function yte(e){e=g(e,g.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(yte.prototype,{metadata:{get:function(){return this._metadata}}});var px=yte;var zEn=T(S(),1);var y7t=T(S(),1);var d7t=T(S(),1);var s7t=T(S(),1);function gb(e,t,n){return t=g(t,0),n=g(n,e.byteLength-t),e=e.subarray(t,t+n),gb.decode(e)}gb.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};gb.decodeWithFromCharCode=function(e){let t="",n=jIe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function LE(e,t,n){return t<=e&&e<=n}function jIe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let l=e[c];if(i===0){if(LE(l,0,127)){s.push(l);continue}if(LE(l,194,223)){i=1,t=l&31;continue}if(LE(l,224,239)){l===224&&(o=160),l===237&&(r=159),i=2,t=l&15;continue}if(LE(l,240,244)){l===240&&(o=144),l===244&&(r=143),i=3,t=l&7;continue}throw new me("String decoding failed.")}if(!LE(l,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|l&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?gb.decode=gb.decodeWithTextDecoder:gb.decode=gb.decodeWithFromCharCode;var hl=gb;function qIe(e,t){return t=g(t,0),hl(e,t,Math.min(4,e.length))}var ym=qIe;function gm(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,d(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(gm.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var RE=Uint32Array.BYTES_PER_ELEMENT;gm.fromTileType=async function(e,t,n,i,o,r){o=g(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=RE;let c=a.getUint32(o,!0);if(c!==1)throw new me(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=RE,o+=RE;let l=a.getUint32(o,!0);o+=RE;let u=n.queryParameters.compositeIndex;d(u)?u=`${u}_`:u="";let m=[];m.length=l;for(let f=0;f<l;++f){let x=ym(s,o),_=a.getUint32(o+RE*2,!0),C=r[x],V=`${u}${f}`,L=n.getDerivedResource({queryParameters:{compositeIndex:V}});if(d(C))m[f]=Promise.resolve(C(e,t,L,i,o));else throw new me(`Unknown tile content type, ${x}, inside Composite tile`);o+=_}let p=await Promise.all(m);return new gm(e,t,n,p)};gm.prototype.hasProperty=function(e,t){return!1};gm.prototype.getFeature=function(e){};gm.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};gm.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};gm.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var ZE=gm;var Jqt=T(S(),1);var _7t=T(S(),1);function $Ie(e,t,n){return JSON.parse(hl(e,t,n))}var Go=$Ie;var R6t=T(S(),1);var P7t=T(S(),1);function Ya(e){this._id=Yn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,kt.maximumTextureSize),r=Math.ceil(t/kt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,l=c*.5;n=new D(o,r),i=new se(s,a,c,l)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Ya.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return d(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),d(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Ya.DEFAULT_COLOR_VALUE=B.WHITE;Ya.DEFAULT_SHOW_VALUE=!0;function gte(e){let t=e._textureDimensions;return t.x*t.y*4}function xte(e){if(!d(e._batchValues)){let t=gte(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function _te(e){if(!d(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Ya.prototype.setShow=function(e,t){if(t&&!d(this._showAlphaProperties))return;let n=_te(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=xte(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Ya.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Ya.prototype.getShow=function(e){if(!d(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var eWe=new Array(4);Ya.prototype.setColor=function(e,t){if(B.equals(t,Ya.DEFAULT_COLOR_VALUE)&&!d(this._batchValues))return;let n=t.toBytes(eWe),i=n[3],o=xte(this),r=e*4,s=_te(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,l=s[a]!==0;o[r+3]=l?i:0,s[a+1]=i;let u=i!==255;u&&!c?++this._translucentFeaturesLength:!u&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,d(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Ya.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Ya.prototype.getColor=function(e,t){if(!d(this._batchValues))return B.clone(Ya.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return B.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Ya.prototype.getPickColor=function(e){return this._pickIds[e]};function Tte(e,t,n){let i=e._textureDimensions;return new Wt({context:t,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:dn.NEAREST})}function tWe(e,t){let n=e._featuresLength;if(!d(e._pickTexture)&&n>0){let i=e._pickIds,o=gte(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let l=t.createPickId(s.getFeature(c));i.push(l);let u=l.color,m=c*4;r[m]=B.floatToByte(u.red),r[m+1]=B.floatToByte(u.green),r[m+2]=B.floatToByte(u.blue),r[m+3]=B.floatToByte(u.alpha)}e._pickTexture=Tte(e,t,r),d(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function nWe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ya.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&tWe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,d(this._batchTexture)||(this._batchTexture=Tte(this,n,this._batchValues),d(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),nWe(this))};Ya.prototype.isDestroyed=function(){return!1};Ya.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Wc=Ya;var q7t=T(S(),1);var D7t=T(S(),1);var iWe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},oWe={SCALAR:void 0,VEC2:D,VEC3:h,VEC4:se,MAT2:$i,MAT3:$,MAT4:F};function rWe(e){let t=e.componentType,n;typeof t=="string"?n=Q.fromName(t):n=t;let i=iWe[e.type],o=oWe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return Q.createArrayBufferView(n,r,s,i*a)}}}var ed=rWe;function yp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,sWe(this,e.extension,e.binaryBody)}Object.defineProperties(yp.prototype,{byteLength:{get:function(){return this._byteLength}}});function sWe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,l=t.parentCounts,u=t.parentIds,m=s,p=0;d(c.byteOffset)&&(c.componentType=g(c.componentType,Q.UNSIGNED_SHORT),c.type=an.SCALAR,r=ed(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let y;if(d(l)){for(d(l.byteOffset)&&(l.componentType=g(l.componentType,Q.UNSIGNED_SHORT),l.type=an.SCALAR,r=ed(l),l=r.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,s),p+=l.byteLength),y=new Uint16Array(s),m=0,i=0;i<s;++i)y[i]=m,m+=l[i];p+=y.byteLength}d(u)&&d(u.byteOffset)&&(u.componentType=g(u.componentType,Q.UNSIGNED_SHORT),u.type=an.SCALAR,r=ed(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,m),p+=u.byteLength);let f=a.length;for(i=0;i<f;++i){let C=a[i].length,V=a[i].instances,L=aWe(C,V,n);p+=cWe(L),a[i].instances=xt(L,V)}let x=new Array(f).fill(0),_=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],_[i]=x[o],++x[o];p+=_.byteLength,e._classes=a,e._classIds=c,e._classIndexes=_,e._parentCounts=l,e._parentIndexes=y,e._parentIds=u,e._byteLength=p}function aWe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(d(s)){let a=r.componentType,c=r.type;if(!d(a))throw new me("componentType is required.");if(!d(c))throw new me("type is required.");if(!d(n))throw new me(`Property ${o} requires a batch table binary.`);let l=ed(r),u=l.componentsPerAttribute,m=l.classType,p=l.createArrayBufferView(n.buffer,n.byteOffset+s,e);d(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:m}}}return i}function cWe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var lWe=[],dWe=[],uWe=0;function mWe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=lWe;c.length=Math.max(c.length,a);let l=++uWe,u=dWe;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===l)continue;c[t]=l;let m=n(e,t);if(d(m))return m;let p=o[t],y=s[t];for(let f=0;f<p;++f){let x=r[y+f];x!==t&&u.push(x)}}}function hWe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(d(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function GE(e,t,n){let i=e._parentCounts,o=e._parentIds;if(d(o)){if(d(i))return mWe(e,t,n)}else return n(e,t);return hWe(e,t,n)}yp.prototype.hasProperty=function(e,t){let n=GE(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(d(s[t]))return!0});return d(n)};yp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(d(o[e]))return!0}return!1};yp.prototype.getPropertyIds=function(e,t){return t=d(t)?t:[],t.length=0,GE(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};yp.prototype.getProperty=function(e,t){return GE(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(d(a))return d(a.typedArray)?fWe(a,s):Oe(a[s],!0)})};function fWe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}yp.prototype.setProperty=function(e,t,n){let i=GE(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],l=a.instances[t];if(d(l))return d(l.typedArray)?pWe(l,c,n):l[c]=Oe(n,!0),!0});return d(i)};function pWe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}yp.prototype.isClass=function(e,t){let n=GE(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return d(n)};yp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var bx=yp;var e6t=T(S(),1),bWe={HIGHLIGHT:0,REPLACE:1,MIX:2},fl=Object.freeze(bWe);var uY=Wc.DEFAULT_COLOR_VALUE,mY=Wc.DEFAULT_SHOW_VALUE;function lo(e,t,n,i,o){this.featuresLength=t;let r;d(n)&&(r=n.extensions),this._extensions=g(r,{});let s=yWe(n);this._properties=s,this._batchTableHierarchy=gWe(this,n,i);let a=Cte(t,s,i);this._binaryPropertiesByteLength=xWe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Wc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}lo._deprecationWarning=zr;Object.defineProperties(lo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return d(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function yWe(e){let t={};if(!d(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Oe(e[n],!0));return t}function gWe(e,t,n){if(!d(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(d(o)&&(lo._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!d(i))return new bx({extension:i,binaryBody:n})}function Cte(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(d(s)){let a=r.componentType,c=r.type;if(!d(a))throw new me("componentType is required.");if(!d(c))throw new me("type is required.");if(!d(n))throw new me(`Property ${o} requires a batch table binary.`);let l=ed(r),u=l.componentsPerAttribute,m=l.classType,p=l.createArrayBufferView(n.buffer,n.byteOffset+s,e);d(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:m}}}return i}function xWe(e){if(!d(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}lo.getBinaryProperties=function(e,t,n){return Cte(e,t,n)};lo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};lo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};lo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};lo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};lo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};lo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};lo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var _We=new B;lo.prototype.applyStyle=function(e){if(!d(e)){this.setAllColor(uY),this.setAllShow(mY);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=d(e.color)?g(e.color.evaluateColor(o,_We),uY):uY,s=d(e.show)?g(e.show.evaluate(o),mY):mY;this.setColor(i,r),this.setShow(i,s)}};function TWe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function SWe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}lo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return d(n)?n.isClass(e,t):!1};lo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};lo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(d(t))return t.getClassName(e)};lo.prototype.hasProperty=function(e,t){return d(this._properties[t])||d(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};lo.prototype.hasPropertyBySemantic=function(){return!1};lo.prototype.getPropertyIds=function(e,t){t=d(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),d(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};lo.prototype.getPropertyBySemantic=function(e,t){};lo.prototype.getProperty=function(e,t){if(d(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(d(i))return TWe(i,e)}let n=this._properties[t];if(d(n))return Oe(n[e],!0);if(d(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(d(i))return i}};lo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(d(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(d(r)){SWe(r,e,n);return}}if(d(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];d(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Oe(n,!0)};function CWe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; 
vec2 computeSt(float batchId) 
{ 
    float stepX = tile_textureStep.x; 
    float centerX = tile_textureStep.y; 
    return vec2(centerX + (batchId * stepX), 0.5); 
} 
`:`uniform vec4 tile_textureStep; 
uniform vec2 tile_textureDimensions; 
vec2 computeSt(float batchId) 
{ 
    float stepX = tile_textureStep.x; 
    float centerX = tile_textureStep.y; 
    float stepY = tile_textureStep.z; 
    float centerY = tile_textureStep.w; 
    float xId = mod(batchId, tile_textureDimensions.x); 
    float yId = floor(batchId / tile_textureDimensions.x); 
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); 
} 
`}lo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Vte(o,n,!1),s;return kt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; 
`),s+=`uniform sampler2D tile_batchTexture; 
out vec4 tile_featureColor; 
out vec2 tile_featureSt; 
void main() 
{ 
    vec2 st = computeSt(${t}); 
    vec4 featureProperties = texture(tile_batchTexture, st); 
    tile_color(featureProperties); 
    float show = ceil(featureProperties.a); 
    gl_Position *= show; 
`,e&&(s+=`    bool isStyleTranslucent = (featureProperties.a != 1.0); 
    if (czm_pass == czm_passTranslucent) 
    { 
        if (!isStyleTranslucent && !tile_translucentCommand) 
        { 
            gl_Position *= 0.0; 
        } 
    } 
    else 
    { 
        if (isStyleTranslucent) 
        { 
            gl_Position *= 0.0; 
        } 
    } 
`),s+=`    tile_featureColor = featureProperties; 
    tile_featureSt = st; 
}`):s=`out vec2 tile_featureSt; 
void main() 
{ 
    tile_color(vec4(1.0)); 
    tile_featureSt = computeSt(${t}); 
}`,`${r}
${CWe(i)}${s}`}};function Ste(e,t){return e=Be.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; 
void tile_color(vec4 tile_featureColor) 
{ 
    tile_main(); 
    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
} 
`:`${e}void tile_color(vec4 tile_featureColor) 
{ 
    tile_main(); 
} 
`}function VWe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let l=o;l<e.length;++l){let u=e.charAt(l);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=l+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Vte(e,t,n){if(!d(t))return Ste(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!d(o))return Ste(e,n);let r=o[0],s=o[2];e=Be.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) 
{ 
    return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); 
} 
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) 
{ 
    vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); 
    vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; 
    return vec4(diffuse.rgb, sourceDiffuse.a); 
} 
`,c=`    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
`,l;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,m=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,m),l=`    vec4 source = ${u}; 
    tile_diffuse = tile_diffuse_final(source, tile_featureColor); 
    tile_main(); 
`}else s==="sampler2D"&&(e=VWe(e,t),l=`    tile_diffuse = tile_featureColor; 
    tile_main(); 
`);return e=`uniform float tile_colorBlend; 
vec4 tile_diffuse = vec4(1.0); 
${a}${r}
${e}
void tile_color(vec4 tile_featureColor) 
{ 
${l}`,n&&(e+=c),e+=`} 
`,e}lo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Vte(i,t,!0),kt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; 
in vec2 tile_featureSt; 
in vec4 tile_featureColor; 
void main() 
{ 
    tile_color(tile_featureColor); 
`,n&&(i+=`    out_FragColor.rgb *= out_FragColor.a; 
`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; 
`),i+=`uniform sampler2D tile_pickTexture; 
uniform sampler2D tile_batchTexture; 
in vec2 tile_featureSt; 
void main() 
{ 
    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); 
    if (featureProperties.a == 0.0) { 
        discard; 
    } 
`,e&&(i+=`    bool isStyleTranslucent = (featureProperties.a != 1.0); 
    if (czm_pass == czm_passTranslucent) 
    { 
        if (!isStyleTranslucent && !tile_translucentCommand) 
        { 
            discard; 
        } 
    } 
    else 
    { 
        if (isStyleTranslucent) 
        { 
            discard; 
        } 
    } 
`),i+=`    tile_color(featureProperties); 
`,n&&(i+=`    out_FragColor.rgb *= out_FragColor.a; 
`),i+=`} 
`),i}};lo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Be.replaceMain(e,"tile_main"),kt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt; 
in vec4 tile_featureColor; 
void main() 
{ 
    tile_main(); 
    out_FragColor = tile_featureColor; 
    out_FragColor.rgb *= out_FragColor.a; 
}`:e+=`uniform sampler2D tile_batchTexture; 
uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt; 
void main() 
{ 
    tile_main(); 
    vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); 
    if (featureProperties.a == 0.0) { 
        discard; 
    } 
    out_FragColor = featureProperties; 
    out_FragColor.rgb *= out_FragColor.a; 
} 
`,e}};function LWe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===fl.HIGHLIGHT)return 0;if(n===fl.REPLACE)return 1;if(n===fl.MIX)return W.clamp(i,W.EPSILON4,1)}lo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(t,{tile_batchTexture:function(){return g(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return LWe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};lo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var xb={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};lo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=RWe(this);for(let l=t;l<i;++l){let u=n[l];if(u.pass===Re.COMPUTE)continue;let m=u.derivedCommands.tileset;(!d(m)||u.dirty)&&(m={},u.derivedCommands.tileset=m,m.originalCommand=ZWe(u),u.dirty=!1);let p=m.originalCommand;c!==xb.ALL_OPAQUE&&u.pass!==Re.TRANSLUCENT&&(d(m.translucent)||(m.translucent=GWe(p))),c!==xb.ALL_TRANSLUCENT&&u.pass!==Re.TRANSLUCENT&&(d(m.opaque)||(m.opaque=EWe(p)),a&&(r||(d(m.zback)||(m.zback=IWe(e.context,p)),s._backfaceCommands.push(m.zback)),(!d(m.stencil)||o._selectionDepth!==PWe(m.stencil))&&(u.renderState.depthMask?m.stencil=WWe(p,o._selectionDepth):m.stencil=m.opaque)));let y=a?m.stencil:m.opaque,f=m.translucent;u.pass!==Re.TRANSLUCENT?(c===xb.ALL_OPAQUE&&(n[l]=y),c===xb.ALL_TRANSLUCENT&&(n[l]=f),c===xb.OPAQUE_AND_TRANSLUCENT&&(n[l]=y,n.push(f))):n[l]=p}};function RWe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?xb.ALL_OPAQUE:t===e.featuresLength?xb.ALL_TRANSLUCENT:xb.OPAQUE_AND_TRANSLUCENT}function ZWe(e){let t=nt.shallowClone(e),n=t.pass===Re.TRANSLUCENT;return t.uniformMap=d(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function GWe(e){let t=nt.shallowClone(e);return t.pass=Re.TRANSLUCENT,t.renderState=vWe(e.renderState),t}function EWe(e){let t=nt.shallowClone(e);return t.renderState=wWe(e.renderState),t}function XWe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!d(n)){let i=t.fragmentShaderSource.clone();i.defines=d(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function IWe(e,t){let n=nt.shallowClone(t),i=Oe(n.renderState,!0);i.cull.enabled=!0,i.cull.face=yi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ft.setCesium3DTileBit(),i.stencilMask=Ft.CESIUM_3D_TILE_MASK,n.renderState=De.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Oe(t.uniformMap);let o=new D(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=XWe(e,t.shaderProgram),n}function WWe(e,t){let n=nt.shallowClone(e),i=Oe(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ft.SKIP_LOD_MASK,i.stencilTest.reference=Ft.CESIUM_3D_TILE_MASK|t<<Ft.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Dn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ht.REPLACE,i.stencilTest.backFunction=Dn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ht.REPLACE,i.stencilMask=Ft.CESIUM_3D_TILE_MASK|Ft.SKIP_LOD_MASK,n.renderState=De.fromCache(i),n}function PWe(e){return(e.renderState.stencilTest.reference&Ft.SKIP_LOD_MASK)>>>Ft.SKIP_LOD_BIT_SHIFT}function vWe(e){let t=Oe(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,De.fromCache(t)}function wWe(e){let t=Oe(e,!0);return t.stencilTest=Ft.setCesium3DTileBit(),t.stencilMask=Ft.CESIUM_3D_TILE_MASK,De.fromCache(t)}lo.prototype.update=function(e,t){this._batchTexture.update(e,t)};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var gp=lo;var Mqt=T(S(),1);var G6t=T(S(),1);function FWe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Dh=FWe;var Lqt=T(S(),1);var X6t=T(S(),1),ES=`in vec3 position;
in float a_batchId;

uniform mat4 u_modifiedModelViewProjection;

void main()
{
    gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var v6t=T(S(),1);function tu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(tu.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return d(this._color)||(this._color=new B),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(d(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});tu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};tu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};tu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};tu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(d(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(d(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(d(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(d(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),d(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=d(e.group)?e.group.metadata:void 0;if(d(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let l=e.tileset.metadata;if(d(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}};tu.prototype.getPropertyInherited=function(e){return tu.getPropertyInherited(this._content,this._batchId,e)};tu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};tu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};tu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};tu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ss=tu;var J6t=T(S(),1);var F6t=T(S(),1),hY=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},fY=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},pl=class e{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,l;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},l=n;let u=m=>r.right_a&&m.right_a?i>m.prec:i<=m.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+l),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+="	";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},AWe=new hY;Object.assign(pl,{hooks:AWe,plugins:new fY(pl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});pl.max_unop_len=pl.getMaxKeyLen(pl.unary_ops);pl.max_binop_len=pl.getMaxKeyLen(pl.binary_ops);var _b=e=>new pl(e).parse(),MWe=Object.getOwnPropertyNames(pl);MWe.forEach(e=>{_b[e]===void 0&&e!=="prototype"&&(_b[e]=pl[e])});_b.Jsep=pl;var NWe="ConditionalExpression",UWe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:NWe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};_b.plugins.register(UWe);var M6t=T(S(),1),kWe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},ft=Object.freeze(kWe);function xm(e,t){this._expression=e,e=e2e(e,t),e=n2e(t2e(e)),_b.addBinaryOp("=~",0),_b.addBinaryOp("!~",0);let n;try{n=_b(e)}catch(i){throw new me(i)}this._runtimeAst=Ci(this,n)}Object.defineProperties(xm.prototype,{expression:{get:function(){return this._expression}}});var Pn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new D),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};xm.prototype.evaluate=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof B&&n instanceof se?B.fromCartesian4(n,t):n instanceof D||n instanceof h||n instanceof se?n.clone(t):n};xm.prototype.evaluateColor=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return B.fromCartesian4(n,t)};xm.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
    return ${o};
}
`,o};xm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};xm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var DWe=["!","-","+"],Lte=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],TM=/\${(.*?)}/g,BWe=/\\/g,YWe="@#%",OWe=/@#%/g,SM=new B,CM={abs:Cs(Math.abs),sqrt:Cs(Math.sqrt),cos:Cs(Math.cos),sin:Cs(Math.sin),tan:Cs(Math.tan),acos:Cs(Math.acos),asin:Cs(Math.asin),atan:Cs(Math.atan),radians:Cs(W.toRadians),degrees:Cs(W.toDegrees),sign:Cs(W.sign),floor:Cs(Math.floor),ceil:Cs(Math.ceil),round:Cs(Math.round),exp:Cs(Math.exp),exp2:Cs(HWe),log:Cs(Math.log),log2:Cs(zWe),fract:Cs(KWe),length:JWe,normalize:QWe},VM={atan2:xM(Math.atan2,!1),pow:xM(Math.pow,!1),min:xM(Math.min,!0),max:xM(Math.max,!0),distance:jWe,dot:qWe,cross:$We},yY={clamp:Rte(W.clamp,!0),mix:Rte(W.lerp,!0)};function KWe(e){return e-Math.floor(e)}function HWe(e){return Math.pow(2,e)}function zWe(e){return W.log2(e)}function Cs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),Pn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Pn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Pn.getCartesian4());throw new me(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function xM(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),Pn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Pn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),Pn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Pn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Pn.getCartesian4());throw new me(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Rte(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Pn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Pn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof D&&o instanceof D&&r instanceof D)return D.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Pn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Pn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Pn.getCartesian4());throw new me(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function JWe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new me(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function QWe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,Pn.getCartesian2());if(t instanceof h)return h.normalize(t,Pn.getCartesian3());if(t instanceof se)return se.normalize(t,Pn.getCartesian4());throw new me(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function jWe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new me(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function qWe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new me(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function $We(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Pn.getCartesian3());throw new me(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function gt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,m2e(this)}function e2e(e,t){if(!d(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;d(o)&&(e=e.replace(i,o))}return e}function t2e(e){return e.replace(BWe,YWe)}function bY(e){return e.replace(OWe,"\\")}function n2e(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new me("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function i2e(e){let t=typeof e.value;if(e.value===null)return new gt(ft.LITERAL_NULL,null);if(t==="boolean")return new gt(ft.LITERAL_BOOLEAN,e.value);if(t==="number")return new gt(ft.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new gt(ft.VARIABLE_IN_STRING,e.value):new gt(ft.LITERAL_STRING,bY(e.value))}function o2e(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!d(c.callee)||c.callee.name!=="regExp")throw new me(`${o} is not a function.`);return i===0?o==="test"?new gt(ft.LITERAL_BOOLEAN,!1):new gt(ft.LITERAL_NULL,null):(s=Ci(e,c),a=Ci(e,n[0]),new gt(ft.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ci(e,c),new gt(ft.FUNCTION_CALL,o,r);throw new me(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new gt(ft.LITERAL_COLOR,o);if(r=Ci(e,n[0]),d(n[1])){let c=Ci(e,n[1]);return new gt(ft.LITERAL_COLOR,o,[r,c])}return new gt(ft.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new me(`${o} requires three arguments.`);return r=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2])],new gt(ft.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new me(`${o} requires four arguments.`);return r=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2]),Ci(e,n[3])],new gt(ft.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Ci(e,n[c]);return new gt(ft.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new gt(ft.LITERAL_BOOLEAN,!0):new gt(ft.LITERAL_BOOLEAN,!1):(r=Ci(e,n[0]),new gt(ft.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new me(`${o} requires exactly one argument.`);return r=Ci(e,n[0]),new gt(ft.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new me(`${o} does not take any argument.`);return new gt(ft.UNARY,o)}else if(d(CM[o])){if(i!==1)throw new me(`${o} requires exactly one argument.`);return r=Ci(e,n[0]),new gt(ft.UNARY,o,r)}else if(d(VM[o])){if(i!==2)throw new me(`${o} requires exactly two arguments.`);return s=Ci(e,n[0]),a=Ci(e,n[1]),new gt(ft.BINARY,o,s,a)}else if(d(yY[o])){if(i!==3)throw new me(`${o} requires exactly three arguments.`);s=Ci(e,n[0]),a=Ci(e,n[1]);let c=Ci(e,n[2]);return new gt(ft.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new gt(ft.LITERAL_BOOLEAN,!1):(r=Ci(e,n[0]),new gt(ft.UNARY,o,r));if(o==="Number")return i===0?new gt(ft.LITERAL_NUMBER,0):(r=Ci(e,n[0]),new gt(ft.UNARY,o,r));if(o==="String")return i===0?new gt(ft.LITERAL_STRING,""):(r=Ci(e,n[0]),new gt(ft.UNARY,o,r));if(o==="regExp")return r2e(e,t)}}throw new me(`Unexpected function call "${o}".`)}function r2e(e,t){let n=t.arguments;if(n.length===0)return new gt(ft.LITERAL_REGEX,new RegExp);let i=Ci(e,n[0]),o;if(n.length>1){let r=Ci(e,n[1]);if(pY(i)&&pY(r)){try{o=new RegExp(bY(String(i._value)),r._value)}catch(s){throw new me(s)}return new gt(ft.LITERAL_REGEX,o)}return new gt(ft.REGEX,i,r)}if(pY(i)){try{o=new RegExp(bY(String(i._value)))}catch(r){throw new me(r)}return new gt(ft.LITERAL_REGEX,o)}return new gt(ft.REGEX,i)}function s2e(e){if(d2e(e.name)){let t=u2e(e.name);return t.substr(0,8)==="tiles3d_"?new gt(ft.BUILTIN_VARIABLE,t):new gt(ft.VARIABLE,t)}else{if(e.name==="NaN")return new gt(ft.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new gt(ft.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new gt(ft.LITERAL_UNDEFINED,void 0)}throw new me(`${e.name} is not defined.`)}function a2e(e){let t=e.property.name;if(t==="PI")return new gt(ft.LITERAL_NUMBER,Math.PI);if(t==="E")return new gt(ft.LITERAL_NUMBER,Math.E)}function c2e(e){if(e.property.name==="POSITIVE_INFINITY")return new gt(ft.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function l2e(e,t){if(t.object.name==="Math")return a2e(t);if(t.object.name==="Number")return c2e(t);let n,i=Ci(e,t.object);return t.computed?(n=Ci(e,t.property),new gt(ft.MEMBER,"brackets",i,n)):(n=new gt(ft.LITERAL_STRING,t.property.name),new gt(ft.MEMBER,"dot",i,n))}function pY(e){return e._type>=ft.LITERAL_NULL}function d2e(e){return e.substr(0,4)==="czm_"}function u2e(e){return e.substr(4)}function Ci(e,t){let n,i,o,r;if(t.type==="Literal")n=i2e(t);else if(t.type==="CallExpression")n=o2e(e,t);else if(t.type==="Identifier")n=s2e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ci(e,t.argument);if(DWe.indexOf(i)>-1)n=new gt(ft.UNARY,i,s);else throw new me(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ci(e,t.left),r=Ci(e,t.right),Lte.indexOf(i)>-1)n=new gt(ft.BINARY,i,o,r);else throw new me(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ci(e,t.left),r=Ci(e,t.right),Lte.indexOf(i)>-1&&(n=new gt(ft.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ci(e,t.test);o=Ci(e,t.consequent),r=Ci(e,t.alternate),n=new gt(ft.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=l2e(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ci(e,t.elements[a]);n=new gt(ft.ARRAY,s)}else throw t.type==="Compound"?new me("Provide exactly one expression."):new me("Cannot parse expression.");return n}function m2e(e){e._type===ft.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===ft.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===ft.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:d(CM[e._value])&&(e.evaluate=f2e(e._value)):e._type===ft.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:d(VM[e._value])&&(e.evaluate=p2e(e._value)):e._type===ft.TERNARY?e.evaluate=b2e(e._value):e._type===ft.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ft.ARRAY?e.evaluate=e._evaluateArray:e._type===ft.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ft.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ft.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ft.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ft.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ft.REGEX?e.evaluate=e._evaluateRegExp:e._type===ft.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=h2e):e.evaluate=e._evaluateLiteral}function h2e(e){return d(e)?e.content.tileset.timeSinceLoad:0}function f2e(e){let t=CM[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function p2e(e){let t=VM[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function b2e(e){let t=yY[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function LM(e,t){if(d(e))return e.getPropertyInherited(t)}gt.prototype._evaluateLiteral=function(){return this._value};gt.prototype._evaluateLiteralColor=function(e){let t=SM,n=this._left;if(this._value==="color")d(n)?n.length>1?(B.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):B.fromCssColorString(n[0].evaluate(e),t):B.fromBytes(255,255,255,255,t);else if(this._value==="rgb")B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Pn.getCartesian4())};gt.prototype._evaluateLiteralVector=function(e){let t=Pn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof D)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new me(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new me(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new me(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new me(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,Pn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Pn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Pn.getCartesian4())};gt.prototype._evaluateLiteralString=function(){return this._value};gt.prototype._evaluateVariableString=function(e){let t=this._value,n=TM.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=LM(e,o);d(r)||(r=""),t=t.replace(i,r),n=TM.exec(t)}return t};gt.prototype._evaluateVariable=function(e){return LM(e,this._value)};function yx(e){return e._value==="feature"}gt.prototype._evaluateMemberDot=function(e){if(yx(this._left))return LM(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!d(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};gt.prototype._evaluateMemberBrackets=function(e){if(yx(this._left))return LM(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!d(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};gt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};gt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new me(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};gt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof D)return D.negate(t,Pn.getCartesian2());if(t instanceof h)return h.negate(t,Pn.getCartesian3());if(t instanceof se)return se.negate(t,Pn.getCartesian4());if(typeof t=="number")return-t;throw new me(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};gt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof D||t instanceof h||t instanceof se||typeof t=="number"))throw new me(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};gt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};gt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};gt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};gt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};gt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new me(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new me(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};gt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new me(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new me(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};gt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,Pn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Pn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Pn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new me(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,Pn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Pn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new me(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,Pn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,Pn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,Pn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Pn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Pn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Pn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Pn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Pn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new me(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,Pn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,Pn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Pn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Pn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Pn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new me(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,Pn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Pn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new me(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};gt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};gt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new me(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};gt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};gt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};gt.prototype._evaluateIsExactClass=function(e){return d(e)?e.isExactClass(this._left.evaluate(e)):!1};gt.prototype._evaluateIsClass=function(e){return d(e)?e.isClass(this._left.evaluate(e)):!1};gt.prototype._evaluateGetExactClassName=function(e){if(d(e))return e.getExactClassName()};gt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};gt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};gt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};gt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";d(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new me(o)}return i};gt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new me(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};gt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new me(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new me(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};gt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new me(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return d(i)?i[1]:null};gt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof h||t instanceof se)return String(t);throw new me(`Unexpected function call "${this._value}".`)};function Zte(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==ft.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return B.fromHsl(i,o,r,s,SM)}function Gte(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==ft.LITERAL_NUMBER)return;let i=SM;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function Tb(e){return e%1===0?e.toFixed(1):e.toString()}function y2e(e){let t=Tb(e.red),n=Tb(e.green),i=Tb(e.blue);return`vec3(${t}, ${n}, ${i})`}function _M(e){let t=Tb(e.red),n=Tb(e.green),i=Tb(e.blue),o=Tb(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function Ete(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function Xte(e,t){return d(t[e])?t[e]:xm.NULL_SENTINEL}xm.NULL_SENTINEL="czm_infinity";gt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;d(this._left)&&(Array.isArray(this._left)?o=Ete(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),d(this._right)&&(r=this._right.getShaderExpression(e,t,this)),d(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Ete(this._value,e,t,this));let l,u,m;switch(a){case ft.VARIABLE:return yx(this)?void 0:Xte(c,e);case ft.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(d(CM[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new me(`Error generating style shader: "${c}" is not supported.`);return c+o;case ft.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:d(VM[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case ft.TERNARY:if(d(yY[c]))return`${c}(${o}, ${r}, ${s})`;break;case ft.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case ft.MEMBER:return yx(this._left)?Xte(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case ft.FUNCTION_CALL:throw new me(`Error generating style shader: "${c}" is not supported.`);case ft.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new me("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case ft.REGEX:throw new me("Error generating style shader: Regular expressions are not supported.");case ft.VARIABLE_IN_STRING:throw new me("Error generating style shader: Converting a variable to a string is not supported.");case ft.LITERAL_NULL:return xm.NULL_SENTINEL;case ft.LITERAL_BOOLEAN:return c?"true":"false";case ft.LITERAL_NUMBER:return Tb(c);case ft.LITERAL_STRING:if(d(n)&&n._type===ft.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||yx(n._left)))return c;if(i=B.fromCssColorString(c,SM),d(i))return y2e(i);throw new me("Error generating style shader: String literals are not supported.");case ft.LITERAL_COLOR:if(l=o,c==="color"){if(d(l)){if(l.length>1){let p=l[0],y=l[1];return y!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${y})`}}else return"vec4(1.0)";return`vec4(${l[0]}, 1.0)`}else{if(c==="rgb")return i=Gte(this),d(i)?_M(i):`vec4(${l[0]} / 255.0, ${l[1]} / 255.0, ${l[2]} / 255.0, 1.0)`;if(c==="rgba")return l[3]!=="1.0"&&(t.translucent=!0),i=Gte(this),d(i)?_M(i):`vec4(${l[0]} / 255.0, ${l[1]} / 255.0, ${l[2]} / 255.0, ${l[3]})`;if(c==="hsl")return i=Zte(this),d(i)?_M(i):`vec4(czm_HSLToRGB(vec3(${l[0]}, ${l[1]}, ${l[2]})), 1.0)`;if(c==="hsla")return i=Zte(this),d(i)?(i.alpha!==1&&(t.translucent=!0),_M(i)):(l[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${l[0]}, ${l[1]}, ${l[2]})), ${l[3]})`)}break;case ft.LITERAL_VECTOR:u=o.length,m=`${c}(`;for(let p=0;p<u;++p)m+=o[p],p<u-1&&(m+=", ");return m+=")",m;case ft.LITERAL_REGEX:throw new me("Error generating style shader: Regular expressions are not supported.");case ft.LITERAL_UNDEFINED:return xm.NULL_SENTINEL;case ft.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};gt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(d(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(d(this._right)&&this._right.getVariables(e,this),d(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case ft.VARIABLE:yx(this)||e.push(s);break;case ft.VARIABLE_IN_STRING:for(a=TM.exec(s);a!==null;)e.push(a[1]),a=TM.exec(s);break;case ft.LITERAL_STRING:d(t)&&t._type===ft.MEMBER&&yx(t._left)&&e.push(s);break}};var nu=xm;function xp(e){e=g(e,g.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=g(e.center,h.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=g(e.classificationType,kn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(xp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var g2e={position:0,a_batchId:1};function x2e(e,t){if(d(e._va))return;let n=mt.createVertexBuffer({context:t,typedArray:e._positions,usage:Ne.STATIC_DRAW}),i=mt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ne.STATIC_DRAW}),o=mt.createIndexBuffer({context:t,typedArray:e._indices,usage:Ne.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:Q.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Q.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ni({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ni({context:t,attributes:r,indexBuffer:mt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Ne.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function _2e(e,t){if(d(e._sp))return;let n=e._batchTable,i=g(e._attributeLocations,g2e),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(d(r)){e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Be.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ES),c=n.getFragmentShaderCallback(!1,void 0,!0)(mb);o=n.getPickId();let l=new Be({sources:[a]}),u=new Be({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:i}),l=new Be({sources:[ES]}),u=new Be({defines:["VECTOR_TILE"],sources:[mb]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:i}),c=Be.replaceMain(c,"czm_non_pick_main"),c=`${c}
void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`;let m=new Be({sources:[a]}),p=new Be({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:i})}function Ite(e){let t=e?Dn.EQUAL:Dn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:t,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},depthMask:!1}}var T2e={stencilTest:{enabled:!0,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Dn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},S2e={stencilTest:{enabled:!0,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Dn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function C2e(e){d(e._rsStencilDepthPass)||(e._rsStencilDepthPass=De.fromCache(Ite(!1)),e._rsStencilDepthPass3DTiles=De.fromCache(Ite(!0)),e._rsColorPass=De.fromCache(T2e),e._rsPickPass=De.fromCache(S2e))}var gx=new F,Wte=new h;function V2e(e,t){if(d(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,gx),F.multiplyByPoint(gx,e._center,Wte),F.setTranslation(gx,Wte,gx),F.multiply(o,gx,gx),gx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function gY(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let l=0;l<c;++l){let u=r[l],m=s[u],p=i[m],y=o[m],f=new e.constructor(e.buffer,a*p,y);t.set(f,n),i[m]=n,n+=y}return n}function L2e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],l=gY(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=l;t.length>0;){let u=t.pop();if(B.equals(u.color,a.color))l=gY(n,s,l,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=l-a.offset;else{let m=l;l=gY(n,s,l,i,o,u.batchIds,r),u.offset=m,u.count=l-m,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function xY(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let l=0;l<c;++l){let u=r[l],m=s[u],p=i[m],y=o[m];t.copyFromBuffer(e,p*a,n*a,y*a),i[m]=n,n+=y}return n}function R2e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,l=xY(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=l;t.length>0;){let m=t.pop();if(B.equals(m.color,r.color))l=xY(a,c,l,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=l-r.offset;else{let p=l;l=xY(a,c,l,n,i,m.batchIds,o),m.offset=p,m.count=l-p,s.push(m),r=m}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function Z2e(e,t){return t.color.toRgba()-e.color.toRgba()}function G2e(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(d(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(Z2e),t.webgl2?R2e(e,n):L2e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function E2e(e,t){let n=G2e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(d(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,l=g(e._modelMatrix,F.IDENTITY),u=e._uniformMap,m=e._boundingVolume;for(let p=0;p<r;++p){let y=o[p].offset,f=o[p].count,x=i[p*2];d(x)||(x=i[p*2]=new nt({owner:e})),x.vertexArray=a,x.modelMatrix=l,x.offset=y,x.count=f,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=u,x.boundingVolume=m,x.cull=!1,x.pass=Re.TERRAIN_CLASSIFICATION;let _=nt.shallowClone(x,x.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=_;let C=i[p*2+1];d(C)||(C=i[p*2+1]=new nt({owner:e})),C.vertexArray=a,C.modelMatrix=l,C.offset=y,C.count=f,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=u,C.boundingVolume=m,C.cull=!1,C.pass=Re.TERRAIN_CLASSIFICATION;let V=nt.shallowClone(C,C.derivedCommands.tileset);V.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=V}e._commandsDirty=!0}function X2e(e,t){if(e.classificationType===kn.TERRAIN||!t.invertClassification||d(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let l=i[c]=nt.shallowClone(n[a],i[c]);l.shaderProgram=o,l.pass=Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function I2e(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=g(e._modelMatrix,F.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let l=e._indexOffsets[c],u=e._indexCounts[c],m=d(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];d(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=l,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=m,p.pass=Re.TERRAIN_CLASSIFICATION;let y=nt.shallowClone(p,p.derivedCommands.tileset);y.renderState=e._rsStencilDepthPass3DTiles,y.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=y;let f=n[c*2+1];d(f)||(f=n[c*2+1]=new nt({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=l,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=m,f.pass=Re.TERRAIN_CLASSIFICATION;let x=nt.shallowClone(f,f.derivedCommands.tileset);x.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=x}e._pickCommandsDirty=!1}xp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ss(e,r)}};xp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function W2e(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=B.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=B.clone(B.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var P2e=new B,v2e=B.WHITE,w2e=!0,F2e=/\$/;xp.prototype.applyStyle=function(e,t){if(!d(e)){W2e(this,t);return}let n=e.color,i=n instanceof nu&&!F2e.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=d(e.color)?e.color.evaluateColor(c,P2e):v2e,c.show=d(e.show)?e.show.evaluate(c):w2e}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=B.clone(B.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};xp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!d(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,l=c.length,u;for(u=0;u<l;++u){let x=c[u].offset,_=c[u].count;if(s>=x&&s<x+_)break}c.push(new Dh({color:B.clone(t),offset:s,count:a,batchIds:[e]}));let m=[],p=[],y=c[u].batchIds,f=y.length;for(let x=0;x<f;++x){let _=y[x];if(_===e)continue;let C=n[_];o[C]<s?m.push(_):p.push(_)}p.length!==0&&c.push(new Dh({color:B.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),m.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=m):c.splice(u,1),this._batchDirty=!0};function Pte(e,t,n,i){let o=e.classificationType,r=o!==kn.CESIUM_3D_TILE,s=o!==kn.TERRAIN,a=t.commandList,c=n.length,l,u;for(u=0;u<c;++u)r&&(l=n[u],l.pass=Re.TERRAIN_CLASSIFICATION,a.push(l)),s&&(l=n[u].derivedCommands.tileset,l.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,a.push(l));if(!(!t.invertClassification||!d(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function A2e(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Re.OPAQUE,n.push(r)}}function M2e(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;d(e._rsWireframe)||(e._rsWireframe=De.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Fe.LINES):(n=e._rsColorPass,i=Fe.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}xp.prototype.update=function(e){let t=e.context;x2e(this,t),_2e(this,t),C2e(this),V2e(this,t);let n=e.passes;n.render&&(E2e(this,t),X2e(this,e),M2e(this),this._debugWireframe?A2e(e,this._commands):Pte(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(I2e(this),Pte(this,e,this._pickCommands))};xp.prototype.isDestroyed=function(){return!1};xp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var xx=xp;function td(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,d(this._center)||(d(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(td.prototype,{trianglesLength:{get:function(){return d(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return d(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});td.packedBoxLength=F.packedLength+h.packedLength;td.packedCylinderLength=F.packedLength+2;td.packedEllipsoidLength=F.packedLength+h.packedLength;td.packedSphereLength=h.packedLength+1;function N2e(e){let t=new Float64Array(F.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,F.pack(e._modelMatrix,t,n),t}function U2e(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ce.unpack(t,n),n+=ce.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let l=B.unpack(t,n);n+=B.packedLength;let u=t[n++],m=t[n++],p=t[n++],y=new Array(p);for(let f=0;f<p;++f)y[f]=t[n++];a[c]=new Dh({color:l,offset:u,count:m,batchIds:y})}return i}var k2e=new pi("createVectorTileGeometries",5),D2e=new B;function B2e(e){if(!d(e._primitive)&&!d(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,l=e._batchTableColors,u=e._packedBuffer;if(!d(l)){let f=0;d(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),d(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),d(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),d(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),l=e._batchTableColors=new Uint32Array(f);let x=e._batchTable;for(let _=0;_<f;++_){let C=x.getColor(_,D2e);l[_]=C.toRgba()}u=e._packedBuffer=N2e(e)}let m=[];d(t)&&m.push(t.buffer,n.buffer),d(i)&&m.push(i.buffer,o.buffer),d(r)&&m.push(r.buffer,s.buffer),d(a)&&m.push(a.buffer,c.buffer),m.push(l.buffer,u.buffer);let p={boxes:d(t)?t.buffer:void 0,boxBatchIds:d(t)?n.buffer:void 0,cylinders:d(i)?i.buffer:void 0,cylinderBatchIds:d(i)?o.buffer:void 0,ellipsoids:d(r)?r.buffer:void 0,ellipsoidBatchIds:d(r)?s.buffer:void 0,spheres:d(a)?a.buffer:void 0,sphereBatchIds:d(a)?c.buffer:void 0,batchTableColors:l.buffer,packedBuffer:u.buffer},y=e._verticesPromise=k2e.scheduleTask(p,m);return d(y)?y.then(function(f){if(e.isDestroyed())return;let x=new Float64Array(f.packedBuffer);U2e(e,x)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),Y2e(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function Y2e(e){d(e._primitive)||(e._primitive=new xx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:g(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}td.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};td.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};td.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};td.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};td.prototype.update=function(e){if(!this._ready){if(d(this._promise)||(this._promise=B2e(this)),d(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var _p=td;function Tp(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,H2e(this,i,o)}Object.defineProperties(Tp.prototype,{featuresLength:{get:function(){return d(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return d(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return d(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return d(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function O2e(e){return function(t,n){d(e._geometries)&&e._geometries.updateCommands(t,n)}}function K2e(e,t){let n,i,o,r,s,a=g(e.BOXES_LENGTH,0),c=g(e.CYLINDERS_LENGTH,0),l=g(e.ELLIPSOIDS_LENGTH,0),u=g(e.SPHERES_LENGTH,0);if(a>0&&d(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&d(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(l>0&&d(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,l)}if(u>0&&d(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let m=d(n)||d(i)||d(o)||d(r),p=a>0&&!d(n)||c>0&&!d(i)||l>0&&!d(o)||u>0&&!d(r);if(m&&p)throw new me("If one group of batch ids is defined, then all batch ids must be defined");if(!d(n)&&!d(i)&&!d(o)&&!d(r)){let f=0;if(!d(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!d(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!d(o)&&l>0)for(o=new Uint16Array(l),s=0;s<l;++s)o[s]=f++;if(!d(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var _x=Uint32Array.BYTES_PER_ELEMENT;function H2e(e,t,n){n=g(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=_x;let r=o.getUint32(n,!0);if(r!==1)throw new me(`Only Geometry tile version 1 is supported.  Version ${r} is not.`);n+=_x;let s=o.getUint32(n,!0);if(n+=_x,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=_x,a===0)throw new me("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=_x;let l=o.getUint32(n,!0);n+=_x;let u=o.getUint32(n,!0);n+=_x;let m=Go(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let y,f;l>0&&(y=Go(i,n,l),n+=l,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=g(m.BOXES_LENGTH,0),_=g(m.CYLINDERS_LENGTH,0),C=g(m.ELLIPSOIDS_LENGTH,0),V=g(m.SPHERES_LENGTH,0),L=x+_+C+V,Z=new gp(e,L,y,f,O2e(e));if(e._batchTable=Z,L===0)return;let G=e.tile.computedTransform,X;d(m.RTC_CENTER)&&(X=h.unpack(m.RTC_CENTER),F.multiplyByPoint(G,X,X));let P=K2e(m,p);if(x>0||_>0||C>0||V>0){let v,A,M,b;if(x>0){let R=p.byteOffset+m.BOXES.byteOffset;v=new Float32Array(p.buffer,R,_p.packedBoxLength*x)}if(_>0){let R=p.byteOffset+m.CYLINDERS.byteOffset;A=new Float32Array(p.buffer,R,_p.packedCylinderLength*_)}if(C>0){let R=p.byteOffset+m.ELLIPSOIDS.byteOffset;M=new Float32Array(p.buffer,R,_p.packedEllipsoidLength*C)}if(V>0){let R=p.byteOffset+m.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,_p.packedSphereLength*V)}return e._geometries=new _p({boxes:v,boxBatchIds:P.boxes,cylinders:A,cylinderBatchIds:P.cylinders,ellipsoids:M,ellipsoidBatchIds:P.ellipsoids,spheres:b,sphereBatchIds:P.spheres,center:X,modelMatrix:G,batchTable:Z,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function vte(e){let t=e.featuresLength;if(!d(e._features)&&t>0){let n=new Array(t);d(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Tp.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Tp.prototype.getFeature=function(e){return vte(this),this._features[e]};Tp.prototype.applyDebugSettings=function(e,t){d(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Tp.prototype.applyStyle=function(e){vte(this),d(this._geometries)&&this._geometries.applyStyle(e,this._features)};Tp.prototype.update=function(e,t){d(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),d(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};Tp.prototype.isDestroyed=function(){return!1};Tp.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var EE=Tp;var Ean=T(S(),1);var jqt=T(S(),1);var _Y={};_Y.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),wte(i,o,r,s);return c};_Y.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),wte(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function wte(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var XS=_Y;var r$t=T(S(),1);var Tx=30,z2e=1<<Tx,J2e=1<<Tx+1>>>0,TY=2*Tx+1,Sb=4,Mte=[],Nte=[],Q2e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Cb=1,IS=2,RM=[Cb,0,0,Cb|IS];function Ar(e){if(!Mt.supportsBigInt())throw new me("S2 required BigInt support");this._cellId=e,this._level=Ar.getLevel(e)}Ar.fromToken=function(e){return new Ar(Ar.getIdFromToken(e))};Ar.isValidId=function(e){return!(e<=0||e>>BigInt(TY)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ar.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ar.isValidId(Ar.getIdFromToken(e)):!1};Ar.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ar.getTokenFromId=function(e){let t=Math.floor(sPe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ar.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Tx-(t>>1)};Ar.prototype.getChild=function(e){let t=Dte(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ar(n)};Ar.prototype.getParent=function(){let e=Dte(this._cellId)<<BigInt(2);return new Ar(this._cellId&~e+BigInt(1)|e)};Ar.prototype.getParentAtLevel=function(e){let t=oPe(e);return new Ar(this._cellId&-t|t)};Ar.prototype.getCenter=function(e){e=g(e,re.WGS84);let t=j2e(this._cellId,this._level);t=h.normalize(t,t);let n=new he.fromCartesian(t,re.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Ar.prototype.getVertex=function(e,t){t=g(t,re.WGS84);let n=q2e(this._cellId,this._level,e);n=h.normalize(n,n);let i=new he.fromCartesian(n,re.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Ar.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(TY-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new Ar(a)};function j2e(e,t){let n=$2e(e,t);return ePe(n[0],n[1],n[2])}function q2e(e,t,n){let i=Ute(e,t),o=tPe([i[1],i[2]],t),r=n>>1&1;return kte(i[0],o[0][r^n&1],o[1][r])}function $2e(e,t){let n=Ute(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,l=(o<<1)+c,u=(r<<1)+c;return[i,l,u]}function Ute(e){Mte.length===0&&iPe();let t=Number(e>>BigInt(TY)),n=t&Cb,i=(1<<Sb)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Tx-7*Sb:Sb))-1;n+=Number(e>>BigInt(s*2*Sb+1)&BigInt(c))<<2,n=Nte[n];let l=s*Sb;o+=n>>Sb+2<<l,r+=(n>>2&i)<<l,n&=Cb|IS}return[t,o,r]}function ePe(e,t,n){let i=Fte(t),o=Fte(n),r=ZM(i),s=ZM(o);return kte(e,r,s)}function kte(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function ZM(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Fte(e){return 1/J2e*e}function tPe(e,t){let n=[[],[]],i=nPe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=ZM(Ate(r)),n[o][1]=ZM(Ate(s))}return n}function nPe(e){return 1<<Tx-e>>>0}function Ate(e){return 1/z2e*e}function Vb(e,t,n,i,o,r){if(e===Sb){let s=(t<<Sb)+n;Mte[(s<<2)+i]=(o<<2)+r,Nte[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=Q2e[r];Vb(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^RM[0]),Vb(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^RM[1]),Vb(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^RM[2]),Vb(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^RM[3])}}function iPe(){Vb(0,0,0,0,0,0),Vb(0,0,0,Cb,0,Cb),Vb(0,0,0,IS,0,IS),Vb(0,0,0,Cb|IS,0,Cb|IS)}function Dte(e){return e&~e+BigInt(1)}function oPe(e){return BigInt(1)<<BigInt(2*(Tx-e))}var rPe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function sPe(e){return rPe[(-e&e)%BigInt(67)]}var Sp=Ar;var aan=T(S(),1);var c$t=T(S(),1);function aPe(e,t){return d(e)&&d(e.extensions)&&d(e.extensions[t])}var ri=aPe;var h$t=T(S(),1);function SY(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(d(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new me(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=g(e.computeAvailableCountEnabled,!1);!d(n)&&s&&(n=cPe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function cPe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(SY.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});SY.prototype.getBit=function(e){if(d(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var WS=SY;var b$t=T(S(),1);function Cp(e){e=g(e,g.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Cp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Cp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Cp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Cp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Cp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Cp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Cp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Cp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var PS=Cp;var g$t=T(S(),1);var GM={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};GM.getBranchingFactor=function(e){switch(e){case GM.OCTREE:return 8;case GM.QUADTREE:return 4}};var Mr=Object.freeze(GM);var G$t=T(S(),1);var C$t=T(S(),1);function Ys(){}Object.defineProperties(Ys.prototype,{class:{get:function(){fe.throwInstantiationError()}}});Ys.prototype.hasProperty=function(e){fe.throwInstantiationError()};Ys.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};Ys.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};Ys.prototype.getProperty=function(e){fe.throwInstantiationError()};Ys.prototype.setProperty=function(e,t){fe.throwInstantiationError()};Ys.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};Ys.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};Ys.hasProperty=function(e,t,n){if(d(t[e]))return!0;let i=n.properties;if(!d(i))return!1;let o=i[e];return!!(d(o)&&d(o.default))};Ys.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!d(i))return!1;let o=i[e];return d(o)};Ys.getPropertyIds=function(e,t,n){n=d(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&d(e[o])&&n.push(o);let i=t.properties;if(d(i))for(let o in i)i.hasOwnProperty(o)&&!d(e[o])&&d(i[o].default)&&n.push(o);return n};Ys.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!d(o)&&d(i.default))return o=Oe(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(d(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Ys.setProperty=function(e,t,n,i){if(!d(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;d(r)&&(o=r[e]);let s=!0;return d(o)&&(t=o.packVectorAndMatrixTypes(t,s),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};Ys.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!d(i))return;let o=i[e];if(d(o))return Ys.getProperty(o.id,t,n)};Ys.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!d(o))return!1;let r=i.propertiesBySemantic[e];return d(r)?Ys.setProperty(r.id,t,n,i):!1};var Mn=Ys;function Vp(e){e=g(e,g.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=d(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Vp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Vp.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Vp.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Vp.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Vp.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Vp.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Vp.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Vp.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var XE=Vp;var xen=T(S(),1);var men=T(S(),1);var P$t=T(S(),1);var Et={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Et.getMinimum=function(e){switch(e){case Et.INT8:return-128;case Et.UINT8:return 0;case Et.INT16:return-32768;case Et.UINT16:return 0;case Et.INT32:return-2147483648;case Et.UINT32:return 0;case Et.INT64:return Mt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Et.UINT64:return Mt.supportsBigInt()?BigInt(0):0;case Et.FLOAT32:return-34028234663852886e22;case Et.FLOAT64:return-Number.MAX_VALUE}};Et.getMaximum=function(e){switch(e){case Et.INT8:return 127;case Et.UINT8:return 255;case Et.INT16:return 32767;case Et.UINT16:return 65535;case Et.INT32:return 2147483647;case Et.UINT32:return 4294967295;case Et.INT64:return Mt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Et.UINT64:return Mt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Et.FLOAT32:return 34028234663852886e22;case Et.FLOAT64:return Number.MAX_VALUE}};Et.isIntegerType=function(e){switch(e){case Et.INT8:case Et.UINT8:case Et.INT16:case Et.UINT16:case Et.INT32:case Et.UINT32:case Et.INT64:case Et.UINT64:return!0;default:return!1}};Et.isUnsignedIntegerType=function(e){switch(e){case Et.UINT8:case Et.UINT16:case Et.UINT32:case Et.UINT64:return!0;default:return!1}};Et.isVectorCompatible=function(e){switch(e){case Et.INT8:case Et.UINT8:case Et.INT16:case Et.UINT16:case Et.INT32:case Et.UINT32:case Et.FLOAT32:case Et.FLOAT64:return!0;default:return!1}};Et.normalize=function(e,t){return Math.max(Number(e)/Number(Et.getMaximum(t)),-1)};Et.unnormalize=function(e,t){let n=Et.getMaximum(t),i=Et.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Et.INT64||t===Et.UINT64)&&Mt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Et.applyValueTransform=function(e,t,n){return n*e+t};Et.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Et.getSizeInBytes=function(e){switch(e){case Et.INT8:case Et.UINT8:return 1;case Et.INT16:case Et.UINT16:return 2;case Et.INT32:case Et.UINT32:return 4;case Et.INT64:case Et.UINT64:return 8;case Et.FLOAT32:return 4;case Et.FLOAT64:return 8}};Et.fromComponentDatatype=function(e){switch(e){case Q.BYTE:return Et.INT8;case Q.UNSIGNED_BYTE:return Et.UINT8;case Q.SHORT:return Et.INT16;case Q.UNSIGNED_SHORT:return Et.UINT16;case Q.INT:return Et.INT32;case Q.UNSIGNED_INT:return Et.UINT32;case Q.FLOAT:return Et.FLOAT32;case Q.DOUBLE:return Et.FLOAT64}};Et.toComponentDatatype=function(e){switch(e){case Et.INT8:return Q.BYTE;case Et.UINT8:return Q.UNSIGNED_BYTE;case Et.INT16:return Q.SHORT;case Et.UINT16:return Q.UNSIGNED_SHORT;case Et.INT32:return Q.INT;case Et.UINT32:return Q.UNSIGNED_INT;case Et.FLOAT32:return Q.FLOAT;case Et.FLOAT64:return Q.DOUBLE}};var tn=Object.freeze(Et);var een=T(S(),1);var k$t=T(S(),1);var Io={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Io.isVectorType=function(e){switch(e){case Io.VEC2:case Io.VEC3:case Io.VEC4:return!0;default:return!1}};Io.isMatrixType=function(e){switch(e){case Io.MAT2:case Io.MAT3:case Io.MAT4:return!0;default:return!1}};Io.getComponentCount=function(e){switch(e){case Io.SCALAR:case Io.STRING:case Io.ENUM:case Io.BOOLEAN:return 1;case Io.VEC2:return 2;case Io.VEC3:return 3;case Io.VEC4:return 4;case Io.MAT2:return 4;case Io.MAT3:return 9;case Io.MAT4:return 16}};Io.getMathType=function(e){switch(e){case Io.VEC2:return D;case Io.VEC3:return h;case Io.VEC4:return se;case Io.MAT2:return $i;case Io.MAT3:return $;case Io.MAT4:return F;default:return}};var Ot=Object.freeze(Io);function pa(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=d(i)&&tn.isIntegerType(i)&&g(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=d(o)?o.valueType:i,this._isArray=g(e.isArray,!1),this._isVariableLengthArray=g(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Oe(e.min,!0),this._max=Oe(e.max,!0),this._normalized=r;let s=Oe(e.offset,!0),a=Oe(e.scale,!0),c=d(s)||d(a),l=!0;d(s)||(s=this.expandConstant(0,l)),d(a)||(a=this.expandConstant(1,l)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Oe(e.noData,!0),this._default=Oe(e.default,!0),this._required=g(e.required,!0),this._extras=Oe(e.extras,!0),this._extensions=Oe(e.extensions,!0)}pa.fromJson=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.property,i=lPe(n),o=dPe(n,e.enums),r;return d(i)?i?r=d(n.optional)?!n.optional:!0:r=g(n.required,!1):r=!1,new pa({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(pa.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function lPe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===Ot.SCALAR||Ot.isMatrixType(t)||Ot.isVectorType(t))return!1;if(d(tn[t]))return!0;if(d(e.noData)||d(e.scale)||d(e.offset)||d(e.required)||d(e.count)||d(e.array)||d(e.optional))return!1}function dPe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!d(s)):e.array?(r=!0,s=e.count,a=!d(e.count)):(r=!1,s=void 0,a=!1);let c;if(d(e.enumType)&&(c=t[e.enumType]),n===Ot.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===Ot.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Ot.SCALAR||Ot.isMatrixType(n)||Ot.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Ot.BOOLEAN||n===Ot.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===Ot.BOOLEAN||i===Ot.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(d(i)&&d(tn[i]))return{type:Ot.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(d(tn[n]))return{type:Ot.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}pa.prototype.normalize=function(e){return this._normalized?CY(e,this._valueType,tn.normalize):e};pa.prototype.unnormalize=function(e){return this._normalized?CY(e,this._valueType,tn.unnormalize):e};pa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:pa.valueTransformInPlace(e,this._offset,this._scale,tn.applyValueTransform)};pa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:pa.valueTransformInPlace(e,this._offset,this._scale,tn.unapplyValueTransform)};pa.prototype.expandConstant=function(e,t){t=g(t,!1);let n=this._isArray,i=this._arrayLength,o=Ot.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};pa.prototype.handleNoData=function(e){let t=this._noData;if(!d(t))return e;if(!Kte(e,t))return e};function Kte(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Kte(e[n],t[n]))return!1;return!0}pa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=g(t,!1);let n=Ot.getMathType(this._type),i=this._isArray,o=Ot.getComponentCount(this._type),r=i&&o>1;return d(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};pa.prototype.packVectorAndMatrixTypes=function(e,t){t=g(t,!1);let n=Ot.getMathType(this._type),i=this._isArray,o=Ot.getComponentCount(this._type),r=i&&o>1;return d(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};pa.prototype.validate=function(e){if(!(!d(e)&&d(this._default)))return this._required&&!d(e)?"required property must have a value":this._isArray?uPe(this,e):Hte(this,e)};function uPe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=Hte(e,t[i]);if(d(o))return o}}function Hte(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return Ot.isVectorType(n)?mPe(t,n,i):Ot.isMatrixType(n)?hPe(t,n,i):n===Ot.STRING?fPe(t):n===Ot.BOOLEAN?pPe(t):n===Ot.ENUM?bPe(t,o):yPe(t,i,r)}function mPe(e,t,n){if(!tn.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===Ot.VEC2&&!(e instanceof D))return`vector value ${e} must be a Cartesian2`;if(t===Ot.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===Ot.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function hPe(e,t,n){if(!tn.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===Ot.MAT2&&!(e instanceof $i))return`matrix value ${e} must be a Matrix2`;if(t===Ot.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===Ot.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function fPe(e){if(typeof e!="string")return EM(e,Ot.STRING)}function pPe(e){if(typeof e!="boolean")return EM(e,Ot.BOOLEAN)}function bPe(e,t){let n=typeof e;if(d(t))return n!=="string"||!d(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function yPe(e,t,n){let i=typeof e;switch(t){case tn.INT8:case tn.UINT8:case tn.INT16:case tn.UINT16:case tn.INT32:case tn.UINT32:case tn.FLOAT32:case tn.FLOAT64:return i!=="number"?EM(e,t):isFinite(e)?Yte(e,t,n):Ote(e,t);case tn.INT64:case tn.UINT64:return i!=="number"&&i!=="bigint"?EM(e,t):i==="number"&&!isFinite(e)?Ote(e,t):Yte(e,t,n)}}function EM(e,t){return`value ${e} does not match type ${t}`}function Bte(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Yte(e,t,n){if(n){let i=tn.isUnsignedIntegerType(t)?0:-1,o=1;return e<i||e>o?Bte(e,t,n):void 0}if(e<tn.getMinimum(t)||e>tn.getMaximum(t))return Bte(e,t,n)}function Ote(e,t){return`value ${e} of type ${t} must be finite`}function CY(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=CY(e[i],t,n);return e}pa.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=pa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Lb=pa;function IE(e){e=g(e,g.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,l=i.enumType,u=r===Ot.STRING,m=r===Ot.BOOLEAN,p=0,y;if(a){let b=g(n.arrayOffsetType,n.offsetType);b=g(tn[b],tn.UINT32);let R=g(n.arrayOffsets,n.arrayOffsetBufferView);y=new VY(o[R],b,t+1),p+=y.typedArray.byteLength}let f=Ot.getComponentCount(r),x;a?x=y.get(t)-y.get(0):s?x=t*i.arrayLength:x=t;let _=f*x,C;if(u){let b=g(n.stringOffsetType,n.offsetType);b=g(tn[b],tn.UINT32);let R=g(n.stringOffsets,n.stringOffsetBufferView);C=new VY(o[R],b,_+1),p+=C.typedArray.byteLength}(u||m)&&(c=tn.UINT8);let V;u?V=C.get(_)-C.get(0):m?V=Math.ceil(_/8):V=_;let L=g(n.values,n.bufferView),Z=new VY(o[L],c,V);p+=Z.typedArray.byteLength;let G=n.offset,X=n.scale,P=i.hasValueTransform||d(G)||d(X);G=g(G,i.offset),X=g(X,i.scale),G=zte(G),X=zte(X);let v,A,M=this;u?v=function(b){return _Pe(b,M._values,M._stringOffsets)}:m?(v=function(b){return TPe(b,M._values)},A=function(b,R){SPe(b,M._values,R)}):d(l)?(v=function(b){let R=M._values.get(b);return l.namesByValue[R]},A=function(b,R){let E=l.valuesByName[R];M._values.set(b,E)}):(v=function(b){return M._values.get(b)},A=function(b,R){M._values.set(b,R)}),this._arrayOffsets=y,this._stringOffsets=C,this._values=Z,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=G,this._scale=X,this._hasValueTransform=P,this._getValue=v,this._setValue=A,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(IE.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});IE.prototype.get=function(e){let t=gPe(this,e);return t=this._classProperty.handleNoData(t),d(t)?(t=this._classProperty.normalize(t),t=XPe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};IE.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=IPe(this,t),t=n.unnormalize(t),xPe(this,e,t)};IE.prototype.getTypedArray=function(){if(d(this._values))return this._values.typedArray};function zte(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function gPe(e,t){Qte(e)&&jte(e);let n=e._classProperty,i=n.isArray,o=n.type,r=Ot.getComponentCount(o);if(d(e._unpackedValues)){let s=e._unpackedValues[t];return i?Oe(s,!0):s}return!i&&r===1?e._getValue(t):Jte(e,n,t)}function Jte(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=Ot.getComponentCount(t.type);i*=s,o*=s}else{let a=g(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function xPe(e,t,n){GPe(e,t,n)&&jte(e);let i=e._classProperty,o=i.isArray,r=i.type,s=Ot.getComponentCount(r);if(d(e._unpackedValues)){i.isArray&&(n=Oe(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let u=g(i.arrayLength,1)*e._vectorComponentCount;a=t*u,c=u}for(let l=0;l<c;++l)e._setValue(a+l,n[l])}function _Pe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return hl(t.typedArray,i,o)}function TPe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function SPe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function CPe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function VPe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function LPe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function RPe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function ZPe(e){switch(e){case tn.INT8:return Q.BYTE;case tn.UINT8:return Q.UNSIGNED_BYTE;case tn.INT16:return Q.SHORT;case tn.UINT16:return Q.UNSIGNED_SHORT;case tn.INT32:return Q.INT;case tn.UINT32:return Q.UNSIGNED_INT;case tn.FLOAT32:return Q.FLOAT;case tn.FLOAT64:return Q.DOUBLE}}function Qte(e){if(d(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===Ot.STRING||i===tn.INT64&&!Mt.supportsBigInt64Array()||i===tn.UINT64&&!Mt.supportsBigUint64Array()}function GPe(e,t,n){if(Qte(e))return!0;let i=e._arrayOffsets;if(d(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function jte(e){e._unpackedValues=EPe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function EPe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=Ot.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Jte(e,i,a);return n}function XPe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Lb.valueTransformInPlace(t,e._offset,e._scale,tn.applyValueTransform)}function IPe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Lb.valueTransformInPlace(t,e._offset,e._scale,tn.unapplyValueTransform)}function VY(e,t,n){let i=this,o,r,s;if(t===tn.INT64)Mt.supportsBigInt()?Mt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return VPe(a,i)}):(It("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return CPe(a,i)});else if(t===tn.UINT64)Mt.supportsBigInt()?Mt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return RPe(a,i)}):(It("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return LPe(a,i)});else{let a=ZPe(t);o=Q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,l){i.typedArray[c]=l}}d(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var WE=IE;function _m(e){e=g(e,g.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(d(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new WE({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(_m.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});_m.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};_m.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};_m.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};_m.prototype.getProperty=function(e,t){let n=this._properties[t],i;return d(n)?i=n.get(e):i=WPe(this._class,t),i};_m.prototype.setProperty=function(e,t,n){let i=this._properties[t];return d(i)?(i.set(e,n),!0):!1};_m.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(d(i)&&(n=i[t]),d(n))return this.getProperty(e,n.id)};_m.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return d(o)&&(i=o[t]),d(i)?this.setProperty(e,i.id,n):!1};_m.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(d(t))return t.getTypedArray()};_m.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(d(n)&&(t=n[e]),d(t))return this.getPropertyTypedArray(t.id)};function WPe(e,t){let n=e.properties;if(!d(n))return;let i=n[t];if(d(i)&&d(i.default)){let o=i.default;return i.isArray&&(o=Oe(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var bl=_m;var Hsn=T(S(),1);var Pen=T(S(),1);var Len=T(S(),1);function Rb(){}Object.defineProperties(Rb.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});Rb.prototype.load=function(){fe.throwInstantiationError()};Rb.prototype.unload=function(){};Rb.prototype.process=function(e){return!1};Rb.prototype.getError=function(e,t){d(t)&&d(t.message)&&(e+=`
${t.message}`);let n=new me(e);return d(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};Rb.prototype.isDestroyed=function(){return!1};Rb.prototype.destroy=function(){return this.unload(),ue(this)};var oo=Rb;var Zen=T(S(),1),PPe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},Rt=Object.freeze(PPe);function Lp(e){e=g(e,g.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Lp.prototype=Object.create(oo.prototype),Lp.prototype.constructor=Lp);Object.defineProperties(Lp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Lp.prototype.load=async function(){return d(this._promise)?this._promise:d(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=vPe(this),this._promise)};async function vPe(e){let t=e._resource;e._state=Rt.LOADING;try{let n=await Lp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Rt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Rt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Lp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Lp.prototype.unload=function(){this._typedArray=void 0};var Sx=Lp;var etn=T(S(),1);var Ben=T(S());var Fen=T(S()),ven=function(){"use strict";var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiLQdilevlevlooroowwvbDDbelve9Weiiviebeoweuec:G;kekr;qiHo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbzl79IV9RbHDwebcekdXCq:fSQdbk:fxeYu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRb:q:kjjbc:GeV86bbavcjdfcbcjdz:tjjjb8AdnaiTmbavcjdfadalzMjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0Ez:tjjjb8AavavcjdfalzMjjjbhDcj;abal9UhodndndndndnalTmbaoc;WFbGgecjdaecjd6Ehqcbhkdninakai9pmiaDcjlfcbcjdz:tjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndndndnaec9WGgsTmbcbhzcehHaPhOawhAxekdnaxTmbcbhAcehHaPhCinaDaAfRbbhXaDcjlfheaChoaxhQinaeaoRbbgLaX9RgXcetaXcKtcK91cr4786bbaoalfhoaecefheaLhXaQcufgQmbkaraw9Ram6miawcbamz:tjjjbgeTmiaCcefhCaeamfhwaAcefgAal6hHaAal9hmbxvkkaraw9Ram6mvawcbamz:tjjjb8AceheinawgXamfhwalaegoSmldnaraw9Ram6mbaocefheawcbamz:tjjjb8AaXmekkcbhwaoal6mvxikindnaxTmbaDazfRbbhXaDcjlfheaOhoaxhQinaeaoRbbgLaX9RgXcetaXcKtcK91cr4786bbaoalfhoaecefheaLhXaQcufgQmbkkaraA9Ram6mearaAcbamz:tjjjbgKamfgw9RcK6mdcbhYaDcjlfhAinaDcjlfaYfh8AcwhCczhLcehQindndnaQce9hmbcuhoa8ARbbmecbhodninaogecsSmeaecefhoaAaefcefRbbTmbkkcucbaecs6EhoxekaQcetc;:FFFeGhocuaQtcu7cFeGhXcbheinaoaXaAaefRbb9nfhoaecefgecz9hmbkkaoaLaoaL6geEhLaQaCaeEhCaQcetgQcw6mbkdndndndnaCcufPdiebkaKaYco4fgeaeRbbcdciaCclSEaYci4coGtV86bbaCcw9hmeawa8A8Pbb83bbawcwfa8Acwf8Pbb83bbawczfhwxdkaKaYco4fgeaeRbbceaYci4coGtV86bbkdncwaC9TgEmbinawcb86bbawcefhwxbkkcuaCtcu7h8Acbh3aAh5ina5heaEhQcbhoinaeRbbgLa8AcFeGgXaLaX6EaoaCtVhoaecefheaQcufgQmbkawao86bba5aEfh5awcefhwa3aEfg3cz6mbkcbheindnaAaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaYczfgYas9pmbaAczfhAaraw9RcL0mekkaYas6meawTmeaOcefhOazcefgzal6hHawhAazalSmixbkkcbhwaHceGTmexikcbhwaHceGmdkaDaPaxcufal2falzMjjjb8AaxakfhkawmbkcbhoxokcbhoxvkaiTmekcbhoaraw9Ralcaalca0E6mialc8F9nmexdkcbhoaecufca6mdkawcbcaal9Rgez:tjjjbaefhwkawaDcjdfalzMjjjbalfab9Rhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBd:q:kjjbk;use3u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbydN:kjjbgrc;GeV86bbalc;abfcFecjez:tjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgoydbhLaocwfydbhKaoclfydbhYcbh8Adndninalc;abfavcsGcitfgoydlhEdndndnaoydbgoaL9hmbaEaYSmekdnaoaY9hmbaEaK9hmba8Acefh8AxekaoaK9hmeaEaL9hmea8Acdfh8Aka8Ac870mdaXcufhvada8AciGcx2goc:y1jjbfydbaCfcdtfydbhEadaocN1jjbfydbaCfcdtfydbhKadaoc:q1jjbfydbaCfcdtfydbhLcbhodnindnalavcsGcdtfydbaE9hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaEaOSgvaYcb9kaYaH9iGgoce7Gh3dndndndndnaYcbcsavEaoEgvcs9hmbarce9imbaEaEaAaEcefaASgvEgAcefSmecmcsavEhvkasava8Acdtc;WeGV86bbavcs9hmeaEaA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbkaEhAxdkcPhvasa8AcdtcPV86bbaEhAkavTmbavaH9imekalaXcdtfaEBdbaXcefcsGhXkaOa3fhOalc;abfaQcitfgvaKBdlavaEBdbalc;abfaQcefcsGgvcitfgoaEBdlaoaLBdbavcefhoxikavcufhva8Aclfg8Ac;ab9hmbkkdnadceaKaOScetaYaOSEcx2gvc:q1jjbfydbaCfcdtfydbgLTadavcN1jjbfydbaCfcdtfydbg8AceSGadavc:y1jjbfydbaCfcdtfydbgYcdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhKxdkcuhKaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydbaY9hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaLaOSg8Efh3dndnaKcm0mbaKcefhKxekcbcsa8Aa3SgvEhKa3avfh3kdndnaEcm0mbaEcefhExekcbcsaYa3SgvEhEa3avfh3kc9:cua8EEh8FaEaKcltVhocbhvdndndninavcj1jjbfRbbaocFeGSmeavcefgvcz9hmbxdkkaLaO9havcm0Va5Vmbasavc;WeV86bbxekasa8F86bbaeao86bbaecefhekdna8EmbaLaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaLhAkdnaKcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmbaYaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaYhAkalaXcdtfaLBdbaXcefcsGhvdndnaKPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfaYBdbavcefcsGhvkalc;abfaQcitfgoaLBdlaoa8ABdbalc;abfaQcefcsGcitfgoa8ABdlaoaYBdbalc;abfaQcdfcsGcitfgoaYBdlaoaLBdbaQcifhoavhXa3hOkascefhsaocsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBdN:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRbN:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaicwfhiaDclfhDaecufgembkkk;klld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicdfciGcdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:Hvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6mearcearce0EhwaohDinaDc:CuBdbaDclfhDawcufgwmbkaeTmiadcl6mdarcearce0EhqarcdthkalhxcbhminaohDaxhwaqhPinaDaDydbgsawydbgzcL4cFeGc:cufcbazEgzasaz9kEBdbawclfhwaDclfhDaPcufgPmbkaxakfhxamcefgmae9hmbkkaeTmdxekaeTmekavcb9hadcl6gqVhHarcearce0Ehkarcdthrceai9Rhmcbhdindndndnavce9hmbaqmdc:CuhwalhDakhPinawaDydbgscL4cFeGc:cufcbasEgsawas9kEhwaDclfhDaPcufgPmbxdkkc:CuhwaHmbaohDalhPakhsinaDaPydbgzcL4cFeGgxc8Aaxc8A9kEc:cufcbazEBdbaPclfhPaDclfhDascufgsmbkkaqmbcbhDakhsinawhPdnavceSmbaoaDfydbhPkdndnalaDfIdbgOcjjj;8iamaPfgPcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohzxekcjjjj94hzkabaDfazcFFFrGaPcKtVBdbaDclfhDascufgsmbkkabarfhbalarfhladcefgdae9hmbkkaocjdf8Kjjjjbk;TkdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Oefcbc;Kbz:tjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgoadcFFFFi0Ecbyd1:kjjbHjjjjbbgeBd:OeavceBd1daeabaozMjjjb8Akavc:yefcwfcbBdbav9cb83i:yeavc:yefaeadaiavc:Oefz:njjjbcuaicdtgraicFFFFi0Egwcbyd1:kjjbHjjjjbbhoavc:Oefavyd1dgDcdtfaoBdbavaDcefgqBd1daoavyd:yegkarzMjjjbhxavc:Oefaqcdtfadci9Ugmcbyd1:kjjbHjjjjbbgoBdbavaDcdfgrBd1daocbamz:tjjjbhPavc:Oefarcdtfawcbyd1:kjjbHjjjjbbgsBdbavaDcifgqBd1daxhoashrinaralIdbalaoydbgwcwawcw6Ecdtfc;ebfIdbMUdbaoclfhoarclfhraicufgimbkavc:OefaqcdtfcuamcdtadcFFFF970Ecbyd1:kjjbHjjjjbbgqBdbavaDclfBd1ddnadci6mbamceamce0EhiaehoaqhrinarasaoydbcdtfIdbasaoclfydbcdtfIdbMasaocwfydbcdtfIdbMUdbaocxfhoarclfhraicufgimbkkavc;mbfhzavhoavyd:CehHavyd:GehOcbhwcbhrcbhAcehCinaohXcihQaearci2gLcdtfgocwfydbhKaoydbhdabaAcx2fgiclfaoclfydbgDBdbaiadBdbaicwfaKBdbaParfce86bbazaKBdwazaDBdlazadBdbaqarcdtfcbBdbdnawTmbcihQaXhiindnaiydbgoadSmbaoaDSmbaoaKSmbazaQcdtfaoBdbaQcefhQkaiclfhiawcufgwmbkkaAcefhAaxadcdtfgoaoydbcufBdbaxaDcdtfgoaoydbcufBdbaxaKcdtfgoaoydbcufBdbcbhwinaOaHaeawaLfcdtfydbcdtgifydbcdtfgKhoakaifgDydbgdhidnadTmbdninaoydbarSmeaoclfhoaicufgiTmdxbkkaoadcdtaKfc98fydbBdbaDaDydbcufBdbkawcefgwci9hmbkdndndnaQTmbcuhrJbbbbhYcbhoinasazaocdtfydbcdtgifgwIdbh8AawalcbaocefgDaocs0EcdtfIdbalaxaifydbgocwaocw6Ecdtfc;ebfIdbMgEUdbdnakaifydbgwTmbaEa8A:thEaOaHaifydbcdtfhoawcdthiinaqaoydbgwcdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYawaradEhraoclfhoaic98fgimbkkaDhoaDaQ9hmbkarcu9hmekaCam9pmeindnaPaCfRbbmbaChrxdkamaCcefgC9hmbxdkkaQczaQcz6EhwazhoaXhzarcu9hmekkavyd1dhokaocdtavc:Oeffc98fhrdninaoTmearydbcbyd:e:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;UlevucuaicdtgvaicFFFFi0Egocbyd1:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd1:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd1:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:tjjjb8Aadci9UhwdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbawceawce0EhDabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:m:kjjbgeabcifc98GfgbBd:m:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:m:kjjbgeabcrfc94GfgbBd:m:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:m:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:m:kjjbfgdBd:m:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Eddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkxebbbdbbbaWbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(p){for(var y=new Uint8Array(p.length),f=0;f<p.length;++f){var x=p.charCodeAt(f);y[f]=x>96?x-97:x>64?x-39:x+4}for(var _=0,f=0;f<p.length;++f)y[_++]=y[f]<60?t[y[f]]:(y[f]-60)*64+y[++f];return y.buffer.slice(0,_)}function r(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,y,f){var x=n.exports.sbrk,_=x(p.length*4),C=x(y*4),V=new Uint8Array(n.exports.memory.buffer),L=s(p);V.set(L,_),f&&f(_,_,p.length,y);var Z=n.exports.meshopt_optimizeVertexFetchRemap(C,_,p.length,y);V=new Uint8Array(n.exports.memory.buffer);var G=new Uint32Array(y);new Uint8Array(G.buffer).set(V.subarray(C,C+y*4)),L.set(V.subarray(_,_+p.length*4)),x(_-x(0));for(var X=0;X<p.length;++X)p[X]=G[p[X]];return[G,Z]}function c(p,y,f,x,_){var C=n.exports.sbrk,V=C(y),L=C(x*_),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(f),L);var G=p(V,y,L,x,_),X=new Uint8Array(G);return X.set(Z.subarray(V,V+G)),C(V-C(0)),X}function l(p){for(var y=0,f=0;f<p.length;++f){var x=p[f];y=y<x?x:y}return y}function u(p,y){if(r(y==2||y==4),y==4)return new Uint32Array(p.buffer,p.byteOffset,p.byteLength/4);var f=new Uint16Array(p.buffer,p.byteOffset,p.byteLength/2);return new Uint32Array(f)}function m(p,y,f,x,_,C,V){var L=n.exports.sbrk,Z=L(f*x),G=L(f*C),X=new Uint8Array(n.exports.memory.buffer);X.set(s(y),G),p(Z,f,x,_,G,V);var P=new Uint8Array(f*x);return P.set(X.subarray(Z,Z+f*x)),L(Z-L(0)),P}return{ready:i,supported:!0,reorderMesh:function(p,y,f){var x=y?f?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(p,l(p)+1,x)},encodeVertexBuffer:function(p,y,f){r(f>0&&f<=256),r(f%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(y,f);return c(n.exports.meshopt_encodeVertexBuffer,x,p,y,f)},encodeIndexBuffer:function(p,y,f){r(f==2||f==4),r(y%3==0);var x=u(p,f),_=n.exports.meshopt_encodeIndexBufferBound(y,l(x)+1);return c(n.exports.meshopt_encodeIndexBuffer,_,x,y,4)},encodeIndexSequence:function(p,y,f){r(f==2||f==4);var x=u(p,f),_=n.exports.meshopt_encodeIndexSequenceBound(y,l(x)+1);return c(n.exports.meshopt_encodeIndexSequence,_,x,y,4)},encodeGltfBuffer:function(p,y,f,x){var _={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(_[x]),_[x](p,y,f)},encodeFilterOct:function(p,y,f,x){return r(f==4||f==8),r(x>=1&&x<=16),m(n.exports.meshopt_encodeFilterOct,p,y,f,x,16)},encodeFilterQuat:function(p,y,f,x){return r(f==8),r(x>=4&&x<=16),m(n.exports.meshopt_encodeFilterQuat,p,y,f,x,16)},encodeFilterExp:function(p,y,f,x,_){r(f>0&&f%4==0),r(x>=1&&x<=24);var C={Separate:0,SharedVector:1,SharedComponent:2};return m(n.exports.meshopt_encodeFilterExp,p,y,f,x,f,_?C[_]:1)}}}();var Men=T(S()),qte=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?t:e,r,s=WebAssembly.instantiate(a(o),{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L<C.length;++L){var Z=C.charCodeAt(L);V[L]=Z>96?Z-97:Z>64?Z-39:Z+4}for(var G=0,L=0;L<C.length;++L)V[G++]=V[L]<60?i[V[L]]:(V[L]-60)*64+V[++L];return V.buffer.slice(0,G)}function c(C,V,L,Z,G,X){var P=r.exports.sbrk,v=L+3&-4,A=P(v*Z),M=P(G.length),b=new Uint8Array(r.exports.memory.buffer);b.set(G,M);var R=C(A,L,Z,M,G.length);if(R==0&&X&&X(A,v,Z),V.set(b.subarray(A,A+L*Z)),P(A-P(0)),R!=0)throw new Error("Malformed buffer data: "+R)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},m=[],p=0;function y(C){var V={object:new Worker(C),pending:0,requests:{}};return V.object.onmessage=function(L){var Z=L.data;V.pending-=Z.count,V.requests[Z.id][Z.action](Z.value),delete V.requests[Z.id]},V}function f(C){for(var V="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a(o))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+c.toString()+_.toString(),L=new Blob([V],{type:"text/javascript"}),Z=URL.createObjectURL(L),G=0;G<C;++G)m[G]=y(Z);URL.revokeObjectURL(Z)}function x(C,V,L,Z,G){for(var X=m[0],P=1;P<m.length;++P)m[P].pending<X.pending&&(X=m[P]);return new Promise(function(v,A){var M=new Uint8Array(L),b=p++;X.pending+=C,X.requests[b]={resolve:v,reject:A},X.object.postMessage({id:b,count:C,size:V,source:M,mode:Z,filter:G},[M.buffer])})}function _(C){s.then(function(){var V=C.data;try{var L=new Uint8Array(V.count*V.size);c(r.exports[V.mode],L,V.count,V.size,V.source,r.exports[V.filter]),self.postMessage({id:V.id,count:V.count,action:"resolve",value:L},[L.buffer])}catch(Z){self.postMessage({id:V.id,count:V.count,action:"reject",value:Z})}})}return{ready:s,supported:!0,useWorkers:function(C){f(C)},decodeVertexBuffer:function(C,V,L,Z,G){c(r.exports.meshopt_decodeVertexBuffer,C,V,L,Z,r.exports[l[G]])},decodeIndexBuffer:function(C,V,L,Z){c(r.exports.meshopt_decodeIndexBuffer,C,V,L,Z)},decodeIndexSequence:function(C,V,L,Z){c(r.exports.meshopt_decodeIndexSequence,C,V,L,Z)},decodeGltfBuffer:function(C,V,L,Z,G,X){c(r.exports[u[G]],C,V,L,Z,r.exports[l[X]])},decodeGltfBufferAsync:function(C,V,L,Z,G){return m.length>0?x(C,V,L,u[Z],l[G]):s.then(function(){var X=new Uint8Array(C*V);return c(r.exports[u[Z]],X,C,V,L,r.exports[l[G]]),X})}}}();var ken=T(S()),Nen=function(){"use strict";var e="b9H79TebbbecD9Geueu9Geub9Gbb9Gquuuuuuu99uueu9Gvuuuuub9Gluuuue999Giuuue999Gluuuueu9Giuuueuimxdilvorbwwbewlve9Weiiviebeoweuecj;jekr7oo9TW9T9V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g8ETmbasaPaCfydbcitfh8Fa3aCfhaaEaCfhXcbhLindndna8FaLcitfydbgQaO9hmbaXaOBdbaaaOBdbxekdnamaQcdtgkfydbghTmbasaPakfydbcitgCfydbaOSmeahcufh8Aa5aCfhAcbhCina8AaCSmeaCcefhCaAydbhKaAcwfhAaKaO9hmbkaCah6meka3akfgCaOaQaCydbcuSEBdbaXaQaOaXydbcuSEBdbkaLcefgLa8E9hmbkkaOcefgOal9hmbkazhAaHhOa3hKaEhLcbhCindndnaCaAydbg8A9hmbdnaCaOydbg8A9hmbaLydbh8AdnaKydbgQcu9hmba8Acu9hmbaYaCfcb86bbxikaYaCfhXdnaCaQSmbaCa8ASmbaXce86bbxikaXcl86bbxdkdnaCaHa8AcdtgQfydb9hmbdnaKydbgXcuSmbaCaXSmbaLydbgkcuSmbaCakSmba3aQfydbg8EcuSmba8Ea8ASmbaEaQfydbgQcuSmbaQa8ASmbdnazaXcdtfydbazaQcdtfydb9hmbazakcdtfydbaza8Ecdtfydb9hmbaYaCfcd86bbxlkaYaCfcl86bbxikaYaCfcl86bbxdkaYaCfcl86bbxekaYaCfaYa8AfRbb86bbkaAclfhAaOclfhOaKclfhKaLclfhLalaCcefgC9hmbkawceGTmbaYhCalhAindnaCRbbce9hmbaCcl86bbkaCcefhCaAcufgAmbkkcbhLcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhmaqcKfaqyd94gCcdtfamBdbaqaCcefgABd94amaialavz:djjjb8AaqcKfaAcdtfcualc8S2gAalc;D;O;f8U0Ecbyd;S1jjbHjjjjbbgOBdbaqaCcdfBd94aOcbaAz1jjjbhsdnadTmbaehAindnamaAclfydbg8Acx2fgCIdbamaAydbgQcx2fgOIdbgg:tg8JamaAcwfydbgXcx2fgKIdlaOIdlg8K:tg8LNaKIdbag:tg8MaCIdla8K:tg8NN:tgyayNa8NaKIdwaOIdwg8P:tgINa8LaCIdwa8P:tg8NN:tg8La8LNa8Na8MNaIa8JN:tg8Ja8JNMM:r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g8Ja8S9Emea86a819pmeJFFuuh8Ldna85ah9pmbaaa5a85cdtfydbcx2fIdwJbb;aZNh8Lkdna8Ja8L9ETmba86aU0mdkdna83azaXydlg87cdtg88fydbgOfg89Rbba83azaXydbgecdtg8:fydbgZfgnRbbVmbdna8YaZcdtgCfydbgKTmba80a8ZaCfydbcitfhCamaOcx2fg8Ecwfhda8EclfhxamaZcx2fg8Fcwfhva8FclfhwcbhAcehQdnindnaiaCydbcdtfydbgLaOSmbaiaCclfydbcdtfydbg8AaOSmbama8Acx2fg8AIdbamaLcx2fgLIdbg8M:tg8LawIdbaLIdlgy:tggNa8FIdba8M:tg8Ka8AIdlay:tg8JN:ta8LaxIdbay:tg8PNa8EIdba8M:tg8Na8JN:tNa8JavIdbaLIdwgy:tgINaga8AIdway:tg8MN:ta8JadIdbay:tgyNa8Pa8MN:tNa8Ma8KNaIa8LN:ta8Ma8NNaya8LN:tNMMJbbbb9DmdkaCcwfhCaAcefgAaK6hQaKaA9hmbkkaQceGTmba85cefh85xekaXcwfhKasaOc8S2fgCasaZc8S2fgAIdbaCIdbMUdbaCaAIdlaCIdlMUdlaCaAIdwaCIdwMUdwaCaAIdxaCIdxMUdxaCaAIdzaCIdzMUdzaCaAIdCaCIdCMUdCaCaAIdKaCIdKMUdKaCaAId3aCId3MUd3aCaAIdaaCIdaMUdaaCaAId8KaCId8KMUd8KaCaAIdyaCIdyMUdydndndndnaYaefgARbbc9:fPdebdkaehCinaiaCcdtgCfaOBdbaHaCfydbgCae9hmbxikkaHa88fydbhCaHa8:fydbheaia8:fa87BdbaCh87kaiaecdtfa87Bdbkance86bba89ce86bbaKIdbg8LaRaRa8L9DEhRaBcefhBcecdaARbbceSEa86fh86kakcefgkah9hmbkkaBTmbdnalTmbcbhAaEhCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmbaEaKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkcbhAa3hCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmba3aKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkkcbhdabhCcbhLindnaiaCydbcdtfydbgAaiaCclfydbcdtfydbgOSmbaAaiaCcwfydbcdtfydbgKSmbaOaKSmbabadcdtfg8AaABdba8AclfaOBdba8AcwfaKBdbadcifhdkaCcxfhCaLcifgLaP9pmdxbkkaPhdxdkadao0mbkkdnaDTmbaDaR:rUdbkaqyd94gCcdtaqcKffc98fhzdninaCTmeazydbcbyd;W1jjbH:bjjjbbazc98fhzaCcufhCxbkkaqcj;bbf8Kjjjjbadk;pleouabydbcbaicdtz1jjjb8Aadci9UhvdnadTmbabydbhodnalTmbaehradhwinaoalarydbcdtfydbcdtfgDaDydbcefBdbarclfhrawcufgwmbxdkkaehradhwinaoarydbcdtfgDaDydbcefBdbarclfhrawcufgwmbkkdnaiTmbabydbhrabydlhwcbhDaihoinawaDBdbawclfhwarydbaDfhDarclfhraocufgombkkdnadci6mbavceavce0EhqabydlhvabydwhrinaecwfydbhwaeclfydbhDaeydbhodnalTmbalawcdtfydbhwalaDcdtfydbhDalaocdtfydbhokaravaocdtfgdydbcitfaDBdbaradydbcitfawBdladadydbcefBdbaravaDcdtfgdydbcitfawBdbaradydbcitfaoBdladadydbcefBdbaravawcdtfgwydbcitfaoBdbarawydbcitfaDBdlawawydbcefBdbaecxfheaqcufgqmbkkdnaiTmbabydlhrabydbhwinararydbawydb9RBdbawclfhwarclfhraicufgimbkkk:3ldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkaPk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz1jjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;01jjbgeabcifc98GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;01jjbgeabcrfc94GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;01jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;01jjbfgdBd;01jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:cedbcjwk9PFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbc;Swkxebbbdbbbj9Kbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function o(p){for(var y=new Uint8Array(p.length),f=0;f<p.length;++f){var x=p.charCodeAt(f);y[f]=x>96?x-97:x>64?x-39:x+4}for(var _=0,f=0;f<p.length;++f)y[_++]=y[f]<60?t[y[f]]:(y[f]-60)*64+y[++f];return y.buffer.slice(0,_)}function r(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function a(p,y){var f=n.exports.sbrk,x=f(p.length*4),_=f(y*4),C=new Uint8Array(n.exports.memory.buffer),V=s(p);C.set(V,x);var L=n.exports.meshopt_optimizeVertexFetchRemap(_,x,p.length,y);C=new Uint8Array(n.exports.memory.buffer);var Z=new Uint32Array(y);new Uint8Array(Z.buffer).set(C.subarray(_,_+y*4)),V.set(C.subarray(x,x+p.length*4)),f(x-f(0));for(var G=0;G<p.length;++G)p[G]=Z[p[G]];return[Z,L]}function c(p){for(var y=0,f=0;f<p.length;++f){var x=p[f];y=y<x?x:y}return y}function l(p,y,f,x,_,C,V,L,Z){var G=n.exports.sbrk,X=G(4),P=G(f*4),v=G(_*C),A=G(f*4),M=new Uint8Array(n.exports.memory.buffer);M.set(s(x),v),M.set(s(y),A);var b=p(P,A,f,v,_,C,V,L,Z,X);M=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);s(R).set(M.subarray(P,P+b*4));var E=new Float32Array(1);return s(E).set(M.subarray(X,X+4)),G(X-G(0)),[R,E[0]]}function u(p,y,f,x){var _=n.exports.sbrk,C=_(f*x),V=new Uint8Array(n.exports.memory.buffer);V.set(s(y),C);var L=p(C,f,x);return _(C-_(0)),L}var m={LockBorder:1};return{ready:i,supported:!0,compactMesh:function(p){r(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),r(p.length%3==0);var y=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return a(y,c(p)+1)},simplify:function(p,y,f,x,_,C){r(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),r(p.length%3==0),r(y instanceof Float32Array),r(y.length%f==0),r(f>=3),r(x%3==0),r(_>=0&&_<=1);for(var V=0,L=0;L<(C?C.length:0);++L)V|=m[C[L]];var Z=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),G=l(n.exports.meshopt_simplify,Z,p.length,y,y.length/f,f*4,x,_,V);return G[0]=p instanceof Uint32Array?G[0]:new p.constructor(G[0]),G},getScale:function(p,y){return r(p instanceof Float32Array),r(p.length%y==0),u(n.exports.meshopt_simplifyScale,p,p.length/y,y*4)}}}();function Cx(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,l=a.byteOffset,u=a.byteLength,m=!1,p,y,f,x;if(ri(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,l=g(C.byteOffset,0),u=C.byteLength,m=!0,p=C.byteStride,y=C.count,f=C.mode,x=g(C.filter,"NONE")}let _=n.buffers[c];this._hasMeshopt=m,this._meshoptByteStride=p,this._meshoptCount=y,this._meshoptMode=f,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=_,this._bufferId=c,this._byteOffset=l,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Cx.prototype=Object.create(oo.prototype),Cx.prototype.constructor=Cx);Object.defineProperties(Cx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function wPe(e){try{let t=FPe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);qte.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Rt.READY,e}catch(t){if(e.isDestroyed())return;e.unload(),e._state=Rt.FAILED;let n="Failed to load buffer view";throw e.getError(n,t)}}Cx.prototype.load=async function(){return d(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=wPe(this),this._promise)};function FPe(e){let t=e._resourceCache,n=e._buffer;if(d(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}Cx.prototype.unload=function(){d(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var vS=Cx;var htn=T(S(),1);var stn=T(S(),1);function _r(){}_r._maxDecodingConcurrency=Math.max(Mt.hardwareConcurrency-1,1);_r._decoderTaskProcessor=void 0;_r._taskProcessorReady=!1;_r._error=void 0;_r._getDecoderTaskProcessor=function(){if(!d(_r._decoderTaskProcessor)){let e=new pi("decodeDraco",_r._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?_r._taskProcessorReady=!0:_r._error=new me("Draco decoder could not be initialized.")}).catch(t=>{_r._error=t}),_r._decoderTaskProcessor=e}return _r._decoderTaskProcessor};_r.decodePointCloud=function(e){let t=_r._getDecoderTaskProcessor();if(d(_r._error))throw _r._error;if(_r._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};_r.decodeBufferView=function(e){let t=_r._getDecoderTaskProcessor();if(d(_r._error))throw _r._error;if(_r._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Rp=_r;function Zb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._dracoError=void 0}d(Object.create)&&(Zb.prototype=Object.create(oo.prototype),Zb.prototype.constructor=Zb);Object.defineProperties(Zb.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function APe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;$te(e,n)}}Zb.prototype.load=async function(){return d(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=APe(this),this._promise)};function $te(e,t){e.unload(),e._state=Rt.FAILED;let n="Failed to load Draco";throw e.getError(n,t)}async function MPe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}Zb.prototype.process=function(e){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(d(this._dracoError)&&$te(this,this._dracoError),!d(this._bufferViewTypedArray))||d(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=Rp.decodeBufferView(a);if(!d(c))return!1;this._decodePromise=MPe(this,c)};Zb.prototype.unload=function(){d(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var wS=Zb;var Ztn=T(S(),1);var gtn=T(S(),1);function NPe(e){let t=e.uint8Array,n=e.format,i=e.request,o=g(e.flipY,!1),r=g(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ee.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ee.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ee({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return d(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return d(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Vx=NPe;function Zp(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,l=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=l,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Zp.prototype=Object.create(oo.prototype),Zp.prototype.constructor=Zp);Object.defineProperties(Zp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Zp.prototype.load=function(){return d(this._promise)?this._promise:d(this._bufferViewId)?(this._promise=UPe(this),this._promise):(this._promise=kPe(this),this._promise)};function ene(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function UPe(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await BPe(i);if(e.isDestroyed())return;let r=ene(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(n){return e.isDestroyed()?void 0:tne(e,n,"Failed to load embedded image")}}async function kPe(e){e._state=Rt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await OPe(i);if(e.isDestroyed())return;let r=ene(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(o){return e.isDestroyed()?void 0:tne(e,o,`Failed to load image: ${n}`)}}function tne(e,t,n){return e.unload(),e._state=Rt.FAILED,Promise.reject(e.getError(n,t))}function DPe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new me("Image format is not recognized")}async function BPe(e){let t=DPe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return rl(n)}return Zp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var YPe=/(^data:image\/ktx2)|(\.ktx2$)/i;function OPe(e){let t=e.getUrlComponent(!1,!0);return YPe.test(t)?rl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Zp.prototype.unload=function(){d(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Zp._loadImageFromTypedArray=Vx;var FS=Zp;var ktn=T(S(),1);var Etn=T(S(),1),KPe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},ba=Object.freeze(KPe);function Gb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=g(e.asynchronous,!0),l=g(e.loadBuffer,!1),u=g(e.loadTypedArray,!1),m=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=m,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=l,this._loadTypedArray=u,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Gb.prototype=Object.create(oo.prototype),Gb.prototype.constructor=Gb);Object.defineProperties(Gb.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var HPe=new RY;Gb.prototype.load=async function(){return d(this._promise)?this._promise:d(this._draco)?(this._promise=zPe(this),this._promise):(this._promise=JPe(this),this._promise)};async function zPe(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Rt.LOADED,e)}catch(n){if(e.isDestroyed())return;LY(e,n)}}async function JPe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=Rt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=QPe(e,a),e._state=Rt.PROCESSING,e}catch(s){if(e.isDestroyed())return;LY(e,s)}}function QPe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ue.getSizeInBytes(s),c=t.buffer,l=t.byteOffset+o.byteOffset;if(l%a!==0){let m=r*a,p=new Uint8Array(c,l,m);c=new Uint8Array(p).buffer,l=0,zr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ue.UNSIGNED_BYTE?u=new Uint8Array(c,l,r):s===Ue.UNSIGNED_SHORT?u=new Uint16Array(c,l,r):s===Ue.UNSIGNED_INT&&(u=new Uint32Array(c,l,r)),u}function LY(e,t){e.unload(),e._state=Rt.FAILED;let n="Failed to load index buffer";throw e.getError(n,t)}function RY(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}RY.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};RY.prototype.execute=function(){this.buffer=nne(this.typedArray,this.indexDatatype,this.context)};function nne(e,t,n){let i=mt.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Gb.prototype.process=function(e){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED&&this._state!==Rt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(d(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){LY(this,o)}if(!d(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=HPe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,ba.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=nne(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=Rt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Gb.prototype.unload=function(){d(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;d(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),d(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var AS=Gb;var qon=T(S(),1);var mnn=T(S(),1);var Ytn=T(S(),1);function jPe(e,t,n){if(n=g(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var rs=jPe;var jtn=T(S(),1);var Htn=T(S(),1);function qPe(e,t){return d(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var tr=qPe;function Kt(){}Kt.objectLegacy=function(e,t){if(d(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(d(o))return o}}};Kt.object=function(e,t){if(d(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(d(r))return r}}};Kt.topLevel=function(e,t,n){let i=e[t];return d(i)&&!Array.isArray(i)?Kt.objectLegacy(i,n):Kt.object(i,n)};Kt.accessor=function(e,t){return Kt.topLevel(e,"accessors",t)};Kt.accessorWithSemantic=function(e,t,n){let i={};return Kt.mesh(e,function(o){return Kt.meshPrimitive(o,function(r){let s=Kt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!d(i[a])){i[a]=!0;let l=n(a);if(d(l))return l}});return d(s)?s:Kt.meshPrimitiveTarget(r,function(a){return Kt.meshPrimitiveTargetAttribute(a,function(c,l){if(l.indexOf(t)===0&&!d(i[c])){i[c]=!0;let u=n(c);if(d(u))return u}})})})})};Kt.accessorContainingVertexAttributeData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=Kt.meshPrimitiveAttribute(o,function(s){if(!d(n[s])){n[s]=!0;let a=t(s);if(d(a))return a}});return d(r)?r:Kt.meshPrimitiveTarget(o,function(s){return Kt.meshPrimitiveTargetAttribute(s,function(a){if(!d(n[a])){n[a]=!0;let c=t(a);if(d(c))return c}})})})})};Kt.accessorContainingIndexData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=o.indices;if(d(r)&&!d(n[r])){n[r]=!0;let s=t(r);if(d(s))return s}})})};Kt.animation=function(e,t){return Kt.topLevel(e,"animations",t)};Kt.animationChannel=function(e,t){let n=e.channels;return Kt.object(n,t)};Kt.animationSampler=function(e,t){let n=e.samplers;return Kt.object(n,t)};Kt.buffer=function(e,t){return Kt.topLevel(e,"buffers",t)};Kt.bufferView=function(e,t){return Kt.topLevel(e,"bufferViews",t)};Kt.camera=function(e,t){return Kt.topLevel(e,"cameras",t)};Kt.image=function(e,t){return Kt.topLevel(e,"images",t)};Kt.material=function(e,t){return Kt.topLevel(e,"materials",t)};Kt.materialValue=function(e,t){let n=e.values;d(e.extensions)&&d(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(d(o))return o}};Kt.mesh=function(e,t){return Kt.topLevel(e,"meshes",t)};Kt.meshPrimitive=function(e,t){let n=e.primitives;if(d(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(d(s))return s}}};Kt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(d(o))return o}};Kt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(d(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(d(r))return r}}};Kt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(d(o))return o}};Kt.node=function(e,t){return Kt.topLevel(e,"nodes",t)};Kt.nodeInTree=function(e,t,n){let i=e.nodes;if(d(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(d(a)){let c=n(a,s);if(d(c))return c;let l=a.children;if(d(l)&&(c=Kt.nodeInTree(e,l,n),d(c)))return c}}}};Kt.nodeInScene=function(e,t,n){let i=t.nodes;if(d(i))return Kt.nodeInTree(e,i,n)};Kt.program=function(e,t){return tr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.programs,t):Kt.topLevel(e,"programs",t)};Kt.sampler=function(e,t){return Kt.topLevel(e,"samplers",t)};Kt.scene=function(e,t){return Kt.topLevel(e,"scenes",t)};Kt.shader=function(e,t){return tr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.shaders,t):Kt.topLevel(e,"shaders",t)};Kt.skin=function(e,t){return Kt.topLevel(e,"skins",t)};Kt.skinJoint=function(e,t){let n=e.joints;if(d(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(d(s))return s}}};Kt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(d(o))return o}};Kt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(d(o))return o}};Kt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(d(o))return o}};Kt.technique=function(e,t){return tr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.techniques,t):Kt.topLevel(e,"techniques",t)};Kt.texture=function(e,t){return Kt.topLevel(e,"textures",t)};var Xe=Kt;var onn=T(S(),1);var $tn=T(S(),1);function $Pe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var nd=$Pe;function eve(e,t){let n=t.bufferView;if(d(n)){let i=e.bufferViews[n];if(d(i.byteStride)&&i.byteStride>0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*nd(t.type)}var yl=eve;function tve(e){Xe.accessor(e,function(n){d(n.bufferView)&&(n.byteOffset=g(n.byteOffset,0))}),Xe.bufferView(e,function(n){d(n.buffer)&&(n.byteOffset=g(n.byteOffset,0))}),Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){if(i.mode=g(i.mode,ne.TRIANGLES),!d(i.material)){d(e.materials)||(e.materials=[]);let o={name:"default"};i.material=rs(e.materials,o)}})}),Xe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=g(i.normalized,!1),d(o)){let r=e.bufferViews[o];r.byteStride=yl(e,i),r.target=ne.ARRAY_BUFFER}}),Xe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(d(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),Xe.material(e,function(n){let i=g(n.extensions,g.EMPTY_OBJECT),o=i.KHR_materials_common;if(d(o)){let c=o.technique,l=d(o.values)?o.values:{};o.values=l,l.ambient=d(l.ambient)?l.ambient:[0,0,0,1],l.emission=d(l.emission)?l.emission:[0,0,0,1],l.transparency=g(l.transparency,1),c!=="CONSTANT"&&(l.diffuse=d(l.diffuse)?l.diffuse:[0,0,0,1],c!=="LAMBERT"&&(l.specular=d(l.specular)?l.specular:[0,0,0,1],l.shininess=g(l.shininess,0))),o.transparent=g(o.transparent,!1),o.doubleSided=g(o.doubleSided,!1);return}n.emissiveFactor=g(n.emissiveFactor,[0,0,0]),n.alphaMode=g(n.alphaMode,"OPAQUE"),n.doubleSided=g(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=g(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;d(r)&&Xe.materialValue(n,function(c){d(c.index)&&Lx(c)}),Lx(n.emissiveTexture),Lx(n.normalTexture),Lx(n.occlusionTexture);let s=n.pbrMetallicRoughness;d(s)&&(s.baseColorFactor=g(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=g(s.metallicFactor,1),s.roughnessFactor=g(s.roughnessFactor,1),Lx(s.baseColorTexture),Lx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;d(a)&&(a.diffuseFactor=g(a.diffuseFactor,[1,1,1,1]),a.specularFactor=g(a.specularFactor,[1,1,1]),a.glossinessFactor=g(a.glossinessFactor,1),Lx(a.specularGlossinessTexture))}),Xe.animation(e,function(n){Xe.animationSampler(n,function(i){i.interpolation=g(i.interpolation,"LINEAR")})});let t=nve(e);return Xe.node(e,function(n,i){d(t[i])||d(n.translation)||d(n.rotation)||d(n.scale)?(n.translation=g(n.translation,[0,0,0]),n.rotation=g(n.rotation,[0,0,0,1]),n.scale=g(n.scale,[1,1,1])):n.matrix=g(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Xe.sampler(e,function(n){n.wrapS=g(n.wrapS,ne.REPEAT),n.wrapT=g(n.wrapT,ne.REPEAT)}),d(e.scenes)&&!d(e.scene)&&(e.scene=0),e}function nve(e){let t={};return Xe.animation(e,function(n){Xe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function Lx(e){d(e)&&(e.texCoord=g(e.texCoord,0))}var PE=tve;var bnn=T(S(),1);function ive(e){return Xe.shader(e,function(t){XM(t)}),Xe.buffer(e,function(t){XM(t)}),Xe.image(e,function(t){XM(t)}),XM(e),e}function XM(e){e.extras=d(e.extras)?e.extras:{},e.extras._pipeline=d(e.extras._pipeline)?e.extras._pipeline:{}}var Eb=ive;var Wnn=T(S(),1);var Cnn=T(S(),1);var xnn=T(S(),1);function ove(e,t){let n=e.extensionsRequired;if(d(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var vE=ove;function rve(e,t){let n=e.extensionsUsed;if(d(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),vE(e,t),n.length===0&&delete e.extensionsUsed}}var Rx=rve;var sve=4;function ave(e){if(ym(e)!=="glTF")throw new me("File is not valid binary glTF");let n=ine(e,0,5),i=n[1];if(i!==1&&i!==2)throw new me("Binary glTF version is not 1 or 2");return i===1?cve(e,n):lve(e,n)}function ine(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*sve,!0);return o}function cve(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new me("Binary glTF scene format is not JSON");let r=20,s=r+i,a=hl(e,r,i),c=JSON.parse(a);Eb(c);let l=e.subarray(s,n),u=c.buffers;if(d(u)&&Object.keys(u).length>0){let m=g(u.binary_glTF,u.KHR_binary_glTF);d(m)&&(m.extras._pipeline.source=l,delete m.uri)}return Rx(c,"KHR_binary_glTF"),c}function lve(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=ine(e,i,2),a=s[0],c=s[1];i+=8;let l=e.subarray(i,i+a);if(i+=a,c===1313821514){let u=hl(l);o=JSON.parse(u),Eb(o)}else c===5130562&&(r=l)}if(d(o)&&d(r)){let s=o.buffers;if(d(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var wE=ave;var Fnn=T(S(),1);function dve(e){return Xe.shader(e,function(t){IM(t)}),Xe.buffer(e,function(t){IM(t)}),Xe.image(e,function(t){IM(t)}),IM(e),e}function IM(e){d(e.extras)&&(d(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var FE=dve;var yon=T(S(),1);var Unn=T(S(),1);function uve(e,t){let n=e.extensionsUsed;d(n)||(n=[],e.extensionsUsed=n),rs(n,t,!0)}var iu=uve;var Qnn=T(S(),1);var Bnn=T(S(),1);function mve(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case Q.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case Q.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case Q.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case Q.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case Q.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case Q.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case Q.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Gp=mve;function hve(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=nd(t.type);if(!d(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],l=c.buffer,m=i[l].extras._pipeline.source,p=t.count,y=yl(e,t),f=t.byteOffset+c.byteOffset+m.byteOffset,x=t.componentType,_=Q.getSizeInBytes(x),C=new DataView(m.buffer),V=new Array(r),L=Gp(x);for(let Z=0;Z<p;Z++){L(C,f,r,_,V);for(let G=0;G<r;G++){let X=V[G];s[G]=Math.min(s[G],X),a[G]=Math.max(a[G],X)}f+=y}return{min:s,max:a}}var Zx=hve;var iin=T(S(),1);var fve=[ne.FUNC_ADD,ne.FUNC_ADD],pve=[ne.ONE,ne.ZERO,ne.ONE,ne.ZERO];function one(e,t){let n=e.enable;return d(n)?n.indexOf(t)>-1:!1}var bve=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function yve(e,t){if(!d(e))return t;for(let n=0;n<4;n++)if(bve.indexOf(e[n])===-1)return t;return e}function gve(e){let t={},n={},i=e.techniques;return d(i)&&(Xe.technique(e,function(o,r){let s=o.states;if(d(s)){let a=n[r]={};if(one(s,ne.BLEND)){a.alphaMode="BLEND";let c=s.functions;d(c)&&(d(c.blendEquationSeparate)||d(c.blendFuncSeparate))&&(t[r]={blendEquation:g(c.blendEquationSeparate,fve),blendFactors:yve(c.blendFuncSeparate,pve)})}one(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(d(e.extensions)||(e.extensions={}),iu(e,"KHR_blend")),Xe.material(e,function(o){if(d(o.technique)){let r=n[o.technique];Xe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];d(s)&&(d(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var AE=gve;var pin=T(S(),1);var cin=T(S(),1);function xve(e,t){let n=e.extensionsRequired;d(n)||(n=[],e.extensionsRequired=n),rs(n,t,!0),iu(e,t)}var ME=xve;function _ve(e){let t=e.techniques,n={},i={},o={};if(d(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Xe.technique(e,function(a,c){let l={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(Xe.techniqueAttribute(a,function(m,p){u=a.parameters[m],l.attributes[p]={semantic:u.semantic}}),Xe.techniqueUniform(a,function(m,p){u=a.parameters[m],l.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},d(n[c])||(n[c]={}),n[c][m]=p}),d(o[a.program]))l.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},y=e.shaders[m.fragmentShader];p.fragmentShader=rs(r.shaders,y,!0);let f=e.shaders[m.vertexShader];p.vertexShader=rs(r.shaders,f,!0),l.program=rs(r.programs,p),o[a.program]=l.program}i[c]=rs(r.techniques,l)}),r.techniques.length>0&&(d(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,iu(e,"KHR_techniques_webgl"),ME(e,"KHR_techniques_webgl"))}return Xe.material(e,function(r){if(d(r.technique)){let s={technique:i[r.technique]};Xe.objectLegacy(r.values,function(a,c){d(s.values)||(s.values={});let l=n[r.technique][c];d(l)&&(s.values[l]=a)}),d(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var NE=_ve;var Zin=T(S(),1);var _in=T(S(),1);function Tve(e,t){tl.typeOf.object("material",e),tl.defined("handler",t);let n=e.pbrMetallicRoughness;if(d(n)){if(d(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(d(r))return r}if(d(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(d(r))return r}}if(d(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(d(o)){if(d(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(d(a))return a}if(d(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(d(a))return a}}let r=e.extensions.KHR_materials_common;if(d(r)&&d(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,l=r.values.specular;if(d(s)&&d(s.index)){let u=t(s.index,s);if(d(u))return u}if(d(a)&&d(a.index)){let u=t(a.index,a);if(d(u))return u}if(d(c)&&d(c.index)){let u=t(c.index,c);if(d(u))return u}if(d(l)&&d(l.index)){let u=t(l.index,l);if(d(u))return u}}}let i=Xe.materialValue(e,function(o){if(d(o.index)){let r=t(o.index,o);if(d(r))return r}});if(d(i))return i;if(d(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(d(r))return r}if(d(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(d(r))return r}if(d(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(d(r))return r}}var MS=Tve;var rne=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function Sve(e,t){return t=g(t,rne),rne.forEach(function(n){t.indexOf(n)>-1&&Vve(e,n)}),e}var Cve={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Vve(e,t){let n=Cve[t],i=e[n];if(d(i)){let o=0,r=Yh[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Bh[t](e,a-o),o++)}}function Bh(){}Bh.accessor=function(e,t){e.accessors.splice(t,1),Xe.mesh(e,function(i){Xe.meshPrimitive(i,function(o){Xe.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Xe.meshPrimitiveTarget(o,function(a){Xe.meshPrimitiveTargetAttribute(a,function(c,l){c>t&&a[l]--})});let r=o.indices;d(r)&&r>t&&o.indices--;let s=o.extensions;d(s)&&d(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Xe.skin(e,function(i){d(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Xe.animation(e,function(i){Xe.animationSampler(i,function(o){d(o.input)&&o.input>t&&o.input--,d(o.output)&&o.output>t&&o.output--})})};Bh.buffer=function(e,t){e.buffers.splice(t,1),Xe.bufferView(e,function(i){d(i.buffer)&&i.buffer>t&&i.buffer--,d(i.extensions)&&d(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Bh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Xe.accessor(e,function(i){d(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Xe.shader(e,function(i){d(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Xe.image(e,function(i){d(i.bufferView)&&i.bufferView>t&&i.bufferView--}),tr(e,"KHR_draco_mesh_compression")&&Xe.mesh(e,function(i){Xe.meshPrimitive(i,function(o){d(o.extensions)&&d(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),tr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(d(a)){for(let c in a)if(a.hasOwnProperty(c)){let l=a[c];d(l.bufferView)&&l.bufferView>t&&l.bufferView--,d(l.arrayOffsetBufferView)&&l.arrayOffsetBufferView>t&&l.arrayOffsetBufferView--,d(l.stringOffsetBufferView)&&l.stringOffsetBufferView>t&&l.stringOffsetBufferView--}}}}if(tr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(d(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let l in c)if(c.hasOwnProperty(l)){let u=c[l];d(u.values)&&u.values>t&&u.values--,d(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,d(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};Bh.image=function(e,t){e.images.splice(t,1),Xe.texture(e,function(i){d(i.source)&&i.source>t&&--i.source;let o=i.extensions;d(o)&&d(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:d(o)&&d(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Bh.mesh=function(e,t){e.meshes.splice(t,1),Xe.node(e,function(i){d(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Bh.node=function(e,t){e.nodes.splice(t,1),Xe.skin(e,function(i){d(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Xe.animation(e,function(i){Xe.animationChannel(i,function(o){d(o.target)&&d(o.target.node)&&o.target.node>t&&o.target.node--})}),Xe.technique(e,function(i){Xe.techniqueUniform(i,function(o){d(o.node)&&o.node>t&&o.node--})}),Xe.node(e,function(i){d(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Xe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Bh.material=function(e,t){e.materials.splice(t,1),Xe.mesh(e,function(i){Xe.meshPrimitive(i,function(o){d(o.material)&&o.material>t&&o.material--})})};Bh.sampler=function(e,t){e.samplers.splice(t,1),Xe.texture(e,function(i){d(i.sampler)&&i.sampler>t&&--i.sampler})};Bh.texture=function(e,t){if(e.textures.splice(t,1),Xe.material(e,function(i){MS(i,function(o,r){r.index>t&&--r.index})}),tr(e,"EXT_feature_metadata")){Xe.mesh(e,function(r){Xe.meshPrimitive(r,function(s){let a=s.extensions;if(d(a)&&d(a.EXT_feature_metadata)){let l=a.EXT_feature_metadata.featureIdTextures;if(d(l)){let u=l.length;for(let m=0;m<u;++m){let y=l[m].featureIds.texture;y.index>t&&--y.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(d(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(tr(e,"EXT_mesh_features")&&Xe.mesh(e,function(i){Xe.meshPrimitive(i,function(o){let r=o.extensions;if(d(r)&&d(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(d(a)){let c=a.length;for(let l=0;l<c;++l){let u=a[l];d(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),tr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(d(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let l in c)if(c.hasOwnProperty(l)){let u=c[l];u.index>t&&--u.index}}}}};function Yh(){}Yh.accessor=function(e){let t={};return Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){Xe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Xe.meshPrimitiveTarget(i,function(r){Xe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;d(o)&&(t[o]=!0)})}),Xe.skin(e,function(n){d(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Xe.animation(e,function(n){Xe.animationSampler(n,function(i){d(i.input)&&(t[i.input]=!0),d(i.output)&&(t[i.output]=!0)})}),tr(e,"EXT_mesh_gpu_instancing")&&Xe.node(e,function(n){d(n.extensions)&&d(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),tr(e,"CESIUM_primitive_outline")&&Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){let o=i.extensions;if(d(o)&&d(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;d(s)&&(t[s]=!0)}})}),t};Yh.buffer=function(e){let t={};return Xe.bufferView(e,function(n){d(n.buffer)&&(t[n.buffer]=!0),d(n.extensions)&&d(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Yh.bufferView=function(e){let t={};if(Xe.accessor(e,function(n){d(n.bufferView)&&(t[n.bufferView]=!0)}),Xe.shader(e,function(n){d(n.bufferView)&&(t[n.bufferView]=!0)}),Xe.image(e,function(n){d(n.bufferView)&&(t[n.bufferView]=!0)}),tr(e,"KHR_draco_mesh_compression")&&Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){d(i.extensions)&&d(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),tr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(d(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];d(c.bufferView)&&(t[c.bufferView]=!0),d(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),d(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(tr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(d(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let l=a[c];d(l.values)&&(t[l.values]=!0),d(l.arrayOffsets)&&(t[l.arrayOffsets]=!0),d(l.stringOffsets)&&(t[l.stringOffsets]=!0)}}}}return t};Yh.image=function(e){let t={};return Xe.texture(e,function(n){d(n.source)&&(t[n.source]=!0),d(n.extensions)&&d(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:d(n.extensions)&&d(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Yh.mesh=function(e){let t={};return Xe.node(e,function(n){if(d(n.mesh&&d(e.meshes))){let i=e.meshes[n.mesh];d(i)&&d(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function sne(e,t,n){let i=e.nodes[t];return d(i.mesh)||d(i.camera)||d(i.skin)||d(i.weights)||d(i.extras)||d(i.extensions)&&Object.keys(i.extensions).length!==0||d(n[t])?!1:!d(i.children)||i.children.filter(function(o){return!sne(e,o,n)}).length===0}Yh.node=function(e){let t={};return Xe.skin(e,function(n){d(n.skeleton)&&(t[n.skeleton]=!0),Xe.skinJoint(n,function(i){t[i]=!0})}),Xe.animation(e,function(n){Xe.animationChannel(n,function(i){d(i.target)&&d(i.target.node)&&(t[i.target.node]=!0)})}),Xe.technique(e,function(n){Xe.techniqueUniform(n,function(i){d(i.node)&&(t[i.node]=!0)})}),Xe.node(e,function(n,i){sne(e,i,t)||(t[i]=!0)}),t};Yh.material=function(e){let t={};return Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){d(i.material)&&(t[i.material]=!0)})}),t};Yh.texture=function(e){let t={};if(Xe.material(e,function(n){MS(n,function(i){t[i]=!0})}),tr(e,"EXT_feature_metadata")){Xe.mesh(e,function(o){Xe.meshPrimitive(o,function(r){let s=r.extensions;if(d(s)&&d(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(d(c)){let l=c.length;for(let u=0;u<l;++u){let p=c[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(d(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a].texture;t[l.index]=!0}}}}if(tr(e,"EXT_mesh_features")&&Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){let o=i.extensions;if(d(o)&&d(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(d(s)){let a=s.length;for(let c=0;c<a;++c){let l=s[c];d(l.texture)&&(t[l.texture.index]=!0)}}}})}),tr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(d(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let l=a[c];t[l.index]=!0}}}}return t};Yh.sampler=function(e){let t={};return Xe.texture(e,function(n){d(n.sampler)&&(t[n.sampler]=!0)}),t};var UE=Sve;var Yin=T(S(),1);var Xin=T(S(),1);function Lve(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:rs(e.buffers,n),byteOffset:0,byteLength:t.length};return rs(e.bufferViews,o)}var kE=Lve;var Ain=T(S(),1);function Rve(e,t){let n=yl(e,t),i=Q.getSizeInBytes(t.componentType),o=nd(t.type),r=t.count,s=new Array(o*r);if(!d(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,l=t.byteOffset+a.byteOffset+c.byteOffset,u=new DataView(c.buffer),m=new Array(o),p=Gp(t.componentType);for(let y=0;y<r;++y){p(u,l,o,i,m);for(let f=0;f<o;++f)s[y*o+f]=m[f];l+=n}return s}var DE=Rve;function Zve(e){let t;return Xe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?WM(e,i,Q.UNSIGNED_BYTE):t!==ne.UNSIGNED_BYTE&&t!==ne.UNSIGNED_SHORT&&WM(e,i,Q.UNSIGNED_SHORT)}),Xe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?WM(e,i,Q.UNSIGNED_BYTE):t===ne.SHORT&&WM(e,i,Q.UNSIGNED_SHORT)}),e}function WM(e,t,n){let i=Q.createTypedArray(n,DE(e,t)),o=new Uint8Array(i.buffer);t.bufferView=kE(e,o),t.componentType=n,t.byteOffset=0}var BE=Zve;var Jin=T(S(),1);function Gve(e,t){return Rx(e,t),t==="CESIUM_RTC"&&Eve(e),ZY(e,t)}function Eve(e){Xe.technique(e,function(t){Xe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function ZY(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)ZY(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;d(n)&&(i=n[t],d(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&ZY(e[o],t);return i}}var Gx=Gve;var PM={.8:wve,"1.0":nwe,"2.0":void 0};function Xve(e,t){t=g(t,g.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=g(e.asset,{version:"1.0"}),e.asset.version=g(e.asset.version,"1.0"),i=g(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(PM,i)||(d(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(PM,i)||(i="1.0"));let o=PM[i];for(;d(o)&&i!==n;)o(e,t),i=e.asset.version,o=PM[i];return t.keepLegacyExtensions||(rwe(e,t),swe(e)),e}function cne(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;d(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function Ive(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(d(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=g(a.primitive,ne.TRIANGLES);a.mode=g(a.mode,c),delete a.primitive}}}}function Wve(e){let t=e.nodes,n=new h,i=new Ae;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(d(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Ae.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;d(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function Pve(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Ae;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let l=t[c],u=l.channels,m=l.parameters,p=l.samplers;if(d(u)){let y=u.length;for(let f=0;f<y;++f){let x=u[f];if(x.target.path==="rotation"){let _=m[p[x.sampler].output];if(d(r[_]))continue;r[_]=!0;let C=n[_],V=i[C.bufferView],Z=o[V.buffer].extras._pipeline.source,G=Z.byteOffset+V.byteOffset+C.byteOffset,X=C.componentType,P=C.count,v=nd(C.type),A=C.count*v,M=Q.createArrayBufferView(X,Z.buffer,G,A);for(let b=0;b<P;b++){let R=b*v;h.unpack(M,R,s);let E=M[R+3];Ae.fromAxisAngle(s,E,a),Ae.pack(a,M,R)}}}}}}function vve(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(d(o)){let r=g(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=g(i.attributes,a.attributes),i.program=g(i.program,a.program),i.uniforms=g(i.uniforms,a.uniforms),i.states=g(i.states,s.states)}delete i.passes,delete i.pass}}}function wve(e){d(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(d(e.version)&&delete e.version,cne(e),Ive(e),Wve(e),Pve(e),vve(e),d(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),d(e.lights)){let n=g(e.extensions,{});e.extensions=n;let i=g(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,iu(e,"KHR_materials_common")}}function Fve(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(d(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function ane(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),d(o.name)||(o.name=i)}return n}function Ave(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,d(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&d(n[s])){let a={},c=e[s];e[s]=ane(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);d(e.scene)&&(e.scene=n.scenes[e.scene]),Xe.bufferView(e,function(s){d(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Xe.accessor(e,function(s){d(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Xe.shader(e,function(s){let a=s.extensions;if(d(a)){let c=a.KHR_binary_glTF;d(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Xe.program(e,function(s){d(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),d(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Xe.technique(e,function(s){d(s.program)&&(s.program=n.programs[s.program]),Xe.techniqueParameter(s,function(a){d(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Xe.mesh(e,function(s){Xe.meshPrimitive(s,function(a){d(a.indices)&&(a.indices=n.accessors[a.indices]),Xe.meshPrimitiveAttribute(a,function(c,l){a.attributes[l]=n.accessors[c]}),d(a.material)&&(a.material=n.materials[a.material])})}),Xe.node(e,function(s){let a=s.children;if(d(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(d(s.meshes)){let c=s.meshes,l=c.length;if(l>0)for(s.mesh=n.meshes[c[0]],t=1;t<l;++t){let u={mesh:n.meshes[c[t]]},m=rs(e.nodes,u);d(a)||(a=[],s.children=a),a.push(m)}delete s.meshes}if(d(s.camera)&&(s.camera=n.cameras[s.camera]),d(s.skin)&&(s.skin=n.skins[s.skin]),d(s.skeletons)){let c=s.skeletons;if(c.length>0&&d(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}d(s.jointName)&&delete s.jointName}),Xe.skin(e,function(s){d(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(d(a)){let c=[],l=a.length;for(t=0;t<l;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Xe.scene(e,function(s){let a=s.nodes;if(d(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Xe.animation(e,function(s){let a={};s.samplers=ane(s.samplers,a),Xe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Xe.animationChannel(s,function(c){c.sampler=a[c.sampler];let l=c.target;d(l)&&(l.node=n.nodes[l.id],delete l.id)})}),Xe.material(e,function(s){d(s.technique)&&(s.technique=n.techniques[s.technique]),Xe.materialValue(s,function(c,l){typeof c=="string"&&(s.values[l]={index:n.textures[c]})});let a=s.extensions;if(d(a)){let c=a.KHR_materials_common;d(c)&&d(c.values)&&Xe.materialValue(c,function(l,u){typeof l=="string"&&(c.values[u]={index:n.textures[l]})})}}),Xe.image(e,function(s){let a=s.extensions;if(d(a)){let c=a.KHR_binary_glTF;d(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Xe.texture(e,function(s){d(s.sampler)&&(s.sampler=n.samplers[s.sampler]),d(s.source)&&(s.source=n.images[s.source])})}function Mve(e){Xe.animation(e,function(t){Xe.animationSampler(t,function(n){delete n.name})})}function Nve(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Xe.node(e,function(t){d(t.children)&&t.children.length===0&&delete t.children})}function Uve(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var kve={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function Dve(e){let t=e.extensionsUsed;if(e.extensionsRequired=g(e.extensionsRequired,[]),d(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];d(kve[o])&&e.extensionsRequired.push(o)}}}function Bve(e){Xe.buffer(e,function(t){delete t.type})}function Yve(e){Xe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Ove(e){Xe.mesh(e,function(t){Xe.meshPrimitive(t,function(n){Xe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Xe.technique(e,function(t){Xe.techniqueParameter(t,function(n){let i=n.semantic;d(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Kve={POSITION:!0,NORMAL:!0,TANGENT:!0},Hve={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function zve(e){let t={};Xe.mesh(e,function(n){Xe.meshPrimitive(n,function(i){Xe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let l,u=Hve[a];d(u)?(l=u+c,t[r]=l):d(Kve[a])||(l=`_${r}`,t[r]=l)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];d(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Xe.technique(e,function(n){Xe.techniqueParameter(n,function(i){let o=t[i.semantic];d(o)&&(i.semantic=o)})})}function Jve(e){Xe.camera(e,function(t){let n=t.perspective;if(d(n)){let i=n.aspectRatio;d(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;d(o)&&o===0&&(n.yfov=1)}})}function GY(e,t){return d(t.byteStride)&&t.byteStride!==0?t.byteStride:yl(e,t)}function Qve(e){Xe.buffer(e,function(t){d(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Xe.accessor(e,function(t){let n=t.bufferView;if(d(n)){let i=e.bufferViews[n],o=GY(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(g(i.byteLength,0),r)}})}function jve(e){let t,n,i,o=e.bufferViews,r={};Xe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];d(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Xe.accessor(e,function(a){d(a.bufferView)&&(s[a.bufferView]=g(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,y){return p.byteOffset-y.byteOffset});let l=0,u=0,m=c.length;for(t=0;t<m;++t){let p=c[t],y=GY(e,p),f=p.byteOffset,x=p.count*y;delete p.byteStride;let _=t<m-1,C=_?GY(e,c[t+1]):void 0;if(y!==C){let V=Oe(i,!0);r[a]&&(V.byteStride=y),V.byteOffset+=l,V.byteLength=f+x-l;let L=rs(o,V);for(n=u;n<=t;++n)p=c[n],p.bufferView=L,p.byteOffset=p.byteOffset-l;l=_?c[t+1].byteOffset:void 0,u=t+1}}}UE(e,["accessor","bufferView","buffer"])}function qve(e){Xe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!d(n.min)||!d(n.max)){let i=Zx(e,n);n.min=i.min,n.max=i.max}})}function lne(e){return(!d(e.children)||e.children.length===0)&&(!d(e.meshes)||e.meshes.length===0)&&!d(e.camera)&&!d(e.skin)&&!d(e.skeletons)&&!d(e.jointName)&&(!d(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!d(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!d(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!d(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!d(e.extensions)&&!d(e.extras)}function dne(e,t){Xe.scene(e,function(n){let i=n.nodes;if(d(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Xe.node(e,function(n,i){if(d(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),lne(n)&&dne(e,i))}}),delete e.nodes[t]}function $ve(e){return Xe.node(e,function(t,n){lne(t)&&dne(e,n)}),e}function ewe(e){Xe.animation(e,function(t){Xe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!d(i.min)||!d(i.max)){let o=Zx(e,i);i.min=o.min,i.max=o.max}})})}function twe(e){Xe.accessor(e,function(t){if(d(t.min)||d(t.max)){let n=Zx(e,t);d(t.min)&&(t.min=n.min),d(t.max)&&(t.max=n.max)}})}function nwe(e){e.asset=g(e.asset,{}),e.asset.version="2.0",cne(e),Fve(e),$ve(e),Ave(e),Mve(e),Uve(e),Dve(e),Qve(e),jve(e),qve(e),ewe(e),twe(e),Bve(e),Yve(e),Ove(e),zve(e),BE(e),Jve(e),AE(e),NE(e),Nve(e)}var iwe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],owe=["u_diffuse","u_diffuse_mat"];function EY(e){e.pbrMetallicRoughness=d(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function vM(e){return d(e.index)}function wM(e){return Array.isArray(e)&&e.length===4}function une(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function rwe(e,t){t=g(t,g.EMPTY_OBJECT);let n=g(t.baseColorTextureNames,iwe),i=g(t.baseColorFactorNames,owe);Xe.material(e,function(o){Xe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&vM(r)?(EY(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&wM(r)&&(EY(o),o.pbrMetallicRoughness.baseColorFactor=une(r))})}),Gx(e,"KHR_techniques_webgl"),Gx(e,"KHR_blend")}function swe(e){Xe.material(e,function(t){let n=g(t.extensions,g.EMPTY_OBJECT).KHR_materials_common;if(d(n)){n.technique==="CONSTANT"&&(iu(e,"KHR_materials_unlit"),t.extensions=d(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=d(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,l=n.doubleSided,u=n.transparent;EY(t),d(r)&&(wM(r)?t.emissiveFactor=r.slice(0,3):vM(r)&&(t.emissiveTexture=r)),d(s)&&(wM(s)?t.pbrMetallicRoughness.baseColorFactor=une(s):vM(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),d(l)&&(t.doubleSided=l),d(a)&&(wM(a)?t.emissiveFactor=a.slice(0,3):vM(a)&&(t.emissiveTexture=a)),d(c)&&(d(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),d(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}}),Gx(e,"KHR_materials_common")}var YE=Xve;var Pon=T(S(),1);var _on=T(S(),1);var si={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function awe(e){switch(e){case si.POSITION:return"positionMC";case si.NORMAL:return"normalMC";case si.TANGENT:return"tangentMC";case si.TEXCOORD:return"texCoord";case si.COLOR:return"color";case si.JOINTS:return"joints";case si.WEIGHTS:return"weights";case si.FEATURE_ID:return"featureId"}}si.hasSetIndex=function(e){switch(e){case si.POSITION:case si.NORMAL:case si.TANGENT:return!1;case si.TEXCOORD:case si.COLOR:case si.JOINTS:case si.WEIGHTS:case si.FEATURE_ID:return!0}};si.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return si.POSITION;case"NORMAL":return si.NORMAL;case"TANGENT":return si.TANGENT;case"TEXCOORD":return si.TEXCOORD;case"COLOR":return si.COLOR;case"JOINTS":return si.JOINTS;case"WEIGHTS":return si.WEIGHTS;case"_FEATURE_ID":return si.FEATURE_ID}};si.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return si.POSITION;case"RGBA":case"RGB":case"RGB565":return si.COLOR;case"NORMAL":case"NORMAL_OCT16P":return si.NORMAL;case"BATCH_ID":return si.FEATURE_ID}};si.getGlslType=function(e){switch(e){case si.POSITION:case si.NORMAL:case si.TANGENT:return"vec3";case si.TEXCOORD:return"vec2";case si.COLOR:return"vec4";case si.JOINTS:return"ivec4";case si.WEIGHTS:return"vec4";case si.FEATURE_ID:return"int"}};si.getVariableName=function(e,t){let n=awe(e);return d(t)&&(n+=`_${t}`),n};var Ct=Object.freeze(si);function Oa(){}Oa.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;d(n)&&d(n.message)&&(i+=`
${n.message}`);let o=new me(i);return d(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};Oa.getNodeTransform=function(e){return d(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(d(e.translation)?e.translation:h.ZERO,d(e.rotation)?e.rotation:Ae.IDENTITY,d(e.scale)?e.scale:h.ONE)};Oa.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=d(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Oa.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};Oa.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Oa.hasQuantizedAttributes=function(e){if(!d(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(d(n.quantization))return!0}return!1};Oa.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;d(t)?(i=Ct.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=an.getGlslType(s);r&&(a="vec4");let c=d(e.quantization),l;return c&&(l=r?"vec4":an.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:l}};var cwe=new h,lwe=new h;Oa.getPositionMinMax=function(e,t,n){let i=Oa.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return d(n)&&d(t)&&(r=h.add(r,t,lwe),o=h.add(o,n,cwe)),{min:r,max:o}};Oa.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===Zo.Y?n=F.clone(Zo.Y_UP_TO_Z_UP,n):e===Zo.X&&(n=F.clone(Zo.X_UP_TO_Z_UP,n)),t===Zo.Z&&(n=F.multiplyTransformation(n,Zo.Z_UP_TO_X_UP,n)),n};var dwe=new $;Oa.getCullFace=function(e,t){if(!Fe.isTriangles(t))return yi.BACK;let n=F.getMatrix3(e,dwe);return $.determinant(n)<0?yi.FRONT:yi.BACK};Oa.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Oa.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Oa.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Oa.supportedExtensions[i])throw new me(`Unsupported glTF Extension: ${i}`)}};var nn=Oa;function Xb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Xb.prototype=Object.create(oo.prototype),Xb.prototype.constructor=Xb);Object.defineProperties(Xb.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Xb.prototype.load=async function(){return d(this._promise)?this._promise:(this._state=Rt.LOADING,d(this._gltfJson)?(this._promise=mne(this,this._gltfJson),this._promise):d(this._typedArray)?(this._promise=hne(this,this._typedArray),this._promise):(this._promise=uwe(this),this._promise))};async function uwe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;XY(e,n)}return hne(e,t)}function XY(e,t){e.unload(),e._state=Rt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function mwe(e,t){if(d(t.asset)&&t.asset.version==="2.0"&&!tr(t,"KHR_techniques_webgl")&&!tr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Xe.buffer(t,function(i){if(!d(i.extras._pipeline.source)&&d(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),YE(t)}function hwe(e){let t=[];return Xe.buffer(e,function(n){let i=n.uri;!d(n.extras._pipeline.source)&&d(i)&&jf(i)&&(delete n.uri,t.push(Ee.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function fwe(e,t){let n=[];return Xe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(d(r)&&!d(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function mne(e,t){try{Eb(t),await hwe(t),await mwe(e,t),PE(t),await fwe(e,t),FE(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new me(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return d(i)&&nn.checkSupportedExtensions(i),e._gltf=t,e._state=Rt.READY,e}catch(n){if(e.isDestroyed())return;XY(e,n)}}async function hne(e,t){let n;try{ym(t)==="glTF"?n=wE(t):n=Go(t)}catch(i){if(e.isDestroyed())return;XY(e,i)}return mne(e,n)}Xb.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Xb.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var NS=Xb;var wrn=T(S(),1);var grn=T(S(),1);var arn=T(S(),1);var ern=T(S(),1),pwe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Oh=Object.freeze(pwe);var Ko={};function bwe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function ywe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function gwe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function xwe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function _we(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function Twe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function Swe(){this.attributes=[]}function Cwe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function Vwe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function Lwe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function Rwe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function Zwe(){this.nodes=[]}var Gwe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function Ewe(){this.input=[],this.interpolation=void 0,this.output=[]}function Xwe(){this.node=void 0,this.path=void 0}function Iwe(){this.sampler=void 0,this.target=void 0}function Wwe(){this.name=void 0,this.samplers=[],this.channels=[]}function Pwe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function vwe(){this.name=void 0,this.stages=[]}function fne(){this.credits=[]}function wwe(){this.asset=new fne,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY)}function Fwe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.channels=void 0}function Ib(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Ib.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Ib.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Ib.DEFAULT_ROUGHNESS_FACTOR}Ib.DEFAULT_BASE_COLOR_FACTOR=se.ONE;Ib.DEFAULT_METALLIC_FACTOR=1;Ib.DEFAULT_ROUGHNESS_FACTOR=1;function Ex(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(Ex.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(Ex.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=Ex.DEFAULT_GLOSSINESS_FACTOR}Ex.DEFAULT_DIFFUSE_FACTOR=se.ONE;Ex.DEFAULT_SPECULAR_FACTOR=h.ONE;Ex.DEFAULT_GLOSSINESS_FACTOR=1;function IY(){this.metallicRoughness=new Ib,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(IY.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Oh.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}IY.DEFAULT_EMISSIVE_FACTOR=h.ZERO;Ko.Quantization=bwe;Ko.Attribute=ywe;Ko.Indices=gwe;Ko.FeatureIdAttribute=xwe;Ko.FeatureIdTexture=Twe;Ko.FeatureIdImplicitRange=_we;Ko.MorphTarget=Swe;Ko.Primitive=Cwe;Ko.Instances=Vwe;Ko.Skin=Lwe;Ko.Node=Rwe;Ko.Scene=Zwe;Ko.AnimatedPropertyType=Object.freeze(Gwe);Ko.AnimationSampler=Ewe;Ko.AnimationTarget=Xwe;Ko.AnimationChannel=Iwe;Ko.Animation=Wwe;Ko.ArticulationStage=Pwe;Ko.Articulation=vwe;Ko.Asset=fne;Ko.Components=wwe;Ko.TextureReader=Fwe;Ko.MetallicRoughness=Ib;Ko.SpecularGlossiness=Ex;Ko.Material=IY;var wt=Ko;var FM={};FM.getImageIdFromTexture=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,o=t.textures[n],r=o.extensions;if(d(r)){if(i.webp&&d(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&d(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};FM.createSampler=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=g(e.compressedTextureNoMipmap,!1),o=Gn.REPEAT,r=Gn.REPEAT,s=cn.LINEAR,a=Ti.LINEAR,c=n.index,u=t.textures[c].sampler;if(d(u)){let m=t.samplers[u];o=g(m.wrapS,o),r=g(m.wrapT,r),s=g(m.minFilter,s),a=g(m.magFilter,a)}return i&&s!==cn.LINEAR&&s!==cn.NEAREST&&(s===cn.NEAREST_MIPMAP_NEAREST||s===cn.NEAREST_MIPMAP_LINEAR?s=cn.NEAREST:s=cn.LINEAR),new dn({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var Awe=new D(1,1);FM.createModelTextureReader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,o=g(t.texCoord,0),r,s=g(t.extensions,g.EMPTY_OBJECT).KHR_texture_transform;if(d(s)){o=g(s.texCoord,o);let c=d(s.offset)?D.unpack(s.offset):D.ZERO,l=g(s.rotation,0),u=d(s.scale)?D.unpack(s.scale):Awe;l=-l,r=new $(Math.cos(l)*u.x,-Math.sin(l)*u.y,c.x,Math.sin(l)*u.x,Math.cos(l)*u.y,c.y,0,0,1)}let a=new wt.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.transform=r,a.channels=n,a};var gl=FM;var Trn=T(S(),1);function Mwe(e){let t=document.createElement("canvas");return t.width=W.nextPowerOfTwo(e.width),t.height=W.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Wb=Mwe;function Pb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=g(e.asynchronous,!0),l=i.index,u=gl.getImageIdFromTexture({gltf:n,textureId:l,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Pb.prototype=Object.create(oo.prototype),Pb.prototype.constructor=Pb);Object.defineProperties(Pb.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var Nwe=new WY;async function Uwe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=Rt.LOADED,e)}catch(n){if(e.isDestroyed())return;e.unload(),e._state=Rt.FAILED;let i="Failed to load texture";throw e.getError(i,n)}}Pb.prototype.load=async function(){return d(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=Uwe(this),this._promise)};function WY(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}WY.prototype.set=function(e,t,n,i,o){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=o};WY.prototype.execute=function(){this.texture=pne(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function pne(e,t,n,i,o){let r=n.internalFormat,s=!1;st.isCompressedFormat(r)&&!d(i)&&(s=!0);let a=gl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,l=a.wrapS,u=a.wrapT,m=c===cn.NEAREST_MIPMAP_NEAREST||c===cn.NEAREST_MIPMAP_LINEAR||c===cn.LINEAR_MIPMAP_NEAREST||c===cn.LINEAR_MIPMAP_LINEAR,p=!d(r)&&m,y=p||l===Gn.REPEAT||l===Gn.MIRRORED_REPEAT||u===Gn.REPEAT||u===Gn.MIRRORED_REPEAT,f=!W.isPowerOfTwo(n.width)||!W.isPowerOfTwo(n.height),x=y&&f,_;return d(r)?(!o.webgl2&&st.isCompressedFormat(r)&&f&&y&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),_=Wt.create({context:o,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=Wb(n)),_=Wt.create({context:o,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&_.generateMipmap(),_}Pb.prototype.process=function(e){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED&&this._state!==Rt.PROCESSING||d(this._texture)||!d(this._image))return!1;this._state=Rt.PROCESSING;let t;if(this._asynchronous){let n=Nwe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,ba.TEXTURE))return;t=n.texture}else t=pne(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=Rt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Pb.prototype.unload=function(){d(this._texture)&&this._texture.destroy(),d(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var US=Pb;var Krn=T(S(),1);function vb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,l=e.cacheKey,u=g(e.asynchronous,!0),m=g(e.loadBuffer,!1),p=g(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=l,this._asynchronous=u,this._loadBuffer=m,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(vb.prototype=Object.create(oo.prototype),vb.prototype.constructor=vb);Object.defineProperties(vb.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function kwe(e,t){return d(e)&&d(e.attributes)&&d(e.attributes[t])}vb.prototype.load=async function(){return d(this._promise)?this._promise:kwe(this._draco,this._attributeSemantic)?(this._promise=Bwe(this),this._promise):(this._promise=Owe(this),this._promise)};function Dwe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new wt.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=an.VEC2,a.normalizationRange=r;else{let c=an.getMathType(i);if(c===Number){let l=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=l,a.normalizationRange=r,a.quantizedVolumeStepSize=l*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let l=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(l);let u=l.map(function(m){return m*s});a.quantizedVolumeStepSize=c.unpack(u)}}return a}async function Bwe(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Rt.LOADED,e)}catch{if(e.isDestroyed())return;PY(e)}}function Ywe(e){e._state=Rt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,l=o.data.quantization;d(l)&&(e._quantization=Dwe(l,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function Owe(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;PY(e,n)}}function PY(e,t){e.unload(),e._state=Rt.FAILED;let n="Failed to load vertex buffer";throw e.getError(n,t)}function vY(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}vY.prototype.set=function(e,t){this.typedArray=e,this.context=t};vY.prototype.execute=function(){this.buffer=bne(this.typedArray,this.context)};function bne(e,t){let n=mt.createVertexBuffer({typedArray:e,context:t,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var Kwe=new vY;vb.prototype.process=function(e){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED&&this._state!==Rt.PROCESSING)return!1;if(d(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){PY(this,i)}Ywe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=Kwe;if(i.set(n,e.context),!e.jobScheduler.execute(i,ba.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=bne(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=Rt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};vb.prototype.unload=function(){d(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;d(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),d(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var kS=vb;var Ssn=T(S(),1);var psn=T(S(),1);var qrn=T(S(),1);function OE(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=g(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];d(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Oe(e.extras,!0),this._extensions=Oe(e.extensions,!0)}OE.fromJson=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Lb.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new OE({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(OE.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});OE.BATCH_TABLE_CLASS_NAME="_batchTable";var Tm=OE;var csn=T(S(),1);var nsn=T(S(),1);function AM(e){e=g(e,g.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Oe(e.extras,!0),this._extensions=Oe(e.extensions,!0)}AM.fromJson=function(e){return new AM({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(AM.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var KE=AM;function MM(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=g(e.valueType,tn.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Oe(e.extras,!0),this._extensions=Oe(e.extensions,!0)}MM.fromJson=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return KE.fromJson(o)});return new MM({id:t,values:i,valueType:tn[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(MM.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var HE=MM;function NM(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.classes,{}),n=g(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Oe(e.extras,!0),this._extensions=Oe(e.extensions,!0)}NM.fromJson=function(e){let t={};if(d(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=HE.fromJson({id:i,enum:e.enums[i]}));let n={};if(d(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Tm.fromJson({id:i,class:e.classes[i],enums:t}));return new NM({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(NM.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Sm=NM;function Xx(e){e=g(e,g.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=d(t)?Sm.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(Xx.prototype=Object.create(oo.prototype),Xx.prototype.constructor=Xx);Object.defineProperties(Xx.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});Xx.prototype.load=async function(){return d(this._promise)?this._promise:d(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=Hwe(this),this._promise)};async function Hwe(e){let t=e._resource;e._state=Rt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Sm.fromJson(n),e._state=Rt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Rt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}Xx.prototype.unload=function(){this._schema=void 0};var DS=Xx;var Esn=T(S(),1);var Cm={};function zE(e){return Zh(e.url)}function UM(e){let t=e.byteOffset,n=e.byteLength;if(ri(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=g(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function zwe(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,o=e.type,r=e.count;return`${n}-${i}-${o}-${r}`}function yne(e){return zE(e)}function gne(e,t){return`${zE(e)}-buffer-id-${t}`}function JE(e,t,n,i){if(d(e.uri)){let o=i.getDerivedResource({url:e.uri});return yne(o)}return gne(n,t)}function wY(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=JE(a,s,n,i),l=UM(r);return`${c}-range-${l}`}function xne(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(d(s)){let p=i.getDerivedResource({url:s});return zE(p)}let a=e.bufferViews[r],c=a.buffer,l=e.buffers[c],u=JE(l,c,n,i),m=UM(a);return`${u}-range-${m}`}function Jwe(e,t){let n=gl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Cm.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return d(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${zE(n)}`};Cm.getExternalBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${yne(t)}`};Cm.getEmbeddedBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${gne(t,n)}`};Cm.getGltfCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${zE(t)}`};Cm.getBufferViewCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,o=e.baseResource,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ri(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=JE(a,s,i,o),l=UM(r);return`buffer-view:${c}-range-${l}`};Cm.getDracoCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,o=e.baseResource;return`draco:${wY(t,n,i,o)}`};Cm.getVertexBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,o=e.frameState,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=g(e.dequantize,!1),l=g(e.loadBuffer,!1),u=g(e.loadTypedArray,!1),m="";if(c&&(m+="-dequantize"),l&&(m+="-buffer",m+=`-context-${o.context.id}`),u&&(m+="-typed-array"),d(s))return`vertex-buffer:${wY(t,s,n,i)}-draco-${a}${m}`;let p=t.bufferViews[r],y=p.buffer,f=t.buffers[y],x=JE(f,y,n,i),_=UM(p);return`vertex-buffer:${x}-range-${_}${m}`};Cm.getIndexBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,o=e.baseResource,r=e.frameState,s=e.draco,a=g(e.loadBuffer,!1),c=g(e.loadTypedArray,!1),l="";if(a&&(l+="-buffer",l+=`-context-${r.context.id}`),c&&(l+="-typed-array"),d(s))return`index-buffer:${wY(t,s,i,o)}-draco${l}`;let u=t.accessors[n],m=u.bufferView,p=t.bufferViews[m],y=p.buffer,f=t.buffers[y],x=JE(f,y,i,o),_=zwe(u,p);return`index-buffer:${x}-accessor-${_}${l}`};Cm.getImageCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,o=e.baseResource;return`image:${xne(t,n,i,o)}`};Cm.getTextureCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=n.index,c=gl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),l=xne(t,c,i,o),u=Jwe(t,n);return`texture:${l}-sampler-${u}-context-${s.context.id}`};var xl=Cm;var Wsn=T(S(),1);function QE(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}QE.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};QE.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;d(n)&&(o+=n.sizeInBytes),d(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};QE.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};QE.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],d(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],d(i)&&(this.texturesByteLength-=i)};var jE=QE;function Fn(){}Fn.cacheEntries={};Fn.statistics=new jE;function Qwe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Fn.get=function(e){let t=Fn.cacheEntries[e];if(d(t))return++t.referenceCount,t.resourceLoader};Fn.add=function(e){let t=e.cacheKey;return Fn.cacheEntries[t]=new Qwe(e),e};Fn.unload=function(e){let t=e.cacheKey,n=Fn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Fn.statistics.removeLoader(e),e.destroy(),delete Fn.cacheEntries[t])};Fn.getSchemaLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=xl.getSchemaCacheKey({schema:t,resource:n}),o=Fn.get(i);return d(o)?o:(o=new DS({schema:t,resource:n,cacheKey:i}),Fn.add(o))};Fn.getEmbeddedBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,o=xl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Fn.get(o);return d(r)?r:(r=new Sx({typedArray:i,cacheKey:o}),Fn.add(r))};Fn.getExternalBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.resource,n=xl.getExternalBufferCacheKey({resource:t}),i=Fn.get(n);return d(i)?i:(i=new Sx({resource:t,cacheKey:n}),Fn.add(i))};Fn.getGltfJsonLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,o=e.gltfJson,r=xl.getGltfCacheKey({gltfResource:t}),s=Fn.get(r);return d(s)?s:(s=new NS({resourceCache:Fn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Fn.add(s))};Fn.getBufferViewLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,o=e.baseResource,r=xl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Fn.get(r);return d(s)?s:(s=new vS({resourceCache:Fn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(s))};Fn.getDracoLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,o=e.baseResource,r=xl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Fn.get(r);return d(s)?s:(s=new wS({resourceCache:Fn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(s))};Fn.getVertexBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,o=e.frameState,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,l=g(e.asynchronous,!0),u=g(e.dequantize,!1),m=g(e.loadBuffer,!1),p=g(e.loadTypedArray,!1),y=xl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:u,loadBuffer:m,loadTypedArray:p}),f=Fn.get(y);return d(f)?f:(f=new kS({resourceCache:Fn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:y,asynchronous:l,dequantize:u,loadBuffer:m,loadTypedArray:p}),Fn.add(f))};Fn.getIndexBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,o=e.baseResource,r=e.frameState,s=e.draco,a=g(e.asynchronous,!0),c=g(e.loadBuffer,!1),l=g(e.loadTypedArray,!1),u=xl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:l}),m=Fn.get(u);return d(m)?m:(m=new AS({resourceCache:Fn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:u,asynchronous:a,loadBuffer:c,loadTypedArray:l}),Fn.add(m))};Fn.getImageLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,o=e.baseResource,r=xl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Fn.get(r);return d(s)?s:(s=new FS({resourceCache:Fn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(s))};Fn.getTextureLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=g(e.asynchronous,!0),c=xl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),l=Fn.get(c);return d(l)?l:(l=new US({resourceCache:Fn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Fn.add(l))};Fn.clearForSpecs=function(){let e=[kS,AS,wS,US,FS,vS,Sx,DS,NS],t,n=Fn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,d(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Fn.statistics.clear()};var Bi=Fn;function Os(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Os.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});Os.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Os.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Os.prototype.contentIsAvailableAtIndex=function(e,t){return t=g(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};Os.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Os.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Os.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Os.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Os.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Mr.OCTREE&&(t=3),e>>t};Os.fromSubtreeJson=async function(e,t,n,i,o){let r=new Os(e,i,o),s;d(t)?s={json:t,binary:void 0}:s=jwe(n);let a=s.json;r._subtreeJson=a;let c;if(ri(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(d(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let l=[];if(d(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L<V;L++){let Z=a.contentMetadata[L];l.push(a.propertyTables[Z])}}let u,m=i.metadataSchema,p=a.subtreeMetadata;if(d(p)){let V=p.class,L=m.classes[V];u=new XE({subtreeMetadata:p,class:L})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=l;let y={constant:0};a.contentAvailabilityHeaders=[],ri(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(g(a.contentAvailability,y));let f=qwe(a.buffers),x=$we(a.bufferViews,f);eFe(a,x),d(c)&&_ne(c,x);for(let V=0;V<l.length;V++){let L=l[V];_ne(L,x)}let _=await tFe(r,f,s.binary),C=iFe(x,_);return oFe(r,a,i,C),d(c)&&(rFe(r,i,C),aFe(r)),sFe(r,i,C),cFe(r),r._ready=!0,r};function jwe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Go(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function qwe(e){e=d(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=d(n.uri),n.isActive=!1}return e}function $we(e,t){e=d(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function eFe(e,t){let n,i=e.tileAvailability;d(i.bitstream)?n=t[i.bitstream]:d(i.bufferView)&&(n=t[i.bufferView]),d(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,d(o[s].bitstream)?n=t[o[s].bitstream]:d(o[s].bufferView)&&(n=t[o[s].bufferView]),d(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;d(r.bitstream)?n=t[r.bitstream]:d(r.bufferView)&&(n=t[r.bufferView]),d(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function _ne(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=g(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=g(r.stringOffsets,r.stringOffsetBufferView);d(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=g(r.arrayOffsets,r.arrayOffsetBufferView);d(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function tFe(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=nFe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];d(a)&&(r[s]=a)}return r})}async function nFe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Bi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function iFe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function oFe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ri(t,"3DTILES_metadata"),l=d(e._tilePropertyTableJson),u=c||l;e._tileAvailability=FY(t.tileAvailability,i,s,u);let m=e._contentPropertyTableJsons.length>0;u=u||m;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let y=FY(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(y)}e._childSubtreeAvailability=FY(t.childSubtreeAvailability,i,a)}function FY(e,t,n,i){if(d(e.constant))return new WS({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return d(e.bitstream)?o=t[e.bitstream]:d(e.bufferView)&&(o=t[e.bufferView]),new WS({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function rFe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new bl({class:a,count:o,properties:i.properties,bufferViews:n})}function sFe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,m=c.class,p=r.classes[m],y=new bl({class:p,count:u,properties:c.properties,bufferViews:n});s.push(y)}}function Tne(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function aFe(e){let t=Tne(e._tileAvailability);e._tileJumpBuffer=t}function cFe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Tne(o);t.push(r)}}Os.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new me("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Os.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new me("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function lFe(e,t){if(!d(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function dFe(e,t,n){let i=e._contentMetadataTables;if(!d(i))return;let o=i[n];if(!d(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}Os.prototype.getTileMetadataView=function(e){let t=lFe(this,e);if(!d(t))return;let n=this._tileMetadataTable;return new PS({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Os.prototype.getContentMetadataView=function(e,t){let n=dFe(this,e,t);if(!d(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new PS({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};Os.prototype.isDestroyed=function(){return!1};Os.prototype.destroy=function(){return d(this._bufferLoader)&&Bi.unload(this._bufferLoader),ue(this)};var Ix=Os;var lan=T(S(),1),uFe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},Wx=Object.freeze(uFe);var man=T(S(),1);var Vm={};Vm.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Vm.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Vm._parseMinimumHeight("TILE",e),maximumHeight:Vm._parseMaximumHeight("TILE",e)},content:{boundingVolume:Vm.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Vm._parseMinimumHeight("CONTENT",e),maximumHeight:Vm._parseMaximumHeight("CONTENT",e)}}};Vm.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(d(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(d(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(d(a))return{sphere:a}};Vm._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Vm._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var Px=Vm;function _l(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(_l.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});_l.fromSubtreeJson=async function(e,t,n,i,o,r){r=g(r,0);let s;d(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,l=await Ix.fromSubtreeJson(n,i,s,a,c),u=new _l(e,t,n);return u._implicitSubtree=l,mFe(u,l),u._ready=!0,u};function mFe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=fFe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=hFe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],l=c.tile,u=CFe(e,l,c.childIndex);l.children.push(u),r.numberOfTilesTotal++}}function hFe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(d(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function fFe(e,t,n,i){let s=Sne(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],l=[],u=e._implicitTileset;for(let m=1;m<u.subtreeLevels;m++){let p=t.getLevelOffset(m),y=u.branchingFactor*c.length;for(let f=0;f<y;f++){let x=p+f;if(!t.tileIsAvailableAtIndex(x)){l.push(void 0);continue}let _=t.getParentMortonIndex(f),C=c[_],V=f%u.branchingFactor,L=Sne(e,t,C,V,x);C.children.push(L),a.numberOfTilesTotal++,l.push(L)}c=l,l=[]}return{rootTile:s,bottomRow:c}}function Cne(e,t,n){let i=Wx.TILE_GEOMETRIC_ERROR;return d(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Sne(e,t,n,i,o,r){let s=e._implicitTileset,a;g(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,l,u;if(d(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let X=Px.parseAllBoundingVolumeSemantics(c);l=X.tile,u=X.content}let p=t.contentPropertyTableJsons.length,y=!1;for(let X=0;X<p;X++)if(t.contentIsAvailableAtCoordinates(a,X)){y=!0;break}let f=yFe(s,a,i,r,n,l),x=[];for(let X=0;X<s.contentCount;X++){if(!t.contentIsAvailableAtIndex(o,X))continue;let A={uri:s.contentUriTemplates[X].getDerivedResource({templateValues:a.getTemplateValues()}).url},M=gFe(f,u);d(M)&&(A.boundingVolume=M),x.push(xt(A,s.contentHeaders[X]))}let _=Cne(c,s,a),C={boundingVolume:f,geometricError:_,refine:s.refine,contents:x},V=!0,L=Oe(s.tileHeader,V);delete L.boundingVolume,delete L.transform,delete L.metadata;let Z=xt(C,L,V),G=Gne(e,s.baseResource,Z,n);return G.implicitCoordinates=a,G.implicitSubtree=t,G.metadata=c,G.hasImplicitContentMetadata=y,G}function kM(e,t){return d(e)&&d(t)&&(d(t.minimumHeight)||d(t.maximumHeight))&&(ri(e,"3DTILES_bounding_volume_S2")||d(e.region))}function MY(e,t){d(t)&&(ri(e,"3DTILES_bounding_volume_S2")?bFe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):d(e.region)&&pFe(e.region,t.minimumHeight,t.maximumHeight))}function pFe(e,t,n){d(t)&&(e[4]=t),d(n)&&(e[5]=n)}function bFe(e,t,n){d(t)&&(e.minimumHeight=t),d(n)&&(e.maximumHeight=n)}function yFe(e,t,n,i,o,r){let s;return!d(r)||!d(r.boundingVolume)||!kM(r.boundingVolume,r)&&kM(e.boundingVolume,r)?s=Vne(e,t,n,g(i,!1),o):s=r.boundingVolume,MY(s,r),s}function gFe(e,t){let n;return d(t)&&(n=t.boundingVolume),kM(n,t)?MY(n,t):kM(e,t)&&(n=Oe(e,!0),MY(n,t)),n}function Vne(e,t,n,i,o){let r=e.boundingVolume;return ri(r,"3DTILES_bounding_volume_S2")?Lne(i,o,n,t.level,t.x,t.y,t.z):d(r.region)?{region:Zne(r.region,t.level,t.x,t.y,t.z)}:{box:Rne(r.box,t.level,t.x,t.y,t.z)}}function Lne(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Sp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),l=c%2===0?XS.encode2D(i,o,r):XS.encode2D(i,r,o),u=Sp.fromFacePositionLevel(c,BigInt(l),i),m,p;if(d(s)){let y=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:y,p=n<4?y:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Sp.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var xFe=new h,_Fe=new h,AY=new h,TFe=new $;function Rne(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,_Fe),s=$.unpack(e,3,TFe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,l=-1+(2*i+1)*a,u=0,m=h.fromElements(a,a,1,xFe);d(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,l,u,AY);p=$.multiplyByVector(s,p,AY),p=h.add(p,r,AY);let y=$.clone(s);y=$.multiplyByScale(y,m,y);let f=new Array(12);return h.pack(p,f),$.pack(y,f,3),f}var SFe=new de;function Zne(e,t,n,i,o){if(t===0)return e.slice();let r=de.unpack(e,0,SFe),s=e[4],a=e[5],c=Math.pow(2,-t),l=c*r.width,u=W.negativePiToPi(r.west+n*l),m=W.negativePiToPi(u+l),p=c*r.height,y=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(y+p),x=s,_=a;if(d(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,y,m,f,x,_]}function CFe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Vne(i,o,n,!1,t),s=Cne(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},l=Gne(e,i.baseResource,c,t);return l.implicitTileset=i,l.implicitCoordinates=o,l}function Gne(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}_l.prototype.hasProperty=function(e,t){return!1};_l.prototype.getFeature=function(e){};_l.prototype.applyDebugSettings=function(e,t){};_l.prototype.applyStyle=function(e){};_l.prototype.update=function(e,t){};_l.prototype.isDestroyed=function(){return!1};_l.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};_l._deriveBoundingBox=Rne;_l._deriveBoundingRegion=Zne;_l._deriveBoundingVolumeS2=Lne;var BS=_l;var P1n=T(S(),1);var Ian=T(S(),1),VFe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Tl=Object.freeze(VFe);var V1n=T(S(),1);var tcn=T(S(),1);var wan=T(S(),1);function YS(e,t){this._distance=t,this._normal=new Ene(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(YS.prototype,{distance:{get:function(){return this._distance},set:function(e){d(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){d(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});YS.fromPlane=function(e,t){return d(t)?(t.normal=e.normal,t.distance=e.distance):t=new YS(e.normal,e.distance),t};YS.clone=function(e,t){return d(t)?(t.normal=e.normal,t.distance=e.distance,t):new YS(e.normal,e.distance)};function Ene(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Ene.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){d(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){d(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){d(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var vx=YS;function Ka(e){e=g(e,g.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=g(e.enabled,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this.edgeColor=B.clone(g(e.edgeColor,B.WHITE)),this.edgeWidth=g(e.edgeWidth,0),this.planeAdded=new ye,this.planeRemoved=new ye,this._owner=void 0;let t=g(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?vne:wne,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(d(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function vne(e){return e===qt.OUTSIDE}function wne(e){return e===qt.INSIDE}Object.defineProperties(Ka.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?vne:wne)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function Xne(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Ka.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Xne(n,i)},e.index=t,Xne(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Ka.prototype.get=function(e){return this._planes[e]};function Fne(e,t){let n=e.length;for(let i=0;i<n;++i)if(on.equals(e[i],t))return i;return-1}Ka.prototype.contains=function(e){return Fne(this._planes,e)!==-1};Ka.prototype.remove=function(e){let t=this._planes,n=Fne(t,e);if(n===-1)return!1;e instanceof vx&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof vx&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Ka.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof vx&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var LFe=new se,RFe=new se;function Ine(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Kn.octEncodeToCartesian4(a.normal,RFe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let l=se.packFloat(a.distance,LFe);i[r+4]=l.x,i[r+5]=l.y,i[r+6]=l.z,i[r+7]=l.w,r+=8}}function Wne(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function Ane(e,t){let n=kt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var ZFe=new D;Ka.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Ka.useFloatTexture(n),o=i?this.length:this.length*2;if(d(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!d(t)){let s=Ane(o,ZFe);s.y*=2,i?(t=new Wt({context:n,width:s.x,height:s.y,pixelFormat:st.RGBA,pixelDatatype:Je.FLOAT,sampler:dn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Wt({context:n,width:s.x,height:s.y,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:dn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(Wne(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Ine(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),Wne(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),Ine(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var GFe=new F,Pne=new on(h.UNIT_X,0);Ka.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;d(t)&&(o=F.multiply(t,o,GFe));let r=qt.INSIDE;!this.unionClippingRegions&&i>0&&(r=qt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];on.transform(a,o,Pne);let c=e.intersectPlane(Pne);if(c===qt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Ka.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),d(e)&&(e._owner=t,t[n]=e))};Ka.useFloatTexture=function(e){return e.floatingPointTexture};Ka.getTextureResolution=function(e,t,n){let i=e.texture;if(d(i))return n.x=i.width,n.y=i.height,n;let o=Ka.useFloatTexture(t)?e.length:e.length*2,r=Ane(o,n);return r.y*=2,r};Ka.prototype.isDestroyed=function(){return!1};Ka.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var ss=Ka;var ocn=T(S(),1);var qE={HIGHLIGHT:0,REPLACE:1,MIX:2};qE.getColorBlend=function(e,t){if(e===qE.HIGHLIGHT)return 0;if(e===qE.REPLACE)return 1;if(e===qE.MIX)return W.clamp(t,W.EPSILON4,1)};var Ha=Object.freeze(qE);var _dn=T(S(),1);var scn=T(S(),1),EFe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},za=Object.freeze(EFe);var ccn=T(S(),1),XFe={STEP:0,LINEAR:1,CUBICSPLINE:2},Lm=Object.freeze(XFe);var bln=T(S(),1);var qcn=T(S(),1);var gcn=T(S(),1);var hcn=T(S(),1);var Mne={};function $E(e){this._count=e.count,this._properties=Oe(e.properties,!0)}$E.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,Mne)};$E.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,Mne,e)};$E.prototype.getProperty=function(e,t){let n=this._properties[t];if(d(n))return Oe(n[e],!0)};$E.prototype.setProperty=function(e,t,n){let i=this._properties[t];d(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Oe(n,!0)};var Ep=$E;function Ja(e){e=g(e,g.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Ja.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(d(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return d(this._metadataTable)&&(e+=this._metadataTable.byteLength),d(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Ja.prototype.hasProperty=function(e,t){return!!(d(this._metadataTable)&&this._metadataTable.hasProperty(t)||d(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||d(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Ja.prototype.hasPropertyBySemantic=function(e,t){return d(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Ja.prototype.propertyExists=function(e){return!!(d(this._metadataTable)&&this._metadataTable.hasProperty(e)||d(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||d(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Ja.prototype.propertyExistsBySemantic=function(e){return d(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var NY=[];Ja.prototype.getPropertyIds=function(e,t){return t=d(t)?t:[],t.length=0,d(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(NY)),d(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,NY)),d(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(NY)),t};Ja.prototype.getProperty=function(e,t){let n;if(d(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),d(n))||d(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),d(n))||d(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),d(n)))return n};Ja.prototype.setProperty=function(e,t,n){d(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||d(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(d(this._jsonMetadataTable)||(this._jsonMetadataTable=new Ep({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Ja.prototype.getPropertyBySemantic=function(e,t){if(d(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Ja.prototype.setPropertyBySemantic=function(e,t,n){return d(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Ja.prototype.getPropertyTypedArray=function(e){if(d(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Ja.prototype.getPropertyTypedArrayBySemantic=function(e){if(d(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Ja.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return d(n)?n.isClass(e,t):!1};Ja.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Ja.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(d(t))return t.getClassName(e)};var Pc=Ja;var Xcn=T(S(),1);var Lcn=T(S(),1);function eX(e){e=g(e,g.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=d(t.channels)?t.channels:[0],r=t,s=gl.createModelTextureReader({textureInfo:r,channels:PFe(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,l=n.hasValueTransform||d(a)||d(c);a=g(a,n.offset),c=g(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=l,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(eX.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});eX.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===Ot.SCALAR&&n===tn.UINT8:Ot.isVectorType(t)||t===Ot.SCALAR?n===tn.UINT8:!1};var IFe=[void 0,"float","vec2","vec3","vec4"],WFe=[void 0,"int","ivec2","ivec3","ivec4"];eX.prototype.getGlslType=function(){let e=this._classProperty,t=Ot.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?IFe[t]:WFe[t]};eX.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function PFe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var tX=eX;function UY(e){e=g(e,g.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(d(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new tX({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(UY.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});UY.prototype.getProperty=function(e){return this._properties[e]};var wx=UY;var Ncn=T(S(),1);var vcn=T(S(),1);function Nne(e){e=g(e,g.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||d(i)||d(o);i=g(i,n.offset),o=g(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Nne.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var nX=Nne;function kY(e){e=g(e,g.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(d(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new nX({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(kY.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});kY.prototype.getProperty=function(e){return this._properties[e]};var Fx=kY;var Bcn=T(S(),1);function iX(e){e=g(e,g.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=d(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(iX.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!d(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});iX.prototype.getPropertyTable=function(e){return this._propertyTables[e]};iX.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};iX.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var ya=iX;function vFe(e){e=g(e,g.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(d(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],l=new bl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Pc({id:s,name:a.name,count:a.count,metadataTable:l,extras:a.extras,extensions:a.extensions}))}let o=[];if(d(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new wx({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(d(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new Fx({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new ya({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var oX=vFe;var aln=T(S(),1);function wFe(e){e=g(e,g.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(d(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],l=n.classes[c.class],u=new bl({count:c.count,properties:c.properties,class:l,bufferViews:e.bufferViews});o.push(new Pc({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(d(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new wx({id:a,propertyTexture:FFe(c),class:n.classes[c.class],textures:e.textures}))}return new ya({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function FFe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:AFe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=xt(o.texture,r,!0)}return t}function AFe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var rX=wFe;function wb(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.frameState,c=e.cacheKey,l=g(e.asynchronous,!0);this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=l,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Rt.UNLOADED,this._promise=void 0}d(Object.create)&&(wb.prototype=Object.create(oo.prototype),wb.prototype.constructor=wb);Object.defineProperties(wb.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function MFe(e){try{let t=BFe(e),n=zFe(e),i=JFe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Rt.LOADED,e)}catch(t){if(e.isDestroyed())return;e.unload(),e._state=Rt.FAILED;let n="Failed to load structural metadata";throw e.getError(n,t)}}wb.prototype.load=function(){return d(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=MFe(this),this._promise)};function NFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;d(o)&&(t[o]=!0),d(r)&&(t[r]=!0),d(s)&&(t[s]=!0)}}function UFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;d(o)&&(t[o]=!0),d(r)&&(t[r]=!0),d(s)&&(t[s]=!0)}}function kFe(e){let t=e.propertyTables,n={};if(d(t))for(let i=0;i<t.length;i++){let o=t[i];NFe(o.properties,n)}return n}function DFe(e){let t=e.featureTables,n={};if(d(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;d(r)&&UFe(r,n)}}return n}async function BFe(e){let t;d(e._extension)?t=kFe(e._extension):t=DFe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Bi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function YFe(e){let t={},n=e.propertyTextures;if(d(n))for(let i=0;i<n.length;i++){let r=n[i].properties;d(r)&&OFe(r,t)}return t}function OFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function KFe(e){let t={},n=e.featureTextures;if(d(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;d(r)&&HFe(r,t)}}return t}function HFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function zFe(e){let t;d(e._extension)?t=YFe(e._extension):t=KFe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let l in t)if(t.hasOwnProperty(l)){let u=Bi.getTextureLoader({gltf:n,textureInfo:t[l],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(l),c.push(u.load())}return Promise.all(c)}async function JFe(e){let t=g(e._extension,e._extensionLegacy),n;if(d(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Bi.getSchemaLoader({resource:i})}else n=Bi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}wb.prototype.process=function(e){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let l=t[a].process(e);i=i&&l}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],l=this._bufferViewLoaders[a];if(!l.isDestroyed()){let u=new Uint8Array(l.typedArray);r[c]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],l=t[a];l.isDestroyed()||(s[c]=l.texture)}return d(this._extension)?this._structuralMetadata=oX({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=rX({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Une(this),this._state=Rt.READY,!0};function Une(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function QFe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}wb.prototype.unload=function(){Une(this),QFe(this),d(this._schemaLoader)&&Bi.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var sX=wb;var gln=T(S(),1);var OS={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};OS.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return OS.TRANSLATION;case"ROTATION":return OS.ROTATION;case"SCALE":return OS.SCALE;case"_FEATURE_ID":return OS.FEATURE_ID}};var Nr=Object.freeze(OS);var Nln=T(S(),1);var Eln=T(S(),1);var jFe=65534,qFe=255;function DM(e){e=g(e,g.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Bne(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],$Fe(this)}Object.defineProperties(DM.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function $Fe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],l=t[a+1],u=t[a+2],m=!1,p=m||n.hasEdge(c,l),y=m||n.hasEdge(l,u),f=m||n.hasEdge(u,c),x=kne(i,c,l,u,p,y,f);for(;d(x);){let _=s[x];if(!d(_)){_=r+o.length;let C=x;for(;C>=r;)C=o[C-r];o.push(C),s[x]=_}_>jFe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>qFe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===l?(l=_,t[a+1]=_):(u=_,t[a+2]=_),x=kne(i,c,l,u,p,y,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function kne(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,l=0,u=DY(e,t,a,c,l);if(u===0)return t;let m=0,p=o?1:0,y=r?1:0,f=DY(e,n,m,p,y);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=DY(e,i,x,_,C);if(V===0)return i;let L=u&f&V,Z,G,X;if(L&1)Z=0,G=1,X=2;else if(L&2)Z=0,X=1,G=2;else if(L&4)G=0,Z=1,X=2;else if(L&8)G=0,X=1,Z=2;else if(L&16)X=0,Z=1,G=2;else if(L&32)X=0,G=1,Z=2;else{let M=BY(u),b=BY(f),R=BY(V);return M<b&&M<R?t:b<R?n:i}let P=t*3;e[P+Z]=a,e[P+G]=c,e[P+X]=l;let v=n*3;e[v+Z]=m,e[v+G]=p,e[v+X]=y;let A=i*3;e[A+Z]=x,e[A+G]=_,e[A+X]=C}function DY(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return d(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function BY(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}DM.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,l=n+a*i;for(let u=0;u<i;u++)s[l+u]=s[c+u]}return s};DM.createTexture=function(e){let t=e.cache.modelOutliningCache;if(d(t)||(t=e.cache.modelOutliningCache={}),d(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,kt.maximumTextureSize),i=n,o=Dne(i),r=[];for(;i>1;)i>>=1,r.push(Dne(i));let s=new Wt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:st.LUMINANCE,sampler:new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR_MIPMAP_LINEAR,magnificationFilter:Ti.LINEAR})});return t.outlineTexture=s,s};function Dne(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Bne(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}Bne.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var Ax=DM;function Yne(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function eAe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function BM(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}BM.prototype.postProcess=function(e){this.needsOutlines&&(tAe(this),iAe(this,e))};function tAe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new Ax({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ue.fromTypedArray(n.typedArray);let r=nAe(o.outlineCoordinates),s=new Yne(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let l=0;l<c;l++){let u=a[l].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function nAe(e){let t=new wt.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Q.FLOAT,t.type=an.VEC3,t.normalized=!1,t.count=e.length/3,t}function iAe(e,t){oAe(e.attributePlans,t),d(e.indicesPlan)&&rAe(e.indicesPlan,t)}function oAe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=mt.createVertexBuffer({typedArray:s,context:t,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function rAe(e,t){let n=e.indices;if(e.loadBuffer){let i=mt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ne.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}BM.AttributeLoadPlan=Yne;BM.IndicesLoadPlan=eAe;var Mx=BM;var Dln=T(S(),1);function sAe(e){e=g(e,g.EMPTY_OBJECT),this.webp=g(e.webp,!1),this.basis=g(e.basis,!1)}var aX=sAe;var aAe=wt.Attribute,cAe=wt.Indices,One=wt.FeatureIdAttribute,Kne=wt.FeatureIdTexture,Hne=wt.FeatureIdImplicitRange,lAe=wt.MorphTarget,dAe=wt.Primitive,uAe=wt.Instances,mAe=wt.Skin,hAe=wt.Node,fAe=wt.AnimatedPropertyType,pAe=wt.AnimationSampler,bAe=wt.AnimationTarget,yAe=wt.AnimationChannel,gAe=wt.Animation,xAe=wt.ArticulationStage,_Ae=wt.Articulation,TAe=wt.Asset,SAe=wt.Scene,CAe=wt.Components,VAe=wt.MetallicRoughness,LAe=wt.SpecularGlossiness,RAe=wt.Material,Eo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Rm(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,o=g(e.releaseGltfJson,!1),r=g(e.asynchronous,!0),s=g(e.incrementallyLoadTextures,!0),a=g(e.upAxis,Zo.Y),c=g(e.forwardAxis,Zo.Z),l=g(e.loadAttributesAsTypedArray,!1),u=g(e.loadAttributesFor2D,!1),m=g(e.loadIndicesForWireframe,!1),p=g(e.loadPrimitiveOutline,!0),y=g(e.loadForClassification,!1),f=g(e.renameBatchIdSemantic,!1);n=d(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=u,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._loadForClassification=y,this._renameBatchIdSemantic=f,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Eo.NOT_LOADED,this._textureState=Eo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._postProcessBuffers=[],this._components=void 0}d(Object.create)&&(Rm.prototype=Object.create(oo.prototype),Rm.prototype.constructor=Rm);Object.defineProperties(Rm.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return d(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function ZAe(e){e._state=Eo.LOADING,e._textureState=Eo.LOADING;try{let t=Bi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Eo.LOADED,e._textureState=Eo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Eo.FAILED,e._textureState=Eo.FAILED,YM(e,t)}}async function GAe(e,t){Mt.supportsWebP.initialized||await Mt.supportsWebP.initialize();let n=new aX({webp:Mt.supportsWebP(),basis:t.context.supportsBasis}),i=e.gltfJson,o=L9e(e,i,n,t);return e._state=Eo.PROCESSING,e._textureState=Eo.PROCESSING,d(e._gltfJsonLoader)&&e._releaseGltfJson&&(Bi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),o}Rm.prototype.load=async function(){return d(this._promise)?this._promise:(this._promise=ZAe(this),this._promise)};function YM(e,t){e.unload();let n="Failed to load glTF";throw e.getError(n,t)}function EAe(e,t){let n,i=!0,o=e._geometryLoaders,r=o.length;for(n=0;n<r;++n){let a=o[n].process(t);a&&d(e._geometryCallbacks[n])&&(e._geometryCallbacks[n](),e._geometryCallbacks[n]=void 0),i=i&&a}let s=e._structuralMetadataLoader;if(d(s)){let a=s.process(t);a&&(e._components.structuralMetadata=s.structuralMetadata),i=i&&a}i&&(e._state=Eo.POST_PROCESSING)}function XAe(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.postProcess(t),r.needsOutlines&&IAe(e,r)}}function IAe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;d(o)&&n.push(o.buffer);let r=i.attributes,s=r.length;for(let c=0;c<s;c++){let l=r[c];d(l.buffer)&&n.push(l.buffer)}let a=i.indices;d(a)&&d(a.buffer)&&n.push(a.buffer)}Rm.prototype._process=function(e){return this._state===Eo.READY?!0:(this._state===Eo.PROCESSING&&EAe(this,e),this._resourcesLoaded&&this._state===Eo.POST_PROCESSING&&(XAe(this,e.context),this._state=Eo.PROCESSED),this._resourcesLoaded&&this._state===Eo.PROCESSED?(nie(this),this._typedArray=void 0,this._state=Eo.READY,!0):!1)};Rm.prototype._processTextures=function(e){if(this._textureState===Eo.READY)return!0;if(this._textureState!==Eo.PROCESSING)return!1;let t,n=!0,i=this._textureLoaders,o=i.length;for(t=0;t<o;++t){let r=i[t].process(e);r&&d(this._textureCallbacks[t])&&(this._textureCallbacks[t](),this._textureCallbacks[t]=void 0),n=n&&r}return n?(this._textureState=Eo.READY,this._texturesLoaded=!0,!0):!1};Rm.prototype.process=function(e){if(this._state===Eo.LOADED&&!d(this._loadResourcesPromise)&&(this._loadResourcesPromise=GAe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),d(this._processError)){this._state=Eo.FAILED;let o=this._processError;this._processError=void 0,YM(this,o)}let t=this._textureErrors.pop();if(d(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Eo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Eo.FAILED,YM(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Eo.FAILED,YM(this,o)}return this._incrementallyLoadTextures?n:n&&i};function WAe(e,t,n,i,o,r,s,a){let l=t.accessors[n].bufferView;return Bi.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:l,draco:o,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function PAe(e,t,n,i,o,r,s){return Bi.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function vAe(e,t,n){let i=Bi.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function zne(e,t,n){let i=t.byteOffset,o=yl(e,t),r=t.count,s=nd(t.type),a=t.componentType,c=Q.getSizeInBytes(a),l=c*s,u=r*s;if(o===l)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let m=Q.createTypedArray(a,u),p=new DataView(n.buffer),y=new Array(s),f=Gp(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){f(p,i,s,c,y);for(let _=0;_<s;++_)m[x*s+_]=y[_];i+=o}return m}function wAe(e,t){let n=e.type;if(n===an.SCALAR)return t.fill(0);let i=an.getMathType(n);return t.fill(i.clone(i.ZERO))}function FAe(e,t,n,i){let o=e.type,r=e.count;if(o===an.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===an.VEC4&&i)for(let s=0;s<r;s++)n[s]=Ae.unpack(t,s*4);else{let s=an.getMathType(o),a=an.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function AAe(e,t,n,i,o,r){if(await t.load(),e.isDestroyed())return;let s=t.typedArray,a=zne(n,i,s);o=g(o,!1),FAe(i,a,r,o)}function OM(e,t,n,i){let o=t.accessors[n],r=o.count,s=new Array(r),a=o.bufferView;if(d(a)){let c=vAe(e,t,a),l=AAe(e,c,t,o,i,s);return e._loaderPromises.push(l),s}return wAe(o,s)}function ou(e,t){if(d(t))return e===Number?t[0]:e.unpack(t)}function MAe(e){return e===Number?0:new e}function NAe(e){switch(e){case Q.BYTE:return 127;case Q.UNSIGNED_BYTE:return 255;case Q.SHORT:return 32767;case Q.UNSIGNED_SHORT:return 65535;default:return 1}}var UAe={VEC2:new D(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function kAe(e,t){let n=NAe(e.componentDatatype),i=UAe[e.type],o=e.min;d(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;d(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function DAe(e,t,n){let i=e.decodeMatrix,o=ou(n,e.decodedMin),r=ou(n,e.decodedMax);d(o)&&d(r)&&(t.min=o,t.max=r);let s=new wt.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new D(i[6],i[7]),s.quantizedVolumeStepSize=new D(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function BAe(e,t,n,i,o){let r=e.accessors[t],s=an.getMathType(r.type),a=g(r.normalized,!1),c=new aAe;c.name=n,c.semantic=i,c.setIndex=o,c.constant=MAe(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=ou(s,r.min),c.max=ou(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=yl(e,r),ri(r,"WEB3D_quantized_attributes")&&DAe(r.extensions.WEB3D_quantized_attributes,c,s);let l=c.semantic===Ct.POSITION||c.semantic===Ct.NORMAL||c.semantic===Ct.TANGENT||c.semantic===Ct.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&l&&kAe(c,s),c}function Jne(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var YAe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function YY(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=YAe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function OAe(e){let t=e===Ct.POSITION,n=e===Ct.FEATURE_ID,i=e===Ct.TEXCOORD;return t||n||i}function KAe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=d(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Q.createArrayBufferView(o,t.typedArray.buffer)}}function HAe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=zne(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Qne(e,t,n,i,o,r,s,a){let c=t.accessors[n],l=c.bufferView,u=i.gltfSemantic,m=i.renamedSemantic,p=i.modelSemantic,y=d(p)?Jne(m):void 0,x=BAe(t,n,u,p,y);if(!d(o)&&!d(l))return x;let _=WAe(e,t,n,u,o,r,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(_);let V=_.load();return e._loaderPromises.push(V),e._geometryCallbacks[C]=()=>{d(o)&&d(o.attributes)&&d(o.attributes[u])?KAe(x,_,r,s):HAe(t,c,x,_,r,s)},x}function jne(e,t,n,i,o,r,s,a){let c=i.modelSemantic,l=c===Ct.POSITION,u=c===Ct.FEATURE_ID,m=l&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=e._loadForClassification&&u,y=e._loadAttributesAsTypedArray,f=!y,x=y||m||p,V=Qne(e,t,n,i,o,s?!1:f,s?!0:x,a),L=new Mx.AttributeLoadPlan(V);return L.loadBuffer=f,L.loadTypedArray=x,L}function zAe(e,t,n,i,o,r){let s=d(i.ROTATION),a=d(i.TRANSLATION)&&d(t.accessors[i.TRANSLATION].min)&&d(t.accessors[i.TRANSLATION].max),c=YY(e,Nr,o),l=c.modelSemantic,u=l===Nr.TRANSLATION||l===Nr.ROTATION||l===Nr.SCALE,m=l===Nr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!r.context.instancedArrays,y=!p,f=e._loadAttributesFor2D&&!r.scene3DOnly;return Qne(e,t,n,c,void 0,y,p||m&&(!a||f),r)}function JAe(e,t,n,i,o,r,s){let a=t.accessors[n],c=a.bufferView;if(!d(i)&&!d(c))return;let l=new cAe;l.count=a.count;let u=e._loadAttributesAsTypedArray,m=e._loadIndicesForWireframe&&!s.context.webgl2,p=e._loadForClassification&&o,f=!u,x=u||m||p,V=PAe(e,t,n,i,r?!1:f,r?!0:x,s),L=e._geometryLoaders.length;e._geometryLoaders.push(V);let Z=V.load();e._loaderPromises.push(Z),e._geometryCallbacks[L]=()=>{l.indexDatatype=V.indexDatatype,l.buffer=V.buffer,l.typedArray=V.typedArray};let G=new Mx.IndicesLoadPlan(l);return G.loadBuffer=f,G.loadTypedArray=x,G}function Xp(e,t,n,i,o,r){let s=gl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!d(s))return;let a=Bi.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:o,asynchronous:e._asynchronous}),c=gl.createModelTextureReader({textureInfo:n}),l=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(m=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw m;e._textureState=Eo.FAILED,e._textureErrors.push(m)}});return e._texturesPromises.push(u),e._textureCallbacks[l]=()=>{c.texture=a.texture,d(r)&&(c.texture.sampler=r)},c}function QAe(e,t,n,i,o){let r=new RAe,s=g(n.extensions,g.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(r.unlit=d(s.KHR_materials_unlit),d(a)){let l=new LAe;r.specularGlossiness=l,d(a.diffuseTexture)&&(l.diffuseTexture=Xp(e,t,a.diffuseTexture,i,o)),d(a.specularGlossinessTexture)&&d(a.specularGlossinessTexture)&&(l.specularGlossinessTexture=Xp(e,t,a.specularGlossinessTexture,i,o)),l.diffuseFactor=ou(se,a.diffuseFactor),l.specularFactor=ou(h,a.specularFactor),l.glossinessFactor=a.glossinessFactor,r.pbrSpecularGlossiness=a}else if(d(c)){let l=new VAe;d(c.baseColorTexture)&&(l.baseColorTexture=Xp(e,t,c.baseColorTexture,i,o)),d(c.metallicRoughnessTexture)&&(l.metallicRoughnessTexture=Xp(e,t,c.metallicRoughnessTexture,i,o)),l.baseColorFactor=ou(se,c.baseColorFactor),l.metallicFactor=c.metallicFactor,l.roughnessFactor=c.roughnessFactor,r.metallicRoughness=l}return d(n.emissiveTexture)&&(r.emissiveTexture=Xp(e,t,n.emissiveTexture,i,o)),d(n.normalTexture)&&!e._loadForClassification&&(r.normalTexture=Xp(e,t,n.normalTexture,i,o)),d(n.occlusionTexture)&&(r.occlusionTexture=Xp(e,t,n.occlusionTexture,i,o)),r.emissiveFactor=ou(h,n.emissiveFactor),r.alphaMode=n.alphaMode,r.alphaCutoff=n.alphaCutoff,r.doubleSided=n.doubleSided,r}function qne(e,t){let n=new One;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function $ne(e,t,n,i){let o=new One,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Jne(r.attribute),o.positionalLabel=i,o}function eie(e,t){let n=new Hne;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function tie(e,t,n,i){let o=new Hne,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=g(r.constant,0);let s=g(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function jAe(e,t,n,i,o,r){let s=new Kne;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=r;let a=n.texture;s.textureReader=Xp(e,t,a,i,o,dn.NEAREST);let l=(d(a.channels)?a.channels:[0]).map(function(u){return"rgba".charAt(u)}).join("");return s.textureReader.channels=l,s}function qAe(e,t,n,i,o,r,s,a){let c=new Kne,l=n.featureIds,u=l.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Xp(e,t,u,o,r,dn.NEAREST),c.textureReader.channels=l.channels,c.positionalLabel=a,c}function $Ae(e,t,n,i,o,r){let s=new lAe,a=void 0,c=!1;for(let l in n)if(n.hasOwnProperty(l)){let u=n[l],m=YY(e,Ct,l),p=jne(e,t,u,m,a,c,i,r);s.attributes.push(p.attribute),o.attributePlans.push(p)}return s}function e9e(e,t,n,i,o,r){let s=new dAe,a=new Mx(s);e._primitiveLoadPlans.push(a);let c=n.material;d(c)&&(s.material=QAe(e,t,t.materials[c],o,r));let l=g(n.extensions,g.EMPTY_OBJECT),u=!1,m=l.CESIUM_primitive_outline;e._loadPrimitiveOutline&&d(m)&&(u=!0,a.needsOutlines=!0,a.outlineIndices=t9e(e,t,m,a));let p=e._loadForClassification,y=l.KHR_draco_mesh_compression,f=!1,x=n.attributes;if(d(x)){for(let P in x)if(x.hasOwnProperty(P)){let v=x[P],A=YY(e,Ct,P),M=A.modelSemantic;if(p&&!OAe(M))continue;M===Ct.FEATURE_ID&&(f=!0);let b=jne(e,t,v,A,y,i,u,r);a.attributePlans.push(b),s.attributes.push(b.attribute)}}let _=n.targets;if(d(_)&&!p){let P=_.length;for(let v=0;v<P;++v)s.morphTargets.push($Ae(e,t,_[v],u,a,r))}let C=n.indices;if(d(C)){let P=JAe(e,t,C,y,f,u,r);d(P)&&(a.indicesPlan=P,s.indices=P.indices)}let V=l.EXT_structural_metadata,L=l.EXT_mesh_features,Z=l.EXT_feature_metadata,G=d(Z);d(L)?n9e(e,t,s,L,o,r):G&&i9e(e,t,s,Z,o,r),d(V)?o9e(s,V):G&&r9e(e,s,Z);let X=n.mode;if(p&&X!==Fe.TRIANGLES)throw new me("Only triangle meshes can be used for classification.");return s.primitiveType=X,s}function t9e(e,t,n){let i=n.indices;return OM(e,t,i,!1)}function n9e(e,t,n,i,o,r){let s;d(i)&&d(i.featureIds)?s=i.featureIds:s=[];for(let a=0;a<s.length;a++){let c=s[a],l=`featureId_${a}`,u;d(c.texture)?u=jAe(e,t,c,o,r,l):d(c.attribute)?u=qne(c,l):u=eie(c,l),n.featureIds.push(u)}}function i9e(e,t,n,i,o,r){let s=t.extensions.EXT_feature_metadata.featureTables,a=0,c=i.featureIdAttributes;if(d(c)){let u=c.length;for(let m=0;m<u;++m){let p=c[m],y=p.featureTable,f=e._sortedPropertyTableIds.indexOf(y),x=s[y].count,_=`featureId_${a}`;a++;let C;d(p.featureIds.attribute)?C=$ne(p,f,x,_):C=tie(p,f,x,_),n.featureIds.push(C)}}let l=i.featureIdTextures;if(d(l)){let u=l.length;for(let m=0;m<u;++m){let p=l[m],y=p.featureTable,f=e._sortedPropertyTableIds.indexOf(y),x=s[y].count,_=`featureId_${a}`;a++;let C=qAe(e,t,p,f,o,r,x,_);n.featureIds.push(C)}}}function o9e(e,t){d(t)&&(d(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),d(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function r9e(e,t,n){d(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function s9e(e,t,n,i){let o=n.EXT_mesh_gpu_instancing,r=new uAe,s=o.attributes;if(d(s)){for(let u in s)if(s.hasOwnProperty(u)){let m=s[u];r.attributes.push(zAe(e,t,m,s,u,i))}}let a=g(o.extensions,g.EMPTY_OBJECT),c=n.EXT_instance_features,l=a.EXT_feature_metadata;return d(c)?a9e(r,c):d(l)&&c9e(t,r,l,e._sortedPropertyTableIds),r}function a9e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;d(o.attribute)?s=qne(o,r):s=eie(o,r),e.featureIds.push(s)}}function c9e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(d(r)){let s=r.length;for(let a=0;a<s;++a){let c=r[a],l=c.featureTable,u=i.indexOf(l),m=o[l].count,p=`instanceFeatureId_${a}`,y;d(c.featureIds.attribute)?y=$ne(c,u,m,p):y=tie(c,u,m,p),t.featureIds.push(y)}}}function l9e(e,t,n,i,o){let r=new hAe;r.name=n.name,r.matrix=ou(F,n.matrix),r.translation=ou(h,n.translation),r.rotation=ou(Ae,n.rotation),r.scale=ou(h,n.scale);let s=g(n.extensions,g.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;if(d(a)){if(e._loadForClassification)throw new me("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");r.instances=s9e(e,t,s,o)}d(c)&&(r.articulationName=c.articulationName);let l=n.mesh;if(d(l)){let u=t.meshes[l],m=u.primitives,p=m.length;for(let _=0;_<p;++_)r.primitives.push(e9e(e,t,m[_],d(r.instances),i,o));let y=g(n.weights,u.weights),x=r.primitives[0].morphTargets.length;r.morphWeights=d(y)?y.slice():new Array(x).fill(0)}return r}function d9e(e,t,n,i){if(!d(t.nodes))return[];let o,r,s=t.nodes.length,a=new Array(s);for(o=0;o<s;++o){let c=l9e(e,t,t.nodes[o],n,i);c.index=o,a[o]=c}for(o=0;o<s;++o){let c=t.nodes[o].children;if(d(c)){let l=c.length;for(r=0;r<l;++r)a[o].children.push(a[c[r]])}}return a}function u9e(e,t,n,i){let o=new mAe,r=n.joints,s=r.length,a=new Array(s);for(let l=0;l<s;++l)a[l]=i[r[l]];o.joints=a;let c=n.inverseBindMatrices;return d(c)?o.inverseBindMatrices=OM(e,t,c):o.inverseBindMatrices=new Array(s).fill(F.IDENTITY),o}function m9e(e,t,n){let i=t.skins;if(e._loadForClassification||!d(i))return[];let o=t.skins.length,r=new Array(o);for(let a=0;a<o;++a){let c=u9e(e,t,t.skins[a],n);c.index=a,r[a]=c}let s=n.length;for(let a=0;a<s;++a){let c=t.nodes[a].skin;d(c)&&(n[a].skin=r[c])}return r}async function h9e(e,t,n,i,o,r){let s=new sX({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:o,frameState:r,asynchronous:e._asynchronous});return e._structuralMetadataLoader=s,s.load()}function f9e(e,t,n){let i=new pAe,o=n.input;i.input=OM(e,t,o);let r=n.interpolation;i.interpolation=g(Lm[r],Lm.LINEAR);let s=n.output;return i.output=OM(e,t,s,!0),i}function p9e(e,t){let n=new bAe,i=e.node;if(!d(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=fAe[o],n}function b9e(e,t,n){let i=new yAe,o=e.sampler;return i.sampler=t[o],i.target=p9e(e.target,n),i}function y9e(e,t,n,i){let o,r=new gAe;r.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(o=0;o<a;o++){let p=f9e(e,t,s[o]);p.index=o,c[o]=p}let l=n.channels,u=l.length,m=new Array(u);for(o=0;o<u;o++)m[o]=b9e(l[o],c,i);return r.samplers=c,r.channels=m,r}function g9e(e,t,n){let i=t.animations;if(e._loadForClassification||!d(i))return[];let o=t.animations.length,r=new Array(o);for(let s=0;s<o;++s){let a=y9e(e,t,t.animations[s],n);a.index=s,r[s]=a}return r}function x9e(e){let t=new xAe;t.name=e.name;let n=e.type.toUpperCase();return t.type=za[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function _9e(e){let t=new _Ae;t.name=e.name;let n=e.stages,i=n.length,o=new Array(i);for(let r=0;r<i;r++){let s=x9e(n[r]);o[r]=s}return t.stages=o,t}function T9e(e){let n=g(e.extensions,g.EMPTY_OBJECT).AGI_articulations;if(!d(n))return[];let i=n.articulations;if(!d(i))return[];let o=i.length,r=new Array(o);for(let s=0;s<o;s++){let a=_9e(i[s]);r[s]=a}return r}function S9e(e){let t;return d(e.scenes)&&d(e.scene)&&(t=e.scenes[e.scene].nodes),t=g(t,e.nodes),t=d(t)?t:[],t}function C9e(e,t){let n=new SAe,i=S9e(e);return n.nodes=i.map(function(o){return t[o]}),n}var V9e=new h;function L9e(e,t,n,i){let o=g(t.extensions,g.EMPTY_OBJECT),r=o.EXT_structural_metadata,s=o.EXT_feature_metadata,a=o.CESIUM_RTC;if(d(s)){let C=s.featureTables,V=s.featureTextures,L=d(C)?C:[],Z=d(V)?V:[];e._sortedPropertyTableIds=Object.keys(L).sort(),e._sortedFeatureTextureIds=Object.keys(Z).sort()}let c=d9e(e,t,n,i),l=m9e(e,t,c),u=g9e(e,t,c),m=T9e(t),p=C9e(t,c),y=new CAe,f=new TAe,x=t.asset.copyright;if(d(x)){let C=x.split(";").map(function(V){return new St(V.trim())});f.credits=C}if(y.asset=f,y.scene=p,y.nodes=c,y.skins=l,y.animations=u,y.articulations=m,y.upAxis=e._upAxis,y.forwardAxis=e._forwardAxis,d(a)){let C=h.fromArray(a.center,0,V9e);y.transform=F.fromTranslation(C,y.transform)}if(e._components=y,d(r)||d(s)){let C=h9e(e,t,r,s,n,i);e._loaderPromises.push(C)}let _=[];return _.push.apply(_,e._loaderPromises),e._incrementallyLoadTextures||_.push.apply(_,e._texturesPromises),Promise.all(_)}function R9e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Bi.unload(t[i]);e._textureLoaders.length=0}function nie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Bi.unload(t[i]);e._bufferViewLoaders.length=0}function Z9e(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Bi.unload(t[i]);e._geometryLoaders.length=0}function G9e(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}function E9e(e){d(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Rm.prototype.isUnloaded=function(){return this._state===Eo.UNLOADED};Rm.prototype.unload=function(){d(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Bi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,R9e(this),nie(this),Z9e(this),G9e(this),E9e(this),this._components=void 0,this._typedArray=void 0,this._state=Eo.UNLOADED};var Ip=Rm;var Ddn=T(S(),1);var Mdn=T(S(),1);var Sdn=T(S(),1),cX=`uniform sampler2D u_pointCloud_colorGBuffer;
uniform sampler2D u_pointCloud_depthGBuffer;
uniform vec2 u_distanceAndEdlStrength;
in vec2 v_textureCoordinates;

vec2 neighborContribution(float log2Depth, vec2 offset)
{
    float dist = u_distanceAndEdlStrength.x;
    vec2 texCoordOrig = v_textureCoordinates + offset * dist;
    vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
    vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);

    float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
    float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));

    // ignore depth values that are the clear depth
    if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
        return vec2(0.0);
    }

    // interpolate the two adjacent depth values
    float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
    vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
    return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
}

void main()
{
    float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float log2Depth = log2(-eyeCoordinate.z);

    if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
    {
        discard;
    }

    vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);

    // sample from neighbors left, right, down, up
    vec2 texelSize = 1.0 / czm_viewport.zw;

    vec2 responseAndCount = vec2(0.0);

    responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
    responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
    responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
    responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));

    float response = responseAndCount.x / responseAndCount.y;
    float strength = u_distanceAndEdlStrength.y;
    float shade = exp(-response * 300.0 * strength);
    color.rgb *= shade;
    out_FragColor = vec4(color);

    // Input and output depth are the same.
    gl_FragDepth = depthOrLogDepth;
}
`;function KS(){this._framebuffer=new mi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(KS.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function X9e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var OY=new D;function I9e(e,t){let n=new Be({defines:["LOG_DEPTH_WRITE"],sources:[cX]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return OY.x=e._radius,OY.y=e._strength,OY}},o=De.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ft.setCesium3DTileBit(),stencilMask:Ft.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Re.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ti({framebuffer:e.framebuffer,color:new B(0,0,0,0),depth:1,renderState:De.fromCache(),pass:Re.CESIUM_3D_TILE,owner:e})}function W9e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),I9e(e,t)}function iie(e){return e.drawBuffers&&e.fragmentDepth}KS.isSupported=iie;function P9e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!d(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Be.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() 
{ 
    czm_point_cloud_post_process_main(); 
#ifdef LOG_DEPTH
    czm_writeLogDepth();
    out_FragData_1 = czm_packDepth(gl_FragDepth); 
#else
    out_FragData_1 = czm_packDepth(gl_FragCoord.z);
#endif
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}KS.prototype.update=function(e,t,n,i){if(!iie(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,W9e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let l=r[o];if(l.primitiveType!==Fe.POINTS||l.pass===Re.TRANSLUCENT)continue;let u,m,p=l.derivedCommands.pointCloudProcessor;d(p)&&(u=p.command,m=p.originalShaderProgram),(!d(u)||l.dirty||m!==l.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=nt.shallowClone(l,u),u.framebuffer=this.framebuffer,u.shaderProgram=P9e(e.context,l.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,d(p)||(p={command:u,originalShaderProgram:l.shaderProgram},l.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=l.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};KS.prototype.isDestroyed=function(){return!1};KS.prototype.destroy=function(){return X9e(this),ue(this)};var Wp=KS;function oie(e){let t=g(e,{});this.attenuation=g(t.attenuation,!1),this.geometricErrorScale=g(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=g(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=g(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=g(t.eyeDomeLightingRadius,1),this.backFaceCulling=g(t.backFaceCulling,!1),this.normalShading=g(t.normalShading,!0)}oie.isSupported=function(e){return Wp.isSupported(e.context)};var Kh=oie;var nun=T(S(),1);var ga={},v9e=new se(0,0,0,1),Qa=new se,w9e=new He,KY=new D,HY=new D;ga.wgs84ToWindowCoordinates=function(e,t,n){return ga.wgs84WithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var rie=new se,sie=new h;function lX(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,rie),rie),s=h.multiplyComponents(t,h.normalize(r,sie),sie);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var F9e=new he(Math.PI,W.PI_OVER_TWO),A9e=new h,M9e=new h;ga.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=ga.computeActualWgs84Position(o,t,v9e);if(!d(r))return;let s=e.canvas,a=w9e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,l=!1;if(o.mode===ie.SCENE2D){let u=e.mapProjection,m=F9e,p=u.project(m,A9e),y=h.clone(c.position,M9e),f=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),_=c.frustum.projectionMatrix,C=c.positionWC.y,V=h.fromElements(W.sign(C)*p.x-C,0,-c.positionWC.x),L=vt.pointToGLWindowCoordinates(_,x,V);if(C===0||L.x<=0||L.x>=s.clientWidth)l=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,Qa=lX(r,n,c,Qa),ga.clipToGLWindowCoordinates(a,Qa,KY),a.x+=L.x,c.position.x=-c.position.x;let Z=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-Z,Qa=lX(r,n,c,Qa),ga.clipToGLWindowCoordinates(a,Qa,HY)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,Qa=lX(r,n,c,Qa),ga.clipToGLWindowCoordinates(a,Qa,KY),a.x=a.x-a.width,c.position.x=-c.position.x;let Z=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-Z,Qa=lX(r,n,c,Qa),ga.clipToGLWindowCoordinates(a,Qa,HY)}h.clone(y,c.position),c.frustum=f.clone(),i=D.clone(KY,i),(i.x<0||i.x>s.clientWidth)&&(i.x=HY.x)}}if(o.mode!==ie.SCENE2D||l){if(Qa=lX(r,n,c,Qa),Qa.z<0&&!(c.frustum instanceof en)&&!(c.frustum instanceof yr))return;i=ga.clipToGLWindowCoordinates(a,Qa,i)}return i.y=s.clientHeight-i.y,i};ga.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=ga.wgs84ToWindowCoordinates(e,t,n),!!d(n))return ga.transformWindowToDrawingBuffer(e,n,n)};var Pp=new h,N9e=new he;ga.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ie.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,N9e);if(!d(r))return;if(o.project(r,Pp),i===ie.COLUMBUS_VIEW)return h.fromElements(Pp.z,Pp.x,Pp.y,n);if(i===ie.SCENE2D)return h.fromElements(0,Pp.x,Pp.y,n);let s=e.morphTime;return h.fromElements(W.lerp(Pp.z,t.x,s),W.lerp(Pp.x,t.y,s),W.lerp(Pp.y,t.z,s),n)};var aie=new h,cie=new h,lie=new F;ga.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,aie),F.computeViewportTransformation(e,0,1,lie),F.multiplyByPoint(lie,aie,cie),D.fromCartesian3(cie,n)};ga.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var U9e=new se,die=new se;ga.drawingBufferToWgs84Coordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let y=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,y)-1;n=c*(1-a/(f+a))/(c-a)}let l=e.view.passState.viewport,u=se.clone(se.UNIT_W,U9e);u.x=(t.x-l.x)/l.width*2-1,u.y=(t.y-l.y)/l.height*2-1,u.z=n*2-1,u.w=1;let m,p=e.camera.frustum;if(d(p.fovy)){m=F.multiplyByVector(r.inverseViewProjection,u,die);let y=1/m.w;h.multiplyByScalar(m,y,m)}else{let y=p.offCenterFrustum;d(y)&&(p=y),m=die,m.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(u.z*(a-c)-a-c)*.5,m.w=1,m=F.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var Ji=ga;var oun=T(S(),1),k9e={LEFT:-1,NONE:0,RIGHT:1},vc=Object.freeze(k9e);var $un=T(S(),1);var dun=T(S(),1);var HS={};HS._deprecationWarning=zr;var vp=Uint32Array.BYTES_PER_ELEMENT;HS.parse=function(e,t){let n=g(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=vp;let r=o.getUint32(t,!0);if(r!==1)throw new me(`Only Batched 3D Model version 1 is supported.  Version ${r} is not.`);t+=vp;let s=o.getUint32(t,!0);t+=vp;let a=o.getUint32(t,!0);t+=vp;let c=o.getUint32(t,!0);t+=vp;let l=o.getUint32(t,!0);t+=vp;let u=o.getUint32(t,!0);t+=vp;let m;l>=570425344?(t-=vp*2,m=a,l=c,u=0,a=0,c=0,HS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=vp,m=l,l=a,u=c,a=0,c=0,HS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:g(m,0)}:(p=Go(i,t,a),t+=a);let y=new Uint8Array(e,t,c);t+=c;let f,x;l>0&&(f=Go(i,t,l),t+=l,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new me("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(HS._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:y,batchTableJson:f,batchTableBinary:x,gltf:C}};var dX=HS;var pun=T(S(),1);function uX(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function uie(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return d(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function D9e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return d(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}uX.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(d(i))return d(i.byteOffset)?(t=g(t,Q.UNSIGNED_INT),n=g(n,1),uie(this,e,t,n,1,i.byteOffset)):i};uX.prototype.hasProperty=function(e){return d(this.json[e])};uX.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(d(i))return d(i.byteOffset)?(d(i.componentType)&&(t=Q.fromName(i.componentType)),uie(this,e,t,n,this.featuresLength,i.byteOffset)):D9e(this,e,t,i)};uX.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!d(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Zm=uX;var vun=T(S(),1);function mX(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=g(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=B9e(n),a;d(s.jsonProperties)&&(a=new Ep({count:t,properties:s.jsonProperties}));let c;d(s.hierarchy)&&(c=new bx({extension:s.hierarchy,binaryBody:i}));let l=Tm.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,m,p,y;if(o){let _=O9e(t,l,u,i,r);y=_.transcodedSchema,p=[new Fx({propertyAttribute:_.propertyAttributeJson,class:_.transcodedClass})]}else{let _=Y9e(t,l,u,i);y=_.transcodedSchema;let C=_.featureTableJson;m=new bl({count:C.count,properties:C.properties,class:_.transcodedClass,bufferViews:_.bufferViewsTypedArrays}),p=[]}let f=[];if(d(m)||d(a)||d(c)){let _=new Pc({id:0,name:"Batch Table",count:t,metadataTable:m,jsonMetadataTable:a,batchTableHierarchy:c});f.push(_)}let x={schema:y,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new ya(x)}function B9e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;d(t)?(mX._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):d(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=d(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function Y9e(e,t,n,i){let o={},r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;if(!d(i))throw new me(`Property ${m} requires a batch table binary.`);let p=n[m],y=ed(p);r[m]={bufferView:a},o[m]=mie(p),s[a]=y.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let l=Sm.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:l,transcodedClass:l.classes[t]}}function O9e(e,t,n,i,o){let r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;let p=n[m];if(!d(i)&&!d(p.typedArray))throw new me(`Property ${m} requires a batch table binary.`);let y=nn.sanitizeGlslIdentifier(m);(y===""||r.hasOwnProperty(y))&&(y=`property_${a}`,a++);let f=mie(p);f.name=m,r[y]=f;let x=y.toUpperCase();x.startsWith("_")||(x=`_${x}`);let _=p.typedArray;d(_)||(_=ed(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new wt.Attribute;C.name=x,C.count=e,C.type=p.type;let V=Q.fromTypedArray(_);(V===Q.INT||V===Q.UNSIGNED_INT||V===Q.DOUBLE)&&(mX._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),_=new Float32Array(_)),C.componentDatatype=Q.fromTypedArray(_),C.typedArray=_,o.push(C),s[y]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let l=Sm.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:l,transcodedClass:l.classes[t]}}function mie(e){let t=K9e(e.componentType);return{type:e.type,componentType:t}}function K9e(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}mX._deprecationWarning=zr;mX._oneTimeWarning=It;var wp=mX;var Nx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},H9e=wt.FeatureIdAttribute;function Fb(e){e=g(e,g.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=g(e.byteOffset,0),r=g(e.releaseGltfJson,!1),s=g(e.asynchronous,!0),a=g(e.incrementallyLoadTextures,!0),c=g(e.upAxis,Zo.Y),l=g(e.forwardAxis,Zo.X),u=g(e.loadAttributesAsTypedArray,!1),m=g(e.loadAttributesFor2D,!1),p=g(e.loadIndicesForWireframe,!1),y=g(e.loadPrimitiveOutline,!0),f=g(e.loadForClassification,!1);n=d(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=l,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=m,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=y,this._loadForClassification=f,this._state=Nx.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}d(Object.create)&&(Fb.prototype=Object.create(oo.prototype),Fb.prototype.constructor=Fb);Object.defineProperties(Fb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Fb.prototype.load=function(){if(d(this._promise))return this._promise;let e=dX.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Zm(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);d(a)&&(this._transform=F.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new Ip({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=Nx.LOADING;let l=this;return this._promise=c.load().then(function(){if(!l.isDestroyed())return l._state=Nx.PROCESSING,l}).catch(function(u){if(!l.isDestroyed())return z9e(l,u)}),this._promise};function z9e(e,t){e.unload(),e._state=Nx.FAILED;let n="Failed to load b3dm";return t=e.getError(n,t),Promise.reject(t)}Fb.prototype.process=function(e){if(this._state===Nx.READY)return!0;if(this._state!==Nx.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),J9e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=Nx.READY,!0};function J9e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(d(n.json))o=wp({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Pc({name:Tm.BATCH_TABLE_CLASS_NAME,count:i});o=new ya({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)hie(r[a]);t.structuralMetadata=o}function hie(e){let t=e.children.length;for(let i=0;i<t;i++)hie(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=nn.getAttributeBySemantic(o,Ct.FEATURE_ID);if(d(r)){r.setIndex=0;let s=new H9e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Fb.prototype.unload=function(){d(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var hX=Fb;var Tmn=T(S(),1);function Ab(e){e=g(e,g.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}d(Object.create)&&(Ab.prototype=Object.create(oo.prototype),Ab.prototype.constructor=Ab);Object.defineProperties(Ab.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Ab.prototype.load=function(){return Promise.resolve(this)};Ab.prototype.process=function(e){return d(this._components)||(this._components=cMe(this._geoJson,e),this._geoJson=void 0),!0};function Q9e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function j9e(){this.features=[]}function zY(e){let t=e[0],n=e[1],i=g(e[2],0);return new h(t,n,i)}function JY(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=zY(e[o]);return[n]}function q9e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=JY(e[i])[0];return n}function fie(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=JY(e[i])[0];return n}function $9e(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,fie(e[i]));return n}function eMe(e){return[zY(e)]}function tMe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=zY(e[i]);return n}var nMe={LineString:JY,MultiLineString:q9e,MultiPolygon:$9e,Polygon:fie,MultiPoint:tMe,Point:eMe},iMe={LineString:Fe.LINES,MultiLineString:Fe.LINES,MultiPolygon:Fe.LINES,Polygon:Fe.LINES,MultiPoint:Fe.POINTS,Point:Fe.POINTS};function pie(e,t){if(!d(e.geometry))return;let n=e.geometry.type,i=nMe[n],o=iMe[n],r=e.geometry.coordinates;if(!d(i)||!d(r))return;let s=new Q9e;o===Fe.LINES?s.lines=i(r):o===Fe.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function oMe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)pie(n[o],t)}var rMe={FeatureCollection:oMe,Feature:pie},KM=new h;function sMe(e,t,n){let i=0,o=0,r=e.length;for(let A=0;A<r;A++){let M=e[A];if(d(M.lines)){let b=M.lines.length;for(let R=0;R<b;R++){let E=M.lines[R];i+=E.length,o+=(E.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ue.createTypedArray(i,o),l=Ue.fromTypedArray(c),u=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,y=0;for(let A=0;A<r;A++){let M=e[A];if(!d(M.lines))continue;let b=M.lines.length;for(let R=0;R<b;R++){let E=M.lines[R],I=E.length;for(let w=0;w<I;w++){let N=E[w],Y=h.fromDegrees(N.x,N.y,N.z,re.WGS84,KM),k=F.multiplyByPoint(t,Y,KM);h.minimumByComponent(u,k,u),h.maximumByComponent(m,k,m),h.pack(k,s,p*3),a[p]=A,w<I-1&&(c[y*2]=p,c[y*2+1]=p+1,y++),p++}}}let f=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});f.vertexArrayDestroyable=!1;let x=mt.createVertexBuffer({typedArray:a,context:n.context,usage:Ne.STATIC_DRAW});x.vertexArrayDestroyable=!1;let _=mt.createIndexBuffer({typedArray:c,context:n.context,usage:Ne.STATIC_DRAW,indexDatatype:l});_.vertexArrayDestroyable=!1;let C=new wt.Attribute;C.semantic=Ct.POSITION,C.componentDatatype=Q.FLOAT,C.type=an.VEC3,C.count=i,C.min=u,C.max=m,C.buffer=f;let V=new wt.Attribute;V.semantic=Ct.FEATURE_ID,V.setIndex=0,V.componentDatatype=Q.FLOAT,V.type=an.SCALAR,V.count=i,V.buffer=x;let L=[C,V],Z=new wt.Material;Z.unlit=!0;let G=new wt.Indices;G.indexDatatype=l,G.count=c.length,G.buffer=_;let X=new wt.FeatureIdAttribute;X.featureCount=r,X.propertyTableId=0,X.setIndex=0,X.positionalLabel="featureId_0";let P=[X],v=new wt.Primitive;return v.attributes=L,v.indices=G,v.featureIds=P,v.primitiveType=Fe.LINES,v.material=Z,v}function aMe(e,t,n){let i=0,o=e.length;for(let L=0;L<o;L++){let Z=e[L];d(Z.points)&&(i+=Z.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=0;for(let L=0;L<o;L++){let Z=e[L];if(!d(Z.points))continue;let G=Z.points.length;for(let X=0;X<G;X++){let P=Z.points[X],v=h.fromDegrees(P.x,P.y,P.z,re.WGS84,KM),A=F.multiplyByPoint(t,v,KM);h.minimumByComponent(a,A,a),h.maximumByComponent(c,A,c),h.pack(A,r,l*3),s[l]=L,l++}}let u=mt.createVertexBuffer({typedArray:r,context:n.context,usage:Ne.STATIC_DRAW});u.vertexArrayDestroyable=!1;let m=mt.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});m.vertexArrayDestroyable=!1;let p=new wt.Attribute;p.semantic=Ct.POSITION,p.componentDatatype=Q.FLOAT,p.type=an.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let y=new wt.Attribute;y.semantic=Ct.FEATURE_ID,y.setIndex=0,y.componentDatatype=Q.FLOAT,y.type=an.SCALAR,y.count=i,y.buffer=m;let f=[p,y],x=new wt.Material;x.unlit=!0;let _=new wt.FeatureIdAttribute;_.featureCount=o,_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0";let C=[_],V=new wt.Primitive;return V.attributes=f,V.featureIds=C,V.primitiveType=Fe.POINTS,V.material=x,V}function cMe(e,t){let n=new j9e,i=rMe[e.type];d(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new me("GeoJSON must have at least one feature");let s={};for(let A=0;A<r;A++){let M=o[A],b=g(M.properties,g.EMPTY_OBJECT);for(let R in b)b.hasOwnProperty(R)&&(d(s[R])||(s[R]=new Array(r)))}for(let A=0;A<r;A++){let M=o[A];for(let b in s)if(s.hasOwnProperty(b)){let R=g(M.properties[b],"");s[b][A]=R}}let a=new Ep({count:r,properties:s}),l=[new Pc({id:0,count:r,jsonMetadataTable:a})],u=Sm.fromJson({}),m=new ya({schema:u,propertyTables:l}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),y=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,x=!1;for(let A=0;A<r;A++){let M=o[A];if(d(M.lines)){f=!0;let b=M.lines.length;for(let R=0;R<b;R++){let E=M.lines[R],I=E.length;for(let w=0;w<I;w++)h.minimumByComponent(p,E[w],p),h.maximumByComponent(y,E[w],y)}}if(d(M.points)){x=!0;let b=M.points.length;for(let R=0;R<b;R++){let E=M.points[R];h.minimumByComponent(p,E,p),h.maximumByComponent(y,E,y)}}}let _=h.midpoint(p,y,new h),C=h.fromDegrees(_.x,_.y,_.z,re.WGS84,new h),V=vt.eastNorthUpToFixedFrame(C,re.WGS84,new F),L=F.inverseTransformation(V,new F),Z=[];f&&Z.push(sMe(o,L,t)),x&&Z.push(aMe(o,L,t));let G=new wt.Node;G.index=0,G.primitives=Z;let X=[G],P=new wt.Scene;P.nodes=X;let v=new wt.Components;return v.scene=P,v.nodes=X,v.transform=V,v.structuralMetadata=m,v}Ab.prototype.unload=function(){this._components=void 0};var fX=Ab;var ihn=T(S(),1);var Zmn=T(S(),1);var HM={};HM._deprecationWarning=zr;var Mb=Uint32Array.BYTES_PER_ELEMENT;HM.parse=function(e,t){let n=g(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Mb;let r=o.getUint32(t,!0);if(r!==1)throw new me(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Mb;let s=o.getUint32(t,!0);t+=Mb;let a=o.getUint32(t,!0);if(a===0)throw new me("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Mb;let c=o.getUint32(t,!0);t+=Mb;let l=o.getUint32(t,!0);t+=Mb;let u=o.getUint32(t,!0);t+=Mb;let m=o.getUint32(t,!0);if(m!==1&&m!==0)throw new me(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${m} is not.`);t+=Mb;let p=Go(i,t,a);t+=a;let y=new Uint8Array(e,t,c);t+=c;let f,x;l>0&&(f=Go(i,t,l),t+=l,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new me("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(HM._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:y,batchTableJson:f,batchTableBinary:x,gltf:C}};var pX=HM;var Fp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},zM=wt.Attribute,lMe=wt.FeatureIdAttribute,yie=wt.Instances;function Ap(e){e=g(e,g.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=g(e.byteOffset,0),r=g(e.releaseGltfJson,!1),s=g(e.asynchronous,!0),a=g(e.incrementallyLoadTextures,!0),c=g(e.upAxis,Zo.Y),l=g(e.forwardAxis,Zo.X),u=g(e.loadAttributesAsTypedArray,!1),m=g(e.loadIndicesForWireframe,!1),p=g(e.loadPrimitiveOutline,!0);i=d(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=l,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._state=Fp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}d(Object.create)&&(Ap.prototype=Object.create(oo.prototype),Ap.prototype.constructor=Ap);Object.defineProperties(Ap.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Ap.prototype.load=function(){if(d(this._promise))return this._promise;let e=pX.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Zm(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!d(a))throw new me("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);d(c)&&(this._transform=F.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let l={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let m=hl(e.gltf);m=m.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:m});l.gltfResource=p,l.baseResource=p}else l.gltfResource=this._i3dmResource,l.typedArray=e.gltf;let u=new Ip(l);return this._gltfLoader=u,this._state=Fp.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=Fp.PROCESSING,this}).catch(m=>{if(!this.isDestroyed())throw dMe(this,m)}),this._promise};function dMe(e,t){e.unload(),e._state=Fp.FAILED;let n="Failed to load i3dm";return e.getError(n,t)}Ap.prototype.process=function(e){if(this._state===Fp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Fp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),hMe(this,i,e),uMe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Fp.READY,!0};function uMe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(d(n.json))o=wp({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Pc({name:Tm.BATCH_TABLE_CLASS_NAME,count:i});o=new ya({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var JM=new h,QY=new Array(4),mMe=new F;function hMe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,l=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=pMe(o,r),m;c&&(m=new Float32Array(4*r));let p;l&&(p=new Float32Array(3*r));let y=new Float32Array(r),f=h.unpackArray(u),x=new h,_=new h,C=new h,V=new h,L=new $,Z=new Ae,G=new Array(4),X=new h,P=new Array(3),v=new F;if(!d(s)||h.equals(h.unpack(s),h.ZERO)){let k=ce.fromPoints(f);for(i=0;i<f.length;i++)h.subtract(f[i],k.center,JM),u[3*i+0]=JM.x,u[3*i+1]=JM.y,u[3*i+2]=JM.z;let O=F.fromTranslation(k.center,mMe);t.transform=F.multiplyTransformation(O,t.transform,t.transform)}for(i=0;i<r;i++){x=h.clone(f[i]),d(s)&&h.add(x,h.unpack(s),x),c&&(bMe(o,a,i,Z,x,C,_,V,L,v),Ae.pack(Z,G,0),m[4*i+0]=G[0],m[4*i+1]=G[1],m[4*i+2]=G[2],m[4*i+3]=G[3]),l&&(yMe(o,i,X),h.pack(X,P,0),p[3*i+0]=P[0],p[3*i+1]=P[1],p[3*i+2]=P[2]);let k=o.getProperty("BATCH_ID",Q.UNSIGNED_SHORT,1,i);d(k)||(k=i),y[i]=k}let A=new yie;A.transformInWorldSpace=!0;let M=e._buffers,b=new zM;if(b.name="Instance Translation",b.semantic=Nr.TRANSLATION,b.componentDatatype=Q.FLOAT,b.type=an.VEC3,b.count=r,b.typedArray=u,!c){let k=mt.createVertexBuffer({context:n.context,typedArray:u,usage:Ne.STATIC_DRAW});k.vertexArrayDestroyable=!1,M.push(k),b.buffer=k}if(A.attributes.push(b),c){let k=new zM;k.name="Instance Rotation",k.semantic=Nr.ROTATION,k.componentDatatype=Q.FLOAT,k.type=an.VEC4,k.count=r,k.typedArray=m,A.attributes.push(k)}if(l){let k=new zM;if(k.name="Instance Scale",k.semantic=Nr.SCALE,k.componentDatatype=Q.FLOAT,k.type=an.VEC3,k.count=r,c)k.typedArray=p;else{let O=mt.createVertexBuffer({context:n.context,typedArray:p,usage:Ne.STATIC_DRAW});O.vertexArrayDestroyable=!1,M.push(O),k.buffer=O}A.attributes.push(k)}let R=new zM;R.name="Instance Feature ID",R.setIndex=0,R.semantic=Nr.FEATURE_ID,R.componentDatatype=Q.FLOAT,R.type=an.SCALAR,R.count=r;let E=mt.createVertexBuffer({context:n.context,typedArray:y,usage:Ne.STATIC_DRAW});E.vertexArrayDestroyable=!1,M.push(E),R.buffer=E,A.attributes.push(R);let I=new lMe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",A.featureIds.push(I);let w=t.nodes,N=w.length,Y=!1;for(i=0;i<N;i++){let k=w[i];k.primitives.length>0&&(k.instances=Y?fMe(A):A,Y=!0)}}function fMe(e){let t=new yie;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Oe(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function pMe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Q.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!d(i))throw new me("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!d(o))throw new me("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new me("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var bie=new Array(4);function bMe(e,t,n,i,o,r,s,a,c,l){let u=e.getProperty("NORMAL_UP",Q.FLOAT,3,n,QY),m=e.getProperty("NORMAL_RIGHT",Q.FLOAT,3,n,bie),p=!1;if(d(u)){if(!d(m))throw new me("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(u,0,r),h.unpack(m,0,s),p=!0}else{let y=e.getProperty("NORMAL_UP_OCT32P",Q.UNSIGNED_SHORT,2,n,QY),f=e.getProperty("NORMAL_RIGHT_OCT32P",Q.UNSIGNED_SHORT,2,n,bie);if(d(y)){if(!d(f))throw new me("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Kn.octDecodeInRange(y[0],y[1],65535,r),Kn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(vt.eastNorthUpToFixedFrame(o,re.WGS84,l),F.getMatrix3(l,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),Ae.fromRotationMatrix(c,i)}function yMe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Q.FLOAT,1,t);d(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",Q.FLOAT,3,t,QY);d(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function gMe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}Ap.prototype.isUnloaded=function(){return this._state===Fp.UNLOADED};Ap.prototype.unload=function(){d(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),gMe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Fp.UNLOADED};var bX=Ap;var Cfn=T(S(),1);var hfn=T(S(),1);var rhn=T(S(),1),xMe={STOPPED:0,ANIMATING:1},Gm=Object.freeze(xMe);var ofn=T(S(),1);var phn=T(S(),1);var mhn=T(S(),1);function zS(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}zS.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Ae)return Ae};zS.prototype.evaluate=fe.throwInstantiationError;zS.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=g(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};zS.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};zS.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var ro=zS;function JS(e){this._value=e,this._valueType=ro.getPointType(e)}Object.defineProperties(JS.prototype,{value:{get:function(){return this._value}}});JS.prototype.findTimeInterval=function(e){};JS.prototype.wrapTime=function(e){return 0};JS.prototype.clampTime=function(e){return 0};JS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var yX=JS;var vhn=T(S(),1);var Thn=T(S(),1);function QS(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=ro.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(QS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});QS.prototype.findTimeInterval=ro.prototype.findTimeInterval;QS.prototype.wrapTime=ro.prototype.wrapTime;QS.prototype.clampTime=ro.prototype.clampTime;QS.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(d(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var Nb=QS;var Vhn=T(S(),1);var gie={};gie.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var jS=gie;var xie=[],_ie=[],Tie=[],Sie=[];function _Me(e,t,n){let i=xie,o=Tie,r=_ie,s=Sie;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(d(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],d(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],d(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],d(c)||(c=s[a+1]=new h),h.clone(n,c),jS.solve(i,r,o,s)}function TMe(e){let t=xie,n=Tie,i=_ie,o=Sie;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(d(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],d(s)||(s=o[r]=new h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],d(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),jS.solve(t,i,n,o)}function Sl(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=ro.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Sl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Sl.createC1=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Sl({times:t,points:n,inTangents:r,outTangents:o})};Sl.createNaturalCubic=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new Nb({points:n,times:t});let i=TMe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Sl({times:t,points:n,inTangents:r,outTangents:o})};Sl.createClampedCubic=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=ro.getPointType(n[0]);if(n.length<3)return new Nb({points:n,times:t});let s=_Me(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Sl({times:t,points:n,inTangents:c,outTangents:a})};Sl.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Sl.prototype.findTimeInterval=ro.prototype.findTimeInterval;var SMe=new se,qS=new h;Sl.prototype.wrapTime=ro.prototype.wrapTime;Sl.prototype.clampTime=ro.prototype.clampTime;Sl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,l=SMe;l.z=c,l.y=c*c,l.x=l.y*c,l.w=1;let u=F.multiplyByVector(Sl.hermiteCoefficientMatrix,l,l);u.z*=a,u.w*=a;let m=this._pointType;return m===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(d(t)||(t=new m),t=m.multiplyByScalar(n[s],u.x,t),m.multiplyByScalar(n[s+1],u.y,qS),m.add(t,qS,t),m.multiplyByScalar(r[s],u.z,qS),m.add(t,qS,t),m.multiplyByScalar(o[s],u.w,qS),m.add(t,qS,t))};var Ub=Sl;var Nhn=T(S(),1);function $S(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=ro.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties($S.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});$S.prototype.findTimeInterval=ro.prototype.findTimeInterval;$S.prototype.wrapTime=ro.prototype.wrapTime;$S.prototype.clampTime=ro.prototype.clampTime;$S.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(d(t)||(t=new o),o.clone(n[i],t))};var gX=$S;var Ohn=T(S(),1);function CMe(e){let t=e.points,n=e.times;return function(i,o){d(o)||(o=new Ae);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Ae.fastSlerp(a,c,s,o)}}function eC(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=CMe(this),this._lastTimeIndex=0}Object.defineProperties(eC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});eC.prototype.findTimeInterval=ro.prototype.findTimeInterval;eC.prototype.wrapTime=ro.prototype.wrapTime;eC.prototype.clampTime=ro.prototype.clampTime;eC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var xX=eC;var Ux=wt.AnimatedPropertyType;function qY(e){e=g(e,g.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,RMe(this)}Object.defineProperties(qY.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function VMe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new Ub({times:e,points:n,inTangents:i,outTangents:o})}function Cie(e,t,n,i){if(e.length===1&&t.length===1)return new yX(t[0]);switch(n){case Lm.STEP:return new gX({times:e,points:t});case Lm.CUBICSPLINE:return VMe(e,t);case Lm.LINEAR:return i===Ux.ROTATION?new xX({times:e,points:t}):new Nb({times:e,points:t})}}function LMe(e,t,n,i,o){let r=[];if(i===Ux.WEIGHTS){let a=t.length/o,c,l;for(c=0;c<o;c++){let u=new Array(a),m=c;if(n===Lm.CUBICSPLINE)for(l=0;l<a;l+=3)u[l]=t[m],u[l+1]=t[m+o],u[l+2]=t[m+2*o],m+=o*3;else for(l=0;l<a;l++)u[l]=t[m],m+=o;r.push(Cie(e,u,n,i))}}else r.push(Cie(e,t,n,i));return r}var jY;function RMe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,l=d(c.morphWeights)?c.morphWeights.length:1,u=LMe(i,o,r,a,l);switch(e._splines=u,e._path=a,a){case Ux.TRANSLATION:case Ux.SCALE:jY=new h;break;case Ux.ROTATION:jY=new Ae;break;case Ux.WEIGHTS:break}}qY.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===Ux.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],l=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(l)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);o[n]=r.evaluate(s,jY)}}};var _X=qY;function $Y(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=te.clone(n.startTime),this._delay=g(n.delay,0),this._stopTime=te.clone(n.stopTime),this.removeOnStop=g(n.removeOnStop,!1),this._multiplier=g(n.multiplier,1),this._reverse=g(n.reverse,!1),this._loop=g(n.loop,Tl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new ye,this.update=new ye,this.stop=new ye,this._state=Gm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,ZMe(this)}Object.defineProperties($Y.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function ZMe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let l=r[c],u=l.target;if(!d(u))continue;let m=u.node.index,p=i._runtimeNodes[m],y=new _X({channel:l,runtimeAnimation:e,runtimeNode:p}),f=l.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(y)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}$Y.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var TX=$Y;function Mp(e){this.animationAdded=new ye,this.animationRemoved=new ye,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Mp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function eO(e,t,n){let i=e._model,o=new TX(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Mp.prototype.add=function(e){e=g(e,g.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(d(i))return eO(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return eO(this,n[i],e)};Mp.prototype.addAll=function(e){e=g(e,g.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=eO(this,n[r],e);i.push(s)}return i};Mp.prototype.remove=function(e){if(!d(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};Mp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Mp.prototype.contains=function(e){return d(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Mp.prototype.get=function(e){return this._runtimeAnimations[e]};var QM=[];function GMe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Mp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&te.equals(e.time,this._previousTime))return!1;this._previousTime=te.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];d(a._computedStartTime)||(a._computedStartTime=te.addSeconds(g(a.startTime,o),a.delay,new te)),d(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,l=a._duration,u=a.stopTime,m=te.lessThanOrEquals(c,o),p=d(u)&&te.greaterThan(o,u),y=0;if(l!==0){let _=te.secondsDifference(p?u:o,c);y=d(a._animationTime)?a._animationTime(l,_):_/l}let f=a.loop===Tl.REPEAT||a.loop===Tl.MIRRORED_REPEAT,x=(m||f&&!d(a.startTime))&&(y<=1||f)&&!p;if(y===a._prevAnimationDelta){let _=a._state===Gm.STOPPED;if(x!==_)continue}if(a._prevAnimationDelta=y,x||a._state===Gm.ANIMATING){if(x&&a._state===Gm.STOPPED&&(a._state=Gm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Tl.REPEAT)y=y-Math.floor(y);else if(a.loop===Tl.MIRRORED_REPEAT){let C=Math.floor(y),V=y-C;y=C%2===1?1-V:V}a.reverse&&(y=1-y);let _=y*l*a.multiplier;_=W.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Gm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&QM.push(a))}}n=QM.length;for(let s=0;s<n;++s){let a=QM[s];t.splice(t.indexOf(a),1),e.afterRender.push(GMe(this,r,a))}return QM.length=0,i};var SX=Mp;var Dfn=T(S(),1);var Zfn=T(S(),1);function kx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(kx.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return d(this._color)||(this._color=new B),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});kx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};kx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};kx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};kx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};kx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var CX=kx;var Efn=T(S(),1),VX={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};VX.getStyleCommandsNeeded=function(e,t){return t===0?VX.ALL_OPAQUE:t===e?VX.ALL_TRANSLUCENT:VX.OPAQUE_AND_TRANSLUCENT};var Em=Object.freeze(VX);var Ifn=T(S(),1);var kb={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};kb.is3DTiles=function(e){switch(e){case kb.TILE_GLTF:case kb.TILE_B3DM:case kb.TILE_I3DM:case kb.TILE_PNTS:case kb.TILE_GEOJSON:return!0;case kb.GLTF:return!1}};var nr=Object.freeze(kb);function Tr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Em.ALL_OPAQUE,EMe(this)}Object.defineProperties(Tr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return d(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function EMe(e){let t=e._model,n=nr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Ss(s,o)}else for(o=0;o<i;o++)r[o]=new CX({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Wc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Tr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Em.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Tr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Tr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Tr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Tr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Tr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Tr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Tr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Tr.prototype.getFeature=function(e){return this._features[e]};Tr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Tr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Tr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Tr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Tr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Tr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Tr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Tr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Tr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var XMe=new B;Tr.prototype.applyStyle=function(e){if(!d(e)){this.setAllColor(Wc.DEFAULT_COLOR_VALUE),this.setAllShow(Wc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=d(e.color)?g(e.color.evaluateColor(n,XMe),Wc.DEFAULT_COLOR_VALUE):Wc.DEFAULT_COLOR_VALUE,o=d(e.show)?g(e.show.evaluate(n),Wc.DEFAULT_SHOW_VALUE):Wc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Tr.prototype.isDestroyed=function(){return!1};Tr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var LX=Tr;var $Sn=T(S(),1);var Bpn=T(S(),1);var Yfn=T(S(),1),RX=`czm_modelMaterial defaultModelMaterial()
{
    czm_modelMaterial material;
    material.diffuse = vec3(0.0);
    material.specular = vec3(1.0);
    material.roughness = 1.0;
    material.occlusion = 1.0;
    material.normalEC = vec3(0.0, 0.0, 1.0);
    material.emissive = vec3(0.0);
    material.alpha = 1.0;
    return material;
}

vec4 handleAlpha(vec3 color, float alpha)
{
    #ifdef ALPHA_MODE_MASK
    if (alpha < u_alphaCutoff) {
        discard;
    }
    #endif

    return vec4(color, alpha);
}

SelectedFeature selectedFeature;

void main()
{
    #ifdef HAS_MODEL_SPLITTER
    modelSplitterStage();
    #endif

    czm_modelMaterial material = defaultModelMaterial();

    ProcessedAttributes attributes;
    geometryStage(attributes);

    FeatureIds featureIds;
    featureIdStage(featureIds, attributes);

    Metadata metadata;
    MetadataClass metadataClass;
    MetadataStatistics metadataStatistics;
    metadataStage(metadata, metadataClass, metadataStatistics, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    selectedFeatureIdStage(selectedFeature, featureIds);
    #endif

    #ifndef CUSTOM_SHADER_REPLACE_MATERIAL
    materialStage(material, attributes, selectedFeature);
    #endif

    #ifdef HAS_CUSTOM_FRAGMENT_SHADER
    customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
    #endif

    lightingStage(material, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    cpuStylingStage(material, selectedFeature);
    #endif

    #ifdef HAS_MODEL_COLOR
    modelColorStage(material);
    #endif

    #ifdef HAS_PRIMITIVE_OUTLINE
    primitiveOutlineStage(material);
    #endif

    vec4 color = handleAlpha(material.diffuse, material.alpha);

    #ifdef HAS_CLIPPING_PLANES
    modelClippingPlanesStage(color);
    #endif

    #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
    silhouetteStage(color);
    #endif

    out_FragColor = color;
}
`;var Kfn=T(S(),1),ZX=`precision highp float;

czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
    czm_modelVertexOutput vsOutput;
    vsOutput.positionMC = positionMC;
    vsOutput.pointSize = 1.0;
    return vsOutput;
}

void main() 
{
    // Initialize the attributes struct with all
    // attributes except quantized ones.
    ProcessedAttributes attributes;
    initializeAttributes(attributes);

    // Dequantize the quantized ones and add them to the
    // attributes struct.
    #ifdef USE_DEQUANTIZATION
    dequantizationStage(attributes);
    #endif

    #ifdef HAS_MORPH_TARGETS
    morphTargetsStage(attributes);
    #endif

    #ifdef HAS_SKINNING
    skinningStage(attributes);
    #endif

    #ifdef HAS_PRIMITIVE_OUTLINE
    primitiveOutlineStage();
    #endif

    // Compute the bitangent according to the formula in the glTF spec.
    // Normal and tangents can be affected by morphing and skinning, so
    // the bitangent should not be computed until their values are finalized.
    #ifdef HAS_BITANGENTS
    attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
    #endif

    FeatureIds featureIds;
    featureIdStage(featureIds, attributes);

    #ifdef HAS_SELECTED_FEATURE_ID
    SelectedFeature feature;
    selectedFeatureIdStage(feature, featureIds);
    // Handle any show properties that come from the style.
    cpuStylingStage(attributes.positionMC, feature);
    #endif

    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
    // The scene mode 2D pipeline stage and instancing stage add a different
    // model view matrix to accurately project the model to 2D. However, the
    // output positions and normals should be transformed by the 3D matrices
    // to keep the data the same for the fragment shader.
    mat4 modelView = czm_modelView3D;
    mat3 normal = czm_normal3D;
    #else
    // These are used for individual model projection because they will
    // automatically change based on the scene mode.
    mat4 modelView = czm_modelView;
    mat3 normal = czm_normal;
    #endif

    // Update the position for this instance in place
    #ifdef HAS_INSTANCING

        // The legacy instance stage is used when rendering i3dm models that 
        // encode instances transforms in world space, as opposed to glTF models
        // that use EXT_mesh_gpu_instancing, where instance transforms are encoded
        // in object space.
        #ifdef USE_LEGACY_INSTANCING
        mat4 instanceModelView;
        mat3 instanceModelViewInverseTranspose;
        
        legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);

        modelView = instanceModelView;
        normal = instanceModelViewInverseTranspose;
        #else
        instancingStage(attributes);
        #endif

        #ifdef USE_PICKING
        v_pickColor = a_pickColor;
        #endif

    #endif

    Metadata metadata;
    MetadataClass metadataClass;
    MetadataStatistics metadataStatistics;
    metadataStage(metadata, metadataClass, metadataStatistics, attributes);

    #ifdef HAS_CUSTOM_VERTEX_SHADER
    czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
    customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
    #endif

    // Compute the final position in each coordinate system needed.
    // This returns the value that will be assigned to gl_Position.
    vec4 positionClip = geometryStage(attributes, modelView, normal);    

    #ifdef HAS_SILHOUETTE
    silhouetteStage(attributes, positionClip);
    #endif

    #ifdef HAS_POINT_CLOUD_SHOW_STYLE
    float show = pointCloudShowStylingStage(attributes, metadata);
    #else
    float show = 1.0;
    #endif

    #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
    show *= pointCloudBackFaceCullingStage();
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
    v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
    #endif

    #ifdef PRIMITIVE_TYPE_POINTS
        #ifdef HAS_CUSTOM_VERTEX_SHADER
        gl_PointSize = vsOutput.pointSize;
        #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
        gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
        #else
        gl_PointSize = 1.0;
        #endif

        gl_PointSize *= show;
    #endif

    gl_Position = show * positionClip;
}
`;var spn=T(S(),1);function nO(e){e=g(e,g.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],vMe(this)}function IMe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},depthMask:!1}}var WMe={stencilTest:{enabled:!0,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Dn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},PMe={stencilTest:{enabled:!0,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Dn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:Ft.CLASSIFICATION_MASK},stencilMask:Ft.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Rie=[];function vMe(e){let t=e._command,n=Rie;if(e._useDebugWireframe){t.pass=Re.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=GX(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Re.TERRAIN_CLASSIFICATION,s=tO(t,r),a=Vie(t,r);n.length=0,n.push(s,a),e._commandListTerrain=GX(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Lie(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Re.CESIUM_3D_TILE_CLASSIFICATION,s=tO(t,r),a=Vie(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=GX(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Lie(e,n,e._commandList3DTilesPicking))}}function GX(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let l=o[c],u=r[c];for(let m=0;m<a;m++){let p=t[m],y=nt.shallowClone(p);y.count=l,y.offset=u,n.push(y)}}return n}function tO(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Re.TERRAIN_CLASSIFICATION?Dn.ALWAYS:Dn.EQUAL,o=IMe(i);return n.renderState=De.fromCache(o),n}function Vie(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=De.fromCache(WMe),n}var wMe=[];function Lie(e,t,n){let i=De.fromCache(PMe),o=t[0],r=t[1],s=nt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=nt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=wMe;return c.length=0,c.push(s,a),GX(e,c,n)}Object.defineProperties(nO.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ce.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});nO.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=tO(this._command,o),s=Rie;s.length=0,s.push(r),this._commandListIgnoreShow=GX(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var EX=nO;var Zpn=T(S(),1);function jM(e){e=g(e,g.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Re.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,l=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ce.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ce,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=l,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=m,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,FMe(this)}function Np(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=g(e.is2D,!1),this.derivedCommand2D=void 0}Np.clone=function(e){return new Np({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function FMe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new Np({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Np({command:BMe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Np({command:JMe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Np({command:QMe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Np({command:YMe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Np({command:OMe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(jM.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ce.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,MMe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,NMe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,UMe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,kMe(this))}}});function AMe(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ce.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function MMe(e){let t=e.shadows,n=xn.castShadows(t),i=xn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function NMe(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Oe(r.renderState,!0);s.cull.enabled=t,r.renderState=De.fromCache(s)}}}function UMe(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Oe(r.renderState,!0);s.cull.face=t,r.renderState=De.fromCache(s)}}}function kMe(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}jM.prototype.pushCommands=function(e,t){let n=Zie(this,e);n&&!this._has2DCommands&&(DMe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(AMe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&d(i)&&(i!==Em.ALL_OPAQUE&&nC(t,this._translucentCommand,n),i===Em.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||nC(o._backfaceCommands,this._skipLodBackfaceCommand,n),KMe(this,r,n),nC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){nC(t,this._silhouetteModelCommand,n);return}return nC(t,this._originalCommand,n),t}};jM.prototype.pushSilhouetteCommands=function(e,t){let n=Zie(this,e);return nC(t,this._silhouetteColorCommand,n),t};function nC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Zie(e,t){if(t.mode!==ie.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*W.PI;return o<s&&r>s||o<-s&&r>-s}function tC(e,t){if(!d(t))return;let n=Np.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function DMe(e){tC(e,e._originalCommand),tC(e,e._translucentCommand),tC(e,e._skipLodBackfaceCommand),tC(e,e._skipLodStencilCommand),tC(e,e._silhouetteModelCommand),tC(e,e._silhouetteColorCommand)}function BMe(e){let t=nt.shallowClone(e);t.pass=Re.TRANSLUCENT;let n=Oe(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=De.fromCache(n),t}function YMe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Oe(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=De.fromCache(o),i}function OMe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=Oe(e.renderState,!0);o.cull.enabled=!1,(e.pass===Re.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Re.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=Oe(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=De.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function KMe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=HMe(o);if(r!==s){let a=zMe(r),c=Oe(o.renderState,!0);c.stencilTest.reference=a,o.renderState=De.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function HMe(e){return(e.renderState.stencilTest.reference&Ft.SKIP_LOD_MASK)>>>Ft.SKIP_LOD_BIT_SHIFT}function zMe(e){return Ft.CESIUM_3D_TILE_MASK|e<<Ft.SKIP_LOD_BIT_SHIFT}function JMe(e){let t=nt.shallowClone(e),n=Oe(e.renderState,!0);n.cull.enabled=!0,n.cull.face=yi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Oe(t.uniformMap),o=new D(5,5);return i.u_polygonOffset=function(){return o},t.renderState=De.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function QMe(e){let t=nt.shallowClone(e),n=Oe(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ft.SKIP_LOD_MASK,i.reference=Ft.CESIUM_3D_TILE_MASK,i.frontFunction=Dn.GREATER_OR_EQUAL,i.frontOperation.zPass=ht.REPLACE,i.backFunction=Dn.GREATER_OR_EQUAL,i.backOperation.zPass=ht.REPLACE,n.stencilMask=Ft.CESIUM_3D_TILE_MASK|Ft.SKIP_LOD_MASK,t.renderState=De.fromCache(n),t}var XX=jM;function jMe(e,t){let n=e.shaderBuilder;n.addVertexLines(ZX),n.addFragmentLines(RX);let i=qMe(e),o=new ni({context:t.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=n.buildShaderProgram(t.context);r._pipelineResources.push(s);let a=e.alphaOptions.pass,c=r.sceneGraph,l=t.mode===ie.SCENE3D,u,m;if(!l&&!t.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new F),m=e.runtimePrimitive.boundingSphere2D;else{let V=l?c._computedModelMatrix:c._computedModelMatrix2D;u=F.multiplyTransformation(V,e.runtimeNode.computedTransform,new F),m=ce.transform(e.boundingSphere,u,e.boundingSphere)}let p=Oe(De.fromCache(e.renderStateOptions),!0);p.cull.face=nn.getCullFace(u,e.primitiveType),p=De.fromCache(p);let y=d(r.classificationType),f=y?!1:xn.castShadows(r.shadows),x=y?!1:xn.receiveShadows(r.shadows),_=y?void 0:e.pickId,C=new nt({boundingVolume:m,modelMatrix:u,uniformMap:e.uniformMap,renderState:p,vertexArray:o,shaderProgram:s,cull:r.cull,pass:a,count:e.count,owner:r,pickId:_,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:f,receiveShadows:x});return y?new EX({primitiveRenderResources:e,command:C}):new XX({primitiveRenderResources:e,command:C})}function qMe(e){let t=e.wireframeIndexBuffer;if(d(t))return t;let n=e.indices;if(d(n))return n.buffer}var IX=jMe;var Jpn=T(S(),1);var Gie={name:"TilesetPipelineStage"};Gie.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,Le.FRAGMENT);let r={u_polygonOffset:function(){return D.ZERO}};e.uniformMap=xt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ft.setCesium3DTileBit(),i.stencilMask=Ft.CESIUM_3D_TILE_MASK};var WX=Gie;var o0n=T(S(),1);var jpn=T(S(),1),PX=`vec3 proceduralIBL(
    vec3 positionEC,
    vec3 normalEC,
    vec3 lightDirectionEC,
    vec3 lightColorHdr,
    czm_pbrParameters pbrParameters
) {
    vec3 v = -positionEC;
    vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));
    vec3 vWC = -normalize(positionWC);
    vec3 l = normalize(lightDirectionEC);
    vec3 n = normalEC;
    vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));

    float NdotL = clamp(dot(n, l), 0.001, 1.0);
    float NdotV = abs(dot(n, v)) + 0.001;

    // Figure out if the reflection vector hits the ellipsoid
    float vertexRadius = length(positionWC);
    float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);
    float reflectionDotNadir = dot(r, normalize(positionWC));
    // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
    r.x = -r.x;
    r = -normalize(czm_temeToPseudoFixed * r);
    r.x = -r.x;

    vec3 diffuseColor = pbrParameters.diffuseColor;
    float roughness = pbrParameters.roughness;
    vec3 specularColor = pbrParameters.f0;

    float inverseRoughness = 1.04 - roughness;
    inverseRoughness *= inverseRoughness;
    vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness;

    float atmosphereHeight = 0.05;
    float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);
    float blendRegionOffset = roughness * -1.0;
    float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);
    float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);
    float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);
    float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);
    vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);
    vec3 nadirColor = belowHorizonColor * 0.5;
    vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);
    vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);
    vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);
    vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); 
    float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;  
    float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));
    vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);
    float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);
    vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);
    specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);
    specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);

    // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf
    #ifdef USE_SUN_LUMINANCE 
    // Angle between sun and zenith
    float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);
    float S = acos(LdotZenith);
    // Angle between zenith and current pixel
    float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);
    // Angle between sun and current pixel
    float gamma = acos(NdotL);
    float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));
    float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));
    float luminance = model_luminanceAtZenith * (numerator / denominator);
    #endif 

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);
    float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);
    vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);
    iblColor *= lightColor;

    #ifdef USE_SUN_LUMINANCE 
    iblColor *= luminance;
    #endif

    return iblColor;
}

#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
vec3 textureIBL(
    vec3 positionEC,
    vec3 normalEC,
    vec3 lightDirectionEC,
    czm_pbrParameters pbrParameters
) {
    vec3 diffuseColor = pbrParameters.diffuseColor;
    float roughness = pbrParameters.roughness;
    vec3 specularColor = pbrParameters.f0;

    vec3 v = -positionEC;
    vec3 n = normalEC;
    vec3 l = normalize(lightDirectionEC);
    vec3 h = normalize(v + l);

    float NdotV = abs(dot(n, v)) + 0.001;
    float VdotH = clamp(dot(v, h), 0.0, 1.0);

    const mat3 yUpToZUp = mat3(
        -1.0, 0.0, 0.0,
        0.0, 0.0, -1.0, 
        0.0, 1.0, 0.0
    ); 
    vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); 

    #ifdef DIFFUSE_IBL 
        #ifdef CUSTOM_SPHERICAL_HARMONICS
        vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); 
        #else
        vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); 
        #endif 
    #else 
    vec3 diffuseIrradiance = vec3(0.0); 
    #endif 

    #ifdef SPECULAR_IBL
    vec3 r0 = specularColor.rgb;
    float reflectance = max(max(r0.r, r0.g), r0.b);
    vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
    vec3 F = fresnelSchlick2(r0, r90, VdotH);
    
    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
      #ifdef CUSTOM_SPECULAR_IBL 
      vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);
      #else 
      vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir,  roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);
      #endif 
    specularIBL *= F * brdfLut.x + brdfLut.y;
    #else 
    vec3 specularIBL = vec3(0.0); 
    #endif

    return diffuseColor * diffuseIrradiance + specularColor * specularIBL;
}
#endif

vec3 imageBasedLightingStage(
    vec3 positionEC,
    vec3 normalEC,
    vec3 lightDirectionEC,
    vec3 lightColorHdr,
    czm_pbrParameters pbrParameters
) {
  #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
  // Environment maps were provided, use them for IBL
  return textureIBL(
      positionEC,
      normalEC,
      lightDirectionEC,
      pbrParameters
  );
  #else
  // Use the procedural IBL if there are no environment maps
  return proceduralIBL(
      positionEC,
      normalEC,
      lightDirectionEC,
      lightColorHdr,
      pbrParameters
  );
  #endif
}`;var Eie={name:"ImageBasedLightingPipelineStage"};Eie.process=function(e,t,n){let i=t.imageBasedLighting,o=e.shaderBuilder;o.addDefine("USE_IBL_LIGHTING",void 0,Le.FRAGMENT),o.addUniform("vec2","model_iblFactor",Le.FRAGMENT),pm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",Le.FRAGMENT),d(i.sphericalHarmonicCoefficients)?(o.addDefine("DIFFUSE_IBL",void 0,Le.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,Le.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",Le.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,Le.FRAGMENT),d(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(o.addDefine("SPECULAR_IBL",void 0,Le.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,Le.FRAGMENT),o.addUniform("sampler2D","model_specularEnvironmentMaps",Le.FRAGMENT),o.addUniform("vec2","model_specularEnvironmentMapsSize",Le.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",Le.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,Le.FRAGMENT)),d(i.luminanceAtZenith)&&(o.addDefine("USE_SUN_LUMINANCE",void 0,Le.FRAGMENT),o.addUniform("float","model_luminanceAtZenith",Le.FRAGMENT)),o.addFragmentLines(PX);let r={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=xt(r,e.uniformMap)};var vX=Eie;var g0n=T(S(),1);var m0n=T(S(),1);var $Me=W.EPSILON16;function oO(e){e=g(e,g.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(oO.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,$Me)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var e5e=new h,iO=new $;oO.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=e5e,o;switch(t){case za.XROTATE:o=$.fromRotationX(W.toRadians(n),iO),e=F.multiplyByMatrix3(e,o,e);break;case za.YROTATE:o=$.fromRotationY(W.toRadians(n),iO),e=F.multiplyByMatrix3(e,o,e);break;case za.ZROTATE:o=$.fromRotationZ(W.toRadians(n),iO),e=F.multiplyByMatrix3(e,o,e);break;case za.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case za.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case za.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case za.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case za.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case za.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case za.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var wX=oO;function qM(e){e=g(e,g.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,t5e(this)}Object.defineProperties(qM.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function t5e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new wX({stage:a,runtimeArticulation:e});o.push(c);let l=a.name;r[l]=c}}qM.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];d(n)&&(n.currentValue=t)};var n5e=new F,i5e=new F;qM.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,n5e),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,i5e);s.transform=a}};var FX=qM;var Z0n=T(S(),1);var _0n=T(S(),1),AX=`void modelColorStage(inout czm_modelMaterial material)
{
    material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
    float highlight = ceil(model_colorBlend);
    material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
    material.alpha *= model_color.a;
}`;var iC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};iC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,Le.FRAGMENT),i.addFragmentLines(AX);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=Re.TRANSLUCENT),i.addUniform("vec4",iC.COLOR_UNIFORM_NAME,Le.FRAGMENT),o[iC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",iC.COLOR_BLEND_UNIFORM_NAME,Le.FRAGMENT),o[iC.COLOR_BLEND_UNIFORM_NAME]=function(){return Ha.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=xt(o,e.uniformMap)};var Db=iC;var A0n=T(S(),1);var E0n=T(S(),1),MX=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
vec4 getClippingPlane(
    highp sampler2D packedClippingPlanes,
    int clippingPlaneNumber,
    mat4 transform
) {
    int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
    int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    vec4 plane = texture(packedClippingPlanes, vec2(u, v));
    return czm_transformPlane(plane, transform);
}
#else
// Handle uint8 clipping texture instead
vec4 getClippingPlane(
    highp sampler2D packedClippingPlanes,
    int clippingPlaneNumber,
    mat4 transform
) {
    int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
    int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
    int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
    vec4 plane;
    plane.xyz = czm_octDecode(oct, 65535.0);
    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
    return czm_transformPlane(plane, transform);
}
#endif

float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float pixelWidth = czm_metersPerPixel(position);
    
    #ifdef UNION_CLIPPING_REGIONS
    float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
    #else
    float clipAmount = 0.0;
    bool clipped = true;
    #endif

    for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        
        #ifdef UNION_CLIPPING_REGIONS
        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
        if (amount <= 0.0) {
            discard;
        }
        #else
        clipAmount = max(amount, clipAmount);
        clipped = clipped && (amount <= 0.0);
        #endif
    }

    #ifndef UNION_CLIPPING_REGIONS
    if (clipped) {
        discard;
    }
    #endif
    
    return clipAmount;
}

void modelClippingPlanesStage(inout vec4 color)
{
    float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
    vec4 clippingPlanesEdgeColor = vec4(1.0);
    clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
    float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
    
    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
        color = clippingPlanesEdgeColor;
    }
}
`;var Xie={name:"ModelClippingPlanesPipelineStage"},o5e=new D;Xie.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,Le.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,Le.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,Le.FRAGMENT),ss.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,Le.FRAGMENT);let s=ss.getTextureResolution(i,o,o5e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,Le.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,Le.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",Le.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",Le.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",Le.FRAGMENT),r.addFragmentLines(MX);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=B.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var NX=Xie;var U0n=T(S(),1);function Iie(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Iie.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){d(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var UX=Iie;var Pbn=T(S(),1);var fbn=T(S(),1);var D0n=T(S(),1),kX=`mat4 getInstancingTransform()
{
    mat4 instancingTransform;

    #ifdef HAS_INSTANCE_MATRICES
    instancingTransform = mat4(
        a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
        a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
        a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
        a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0  // Column 4
    );
    #else
    vec3 translation = vec3(0.0, 0.0, 0.0);
    vec3 scale = vec3(1.0, 1.0, 1.0);
    
        #ifdef HAS_INSTANCE_TRANSLATION
        translation = a_instanceTranslation;
        #endif
        #ifdef HAS_INSTANCE_SCALE
        scale = a_instanceScale;
        #endif

    instancingTransform = mat4(
        scale.x, 0.0, 0.0, 0.0,
        0.0, scale.y, 0.0, 0.0,
        0.0, 0.0, scale.z, 0.0,
        translation.x, translation.y, translation.z, 1.0
    ); 
    #endif

    return instancingTransform;
}

#ifdef USE_2D_INSTANCING
mat4 getInstancingTransform2D()
{
    mat4 instancingTransform2D;

    #ifdef HAS_INSTANCE_MATRICES
    instancingTransform2D = mat4(
        a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
        a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
        a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
        a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0  // Column 4
    );
    #else
    vec3 translation2D = vec3(0.0, 0.0, 0.0);
    vec3 scale = vec3(1.0, 1.0, 1.0);
    
        #ifdef HAS_INSTANCE_TRANSLATION
        translation2D = a_instanceTranslation2D;
        #endif
        #ifdef HAS_INSTANCE_SCALE
        scale = a_instanceScale;
        #endif

    instancingTransform2D = mat4(
        scale.x, 0.0, 0.0, 0.0,
        0.0, scale.y, 0.0, 0.0,
        0.0, 0.0, scale.z, 0.0,
        translation2D.x, translation2D.y, translation2D.z, 1.0
    ); 
    #endif

    return instancingTransform2D;
}
#endif
`;var Y0n=T(S(),1),DX=`void instancingStage(inout ProcessedAttributes attributes) 
{
    vec3 positionMC = attributes.positionMC;
    
    mat4 instancingTransform = getInstancingTransform();
    
    attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
    #endif

    #ifdef USE_2D_INSTANCING
    mat4 instancingTransform2D = getInstancingTransform2D();
    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
    #endif
}
`;var K0n=T(S(),1),BX=`void legacyInstancingStage(
    inout ProcessedAttributes attributes,
    out mat4 instanceModelView,
    out mat3 instanceModelViewInverseTranspose)
{
    vec3 positionMC = attributes.positionMC;

    mat4 instancingTransform = getInstancingTransform();
 
    mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
    instanceModelView = u_instance_modifiedModelView;
    instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);

    attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
    
    #ifdef USE_2D_INSTANCING
    mat4 instancingTransform2D = getInstancingTransform2D();
    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
    #endif
}
`;var $M=new F,r5e=new F,s5e=new F,Pie={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Mie,_transformsToTypedArray:sO};Pie.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(kX);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,l=n.mode!==ie.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=[];T5e(e,n,i,u,l),V5e(e,n,i,u);let m={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,Le.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",Le.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",Le.VERTEX),m.u_instance_modifiedModelView=function(){let p=F.multiplyTransformation(s.modelMatrix,a.components.transform,$M);return l?F.multiplyTransformation(n.context.uniformState.view3D,p,$M):(n.mode!==ie.SCENE3D&&(p=vt.basisTo2D(n.mapProjection,p,$M)),F.multiplyTransformation(n.context.uniformState.view,p,$M))},m.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,r5e)},r.addVertexLines(BX)):r.addVertexLines(DX),l){r.addDefine("USE_2D_INSTANCING",void 0,Le.VERTEX),r.addUniform("mat4","u_modelView2D",Le.VERTEX);let p=n.context,y=F.fromTranslation(c.instancingReferencePoint2D,new F);m.u_modelView2D=function(){return F.multiplyTransformation(p.uniformState.view,y,s5e)}}e.uniformMap=xt(m,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,u)};var YX=new F,a5e=new h;function c5e(e,t,n,i,o){let r=F.multiplyTransformation(t,e,YX);return r=F.multiplyTransformation(r,n,YX),o=vt.basisTo2D(i.mapProjection,r,o),o}function l5e(e,t,n,i,o){let r=F.fromTranslation(e,YX),s=F.multiplyTransformation(t,r,YX);s=F.multiplyTransformation(s,n,YX);let a=F.getTranslation(s,a5e);return o=Ji.computeActualWgs84Position(i,a,o),o}function vie(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var wie=new F,Fie=new F,d5e=new F,u5e=new h;function m5e(e,t,n,i){let o=wie,r=Fie;vie(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let l=0;l<c;l++){let u=e[l],m=c5e(u,o,r,n,d5e),p=F.getTranslation(m,u5e),y=h.subtract(p,a,p);i[l]=F.setTranslation(m,y,i[l])}return i}function h5e(e,t,n,i){let o=wie,r=Fie;vie(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let l=0;l<c;l++){let u=e[l],m=l5e(u,o,r,n,u);i[l]=h.subtract(m,a,i[l])}return i}var f5e=new h,p5e=new h;function Aie(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,f5e),r=Ji.computeActualWgs84Position(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,p5e),a=Ji.computeActualWgs84Position(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function sO(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function b5e(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var y5e=new h,g5e=new Ae,x5e=new h;function Mie(e,t,n){let i=new Array(t),o=nn.getAttributeBySemantic(e,Nr.TRANSLATION),r=nn.getAttributeBySemantic(e,Nr.ROTATION),s=nn.getAttributeBySemantic(e,Nr.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=d(o),u=d(r),m=d(s),p=l?o.typedArray:new Float32Array(t*3),y=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(y=Kn.dequantize(y,r.componentDatatype,r.type,t));let f;m?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let _=0;_<t;_++){let C=new h(p[_*3],p[_*3+1],p[_*3+2],y5e);h.maximumByComponent(a,C,a),h.minimumByComponent(c,C,c);let V=new Ae(y[_*4],y[_*4+1],y[_*4+2],u?y[_*4+3]:1,g5e),L=new h(f[_*3],f[_*3+1],f[_*3+2],x5e),Z=F.fromTranslationQuaternionRotationScale(C,V,L,new F);i[_]=Z}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,l&&(o.typedArray=void 0),u&&(r.typedArray=void 0),m&&(s.typedArray=void 0),i}function _5e(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let l=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=l,h.minimumByComponent(r,l,r),h.maximumByComponent(s,l,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function aO(e,t){let n=mt.createVertexBuffer({context:t.context,typedArray:e,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function T5e(e,t,n,i,o){let r=nn.getAttributeBySemantic(n,Nr.ROTATION);d(r)?S5e(e,n,i,t,o):C5e(e,n,i,t,o)}function S5e(e,t,n,i,o){let r=e.shaderBuilder,s=t.attributes[0].count,a=e.model,c=e.runtimeNode;r.addDefine("HAS_INSTANCE_MATRICES");let l="Transform",u,m=c.instancingTransformsBuffer;if(!d(m)){u=Mie(t,s,e);let x=sO(u);m=aO(x,i),a._modelResources.push(m),c.instancingTransformsBuffer=m}if(Wie(e,m,n,l),!o)return;let p=Oe(i);p.mode=ie.COLUMBUS_VIEW,Aie(e,p);let y=c.instancingTransformsBuffer2D;if(!d(y)){let x=m5e(u,e,p,u),_=sO(x);y=aO(_,i),a._modelResources.push(y),c.instancingTransformsBuffer2D=y}Wie(e,y,n,"Transform2D")}function C5e(e,t,n,i,o){let r=e.shaderBuilder,s=e.runtimeNode,a=nn.getAttributeBySemantic(t,Nr.TRANSLATION),c=nn.getAttributeBySemantic(t,Nr.SCALE);if(d(c)){r.addDefine("HAS_INSTANCE_SCALE");let C="Scale";rO(e,c.buffer,c.byteOffset,c.byteStride,n,C)}if(!d(a))return;let l,u=a.typedArray;d(u)?l=_5e(a,a.count,e):d(s.instancingTranslationMin)||(s.instancingTranslationMin=a.min,s.instancingTranslationMax=a.max),r.addDefine("HAS_INSTANCE_TRANSLATION");let m="Translation";if(rO(e,a.buffer,a.byteOffset,a.byteStride,n,m),!o)return;let p=Oe(i);p.mode=ie.COLUMBUS_VIEW,Aie(e,p);let y=s.instancingTranslationBuffer2D;if(!d(y)){let C=h5e(l,e,p,l),V=b5e(C);y=aO(V,i),e.model._modelResources.push(y),s.instancingTranslationBuffer2D=y}rO(e,y,0,void 0,n,"Translation2D")}function Wie(e,t,n,i){let r=Q.getSizeInBytes(Q.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function rO(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function V5e(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===Nr.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:an.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var OX=Pie;var xbn=T(S(),1);var cO={};cO.name="ModelMatrixUpdateStage";cO.update=function(e,t,n){let i=n.mode!==ie.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Nie(e,t,o,e.transformToRoot),e._transformDirty=!1}};function Nie(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let c=e.runtimePrimitives[o].drawCommand;c.modelMatrix=F.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=nn.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),Nie(a,t,n,i),a._transformDirty=!1}}var KX=cO;var Sbn=T(S(),1);var Uie={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:kie,_countGeneratedBuffers:Die};Uie.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;kie(i,o),Die(i,r)};function kie(e,t){if(!d(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];d(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Die(e,t){d(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),d(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),d(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var HX=Uie;function oC(e){e=g(e,g.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,L5e(this)}Object.defineProperties(oC.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return d(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),lO(this,t))}},rotation:{get:function(){return d(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Ae.equals(n,e)||(t.rotation=Ae.clone(e,t.rotation),lO(this,t))}},scale:{get:function(){return d(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),lO(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function L5e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;d(o.matrix)||(e._transformParameters=new yb(o.translation,o.rotation,o.scale)),d(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(d(r)){let c=e.sceneGraph._runtimeArticulations[r];d(c)&&c.runtimeNodes.push(e)}}function lO(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}oC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};oC.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,d(e.instances)&&t.push(OX),t.push(HX),n.push(KX)};oC.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};oC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!d(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){d(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var zX=oC;var wTn=T(S(),1);var Ubn=T(S(),1);var Bie={name:"AlphaPipelineStage"};Bie.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=g(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===Re.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;d(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,Le.FRAGMENT),s.addUniform("float","u_alphaCutoff",Le.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var JX=Bie;var Ybn=T(S(),1);var Yie={name:"BatchTexturePipelineStage"};Yie.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return g(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var QX=Yie;var jbn=T(S(),1);var Oie={name:"ClassificationPipelineStage"};Oie.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,Le.BOTH);let o=e.runtimePrimitive;d(o.batchLengths)||R5e(t,o)};function R5e(e,t){let n=nn.getAttributeBySemantic(e,Ct.POSITION);if(!d(n))throw new me("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=d(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=nn.getAttributeBySemantic(e,Ct.FEATURE_ID,0);if(!d(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let l=[],u=[0],m=r?i[0]:0,p=c[m],y=0;for(let x=1;x<s;x++){let _=r?i[x]:x,C=c[_];if(C!==p){let V=x-y,L=x;l.push(V),u.push(L),y=L,p=C}}let f=s-y;l.push(f),t.batchLengths=l,t.batchOffsets=u}var jX=Oie;var dyn=T(S(),1);var $bn=T(S(),1),qX=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {
        // If the model has a translucent silhouette, it needs to render during the silhouette color command,
        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
        #ifdef HAS_SILHOUETTE
        positionMC *= float(model_silhouettePass);
        #else
        positionMC *= 0.0;
        #endif
    }
    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        positionMC *= 0.0;
    }
}

void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
{
    float show = ceil(feature.color.a);
    positionMC *= show;

    #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
    filterByPassType(positionMC, feature.color);
    #endif
}
`;var tyn=T(S(),1),$X=`void filterByPassType(vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {   
        // If the model has a translucent silhouette, it needs to render during the silhouette color command,
        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
        #ifdef HAS_SILHOUETTE
        if(!model_silhouettePass) {
            discard;
        }
        #else
        discard;
        #endif
    }
    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        discard;
    }
}

void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
{
    vec4 featureColor = feature.color;
    if (featureColor.a == 0.0)
    {
        discard;
    }

    // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
    // So, we only apply in in the fragment shader if the feature ID texture is used.
    #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
    filterByPassType(featureColor);
    #endif

    featureColor = czm_gammaCorrect(featureColor);

    // Classification models compute the diffuse differently.
    #ifdef HAS_CLASSIFICATION
    material.diffuse = featureColor.rgb * featureColor.a;
    #else
    float highlight = ceil(model_colorBlend);
    material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
    #endif
    
    material.alpha *= featureColor.a;
}
`;var Kie={name:"CPUStylingPipelineStage"};Kie.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(qX),o.addFragmentLines($X),o.addDefine("USE_CPU_STYLING",void 0,Le.BOTH),d(i.color)||(o.addUniform("float",Db.COLOR_BLEND_UNIFORM_NAME,Le.FRAGMENT),e.uniformMap[Db.COLOR_BLEND_UNIFORM_NAME]=function(){return Ha.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",Le.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Re.TRANSLUCENT}};var eI=Kie;var myn=T(S(),1),Hie={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Hie.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Up=Object.freeze(Hie);var agn=T(S(),1);var fyn=T(S(),1),tI=`void customShaderStage(
    inout czm_modelVertexOutput vsOutput, 
    inout ProcessedAttributes attributes, 
    FeatureIds featureIds,
    Metadata metadata,
    MetadataClass metadataClass,
    MetadataStatistics metadataStatistics
) {
    // VertexInput and initializeInputStruct() are dynamically generated in JS, 
    // see CustomShaderPipelineStage.js
    VertexInput vsInput;
    initializeInputStruct(vsInput, attributes);
    vsInput.featureIds = featureIds;
    vsInput.metadata = metadata;
    vsInput.metadataClass = metadataClass;
    vsInput.metadataStatistics = metadataStatistics;
    vertexMain(vsInput, vsOutput);
    attributes.positionMC = vsOutput.positionMC;
}
`;var byn=T(S(),1),nI=`void customShaderStage(
    inout czm_modelMaterial material,
    ProcessedAttributes attributes,
    FeatureIds featureIds,
    Metadata metadata,
    MetadataClass metadataClass,
    MetadataStatistics metadataStatistics
) {
    // FragmentInput and initializeInputStruct() are dynamically generated in JS, 
    // see CustomShaderPipelineStage.js
    FragmentInput fsInput;
    initializeInputStruct(fsInput, attributes);
    fsInput.featureIds = featureIds;
    fsInput.metadata = metadata;
    fsInput.metadataClass = metadataClass;
    fsInput.metadataStatistics = metadataStatistics;
    fragmentMain(fsInput, material);
}
`;var Pyn=T(S(),1);var gyn=T(S(),1),iI=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
}
`;var _yn=T(S(),1),oI=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) 
{
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
  setFeatureIdVaryings();
}
`;var Ai={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Ai.process=function(e,t,n){let i=e.shaderBuilder;Z5e(i);let o=e.runtimeNode.node.instances;d(o)&&G5e(e,o,n),E5e(e,t,n),i.addVertexLines(oI),i.addFragmentLines(iI)};function Z5e(e){e.addStruct(Ai.STRUCT_ID_FEATURE_IDS_VS,Ai.STRUCT_NAME_FEATURE_IDS,Le.VERTEX),e.addStruct(Ai.STRUCT_ID_FEATURE_IDS_FS,Ai.STRUCT_NAME_FEATURE_IDS,Le.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Le.VERTEX),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Le.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Le.VERTEX),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Le.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Ai.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,Le.VERTEX)}function G5e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof wt.FeatureIdAttribute?X5e(e,s,a):zie(e,s,a,o,1,n);let c=s.label;d(c)&&Jie(e,a,c,Le.BOTH)}}function E5e(e,t,n){let i=t.featureIds,r=nn.getAttributeBySemantic(t,Ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,l=Le.BOTH;a instanceof wt.FeatureIdAttribute?I5e(e,a,c):a instanceof wt.FeatureIdImplicitRange?zie(e,a,c,r,void 0,n):(W5e(e,a,c,s,n),l=Le.FRAGMENT);let u=a.label;d(u)&&Jie(e,c,u,l)}}function X5e(e,t,n){let i=e.shaderBuilder;i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,l=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[l]),i.addVarying("float",a),i.addFunctionLines(Ai.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function I5e(e,t,n){let i=e.shaderBuilder;i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function zie(e,t,n,i,o,r){P5e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Ai.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function W5e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return g(a.texture,o.context.defaultTexture)};let c=a.channels,l=e.shaderBuilder;l.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n),l.addUniform("sampler2D",r,Le.FRAGMENT);let u=`v_texCoord_${a.texCoord}`,m=`texture(${r}, ${u}).${c}`,p=`featureIds.${n} = czm_unpackUint(${m});`;l.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[p])}function Jie(e,t,n,i){let o=e.shaderBuilder,r=Le.includesVertexShader(i);r&&o.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function P5e(e,t,n,i,o){let r=e.model,s,a;if(d(t.repeat)){let l=v5e(t,n);s=mt.createVertexBuffer({context:o.context,typedArray:l,usage:Ne.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s);let u=!1;r.statistics.addBuffer(s,u)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Q.FLOAT,strideInBytes:Q.getSizeInBytes(Q.FLOAT),offsetInBytes:0};e.attributes.push(c)}function v5e(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var Bb=Ai;var Oyn=T(S(),1);var wyn=T(S(),1),rI=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var Ayn=T(S(),1),sI=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
  setMetadataVaryings();
}
`;var Vi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Vi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=w5e(r.propertyAttributes,t,a),l=A5e(r.propertyTextures,a),u=c.concat(l);N5e(i,u),D5e(i),i.addVertexLines(sI),i.addFragmentLines(rI);for(let m=0;m<c.length;m++){let p=c[m];B5e(e,p)}for(let m=0;m<l.length;m++){let p=l[m];O5e(e,p)}};function w5e(e,t,n){return d(e)?e.flatMap(i=>F5e(i,t,n)):[]}function F5e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=nn,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),l=new Array(c.length);for(let u=0;u<c.length;u++){let[m,p]=c[u],y=i(t,p.attribute),{glslType:f,variableName:x}=o(y);l[u]={metadataVariable:r(m),property:p,type:p.classProperty.type,glslType:f,variableName:x,propertyStatistics:a?.properties[m],shaderDestination:Le.BOTH}}return l}function A5e(e,t){return d(e)?e.flatMap(n=>M5e(n,t)):[]}function M5e(e,t){let{sanitizeGlslIdentifier:n}=nn,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,l]=r[a];s[a]={metadataVariable:n(c),property:l,type:l.classProperty.type,glslType:l.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:Le.FRAGMENT}}return s}function N5e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:l,propertyStatistics:u}=t[a];n.add(l),d(u)&&c!==Ot.ENUM&&i.add(l)}let o=Vi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Vi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,l){e.addStruct(a,a,Le.BOTH);for(let u=0;u<l.length;u++){let{shaderName:m}=l[u],p=l[u].type==="float"?k5e(c):c;e.addStructField(a,p,m)}}}var U5e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function k5e(e){let t=U5e[e];return d(t)?t:e}function D5e(e){e.addStruct(Vi.STRUCT_ID_METADATA_VS,Vi.STRUCT_NAME_METADATA,Le.VERTEX),e.addStruct(Vi.STRUCT_ID_METADATA_FS,Vi.STRUCT_NAME_METADATA,Le.FRAGMENT),e.addStruct(Vi.STRUCT_ID_METADATA_CLASS_VS,Vi.STRUCT_NAME_METADATA_CLASS,Le.VERTEX),e.addStruct(Vi.STRUCT_ID_METADATA_CLASS_FS,Vi.STRUCT_NAME_METADATA_CLASS,Le.FRAGMENT),e.addStruct(Vi.STRUCT_ID_METADATA_STATISTICS_VS,Vi.STRUCT_NAME_METADATA_STATISTICS,Le.VERTEX),e.addStruct(Vi.STRUCT_ID_METADATA_STATISTICS_FS,Vi.STRUCT_NAME_METADATA_STATISTICS,Le.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,Vi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Le.VERTEX),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,Vi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Le.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_SET_METADATA_VARYINGS,Vi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,Le.VERTEX)}function B5e(e,t){Y5e(e,t),Qie(e.shaderBuilder,t),jie(e.shaderBuilder,t)}function Y5e(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=$ie({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:Le.BOTH,property:o});n.addStructField(Vi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Vi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function O5e(e,t){K5e(e,t),Qie(e.shaderBuilder,t),jie(e.shaderBuilder,t)}function K5e(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:l,texture:u}=s.textureReader,m=`u_propertyTexture_${l}`;i.hasOwnProperty(m)||(n.addUniform("sampler2D",m,Le.FRAGMENT),i[m]=()=>u),n.addStructField(Vi.STRUCT_ID_METADATA_FS,r,o);let p=`attributes.texCoord_${a}`,y=`texture(${m}, ${p}).${c}`,f=s.unpackInShader(y),x=$ie({valueExpression:f,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:Le.FRAGMENT,property:s}),_=`metadata.${o} = ${x};`;n.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,[_])}function Qie(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=qie(Vi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Vi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),Le.includesVertexShader(r)&&(e.addStructField(Vi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function jie(e,t){let{propertyStatistics:n}=t;if(!d(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===Ot.ENUM)return;let s=Vi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=qie(s,n,a,r),l=`${r}MetadataStatistics`;e.addStructField(Vi.STRUCT_ID_METADATA_STATISTICS_FS,l,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),Le.includesVertexShader(t.shaderDestination)&&(e.addStructField(Vi.STRUCT_ID_METADATA_STATISTICS_VS,l,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function qie(e,t,n,i){function o(r){let s=t[r.specName];if(d(s))return`${n}.${r.shaderName} = ${i}(${s});`}return d(t)?e.map(o).filter(d):[]}function $ie(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:l}=e;s.addUniform(c,o,l),s.addUniform(c,r,l);let{offset:u,scale:m}=n;return a[o]=()=>u,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}var ru=Vi;var Hyn=T(S(),1),H5e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Yb=Object.freeze(H5e);var Ks={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:It};Ks.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;d(a)&&(e.lightingOptions.lightingModel=a),c===Yb.TRANSLUCENT?r.pass=Re.TRANSLUCENT:c===Yb.OPAQUE&&(r.pass=void 0);let l=tNe(s,t);if(!l.customShaderEnabled)return;if(rNe(i,s,l),l.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,Le.BOTH),d(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,Le.VERTEX),d(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,Le.FRAGMENT);let p=Up.getDefineName(s.mode);i.addDefine(p,void 0,Le.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let y=u[p];i.addUniform(y.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let y=m[p];i.addVarying(y,p)}e.uniformMap=xt(e.uniformMap,s.uniformMap)};function z5e(e){let t={};for(let n=0;n<e.length;n++){let i=nn.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var J5e={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},Q5e={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function eoe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=J5e[t],i=Q5e[t];if(d(n))return{attributeField:[n,e],value:i}}function j5e(e,t){if(!d(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=toe(t,n,!1),o=noe(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let u=[i[c].glslType,c];s.push(u),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let l=o[c],u=eoe(l);if(!d(u))return Ks._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${l}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${l} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function q5e(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function $5e(e,t){if(!d(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=toe(t,n,!0),o=noe(t,n,!0),r,s=[],a=[];for(let l in i){if(!i.hasOwnProperty(l))continue;let m=[i[l].glslType,l];s.push(m),r=`fsInput.attributes.${l} = attributes.${l};`,a.push(r)}for(let l=0;l<o.length;l++){let u=o[l],m=eoe(u);if(!d(m))return Ks._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(m.attributeField),r=`fsInput.attributes.${u} = ${m.value};`,a.push(r)}let c=q5e(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var eNe={positionWC:!0,positionEC:!0};function toe(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function noe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||eNe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function tNe(e,t){let n=z5e(t.attributes),i=j5e(e,n),o=$5e(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function nNe(e,t){let n=Ks.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ks.STRUCT_NAME_ATTRIBUTES,Le.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ks.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ks.STRUCT_NAME_VERTEX_INPUT,Le.VERTEX),e.addStructField(n,Ks.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Bb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,ru.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,ru.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,ru.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ks.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Ks.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,Le.VERTEX),e.addFunctionLines(r,o)}function iNe(e,t){let n=Ks.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ks.STRUCT_NAME_ATTRIBUTES,Le.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ks.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ks.STRUCT_NAME_FRAGMENT_INPUT,Le.FRAGMENT),e.addStructField(n,Ks.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Bb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,ru.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,ru.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,ru.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ks.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Ks.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,Le.FRAGMENT),e.addFunctionLines(r,o)}var oNe=[];function rNe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=oNe;i.enabled&&(nNe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,tI),e.addVertexLines(r)),o.enabled&&(iNe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,nI),e.addFragmentLines(r))}var aI=Ks;var fgn=T(S(),1);var cI={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};cI.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=d(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,Le.VERTEX),i.addFunction(cI.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,cI.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,Le.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],l=c.quantization;if(!d(l))continue;let u=c.semantic===Ct.POSITION,m=c.semantic===Ct.TEXCOORD;if(r&&!u&&!m)continue;let p=nn.getAttributeInfo(c);aNe(i,p),sNe(e,p)}};function sNe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,Le.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,Le.VERTEX),n.addUniform(c,a,Le.VERTEX);let l=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(l=ioe(l,0),u=ioe(u,1)),i[s]=function(){return l},i[a]=function(){return u}}}function ioe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function aNe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=cNe(n,i):o=lNe(n),e.addFunctionLines(cI.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function cNe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function lNe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var lI=cI;var Dgn=T(S(),1);var bgn=T(S(),1),dI=`void geometryStage(out ProcessedAttributes attributes)
{
  attributes.positionMC = v_positionMC;
  attributes.positionEC = v_positionEC;

  #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER
  attributes.positionWC = v_positionWC;
  #endif

  #ifdef HAS_NORMALS
  // renormalize after interpolation
  attributes.normalEC = normalize(v_normalEC);
  #endif

  #ifdef HAS_TANGENTS
  attributes.tangentEC = normalize(v_tangentEC);
  #endif

  #ifdef HAS_BITANGENTS
  attributes.bitangentEC = normalize(v_bitangentEC);
  #endif

  // Everything else is dynamically generated in GeometryPipelineStage
  setDynamicVaryings(attributes);
}
`;var ggn=T(S(),1),uI=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) 
{
    vec4 computedPosition;

    // Compute positions in different coordinate systems
    vec3 positionMC = attributes.positionMC;
    v_positionMC = positionMC;
    v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;

    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
    vec3 position2D = attributes.position2D;
    vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
    computedPosition = czm_projection * vec4(positionEC, 1.0);
    #else
    computedPosition = czm_projection * vec4(v_positionEC, 1.0);
    #endif

    // Sometimes the custom shader and/or style needs this
    #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE)
    // Note that this is a 32-bit position which may result in jitter on small
    // scales.
    v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
    #endif

    #ifdef HAS_NORMALS
    v_normalEC = normalize(normal * attributes.normalMC);
    #endif

    #ifdef HAS_TANGENTS
    v_tangentEC = normalize(normal * attributes.tangentMC);    
    #endif

    #ifdef HAS_BITANGENTS
    v_bitangentEC = normalize(normal * attributes.bitangentMC);
    #endif

    // All other varyings need to be dynamically generated in
    // GeometryPipelineStage
    setDynamicVaryings(attributes);
    
    return computedPosition;
}
`;var Ggn=T(S(),1);var _gn=T(S(),1),rC=`vec2 computeSt(float featureId)
{
    float stepX = model_textureStep.x;
    float centerX = model_textureStep.y;

    #ifdef MULTILINE_BATCH_TEXTURE
    float stepY = model_textureStep.z;
    float centerY = model_textureStep.w;

    float xId = mod(featureId, model_textureDimensions.x); 
    float yId = floor(featureId / model_textureDimensions.x);
    
    return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
    #else
    return vec2(centerX + (featureId * stepX), 0.5);
    #endif
}

void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
{   
    int featureId = featureIds.SELECTED_FEATURE_ID;


    if (featureId < model_featuresLength)
    {
        vec2 featureSt = computeSt(float(featureId));

        feature.id = featureId;
        feature.st = featureSt;
        feature.color = texture(model_batchTexture, featureSt);
    }
    // Floating point comparisons can be unreliable in GLSL, so we
    // increment the feature ID to make sure it's always greater
    // then the model_featuresLength - a condition we check for in the
    // pick ID, to avoid sampling the pick texture if the feature ID is
    // greater than the number of features.
    else
    {
        feature.id = model_featuresLength + 1;
        feature.st = vec2(0.0);
        feature.color = vec4(1.0);
    }

    #ifdef HAS_NULL_FEATURE_ID
    if (featureId == model_nullFeatureId) {
        feature.id = featureId;
        feature.st = vec2(0.0);
        feature.color = vec4(1.0);
    }
    #endif
}
`;var mI={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};mI.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=dNe(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),uNe(i);let c=s.featureIds.nullFeatureId,l=e.uniformMap;d(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),l.model_nullFeatureId=function(){return c}),s.shaderDestination===Le.BOTH&&i.addVertexLines(rC),i.addFragmentLines(rC)};function ooe(e){return e instanceof wt.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function roe(e){return e instanceof wt.FeatureIdTexture?Le.FRAGMENT:Le.BOTH}function dNe(e,t,n){let i,o;return d(t.instances)&&(o=nn.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),d(o))?(i=g(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:roe(o),featureIdDefine:ooe(o)}):(o=nn.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=g(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:roe(o),featureIdDefine:ooe(o)})}function uNe(e){e.addStructField(mI.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(mI.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(mI.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Ob=mI;var Vs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Vs.process=function(e,t,n){let i=e.shaderBuilder,o=e.model;i.addStruct(Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",Le.VERTEX),i.addStruct(Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",Le.FRAGMENT),i.addStruct(Ob.STRUCT_ID_SELECTED_FEATURE,Ob.STRUCT_NAME_SELECTED_FEATURE,Le.BOTH),i.addFunction(Vs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Vs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,Le.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Vs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Vs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Le.VERTEX),i.addFunction(Vs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Vs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Le.FRAGMENT),o.type===nr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,Le.FRAGMENT);let s=n.mode!==ie.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=d(e.runtimeNode.node.instances),c=s&&!a,l=t.attributes.length;for(let u=0;u<l;u++){let m=t.attributes[u],p=an.getAttributeLocationCount(m.type),y=m.semantic===Ct.POSITION,f;p>1?(f=e.attributeIndex,e.attributeIndex+=p):y&&!c?f=0:f=e.attributeIndex++,mNe(e,m,f,p,s,a)}TNe(i,t.attributes),t.primitiveType===Fe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(uI),i.addFragmentLines(dI)};function mNe(e,t,n,i,o,r){let s=e.shaderBuilder,a=nn.getAttributeInfo(t),c=o&&!r;i>1?pNe(e,t,n,i):fNe(e,t,n,c),yNe(s,a,c),bNe(s,a),d(t.semantic)&&hNe(s,t),gNe(s,a,o),xNe(s,a,c),_Ne(s,a)}function hNe(e,t){let n=t.semantic,i=t.setIndex;switch(n){case Ct.NORMAL:e.addDefine("HAS_NORMALS");break;case Ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case Ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Ct.TEXCOORD:case Ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function fNe(e,t,n,i){let o=t.quantization,r,s;d(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===Ct.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let l=a===Ct.POSITION,u=l?0:n,m=an.getNumberOfComponents(r),p={index:u,value:d(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!l||!i)return;let y=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:y,count:t.count,componentsPerAttribute:m,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function pNe(e,t,n,i){let o=t.quantization,r,s;d(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.normalized,l=an.getNumberOfComponents(r)/i,u=Q.getSizeInBytes(s),m=l*u,p=t.byteStride;for(let y=0;y<i;y++){let f=t.byteOffset+y*m,x={index:n+y,vertexBuffer:t.buffer,componentsPerAttribute:l,componentDatatype:s,offsetInBytes:f,strideInBytes:p,normalize:a};e.attributes.push(x)}}function bNe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function yNe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===Ct.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function gNe(e,t,n){let i=Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,r=t.variableName;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,t.glslType,r),e.addStructField(o,t.glslType,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function xNe(e,t,n){let i=Vs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n){let a="attributes.position2D = a_position2D;";e.addFunctionLines(i,[a])}if(t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function _Ne(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(d(n)&&!d(i))return;let o=Vs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Vs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function TNe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===Ct.NORMAL?n=!0:r.semantic===Ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Vs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var hI=Vs;var qgn=T(S(),1);var Ygn=T(S(),1),fI=`#ifdef LIGHTING_PBR
vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)
{
    czm_pbrParameters pbrParameters;
    pbrParameters.diffuseColor = inputMaterial.diffuse;
    pbrParameters.f0 = inputMaterial.specular;
    pbrParameters.roughness = inputMaterial.roughness;
    
    #ifdef USE_CUSTOM_LIGHT_COLOR
    vec3 lightColorHdr = model_lightColorHdr;
    #else
    vec3 lightColorHdr = czm_lightColorHdr;
    #endif

    vec3 color = inputMaterial.diffuse;
    #ifdef HAS_NORMALS
    color = czm_pbrLighting(
        attributes.positionEC,
        inputMaterial.normalEC,
        czm_lightDirectionEC,
        lightColorHdr,
        pbrParameters
    );

        #ifdef USE_IBL_LIGHTING
        color += imageBasedLightingStage(
            attributes.positionEC,
            inputMaterial.normalEC,
            czm_lightDirectionEC,
            lightColorHdr,
            pbrParameters
        );
        #endif
    #endif

    color *= inputMaterial.occlusion;
    color += inputMaterial.emissive;

    // In HDR mode, the frame buffer is in linear color space. The
    // post-processing stages (see PostProcessStageCollection) will handle
    // tonemapping. However, if HDR is not enabled, we must tonemap else large
    // values may be clamped to 1.0
    #ifndef HDR 
    color = czm_acesTonemapping(color);
    #endif 

    return color;
}
#endif

void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
{
    // Even though the lighting will only set the diffuse color,
    // pass all other properties so further stages have access to them.
    vec3 color = vec3(0.0);

    #ifdef LIGHTING_PBR
    color = computePbrLighting(material, attributes);
    #else // unlit
    color = material.diffuse;
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
    // The colors resulting from point cloud styles are adjusted differently.
    color = czm_gammaCorrect(color);
    #elif !defined(HDR)
    // If HDR is not enabled, the frame buffer stores sRGB colors rather than
    // linear colors so the linear value must be converted.
    color = czm_linearToSrgb(color);
    #endif

    material.diffuse = color;
}
`;var Kgn=T(S(),1),SNe={UNLIT:0,PBR:1},Hh=Object.freeze(SNe);var soe={name:"LightingPipelineStage"};soe.process=function(e,t){let n=e.model,i=e.lightingOptions,o=e.shaderBuilder;if(d(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,Le.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",Le.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===Hh.PBR?o.addDefine("LIGHTING_PBR",void 0,Le.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,Le.FRAGMENT),o.addFragmentLines(fI)};var pI=soe;var pxn=T(S(),1);var exn=T(S(),1),bI=`// If the style color is white, it implies the feature has not been styled.
bool isDefaultStyleColor(vec3 color)
{
    return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}

vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
{
    vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
    vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
    return color;
}

vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
{
    return vec2(textureTransform * vec3(texCoord, 1.0));
}

#ifdef HAS_NORMALS
vec3 computeNormal(ProcessedAttributes attributes)
{
    // Geometry normal. This is already normalized 
    vec3 ng = attributes.normalEC;

    vec3 normal = ng;
    #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
    vec2 normalTexCoords = TEXCOORD_NORMAL;
        #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
        normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);
        #endif

        // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
        #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
        mat3 tbn = mat3(t, b, ng);
        vec3 n = texture(u_normalTexture, normalTexCoords).rgb;
        normal = normalize(tbn * (2.0 * n - 1.0));
        #elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
        // If derivatives are available (not IE 10), compute tangents
        vec3 positionEC = attributes.positionEC;
        vec3 pos_dx = dFdx(positionEC);
        vec3 pos_dy = dFdy(positionEC);
        vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));
        vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));
        vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);
        t = normalize(t - ng * dot(ng, t));
        vec3 b = normalize(cross(ng, t));
        mat3 tbn = mat3(t, b, ng);
        vec3 n = texture(u_normalTexture, normalTexCoords).rgb;
        normal = normalize(tbn * (2.0 * n - 1.0));
        #endif
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
    if (czm_backFacing()) {
        normal = -normal;
    }
    #endif

    return normal;
}
#endif

void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
{
    #ifdef HAS_NORMALS
    material.normalEC = computeNormal(attributes);
    #endif

    vec4 baseColorWithAlpha = vec4(1.0);
    // Regardless of whether we use PBR, set a base color
    #ifdef HAS_BASE_COLOR_TEXTURE
    vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;

        #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
        baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
        #endif

    baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));

        #ifdef HAS_BASE_COLOR_FACTOR
        baseColorWithAlpha *= u_baseColorFactor;
        #endif
    #elif defined(HAS_BASE_COLOR_FACTOR)
    baseColorWithAlpha = u_baseColorFactor;
    #endif

    #ifdef HAS_POINT_CLOUD_COLOR_STYLE
    baseColorWithAlpha = v_pointCloudColor;
    #elif defined(HAS_COLOR_0)
    vec4 color = attributes.color_0;
        // .pnts files store colors in the sRGB color space
        #ifdef HAS_SRGB_COLOR
        color = czm_srgbToLinear(color);
        #endif
    baseColorWithAlpha *= color;
    #endif

    material.diffuse = baseColorWithAlpha.rgb;
    material.alpha = baseColorWithAlpha.a;

    #ifdef USE_CPU_STYLING
    material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);
    #endif

    #ifdef HAS_OCCLUSION_TEXTURE
    vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
        #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
        occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
        #endif
    material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
    #endif

    #ifdef HAS_EMISSIVE_TEXTURE
    vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
        #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
        emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
        #endif

    vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
        #ifdef HAS_EMISSIVE_FACTOR
        emissive *= u_emissiveFactor;
        #endif
    material.emissive = emissive;
    #elif defined(HAS_EMISSIVE_FACTOR)
    material.emissive = u_emissiveFactor;
    #endif

    #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
        #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
        vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
          #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
          specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
          #endif

        vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
        vec3 specular = specularGlossiness.rgb;
        float glossiness = specularGlossiness.a;
            #ifdef HAS_SPECULAR_FACTOR
            specular *= u_specularFactor;
            #endif

            #ifdef HAS_GLOSSINESS_FACTOR
            glossiness *= u_glossinessFactor;
            #endif
        #else
            #ifdef HAS_SPECULAR_FACTOR
            vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));
            #else
            vec3 specular = vec3(1.0);
            #endif

            #ifdef HAS_GLOSSINESS_FACTOR
            float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
            #else
            float glossiness = 1.0;
            #endif
        #endif

        #ifdef HAS_DIFFUSE_TEXTURE
        vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
            #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
            diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
            #endif

        vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
            #ifdef HAS_DIFFUSE_FACTOR
            diffuse *= u_diffuseFactor;
            #endif
        #elif defined(HAS_DIFFUSE_FACTOR)
        vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
        #else
        vec4 diffuse = vec4(1.0);
        #endif
    czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(
      diffuse.rgb,
      specular,
      glossiness
    );
    material.diffuse = parameters.diffuseColor;
    // the specular glossiness extension's alpha overrides anything set
    // by the base material.
    material.alpha = diffuse.a;
    material.specular = parameters.f0;
    material.roughness = parameters.roughness;
    #elif defined(LIGHTING_PBR)
        #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
        vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
            #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
            metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
            #endif

        vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
        float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
        float roughness = clamp(metallicRoughness.g, 0.04, 1.0);
            #ifdef HAS_METALLIC_FACTOR
            metalness *= u_metallicFactor;
            #endif

            #ifdef HAS_ROUGHNESS_FACTOR
            roughness *= u_roughnessFactor;
            #endif
        #else
            #ifdef HAS_METALLIC_FACTOR
            float metalness = clamp(u_metallicFactor, 0.0, 1.0);
            #else
            float metalness = 1.0;
            #endif

            #ifdef HAS_ROUGHNESS_FACTOR
            float roughness = clamp(u_roughnessFactor, 0.04, 1.0);
            #else
            float roughness = 1.0;
            #endif
        #endif
    czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(
      material.diffuse,
      metalness,
      roughness
    );
    material.diffuse = parameters.diffuseColor;
    material.specular = parameters.f0;
    material.roughness = parameters.roughness;
    #endif
}
`;var CNe=wt.Material,dO=wt.MetallicRoughness,uO=wt.SpecularGlossiness,aoe={name:"MaterialPipelineStage",_processTexture:Kb,_processTextureTransform:coe};aoe.process=function(e,t,n){let i=t.material,o=e.model,r=d(o.classificationType),s=r,a=e.uniformMap,c=e.shaderBuilder,l=n.context.defaultTexture,u=n.context.defaultNormalTexture,m=n.context.defaultEmissiveTexture;VNe(i,a,c,l,u,m,s),d(i.specularGlossiness)?LNe(i,a,c,l,s):RNe(i,a,c,l,s);let p=nn.getAttributeBySemantic(t,Ct.NORMAL),y=e.lightingOptions;i.unlit||!p||r?y.lightingModel=Hh.UNLIT:y.lightingModel=Hh.PBR;let f=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=f;let x=e.alphaOptions;i.alphaMode===Oh.BLEND?x.pass=Re.TRANSLUCENT:i.alphaMode===Oh.MASK&&(x.alphaCutoff=i.alphaCutoff),c.addFragmentLines(bI),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,Le.BOTH)};function coe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,Le.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,Le.FRAGMENT),t[s]=function(){return n.transform}}function Kb(e,t,n,i,o,r){e.addUniform("sampler2D",i,Le.FRAGMENT),t[i]=function(){return g(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,Le.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,l=`TEXCOORD_${o}`;e.addDefine(l,c,Le.FRAGMENT);let u=n.transform;d(u)&&!$.equals(u,$.IDENTITY)&&coe(e,t,n,i,o)}function VNe(e,t,n,i,o,r,s){let a=e.emissiveFactor;if(d(a)&&!h.equals(a,CNe.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",Le.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,Le.FRAGMENT);let u=e.emissiveTexture;d(u)&&!s&&Kb(n,t,u,"u_emissiveTexture","EMISSIVE",r)}let c=e.normalTexture;d(c)&&!s&&Kb(n,t,c,"u_normalTexture","NORMAL",o);let l=e.occlusionTexture;d(l)&&!s&&Kb(n,t,l,"u_occlusionTexture","OCCLUSION",i)}function LNe(e,t,n,i,o){let r=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,Le.FRAGMENT);let s=r.diffuseTexture;d(s)&&!o&&Kb(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=r.diffuseFactor;d(a)&&!se.equals(a,uO.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",Le.FRAGMENT),t.u_diffuseFactor=function(){return r.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,Le.FRAGMENT));let c=r.specularGlossinessTexture;d(c)&&!o&&Kb(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let l=r.specularFactor;d(l)&&!h.equals(l,uO.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",Le.FRAGMENT),t.u_specularFactor=function(){return r.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,Le.FRAGMENT));let u=r.glossinessFactor;d(u)&&u!==uO.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",Le.FRAGMENT),t.u_glossinessFactor=function(){return r.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,Le.FRAGMENT))}function RNe(e,t,n,i,o){let r=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,Le.FRAGMENT);let s=r.baseColorTexture;d(s)&&!o&&Kb(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=r.baseColorFactor;d(a)&&!se.equals(a,dO.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",Le.FRAGMENT),t.u_baseColorFactor=function(){return r.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,Le.FRAGMENT));let c=r.metallicRoughnessTexture;d(c)&&!o&&Kb(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=r.metallicFactor;d(l)&&l!==dO.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",Le.FRAGMENT),t.u_metallicFactor=function(){return r.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,Le.FRAGMENT));let u=r.roughnessFactor;d(u)&&u!==dO.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",Le.FRAGMENT),t.u_roughnessFactor=function(){return r.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,Le.FRAGMENT))}var yI=aoe;var Lxn=T(S(),1);var yxn=T(S(),1),gI=`void morphTargetsStage(inout ProcessedAttributes attributes) 
{
    vec3 positionMC = attributes.positionMC;
    attributes.positionMC = getMorphedPosition(positionMC);

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = getMorphedNormal(normalMC);
    #endif

    #ifdef HAS_TANGENTS
    vec3 tangentMC = attributes.tangentMC;
    attributes.tangentMC = getMorphedTangent(tangentMC);
    #endif
}`;var xa={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};xa.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,Le.VERTEX),WNe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,l=c.length;for(let u=0;u<l;u++){let m=c[u],p=m.semantic;p!==Ct.POSITION&&p!==Ct.NORMAL&&p!==Ct.TANGENT||(GNe(e,m,e.attributeIndex,a),e.attributeIndex++)}}PNe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,Le.VERTEX),n.addVertexLines(gI);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=xt(s,e.uniformMap)};var ZNe={attributeString:void 0,functionId:void 0};function GNe(e,t,n,i){let o=e.shaderBuilder;ENe(e,t,n);let r=XNe(t,ZNe);INe(o,r,i)}function ENe(e,t,n){let i={index:n,value:d(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:an.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function XNe(e,t){switch(e.semantic){case Ct.POSITION:t.attributeString="Position",t.functionId=xa.FUNCTION_ID_GET_MORPHED_POSITION;break;case Ct.NORMAL:t.attributeString="Normal",t.functionId=xa.FUNCTION_ID_GET_MORPHED_NORMAL;break;case Ct.TANGENT:t.attributeString="Tangent",t.functionId=xa.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function INe(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function WNe(e){e.addFunction(xa.FUNCTION_ID_GET_MORPHED_POSITION,xa.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,Le.VERTEX);let t="vec3 morphedPosition = position;";e.addFunctionLines(xa.FUNCTION_ID_GET_MORPHED_POSITION,[t]),e.addFunction(xa.FUNCTION_ID_GET_MORPHED_NORMAL,xa.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,Le.VERTEX);let n="vec3 morphedNormal = normal;";e.addFunctionLines(xa.FUNCTION_ID_GET_MORPHED_NORMAL,[n]),e.addFunction(xa.FUNCTION_ID_GET_MORPHED_TANGENT,xa.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,Le.VERTEX);let i="vec3 morphedTangent = tangent;";e.addFunctionLines(xa.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}function PNe(e){let t="return morphedPosition;";e.addFunctionLines(xa.FUNCTION_ID_GET_MORPHED_POSITION,[t]);let n="return morphedNormal;";e.addFunctionLines(xa.FUNCTION_ID_GET_MORPHED_NORMAL,[n]);let i="return morphedTangent;";e.addFunctionLines(xa.FUNCTION_ID_GET_MORPHED_TANGENT,[i])}var xI=xa;var Fxn=T(S(),1);var loe={name:"PickingPipelineStage"};loe.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)vNe(e,t,a,i);else if(d(a))wNe(e,i);else{let c=doe(e),l=i.createPickId(c);s._pipelineResources.push(l),s._pickIds.push(l),r.addUniform("vec4","czm_pickColor",Le.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return l.color},e.pickId="czm_pickColor"}};function doe(e,t){let n=e.model;if(d(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(nr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,d(t)&&(o.instanceId=t),o}function vNe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;d(i.featureTableId)?o=i.featureTableId:d(n)?(r=nn.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=nn.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",Le.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return g(u.pickTexture,u.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function wNe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let m=0;m<n;m++){let p=doe(e,m),y=t.createPickId(p);s.push(y),i[m]=y;let f=y.color;o[m*4+0]=B.floatToByte(f.red),o[m*4+1]=B.floatToByte(f.green),o[m*4+2]=B.floatToByte(f.blue),o[m*4+3]=B.floatToByte(f.alpha)}r._pickIds=i;let a=mt.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1;let c=!1;r.statistics.addBuffer(a,c),s.push(a);let l={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(l);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,Le.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var _I=loe;var r_n=T(S(),1);var Mxn=T(S(),1),FNe={ADD:0,REPLACE:1},Wo=Object.freeze(FNe);var Uxn=T(S(),1),TI=`float getPointSizeFromAttenuation(vec3 positionEC) {
  // Variables are packed into a single vector to minimize gl.uniformXXX() calls
  float pointSize = model_pointCloudParameters.x;
  float geometricError = model_pointCloudParameters.y;
  float depthMultiplier = model_pointCloudParameters.z;

  float depth = -positionEC.z;
  return min((geometricError / depth) * depthMultiplier, pointSize);
}

#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#endif

#ifdef HAS_POINT_CLOUD_COLOR_STYLE
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
}
#endif

#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  float tiles3d_tileset_time = model_pointCloudParameters.w;
  return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  return getPointSizeFromAttenuation(v_positionEC);
}
#endif

#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
float pointCloudBackFaceCullingStage() {
  #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
  // This needs to be computed in eye coordinates so we can't use attributes.normalMC
  return step(-v_normalEC.z, 0.0);
  #else
  return 1.0;
  #endif
}
#endif`;var ANe=new se,moe={name:"PointCloudStylingPipelineStage"};moe.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=d(s)?s.propertyAttributes:void 0,c=d(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,l=!d(a)&&c;if(d(r)&&!l){let x=kNe(a),_=DNe(r,x);BNe(i,_);let V=YNe(_).indexOf("normalMC")>=0,L=nn.getAttributeBySemantic(t,Ct.NORMAL);if(V&&!L)throw new me("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,Le.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Re.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,Le.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,Le.VERTEX);let m,p,y;nr.is3DTiles(o.type)&&(p=!0,m=o.content,y=m.tile.refine===Wo.ADD),i.addUniform("vec4","model_pointCloudParameters",Le.VERTEX),i.addVertexLines(TI);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=ANe,_=1;p&&(_=y?5:m.tileset.memoryAdjustedScreenSpaceError),x.x=g(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=MNe(e,t,u,m);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,Z;return n.mode===ie.SCENE2D||L instanceof en?Z=Number.POSITIVE_INFINITY:Z=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=Z,p&&(x.w=m.tileset.timeSinceLoad),x}};var uoe=new h;function MNe(e,t,n,i){if(d(i)){let u=i.tile.geometricError;if(u>0)return u}if(d(n.baseResolution))return n.baseResolution;let o=nn.getAttributeBySemantic(t,Ct.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,uoe);a=F.multiplyByPointAsVector(s,a,uoe);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var NNe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},UNe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function kNe(e){let t=Oe(UNe);if(!d(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var mO="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function DNe(e,t){let n=NNe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${mO})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${mO})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${mO})`,t,i),n.styleTranslucent=d(n.colorStyleFunction)&&i.translucent,n}function BNe(e,t){let n=t.colorStyleFunction;d(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,Le.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;d(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,Le.VERTEX),e.addVertexLines(i));let o=t.pointSizeStyleFunction;d(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,Le.VERTEX),e.addVertexLines(o))}function hO(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function YNe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return d(t)&&hO(t,o),d(n)&&hO(n,o),d(i)&&hO(i,o),o}var SI=moe;var b_n=T(S(),1);var a_n=T(S(),1),CI=`void primitiveOutlineStage() {
    v_outlineCoordinates = a_outlineCoordinates;
}
`;var l_n=T(S(),1),VI=`void primitiveOutlineStage(inout czm_modelMaterial material) {
    if (!model_showOutline) {
        return;
    }

    float outlineX = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
    float outlineY = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
    float outlineZ = 
        texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
    float outlineness = max(outlineX, max(outlineY, outlineZ));

    material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
}

`;var hoe={name:"PrimitiveOutlinePipelineStage"};hoe.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,Le.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:an.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",Le.FRAGMENT);let a=Ax.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",Le.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",Le.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(CI),i.addFragmentLines(VI)};var LI=hoe;var S_n=T(S(),1);var foe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:poe,_count2DPositions:boe,_countMorphTargetAttributes:yoe,_countMaterialTextures:goe,_countFeatureIdTextures:xoe,_countBinaryMetadata:_oe};foe.process=function(e,t,n){let i=e.model,o=i.statistics;poe(o,t),boe(o,e.runtimePrimitive),yoe(o,t),goe(o,t.material),xoe(o,t.featureIds),_oe(o,i)};function poe(e,t){let n=d(t.indices)?t.indices.count:nn.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Fe.POINTS?e.pointsLength+=n:Fe.isTriangles(i)&&(e.trianglesLength+=ONe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let l=o[c];if(d(l.buffer)){let u=d(l.typedArray);e.addBuffer(l.buffer,u)}}let s=t.outlineCoordinates;d(s)&&d(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(d(a)&&d(a.buffer)){let c=d(a.typedArray);e.addBuffer(a.buffer,c)}}function ONe(e,t){switch(e){case Fe.TRIANGLES:return t/3;case Fe.TRIANGLE_STRIP:case Fe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function boe(e,t){let n=t.positionBuffer2D;d(n)&&e.addBuffer(n,!0)}function yoe(e,t){let n=t.morphTargets;if(!d(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let l=s[c];d(l.buffer)&&e.addBuffer(l.buffer,i)}}}function goe(e,t){let n=KNe(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];d(r)&&d(r.texture)&&e.addTexture(r.texture)}}function KNe(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return d(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function xoe(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof wt.FeatureIdTexture){let r=o.textureReader;d(r.texture)&&e.addTexture(r.texture)}}}function _oe(e,t){let n=t.structuralMetadata;d(n)&&(HNe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!d(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function HNe(e,t){let n=t.propertyTextures;if(!d(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let l=s[a].textureReader;d(l.texture)&&e.addTexture(l.texture)}}}var RI=foe;var A_n=T(S(),1);var zNe=new F,JNe=new F,Toe={name:"SceneMode2DPipelineStage"};Toe.process=function(e,t,n){let i=nn.getAttributeBySemantic(t,Ct.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,zNe),l=qNe(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=l;let m=e.runtimeNode.node.instances;if(d(m))return;if(d(i.typedArray)){let x=tUe(i,c,l,n);u.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,Le.VERTEX),o.addUniform("mat4","u_modelView2D",Le.VERTEX);let p=F.fromTranslation(l.center,new F),y=n.context,f={u_modelView2D:function(){return F.multiplyTransformation(y.uniformState.view,p,JNe)}};e.uniformMap=xt(f,e.uniformMap)};var QNe=new h,jNe=new h;function qNe(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,QNe),o=Ji.computeActualWgs84Position(n,i,i),r=F.multiplyByPoint(t,e.positionMax,jNe),s=Ji.computeActualWgs84Position(n,r,r);return ce.fromCornerPoints(o,s,new ce)}var Soe=new h;function $Ne(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Soe),c=h.multiplyComponents(a,r,a),l=h.add(c,o,c);i[s]=l.x,i[s+1]=l.y,i[s+2]=l.z}return i}function eUe(e,t,n,i){let o;d(e.quantization)?o=$Ne(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=d(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let l=h.fromArray(o,c,Soe);if(isNaN(l.x)||isNaN(l.y)||isNaN(l.z))continue;let u=F.multiplyByPoint(t,l,l),m=Ji.computeActualWgs84Position(i,u,u),p=h.subtract(m,n,m);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function tUe(e,t,n,i){let o=Oe(i);o.mode=ie.COLUMBUS_VIEW;let r=n.center,s=eUe(e,t,r,o),a=mt.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var ZI=Toe;var O_n=T(S(),1);var N_n=T(S(),1),GI=`void skinningStage(inout ProcessedAttributes attributes) 
{
    mat4 skinningMatrix = getSkinningMatrix();
    mat3 skinningMatrixMat3 = mat3(skinningMatrix);

    vec4 positionMC = vec4(attributes.positionMC, 1.0);
    attributes.positionMC = vec3(skinningMatrix * positionMC);

    #ifdef HAS_NORMALS
    vec3 normalMC = attributes.normalMC;
    attributes.normalMC = skinningMatrixMat3 * normalMC;
    #endif

    #ifdef HAS_TANGENTS
    vec3 tangentMC = attributes.tangentMC;
    attributes.tangentMC = skinningMatrixMat3 * tangentMC;
    #endif
}`;var Dx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Dx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,Le.VERTEX),iUe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,Le.VERTEX),n.addVertexLines(GI);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=xt(r,e.uniformMap)};function nUe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===Ct.JOINTS||r.semantic===Ct.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function iUe(e,t){e.addFunction(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,Dx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,Le.VERTEX);let n="mat4 skinnedMatrix = mat4(0);";e.addFunctionLines(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,[n]);let i,o,r=["x","y","z","w"],s=nUe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],l=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,[l])}let a="return skinnedMatrix;";e.addFunctionLines(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,[a])}var EI=Dx;var aTn=T(S(),1);var Q_n=T(S(),1);var fO={};function oUe(e){let t=Ue.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function rUe(e,t){let n=t.length,i=Ue.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function sUe(e){let t=e-2,n=2+t*4,i=Ue.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function aUe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],l=t[a+1],u=t[a+2];r[s++]=l,r[s++]=u,r[s++]=u,r[s++]=c}return r}function cUe(e){let t=e-2,n=2+t*4,i=Ue.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function lUe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let l=t[c+1],u=t[c+2];r[s++]=l,r[s++]=u,r[s++]=u,r[s++]=a}return r}fO.createWireframeIndices=function(e,t,n){let i=d(n);if(e===Fe.TRIANGLES)return i?rUe(t,n):oUe(t);if(e===Fe.TRIANGLE_STRIP)return i?aUe(t,n):sUe(t);if(e===Fe.TRIANGLE_FAN)return i?lUe(t,n):cUe(t)};fO.getWireframeIndicesCount=function(e,t){return e===Fe.TRIANGLES?t*2:e===Fe.TRIANGLE_STRIP||e===Fe.TRIANGLE_FAN?2+(t-2)*4:t};var sC=fO;var Coe={name:"WireframePipelineStage"};Coe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,Le.FRAGMENT);let o=e.model,r=dUe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r;let s=!1;o.statistics.addBuffer(r,s);let a=e.primitiveType,c=e.count;e.primitiveType=Fe.LINES,e.count=sC.getWireframeIndicesCount(a,c)};function dUe(e,t,n){let o=nn.getAttributeBySemantic(e,Ct.POSITION).count,r=n.context.webgl2,s;if(d(t)){let u=t.buffer,m=t.count;d(u)&&r?(s=u.sizeInBytes===m?new Uint8Array(m):Ue.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=sC.createWireframeIndices(a,o,s),l=Ue.fromSizeInBytes(c.BYTES_PER_ELEMENT);return mt.createIndexBuffer({context:n.context,typedArray:c,usage:Ne.STATIC_DRAW,indexDatatype:l})}var XI=Coe;function Voe(e){e=g(e,g.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Voe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,l=e.mode!==ie.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=d(n.morphTargets)&&n.morphTargets.length>0,m=d(i.skin),p=d(r),f=!(p&&d(r.fragmentShaderText))||r.mode!==Up.REPLACE_MATERIAL,x=nn.hasQuantizedAttributes(n.attributes),_=o.debugWireframe&&Fe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,V=d(C)&&C.attenuation,L=d(C)&&C.backFaceCulling,Z=n.primitiveType===Fe.POINTS&&(d(s)||V||L),G=o._enableShowOutline&&d(n.outlineCoordinates),X=uUe(o,i,n),P=d(o.classificationType);l&&t.push(ZI),t.push(hI),_&&t.push(XI),P&&t.push(jX),u&&t.push(xI),m&&t.push(EI),Z&&t.push(SI),x&&t.push(lI),f&&t.push(yI),t.push(Bb),t.push(ru),X.hasPropertyTable&&(t.push(Ob),t.push(QX),t.push(eI)),p&&t.push(aI),t.push(pI),o.allowPicking&&t.push(_I),G&&t.push(LI),t.push(JX),t.push(RI)};function uUe(e,t,n){let i;return d(t.instances)&&(i=nn.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),d(i))?{hasFeatureIds:!0,hasPropertyTable:d(i.propertyTableId)}:(i=nn.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),d(i)?{hasFeatureIds:!0,hasPropertyTable:d(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var II=Voe;var NTn=T(S(),1);function pO(e){e=g(e,g.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],mUe(this)}Object.defineProperties(pO.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function mUe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let l=i[c].index,u=r[l];s.push(u);let m=n[c],p=Loe(u,m,new F);a.push(p)}}function Loe(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}pO.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Loe(i,o,e[n])}};var WI=pO;var HTn=T(S(),1);var kTn=T(S(),1);function hUe(){this.pass=void 0,this.alphaCutoff=void 0}var PI=hUe;function fUe(e){this.shaderBuilder=new Ag,this.model=e,this.uniformMap={},this.alphaOptions=new PI,this.renderStateOptions=De.getState(De.fromCache({depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var vI=fUe;var oSn=T(S(),1);var JTn=T(S(),1),wI=`void silhouetteStage(inout vec4 color) {
    if(model_silhouettePass) {
        color = czm_gammaCorrect(model_silhouetteColor);
    }
}`;var jTn=T(S(),1),FI=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
     #ifdef HAS_NORMALS
     if(model_silhouettePass) {
          vec3 normal = normalize(czm_normal3D * attributes.normalMC);
          normal.x *= czm_projection[0][0];
          normal.y *= czm_projection[1][1];
          positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
    }
    #endif
}
`;var e5={name:"ModelSilhouettePipelineStage"};e5.silhouettesLength=0;e5.process=function(e,t,n){d(t._silhouetteId)||(t._silhouetteId=++e5.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,Le.BOTH),i.addVertexLines(FI),i.addFragmentLines(wI),i.addUniform("vec4","model_silhouetteColor",Le.FRAGMENT),i.addUniform("float","model_silhouetteSize",Le.VERTEX),i.addUniform("bool","model_silhouettePass",Le.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=xt(o,e.uniformMap),e.hasSilhouette=!0};var AI=e5;var uSn=T(S(),1);var sSn=T(S(),1),MI=`void modelSplitterStage()
{
    // Don't split when rendering the shadow map, because it is rendered from
    // the perspective of a totally different camera.
#ifndef SHADOW_MAP
    if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
}
`;var t5={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};t5.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,Le.FRAGMENT),i.addFragmentLines(MI);let o={};i.addUniform("float",t5.SPLIT_DIRECTION_UNIFORM_NAME,Le.FRAGMENT),o[t5.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var NI=t5;var fSn=T(S(),1);function pUe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Oe(e.uniformMap),this.alphaOptions=Oe(e.alphaOptions),this.renderStateOptions=Oe(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var UI=pUe;var RSn=T(S(),1);var gSn=T(S(),1);function bUe(e){e=g(e,g.EMPTY_OBJECT),this.lightingModel=g(e.lightingModel,Hh.UNLIT)}var kI=bUe;function yUe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Oe(e.uniformMap),this.alphaOptions=Oe(e.alphaOptions),this.renderStateOptions=Oe(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=d(n.indices)?n.indices.count:nn.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=nn.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ce.fromCornerPoints(this.positionMin,this.positionMax,new ce),this.lightingOptions=new kI,this.pickId=void 0}var DI=yUe;function id(e){e=g(e,g.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=nn.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},gUe(this)}Object.defineProperties(id.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function gUe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Roe(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V<s;V++){let L=r[V],Z=new FX({articulation:L,sceneGraph:e}),G=Z.name;a[G]=Z}let c=t.nodes,l=c.length;e._runtimeNodes=new Array(l);let m=n.nodes.length,p=F.IDENTITY;for(let V=0;V<m;V++){let L=n.nodes[V],Z=Zoe(e,L,p);e._rootNodes.push(Z)}let y=t.skins,f=e._runtimeSkins,x=y.length;for(let V=0;V<x;V++){let L=y[V];f.push(new WI({skin:L,sceneGraph:e}))}let _=e._skinnedNodes,C=_.length;for(let V=0;V<C;V++){let L=_[V],Z=e._runtimeNodes[L],X=c[L].skin.index;Z._runtimeSkin=f[X],Z.updateJointMatrices()}e.applyArticulations()}function Roe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var xUe=new h;function _Ue(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,xUe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=vt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=vt.wgs84To2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ce.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Zoe(e,t,n){let i=[],o=nn.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=F.multiplyTransformation(n,o,new F),y=Zoe(e,m,p);i.push(y)}let s=new zX({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new II({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,d(t.skin)&&e._skinnedNodes.push(c);let l=t.name;if(d(l)){let u=e._model,m=new UX(u,s);u._nodesByName[l]=m}return c}var TUe=new h,SUe=new h,CUe=new h,VUe=new h;id.prototype.buildDrawCommands=function(e){let t=this._model,n=new vI(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,TUe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,SUe);for(o=0;o<this._runtimeNodes.length;o++){let l=this._runtimeNodes[o];if(!d(l))continue;l.configurePipeline();let u=l.pipelineStages,m=new UI(n,l);for(r=0;r<u.length;r++)u[r].process(m,l.node,e);let p=l.computedTransform;for(r=0;r<l.runtimePrimitives.length;r++){let y=l.runtimePrimitives[r];y.configurePipeline(e);let f=y.pipelineStages,x=new DI(m,y);for(s=0;s<f.length;s++)f[s].process(x,y.primitive,e);y.boundingSphere=ce.clone(x.boundingSphere,new ce);let _=F.multiplyByPoint(p,x.positionMin,CUe),C=F.multiplyByPoint(p,x.positionMax,VUe);h.minimumByComponent(a,_,a),h.maximumByComponent(c,C,c);let V=IX(x,e);y.drawCommand=V}}this._boundingSphere=ce.fromCornerPoints(a,c,new ce),this._boundingSphere=ce.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ce.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ce.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};id.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model;d(n.color)&&t.push(Db),!d(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(vX),n.isClippingEnabled()&&t.push(NX),n.hasSilhouette(e)&&t.push(AI),d(n.splitDirection)&&n.splitDirection!==vc.NONE&&t.push(NI),nr.is3DTiles(n.type)&&t.push(WX))};id.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!d(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ie.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};id.prototype.updateModelMatrix=function(e,t){Roe(this,e),t.mode!==ie.SCENE3D&&_Ue(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};id.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Goe(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let l=t.getChild(c);Goe(e,l,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let l=s[c];i(l,o)}}function n5(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];Goe(e,c,t,n,i)}}var LUe={backFaceCulling:void 0};id.prototype.updateBackFaceCulling=function(e){let t=LUe;t.backFaceCulling=e,n5(this,!1,RUe,t)};function RUe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var ZUe={shadowMode:void 0};id.prototype.updateShadows=function(e){let t=ZUe;t.shadowMode=e,n5(this,!1,GUe,t)};function GUe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var EUe={debugShowBoundingVolume:void 0};id.prototype.updateShowBoundingVolume=function(e){let t=EUe;t.debugShowBoundingVolume=e,n5(this,!1,XUe,t)};function XUe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Eoe=[],IUe={frameState:void 0,hasSilhouette:void 0};id.prototype.pushDrawCommands=function(e){let t=Eoe;t.length=0;let n=IUe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,n5(this,!0,WUe,n),e.commandList.push.apply(e.commandList,t)};function WUe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Eoe,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}id.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];d(r)&&r.setArticulationStage(o,t)};id.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var BI=id;var nCn=T(S(),1);function aC(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Tt}Object.defineProperties(aC.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});aC.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};aC.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};aC.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};aC.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var YI=aC;var NCn=T(S(),1);var Poe=T(o9(),1);var pCn=T(S(),1);var Xoe={},Bx=Uint32Array.BYTES_PER_ELEMENT;Xoe.parse=function(e,t){t=g(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=Bx;let o=i.getUint32(t,!0);if(o!==1)throw new me(`Only Point Cloud tile version 1 is supported.  Version ${o} is not.`);t+=Bx,t+=Bx;let r=i.getUint32(t,!0);if(r===0)throw new me("Feature table must have a byte length greater than zero");t+=Bx;let s=i.getUint32(t,!0);t+=Bx;let a=i.getUint32(t,!0);t+=Bx;let c=i.getUint32(t,!0);t+=Bx;let l=Go(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=Go(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let y=new Zm(l,u),f=y.getGlobalProperty("POINTS_LENGTH");if(y.featuresLength=f,!d(f))throw new me("Feature table global property: POINTS_LENGTH must be defined");let x=y.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);d(x)&&(x=h.unpack(x));let _=PUe(y,m);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=vUe(y);_.positions=C,_.hasPositions=_.hasPositions||d(C)}if(!_.hasPositions)throw new me("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=FUe(y);_.normals=C,_.hasNormals=_.hasNormals||d(C)}if(!_.hasColors){let C=wUe(y);_.colors=C,_.hasColors=_.hasColors||d(C),_.hasConstantColor=d(_.constantColor),_.isTranslucent=d(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=AUe(y);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||d(C)}if(_.hasBatchIds){let C=y.getGlobalProperty("BATCH_LENGTH");if(!d(C))throw new me("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return d(p)&&(p=new Uint8Array(p),_.batchTableJson=m,_.batchTableBinary=p),_};function PUe(e,t){let n=e.json,i,o,r,s=d(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=d(t)&&d(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;d(a)&&(r=a.properties);let c,l,u,m,p;if(d(s)){o=s.properties;let f=s.byteOffset,x=s.byteLength;if(!d(o)||!d(f)||!d(x))throw new me("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+x),c=d(o.POSITION),l=d(o.RGB)||d(o.RGBA),u=d(o.NORMAL),m=d(o.BATCH_ID),p=d(o.RGBA)}let y;return d(i)&&(y={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:y,hasPositions:c,hasColors:l,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function vUe(e){let t=e.json,n;if(d(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:Ct.POSITION,semantic:Ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:an.VEC3};if(d(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!d(i))throw new me("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65536-1,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!d(r))throw new me("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Ct.POSITION,semantic:Ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:an.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:an.VEC3}}}function wUe(e){let t=e.json,n;if(d(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:Ct.COLOR,semantic:Ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(d(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(d(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:an.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(d(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=B.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Ct.COLOR,semantic:Ct.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:an.VEC4,isQuantized:!1,isTranslucent:s}}}function FUe(e){let t=e.json,n;if(d(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:Ct.NORMAL,semantic:Ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:an.VEC3};if(d(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2);let i=8;return{name:Ct.NORMAL,semantic:Ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<i)-1,quantizedType:an.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:an.VEC3}}}function AUe(e){let t=e.json;if(d(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:Ct.FEATURE_ID,semantic:Ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:an.SCALAR}}}var Yx=Xoe;var MUe=wt.Components,NUe=wt.Scene,UUe=wt.Node,kUe=wt.Primitive,DUe=wt.Attribute,Ioe=wt.Quantization,BUe=wt.FeatureIdAttribute,YUe=wt.Material,OUe=wt.MetallicRoughness;function Hb(e){e=g(e,g.EMPTY_OBJECT);let t=e.arrayBuffer,n=g(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=g(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Rt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}d(Object.create)&&(Hb.prototype=Object.create(oo.prototype),Hb.prototype.constructor=Hb);Object.defineProperties(Hb.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Hb.prototype.load=function(){if(d(this._promise))return this._promise;this._parsedContent=Yx.parse(this._arrayBuffer,this._byteOffset),this._state=Rt.PROCESSING,this._promise=Promise.resolve(this)};Hb.prototype.process=function(e){if(d(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===Rt.READY)return!0;if(this._state===Rt.PROCESSING){if(d(this._decodePromise))return!1;this._decodePromise=KUe(this,e.context)}return!1};function KUe(e,t){let i=e._parsedContent.draco,o;if(d(i)?o=Rp.decodePointCloud(i,t):o=Promise.resolve(),!!d(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return d(r)&&HUe(e,i,r),oke(e,t),e._state=Rt.READY,e}).catch(function(r){e.unload(),e._state=Rt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function HUe(e,t,n){e._state=Rt.READY;let i=e._parsedContent,o;if(d(n.POSITION)){if(o={name:"POSITION",semantic:Ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:an.VEC3,isQuantized:!1},d(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,l=h.fromElements(c,c,c),u=h.unpack(a.minValues),m=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=m,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=l,o.quantizedComponentDatatype=m<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT,o.quantizedType=an.VEC3}i.positions=o}if(d(n.NORMAL)){if(o={name:"NORMAL",semantic:Ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Q.FLOAT,type:an.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},d(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=Q.UNSIGNED_BYTE,o.quantizedType=an.VEC2}i.normals=o}if(d(n.RGBA)?i.colors={name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC4,normalized:!0,isTranslucent:!0}:d(n.RGB)&&(i.colors={name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Q.UNSIGNED_BYTE,type:an.VEC3,normalized:!0,isTranslucent:!1}),d(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:Ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Q.fromTypedArray(a),type:an.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];d(r)||(r={}),i.hasDracoBatchTable=!0;let l=c.data;r[a]={byteOffset:l.byteOffset,type:zUe(l.componentsPerAttribute),componentType:JUe(l.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function zUe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function JUe(e){switch(e){case ne.BYTE:return"BYTE";case ne.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ne.SHORT:return"SHORT";case ne.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ne.INT:return"INT";case ne.UNSIGNED_INT:return"UNSIGNED_INT";case ne.DOUBLE:return"DOUBLE";case ne.FLOAT:return"FLOAT"}}function OI(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Ioe,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Ioe;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new DUe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=g(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Kn.decodeRGB565(i)),d(t.constantColor)){let a=new Array(4);r.constant=B.pack(t.constantColor,a)}else{let a=mt.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===Ct.POSITION&&s&&(r.typedArray=i),r}var Woe,i5;function QUe(e){if(!d(i5)){Woe=new Poe.default(0),i5=new Array(e);for(let t=0;t<e;++t)i5[t]=Woe.random()}return i5}var jUe=new h,qUe=new h,$Ue=new h;function eke(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=QUe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,jUe),l=h.fromElements(a,a,a,qUe),u,m,p;if(e.isQuantized)c=h.ZERO,l=e.quantizedVolumeScale;else for(u=0;u<o;++u)m=Math.floor(r[u]*i),p=h.unpack(t,m*3,$Ue),h.minimumByComponent(c,p,c),h.maximumByComponent(l,p,l);e.min=h.clone(c),e.max=h.clone(l)}var tke={name:Ct.COLOR,semantic:Ct.COLOR,setIndex:0,constantColor:B.DARKGRAY,componentDatatype:Q.FLOAT,type:an.VEC4,isQuantized:!1,isTranslucent:!1};function nke(e,t,n){let i=[],o,r=t.positions;return d(r)&&(eke(r),o=OI(e,r,n),o.count=t.pointsLength,i.push(o)),d(t.normals)&&(o=OI(e,t.normals,n),i.push(o)),d(t.colors)?(o=OI(e,t.colors,n),i.push(o)):(o=OI(e,tke,n),i.push(o)),d(t.batchIds)&&(o=OI(e,t.batchIds,n),i.push(o)),i}function ike(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!d(e.batchIds);if(d(o)||e.hasDracoBatchTable){let s=g(n,i);return wp({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new ya({schema:{},propertyTables:[]})}function oke(e,t){let n=e._parsedContent,i=new OUe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new YUe;o.metallicRoughness=i;let r=n.colors;d(r)&&r.isTranslucent&&(o.alphaMode=Oh.BLEND);let s=!d(n.normals);o.unlit=s;let a=new kUe;if(a.attributes=nke(e,n,t),a.primitiveType=Fe.POINTS,a.material=o,d(n.batchIds)){let y=new BUe;y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0",a.featureIds.push(y)}let c=new UUe;c.index=0,c.primitives=[a];let l=new NUe;l.nodes=[c],l.upAxis=Zo.Z,l.forwardAxis=Zo.X;let u=new MUe;u.scene=l,u.nodes=[c];let m=[];u.structuralMetadata=ike(n,m),m.length>0&&rke(e,a,m,t),d(n.rtcCenter)&&(u.transform=F.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;d(p)&&p.isQuantized&&(u.transform=F.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function rke(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=mt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Hb.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var KI=Hb;function To(e){e=g(e,g.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=g(e.type,nr.GLTF),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=g(e.scale,1),this._minimumPixelSize=g(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=d(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new SX(this),this._clampAnimations=g(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=B.clone(e.color),this._colorBlendMode=g(e.colorBlendMode,Ha.HIGHLIGHT),this._colorBlendAmount=g(e.colorBlendAmount,.5);let t=g(e.silhouetteColor,B.RED);this._silhouetteColor=B.clone(t),this._silhouetteSize=g(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=g(e.cull,!0),this._opaquePass=g(e.opaquePass,Re.OPAQUE),this._allowPicking=g(e.allowPicking,!0),this._show=g(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=g(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=g(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ce,this._initialRadius=void 0,this._heightReference=g(e.heightReference,Ke.NONE),this._heightDirty=this._heightReference!==Ke.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;let o=e.scene;d(o)&&d(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(function(){this._heightDirty=!0},this)),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Kh(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;d(s)&&s.owner===void 0?ss.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=d(e.imageBasedLighting)?e.imageBasedLighting:new fx,this._shouldDestroyImageBasedLighting=!d(e.imageBasedLighting),this._backFaceCulling=g(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=g(e.shadows,xn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=g(e.enableDebugWireframe,!1),this._enableShowOutline=g(e.enableShowOutline,!0),this._debugWireframe=g(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===nr.GLTF&&It("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let a=e.credit;typeof a=="string"&&(a=new St(a)),this._credits=[],this._credit=a,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=g(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=g(e.splitDirection,vc.NONE),this._enableShowOutline=g(e.enableShowOutline,!0),this.showOutline=g(e.showOutline,!0),this.outlineColor=g(e.outlineColor,B.BLACK),this._classificationType=e.classificationType,this._statistics=new YI,this._sceneMode=void 0,this._projectTo2D=g(e.projectTo2D,!1),this._skipLevelOfDetail=!1,this._ignoreCommands=g(e.ignoreCommands,!1),this._errorEvent=new ye,this._readyEvent=new ye,this._texturesReadyEvent=new ye,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function bO(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function ske(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new LX({model:e,propertyTable:s});n.push(a)}return n}function ake(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],d(a.instances)&&(s=nn.getFeatureIdsByLabel(a.instances.featureIds,i),d(s)&&d(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],l=nn.getFeatureIdsByLabel(c.featureIds,n);if(d(l))return l.propertyTableId}if(t._featureTables.length===1)return 0}function gO(e,t){if(!d(e)&&!d(t))return!1;if(d(e)!==d(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(To.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return g(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){gO(e,this._color)&&this.resetDrawCommands(),this._color=B.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!B.equals(e,this._silhouetteColor)){let t=gO(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=B.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=d(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Foe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===nr.GLTF&&It("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(ss.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){d(e)!==d(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});To.prototype.getNode=function(e){return this._nodesByName[e]};To.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};To.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};To.prototype.makeStyleDirty=function(){this._styleDirty=!0};To.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var cke=new F,lke=new $,dke=new F;To.prototype.update=function(e){let t=!1;try{t=uke(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")bO(this,n);else{let i=nn.getError("model",this._resource,n);bO(this,i)}}if(mke(this,e),hke(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!d(n)){if(this._loader.isUnloaded())return;let r=nn.getError("model",this._resource,new me("Failed to load model."));bO(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;d(i)&&i.propertyTableCount>0&&ske(this,i);let o=new BI({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ie.MORPHING)){if(fke(this),pke(this),bke(this,e),yke(this),gke(this,e),xke(this,e),_ke(this,e),Tke(this,e),this._defaultTexture=e.context.defaultTexture,Ske(this,e),Cke(this,e),Vke(this),Lke(this,e),Gke(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),Zke(this),Eke(this,e),Xke(this),Ike(this,e)}};function uke(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function mke(e,t){d(e._customShader)&&e._customShader.update(t)}function hke(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function fke(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;d(n)&&n.propertyTableCount>0&&(e.featureTableId=ake(t,e),e._styleDirty=!0,e.resetDrawCommands())}function pke(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function bke(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&woe(e)}function woe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Em.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function yke(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function gke(e,t){e._silhouetteDirty&&(Aoe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function xke(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function _ke(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function Tke(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Ske(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Cke(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var zh=new h,o5=new he;function Vke(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;d(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!d(t)||!d(t.globe)||e.heightReference===Ke.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,o=e.modelMatrix;zh.x=o[12],zh.y=o[13],zh.z=o[14];let r=i.cartesianToCartographic(zh);d(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(o,new F));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(r,voe(e,i,r));let a=n.getHeight(r);if(d(a)){let c=voe(e,i,r);he.clone(r,o5),o5.height=a,i.cartographicToCartesian(o5,zh),c(zh)}e._heightDirty=!1,e._updateModelMatrix=!0}function Lke(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=d(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Foe(e,n),Rke(e,n,t)}function Foe(e,t){e._clampedScale=d(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ce.transform(e._boundingSphere,t,e._boundingSphere)}function Rke(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,zh),e._sceneMode!==ie.SCENE3D&&Ji.computeActualWgs84Position(n,zh,zh);let s=e._boundingSphere.radius,a=Wke(zh,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=d(e.maximumScale)?Math.min(e.maximumScale,i):i}function Zke(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}function Gke(e,t){let n=d(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=g(e.referenceMatrix,n),o=t.context,r=e._imageBasedLighting;if(r.useSphericalHarmonicCoefficients||r.useSpecularEnvironmentMaps){let s=lke,a=cke;a=F.multiply(o.uniformState.view3D,i,a),s=F.getMatrix3(a,s),s=$.getRotation(s,s),e._iblReferenceFrameMatrix=$.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=dke;s=F.multiply(o.uniformState.view3D,i,s),s=F.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=F.inverseTranspose(s,e._clippingPlanesMatrix)}}function Eke(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=d(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;d(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Xke(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(d(e._credit)){let s=St.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=St.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=St.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Ike(e,t){let n=vke(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(wke(e,t),e._sceneGraph.pushDrawCommands(t))}var yO=new ce;function Wke(e,t,n){return yO.center=e,yO.radius=t,n.camera.getPixelSize(yO,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}function voe(e,t,n){return function(i){if(e.heightReference===Ke.RELATIVE_TO_GROUND){let r=t.cartesianToCartographic(i,o5);r.height+=n.height,t.cartographicToCartesian(r,i)}let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightDirty=!0}}var Pke=new h;function vke(e,t){let n=e.distanceDisplayCondition;if(!d(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ie.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,Pke);Ji.computeActualWgs84Position(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function wke(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}To.prototype.isTranslucent=function(){let e=this.color;return d(e)&&e.alpha>0&&e.alpha<1};To.prototype.isInvisible=function(){let e=this.color;return d(e)&&e.alpha===0};function Aoe(e){return e.context.stencilBuffer}To.prototype.hasSilhouette=function(e){return Aoe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!d(this._classificationType)};To.prototype.hasSkipLevelOfDetail=function(e){if(!nr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};To.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return d(e)&&e.enabled&&e.length!==0};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){let e=this._loader;d(e)&&e.destroy();let t=this._featureTables;if(d(t)){let i=t.length;for(let o=0;o<i;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),d(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),d(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;d(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};To.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};To.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};To.fromGltfAsync=async function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:d(e.classificationType)},i=g(e.basePath,""),o=Ee.createIfNeeded(i);d(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Ee.createIfNeeded(t);let r=new Ip(n),a=d(e.content)?nr.TILE_GLTF:nr.GLTF,c=n.gltfResource,l=HI(r,a,e);l.resource=c;try{await r.load()}catch(y){throw r.destroy(),nn.getError("model",c,y)}let u=e.gltfCallback;d(u)&&u(r.gltfJson);let m=new To(l),p=m._resource.credits;if(d(p)){let y=p.length;for(let f=0;f<y;f++)m._resourceCredits.push(St.clone(p[f]))}return m};To.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:d(e.classificationType)},n=new hX(t);try{await n.load();let i=HI(n,nr.TILE_B3DM,e);return new To(i)}catch(i){throw n.destroy(),i}};To.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new KI(t);try{await n.load();let i=HI(n,nr.TILE_PNTS,e);return new To(i)}catch(i){throw n.destroy(),i}};To.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new bX(t);try{await n.load();let i=HI(n,nr.TILE_I3DM,e);return new To(i)}catch(i){throw n.destroy(),i}};To.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new fX(t),i=HI(n,nr.TILE_GEOJSON,e);return new To(i)};var Fke=new B;To.prototype.applyColorAndShow=function(e){let t=B.clone(this._color,Fke),n=d(e)&&d(e.color),i=d(e)&&d(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):B.clone(B.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,gO(t,this._color)&&this.resetDrawCommands()};To.prototype.applyStyle=function(e){let t=this.type===nr.TILE_PNTS,n=d(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=d(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=d(i)&&d(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),woe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function HI(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Xm=To;function Ls(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Ls.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return d(t)&&d(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(d(t)&&d(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ls.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Ls.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return d(i)?n.featureTables[i].hasProperty(e,t):!1};Ls.prototype.applyDebugSettings=function(e,t){t=e?t:B.WHITE,this.featuresLength===0?this._model.color=t:d(this.batchTable)&&this.batchTable.setAllColor(t)};Ls.prototype.applyStyle=function(e){this._model.style=e};Ls.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,d(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0),d(o)&&d(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Tl.REPEAT}),this._ready=!0)};Ls.prototype.isDestroyed=function(){return!1};Ls.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Ls.fromGltf=async function(e,t,n,i){let o=new Ls(e,t,n),s=zI(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Xm.fromGltfAsync(s);return o._model=c,o};Ls.fromB3dm=async function(e,t,n,i,o){let r=new Ls(e,t,n),a=zI(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let l=await Xm.fromB3dm(a);return r._model=l,r};Ls.fromI3dm=async function(e,t,n,i,o){let r=new Ls(e,t,n),a=zI(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Xm.fromI3dm(a);return r._model=c,r};Ls.fromPnts=async function(e,t,n,i,o){let r=new Ls(e,t,n),a=zI(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Xm.fromPnts(a);return r._model=c,r};Ls.fromGeoJson=async function(e,t,n,i){let o=new Ls(e,t,n),s=zI(e,t,o,{geoJson:i,resource:n}),a=await Xm.fromGeoJson(s);return o._model=a,o};function zI(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Re.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return xt(i,o)}var Jh=Ls;var F1n=T(S(),1);function Im(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Im.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Im.fromJson=function(e,t,n,i){let o=new Im(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Im.prototype.hasProperty=function(e,t){return!1};Im.prototype.getFeature=function(e){};Im.prototype.applyDebugSettings=function(e,t){};Im.prototype.applyStyle=function(e){};Im.prototype.update=function(e,t){};Im.prototype.isDestroyed=function(){return!1};Im.prototype.destroy=function(){return ue(this)};var JI=Im;var NEn=T(S(),1);var MZn=T(S(),1);var rLn=T(S(),1);var M1n=T(S(),1),QI=`uniform sampler2D u_atlas;

#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;

#ifdef SDF
in vec4 v_outlineColor;
in float v_outlineWidth;
#endif

#ifdef FRAGMENT_DEPTH_CHECK
in vec4 v_textureCoordinateBounds;                  // the min and max x and y values for the texture coordinates
in vec4 v_originTextureCoordinateAndTranslate;      // texture coordinate at the origin, billboard translate (used for label glyphs)
in vec4 v_compressed;                               // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
in mat2 v_rotationMatrix;

const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT1 = 2.0;

const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;

float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
{
    vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
    lookupVector = v_rotationMatrix * lookupVector;
    vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle.  Will be zero for billboards because dimensions and imageSize will be equal

    vec2 translation = v_originTextureCoordinateAndTranslate.zw;

    if (applyTranslate)
    {
        // this is only needed for labels where the horizontal origin is not LEFT
        // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
        translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
    }

    vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));

    if (logDepthOrDepth == 0.0)
    {
        return 0.0; // not on the globe
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    return eyeCoordinate.z / eyeCoordinate.w;
}
#endif


#ifdef SDF

// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
float getDistance(vec2 position)
{
    return texture(u_atlas, position).r;
}

// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
{
    float distance = getDistance(position);

    if (outlineWidth > 0.0)
    {
        // Don't get the outline edge exceed the SDF_EDGE
        float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
        float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
        vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
        float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
        return vec4(sdfColor.rgb, sdfColor.a * alpha);
    }
    else
    {
        float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
        return vec4(v_color.rgb, v_color.a * alpha);
    }
}
#endif

void main()
{
    vec4 color = texture(u_atlas, v_textureCoordinates);

#ifdef SDF
    float outlineWidth = v_outlineWidth;
    vec4 outlineColor = v_outlineColor;

    // Get the current distance
    float distance = getDistance(v_textureCoordinates);

#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
    float smoothing = fwidth(distance);
    // Get an offset that is approximately half the distance to the neighbor pixels
    // 0.354 is approximately half of 1/sqrt(2)
    vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));

    // Sample the center point
    vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);

    // Sample the 4 neighbors
    vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
    vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);

    // Equally weight the center sample and the 4 neighboring samples
    color = (center + color1 + color2 + color3 + color4)/5.0;
#else
    // If no derivatives available (IE 10?), just do a single sample
    float smoothing = 1.0/32.0;
    color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
#endif

    color = czm_gammaCorrect(color);
#else
    color = czm_gammaCorrect(color);
    color *= czm_gammaCorrect(v_color);
#endif

// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
    if (color.a < 0.005)   // matches 0/255 and 1/255
    {
        discard;
    }
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
    if (color.a < 0.995)   // matches < 254/255
    {
        discard;
    }
#else
    if (color.a >= 0.995)  // matches 254/255 and 255/255
    {
        discard;
    }
#endif
#endif

#ifdef VECTOR_TILE
    color *= u_highlightColor;
#endif
    out_FragColor = color;

#ifdef LOG_DEPTH
    czm_writeLogDepth();
#endif

#ifdef FRAGMENT_DEPTH_CHECK
    float temp = v_compressed.y;

    temp = temp * SHIFT_RIGHT1;

    float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
    bool enableDepthTest = temp2 != 0.0;
    bool applyTranslate = floor(temp) != 0.0;

    if (enableDepthTest) {
        temp = v_compressed.z;
        temp = temp * SHIFT_RIGHT12;

        vec2 dimensions;
        dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
        dimensions.x = floor(temp);

        temp = v_compressed.w;
        temp = temp * SHIFT_RIGHT12;

        vec2 imageSize;
        imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
        imageSize.x = floor(temp);

        vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
        adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);

        float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
        float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);

        // negative values go into the screen
        if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
        {
            float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
            if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
            {
                float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
                if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
                {
                    discard;
                }
            }
        }
    }
#endif

}
`;var U1n=T(S(),1),jI=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScale;
in vec4 positionLowAndRotation;
in vec4 compressedAttribute0;                       // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
in vec4 compressedAttribute1;                       // aligned axis, translucency by distance, image width
in vec4 compressedAttribute2;                       // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
in vec4 eyeOffset;                                  // eye offset in meters, 4 bytes free (texture range)
in vec4 scaleByDistance;                            // near, nearScale, far, farScale
in vec4 pixelOffsetScaleByDistance;                 // near, nearScale, far, farScale
in vec4 compressedAttribute3;                       // distance display condition near, far, disableDepthTestDistance, dimensions
in vec2 sdf;                                        // sdf outline color (rgb) and width (w)
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
in vec4 textureCoordinateBoundsOrLabelTranslate;    // the min and max x and y values for the texture coordinates
#endif
#ifdef VECTOR_TILE
in float a_batchId;
#endif

out vec2 v_textureCoordinates;
#ifdef FRAGMENT_DEPTH_CHECK
out vec4 v_textureCoordinateBounds;
out vec4 v_originTextureCoordinateAndTranslate;
out vec4 v_compressed;                                 // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
out mat2 v_rotationMatrix;
#endif

out vec4 v_pickColor;
out vec4 v_color;
#ifdef SDF
out vec4 v_outlineColor;
out float v_outlineWidth;
#endif

const float UPPER_BOUND = 32768.0;

const float SHIFT_LEFT16 = 65536.0;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_LEFT7 = 128.0;
const float SHIFT_LEFT5 = 32.0;
const float SHIFT_LEFT3 = 8.0;
const float SHIFT_LEFT2 = 4.0;
const float SHIFT_LEFT1 = 2.0;

const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
const float SHIFT_RIGHT7 = 1.0 / 128.0;
const float SHIFT_RIGHT5 = 1.0 / 32.0;
const float SHIFT_RIGHT3 = 1.0 / 8.0;
const float SHIFT_RIGHT2 = 1.0 / 4.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;

vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
{
    // Note the halfSize cannot be computed in JavaScript because it is sent via
    // compressed vertex attributes that coerce it to an integer.
    vec2 halfSize = imageSize * scale * 0.5;
    halfSize *= ((direction * 2.0) - 1.0);

    vec2 originTranslate = origin * abs(halfSize);

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    if (validAlignedAxis || rotation != 0.0)
    {
        float angle = rotation;
        if (validAlignedAxis)
        {
            vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
            angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
                    (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
        }

        float cosTheta = cos(angle);
        float sinTheta = sin(angle);
        rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
        halfSize = rotationMatrix * halfSize;
    }
    else
    {
        rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
    }
#endif

    mpp = czm_metersPerPixel(positionEC);
    positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
    positionEC.xy += (translate + pixelOffset) * mpp;

    return positionEC;
}

#ifdef VERTEX_DEPTH_CHECK
float getGlobeDepth(vec4 positionEC)
{
    vec4 posWC = czm_eyeToWindowCoordinates(positionEC);

    float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));

    if (globeDepth == 0.0)
    {
        return 0.0; // not on the globe
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
    return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
void main()
{
    // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition

    // unpack attributes
    vec3 positionHigh = positionHighAndScale.xyz;
    vec3 positionLow = positionLowAndRotation.xyz;
    float scale = positionHighAndScale.w;

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    float rotation = positionLowAndRotation.w;
#else
    float rotation = 0.0;
#endif

    float compressed = compressedAttribute0.x;

    vec2 pixelOffset;
    pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
    compressed -= pixelOffset.x * SHIFT_LEFT7;
    pixelOffset.x -= UPPER_BOUND;

    vec2 origin;
    origin.x = floor(compressed * SHIFT_RIGHT5);
    compressed -= origin.x * SHIFT_LEFT5;

    origin.y = floor(compressed * SHIFT_RIGHT3);
    compressed -= origin.y * SHIFT_LEFT3;

#ifdef FRAGMENT_DEPTH_CHECK
    vec2 depthOrigin = origin.xy;
#endif
    origin -= vec2(1.0);

    float show = floor(compressed * SHIFT_RIGHT2);
    compressed -= show * SHIFT_LEFT2;

#ifdef INSTANCED
    vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
    vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
    vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
#else
    vec2 direction;
    direction.x = floor(compressed * SHIFT_RIGHT1);
    direction.y = compressed - direction.x * SHIFT_LEFT1;

    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
#endif

    float temp = compressedAttribute0.y  * SHIFT_RIGHT8;
    pixelOffset.y = -(floor(temp) - UPPER_BOUND);

    vec2 translate;
    translate.y = (temp - floor(temp)) * SHIFT_LEFT16;

    temp = compressedAttribute0.z * SHIFT_RIGHT8;
    translate.x = floor(temp) - UPPER_BOUND;

    translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
    translate.y -= UPPER_BOUND;

    temp = compressedAttribute1.x * SHIFT_RIGHT8;
    float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);

    vec2 imageSize = vec2(floor(temp), temp2);

#ifdef FRAGMENT_DEPTH_CHECK
    float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
    float applyTranslate = 0.0;
    if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false
    {
        applyTranslate = 1.0;
        labelHorizontalOrigin -= 2.0;
        depthOrigin.x = labelHorizontalOrigin + 1.0;
    }

    depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
#endif

#ifdef EYE_DISTANCE_TRANSLUCENCY
    vec4 translucencyByDistance;
    translucencyByDistance.x = compressedAttribute1.z;
    translucencyByDistance.z = compressedAttribute1.w;

    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;

    temp = compressedAttribute1.y * SHIFT_RIGHT8;
    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif

#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
    temp = compressedAttribute3.w;
    temp = temp * SHIFT_RIGHT12;

    vec2 dimensions;
    dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
    dimensions.x = floor(temp);
#endif

#ifdef ALIGNED_AXIS
    vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
    temp = compressedAttribute2.z * SHIFT_RIGHT5;
    bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
#else
    vec3 alignedAxis = vec3(0.0);
    bool validAlignedAxis = false;
#endif

    vec4 pickColor;
    vec4 color;

    temp = compressedAttribute2.y;
    temp = temp * SHIFT_RIGHT8;
    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor.r = floor(temp);

    temp = compressedAttribute2.x;
    temp = temp * SHIFT_RIGHT8;
    color.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    color.g = (temp - floor(temp)) * SHIFT_LEFT8;
    color.r = floor(temp);

    temp = compressedAttribute2.z * SHIFT_RIGHT8;
    bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
    temp = floor(temp) * SHIFT_RIGHT8;

    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor /= 255.0;

    color.a = floor(temp);
    color /= 255.0;

    ///////////////////////////////////////////////////////////////////////////

    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;

#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
    float eyeDepth = positionEC.z;
#endif

    positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
    positionEC.xyz *= show;

    ///////////////////////////////////////////////////////////////////////////

#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
    float lengthSq;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        // 2D camera distance is a special case
        // treat all billboards as flattened to the z=0.0 plane
        lengthSq = czm_eyeHeight2D.y;
    }
    else
    {
        lengthSq = dot(positionEC.xyz, positionEC.xyz);
    }
#endif

#ifdef EYE_DISTANCE_SCALING
    float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
    scale *= distanceScale;
    translate *= distanceScale;
    // push vertex behind near plane for clipping
    if (scale == 0.0)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

    float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
    // push vertex behind near plane for clipping
    if (translucency == 0.0)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

#ifdef EYE_DISTANCE_PIXEL_OFFSET
    float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
    pixelOffset *= pixelOffsetScale;
#endif

#ifdef DISTANCE_DISPLAY_CONDITION
    float nearSq = compressedAttribute3.x;
    float farSq = compressedAttribute3.y;
    if (lengthSq < nearSq || lengthSq > farSq)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

    mat2 rotationMatrix;
    float mpp;

#ifdef DISABLE_DEPTH_DISTANCE
    float disableDepthTestDistance = compressedAttribute3.z;
#endif

#ifdef VERTEX_DEPTH_CHECK
if (lengthSq < disableDepthTestDistance) {
    float depthsilon = 10.0;

    vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
    vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
    float globeDepth1 = getGlobeDepth(pEC1);

    if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
    {
        vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
        float globeDepth2 = getGlobeDepth(pEC2);

        if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
        {
            vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
            float globeDepth3 = getGlobeDepth(pEC3);
            if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
            {
                positionEC.xyz = vec3(0.0);
            }
        }
    }
}
#endif

    positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
    gl_Position = czm_projection * positionEC;
    v_textureCoordinates = textureCoordinates;

#ifdef LOG_DEPTH
    czm_vertexLogDepth();
#endif

#ifdef DISABLE_DEPTH_DISTANCE
    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
    {
        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
    }

    if (disableDepthTestDistance != 0.0)
    {
        // Don't try to "multiply both sides" by w.  Greater/less-than comparisons won't work for negative values of w.
        float zclip = gl_Position.z / gl_Position.w;
        bool clipped = (zclip < -1.0 || zclip > 1.0);
        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
        {
            // Position z on the near plane.
            gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
            v_depthFromNearPlusOne = 1.0;
#endif
        }
    }
#endif

#ifdef FRAGMENT_DEPTH_CHECK
    if (sizeInMeters) {
        translate /= mpp;
        dimensions /= mpp;
        imageSize /= mpp;
    }

#if defined(ROTATION) || defined(ALIGNED_AXIS)
    v_rotationMatrix = rotationMatrix;
#else
    v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
#endif

    float enableDepthCheck = 0.0;
    if (lengthSq < disableDepthTestDistance)
    {
        enableDepthCheck = 1.0;
    }

    float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
    float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));

    float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
    float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));

    v_compressed.x = eyeDepth;
    v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
    v_compressed.z = dw * SHIFT_LEFT12 + dh;
    v_compressed.w = iw * SHIFT_LEFT12 + ih;
    v_originTextureCoordinateAndTranslate.xy = depthOrigin;
    v_originTextureCoordinateAndTranslate.zw = translate;
    v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;

#endif

#ifdef SDF
    vec4 outlineColor;
    float outlineWidth;

    temp = sdf.x;
    temp = temp * SHIFT_RIGHT8;
    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.r = floor(temp);

    temp = sdf.y;
    temp = temp * SHIFT_RIGHT8;
    float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.a = floor(temp);
    outlineColor /= 255.0;

    v_outlineWidth = outlineWidth / 255.0;
    v_outlineColor = outlineColor;
    v_outlineColor.a *= translucency;
#endif

    v_pickColor = pickColor;

    v_color = color;
    v_color.a *= translucency;

}
`;var sVn=T(S(),1);function Li(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;d(n)&&(n=Pt.clone(n)),d(i)&&(i=Pt.clone(i)),d(o)&&(o=Pt.clone(o)),d(r)&&(r=Gt.clone(r)),this._show=g(e.show,!0),this._position=h.clone(g(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=D.clone(g(e.pixelOffset,D.ZERO)),this._translate=new D(0,0),this._eyeOffset=h.clone(g(e.eyeOffset,h.ZERO)),this._heightReference=g(e.heightReference,Ke.NONE),this._verticalOrigin=g(e.verticalOrigin,In.CENTER),this._horizontalOrigin=g(e.horizontalOrigin,bi.CENTER),this._scale=g(e.scale,1),this._color=B.clone(g(e.color,B.WHITE)),this._rotation=g(e.rotation,0),this._alignedAxis=h.clone(g(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=g(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=g(e.collection,t),this._pickId=void 0,this._pickPrimitive=g(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;d(s)&&(d(a)||(typeof s=="string"?a=s:d(s.src)?a=s.src:a=Yn()),this._imageId=a,this._image=s),d(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),d(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ie.SCENE3D,this._clusterShow=!0,this._outlineColor=B.clone(g(e.outlineColor,B.BLACK)),this._outlineWidth=g(e.outlineWidth,0),this._updateClamping()}var Moe=Li.SHOW_INDEX=0,s5=Li.POSITION_INDEX=1,Boe=Li.PIXEL_OFFSET_INDEX=2,Ake=Li.EYE_OFFSET_INDEX=3,Mke=Li.HORIZONTAL_ORIGIN_INDEX=4,Nke=Li.VERTICAL_ORIGIN_INDEX=5,Uke=Li.SCALE_INDEX=6,a5=Li.IMAGE_INDEX_INDEX=7,Noe=Li.COLOR_INDEX=8,kke=Li.ROTATION_INDEX=9,Dke=Li.ALIGNED_AXIS_INDEX=10,Bke=Li.SCALE_BY_DISTANCE_INDEX=11,Yke=Li.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Oke=Li.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Kke=Li.DISTANCE_DISPLAY_CONDITION=14,Hke=Li.DISABLE_DEPTH_DISTANCE=15;Li.TEXTURE_COORDINATE_BOUNDS=16;var Uoe=Li.SDF_INDEX=17;Li.NUMBER_OF_PROPERTIES=18;function Po(e,t){let n=e._billboardCollection;d(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Li.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Po(this,Moe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Po(this,s5))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Po(this,s5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),Po(this,Boe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Pt.equals(t,e)||(this._scaleByDistance=Pt.clone(e,t),Po(this,Bke))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Pt.equals(t,e)||(this._translucencyByDistance=Pt.clone(e,t),Po(this,Yke))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Pt.equals(t,e)||(this._pixelOffsetScaleByDistance=Pt.clone(e,t),Po(this,Oke))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Po(this,Ake))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Po(this,Mke))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Po(this,Nke))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Po(this,Uke))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Po(this,Noe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Po(this,kke))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Po(this,Dke))}},width:{get:function(){return g(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Po(this,a5))}},height:{get:function(){return g(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Po(this,a5))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Po(this,Noe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Po(this,Kke))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Po(this,Hke))}},id:{get:function(){return this._id},set:function(e){this._id=e,d(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,d(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){d(e)?typeof e=="string"?this.setImage(e,e):e instanceof Ee?this.setImage(e.url,e):d(e.src)?this.setImage(e.src,e):this.setImage(Yn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Po(this,a5))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),Po(this,s5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Po(this,Moe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Po(this,Uoe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Po(this,Uoe))}}});Li.prototype.getPickId=function(e){return d(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Li.prototype._updateClamping=function(){Li._updateClamping(this._billboardCollection,this)};var qI=new he,koe=new h;Li._updateClamping=function(e,t){let n=e._scene;if(!d(n)||!d(n.globe))return;let i=n.globe,o=i.ellipsoid,r=i._surface,s=n.frameState.mode,a=s!==t._mode;if(t._mode=s,(t._heightReference===Ke.NONE||a)&&d(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ke.NONE||!d(t._position))return;let c=o.cartesianToCartographic(t._position);if(!d(c)){t._actualClampedPosition=void 0;return}d(t._removeCallbackFunc)&&t._removeCallbackFunc();function l(m){if(t._heightReference===Ke.RELATIVE_TO_GROUND)if(t._mode===ie.SCENE3D){let p=o.cartesianToCartographic(m,qI);p.height+=c.height,o.cartographicToCartesian(p,m)}else m.x+=c.height;t._clampedPosition=h.clone(m,t._clampedPosition)}t._removeCallbackFunc=r.updateHeight(c,l),he.clone(c,qI);let u=i.getHeight(c);d(u)&&(qI.height=u),o.cartographicToCartesian(qI,koe),l(koe)};Li.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!He.equals(r._imageSubRegion,i))return;let l=e.textureCoordinates[c];r._imageWidth=e.texture.width*l.width,r._imageHeight=e.texture.height*l.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Po(r,a5);let u=r._billboardCollection._scene;d(u)&&u.frameState.afterRender.push(()=>!0)}if(d(n)&&(o=e.addImage(t,n)),d(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!d(o))return;let a=e.getImageIndex(t);if(d(a)&&!d(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};Li.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,d(this._billboardCollection._textureAtlas)&&this._loadImage())};Li.prototype.setImageSubRegion=function(e,t){this._imageId===e&&He.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=He.clone(t),d(this._billboardCollection._textureAtlas)&&this._loadImage())};Li.prototype._setTranslate=function(e){let t=this._translate;D.equals(t,e)||(D.clone(e,t),Po(this,Boe))};Li.prototype._getActualPosition=function(){return d(this._clampedPosition)?this._clampedPosition:this._actualPosition};Li.prototype._setActualPosition=function(e){d(this._clampedPosition)||h.clone(e,this._actualPosition),Po(this,s5)};var Doe=new se;Li._computeActualPosition=function(e,t,n,i){return d(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ie.SCENE3D?t:(F.multiplyByPoint(i,t,Doe),Ji.computeActualWgs84Position(n,Doe))};var Yoe=new h;Li._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,Yoe),a=Ji.wgs84WithEyeOffsetToWindowCoordinates(o,s,n,r);if(d(a))return D.add(a,i,a),a};var r5=new D(0,0);Li.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;d(t)||(t=new D),D.clone(this._pixelOffset,r5),D.add(r5,this._translate,r5);let i=n.modelMatrix,o=this._position;if(d(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ie.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,qI);o=a.cartographicToCartesian(c,Yoe),i=F.IDENTITY}return Li._computeScreenSpacePosition(i,o,this._eyeOffset,r5,e,t)};Li.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===bi.RIGHT?s-=i:e.horizontalOrigin===bi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===In.BOTTOM||e.verticalOrigin===In.BASELINE?a-=o:e.verticalOrigin===In.CENTER&&(a-=o*.5),d(n)||(n=new He),n.x=s,n.y=a,n.width=i,n.height=o,n};Li.prototype.equals=function(e){return this===e||d(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&He.equals(this._imageSubRegion,e._imageSubRegion)&&B.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Pt.equals(this._scaleByDistance,e._scaleByDistance)&&Pt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Pt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Li.prototype._destroy=function(){d(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),d(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var uo=Li;var cVn=T(S(),1),zke={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},So=Object.freeze(zke);var dVn=T(S(),1),Jke={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Rs=Object.freeze(Jke);var CVn=T(S(),1);function kp(e,t,n,i,o){this.bottomLeft=g(e,D.ZERO),this.topRight=g(t,D.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var Qke=new D(16,16);function zb(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.borderWidthInPixels,1),n=g(e.initialSize,Qke);this._context=e.context,this._pixelFormat=g(e.pixelFormat,st.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Yn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(zb.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return d(this._texture)||(this._texture=new Wt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function jke(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),l=o*(a+t.height+r),u=s/c,m=a/l,p=new kp(new D(s+r,r),new D(c,a)),y=new kp(new D,new D(c,a),e._root,p),f=new kp(new D(r,a+r),new D(c,l)),x=new kp(new D,new D(c,l),y,f);for(let V=0;V<e._textureCoordinates.length;V++){let L=e._textureCoordinates[V];d(L)&&(L.x*=u,L.y*=m,L.width*=u,L.height*=m)}let _=new Wt({context:e._context,width:c,height:l,pixelFormat:e._pixelFormat}),C=new Us({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),_.copyFromFramebuffer(0,0,0,0,c,l),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=_,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Wt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new kp(new D(r,r),new D(s,a))}}function c5(e,t,n){if(d(t)){if(!d(t.childNode1)&&!d(t.childNode2)){if(d(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new kp(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new kp(new D(a,t.bottomLeft.y),new D(t.topRight.x,t.topRight.y)))}else{t.childNode1=new kp(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new kp(new D(t.bottomLeft.x,a),new D(t.topRight.x,t.topRight.y)))}return c5(e,t.childNode1,n)}return c5(e,t.childNode1,n)||c5(e,t.childNode2,n)}}function Ooe(e,t,n){let i=c5(e,e._root,t);if(d(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,l=i.bottomLeft.y/r,u=s/o,m=a/r;e._textureCoordinates[n]=new He(c,l,u,m),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else jke(e,t),Ooe(e,t,n);e._guid=Yn()}function Koe(e,t){if(!d(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return Ooe(e,t,n),n}zb.prototype.getImageIndex=function(e){return this._indexHash[e]};zb.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return d(n)||(n=Koe(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};zb.prototype.addImage=function(e,t){let n=this._idHash[e];if(d(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Ee)&&(t=Ee.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=Koe(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};zb.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!d(n))throw new me(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,l=a.y+t.y/s,u=t.width/r,m=t.height/s,p=i._textureCoordinates.push(new He(c,l,u,m))-1;return i._indexHash[e]=p,i._guid=Yn(),p})};zb.prototype.isDestroyed=function(){return!1};zb.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Jb=zb;var qke=uo.SHOW_INDEX,eW=uo.POSITION_INDEX,Hoe=uo.PIXEL_OFFSET_INDEX,zoe=uo.EYE_OFFSET_INDEX,$ke=uo.HORIZONTAL_ORIGIN_INDEX,eDe=uo.VERTICAL_ORIGIN_INDEX,tDe=uo.SCALE_INDEX,$I=uo.IMAGE_INDEX_INDEX,Joe=uo.COLOR_INDEX,nDe=uo.ROTATION_INDEX,iDe=uo.ALIGNED_AXIS_INDEX,Qoe=uo.SCALE_BY_DISTANCE_INDEX,joe=uo.TRANSLUCENCY_BY_DISTANCE_INDEX,qoe=uo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,$oe=uo.DISTANCE_DISPLAY_CONDITION,oDe=uo.DISABLE_DEPTH_DISTANCE,rDe=uo.TEXTURE_COORDINATE_BOUNDS,ere=uo.SDF_INDEX,LO=uo.NUMBER_OF_PROPERTIES,xo,sDe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},aDe={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function cu(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(LO),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=g(e.debugShowTextureAtlas,!1),this.blendOption=g(e.blendOption,So.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ie.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=B.clone(B.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;d(n)&&d(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)d(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(cu.prototype,{length:{get:function(){return RO(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function tre(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}cu.prototype.add=function(e){let t=new uo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};cu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};cu.prototype.removeAll=function(){tre(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function RO(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];d(s)&&(s._index=r++,t.push(s))}e._billboards=t}}cu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};cu.prototype.contains=function(e){return d(e)&&e._billboardCollection===this};cu.prototype.get=function(e){return RO(this),this._billboards[e]};var xO;function cDe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(d(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function lDe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return d(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function dDe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return d(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}cu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<LO;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function uDe(e,t,n,i,o,r){let s=[{index:xo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[eW]},{index:xo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[eW]},{index:xo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Hoe]},{index:xo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[joe]},{index:xo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Joe]},{index:xo.eyeOffset,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[zoe]},{index:xo.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Qoe]},{index:xo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[qoe]},{index:xo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[$oe]},{index:xo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[rDe]}];i&&s.push({index:xo.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:dDe(e)}),d(o)&&s.push({index:xo.a_batchId,componentsPerAttribute:1,componentDatatype:Q.FLOAT,bufferUsage:Ne.STATIC_DRAW}),r&&s.push({index:xo.sdf,componentsPerAttribute:2,componentDatatype:Q.FLOAT,usage:n[ere]});let a=i?t:4*t;return new ip(e,s,a,i)}var _O=new On;function nre(e,t,n,i,o){let r,s=i[xo.positionHighAndScale],a=i[xo.positionLowAndRotation],c=o._getActualPosition();e._mode===ie.SCENE3D&&(ce.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),On.fromCartesian(c,_O);let l=o.scale,u=o.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let m=_O.high,p=_O.low;e._instanced?(r=o._index,s(r,m.x,m.y,m.z,l),a(r,p.x,p.y,p.z,u)):(r=o._index*4,s(r+0,m.x,m.y,m.z,l),s(r+1,m.x,m.y,m.z,l),s(r+2,m.x,m.y,m.z,l),s(r+3,m.x,m.y,m.z,l),a(r+0,p.x,p.y,p.z,u),a(r+1,p.x,p.y,p.z,u),a(r+2,p.x,p.y,p.z,u),a(r+3,p.x,p.y,p.z,u))}var au=new D,su=32768,cC=65536,TO=4096,Qh=256,mDe=128,hDe=32,fDe=8,ire=4,pDe=1/256,ore=0,rre=2,sre=3,are=1;function cre(e,t,n,i,o){let r,s=i[xo.compressedAttribute0],a=o.pixelOffset,c=a.x,l=a.y,u=o._translate,m=u.x,p=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+m),Math.abs(-l+p));let y=o.horizontalOrigin,f=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),f===In.BASELINE&&(f=In.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&y===bi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&f===In.CENTER;let _=0,C=0,V=0,L=0,Z=o._imageIndex;if(Z!==-1){let Y=n[Z];_=Y.x,C=Y.y,V=Y.width,L=Y.height}let G=_+V,X=C+L,P=Math.floor(W.clamp(c,-su,su)+su)*mDe;P+=(y+1)*hDe,P+=(f+1)*fDe,P+=(x?1:0)*ire;let v=Math.floor(W.clamp(l,-su,su)+su)*Qh,A=Math.floor(W.clamp(m,-su,su)+su)*Qh,M=(W.clamp(p,-su,su)+su)*pDe,b=Math.floor(M),R=Math.floor((M-b)*Qh);v+=b,A+=R,au.x=_,au.y=C;let E=Kn.compressTextureCoordinates(au);au.x=G;let I=Kn.compressTextureCoordinates(au);au.y=X;let w=Kn.compressTextureCoordinates(au);au.x=_;let N=Kn.compressTextureCoordinates(au);e._instanced?(r=o._index,s(r,P,v,A,E)):(r=o._index*4,s(r+0,P+ore,v,A,E),s(r+1,P+rre,v,A,I),s(r+2,P+sre,v,A,w),s(r+3,P+are,v,A,N))}function lre(e,t,n,i,o){let r,s=i[xo.compressedAttribute1],a=o.alignedAxis;h.equals(a,h.ZERO)||(e._shaderAlignedAxis=!0);let c=0,l=1,u=1,m=1,p=o.translucencyByDistance;d(p)&&(c=p.near,l=p.nearValue,u=p.far,m=p.farValue,(l!==1||m!==1)&&(e._shaderTranslucencyByDistance=!0));let y=0,f=o._imageIndex;f!==-1&&(y=n[f].width);let x=e._textureAtlas.texture.width,_=Math.round(g(o.width,x*y));e._maxSize=Math.max(e._maxSize,_);let C=W.clamp(_,0,cC),V=0;Math.abs(h.magnitudeSquared(a)-1)<W.EPSILON6&&(V=Kn.octEncodeFloat(a)),l=W.clamp(l,0,1),l=l===1?255:l*255|0,C=C*Qh+l,m=W.clamp(m,0,1),m=m===1?255:m*255|0,V=V*Qh+m,e._instanced?(r=o._index,s(r,C,V,c,u)):(r=o._index*4,s(r+0,C,V,c,u),s(r+1,C,V,c,u),s(r+2,C,V,c,u),s(r+3,C,V,c,u))}function CO(e,t,n,i,o){let r,s=i[xo.compressedAttribute2],a=o.color,c=d(e._batchTable)?B.WHITE:o.getPickId(t.context).color,l=o.sizeInMeters?1:0,u=Math.abs(h.magnitudeSquared(o.alignedAxis)-1)<W.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let m=0,p=o._imageIndex;p!==-1&&(m=n[p].height);let y=e._textureAtlas.texture.dimensions,f=Math.round(g(o.height,y.y*m));e._maxSize=Math.max(e._maxSize,f);let x=g(o._labelHorizontalOrigin,-2);x+=2;let _=f*ire+x,C=B.floatToByte(a.red),V=B.floatToByte(a.green),L=B.floatToByte(a.blue),Z=C*cC+V*Qh+L;C=B.floatToByte(c.red),V=B.floatToByte(c.green),L=B.floatToByte(c.blue);let G=C*cC+V*Qh+L,X=B.floatToByte(a.alpha)*cC+B.floatToByte(c.alpha)*Qh;X+=l*2+u,e._instanced?(r=o._index,s(r,Z,G,X,_)):(r=o._index*4,s(r+0,Z,G,X,_),s(r+1,Z,G,X,_),s(r+2,Z,G,X,_),s(r+3,Z,G,X,_))}function VO(e,t,n,i,o){let r,s=i[xo.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Ke.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let l=0,u=0,m=o._imageIndex;if(m!==-1){let y=n[m];l=y.width,u=y.height}au.x=l,au.y=u;let p=Kn.compressTextureCoordinates(au);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function dre(e,t,n,i,o){let r,s=i[xo.scaleByDistance],a=0,c=1,l=1,u=1,m=o.scaleByDistance;d(m)&&(a=m.near,c=m.nearValue,l=m.far,u=m.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,l,u)):(r=o._index*4,s(r+0,a,c,l,u),s(r+1,a,c,l,u),s(r+2,a,c,l,u),s(r+3,a,c,l,u))}function ure(e,t,n,i,o){let r,s=i[xo.pixelOffsetScaleByDistance],a=0,c=1,l=1,u=1,m=o.pixelOffsetScaleByDistance;d(m)&&(a=m.near,c=m.nearValue,l=m.far,u=m.farValue,(c!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,l,u)):(r=o._index*4,s(r+0,a,c,l,u),s(r+1,a,c,l,u),s(r+2,a,c,l,u),s(r+3,a,c,l,u))}function mre(e,t,n,i,o){let r,s=i[xo.compressedAttribute3],a=0,c=Number.MAX_VALUE,l=o.distanceDisplayCondition;d(l)&&(a=l.near,c=l.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=o.disableDepthTestDistance,m=o.heightReference===Ke.CLAMP_TO_GROUND&&t.context.depthTexture;d(u)||(u=m?5e3:0),u*=u,(m||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let p,y;if(d(o._labelDimensions))y=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let G=n[L];C=G.height,V=G.width}p=Math.round(g(o.height,e._textureAtlas.texture.dimensions.y*C));let Z=e._textureAtlas.texture.width;y=Math.round(g(o.width,Z*V))}let f=Math.floor(W.clamp(y,0,TO)),x=Math.floor(W.clamp(p,0,TO)),_=f*TO+x;e._instanced?(r=o._index,s(r,a,c,u,_)):(r=o._index*4,s(r+0,a,c,u,_),s(r+1,a,c,u,_),s(r+2,a,c,u,_),s(r+3,a,c,u,_))}function hre(e,t,n,i,o){if(o.heightReference===Ke.CLAMP_TO_GROUND){let f=e._scene,x=t.context,_=t.globeTranslucencyState.translucent,C=d(f.globe)&&f.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!_&&C}let r,s=i[xo.textureCoordinateBoundsOrLabelTranslate];if(kt.maximumVertexTextureImageUnits>0){let f=0,x=0;d(o._labelTranslate)&&(f=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,f,x,0,0)):(r=o._index*4,s(r+0,f,x,0,0),s(r+1,f,x,0,0),s(r+2,f,x,0,0),s(r+3,f,x,0,0));return}let a=0,c=0,l=0,u=0,m=o._imageIndex;if(m!==-1){let f=n[m];a=f.x,c=f.y,l=f.width,u=f.height}let p=a+l,y=c+u;e._instanced?(r=o._index,s(r,a,c,p,y)):(r=o._index*4,s(r+0,a,c,p,y),s(r+1,a,c,p,y),s(r+2,a,c,p,y),s(r+3,a,c,p,y))}function bDe(e,t,n,i,o){if(!d(e._batchTable))return;let r=i[xo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function fre(e,t,n,i,o){if(!e._sdf)return;let r,s=i[xo.sdf],a=o.outlineColor,c=o.outlineWidth,l=B.floatToByte(a.red),u=B.floatToByte(a.green),m=B.floatToByte(a.blue),p=l*cC+u*Qh+m,y=c/Rs.RADIUS,f=B.floatToByte(a.alpha)*cC+B.floatToByte(y)*Qh;e._instanced?(r=o._index,s(r,p,f)):(r=o._index*4,s(r+0,p+ore,f),s(r+1,p+rre,f),s(r+2,p+sre,f),s(r+3,p+are,f))}function yDe(e,t,n,i,o){nre(e,t,n,i,o),cre(e,t,n,i,o),lre(e,t,n,i,o),CO(e,t,n,i,o),VO(e,t,n,i,o),dre(e,t,n,i,o),ure(e,t,n,i,o),mre(e,t,n,i,o),hre(e,t,n,i,o),bDe(e,t,n,i,o),fre(e,t,n,i,o)}function SO(e,t,n,i,o,r){let s;i.mode===ie.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let l=t[c],u=l.position,m=uo._computeActualPosition(l,u,i,o);d(m)&&(l._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function gDe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ie.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ie.SCENE3D||n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&SO(e,i,i.length,t,r,!0)):n===ie.MORPHING?SO(e,i,i.length,t,r,!0):(n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&SO(e,o,e._billboardsToUpdateIndex,t,r,!1)}function xDe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function _De(e,t){let n=`uniform sampler2D billboard_texture; 
in vec2 v_textureCoordinates; 
void main() 
{ 
    out_FragColor = texture(billboard_texture, v_textureCoordinates); 
} 
`,i=t.createViewportQuadCommand(n,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Re.OVERLAY,i}var TDe=[];cu.prototype.update=function(e){if(RO(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,xo=this._instanced?aDe:sDe,xO=this._instanced?lDe:cDe;let o=this._textureAtlas;if(!d(o)){o=this._textureAtlas=new Jb({context:i});for(let v=0;v<n;++v)t[v]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;gDe(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,l=o.guid,u=this._createVertexArray||this._textureAtlasGUID!==l;this._textureAtlasGUID=l;let m,p=e.passes,y=p.pick;if(u||!y&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<LO;++v)c[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=uDe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),m=this._vaf.writers;for(let v=0;v<n;++v){let A=this._billboards[v];A._dirty=!1,yDe(this,e,r,m,A)}this._vaf.commit(xO(i))}this._billboardsToUpdateIndex=0}else if(a>0){let v=TDe;v.length=0,(c[eW]||c[nDe]||c[tDe])&&v.push(nre),(c[$I]||c[Hoe]||c[$ke]||c[eDe]||c[qke])&&(v.push(cre),this._instanced&&v.push(VO)),(c[$I]||c[iDe]||c[joe])&&(v.push(lre),v.push(CO)),(c[$I]||c[Joe])&&v.push(CO),c[zoe]&&v.push(VO),c[Qoe]&&v.push(dre),c[qoe]&&v.push(ure),(c[$oe]||c[oDe]||c[$I]||c[eW])&&v.push(mre),(c[$I]||c[eW])&&v.push(hre),c[ere]&&v.push(fre);let A=v.length;if(m=this._vaf.writers,a/n>.1){for(let M=0;M<a;++M){let b=s[M];b._dirty=!1;for(let R=0;R<A;++R)v[R](this,e,r,m,b)}this._vaf.commit(xO(i))}else{for(let M=0;M<a;++M){let b=s[M];b._dirty=!1;for(let R=0;R<A;++R)v[R](this,e,r,m,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(b._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!d(this._vaf)||!d(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,x=F.IDENTITY;e.mode===ie.SCENE3D?(x=this.modelMatrix,f=ce.clone(this._baseVolumeWC,this._boundingVolume)):f=ce.clone(this._baseVolume2D,this._boundingVolume),xDe(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===So.OPAQUE||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=De.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let v=this._blendOption===So.TRANSLUCENT;this._blendOption===So.TRANSLUCENT||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=De.fromCache({depthTest:{enabled:!0,func:v?ne.LEQUAL:ne.LESS},depthMask:v,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,Z,G,X=kt.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=jI,V=QI,G=[],d(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new Be({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(X?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let v=1-Rs.CUTOFF;this._sdf&&L.defines.push("SDF");let A=d(this._batchTable)?"VECTOR_TILE":"";this._blendOption===So.OPAQUE_AND_TRANSLUCENT&&(Z=new Be({defines:["OPAQUE",A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:xo}),Z=new Be({defines:["TRANSLUCENT",A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:xo})),this._blendOption===So.OPAQUE&&(Z=new Be({defines:[A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:xo})),this._blendOption===So.TRANSLUCENT&&(Z=new Be({defines:[A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:xo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let P=e.commandList;if(p.render||p.pick){let v=this._colorCommands,A=this._blendOption===So.OPAQUE,M=this._blendOption===So.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,E=this._uniforms,I;d(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),I=this._batchTable.getPickId()):I="v_pickColor",v.length=R;let w=M?R*2:R;for(let N=0;N<w;++N){let Y=v[N];d(Y)||(Y=v[N]=new nt);let k=A||M&&N%2===0;Y.pass=k||!M?Re.OPAQUE:Re.TRANSLUCENT,Y.owner=this;let O=M?Math.floor(N/2):N;Y.boundingVolume=f,Y.modelMatrix=x,Y.count=b[O].indicesCount,Y.shaderProgram=k?this._sp:this._spTranslucent,Y.uniformMap=E,Y.vertexArray=b[O].va,Y.renderState=k?this._rsOpaque:this._rsTranslucent,Y.debugShowBoundingVolume=this.debugShowBoundingVolume,Y.pickId=I,this._instanced&&(Y.count=6,Y.instanceCount=n),P.push(Y)}this.debugShowTextureAtlas&&(d(this.debugCommand)||(this.debugCommand=_De(this,e.context)),P.push(this.debugCommand))}};cu.prototype.isDestroyed=function(){return!1};cu.prototype.destroy=function(){return d(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),tre(this._billboards),ue(this)};var od=cu;var pLn=T(S(),1);var aLn=T(S(),1);function SDe(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var Ox=SDe;function Hs(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),lC(this)}var CDe=new he;Object.defineProperties(Hs.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=B.clone(e,this._color),lC(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,lC(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=B.clone(e,this._pointOutlineColor),lC(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,lC(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){d(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=g(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,CDe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=B.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&lC(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});Hs.defaultColor=B.WHITE;Hs.defaultPointOutlineColor=B.BLACK;Hs.defaultPointOutlineWidth=0;Hs.defaultPointSize=8;function lC(e){let t=e._billboard;if(d(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(d(e._billboardImage))return;let n=g(e._color,Hs.defaultColor),i=g(e._pointOutlineColor,Hs.defaultPointOutlineColor),o=g(e._pointOutlineWidth,Hs.defaultPointOutlineWidth),r=g(e._pointSize,Hs.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,l=e._billboardSize;if(B.equals(n,s)&&B.equals(i,a)&&o===c&&r===l)return;e._billboardColor=B.clone(n,e._billboardColor),e._billboardOutlineColor=B.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),y=JSON.stringify([m,r,p,o]);t.setImage(y,Ox(u,m,p,o,r))}Hs.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Hs.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Hs.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Hs.prototype.getPropertyInherited=function(e){return Ss.getPropertyInherited(this._content,this._batchId,e)};Hs.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Hs.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Hs.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Hs.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Dp=Hs;var aRn=T(S(),1);var _Ln=T(S(),1);function VDe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),l=100,u=r.width+l|0,m=3*a,p=m/2;c.width=u,c.height=m;let y=c.getContext("2d");y.font=n,y.fillStyle="white",y.fillRect(0,0,c.width+1,c.height+1),i&&(y.strokeStyle="black",y.lineWidth=e.lineWidth,y.strokeText(t,l/2,p)),o&&(y.fillStyle="black",y.fillText(t,l/2,p));let f=y.getImageData(0,0,u,m).data,x=f.length,_=u*4,C,V,L,Z;for(C=0;C<x;++C)if(f[C]!==255){L=C/_|0;break}for(C=x-1;C>=0;--C)if(f[C]!==255){Z=C/_|0;break}let G=-1;for(C=0;C<u&&G===-1;++C)for(V=0;V<m;++V){let X=C*4+V*_;if(f[X]!==255||f[X+1]!==255||f[X+2]!==255||f[X+3]!==255){G=C;break}}return{width:r.width,height:Z-L,ascent:p-L,descent:Z-p,minx:G-l/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Kx;function LDe(e,t){if(e==="")return;t=g(t,g.EMPTY_OBJECT);let n=g(t.font,"10px sans-serif"),i=g(t.stroke,!1),o=g(t.fill,!0),r=g(t.strokeWidth,1),s=g(t.backgroundColor,B.TRANSPARENT),a=g(t.padding,0),c=a*2,l=document.createElement("canvas");l.width=1,l.height=1,l.style.font=n;let u=l.getContext("2d",{willReadFrequently:!0});d(Kx)||(d(u.imageSmoothingEnabled)?Kx="imageSmoothingEnabled":d(u.mozImageSmoothingEnabled)?Kx="mozImageSmoothingEnabled":d(u.webkitImageSmoothingEnabled)?Kx="webkitImageSmoothingEnabled":d(u.msImageSmoothingEnabled)&&(Kx="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[Kx]=!1,l.style.visibility="hidden",document.body.appendChild(l);let m=VDe(u,e,n,i,o);l.dimensions=m,document.body.removeChild(l),l.style.visibility="";let p=-m.minx,y=Math.ceil(m.width)+p+c,f=m.height+c,x=f-m.ascent+a,_=f-x+c;if(l.width=y,l.height=f,u.font=n,u.lineJoin="round",u.lineWidth=r,u[Kx]=!1,s!==B.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,l.width,l.height)),i){let C=g(t.strokeColor,B.BLACK);u.strokeStyle=C.toCssColorString(),u.strokeText(e,p+a,_)}if(o){let C=g(t.fillColor,B.WHITE);u.fillStyle=C.toCssColorString(),u.fillText(e,p+a,_)}return l}var Hx=LDe;var Lre=T(gre(),1);var ULn=T(S(),1);var VLn=T(S(),1),ZDe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},vo=Object.freeze(ZDe);var xre={},_re=0,GDe=256,EDe=new B(.165,.165,.165,.8),XDe=new D(7,5),qr=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function zx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function nW(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function iW(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Sre(e){let t=xre[e._font];if(!d(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(iW(n,"line-height"));isNaN(i)&&(i=void 0),t={family:iW(n,"font-family"),size:iW(n,"font-size").replace("px",""),style:iW(n,"font-style"),weight:iW(n,"font-weight"),lineHeight:i},document.body.removeChild(n),_re<GDe&&(xre[e._font]=t,_re++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Bp(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;d(n)&&(n=Pt.clone(n)),d(i)&&(i=Pt.clone(i)),d(o)&&(o=Pt.clone(o)),d(r)&&(r=Gt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=g(e.show,!0),this._font=g(e.font,"30px sans-serif"),this._fillColor=B.clone(g(e.fillColor,B.WHITE)),this._outlineColor=B.clone(g(e.outlineColor,B.BLACK)),this._outlineWidth=g(e.outlineWidth,1),this._showBackground=g(e.showBackground,!1),this._backgroundColor=B.clone(g(e.backgroundColor,EDe)),this._backgroundPadding=D.clone(g(e.backgroundPadding,XDe)),this._style=g(e.style,vo.FILL),this._verticalOrigin=g(e.verticalOrigin,In.BASELINE),this._horizontalOrigin=g(e.horizontalOrigin,bi.LEFT),this._pixelOffset=D.clone(g(e.pixelOffset,D.ZERO)),this._eyeOffset=h.clone(g(e.eyeOffset,h.ZERO)),this._position=h.clone(g(e.position,h.ZERO)),this._scale=g(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=g(e.heightReference,Ke.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=g(e.text,""),this._relativeSize=1,Sre(this),this._updateClamping()}Object.defineProperties(Bp.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;d(r)&&(r.show=e)}let n=this._backgroundBillboard;d(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;d(s)&&(s.position=e)}let i=this._backgroundBillboard;d(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;d(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;d(n)&&(n.heightReference=e),nW(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=Bp.enableRightToLeftDetection?FDe(t):t,zx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,zx(this),Sre(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;B.equals(t,e)||(B.clone(e,t),zx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),zx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,zx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,zx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!B.equals(t,e)){B.clone(e,t);let n=this._backgroundBillboard;d(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;D.equals(t,e)||(D.clone(e,t),nW(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,zx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!D.equals(t,e)){D.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];d(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;d(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Pt.equals(t,e)){this._translucencyByDistance=Pt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];d(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;d(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Pt.equals(t,e)){this._pixelOffsetScaleByDistance=Pt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];d(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;d(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Pt.equals(t,e)){this._scaleByDistance=Pt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];d(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;d(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];d(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;d(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,nW(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;d(n)&&(n.verticalOrigin=e),nW(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;d(n)&&(n.scale=e*this._relativeSize),nW(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Gt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;d(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;d(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;d(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!d(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;d(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];d(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;d(n)&&(n.clusterShow=e)}}}});Bp.prototype._updateClamping=function(){uo._updateClamping(this._labelCollection,this)};Bp.prototype.computeScreenSpacePosition=function(e,t){d(t)||(t=new D);let i=this._labelCollection.modelMatrix,o=d(this._actualClampedPosition)?this._actualClampedPosition:this._position;return uo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Bp.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(d(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===In.BOTTOM||e.verticalOrigin===In.BASELINE?o-=s:e.verticalOrigin===In.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let l=0,u=0,m=e._glyphs,p=m.length;for(let y=0;y<p;++y){let f=m[y],x=f.billboard;if(!d(x))continue;let _=t.x+x._translate.x,C=t.y-x._translate.y,V=f.dimensions.width*a,L=f.dimensions.height*a;e.verticalOrigin===In.BOTTOM||e.verticalOrigin===In.BASELINE?C-=L:e.verticalOrigin===In.CENTER&&(C-=L*.5),e._verticalOrigin===In.TOP?C+=Rs.PADDING*a:(e._verticalOrigin===In.BOTTOM||e._verticalOrigin===In.BASELINE)&&(C-=Rs.PADDING*a),i=Math.min(i,_),o=Math.min(o,C),l=Math.max(l,_+V),u=Math.max(u,C+L)}r=l-i,s=u-o}return d(n)||(n=new He),n.x=i,n.y=o,n.width=r,n.height=s,n};Bp.prototype.equals=function(e){return this===e||d(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&B.equals(this._fillColor,e._fillColor)&&B.equals(this._outlineColor,e._outlineColor)&&B.equals(this._backgroundColor,e._backgroundColor)&&D.equals(this._backgroundPadding,e._backgroundPadding)&&D.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Pt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Pt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Pt.equals(this._scaleByDistance,e._scaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Bp.prototype.isDestroyed=function(){return!1};Bp.enableRightToLeftDetection=!1;function IDe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=qr.LTR,a="",c=e.length;for(let l=0;l<c;++l){let u=e.charAt(l);t.test(u)?a=qr.RTL:n.test(u)?a=qr.LTR:i.test(u)?a=qr.BRACKETS:a=qr.WEAK,l===0&&(s=a),s===a&&a!==qr.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function WDe(e){return e.split("").reverse().join("")}function oW(e,t,n){return e.slice(0,t)+n+e.slice(t)}function PDe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var vDe="\u05D0-\u05EA",wDe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Tre=new RegExp(`[${vDe}${wDe}]`);function FDe(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Tre.test(o.charAt(0)),s=IDe(o,Tre),a=0,c="";for(let l=0;l<s.length;++l){let u=s[l],m=u.Type===qr.BRACKETS?PDe(u.Word):WDe(u.Word);r?u.Type===qr.RTL?(c=m+c,a=0):u.Type===qr.LTR?(c=oW(c,a,u.Word),a+=u.Word.length):(u.Type===qr.WEAK||u.Type===qr.BRACKETS)&&(u.Type===qr.WEAK&&s[l-1].Type===qr.BRACKETS?c=m+c:s[l-1].Type===qr.RTL?(c=m+c,a=0):s.length>l+1?s[l+1].Type===qr.RTL?(c=m+c,a=0):(c=oW(c,a,u.Word),a+=u.Word.length):c=oW(c,0,m)):u.Type===qr.RTL?c=oW(c,a,m):u.Type===qr.LTR?(c+=u.Word,a=c.length):(u.Type===qr.WEAK||u.Type===qr.BRACKETS)&&(l>0&&s[l-1].Type===qr.RTL?s.length>l+1?s[l+1].Type===qr.RTL?c=oW(c,a,m):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
`)}return n}var Qb=Bp;var Rre=T(Cre(),1);function MDe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function NDe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var UDe=1.2,Zre="ID_WHITE_PIXEL",ZO=new D(4,4),kDe=new He(1,1,1,1);function DDe(e){let t=document.createElement("canvas");t.width=ZO.x,t.height=ZO.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Zre,t)}var lu={};function BDe(e,t,n,i,o,r,s){return lu.font=t,lu.fillColor=n,lu.strokeColor=i,lu.strokeWidth=o,lu.padding=Rs.PADDING,s===In.CENTER?lu.textBaseline="middle":s===In.TOP?lu.textBaseline="top":lu.textBaseline="bottom",lu.fill=r===vo.FILL||r===vo.FILL_AND_OUTLINE,lu.stroke=r===vo.OUTLINE||r===vo.FILL_AND_OUTLINE,lu.backgroundColor=B.BLACK,Hx(e,lu)}function GO(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;d(n)&&(n.show=!1,n.image=void 0,d(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function YDe(e,t,n,i){i.index=e.addImageSync(t,n)}var ODe=new Rre.default;function KDe(e,t){let n=t._renderedText,i=ODe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,l;if(t._relativeSize=t._fontSize/Rs.FONT_SIZE,o<s)for(c=o;c<s;++c)GO(e,r[c]);r.length=o;let u=t._showBackground&&n.split(`
`).join("").length>0,m=t._backgroundBillboard,p=e._backgroundBillboardCollection;u?(d(m)||(m=p.add({collection:e,image:Zre,imageSubRegion:kDe}),t._backgroundBillboard=m),m.color=t._backgroundColor,m.show=t._show,m.position=t._position,m.eyeOffset=t._eyeOffset,m.pixelOffset=t._pixelOffset,m.horizontalOrigin=bi.LEFT,m.verticalOrigin=t._verticalOrigin,m.heightReference=t._heightReference,m.scale=t.totalScale,m.pickPrimitive=t,m.id=t._id,m.translucencyByDistance=t._translucencyByDistance,m.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,m.scaleByDistance=t._scaleByDistance,m.distanceDisplayCondition=t._distanceDisplayCondition,m.disableDepthTestDistance=t._disableDepthTestDistance):d(m)&&(p.remove(m),t._backgroundBillboard=m=void 0);let y=e._glyphTextureCache;for(l=0;l<o;++l){let f=i[l],x=t._verticalOrigin,_=JSON.stringify([f,t._fontFamily,t._fontStyle,t._fontWeight,+x]),C=y[_];if(!d(C)){let V=`${t._fontStyle} ${t._fontWeight} ${Rs.FONT_SIZE}px ${t._fontFamily}`,L=BDe(f,V,B.WHITE,B.WHITE,0,vo.FILL,x);if(C=new NDe(e,-1,L.dimensions),y[_]=C,L.width>0&&L.height>0){let Z=(0,Lre.default)(L,{cutoff:Rs.CUTOFF,radius:Rs.RADIUS}),G=L.getContext("2d"),X=L.width,P=L.height,v=G.getImageData(0,0,X,P);for(let A=0;A<X;A++)for(let M=0;M<P;M++){let b=M*X+A,R=Z[b]*255,E=b*4;v.data[E+0]=R,v.data[E+1]=R,v.data[E+2]=R,v.data[E+3]=R}G.putImageData(v,0,0),f!==" "&&YDe(e._textureAtlas,_,L,C)}}if(a=r[l],d(a)?C.index===-1?GO(e,a):d(a.textureInfo)&&(a.textureInfo=void 0):(a=new MDe,r[l]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let V=a.billboard,L=e._spareBillboards;d(V)||(L.length>0?V=L.pop():(V=e._billboardCollection.add({collection:e}),V._labelDimensions=new D,V._labelTranslate=new D),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=bi.LEFT,V.verticalOrigin=t._verticalOrigin,V.heightReference=t._heightReference,V.scale=t.totalScale,V.pickPrimitive=t,V.id=t._id,V.image=_,V.translucencyByDistance=t._translucencyByDistance,V.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,V.scaleByDistance=t._scaleByDistance,V.distanceDisplayCondition=t._distanceDisplayCondition,V.disableDepthTestDistance=t._disableDepthTestDistance,V._batchIndex=t._batchIndex,V.outlineColor=t.outlineColor,t.style===vo.FILL_AND_OUTLINE?(V.color=t._fillColor,V.outlineWidth=t.outlineWidth):t.style===vo.FILL?(V.color=t._fillColor,V.outlineWidth=0):t.style===vo.OUTLINE&&(V.color=B.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Vre(e,t,n){return t===bi.CENTER?-e/2:t===bi.RIGHT?-(e+n.x):n.x}var ir=new D,HDe=new D;function zDe(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,l=0,u=1,m,p=t.length,y=e._backgroundBillboard,f=D.clone(d(y)?e._backgroundPadding:D.ZERO,HDe);for(f.x/=e._relativeSize,f.y/=e._relativeSize,m=0;m<p;++m)n.charAt(m)===`
`?(a.push(r),++u,r=0):(i=t[m],o=i.dimensions,l=Math.max(l,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,m<p-1&&(r+=t[m+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=l+c,_=e.totalScale,C=e._horizontalOrigin,V=e._verticalOrigin,L=0,Z=a[L],G=Vre(Z,C,f),X=(d(e._lineHeight)?e._lineHeight:UDe*e._fontSize)/e._relativeSize,P=X*(u-1),v=s,A=x+P;d(y)&&(v+=f.x*2,A+=f.y*2,y._labelHorizontalOrigin=C),ir.x=G*_,ir.y=0;let M=!0,b=0;for(m=0;m<p;++m)if(n.charAt(m)===`
`)++L,b+=X,Z=a[L],G=Vre(Z,C,f),ir.x=G*_,M=!0;else if(i=t[m],o=i.dimensions,V===In.TOP?(ir.y=o.height-l-f.y,ir.y+=Rs.PADDING):V===In.CENTER?ir.y=(P+o.height-l)/2:V===In.BASELINE?(ir.y=P,ir.y-=Rs.PADDING):(ir.y=P+c+f.y,ir.y-=Rs.PADDING),ir.y=(ir.y-o.descent-b)*_,M&&(ir.x-=Rs.PADDING*_,M=!1),d(i.billboard)&&(i.billboard._setTranslate(ir),i.billboard._labelDimensions.x=v,i.billboard._labelDimensions.y=A,i.billboard._labelHorizontalOrigin=C),m<p-1){let R=t[m+1];ir.x+=(o.width-o.minx+R.dimensions.minx)*_}if(d(y)&&n.split(`
`).join("").length>0&&(C===bi.CENTER?G=-s/2-f.x:C===bi.RIGHT?G=-(s+f.x*2):G=0,ir.x=G*_,V===In.TOP?ir.y=x-l-c:V===In.CENTER?ir.y=(x-l)/2-c:V===In.BASELINE?ir.y=-f.y-c:ir.y=0,ir.y=ir.y*_,y.width=v,y.height=A,y._setTranslate(ir),y._labelTranslate=D.clone(ir,y._labelTranslate)),e.heightReference===Ke.CLAMP_TO_GROUND)for(m=0;m<p;++m){i=t[m];let R=i.billboard;d(R)&&(R._labelTranslate=D.clone(ir,R._labelTranslate))}}function Gre(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)GO(e,n[i]);d(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,d(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function jh(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new od({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new od({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=B.clone(B.WHITE),this.show=g(e.show,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,So.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(jh.prototype,{length:{get:function(){return this._labels.length}}});jh.prototype.add=function(e){let t=new Qb(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};jh.prototype.remove=function(e){if(d(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Gre(this,e),!0}return!1};jh.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Gre(this,e[t]);e.length=0};jh.prototype.contains=function(e){return d(e)&&e._labelCollection===this};jh.prototype.get=function(e){return this._labels[e]};jh.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;d(this._textureAtlas)||(this._textureAtlas=new Jb({context:i}),t.textureAtlas=this._textureAtlas),d(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Jb({context:i,initialSize:ZO}),n.textureAtlas=this._backgroundTextureAtlas,DDe(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(KDe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(zDe(a),a._repositionAllGlyphs=!1);let l=a._glyphs.length-c;this._totalGlyphCount+=l}let r=n.length>0?So.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};jh.prototype.isDestroyed=function(){return!1};jh.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var qh=jh;var xZn=T(S(),1);var lRn=T(S(),1),rW=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 position2DHigh;
in vec3 position2DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 prevPosition2DHigh;
in vec3 prevPosition2DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec3 nextPosition2DHigh;
in vec3 nextPosition2DLow;
in vec4 texCoordExpandAndBatchIndex;

out vec2  v_st;
out float v_width;
out vec4 v_pickColor;
out float v_polylineAngle;

void main()
{
    float texCoord = texCoordExpandAndBatchIndex.x;
    float expandDir = texCoordExpandAndBatchIndex.y;
    bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
    float batchTableIndex = texCoordExpandAndBatchIndex.w;

    vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
    float width = widthAndShow.x + 0.5;
    float show = widthAndShow.y;

    if (width < 1.0)
    {
        show = 0.0;
    }

    vec4 pickColor = batchTable_getPickColor(batchTableIndex);

    vec4 p, prev, next;
    if (czm_morphTime == 1.0)
    {
        p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
        prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
        next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
    }
    else if (czm_morphTime == 0.0)
    {
        p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
        prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
        next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
    }
    else
    {
        p = czm_columbusViewMorph(
                czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
                czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
                czm_morphTime);
        prev = czm_columbusViewMorph(
                czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
                czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
                czm_morphTime);
        next = czm_columbusViewMorph(
                czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
                czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
                czm_morphTime);
    }

    #ifdef DISTANCE_DISPLAY_CONDITION
        vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
        vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
        vec3 centerLow = centerLowAndRadius.xyz;
        float radius = centerLowAndRadius.w;
        vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);

        float lengthSq;
        if (czm_sceneMode == czm_sceneMode2D)
        {
            lengthSq = czm_eyeHeight2D.y;
        }
        else
        {
            vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
            lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
        }

        float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
        float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
        if (lengthSq < nearSq || lengthSq > farSq)
        {
            show = 0.0;
        }
    #endif

    float polylineAngle;
    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
    gl_Position = czm_viewportOrthographic * positionWC * show;

    v_st.s = texCoord;
    v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);

    v_width = width;
    v_pickColor = pickColor;
    v_polylineAngle = polylineAngle;
}
`;var vRn=T(S(),1);var SRn=T(S(),1);var wc={};wc.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};wc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var JDe=new he;wc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,JDe).height}return i};var QDe=new F,jDe=new h,Ere=new h,qDe=new on(h.UNIT_X,0),Xre=new h,$De=new on(h.UNIT_X,0),eBe=new h,tBe=new h,XO=[];function Wre(e,t,n){let i=XO;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var u5=new he,d5=new he,jb=new h,IO=new h,nBe=new h,EO=new eu,sW=new ha;function iBe(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,IO),l=i.scaleToGeodeticSurface(t,nBe),u=wc.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,u5),p=i.cartesianToCartographic(l,d5),y=Wre(u,o,r);EO.setEndPoints(m,p);let f=EO.surfaceDistance/u,x=a;m.height=o;let _=i.cartographicToCartesian(m,jb);h.pack(_,s,x),x+=3;for(let C=1;C<u;C++){let V=EO.interpolateUsingSurfaceDistance(C*f,d5);V.height=y[C],_=i.cartographicToCartesian(V,jb),h.pack(_,s,x),x+=3}return x}function oBe(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,u5),l=i.cartesianToCartographic(t,d5),u=wc.numberOfPointsRhumbLine(c,l,n);c.height=0,l.height=0;let m=Wre(u,o,r);sW.ellipsoid.equals(i)||(sW=new ha(void 0,void 0,i)),sW.setEndPoints(c,l);let p=sW.surfaceDistance/u,y=a;c.height=o;let f=i.cartographicToCartesian(c,jb);h.pack(f,s,y),y+=3;for(let x=1;x<u;x++){let _=sW.interpolateUsingSurfaceDistance(x*p,d5);_.height=m[x],f=i.cartographicToCartesian(_,jb),h.pack(f,s,y),y+=3}return y}wc.wrapLongitude=function(e,t){let n=[],i=[];if(d(e)&&e.length>0){t=g(t,F.IDENTITY);let o=F.inverseTransformation(t,QDe),r=F.multiplyByPoint(o,h.ZERO,jDe),s=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_Y,Ere),Ere),a=on.fromPointNormal(r,s,qDe),c=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_X,Xre),Xre),l=on.fromPointNormal(r,c,$De),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let y=1;y<p;++y){let f=e[y];if(on.getPointDistance(l,m)<0||on.getPointDistance(l,f)<0){let x=Si.lineSegmentPlane(m,f,a,eBe);if(d(x)){let _=h.multiplyByScalar(s,5e-9,tBe);on.getPointDistance(a,m)<0&&h.negate(_,_),n.push(h.add(x,_,new h)),i.push(u+1),h.negate(_,_),n.push(h.add(x,_,new h)),u=1}}n.push(h.clone(e[y])),u++,m=f}i.push(u)}return{positions:n,lengths:i}};wc.generateArc=function(e){d(e)||(e={});let t=e.positions,n=t.length,i=g(e.ellipsoid,re.WGS84),o=g(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],IO);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(x,jb);h.multiplyByScalar(_,o,_),h.add(x,_,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!d(s)){let x=g(e.granularity,W.RADIANS_PER_DEGREE);s=W.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=wc.numberOfPoints(t[c],t[c+1],s);let l=(a+1)*3,u=new Array(l),m=0;for(c=0;c<n-1;c++){let x=t[c],_=t[c+1],C=r?o[c]:o,V=r?o[c+1]:o;m=iBe(x,_,s,i,C,V,u,m)}XO.length=0;let p=t[n-1],y=i.cartesianToCartographic(p,u5);y.height=r?o[n-1]:o;let f=i.cartographicToCartesian(y,jb);return h.pack(f,u,l-3),u};var Ire=new he,rBe=new he;wc.generateRhumbArc=function(e){d(e)||(e={});let t=e.positions,n=t.length,i=g(e.ellipsoid,re.WGS84),o=g(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],IO);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(C,jb);h.multiplyByScalar(V,o,V),h.add(C,V,C)}return[C.x,C.y,C.z]}let s=g(e.granularity,W.RADIANS_PER_DEGREE),a=0,c,l=i.cartesianToCartographic(t[0],Ire),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],rBe),a+=wc.numberOfPointsRhumbLine(l,u,s),l=he.clone(u,Ire);let m=(a+1)*3,p=new Array(m),y=0;for(c=0;c<n-1;c++){let C=t[c],V=t[c+1],L=r?o[c]:o,Z=r?o[c+1]:o;y=oBe(C,V,s,i,L,Z,p,y)}XO.length=0;let f=t[n-1],x=i.cartesianToCartographic(f,u5);x.height=r?o[n-1]:o;let _=i.cartographicToCartesian(x,jb);return h.pack(_,p,m-3),p};wc.generateCartesianArc=function(e){let t=wc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};wc.generateCartesianRhumbArc=function(e){let t=wc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var Xi=wc;function rd(e,t){e=g(e,g.EMPTY_OBJECT),this._show=g(e.show,!0),this._width=g(e.width,1),this._loop=g(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,d(this._material)||(this._material=ki.fromType(ki.ColorType,{color:new B(1,1,1,1)}));let n=e.positions;d(n)||(n=[]),this._positions=n,this._actualPositions=go(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;d(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Xi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(vre),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ce.fromPoints(this._actualPositions),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ce}var Pre=rd.POSITION_INDEX=0,sBe=rd.SHOW_INDEX=1,aBe=rd.WIDTH_INDEX=2,cBe=rd.MATERIAL_INDEX=3,aW=rd.POSITION_SIZE_INDEX=4,lBe=rd.DISTANCE_DISPLAY_CONDITION=5,vre=rd.NUMBER_OF_PROPERTIES=6;function Yp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;d(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(rd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Yp(this,sBe))}},positions:{get:function(){return this._positions},set:function(e){let t=go(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Yp(this,aW),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ce.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Yp(this,Pre),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Yp(this,cBe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Yp(this,aBe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Yp(this,aW)}}},id:{get:function(){return this._id},set:function(e){this._id=e,d(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!d(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Yp(this,lBe))}}});rd.prototype.update=function(){let e=F.IDENTITY;d(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Pre]>0||this._propertiesChanged[aW]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Xi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ce.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)Yp(this,aW);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Yp(this,aW);break}}};rd.prototype.getPickId=function(e){return d(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};rd.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<vre-1;++t)e[t]=0};rd.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var du=rd;var dBe=du.SHOW_INDEX,uBe=du.WIDTH_INDEX,PO=du.POSITION_INDEX,mBe=du.MATERIAL_INDEX,wre=du.POSITION_SIZE_INDEX,hBe=du.DISTANCE_DISPLAY_CONDITION,Dre=du.NUMBER_OF_PROPERTIES,Cl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Wm(e){e=g(e,g.EMPTY_OBJECT),this.show=g(e.show,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Dre),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=B.clone(B.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Wm.prototype,{length:{get:function(){return vO(this),this._polylines.length}}});Wm.prototype.add=function(e){let t=new du(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Wm.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,d(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Wm.prototype.removeAll=function(){wO(this),Hre(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Wm.prototype.contains=function(e){return d(e)&&e._polylineCollection===this};Wm.prototype.get=function(e){return vO(this),this._polylines[e]};function fBe(e,t){d(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Q.FLOAT,componentsPerAttribute:2}];e._batchTable=new Bg(t,n,e._polylines.length)}var Bre=new On,Yre=new se,Ore=new D;Wm.prototype.update=function(e){if(vO(this),this._polylines.length===0||!this.show)return;_Be(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(kt.maximumVertexTextureImageUnits===0)throw new me("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");fBe(this,t),this._createBatchTable=!1}if(this._createVertexArray||bBe(this))Mre(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ie.SCENE3D){let l=c.length;for(let u=0;u<l;++u)i=c[u],i.update()}if(o[wre]||o[mBe])Mre(this,t,n);else{let l=c.length,u=this._polylineBuckets;for(let m=0;m<l;++m){i=c[m],o=i._propertiesChanged;let p=i._bucket,y=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[PO]&&p.writeUpdate(y,i,this._positionBuffer,n);break}y+=u[f].lengthOfPositions}if((o[dBe]||o[uBe])&&this._batchTable.setBatchedAttribute(i._index,0,new D(i._width,i._show)),this._batchTable.attributes.length>2){if(o[PO]||o[wre]){let f=e.mode===ie.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=On.fromCartesian(f.center,Bre),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,Yre);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[hBe]){let f=Ore;f.x=0,f.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;d(x)&&(f.x=x.near,f.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<Dre;++c)o[c]=0;let r=F.IDENTITY;e.mode===ie.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!d(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=De.fromCache({depthMask:a,depthTest:{enabled:a}})),(!d(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=De.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;pBe(this,e,c,r)}};var cW=new ce,Fre=new ce;function pBe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,l=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),y=l.length;for(let f=0;f<y;++f){let x=l[f],_=x.buckets,C=_.length;for(let V=0;V<C;++V){let L=_[V],Z=L.offset,G=L.bucket.shaderProgram,X=L.bucket.polylines,P=X.length,v,A,M=0,b,R;for(let E=0;E<P;++E){let I=X[E],w=gBe(I._material);if(w!==v){if(d(v)&&M>0){let O=A.isTranslucent();a>=s?(b=new nt({owner:e}),n.push(b)):b=n[a],++a,R=xt(p(A._uniforms),e._uniformMap),b.boundingVolume=ce.clone(cW,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=O?e._translucentRS:e._opaqueRS,b.pass=O?Re.TRANSLUCENT:Re.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=M,b.offset=Z,Z+=M,M=0,c=!0,r.push(b)}A=I._material,A.update(o),v=w}let N=I._locatorBuckets,Y=N.length;for(let O=0;O<Y;++O){let U=N[O];U.locator===L&&(M+=U.count)}let k;t.mode===ie.SCENE3D?k=I._boundingVolumeWC:t.mode===ie.COLUMBUS_VIEW?k=I._boundingVolume2D:t.mode===ie.SCENE2D?d(I._boundingVolume2D)&&(k=ce.clone(I._boundingVolume2D,Fre),k.center.x=0):d(I._boundingVolumeWC)&&d(I._boundingVolume2D)&&(k=ce.union(I._boundingVolumeWC,I._boundingVolume2D,Fre)),c?(c=!1,ce.clone(k,cW)):ce.union(k,cW,cW)}d(v)&&M>0&&(a>=s?(b=new nt({owner:e}),n.push(b)):b=n[a],++a,R=xt(p(A._uniforms),e._uniformMap),b.boundingVolume=ce.clone(cW,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=A.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=A.isTranslucent()?Re.TRANSLUCENT:Re.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=M,b.offset=Z,c=!0,r.push(b)),v=void 0}}n.length=a}Wm.prototype.isDestroyed=function(){return!1};Wm.prototype.destroy=function(){return Kre(this),wO(this),Hre(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function bBe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[PO]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var Are=[0,0,0];function Mre(e,t,n){e._createVertexArray=!1,wO(e),Kre(e),xBe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,l=[[]],u=0,m=e._polylineBuckets,p,y;for(p in m)m.hasOwnProperty(p)&&(y=m[p],y.updateShader(t,r,s),u+=y.lengthOfPositions);if(u>0){let f=e._mode,x=new Float32Array(6*u*3),_=new Float32Array(u*4),C,V=0,L=0,Z=0;for(p in m)if(m.hasOwnProperty(p)){y=m[p],y.write(x,_,V,L,Z,r,t,n),f===ie.MORPHING&&(d(C)||(C=new Float32Array(6*u*3)),y.writeForMorph(C,V));let R=y.lengthOfPositions;V+=6*R*3,L+=R*4,Z+=R*4,c=y.updateIndices(i,a,l,c)}let G=e._positionBufferUsage.bufferUsage,X=Ne.STATIC_DRAW;e._positionBuffer=mt.createVertexBuffer({context:t,typedArray:x,usage:G});let P;d(C)&&(P=mt.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=mt.createVertexBuffer({context:t,typedArray:_,usage:X});let v=3*Float32Array.BYTES_PER_ELEMENT,A=4*Float32Array.BYTES_PER_ELEMENT,M=0,b=i.length;for(let R=0;R<b;++R)if(o=i[R],o.length>0){let E=new Uint16Array(o),I=mt.createIndexBuffer({context:t,typedArray:E,usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});M+=a[R];let w=6*(R*(v*W.SIXTY_FOUR_KILOBYTES)-M*v),N=v+w,Y=v+N,k=v+Y,O=v+k,U=v+O,J=R*(A*W.SIXTY_FOUR_KILOBYTES)-M*A,z=[{index:Cl.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*v},{index:Cl.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*v},{index:Cl.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*v},{index:Cl.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*v},{index:Cl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*v},{index:Cl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*v},{index:Cl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*v},{index:Cl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*v},{index:Cl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*v},{index:Cl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*v},{index:Cl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*v},{index:Cl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*v},{index:Cl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}],ee,K,j,q;f===ie.SCENE3D?(K=e._positionBuffer,ee="vertexBuffer",j=Are,q="value"):f===ie.SCENE2D||f===ie.COLUMBUS_VIEW?(K=Are,ee="value",j=e._positionBuffer,q="vertexBuffer"):(K=P,ee="vertexBuffer",j=e._positionBuffer,q="vertexBuffer"),z[0][ee]=K,z[1][ee]=K,z[2][q]=j,z[3][q]=j,z[4][ee]=K,z[5][ee]=K,z[6][q]=j,z[7][q]=j,z[8][ee]=K,z[9][ee]=K,z[10][q]=j,z[11][q]=j;let be=new ni({context:t,attributes:z,indexBuffer:I});e._vertexArrays.push({va:be,buckets:l[R]})}}}function yBe(e,t){return t instanceof Wt?t.id:t}var m5=[];function gBe(e){let t=ki._uniformList[e.type],n=t.length;m5.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];m5[i]=r,m5[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(m5,yBe)}`}function xBe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,l=i[c.type];d(l)||(l=i[c.type]=new $h(c,t,n)),l.addPolyline(a)}}}function _Be(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function vO(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function wO(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;d(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Kre(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Wm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Hre(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function WO(e,t,n){this.count=e,this.offset=t,this.bucket=n}function $h(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}$h.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};$h.prototype.updateShader=function(e,t,n){if(d(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Mt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Be({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,ex]}),r=t.getVertexShaderCallback()(rW),s=new Be({defines:i,sources:[jl,r]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Cl})};function zre(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(on.ORIGIN_ZX_PLANE)===qt.INTERSECTING}$h.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ie.SCENE3D||!zre(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var as=new h,uu=new h,mu=new h,h5=new h,TBe=new se,SBe=new D;$h.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,l=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,m=u.length;for(let p=0;p<m;++p){let y=u[p],f=y.width,x=y.show&&f>0,_=y._index,C=this.getSegments(y,a),V=C.positions,L=C.lengths,Z=V.length,G=y.getPickId(s).color,X=0,P=0,v;for(let Y=0;Y<Z;++Y){Y===0?y._loop?v=V[Z-2]:(v=h5,h.subtract(V[0],V[1],v),h.add(V[0],v,v)):v=V[Y-1],h.clone(v,uu),h.clone(V[Y],as),Y===Z-1?y._loop?v=V[1]:(v=h5,h.subtract(V[Z-1],V[Z-2],v),h.add(V[Z-1],v,v)):v=V[Y+1],h.clone(v,mu);let k=L[X];Y===P+k&&(P+=k,++X);let O=Y-P===0,U=Y===P+L[X]-1;c===ie.SCENE2D&&(uu.z=0,as.z=0,mu.z=0),(c===ie.SCENE2D||c===ie.MORPHING)&&(O||U)&&l-Math.abs(as.x)<1&&((as.x<0&&uu.x>0||as.x>0&&uu.x<0)&&h.clone(as,uu),(as.x<0&&mu.x>0||as.x>0&&mu.x<0)&&h.clone(as,mu));let J=O?2:0,z=U?2:4;for(let ee=J;ee<z;++ee){On.writeElements(as,e,n),On.writeElements(uu,e,n+6),On.writeElements(mu,e,n+12);let K=ee-2<0?-1:1;t[o]=Y/(Z-1),t[o+1]=2*(ee%2)-1,t[o+2]=K,t[o+3]=_,n+=6*3,o+=4}}let A=TBe;A.x=B.floatToByte(G.red),A.y=B.floatToByte(G.green),A.z=B.floatToByte(G.blue),A.w=B.floatToByte(G.alpha);let M=SBe;M.x=f,M.y=x?1:0;let b=c===ie.SCENE2D?y._boundingVolume2D:y._boundingVolumeWC,R=On.fromCartesian(b.center,Bre),E=R.high,I=se.fromElements(R.low.x,R.low.y,R.low.z,b.radius,Yre),w=Ore;w.x=0,w.y=Number.MAX_VALUE;let N=y.distanceDisplayCondition;d(N)&&(w.x=N.near,w.y=N.far),r.setBatchedAttribute(_,0,M),r.setBatchedAttribute(_,1,A),r.attributes.length>2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,I),r.setBatchedAttribute(_,4,w))}};var CBe=new h,VBe=new h,LBe=new h,Nre=new h;$h.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,l=a.length,u=0,m=0;for(let p=0;p<l;++p){let y;p===0?s._loop?y=a[l-2]:(y=Nre,h.subtract(a[0],a[1],y),h.add(a[0],y,y)):y=a[p-1],y=F.multiplyByPoint(n,y,VBe);let f=F.multiplyByPoint(n,a[p],CBe),x;p===l-1?s._loop?x=a[1]:(x=Nre,h.subtract(a[l-1],a[l-2],x),h.add(a[l-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,LBe);let _=c[u];p===m+_&&(m+=_,++u);let C=p-m===0,V=p===m+c[u]-1,L=C?2:0,Z=V?2:4;for(let G=L;G<Z;++G)On.writeElements(f,e,t),On.writeElements(y,e,t+6),On.writeElements(x,e,t+12),t+=6*3}}};var RBe=new Array(1);$h.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new WO(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let l=this.polylines,u=l.length;for(let m=0;m<u;++m){let p=l[m];p._locatorBuckets=[];let y;if(this.mode===ie.SCENE3D){y=RBe;let x=p._actualPositions.length;if(x>0)y[0]=x;else continue}else y=p._segments.lengths;let f=y.length;if(f>0){let x=0;for(let _=0;_<f;++_){let C=y[_]-1;for(let V=0;V<C;++V)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new WO(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new WO(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};$h.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var dC={positions:void 0,lengths:void 0},Ure=new Array(1),ZBe=new h,GBe=new he;$h.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ie.SCENE3D)return Ure[0]=n.length,dC.positions=n,dC.lengths=Ure,dC;zre(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=ZBe;for(let l=0;l<s;++l)a=n[l],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,GBe)));if(o.length>0){e._boundingVolume2D=ce.fromPoints(o,e._boundingVolume2D);let l=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(l.z,l.x,l.y)}return dC.positions=o,dC.lengths=e._segments.lengths,dC};var kre;$h.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=kre,c=6*s*3;!d(a)||a.length<c?a=kre=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let l=this.getSegments(t,i),u=l.positions,m=l.lengths,p=0,y=0,f=0,x;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?x=u[s-2]:(x=h5,h.subtract(u[0],u[1],x),h.add(u[0],x,x)):x=u[_-1],h.clone(x,uu),h.clone(u[_],as),_===s-1?t._loop?x=u[1]:(x=h5,h.subtract(u[s-1],u[s-2],x),h.add(u[s-1],x,x)):x=u[_+1],h.clone(x,mu);let C=m[y];_===f+C&&(f+=C,++y);let V=_-f===0,L=_===f+m[y]-1;o===ie.SCENE2D&&(uu.z=0,as.z=0,mu.z=0),(o===ie.SCENE2D||o===ie.MORPHING)&&(V||L)&&r-Math.abs(as.x)<1&&((as.x<0&&uu.x>0||as.x>0&&uu.x<0)&&h.clone(as,uu),(as.x<0&&mu.x>0||as.x>0&&mu.x<0)&&h.clone(as,mu));let Z=V?2:0,G=L?2:4;for(let X=Z;X<G;++X)On.writeElements(as,a,p),On.writeElements(uu,a,p+6),On.writeElements(mu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Pm=Wm;function qb(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new od({batchTable:e.batchTable}),this._labelCollection=new qh({batchTable:e.batchTable}),this._polylineCollection=new Pm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(qb.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function EBe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+de.packedLength+re.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,de.pack(n,s,a),a+=de.packedLength,re.pack(t,s,a),s}var XBe=new pi("createVectorTilePoints",5),IBe=new h;function WBe(e,t){let n=e._positions,i=e._packedBuffer;d(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=EBe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=XBe.scheduleTask(r,o);if(d(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,l=e._labelCollection,u=e._polylineCollection;n=e._positions;let m=e._batchIds,p=n.length/3;for(let y=0;y<p;++y){let f=m[y],x=h.unpack(n,y*3,IBe),_=c.add();_.position=x,_._batchIndex=f;let C=l.add();C.text=" ",C.position=x,C._batchIndex=f;let V=u.add();V.positions=[h.clone(x),h.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}qb.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],l=n.get(a),u=i.get(a),m=o.get(a);t[c]=new Dp(e,c,l,u,m)}};qb.prototype.applyDebugSettings=function(e,t){e?(B.clone(t,this._billboardCollection._highlightColor),B.clone(t,this._labelCollection._highlightColor),B.clone(t,this._polylineCollection._highlightColor)):(B.clone(B.WHITE,this._billboardCollection._highlightColor),B.clone(B.WHITE,this._labelCollection._highlightColor),B.clone(B.WHITE,this._polylineCollection._highlightColor))};function PBe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=Dp.defaultPointSize,s.color=Dp.defaultColor,s.pointOutlineColor=Dp.defaultPointOutlineColor,s.pointOutlineWidth=Dp.defaultPointOutlineWidth,s.labelColor=B.WHITE,s.labelOutlineColor=B.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=vo.FILL,s.labelText=void 0,s.backgroundColor=new B(.165,.165,.165,.8),s.backgroundPadding=new D(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=B.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=bi.CENTER,s.verticalOrigin=In.CENTER,s.labelHorizontalOrigin=bi.RIGHT,s.labelVerticalOrigin=In.BASELINE}}var vBe=new B,wBe=new B,FBe=new B,ABe=new B,MBe=new B,NBe=new B,lW=new Pt,dW=new Pt,FO=new Gt;qb.prototype.applyStyle=function(e,t){if(!d(e)){PBe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(d(e.show)&&(s.show=e.show.evaluate(s)),d(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),d(e.color)&&(s.color=e.color.evaluateColor(s,vBe)),d(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,wBe)),d(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),d(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,FBe)),d(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,ABe)),d(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),d(e.font)&&(s.font=e.font.evaluate(s)),d(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),d(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,d(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,MBe)),d(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),d(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),d(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);d(a)?(lW.near=a.x,lW.nearValue=a.y,lW.far=a.z,lW.farValue=a.w,s.scaleByDistance=lW):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(d(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);d(a)?(dW.near=a.x,dW.nearValue=a.y,dW.far=a.z,dW.farValue=a.w,s.translucencyByDistance=dW):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(d(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);d(a)?(FO.near=a.x,FO.far=a.y,s.distanceDisplayCondition=FO):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;d(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),d(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),d(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,NBe)),d(e.image)?s.image=e.image.evaluate(s):s.image=void 0,d(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),d(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),d(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),d(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),d(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};qb.prototype.update=function(e){if(!this._ready){if(d(this._promise)||(this._promise=WBe(this,e.mapProjection.ellipsoid)),d(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};qb.prototype.isDestroyed=function(){return!1};qb.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var uW=qb;var $Zn=T(S(),1);function Op(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=g(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=g(e.center,h.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(Op.prototype,{trianglesLength:{get:function(){return d(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return d(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function UBe(e){let t=new Float64Array(3+h.packedLength+re.packedLength+de.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,de.pack(e._rectangle,t,n),t}function kBe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Wn.unpack(t,n),n+=Wn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=B.unpack(t,n);n+=B.packedLength;let l=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let y=0;y<m;++y)p[y]=t[n++];s[a]=new Dh({color:c,offset:l,count:u,batchIds:p})}}var DBe=new pi("createVectorTilePolygons",5),BBe=new B;function YBe(e){if(d(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!d(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(de.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let y=e._batchTable,f=s.length;for(let x=0;x<f;++x){let _=y.getColor(x,BBe);s[x]=_.toRgba()}a=e._packedBuffer=UBe(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],l={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,m=e._polygonMaximumHeights;d(u)&&d(m)&&(u=u.slice(),m=m.slice(),c.push(u.buffer,m.buffer),l.minimumHeights=u,l.maximumHeights=m);let p=DBe.scheduleTask(l,c);if(d(p))return p.then(y=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(y.packedBuffer),x=f[0];kBe(e,f),e._indices=Ue.getSizeInBytes(x)===2?new Uint16Array(y.indices):new Uint32Array(y.indices),e._indexOffsets=new Uint32Array(y.indexOffsets),e._indexCounts=new Uint32Array(y.indexCounts),e._batchedPositions=new Float32Array(y.positions),e._vertexBatchIds=new Uint16Array(y.batchIds),OBe(e),e._ready=!0}).catch(y=>{e.isDestroyed()||(e._error=y)})}function OBe(e){d(e._primitive)||(e._primitive=new xx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Op.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Op.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Op.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Op.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Op.prototype.update=function(e){if(!this._ready){if(d(this._promise)||(this._promise=YBe(this)),d(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Op.prototype.isDestroyed=function(){return!1};Op.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var mW=Op;var ZGn=T(S(),1);var tGn=T(S(),1),hW=`in vec4 currentPosition;
in vec4 previousPosition;
in vec4 nextPosition;
in vec2 expandAndWidth;
in float a_batchId;

uniform mat4 u_modifiedModelView;

void main()
{
    float expandDir = expandAndWidth.x;
    float width = abs(expandAndWidth.y) + 0.5;
    bool usePrev = expandAndWidth.y < 0.0;

    vec4 p = u_modifiedModelView * currentPosition;
    vec4 prev = u_modifiedModelView * previousPosition;
    vec4 next = u_modifiedModelView * nextPosition;

    float angle;
    vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
    gl_Position = czm_viewportOrthographic * positionWC;
}
`;function vm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=g(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function KBe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+re.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,de.pack(t,a,c),c+=de.packedLength,re.pack(o,a,c),c+=re.packedLength,h.pack(r,a,c),a}var HBe=new pi("createVectorTilePolylines",5),uC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function zBe(e,t){if(d(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;d(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=KBe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},l=HBe.scheduleTask(c,a);if(d(l))return l.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let m=u.indexDatatype;e._indices=m===Ue.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),JBe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function JBe(e,t){if(!d(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let l=mt.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),u=mt.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),m=mt.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),y=mt.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),f=mt.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),x=[{index:uC.previousPosition,vertexBuffer:l,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:uC.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:uC.nextPosition,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:uC.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:uC.a_batchId,vertexBuffer:y,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:x,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var fW=new F,Jre=new h;function QBe(e,t){d(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,fW),F.multiplyByPoint(fW,e._center,Jre),F.setTranslation(fW,Jre,fW),fW},u_highlightColor:function(){return e._highlightColor}})}function jBe(e){if(d(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=De.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var qBe=`uniform vec4 u_highlightColor; 
void main()
{
    out_FragColor = u_highlightColor;
}
`;function $Be(e,t){if(d(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(hW),o=n.getFragmentShaderCallback(!1,void 0,!1)(qBe),r=new Be({defines:["VECTOR_TILE",Mt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[jl,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:uC})}function e3e(e,t){if(!d(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Re.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}vm.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!d(n)||!d(i))return;let r,s,a=n.length,c=0,l=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let m=o[r],p=o[r+1]-m;for(s=0;s<p;++s){let y=(m+s)*3;u[l++]=i[y],u[l++]=i[y+1],u[l++]=i[y+2]}}return u};vm.prototype.getPositions=function(e){return vm.getPolylinePositions(this,e)};vm.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ss(e,r)}};vm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function t3e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=B.WHITE}}var n3e=new B,i3e=B.WHITE,o3e=!0;vm.prototype.applyStyle=function(e,t){if(!d(e)){t3e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=d(e.color)?e.color.evaluateColor(s,n3e):i3e,s.show=d(e.show)?e.show.evaluate(s):o3e}};vm.prototype.update=function(e){let t=e.context;if(!this._ready){if(d(this._promise)||(this._promise=zBe(this,t)),d(this._error)){let i=this._error;throw this._error=void 0,i}return}QBe(this,t),$Be(this,t),jBe(this);let n=e.passes;(n.render||n.pick)&&e3e(this,e)};vm.prototype.isDestroyed=function(){return!1};vm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var Jx=vm;var hEn=T(S(),1);var EGn=T(S(),1),pW=`in vec3 startEllipsoidNormal;
in vec3 endEllipsoidNormal;
in vec4 startPositionAndHeight;
in vec4 endPositionAndHeight;
in vec4 startFaceNormalAndVertexCorner;
in vec4 endFaceNormalAndHalfWidth;
in float a_batchId;

uniform mat4 u_modifiedModelView;
uniform vec2 u_minimumMaximumVectorHeights;

out vec4 v_startPlaneEC;
out vec4 v_endPlaneEC;
out vec4 v_rightPlaneEC;
out float v_halfWidth;
out vec3 v_volumeUpEC;

void main()
{
    // vertex corner IDs
    //          3-----------7
    //         /|   left   /|
    //        / | 1       / |
    //       2-----------6  5  end
    //       | /         | /
    // start |/  right   |/
    //       0-----------4
    //
    float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
    float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top

    vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
    vec3 right = normalize(cross(forward, startEllipsoidNormal));

    vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
    position.xyz += forward * isEnd;

    v_volumeUpEC = czm_normal * normalize(cross(right, forward));

    // Push for volume height
    float offset;
    vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);

    // offset height to create volume
    offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
    offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
    position.xyz += offset * ellipsoidNormal;

    // move from RTC to EC
    position = u_modifiedModelView * position;
    right = czm_normal * right;

    // Push for width in a direction that is in the start or end plane and in a plane with right
    // N = normalEC ("right-facing" direction for push)
    // R = right
    // p = angle between N and R
    // w = distance to push along R if R == N
    // d = distance to push along N
    //
    //   N   R
    //  {  p| }      * cos(p) = dot(N, R) = w / d
    //  d  |  |w    * d = w / dot(N, R)
    //    { | }
    //       o---------- polyline segment ---->
    //
    vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
    scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
    vec3 miterPushNormal = czm_normal * normalize(scratchNormal);

    offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
    offset = offset / dot(miterPushNormal, right);
    position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));

    gl_Position = czm_depthClamp(czm_projection * position);

    position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
    vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
    v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
    v_rightPlaneEC = vec4(right, -dot(right, position.xyz));

    position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
    vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
    v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
    v_halfWidth = endFaceNormalAndHalfWidth.w;
}
`;var IGn=T(S(),1),bW=`in vec4 v_startPlaneEC;
in vec4 v_endPlaneEC;
in vec4 v_rightPlaneEC;
in float v_halfWidth;
in vec3 v_volumeUpEC;

uniform vec4 u_highlightColor;
void main()
{
    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));

    // Discard for sky
    if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }

    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
    eyeCoordinate /= eyeCoordinate.w;

    float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);

    // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
    halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));

    // Check distance of the eye coordinate against the right-facing plane
    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);

    // Check eye coordinate against the mitering planes
    float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
    float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);

    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
        out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
        return;
#else // DEBUG_SHOW_VOLUME
        discard;
#endif // DEBUG_SHOW_VOLUME
    }
    out_FragColor = u_highlightColor;

    czm_writeDepthClamp();
}
`;function Kp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=g(e.ellipsoid,re.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new D(li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight),this._boundingVolume=Wn.fromRectangle(e.rectangle,li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Kp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function r3e(e,t,n){let i=li.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Wn.fromRectangle(c,o,r,n,a)}function s3e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+re.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,de.pack(t,a,c),c+=de.packedLength,re.pack(o,a,c),c+=re.packedLength,h.pack(r,a,c),a}var a3e=new pi("createVectorTileClampedPolylines"),$b={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function c3e(e,t){if(d(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;d(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=s3e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},l=a3e.scheduleTask(c,a);if(d(l))return l.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let m=u.indexDatatype;e._indices=m===Ue.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),l3e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function l3e(e,t){if(!d(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,l=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+l.byteLength,e._trianglesLength=l.length/3,e._geometryByteLength=u;let m=mt.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=mt.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),y=mt.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),f=mt.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),x=mt.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),_=mt.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),C=mt.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW}),V=mt.createIndexBuffer({context:t,typedArray:l,usage:Ne.STATIC_DRAW,indexDatatype:l.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),L=[{index:$b.startEllipsoidNormal,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:$b.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:$b.startPositionAndHeight,vertexBuffer:y,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:$b.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:$b.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:$b.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:$b.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var yW=new F,Qre=new h;function d3e(e,t){d(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,yW),F.multiplyByPoint(yW,e._center,Qre),F.setTranslation(yW,Qre,yW),yW},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function jre(e){return De.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Dn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Dn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})}function u3e(e){d(e._rs)||(e._rs=jre(!1),e._rs3DTiles=jre(!0))}function m3e(e,t){if(d(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(pW),o=n.getFragmentShaderCallback(!1,void 0,!0)(bW),r=new Be({defines:["VECTOR_TILE",Mt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[jl,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:$b})}function h3e(e,t){let n=e._command;if(!d(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Re.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=nt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Kp.prototype.getPositions=function(e){return Jx.getPolylinePositions(this,e)};Kp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ss(e,r)}};Kp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function f3e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=B.WHITE}}var p3e=new B,b3e=B.WHITE,y3e=!0;Kp.prototype.applyStyle=function(e,t){if(!d(e)){f3e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=d(e.color)?e.color.evaluateColor(s,p3e):b3e,s.show=d(e.show)?e.show.evaluate(s):y3e}};function g3e(e){return li.initialize().then(function(){r3e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Kp.prototype.update=function(e){let t=e.context;if(!this._ready){if(d(this._promise)||(this._promise=g3e(this).then(c3e(this,t))),d(this._error)){let i=this._error;throw this._error=void 0,i}return}d3e(this,t),m3e(this,t),u3e(this);let n=e.passes;(n.render||n.pick)&&h3e(this,e)};Kp.prototype.isDestroyed=function(){return!1};Kp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var gW=Kp;var xEn=T(S(),1);var AO=32767,x3e=new he,_3e=new h;function T3e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Kn.zigZagDeltaDecode(s,a,c);let l=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],y=c[u],f=W.lerp(t.west,t.east,m/AO),x=W.lerp(t.south,t.north,p/AO),_=W.lerp(n,i,y/AO),C=he.fromRadians(f,x,_,x3e),V=o.cartographicToCartesian(C,_3e);h.pack(V,l,u*3)}return l}var xW=T3e;function ef(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,R3e(this,i,o)}Object.defineProperties(ef.prototype,{featuresLength:{get:function(){return d(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return d(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return d(this._polygons)&&(e+=this._polygons.trianglesLength),d(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return d(this._polygons)&&(e+=this._polygons.geometryByteLength),d(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return d(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return d(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function S3e(e){return function(t,n){d(e._polygons)&&e._polygons.updateCommands(t,n)}}function C3e(e,t){let n,i,o,r,s=g(e.POLYGONS_LENGTH,0),a=g(e.POLYLINES_LENGTH,0),c=g(e.POINTS_LENGTH,0);if(s>0&&d(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&d(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&d(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let l=d(n)||d(i)||d(o),u=s>0&&!d(n)||a>0&&!d(i)||c>0&&!d(o);if(l&&u)throw new me("If one group of batch ids is defined, then all batch ids must be defined");if(!d(n)&&!d(i)&&!d(o)){let p=0;if(!d(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!d(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!d(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var wm=Uint32Array.BYTES_PER_ELEMENT;function V3e(e){return new Jx(e)}function L3e(e){return new gW(e)}function R3e(e,t,n){n=g(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=wm;let r=o.getUint32(n,!0);if(r!==1)throw new me(`Only Vector tile version 1 is supported.  Version ${r} is not.`);n+=wm;let s=o.getUint32(n,!0);if(n+=wm,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=wm,a===0)throw new me("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=wm;let l=o.getUint32(n,!0);n+=wm;let u=o.getUint32(n,!0);n+=wm;let m=o.getUint32(n,!0);n+=wm;let p=o.getUint32(n,!0);n+=wm;let y=o.getUint32(n,!0);n+=wm;let f=o.getUint32(n,!0);n+=wm;let x=Go(i,n,a);n+=a;let _=new Uint8Array(t,n,c);n+=c;let C,V;l>0&&(C=Go(i,n,l),n+=l,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=g(x.POLYGONS_LENGTH,0),Z=g(x.POLYLINES_LENGTH,0),G=g(x.POINTS_LENGTH,0),X=L+Z+G,P=new gp(e,X,C,V,S3e(e));if(e._batchTable=P,X===0)return;let v=new Zm(x,_),A=v.getGlobalProperty("REGION");if(!d(A))throw new me("Feature table global property: REGION must be defined");let M=de.unpack(A),b=A[4],R=A[5],E=e._tile.computedTransform,I=v.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);d(I)?(I=h.unpack(I),F.multiplyByPoint(E,I,I)):(I=de.center(M),I.height=W.lerp(b,R,.5),I=re.WGS84.cartographicToCartesian(I));let w=C3e(x,_);if(n+=(4-n%4)%4,L>0){v.featuresLength=L;let N=g(v.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),v.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!d(N))throw new me("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let Y=g(v.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),v.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!d(Y))throw new me("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=N.reduce(function(K,j){return K+j*2},0),O=Y.reduce(function(K,j){return K+j},0),U=new Uint32Array(t,n,O);n+=m;let J=new Uint16Array(t,n,k);n+=p;let z,ee;d(x.POLYGON_MINIMUM_HEIGHTS)&&d(x.POLYGON_MAXIMUM_HEIGHTS)&&(z=v.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),ee=v.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new mW({positions:J,counts:N,indexCounts:Y,indices:U,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:z,polygonMaximumHeights:ee,center:I,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,batchIds:w.polygons,modelMatrix:E})}if(Z>0){v.featuresLength=Z;let N=g(v.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),v.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!d(N))throw new me("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let Y=v.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!d(Y)){Y=new Uint16Array(Z);for(let ee=0;ee<Z;++ee)Y[ee]=2}let k=N.reduce(function(ee,K){return ee+K*3},0),O=new Uint16Array(t,n,k);n+=y;let U=e._tileset,J=U.examineVectorLinesFunction;if(d(J)){let ee=xW(new Uint16Array(O),M,b,R,re.WGS84);Z3e(ee,N,w.polylines,P,e.url,J)}let z=V3e;d(U.classificationType)&&(z=L3e),e._polylines=z({positions:O,widths:Y,counts:N,batchIds:w.polylines,minimumHeight:b,maximumHeight:R,center:I,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(G>0){let N=new Uint16Array(t,n,G*3);n+=f,e._points=new uW({positions:N,batchIds:w.points,minimumHeight:b,maximumHeight:R,rectangle:M,batchTable:P})}}function MO(e){let t=e.featuresLength;if(!d(e._features)&&t>0){let n=new Array(t);d(e._polygons)&&e._polygons.createFeatures(e,n),d(e._polylines)&&e._polylines.createFeatures(e,n),d(e._points)&&e._points.createFeatures(e,n),e._features=n}}ef.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ef.prototype.getFeature=function(e){return d(this._features)||MO(this),this._features[e]};ef.prototype.applyDebugSettings=function(e,t){d(this._polygons)&&this._polygons.applyDebugSettings(e,t),d(this._polylines)&&this._polylines.applyDebugSettings(e,t),d(this._points)&&this._points.applyDebugSettings(e,t)};ef.prototype.applyStyle=function(e){d(this._features)||MO(this),d(this._polygons)&&this._polygons.applyStyle(e,this._features),d(this._polylines)&&this._polylines.applyStyle(e,this._features),d(this._points)&&this._points.applyStyle(e,this._features)};ef.prototype.update=function(e,t){let n=!0;d(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),d(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),d(this._points)&&(this._points.update(t),n=n&&this._points.ready),d(this._batchTable)&&n&&(d(this._features)||MO(this),this._batchTable.update(e,t),this._ready=!0)};ef.prototype.getPolylinePositions=function(e){let t=this._polylines;if(d(t))return t.getPositions(e)};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function Z3e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let l=t[c]*3,u=e.slice(a,a+l);a+=l,r(u,n[c],o,i)}}var _W=ef;var qre={b3dm:function(e,t,n,i,o){return Jh.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Jh.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Jh.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return ZE.fromTileType(e,t,n,i,o,qre)},externalTileset:function(e,t,n,i){return JI.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new EE(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new _W(e,t,n,i,o)},subt:function(e,t,n,i,o){return BS.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return BS.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new me("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return Jh.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Jh.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Jh.fromGeoJson(e,t,n,i)}},Qx=qre;var QEn=T(S(),1),G3e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},wo=Object.freeze(G3e);var qEn=T(S(),1),Fm={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Fm.isBinaryFormat=function(e){switch(e){case Fm.BATCHED_3D_MODEL:case Fm.INSTANCED_3D_MODEL:case Fm.COMPOSITE:case Fm.POINT_CLOUD:case Fm.VECTOR:case Fm.GEOMETRY:case Fm.IMPLICIT_SUBTREE:case Fm.VOXEL_BINARY:case Fm.GLTF_BINARY:return!0;default:return!1}};var cs=Object.freeze(Fm);var eXn=T(S(),1),E3e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},hu=Object.freeze(E3e);var nXn=T(S(),1),Zs={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Hp=new Array(Zs.NUMBER_OF_PASSES);Hp[Zs.RENDER]=Object.freeze({pass:Zs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Hp[Zs.PICK]=Object.freeze({pass:Zs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Hp[Zs.SHADOW]=Object.freeze({pass:Zs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Hp[Zs.PRELOAD]=Object.freeze({pass:Zs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Hp[Zs.PRELOAD_FLIGHT]=Object.freeze({pass:Zs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Hp[Zs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Zs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Hp[Zs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Zs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Hp[Zs.MOST_DETAILED_PICK]=Object.freeze({pass:Zs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Zs.getPassOptions=function(e){return Hp[e]};var Xo=Object.freeze(Zs);var rXn=T(S(),1);function zp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(zp.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});zp.prototype.hasProperty=function(e,t){return!1};zp.prototype.getFeature=function(e){};zp.prototype.applyDebugSettings=function(e,t){};zp.prototype.applyStyle=function(e){};zp.prototype.update=function(e,t){};zp.prototype.isDestroyed=function(){return!1};zp.prototype.destroy=function(){return ue(this)};var mC=zp;var bXn=T(S(),1);var lXn=T(S(),1);function Jp(e){e=g(e,g.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Jp.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Jp.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Jp.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Jp.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Jp.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Jp.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var TW=Jp;function NO(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!d(n))return;if(!d(e.schema)){NO._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=g(e.schema.classes,g.EMPTY_OBJECT);if(d(n.class)){let o=i[n.class];return new TW({content:n,class:o})}}NO._oneTimeWarning=It;var jx=NO;var _Xn=T(S(),1);function X3e(e,t){let n=e.metadataExtension;if(!d(n))return;let i=n.groups,o=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var qx=X3e;var IXn=T(S(),1);var VXn=T(S(),1);function Qp(e){e=g(e,g.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qp.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Qp.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Qp.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Qp.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Qp.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var SW=Qp;function UO(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!d(n))return;if(!d(e.schema)){UO._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=g(e.schema.classes,g.EMPTY_OBJECT);if(d(n.class)){let o=i[n.class];return new SW({tile:n,class:o})}}UO._oneTimeWarning=It;var CW=UO;var $Xn=T(S(),1);var MXn=T(S(),1);function I3e(e){let t=new Uint8Array(e),n=ym(t);if(n==="glTF"&&(n="glb"),cs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=W3e(t);if(d(i.root))return{contentType:cs.EXTERNAL_TILESET,jsonPayload:i};if(d(i.asset))return{contentType:cs.GLTF,jsonPayload:i};if(d(i.tileAvailability))return{contentType:cs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(d(i.type))return{contentType:cs.GEOJSON,jsonPayload:i};if(d(i.voxelTable))return{contentType:cs.VOXEL_JSON,jsonPayload:i};throw new me("Invalid tile content.")}function W3e(e){let t;try{t=Go(e)}catch{throw new me("Invalid tile content.")}return t}var tf=I3e;function Am(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=d(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=wa.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Am.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function kO(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function $re(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}Am.prototype.requestInnerContents=function(){if(!P3e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;kO(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=v3e(this,n,t,this._tile._contentState);return w3e(this)};function P3e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];d(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!wa.serverHasOpenSlots(n,t[n]))return!1;return wa.heapHasOpenSlots(e.length)}function v3e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Uo({throttle:!0,throttleByServer:!0,type:Jr.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let l=o.fetchArrayBuffer();if(d(l))return l.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){$re(e,i);return}return kO(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){$re(e,i);return}kO(e,-1),ese(e,t,u)}})}async function w3e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>F3e(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(d),o}async function F3e(e,t,n){if(d(t))try{let i=tf(t);if(i.contentType===cs.EXTERNAL_TILESET)throw new me("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===cs.GEOMETRY||i.contentType===cs.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=Qx[i.contentType];d(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let l=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=jx(o,l));let u=qx(o,l);return d(u)&&(a.group=new px({metadata:u})),a}catch(i){ese(e,n,i)}}function ese(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=d(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Am.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];d(t)&&t.cancel()}};Am.prototype.hasProperty=function(e,t){return!1};Am.prototype.getFeature=function(e){};Am.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Am.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Am.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Am.prototype.isDestroyed=function(){return!1};Am.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var VW=Am;var dWn=T(S(),1);var YIn=T(S(),1);var bIn=T(S(),1),lse=T(rse(),1);var q3e=new h,$3e=new h,ey={};ey.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};ey.computeWindingOrder2D=function(e){return ey.computeArea2D(e)>0?Hr.COUNTER_CLOCKWISE:Hr.CLOCKWISE};ey.triangulate=function(e,t){let n=D.packArray(e);return(0,lse.default)(n,t,2)};var dse=new h,use=new h,mse=new h,sse=new h,ase=new h,cse=new h,jp=new h,hse=new D,fse=new D,pse=new D,fC=new D;ey.computeSubdivision=function(e,t,n,i,o){o=g(o,W.RADIANS_PER_DEGREE);let r=d(i),s=n.slice(0),a,c=t.length,l=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a<c;a++){let L=t[a];if(l[m++]=L.x,l[m++]=L.y,l[m++]=L.z,r){let Z=i[a];u[p++]=Z.x,u[p++]=Z.y}}let y=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=_*_;for(;s.length>0;){let L=s.pop(),Z=s.pop(),G=s.pop(),X=h.fromArray(l,G*3,dse),P=h.fromArray(l,Z*3,use),v=h.fromArray(l,L*3,mse),A,M,b;r&&(A=D.fromArray(u,G*2,hse),M=D.fromArray(u,Z*2,fse),b=D.fromArray(u,L*2,pse));let R=h.multiplyByScalar(h.normalize(X,sse),x,sse),E=h.multiplyByScalar(h.normalize(P,ase),x,ase),I=h.multiplyByScalar(h.normalize(v,cse),x,cse),w=h.magnitudeSquared(h.subtract(R,E,jp)),N=h.magnitudeSquared(h.subtract(E,I,jp)),Y=h.magnitudeSquared(h.subtract(I,R,jp)),k=Math.max(w,N,Y),O,U,J;k>C?w===k?(O=`${Math.min(G,Z)} ${Math.max(G,Z)}`,a=f[O],d(a)||(U=h.add(X,P,jp),h.multiplyByScalar(U,.5,U),l.push(U.x,U.y,U.z),a=l.length/3-1,f[O]=a,r&&(J=D.add(A,M,fC),D.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(G,a,L),s.push(a,Z,L)):N===k?(O=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[O],d(a)||(U=h.add(P,v,jp),h.multiplyByScalar(U,.5,U),l.push(U.x,U.y,U.z),a=l.length/3-1,f[O]=a,r&&(J=D.add(M,b,fC),D.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(Z,a,G),s.push(a,L,G)):Y===k&&(O=`${Math.min(L,G)} ${Math.max(L,G)}`,a=f[O],d(a)||(U=h.add(v,X,jp),h.multiplyByScalar(U,.5,U),l.push(U.x,U.y,U.z),a=l.length/3-1,f[O]=a,r&&(J=D.add(b,A,fC),D.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(L,a,Z),s.push(a,G,Z)):(y.push(G),y.push(Z),y.push(L))}let V={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:l})},indices:y,primitiveType:Fe.TRIANGLES};return r&&(V.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new dt(V)};var eYe=new he,tYe=new he,nYe=new he,KO=new he;ey.computeRhumbLineSubdivision=function(e,t,n,i,o){o=g(o,W.RADIANS_PER_DEGREE);let r=d(i),s=n.slice(0),a,c=t.length,l=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a<c;a++){let G=t[a];if(l[m++]=G.x,l[m++]=G.y,l[m++]=G.z,r){let X=i[a];u[p++]=X.x,u[p++]=X.y}}let y=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=new ha(void 0,void 0,e),V=new ha(void 0,void 0,e),L=new ha(void 0,void 0,e);for(;s.length>0;){let G=s.pop(),X=s.pop(),P=s.pop(),v=h.fromArray(l,P*3,dse),A=h.fromArray(l,X*3,use),M=h.fromArray(l,G*3,mse),b,R,E;r&&(b=D.fromArray(u,P*2,hse),R=D.fromArray(u,X*2,fse),E=D.fromArray(u,G*2,pse));let I=e.cartesianToCartographic(v,eYe),w=e.cartesianToCartographic(A,tYe),N=e.cartesianToCartographic(M,nYe);C.setEndPoints(I,w);let Y=C.surfaceDistance;V.setEndPoints(w,N);let k=V.surfaceDistance;L.setEndPoints(N,I);let O=L.surfaceDistance,U=Math.max(Y,k,O),J,z,ee,K,j;U>_?Y===U?(J=`${Math.min(P,X)} ${Math.max(P,X)}`,a=f[J],d(a)||(z=C.interpolateUsingFraction(.5,KO),ee=(I.height+w.height)*.5,K=h.fromRadians(z.longitude,z.latitude,ee,e,jp),l.push(K.x,K.y,K.z),a=l.length/3-1,f[J]=a,r&&(j=D.add(b,R,fC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(P,a,G),s.push(a,X,G)):k===U?(J=`${Math.min(X,G)} ${Math.max(X,G)}`,a=f[J],d(a)||(z=V.interpolateUsingFraction(.5,KO),ee=(w.height+N.height)*.5,K=h.fromRadians(z.longitude,z.latitude,ee,e,jp),l.push(K.x,K.y,K.z),a=l.length/3-1,f[J]=a,r&&(j=D.add(R,E,fC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(X,a,P),s.push(a,G,P)):O===U&&(J=`${Math.min(G,P)} ${Math.max(G,P)}`,a=f[J],d(a)||(z=L.interpolateUsingFraction(.5,KO),ee=(N.height+I.height)*.5,K=h.fromRadians(z.longitude,z.latitude,ee,e,jp),l.push(K.x,K.y,K.z),a=l.length/3-1,f[J]=a,r&&(j=D.add(E,b,fC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(G,a,X),s.push(a,P,X)):(y.push(P),y.push(X),y.push(G))}let Z={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:l})},indices:y,primitiveType:Fe.TRIANGLES};return r&&(Z.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new dt(Z)};ey.scaleToGeodeticHeight=function(e,t,n,i){n=g(n,re.WGS84);let o=q3e,r=$3e;if(t=g(t,0),i=g(i,!0),d(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var ai=ey;var LIn=T(S(),1);var bse=Math.cos,yse=Math.sin,iYe=Math.sqrt,zO={};zO.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,l=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,m=bse(u),p=yse(u),y=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,x=m*bse(f),_=m*yse(f),C=a.x*x,V=a.y*_,L=iYe(C*x+V*_+y*p);if(r.x=C/L,r.y=V/L,r.z=y/L,n){let Z=e.stNwCorner;d(Z)?(u=Z.latitude-e.stGranYCos*i+o*e.stGranXSin,f=Z.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-l.west)*e.lonScalar,s.y=(u-l.south)*e.latScalar)}};var oYe=new $i,fu=new h,rYe=new he,g5=new h,HO=new Zi;function gse(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,l=n*a,u=Math.sin(t),m=i*u,p=n*u;fu=HO.project(e,fu),fu=h.subtract(fu,g5,fu);let y=$i.fromRotation(t,oYe);fu=$i.multiplyByVector(y,fu,fu),fu=h.add(fu,g5,fu),e=HO.unproject(fu,e),r-=1,s-=1;let f=e.latitude,x=f+r*p,_=f-c*s,C=f-c*s+r*p,V=Math.max(f,x,_,C),L=Math.min(f,x,_,C),Z=e.longitude,G=Z+r*l,X=Z+s*m,P=Z+s*m+r*l,v=Math.max(Z,G,X,P),A=Math.min(Z,G,X,P);return{north:V,south:L,east:v,west:A,granYCos:c,granYSin:m,granXCos:l,granXSin:p,nwCorner:e}}zO.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,l=e.north,u=e.south,m=!1,p=!1;l===W.PI_OVER_TWO&&(m=!0),u===-W.PI_OVER_TWO&&(p=!0);let y,f=l-u;c>a?y=W.TWO_PI-c+a:y=a-c;let x=Math.ceil(y/t)+1,_=Math.ceil(f/t)+1,C=y/(x-1),V=f/(_-1),L=de.northwest(e,r),Z=de.center(e,rYe);(n!==0||i!==0)&&(Z.longitude<L.longitude&&(Z.longitude+=W.TWO_PI),g5=HO.project(Z,g5));let G=V,X=C,P=0,v=0,A=de.clone(e,o),M={granYCos:G,granYSin:P,granXCos:X,granXSin:v,nwCorner:L,boundingRectangle:A,width:x,height:_,northCap:m,southCap:p};if(n!==0){let b=gse(L,n,C,V,Z,x,_);l=b.north,u=b.south,a=b.east,c=b.west,M.granYCos=b.granYCos,M.granYSin=b.granYSin,M.granXCos=b.granXCos,M.granXSin=b.granXSin,A.north=l,A.south=u,A.east=a,A.west=c}if(i!==0){n=n-i;let b=de.northwest(A,s),R=gse(b,n,C,V,Z,x,_);M.stGranYCos=R.granYCos,M.stGranXCos=R.granXCos,M.stGranYSin=R.granYSin,M.stGranXSin=R.granXSin,M.stNwCorner=b,M.stWest=R.west,M.stSouth=R.south}return M};var ls=zO;var sYe=new ce,aYe=new ce,cYe=new h,lYe=new de;function xse(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,l=0,u=4;r&&(c-=1,a-=1,l+=1,u-=2),s&&(c-=1,a-=1,l+=1,u-=2),l+=c*o+2*a-u;let m=new Float64Array(l*3),p=0,y=0,f,x=cYe;if(r)ls.computePosition(t,n,!1,y,0,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;else for(f=0;f<o;f++)ls.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=o-1,y=1;y<i;y++)ls.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;if(y=i-1,!s)for(f=o-2;f>=0;f--)ls.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=0,y=i-2;y>0;y--)ls.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;let _=m.length/3*2,C=Ue.createTypedArray(m.length/3,_),V=0;for(let Z=0;Z<m.length/3-1;Z++)C[V++]=Z,C[V++]=Z+1;C[V++]=m.length/3-1,C[V++]=0;let L=new dt({attributes:new hn,primitiveType:Fe.LINES});return L.attributes.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),L.indices=C,L}function dYe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=i,s=n,a=xse(e,t),c=t.height,l=t.width,u=ai.scaleToGeodeticHeight(a.attributes.position.values,s,o,!1),m=u.length,p=new Float64Array(m*2);p.set(u);let y=ai.scaleToGeodeticHeight(a.attributes.position.values,r,o);p.set(y,m),a.attributes.position.values=p;let f=t.northCap,x=t.southCap,_=4;f&&(_-=1),x&&(_-=1);let C=(p.length/3+_)*2,V=Ue.createTypedArray(p.length/3,C);m=p.length/6;let L=0;for(let G=0;G<m-1;G++)V[L++]=G,V[L++]=G+1,V[L++]=G+m,V[L++]=G+m+1;V[L++]=m-1,V[L++]=0,V[L++]=m+m-1,V[L++]=m,V[L++]=0,V[L++]=m;let Z;if(f)Z=c-1;else{let G=l-1;V[L++]=G,V[L++]=G+m,Z=l+c-2}if(V[L++]=Z,V[L++]=Z+m,!x){let G=l+Z-1;V[L++]=G,V[L]=G+m}return a.indices=V,a}function bC(e){e=g(e,g.EMPTY_OBJECT);let t=e.rectangle,n=g(e.granularity,W.RADIANS_PER_DEGREE),i=g(e.ellipsoid,re.WGS84),o=g(e.rotation,0),r=g(e.height,0),s=g(e.extrudedHeight,r);this._rectangle=de.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}bC.packedLength=de.packedLength+re.packedLength+5;bC.pack=function(e,t,n){return n=g(n,0),de.pack(e._rectangle,t,n),n+=de.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=g(e._offsetAttribute,-1),t};var _se=new de,Tse=re.clone(re.UNIT_SPHERE),pC={rectangle:_se,ellipsoid:Tse,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};bC.unpack=function(e,t,n){t=g(t,0);let i=de.unpack(e,t,_se);t+=de.packedLength;let o=re.unpack(e,t,Tse);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],l=e[t];return d(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=re.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=l===-1?void 0:l,n):(pC.granularity=r,pC.height=s,pC.rotation=a,pC.extrudedHeight=c,pC.offsetAttribute=l===-1?void 0:l,new bC(pC))};var uYe=new he;bC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=ls.computeOptions(t,e._granularity,e._rotation,0,lYe,uYe),o,r;if(W.equalsEpsilon(t.north,t.south,W.EPSILON10)||W.equalsEpsilon(t.east,t.west,W.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!W.equalsEpsilon(s,a,0,W.EPSILON2),l;if(c){if(o=dYe(e,i),d(e._offsetAttribute)){let p=o.attributes.position.values.length/3,y=new Uint8Array(p);e._offsetAttribute===rn.TOP?y=y.fill(1,0,p/2):(l=e._offsetAttribute===rn.NONE?0:1,y=y.fill(l)),o.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}let u=ce.fromRectangle3D(t,n,s,aYe),m=ce.fromRectangle3D(t,n,a,sYe);r=ce.union(u,m)}else{if(o=xse(e,i),o.attributes.position.values=ai.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),d(e._offsetAttribute)){let u=o.attributes.position.values.length;l=e._offsetAttribute===rn.NONE?0:1;let m=new Uint8Array(u/3).fill(l);o.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}r=ce.fromRectangle3D(t,n,s)}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:Fe.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var e_=bC;function gC(e){this.rectangle=de.clone(e.rectangle),this.minimumHeight=g(e.minimumHeight,0),this.maximumHeight=g(e.maximumHeight,0),this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=g(e.ellipsoid,re.WGS84);bYe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,g(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(gC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});gC.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Wn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)};var Sse=new h,x5=new h,Cse=new h,mYe=new h,hYe=new h,fYe=new h,pYe=new h,pu=new he,Vse=new on(h.UNIT_X,0),yC=new Sn;function bYe(e,t,n){n.cartographicToCartesian(de.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(de.northeast(t),e.northeastCornerCartesian),pu.longitude=t.west,pu.latitude=(t.south+t.north)*.5,pu.height=0;let i=n.cartographicToCartesian(pu,fYe),o=h.cross(i,h.UNIT_Z,mYe);h.normalize(o,e.westNormal),pu.longitude=t.east;let r=n.cartographicToCartesian(pu,pYe),s=h.cross(h.UNIT_Z,r,Sse);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,Sse);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,hYe),l=t.south,u;if(l>0){pu.longitude=(t.west+t.east)*.5,pu.latitude=l;let x=n.cartographicToCartesian(pu,yC.origin);h.clone(c,yC.direction);let _=on.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Vse);Si.rayPlane(yC,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,x5)}else u=n.geodeticSurfaceNormalCartographic(de.southeast(t),x5);let m=h.cross(u,a,Cse);h.normalize(m,e.southNormal);let p=t.north,y;if(p<0){pu.longitude=(t.west+t.east)*.5,pu.latitude=p;let x=n.cartographicToCartesian(pu,yC.origin);h.negate(c,yC.direction);let _=on.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Vse);Si.rayPlane(yC,_,e.northeastCornerCartesian),y=n.geodeticSurfaceNormal(x,x5)}else y=n.geodeticSurfaceNormalCartographic(de.northwest(t),x5);let f=h.cross(a,y,Cse);h.normalize(f,e.northNormal)}var yYe=new h,gYe=new h,xYe=new h(0,-1,0),_Ye=new h(0,0,-1),Lse=new h;function TYe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!de.contains(e.rectangle,o)){let l=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,y=e.eastNormal,f=e.northNormal;t.mode!==ie.SCENE3D&&(l=t.mapProjection.project(de.southwest(e.rectangle),yYe),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(de.northeast(e.rectangle),gYe),u.z=u.y,u.y=u.x,u.x=0,m=xYe,y=h.UNIT_Y,p=_Ye,f=h.UNIT_Z);let x=h.subtract(i,l,Lse),_=h.dot(x,m),C=h.dot(x,p),V=h.subtract(i,u,Lse),L=h.dot(V,y),Z=h.dot(V,f);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:Z>0&&(r+=Z*Z)}let s,a,c;if(t.mode===ie.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let l=s-c;r+=l*l}else if(s<a){let l=a-s;r+=l*l}return Math.sqrt(r)}gC.prototype.distanceToCamera=function(e){let t=TYe(this,e);if(e.mode===ie.SCENE3D&&d(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};gC.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};gC.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new e_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new _t({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Ut.fromColor(e)}});return new Zn({geometryInstances:i,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var bu=gC;var R2n=T(S(),1);var c2n=T(S(),1);var bWn=T(S(),1);var GW={},SYe=new h,Rse=new h,Zse=new h,Gse=new h,Ese=new Wn;GW.validOutline=function(e){let n=Wn.fromPoints(e,Ese).halfAxes,i=$.getColumn(n,0,Rse),o=$.getColumn(n,1,Zse),r=$.getColumn(n,2,Gse),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};GW.computeProjectTo2DArguments=function(e,t,n,i){let o=Wn.fromPoints(e,Ese),r=o.halfAxes,s=$.getColumn(r,0,Rse),a=$.getColumn(r,1,Zse),c=$.getColumn(r,2,Gse),l=h.magnitude(s),u=h.magnitude(a),m=h.magnitude(c),p=Math.min(l,u,m);if(l===0&&(u===0||m===0)||u===0&&m===0)return!1;let y,f;return(p===u||p===m)&&(y=s),p===l?y=a:p===m&&(f=a),(p===l||p===u)&&(f=c),h.normalize(y,n),h.normalize(f,i),h.clone(o.center,t),!0};function Xse(e,t,n,i,o){let r=h.subtract(e,t,SYe),s=h.dot(n,r),a=h.dot(i,r);return D.fromElements(s,a,o)}GW.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Xse(i[r],e,t,n);return o}};GW.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Xse(i,e,t,n,o)}};var qp=GW;var OWn=T(S(),1);var gWn=T(S(),1);function ty(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(ty.prototype,{length:{get:function(){return this._length}}});ty.prototype.enqueue=function(e){this._array.push(e),this._length++};ty.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};ty.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ty.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ty.prototype.clear=function(){this._array.length=this._offset=this._length=0};ty.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ny=ty;var Ho={};Ho.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!d(o))continue;n+=2;let r=o.positions,s=o.holes;if(d(r)&&r.length>0&&(n+=r.length*t.packedLength),d(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Ho.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!d(r))continue;let s=r.positions,a=r.holes;if(t[n++]=d(s)?s.length:0,t[n++]=d(a)?a.length:0,d(s)){let c=s.length;for(let l=0;l<c;++l,n+=i.packedLength)i.pack(s[l],t,n)}if(d(a)){let c=a.length;for(let l=0;l<c;++l)o.push(a[l])}}return n};Ho.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=Ho.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var t_=new D;function Pse(e,t,n,i){return D.subtract(t,e,t_),D.multiplyByScalar(t_,n/i,t_),D.add(e,t_,t_),[t_.x,t_.y]}var iy=new h;function CYe(e,t,n,i){return h.subtract(t,e,iy),h.multiplyByScalar(iy,n/i,iy),h.add(e,iy,iy),[iy.x,iy.y,iy.z]}Ho.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(W.log2(o)));return Math.pow(2,r)};var T5=new he,S5=new he,VYe=new he,LYe=new h,_5=new ha;Ho.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,T5),r=e.cartesianToCartographic(n,S5),a=new ha(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(W.log2(a)));return Math.pow(2,c)};Ho.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=Ho.subdivideLineCount(n,i,o),a=D.distance(e,t),c=a/s,l=r;l.length=s*2;let u=0;for(let m=0;m<s;m++){let p=Pse(e,t,m*c,a);l[u++]=p[0],l[u++]=p[1]}return l};Ho.subdivideLine=function(e,t,n,i){let o=Ho.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;d(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let l=0;l<o;l++){let u=CYe(e,t,l*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};Ho.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,T5),c=n.cartesianToCartographic(o,S5);_5.setEndPoints(a,c);let l=_5.surfaceDistance/r,u=Math.max(0,Math.ceil(W.log2(l))),m=Math.pow(2,u),p=D.distance(e,t),y=p/m,f=s;f.length=m*2;let x=0;for(let _=0;_<m;_++){let C=Pse(e,t,_*y,p);f[x++]=C[0],f[x++]=C[1]}return f};Ho.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,T5),s=e.cartesianToCartographic(n,S5),a=new ha(r,s,e),c=a.surfaceDistance/i,l=Math.max(0,Math.ceil(W.log2(c))),u=Math.pow(2,l),m=a.surfaceDistance/u;d(o)||(o=[]);let p=o;p.length=u*3;let y=0;for(let f=0;f<u;f++){let x=a.interpolateUsingSurfaceDistance(f*m,VYe),_=e.cartographicToCartesian(x,LYe);p[y++]=_.x,p[y++]=_.y,p[y++]=_.z}return p};var RYe=new h,ZYe=new h,GYe=new h,EYe=new h;Ho.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=g(i,re.WGS84);let r=RYe,s=ZYe,a=GYe,c=EYe;if(d(e)&&d(e.attributes)&&d(e.attributes.position)){let l=e.attributes.position.values,u=l.length/2;for(let m=0;m<u;m+=3)h.fromArray(l,m,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),l[m+u]=s.x,l[m+1+u]=s.y,l[m+2+u]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),l[m]=s.x,l[m+1]=s.y,l[m+2]=s.z}return e};Ho.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new ny;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),l=c.positions;if(t)for(a=l.length,r=0;r<a;r++)n.scaleToGeodeticSurface(l[r],l[r]);if(l=go(l,h.equalsEpsilon,!0),l.length<3)continue;let u=c.holes?c.holes.length:0;for(r=0;r<u;r++){let m=c.holes[r],p=m.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=go(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let y=0;for(d(m.holes)&&(y=m.holes.length),s=0;s<y;s++)o.enqueue(m.holes[s])}i.push(l)}return i};var XYe=new he;function IYe(e,t,n){let i=n.cartesianToCartographic(e,T5),o=n.cartesianToCartographic(t,S5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;_5.setEndPoints(i,o);let r=_5.findIntersectionWithLatitude(0,XYe);if(!d(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>W.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function WYe(e,t,n,i){if(i===Jt.RHUMB)return IYe(e,t,n);let o=Si.lineSegmentPlane(e,t,on.ORIGIN_XY_PLANE);if(d(o))return n.scaleToGeodeticSurface(o,o)}var PYe=new he;function vYe(e,t,n){let i=[],o,r,s,a,c,l=0;for(;l<e.length;){o=e[l],r=e[(l+1)%e.length],s=W.sign(o.z),a=W.sign(r.z);let u=m=>t.cartesianToCartographic(m,PYe).longitude;if(s===0)i.push({position:l,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=WYe(o,r,t,n),++l,!d(c))continue;e.splice(l,0,c),i.push({position:l,type:s,visited:!1,next:a,theta:u(c)})}++l}return i}function vse(e,t,n,i,o,r,s){let a=[],c=r,l=m=>p=>p.position===m,u=[];do{let m=n[c];a.push(m);let p=i.findIndex(l(c)),y=i[p];if(!d(y)){++c;continue}let{visited:f,type:x,next:_}=y;if(y.visited=!0,x===0){if(_===0){let Z=i[p-(s?1:-1)];if(Z?.position===c+1)Z.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}f||u.push(c);let V=p+(s?1:-1),L=i[V];if(!d(L)){++c;continue}c=L.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let m of u)t=vse(e,++t,n,i,0,m,!s);return t}Ho.splitPolygonsOnEquator=function(e,t,n,i){d(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=vYe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((l,u)=>l.theta-u.theta);let c=s[0].z>=0;o=vse(i,o,s,a,1,0,c)}return i};Ho.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new ny;c.enqueue(e);let l=d(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,y,f;if(i)for(f=m.length,y=0;y<f;y++)o.scaleToGeodeticSurface(m[y],m[y]);if(t||(m=go(m,h.equalsEpsilon,!0)),m.length<3)continue;let x=n(m);if(!d(x))continue;let _=[],C=ai.computeWindingOrder2D(x);if(C===Hr.CLOCKWISE&&(x.reverse(),m=m.slice().reverse()),l){l=!1;let X=[m];if(X=r(X,X),X.length>1){for(let P of X)c.enqueue(new fa(P,p));continue}}let V=m.slice(),L=d(p)?p.length:0,Z=[],G;for(y=0;y<L;y++){let X=p[y],P=X.positions;if(i)for(f=P.length,G=0;G<f;++G)o.scaleToGeodeticSurface(P[G],P[G]);if(t||(P=go(P,h.equalsEpsilon,!0)),P.length<3)continue;let v=n(P);if(!d(v))continue;C=ai.computeWindingOrder2D(v),C===Hr.CLOCKWISE&&(v.reverse(),P=P.slice().reverse()),Z.push(P),_.push(V.length),V=V.concat(P),x=x.concat(v);let A=0;for(d(X.holes)&&(A=X.holes.length),G=0;G<A;G++)c.enqueue(X.holes[G])}s.push({outerRing:m,holes:Z}),a.push({positions:V,positions2D:x,holes:_})}return{hierarchy:s,polygons:a}};var wYe=new D,FYe=new h,AYe=new Ae,MYe=new $;Ho.computeBoundingRectangle=function(e,t,n,i,o){let r=Ae.fromAxisAngle(e,i,AYe),s=$.fromQuaternion(r,MYe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,m=n.length;for(let p=0;p<m;++p){let y=h.clone(n[p],FYe);$.multiplyByVector(s,y,y);let f=t(y,wYe);d(f)&&(a=Math.min(a,f.x),c=Math.max(c,f.x),l=Math.min(l,f.y),u=Math.max(u,f.y))}return o.x=a,o.y=l,o.width=c-a,o.height=u-l,o};Ho.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ai.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,l=d(n),u=l?n.positions:void 0;if(o){let m=c.length,p=new Array(m*3),y=0;for(let _=0;_<m;_++){let C=c[_];p[y++]=C.x,p[y++]=C.y,p[y++]=C.z}let f={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Fe.TRIANGLES};l&&(f.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:D.packArray(u)}));let x=new dt(f);return r.normal?An.computeNormal(x):x}if(s===Jt.GEODESIC)return ai.computeSubdivision(e,c,a,u,i);if(s===Jt.RHUMB)return ai.computeRhumbLineSubdivision(e,c,a,u,i)};var Ise=[],Wse=[],NYe=new h,UYe=new h;Ho.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,l,u,m,p,y,f,x=e.length,_=0,C=0,V=d(t),L=V?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),V&&(f=x*2*2,y=new Array(f*2)),c=0;c<x;c++)l=e[c],u=e[(c+1)%x],s[_]=s[_+a]=l.x,++_,s[_]=s[_+a]=l.y,++_,s[_]=s[_+a]=l.z,++_,s[_]=s[_+a]=u.x,++_,s[_]=s[_+a]=u.y,++_,s[_]=s[_+a]=u.z,++_,V&&(m=L[c],p=L[(c+1)%x],y[C]=y[C+f]=m.x,++C,y[C]=y[C+f]=m.y,++C,y[C]=y[C+f]=p.x,++C,y[C]=y[C+f]=p.y,++C);else{let v=W.chordLength(i,n.maximumRadius),A=0;if(r===Jt.GEODESIC)for(c=0;c<x;c++)A+=Ho.subdivideLineCount(e[c],e[(c+1)%x],v);else if(r===Jt.RHUMB)for(c=0;c<x;c++)A+=Ho.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],v);for(a=(A+x)*3,s=new Array(a*2),V&&(f=(A+x)*2,y=new Array(f*2)),c=0;c<x;c++){l=e[c],u=e[(c+1)%x];let M,b;V&&(m=L[c],p=L[(c+1)%x]),r===Jt.GEODESIC?(M=Ho.subdivideLine(l,u,v,Wse),V&&(b=Ho.subdivideTexcoordLine(m,p,l,u,v,Ise))):r===Jt.RHUMB&&(M=Ho.subdivideRhumbLine(n,l,u,v,Wse),V&&(b=Ho.subdivideTexcoordRhumbLine(m,p,n,l,u,v,Ise)));let R=M.length;for(let E=0;E<R;++E,++_)s[_]=M[E],s[_+a]=M[E];if(s[_]=u.x,s[_+a]=u.x,++_,s[_]=u.y,s[_+a]=u.y,++_,s[_]=u.z,s[_+a]=u.z,++_,V){let E=b.length;for(let I=0;I<E;++I,++C)y[C]=b[I],y[C+f]=b[I];y[C]=p.x,y[C+f]=p.x,++C,y[C]=p.y,y[C+f]=p.y,++C}}}x=s.length;let Z=Ue.createTypedArray(x/3,x-e.length*6),G=0;for(x/=6,c=0;c<x;c++){let v=c,A=v+1,M=v+x,b=M+1;l=h.fromArray(s,v*3,NYe),u=h.fromArray(s,A*3,UYe),!h.equalsEpsilon(l,u,W.EPSILON10,W.EPSILON10)&&(Z[G++]=v,Z[G++]=M,Z[G++]=A,Z[G++]=A,Z[G++]=M,Z[G++]=b)}let X={attributes:new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:Z,primitiveType:Fe.TRIANGLES};return V&&(X.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:y})),new dt(X)};var Bn=Ho;function kYe(e){let t=e.length,n=new Float64Array(t*3),i=Ue.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n})});return new dt({attributes:s,indices:i,primitiveType:Fe.LINES})}function n_(e){e=g(e,g.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Bn.computeHierarchyPackedLength(t,h)+1}n_.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new n_(t)};n_.pack=function(e,t,n){return n=g(n,0),n=Bn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var DYe={polygonHierarchy:{}};n_.unpack=function(e,t,n){t=g(t,0);let i=Bn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return d(n)||(n=new n_(DYe)),n._polygonHierarchy=i,n.packedLength=o,n};n_.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=go(n,h.equalsEpsilon,!0),n.length<3||!qp.validOutline(n))return;let o=Bn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let l=new _t({geometry:kYe(o[c])});r.push(l)}let s=An.combineInstances(r)[0],a=ce.fromPoints(t.positions);return new dt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var yu=n_;var C5=new he;function EW(e){let t=Sp.fromToken(e.token),n=g(e.minimumHeight,0),i=g(e.maximumHeight,0),o=g(e.ellipsoid,re.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=jYe(t,n,i,o);this._boundingPlanes=r;let s=tOe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=nK(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=nK(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=nK(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();C5=o.cartesianToCartographic(c,C5),C5.height=(i+n)/2,this.center=o.cartographicToCartesian(C5,c),this._boundingSphere=ce.fromPoints(s)}var BYe=new h,YYe=new he,OYe=new h,KYe=new he,HYe=new h,zYe=new h,JYe=new h,QYe=new h;function jYe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,BYe),a=i.cartesianToCartographic(r,YYe);a.height=n;let c=i.cartographicToCartesian(a,OYe),l=on.fromPointNormal(c,s);o[0]=l;let u=0,m,p=[],y,f;for(m=0;m<4;m++){y=e.getVertex(m),p[m]=y,f=i.cartesianToCartographic(y,KYe),f.height=t;let _=on.getPointDistance(l,i.cartographicToCartesian(f,HYe));_<u&&(u=_)}let x=on.clone(l);for(x.normal=h.negate(x.normal,x.normal),x.distance=x.distance*-1+u,o[1]=x,m=0;m<4;m++){y=p[m];let _=p[(m+1)%4],C=i.geodeticSurfaceNormal(y,zYe),V=h.subtract(_,y,QYe),L=h.cross(V,C,JYe);L=h.normalize(L,L),o[2+m]=on.fromPointNormal(y,L)}return o}var i_=new h,o_=new h,r_=new h,JO=new h,QO=new h,jO=new h,qYe=new h,$Ye=new h,eOe=new h,qO=new h,$O=new h,eK=new h,oy=new h,nf=new $;function wse(e,t,n){i_=e.normal,o_=t.normal,r_=n.normal,JO=h.multiplyByScalar(e.normal,-e.distance,JO),QO=h.multiplyByScalar(t.normal,-t.distance,QO),jO=h.multiplyByScalar(n.normal,-n.distance,jO),qO=h.multiplyByScalar(h.cross(o_,r_,qYe),h.dot(JO,i_),qO),$O=h.multiplyByScalar(h.cross(r_,i_,$Ye),h.dot(QO,o_),$O),eK=h.multiplyByScalar(h.cross(i_,o_,eOe),h.dot(jO,r_),eK),nf[0]=i_.x,nf[1]=o_.x,nf[2]=r_.x,nf[3]=i_.y,nf[4]=o_.y,nf[5]=r_.y,nf[6]=i_.z,nf[7]=o_.z,nf[8]=r_.z;let i=$.determinant(nf);return oy=h.add(qO,$O,oy),oy=h.add(oy,eK,oy),new h(oy.x/i,oy.y/i,oy.z/i)}function tOe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=wse(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=wse(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var tK=new h,xC=new h;function nK(e,t){let n=[];for(let i=0;i<4;i++)tK=h.subtract(t[(i+1)%4],t[i],tK),xC=h.cross(e.normal,tK,xC),xC=h.normalize(xC,xC),n[i]=h.clone(xC);return n}Object.defineProperties(EW.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var iK=new h;EW.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;on.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):on.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,on.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=oK(on.projectPointOntoPlane(c,t,iK),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Fse(t,p[0],p[1]),h.distance(a,t)}let u=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=oK(on.projectPointOntoPlane(c,t,iK),i[r],c,this._edgeNormals[n[r]]),m=h.distanceSquared(a,t),m<u&&(u=m);return Math.sqrt(u)}else if(n.length>3)return a=oK(on.projectPointOntoPlane(this._boundingPlanes[1],t,iK),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let l=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+l)%4]):h.distance(t,this._vertices[4+(n[1]-2+l)%4])};var nOe=new h,iOe=new h;function Fse(e,t,n){let i=h.subtract(n,t,nOe),o=h.subtract(e,t,iOe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var oOe=new on(h.UNIT_X,0);function oK(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let l=on.fromPointNormal(t[c],i[c],oOe);on.getPointDistance(l,e)<0||(a=Fse(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return d(s)?s:e}EW.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?qt.INSIDE:n===this._vertices.length?qt.OUTSIDE:qt.INTERSECTING};EW.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new yu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=yu.createGeometry(n),o=new _t({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Ut.fromColor(e)}}),r=new yu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=yu.createGeometry(r),a=new _t({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Ut.fromColor(e)}}),c=[];for(let l=0;l<4;l++){let u=new yu({polygonHierarchy:{positions:this._planeVertices[2+l]}}),m=yu.createGeometry(u);c[l]=new _t({geometry:m,id:"outline",modelMatrix:t,attributes:{color:Ut.fromColor(e)}})}return new Zn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var XW=EW;var oPn=T(S(),1);var H2n=T(S(),1);var k2n=T(S(),1);var rOe=new h(1,1,1),V5=Math.cos,L5=Math.sin;function _C(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.radii,rOe),n=g(e.innerRadii,t),i=g(e.minimumClock,0),o=g(e.maximumClock,W.TWO_PI),r=g(e.minimumCone,0),s=g(e.maximumCone,W.PI),a=Math.round(g(e.stackPartitions,10)),c=Math.round(g(e.slicePartitions,8)),l=Math.round(g(e.subdivisions,128));this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=l,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}_C.packedLength=2*h.packedLength+8;_C.pack=function(e,t,n){return n=g(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=g(e._offsetAttribute,-1),t};var Ase=new h,Mse=new h,$p={radii:Ase,innerRadii:Mse,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};_C.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Ase);t+=h.packedLength;let o=h.unpack(e,t,Mse);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t++],p=e[t];return d(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=l,n._slicePartitions=u,n._subdivisions=m,n._offsetAttribute=p===-1?void 0:p,n):($p.minimumClock=r,$p.maximumClock=s,$p.minimumCone=a,$p.maximumCone=c,$p.stackPartitions=l,$p.slicePartitions=u,$p.subdivisions=m,$p.offsetAttribute=p===-1?void 0:p,new _C($p))};_C.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=re.fromCartesian3(t),l=e._slicePartitions+1,u=e._stackPartitions+1;l=Math.round(l*Math.abs(o-i)/W.TWO_PI),u=Math.round(u*Math.abs(s-r)/W.PI),l<2&&(l=2),u<2&&(u=2);let m=0,p=1,y=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,x=!1;y&&(p=2,r>0&&(f=!0,m+=l),s<Math.PI&&(x=!0,m+=l));let _=a*p*(u+l),C=new Float64Array(_*3),V=2*(_+m-(l+u)*p),L=Ue.createTypedArray(_,V),Z,G,X,P,v=0,A=new Array(u),M=new Array(u);for(Z=0;Z<u;Z++)P=r+Z*(s-r)/(u-1),A[Z]=L5(P),M[Z]=V5(P);let b=new Array(a),R=new Array(a);for(Z=0;Z<a;Z++)X=i+Z*(o-i)/(a-1),b[Z]=L5(X),R[Z]=V5(X);for(Z=0;Z<u;Z++)for(G=0;G<a;G++)C[v++]=t.x*A[Z]*R[G],C[v++]=t.y*A[Z]*b[G],C[v++]=t.z*M[Z];if(y)for(Z=0;Z<u;Z++)for(G=0;G<a;G++)C[v++]=n.x*A[Z]*R[G],C[v++]=n.y*A[Z]*b[G],C[v++]=n.z*M[Z];for(A.length=a,M.length=a,Z=0;Z<a;Z++)P=r+Z*(s-r)/(a-1),A[Z]=L5(P),M[Z]=V5(P);for(b.length=l,R.length=l,Z=0;Z<l;Z++)X=i+Z*(o-i)/(l-1),b[Z]=L5(X),R[Z]=V5(X);for(Z=0;Z<a;Z++)for(G=0;G<l;G++)C[v++]=t.x*A[Z]*R[G],C[v++]=t.y*A[Z]*b[G],C[v++]=t.z*M[Z];if(y)for(Z=0;Z<a;Z++)for(G=0;G<l;G++)C[v++]=n.x*A[Z]*R[G],C[v++]=n.y*A[Z]*b[G],C[v++]=n.z*M[Z];for(v=0,Z=0;Z<u*p;Z++){let w=Z*a;for(G=0;G<a-1;G++)L[v++]=w+G,L[v++]=w+G+1}let E=u*a*p;for(Z=0;Z<l;Z++)for(G=0;G<a-1;G++)L[v++]=E+Z+G*l,L[v++]=E+Z+(G+1)*l;if(y)for(E=u*a*p+l*a,Z=0;Z<l;Z++)for(G=0;G<a-1;G++)L[v++]=E+Z+G*l,L[v++]=E+Z+(G+1)*l;if(y){let w=u*a*p,N=w+a*l;if(f)for(Z=0;Z<l;Z++)L[v++]=w+Z,L[v++]=N+Z;if(x)for(w+=a*l-l,N+=a*l-l,Z=0;Z<l;Z++)L[v++]=w+Z,L[v++]=N+Z}let I=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C})});if(d(e._offsetAttribute)){let w=C.length,N=e._offsetAttribute===rn.NONE?0:1,Y=new Uint8Array(w/3).fill(N);I.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}return new dt({attributes:I,indices:L,primitiveType:Fe.LINES,boundingSphere:ce.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var sd=_C;function TC(e){let t=g(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new sd(i),this._workerName="createSphereOutlineGeometry"}TC.packedLength=sd.packedLength;TC.pack=function(e,t,n){return sd.pack(e._ellipsoidGeometry,t,n)};var sOe=new sd,s_={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};TC.unpack=function(e,t,n){let i=sd.unpack(e,t,sOe);return s_.stackPartitions=i._stackPartitions,s_.slicePartitions=i._slicePartitions,s_.subdivisions=i._subdivisions,d(n)?(h.clone(i._radii,s_.radii),n._ellipsoidGeometry=new sd(s_),n):(s_.radius=i._radii.x,new TC(s_))};TC.createGeometry=function(e){return sd.createGeometry(e._ellipsoidGeometry)};var e0=TC;function SC(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new ce(e,t)}Object.defineProperties(SC.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});SC.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};SC.prototype.intersectPlane=function(e){return ce.intersectPlane(this._boundingSphere,e)};SC.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};SC.prototype.createDebugVolume=function(e){let t=new e0({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new _t({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ut.fromColor(e)}});return new Zn({geometryInstances:i,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var t0=SC;var yPn=T(S(),1);var aOe=new h,cOe=new h,lOe=new h,dOe=new h;function a_(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function rK(e,t){let n=h.normalize(e,dOe),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return a_(e,i,t)}function Nse(e){let t=$.getColumn(e,0,aOe),n=$.getColumn(e,1,cOe),i=$.getColumn(e,2,lOe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=W.EPSILON7,e[4]=W.EPSILON7,e[8]=W.EPSILON7,e):(o&&!r&&!s?t=a_(n,i,t):!o&&r&&!s?n=a_(t,i,n):!o&&!r&&s?i=a_(n,t,i):o?r?s||(t=rK(i,t),n=a_(i,t,n)):(t=rK(n,t),i=a_(n,t,i)):(n=rK(t,n),i=a_(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function CC(e,t){t=Nse(t),this._orientedBoundingBox=new Wn(e,t),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(CC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});CC.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};CC.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};CC.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Nse(t),$.clone(t,this._orientedBoundingBox.halfAxes),ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};CC.prototype.createDebugVolume=function(e){let t=new sm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new _t({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ut.fromColor(e)}});return new Zn({geometryInstances:i,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})};var gu=CC;function zo(e,t,n,i){this._tileset=e,this._header=n;let o=d(n.contents),r=o&&n.contents.length>1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=d(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=d(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),l=d(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(l,this.transform,new F),this.computedTransform=c,this.metadata=CW(e,n),this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;d(s)&&d(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let m;d(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,d(this._geometricError)||(this._geometricError=d(i)?i._geometricError:e._geometricError,zo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;d(n.refine)?((n.refine==="replace"||n.refine==="add")&&zo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Wo.REPLACE:Wo.ADD):d(i)?p=i.refine:p=Wo.REPLACE,this.refine=p,this.children=[],this.parent=i;let y,f=!1,x,_,C;if(t=Ee.createIfNeeded(t),r)x=wo.UNLOADED,_=t.clone();else if(d(s)){let G=s.uri;d(s.url)&&(zo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?(zo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),y=new mC(e,this),f=!0,x=wo.READY):(x=wo.UNLOADED,_=t.getDerivedResource({url:G}),C=wa.getServerKey(_.getUrlComponent()))}else y=new mC(e,this),f=!0,x=wo.READY;this._content=y,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,Z;d(V)&&(L=V.duration,d(V.date)&&(Z=te.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=Z,this.lastStyleTime=0,this._optimChildrenWithinParent=hu.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=B.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new te,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}zo._deprecationWarning=zr;Object.defineProperties(zo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return g(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return d(this._color)||(this._color=new B),B.clone(this._color)},set:function(e){this._color=B.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||d(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===wo.READY}},contentUnloaded:{get:function(){return this._contentState===wo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===wo.EXPIRED}},contentFailed:{get:function(){return this._contentState===wo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ry=new h;function uOe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,ry),c=h.add(s.positionWC,a,ry),l=h.subtract(c,r,ry);if(h.magnitude(l)>o){let Z=h.normalize(l,ry),G=h.multiplyByScalar(Z,o,ry),X=h.add(r,G,ry),P=h.subtract(X,s.positionWC,ry),v=h.normalize(P,ry);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,v))}else e._foveatedFactor=0;let p=e.refine===Wo.REPLACE,y=n.isSkippingLevelOfDetail;if(p&&!y||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&y||n._pass===Xo.PRELOAD_FLIGHT||n._pass===Xo.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*f;if(e._foveatedFactor<=x)return!1;let _=f-x,C=W.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&d(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var Dse=new te;zo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=g(n,1),r=d(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,l=a.frustum,u=c.drawingBufferWidth,m=c.drawingBufferHeight*o,p;if(e.mode===ie.SCENE2D||l instanceof en){let y=l.offCenterFrustum;d(y)&&(l=y);let f=Math.max(l.top-l.bottom,l.right-l.left)/Math.max(u,m);p=s/f}else{let y=Math.max(this._distanceToCamera,W.EPSILON7),f=l.sseDenominator;if(p=s*m/(y*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(y,x)*_;p-=C}}return p/=e.pixelRatio,p};function mOe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=d(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function hOe(e,t){let n=t.parent,o=d(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}zo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=d(t)?t.computedTransform:n.modelMatrix,o=d(t)?t._visibilityPlaneMask:Qr.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==Qr.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=hOe(n,this),this._priorityProgressiveResolution=mOe(n,this),this.priorityDeferred=uOe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};zo.prototype.updateExpiration=function(){if(d(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=te.now(Dse);te.lessThan(this.expireDate,e)&&(this._contentState=wo.EXPIRED,this._expiredContent=this._content)}};function fOe(e){if(!d(e.expireDuration))return;let t=te.now(Dse);te.addSeconds(t,e.expireDuration,t),d(e.expireDate)?te.lessThan(e.expireDate,t)&&te.clone(t,e.expireDate):e.expireDate=te.clone(t)}function pOe(e){return function(){return e._priority}}zo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?bOe(this):gOe(this)};function bOe(e){let t=e._content,n=e._tileset;if(!d(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new VW(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(d(i))return e._contentState=wo.LOADING,i.then(o=>{if(!e.isDestroyed()&&d(o))return e._contentState=wo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=wo.FAILED,o})}async function yOe(e,t,n,i,o){let r=e._contentState;e._contentState=wo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=wo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await xOe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=wo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=wo.FAILED,a}}function gOe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Uo({throttle:!0,throttleByServer:!0,type:Jr.TILES3D,priorityFunction:pOe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!d(r)){++o.statistics.numberOfAttemptedRequests;return}return yOe(e,o,i,n,r)}async function xOe(e,t){let n=tf(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===cs.GEOMETRY||n.contentType===cs.VECTOR,(n.contentType===cs.IMPLICIT_SUBTREE||n.contentType===cs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===cs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=Qx[n.contentType];if(e.isDestroyed())return;d(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,l=e.implicitCoordinates;o.metadata=c.getContentMetadataView(l,0)}else e.hasImplicitContent||(o.metadata=jx(i,s));let a=qx(i,s);return d(a)&&(o.group=new px({metadata:a})),o}zo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};zo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=wo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Bse=new ce;function aK(e,t){if(t.mode!==ie.SCENE3D&&!d(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,Bse);e._boundingVolume2D=new t0(i.center,i.radius)}return t.mode!==ie.SCENE3D?e._boundingVolume2D:e._boundingVolume}function _Oe(e,t){if(t.mode!==ie.SCENE3D&&!d(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,Bse);e._contentBoundingVolume2D=new t0(i.center,i.radius)}return t.mode!==ie.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}zo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=aK(this,e),o=this._tileset,r=o.clippingPlanes;if(d(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==qt.INSIDE,s===qt.OUTSIDE)return Qr.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};zo.prototype.contentVisibility=function(e){if(!d(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===Qr.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=_Oe(this,e),i=this._tileset,o=i.clippingPlanes;if(d(o)&&o.enabled){let r=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=r!==qt.INSIDE,r===qt.OUTSIDE)return qt.OUTSIDE}return t.computeVisibility(n)};zo.prototype.distanceToTile=function(e){return aK(this,e).distanceToCamera(e)};var TOe=new h;zo.prototype.distanceToTileCenter=function(e){let n=aK(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,TOe);return h.dot(e.camera.directionWC,i)};zo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!d(t)||t.distanceToCamera(e)===0};var Yse=new $,Ose=new h,SOe=new $,Kse=new h,Hse=new de,COe=new Wn,sK=new F;function VOe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Kse),o=$.fromArray(e,3,SOe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,Yse);return o=$.multiply(r,o,o),d(n)?(n.update(i,o),n):new gu(i,o)}function LOe(e,t,n,i){let o=de.unpack(e,0,Hse),r=e[4],s=e[5],a=Wn.fromRectangle(o,r,s,re.WGS84,COe),c=a.center,l=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,sK),sK),c=F.multiplyByPoint(t,c,c);let u=F.getMatrix3(t,Yse);return l=$.multiply(u,l,l),d(i)&&i instanceof gu?(i.update(c,l),i):new gu(c,l)}function ROe(e,t,n,i){if(!F.equalsEpsilon(t,n,W.EPSILON8))return LOe(e,t,n,i);if(d(i))return i;let o=de.unpack(e,0,Hse);return new bu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function ZOe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Kse),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,Ose),s=h.maximumComponent(r);return o*=s,d(n)?(n.update(i,o),n):new t0(i,o)}zo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(d(i)&&(o=Px.parseBoundingVolumeSemantic("TILE",i)),d(o)&&(e=o),!d(e))throw new me("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new XW(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(d(r))return VOe(r,t,n);if(d(s))return ROe(s,t,this._initialTransform,n);if(d(a))return ZOe(a,t,n);throw new me("boundingVolume must contain a sphere, region, or box")};zo.prototype.updateTransform=function(e){e=g(e,F.IDENTITY);let t=F.multiplyTransformation(e,this.transform,sK);if(!!F.equals(t,this.computedTransform))return;F.clone(t,this.computedTransform);let i=this._header,o=this._contentHeader;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),d(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._contentBoundingVolume)),d(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};zo.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,Ose),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!d(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function GOe(e,t,n,i){if(!i.isRender)return;let o=d(e._contentHeader)&&d(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=B.WHITE:c=B.DARKGRAY:c=B.YELLOW,d(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let l=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");l.color=Ut.toValue(c,l.color)}else!r&&d(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(d(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(B.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&d(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&d(e._viewerRequestVolume)?(d(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(B.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&d(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||d(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=B.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function EOe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&d(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(d(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=wo.FAILED,o}}function XOe(e,t){let n=t.clippingPlanes,i=0;d(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}zo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;XOe(this,e),GOe(this,e,t,n),EOe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Re.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var Use=[];zo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(fOe(this),this._selectedFrame=0,this.lastStyleTime=0,te.now(this._loadTimestamp),this._contentState=wo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Use;try{this._content.update(e,t)}catch(i){throw this._contentState=wo.FAILED,i}Use.length=0,t.commandList=n};function kse(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function R5(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}zo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,l=o,u=c+l,m=r,p=Math.pow(10,u),y=u+m,f=r,x=Math.pow(10,y),_=y+f,C=Math.pow(10,_),V=R5(this._depth,n.depth,i.depth);V=t?1-V:V;let Z=!e.isSkippingLevelOfDetail&&this.refine===Wo.REPLACE?R5(this._priorityHolder._distanceToCamera,n.distance,i.distance):R5(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),G=kse(Z,a,s),X=this._priorityProgressiveResolution?0:p,P=R5(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),v=kse(P,l,c),A=this.priorityDeferred?x:0,M=e._pass===Xo.PRELOAD_FLIGHT?0:C;this._priority=V+G+X+v+A+M};zo.prototype.isDestroyed=function(){return!1};zo.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var xu=zo;var Rvn=T(S(),1);var pvn=T(S(),1);function n0(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=d(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(n0.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});n0.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};n0.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};n0.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};n0.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};n0.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};n0.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};n0.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var VC=n0;var _vn=T(S(),1);function i0(e){e=g(e,g.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=d(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(i0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});i0.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};i0.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};i0.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};i0.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};i0.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};i0.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};i0.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var IW=i0;function zse(e){e=g(e,g.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=g(t.metadata,t.tileset),o;d(i)&&(o=new IW({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let l=0;l<c;l++){let u=a[l];s.push(new VC({group:u,class:n.classes[u.class]}))}}else if(d(a)){r=Object.keys(a).sort();let c=r.length;for(let l=0;l<c;l++){let u=r[l];if(a.hasOwnProperty(u)){let m=a[u];s.push(new VC({id:u,group:a[u],class:n.classes[m.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(zse.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var c_=zse;var Wvn=T(S(),1);var Jse={},IOe=new h;Jse.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof gu||i instanceof bu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=hu.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof gu||a instanceof bu)){e._optimChildrenWithinParent=hu.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,l=h.subtract(c.center,o.center,IOe),u=h.magnitude(l);h.divideByScalar(l,u,l);let m=Math.abs(o.halfAxes[0]*l.x)+Math.abs(o.halfAxes[1]*l.y)+Math.abs(o.halfAxes[2]*l.z)+Math.abs(o.halfAxes[3]*l.x)+Math.abs(o.halfAxes[4]*l.y)+Math.abs(o.halfAxes[5]*l.z)+Math.abs(o.halfAxes[6]*l.x)+Math.abs(o.halfAxes[7]*l.y)+Math.abs(o.halfAxes[8]*l.z),p=Math.abs(c.halfAxes[0]*l.x)+Math.abs(c.halfAxes[1]*l.y)+Math.abs(c.halfAxes[2]*l.z)+Math.abs(c.halfAxes[3]*l.x)+Math.abs(c.halfAxes[4]*l.y)+Math.abs(c.halfAxes[5]*l.z)+Math.abs(c.halfAxes[6]*l.x)+Math.abs(c.halfAxes[7]*l.y)+Math.abs(c.halfAxes[8]*l.z);if(m<=p+u){e._optimChildrenWithinParent=hu.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===hu.USE_OPTIMIZATION};var WW=Jse;var Nvn=T(S(),1);var wvn=T(S(),1);function PW(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(PW.prototype,{length:{get:function(){return this._length}}});function WOe(e,t,n){this.item=e,this.previous=t,this.next=n}PW.prototype.add=function(e){let t=new WOe(e,this.tail,void 0);return d(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Qse(e,t){d(t.previous)&&d(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):d(t.previous)?(t.previous.next=void 0,e.tail=t.previous):d(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}PW.prototype.remove=function(e){d(e)&&(Qse(this,e),--this._length)};PW.prototype.splice=function(e,t){if(e===t)return;Qse(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var vW=PW;function l_(){this._list=new vW,this._sentinel=this._list.add(),this._trimTiles=!1}l_.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};l_.prototype.touch=function(e){let t=e.cacheNode;d(t)&&this._list.splice(this._sentinel,t)};l_.prototype.add=function(e){d(e.cacheNode)||(e.cacheNode=this._list.add(e))};l_.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;d(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};l_.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};l_.prototype.trim=function(){this._trimTiles=!0};var wW=l_;var Ovn=T(S(),1);function Z5(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function lK(e,t){let n;return t==="_loadTimestamp"?n=te.toDate(e).getTime():n=e,n}Z5.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=lK(e,n),this._referenceMaximum[n]=lK(t,n)};function POe(e,t){let n=e.tilePropertyName;if(d(n)){let i=lK(t[n],n);return d(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var cK=[new B(.1,.1,.1,1),new B(.153,.278,.878,1),new B(.827,.231,.49,1),new B(.827,.188,.22,1),new B(1,.592,.259,1),new B(1,.843,0,1)];Z5.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!d(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=POe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,l=cK.length-1,u=c*l,m=Math.floor(u),p=Math.ceil(u),y=u-m,f=cK[m],x=cK[p],_=B.clone(B.WHITE);_.red=W.lerp(f.red,x.red,y),_.green=W.lerp(f.green,x.green,y),_.blue=W.lerp(f.blue,x.blue,y),e._debugColor=_};Z5.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(d(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=d(t)&&d(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var FW=Z5;var zvn=T(S(),1);function LC(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}LC.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function G5(e,t,n,i){let o=t.innerContents,r=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,l=t.texturesByteLength,u=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-r:r,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-l:l,e.batchTableByteLength+=n?-u:u):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-r:r,e.numberOfTrianglesSelected+=n?-s:s),d(o)){let m=o.length;for(let p=0;p<m;++p)G5(e,o[p],n,i)}}LC.prototype.incrementSelectionCounts=function(e){G5(this,e,!1,!1)};LC.prototype.incrementLoadCounts=function(e){G5(this,e,!1,!0)};LC.prototype.decrementLoadCounts=function(e){G5(this,e,!0,!0)};LC.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var o0=LC;var jvn=T(S(),1);function AW(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(AW.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});AW.prototype.makeDirty=function(){this._styleDirty=!0};AW.prototype.resetDirty=function(){this._styleDirty=!1};AW.prototype.applyStyle=function(e){if(!d(e.root)||d(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var MW=AW;var rwn=T(S(),1);function vOe(e,t,n){let i=ri(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!d(o.box)&&!d(o.region)&&!ri(o,"3DTILES_bounding_volume_S2")&&!ri(o,"3DTILES_bounding_volume_cylinder"))throw new me("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Ee({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=wOe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Oe(a,!0));let c=new Ee({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=FOe(t),this.subdivisionScheme=Mr[i.subdivisionScheme],this.branchingFactor=Mr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,d(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function wOe(e){if(ri(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return d(t.contents)?t.contents:t.content}return d(e.contents)?e.contents:d(e.content)?[e.content]:[]}function FOe(e){let t=Oe(e,!0);return d(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var d_=vOe;var hwn=T(S(),1);var cwn=T(S(),1);var NW={};function jse(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function dK(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function qse(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function uK(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}NW.encode2D=function(e,t){return(jse(e)|jse(t)<<1)>>>0};NW.decode2D=function(e,t){return d(t)||(t=new Array(2)),t[0]=qse(e),t[1]=qse(e>>1),t};NW.encode3D=function(e,t,n){return dK(e)|dK(t)<<1|dK(n)<<2};NW.decode3D=function(e,t){return d(t)||(t=new Array(3)),t[0]=uK(e),t[1]=uK(e>>1),t[2]=uK(e>>2),t};var sy=NW;function Fo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Mr.OCTREE&&(this.z=e.z)}Object.defineProperties(Fo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Mr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Mr.OCTREE?sy.encode3D(this.x,this.y,this.z):sy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Mr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Fo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Mr.OCTREE){let o=(this.z<<e.level)+e.z;return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Fo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===Mr.OCTREE){let r=Math.floor(this.z/t);return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Fo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Mr.OCTREE){let r=e.z%n;return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Fo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Mr.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Fo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Fo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Fo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===Mr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Fo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Mr.OCTREE?this.z===e.z:!0)};Fo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Fo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Fo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Fo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Mr.OCTREE&&(e.z=this.z),e};var $se=[0,0,0];Fo.fromMortonIndex=function(e,t,n,i){let o;return e===Mr.OCTREE?(o=sy.decode3D(i,$se),new Fo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=sy.decode2D(i,$se),new Fo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Fo.fromTileIndex=function(e,t,n){let i,o,r;return e===Mr.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Fo.fromMortonIndex(e,t,i,r)};var u_=Fo;var Rwn=T(S(),1);var _wn=T(S(),1);function r0(){}r0.selectTiles=function(e,t){fe.throwInstantiationError()};r0.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};r0.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};r0.selectTile=function(e,t){if(e.contentVisibility(t)===qt.OUTSIDE)return;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&i._selectedTilesToStyle.push(e),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};r0.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};r0.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};r0.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!AOe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function AOe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}r0.updateTile=function(e,t){eae(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,UOe(e),e._shouldSelect=!1,e._finalResolution=!0};function eae(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];eae(r,t),e._visible=r._visible;return}if(MOe(e,t)){e._visible=!1;return}let i=e.refine===Wo.REPLACE,o=e._optimChildrenWithinParent===hu.USE_OPTIMIZATION;if(i&&o&&n&&!NOe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function MOe(e,t){let{parent:n,tileset:i}=e;return!d(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Wo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function NOe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function UOe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Gs=r0;function tae(){}var UW={stack:new Ic,stackMaximumLength:0};tae.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Gs,s=UW.stack;for(s.push(i);s.length>0;){UW.stackMaximumLength=Math.max(UW.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Wo.ADD,l=a.refine===Wo.REPLACE,u=kOe(a);u&&DOe(a,s,t),(c||l&&!u)&&(BOe(e,a),o(a,t),YOe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return UW.stack.trim(UW.stackMaximumLength),n};function kOe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function DOe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function BOe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function YOe(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var kW=tae;var Wwn=T(S(),1);function nae(){}var DW={stack:new Ic,stackMaximumLength:0},BW={stack:new Ic,stackMaximumLength:0};nae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;KOe(n,t),DW.stack.trim(DW.stackMaximumLength),BW.stack.trim(BW.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function mK(e,t){e.contentAvailable&&Gs.selectTile(e,t)}function OOe(e,t,n){let i=e.refine===Wo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Gs;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Gs.sortChildrenByDistanceToCamera);let l=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,y=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let x=r[f];if(x.isVisible?(t.push(x),x._foveatedFactor<y&&(p=f,y=x._foveatedFactor),m=!0):(l||o.loadSiblings)&&(x._foveatedFactor<y&&(p=f,y=x._foveatedFactor),a(x,n),c(x,n)),l){let _;x._inRequestVolume?x.hasRenderableContent?_=x.contentAvailable:_=HOe(x,n):_=!1,u=u&&_}}if(m||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&y<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(f._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(f._distanceToCamera,x._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=x}return u}function KOe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Gs,a=DW.stack;for(a.push(e);a.length>0;){DW.stackMaximumLength=Math.max(DW.stackMaximumLength,a.length);let c=a.pop(),l=c.parent,u=!d(l)||l._refines;c._refines=i(c)?OOe(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===Wo.ADD?(mK(c,t),o(c,t)):c.refine===Wo.REPLACE&&(o(c,t),m&&mK(c,t)):(n._emptyTiles.push(c),o(c,t),m&&mK(c,t)),r(c,t),s(c,t)}}function HOe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Gs,s=!0,a=BW.stack;for(a.push(e);a.length>0;){BW.stackMaximumLength=Math.max(BW.stackMaximumLength,a.length);let c=a.pop(),l=c.children,u=l.length,m=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!m&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),m)for(let y=0;y<u;++y){let f=l[y];a.push(f)}}return s}var YW=nae;var Mwn=T(S(),1);function iae(){}var OW={stack:new Ic,stackMaximumLength:0},KW={stack:new Ic,stackMaximumLength:0},s0={stack:new Ic,stackMaximumLength:0,ancestorStack:new Ic,ancestorStackMaximumLength:0},zOe=2;iae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;eKe(n,t),tKe(n,t),OW.stack.trim(OW.stackMaximumLength),KW.stack.trim(KW.stackMaximumLength),s0.stack.trim(s0.stackMaximumLength),s0.ancestorStack.trim(s0.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function JOe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Gs,r=KW.stack;for(r.push(e);r.length>0;){KW.stackMaximumLength=Math.max(KW.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let l=a[c];l.isVisible&&(l.contentAvailable?(n(l,t),i(l,t),o(l,t)):l._depth-e._depth<zOe&&r.push(l))}}}function E5(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;d(n)?n._shouldSelect=!0:JOe(e,t)}function QOe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!d(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function jOe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||d(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function qOe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Gs;for(let l=0;l<o.length;++l)r(o[l],n);o.sort(Gs.sortChildrenByDistanceToCamera);let c=!1;for(let l=0;l<o.length;++l){let u=o[l];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function $Oe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:d(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function eKe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Gs,c=OW.stack;for(c.push(e);c.length>0;){OW.stackMaximumLength=Math.max(OW.stackMaximumLength,c.length);let l=c.pop();QOe(l,t);let u=l.parent,m=!d(u)||u._refines;l._refines=o(l)?qOe(l,c,t)&&m:!1;let p=!l._refines&&m;l.hasRenderableContent?l.refine===Wo.ADD?(E5(l,t),r(l,t)):l.refine===Wo.REPLACE&&($Oe(l,i)?(r(l,t),p&&E5(l,t)):p?(E5(l,t),r(l,t)):jOe(n,l)&&r(l,t)):(n._emptyTiles.push(l),r(l,t),p&&E5(l,t)),s(l,t),a(l,t)}}function tKe(e,t){let{selectTile:n,canTraverse:i}=Gs,{stack:o,ancestorStack:r}=s0,s;for(o.push(e);o.length>0||r.length>0;){if(s0.stackMaximumLength=Math.max(s0.stackMaximumLength,o.length),s0.ancestorStackMaximumLength=Math.max(s0.ancestorStackMaximumLength,r.length),r.length>0){let l=r.peek();if(l._stackLength===o.length){r.pop(),l!==s&&(l._finalResolution=!1),n(l,t);continue}}let a=o.pop();if(!d(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Wo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let l=a.children;for(let u=0;u<l.length;++u){let m=l[u];m.isVisible&&o.push(m)}}}}var HW=iae;function Cr(e){e=g(e,g.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new wW,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=g(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=g(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Ic,this._maximumScreenSpaceError=g(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=g(e.cacheBytes,512*1024*1024);let t=g(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new MW,this._styleApplied=!1,this._modelMatrix=d(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._statistics=new o0,this._statisticsLast=new o0,this._statisticsPerPass=new Array(Xo.NUMBER_OF_PASSES);for(let o=0;o<Xo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new o0;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new FW(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=g(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=g(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=W.clamp(g(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=g(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=g(e.ellipsoid,re.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=g(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=g(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=g(e.preloadWhenHidden,!1),this.preloadFlightDestinations=g(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=g(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=g(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=g(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=g(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=g(e.foveatedInterpolationCallback,W.lerp),this.foveatedTimeDelay=g(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=g(e.shadows,xn.ENABLED),this.show=g(e.show,!0),this.colorBlendMode=fl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Kh(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Wp,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye,this.tileLoad=new ye,this.tileUnload=new ye,this.tileFailed=new ye,this.tileVisible=new ye,this.skipLevelOfDetail=g(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=g(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=g(e.skipScreenSpaceErrorFactor,16),this.skipLevels=g(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=g(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=g(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,d(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new fx,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=g(e.backFaceCulling,!0),this._enableShowOutline=g(e.enableShowOutline,!0),this.showOutline=g(e.showOutline,!0),this.outlineColor=g(e.outlineColor,B.BLACK),this.splitDirection=g(e.splitDirection,vc.NONE),this._projectTo2D=g(e.projectTo2D,!1),this.debugFreezeFrame=g(e.debugFreezeFrame,!1),this.debugColorizeTiles=g(e.debugColorizeTiles,!1),this._enableDebugWireframe=g(e.enableDebugWireframe,!1),this.debugWireframe=g(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&It("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=g(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=g(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=g(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=g(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=g(e.debugShowMemoryUsage,!1),this.debugShowUrl=g(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=g(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=g(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(Cr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return zr("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!d(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(d(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(d(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return d(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,uae(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});Cr.fromIonAssetId=async function(e,t){let n=await $l.fromAssetId(e);return Cr.fromUrl(n,t)};Cr.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await Cr.loadJson(n),r=await nKe(n,o),s=new Cr(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,uae(s);let c=d(o.asset.gltfUpAxis)?Zo.fromName(o.asset.gltfUpAxis):Zo.Y,l=g(t.modelUpAxis,c),u=g(t.modelForwardAxis,Zo.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=l,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,y=s._ellipsoid.cartesianToCartographic(p);return d(y)&&y.height>li._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=vt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};Cr.loadJson=function(e){return Ee.createIfNeeded(e).fetchJson()};Cr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};Cr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!d(i))throw new me("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new me("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");d(t.extensionsRequired)&&Cr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;d(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=oae(this,e,t.root,n);d(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Wo.ADD;let l=c._header.children;if(d(l))for(let u=0;u<l.length;++u){let m=l[u],p=oae(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&WW.checkChildrenWithinParent(c)}return s};function oae(e,t,n,i){if(!(d(n.implicitTiling)||ri(n,"3DTILES_implicit_tiling")))return new xu(e,t,n,i);let r=e.schema,s=new d_(t,n,r),a=new u_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=Oe(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new xu(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function nKe(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(d(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Bi.getSchemaLoader({resource:e});else if(d(n.schema))i=Bi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new c_({schema:i.schema,metadataJson:n});return Bi.unload(i),o}var rae=new h,iKe=new he,oKe=new F,rKe=new h,sKe=new h,aKe=new h;function cKe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,l=c.contentBoundingVolume;if(l instanceof bu)n=h.normalize(a.positionWC,rae),i=a.directionWC,o=a.positionCartographic.height,r=l.minimumHeight,s=l.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,oKe),_=t.mapProjection.ellipsoid,C=l.boundingVolume,V=F.multiplyByPoint(x,C.center,rKe);if(h.magnitude(V)>_.minimumRadius){let L=he.fromCartesian(V,_,iKe);n=h.normalize(a.positionWC,rae),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=F.multiplyByPoint(x,a.positionWC,sKe);if(n=h.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,aKe),i=h.normalize(i,i),o=L.z,l instanceof gu){let Z=c._header.boundingVolume.box[11];r=V.z-Z,s=V.z+Z}else if(l instanceof t0){let Z=C.radius;r=V.z-Z,s=V.z+Z}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,y=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-y),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function lKe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();d(o)&&(o.then(r=>{!d(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{cae(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?xKe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function aae(e,t){return e._priority-t._priority}Cr.prototype.postPassesUpdate=function(e){d(this._root)&&(dKe(this,e),TKe(this,e),this._cache.unloadTiles(this,dae),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};Cr.prototype.prePassesUpdate=function(e){if(!d(this._root))return;hKe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,d(t)&&t.enabled&&t.update(e),d(this._loadTimestamp)||(this._loadTimestamp=te.clone(e.time)),this._timeSinceLoad=Math.max(te.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&cKe(this,e),e.newFrame&&this._cache.reset()};function dKe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==wo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function uKe(e){let t=e._requestedTiles;t.sort(aae);for(let n=0;n<t.length;++n)lKe(e,t[n])}function cae(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=d(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`))}function mKe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==wo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}function hKe(e,t){mKe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let l=n[c];try{l.process(e,t),l.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(l))}catch(u){--r.numberOfTilesProcessing,cae(u,e,l)}}e.totalMemoryUsageInBytes<i?pKe(e):a&&n.length>0&&fKe(e)}function fKe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(aae)}function pKe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var X5=new h,bKe={maximumFractionDigits:3};function sae(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,bKe):Math.round(t).toLocaleString()}function hK(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,X5);if(d(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(d(n)){let r=h.normalize(i,X5);r=h.multiplyByScalar(r,.75*n,X5),o=h.add(r,i,X5)}return o}function fK(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
Triangles: ${e.content.trianglesLength}`,o++),i+=`
Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
Texture Memory: ${sae(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${sae(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
- ${s[a]}`;o+=s.length}else i+=`
Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function yKe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(d(e.debugPickedTile)){let s=d(e.debugPickPosition)?e.debugPickPosition:hK(e.debugPickedTile),a=fK(e.debugPickedTile,e,s);a.pixelOffset=new D(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];fK(a,e,hK(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&fK(a,e,hK(a))}}e._tileDebugLabels.update(t)}function gKe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(d(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:Re.CESIUM_3D_TILE,renderState:De.fromCache({stencilMask:Ft.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:l}=e,u=n.isRender,m=i.length;for(let f=0;f<s.length;++f){let x=s[f];u&&l.raiseEvent(x),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let y=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,x=f.length;i.length+=x;for(let _=y-1;_>=0;--_)i[m+x+_]=i[m+_];for(let _=0;_<x;++_)i[m+_]=f[_]}y=i.length-r,c.numberOfCommands=y,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&y>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(d(e._tileDebugLabels)||(e._tileDebugLabels=new qh),yKe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var lae=[];function xKe(e,t){let n=t,i=lae;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(_Ke(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function dae(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function _Ke(e,t){e._cache.unloadTile(e,t,dae),t.destroy()}Cr.prototype.trimLoadedTiles=function(){this._cache.trim()};function TKe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;o0.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function SKe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function CKe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&d(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function VKe(e,t,n,i){if(t.mode===ie.MORPHING||!d(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,SKe(e),CKe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&uKe(e),gKe(e,t,i),o0.clone(o,n),i.isRender){let s=e._credits;if(d(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function uae(e){let t=e._credits;d(t)||(t=[]),t.length=0,d(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(St.clone(i))});let n=e.asset.extras;if(d(n)&&d(n.cesium)&&d(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new St(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}Cr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Xo.MOST_DETAILED_PRELOAD||t===Xo.MOST_DETAILED_PICK?kW:this.isSkippingLevelOfDetail?HW:YW};Cr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};Cr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Xo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Xo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Xo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Xo.getPassOptions(n),a=s.ignoreCommands,c=g(t.commandList,i),l=c.length;e.commandList=c,e.camera=g(t.camera,o),e.cullingVolume=g(t.cullingVolume,r);let u=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=VKe(this,e,u,s)),a&&(c.length=l),e.commandList=i,e.camera=o,e.cullingVolume=r};Cr.prototype.hasExtension=function(e){return d(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};Cr.prototype.isDestroyed=function(){return!1};Cr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),d(this._root)){let e=lae;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};Cr.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};Cr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!Cr.supportedExtensions[e[t]])throw new me(`Unsupported 3D Tiles Extension: ${e[t]}`)};var zs=Cr;var LKe=new F;function ay(e,t){t.collectionChanged.addEventListener(ay.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Tt,this._onCollectionChanged(t,t.values,[],[])}ay.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,l=n[s.id],u=s.isShowing&&s.isAvailable(e)&&H.getValueOrDefault(a._show,e,!0),m;u&&(m=s.computeModelMatrix(e,LKe),c=Ee.createIfNeeded(H.getValueOrUndefined(a._uri,e)));let p=d(l)?l.tilesetPrimitive:void 0;if(!u){d(p)&&(p.show=!1);continue}(!d(l)||c.url!==l.url)&&(d(p)&&i.removeAndDestroy(p),delete n[s.id],RKe(c,n,s,i)),d(p)&&(p.show=!0,d(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=H.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ay.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)pK(this,e[i],t,n);return ue(this)};ay.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!d(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return d(i)?i.show?(ce.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};ay.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],d(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],d(r._tileset)?s.set(r.id,r):(pK(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],pK(this,r,a,c),s.remove(r.id)};function pK(e,t,n,i){let o=n[t.id];d(o)&&(d(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function RKe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await zs.fromUrl(e);if(o.id=n,i.add(o),!d(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var zW=ay;var cAn=T(S(),1);var ZKe=B.WHITE,GKe=B.BLACK,EKe=new D(2,2);function RC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(RC.prototype,{isConstant:{get:function(){return H.isConstant(this._evenColor)&&H.isConstant(this._oddColor)&&H.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});RC.prototype.getType=function(e){return"Checkerboard"};RC.prototype.getValue=function(e,t){return d(t)||(t={}),t.lightColor=H.getValueOrClonedDefault(this._evenColor,e,ZKe,t.lightColor),t.darkColor=H.getValueOrClonedDefault(this._oddColor,e,GKe,t.darkColor),t.repeat=H.getValueOrDefault(this._repeat,e,EKe),t};RC.prototype.equals=function(e){return this===e||e instanceof RC&&H.equals(this._evenColor,e._evenColor)&&H.equals(this._oddColor,e._oddColor)&&H.equals(this._repeat,e._repeat)};var ZC=RC;var RAn=T(S(),1);var xAn=T(S(),1);var mae={id:void 0};function JW(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function ja(e){this._owner=e,this._entities=new Tt,this._addedEntities=new Tt,this._removedEntities=new Tt,this._changedEntities=new Tt,this._suspendCount=0,this._collectionChanged=new ye,this._id=Yn(),this._show=!0,this._firing=!1,this._refire=!1}ja.prototype.suspendEvents=function(){this._suspendCount++};ja.prototype.resumeEvents=function(){this._suspendCount--,JW(this)};Object.defineProperties(ja.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});ja.prototype.computeAvailability=function(){let e=Ye.MAXIMUM_VALUE,t=Ye.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(d(s)){let a=s.start,c=s.stop;te.lessThan(a,e)&&!a.equals(Ye.MINIMUM_VALUE)&&(e=a),te.greaterThan(c,t)&&!c.equals(Ye.MAXIMUM_VALUE)&&(t=c)}}return Ye.MAXIMUM_VALUE.equals(e)&&(e=Ye.MINIMUM_VALUE),Ye.MINIMUM_VALUE.equals(t)&&(t=Ye.MAXIMUM_VALUE),new Tn({start:e,stop:t})};ja.prototype.add=function(e){e instanceof Oo||(e=new Oo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new me(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(ja.prototype._onEntityDefinitionChanged,this),JW(this),e};ja.prototype.remove=function(e){return d(e)?this.removeById(e.id):!1};ja.prototype.contains=function(e){return this._entities.get(e.id)===e};ja.prototype.removeById=function(e){if(!d(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(ja.prototype._onEntityDefinitionChanged,this),JW(this),!0):!1};ja.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);d(c)||(s.definitionChanged.removeEventListener(ja.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),JW(this)};ja.prototype.getById=function(e){return this._entities.get(e)};ja.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return d(t)||(mae.id=e,t=new Oo(mae),this.add(t)),t};ja.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),JW(this)};var Es=ja;var I5={id:void 0},GC=new Array(2);function bK(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function hae(e,t,n,i){GC[0]=n,GC[1]=i.id,t[JSON.stringify(GC)]=i.definitionChanged.addEventListener(Vr.prototype._onDefinitionChanged,e)}function fae(e,t,n,i){GC[0]=n,GC[1]=i.id;let o=JSON.stringify(GC);t[o](),t[o]=void 0}function cy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,l,u=e._composite,m=new Es(e),p=e._eventHash,y;for(r=0;r<o;r++)for(l=i[r],l.collectionChanged.removeEventListener(Vr.prototype._onCollectionChanged,e),a=l.values,y=l.id,c=a.length-1;c>-1;c--)s=a[c],fae(e,p,y,s);for(r=n-1;r>=0;r--)for(l=t[r],l.collectionChanged.addEventListener(Vr.prototype._onCollectionChanged,e),a=l.values,y=l.id,c=a.length-1;c>-1;c--){s=a[c],hae(e,p,y,s);let x=m.getById(s.id);d(x)||(x=u.getById(s.id),d(x)?bK(x):(I5.id=s.id,x=new Oo(I5)),m.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=m.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Vr(e,t){this._owner=t,this._composite=new Es(this),this._suspendCount=0,this._collections=d(e)?e.slice():[],this._collectionsCopy=[],this._id=Yn(),this._eventHash={},cy(this),this._shouldRecomposite=!1}Object.defineProperties(Vr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Vr.prototype.addCollection=function(e,t){d(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),cy(this)};Vr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),cy(this),!0):!1};Vr.prototype.removeAllCollections=function(){this._collections.length=0,cy(this)};Vr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Vr.prototype.contains=function(e){return this._composite.contains(e)};Vr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Vr.prototype.getCollection=function(e){return this._collections[e]};Vr.prototype.getCollectionsLength=function(){return this._collections.length};function W5(e,t){return e.indexOf(t)}function pae(e,t,n){let i=e._collections;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,cy(e)}Vr.prototype.raiseCollection=function(e){let t=W5(this._collections,e);pae(this,t,t+1)};Vr.prototype.lowerCollection=function(e){let t=W5(this._collections,e);pae(this,t,t-1)};Vr.prototype.raiseCollectionToTop=function(e){let t=W5(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),cy(this))};Vr.prototype.lowerCollectionToBottom=function(e){let t=W5(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),cy(this))};Vr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Vr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(cy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Vr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Vr.prototype.getById=function(e){return this._composite.getById(e)};Vr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,l,u=n.length,m=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];fae(this,m,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),d(c)&&(d(l)||(l=r.getById(x),bK(l)),l.merge(c));d(l)||r.removeById(x),l=void 0}let y=t.length;for(s=0;s<y;s++){let f=t[s];hae(this,m,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),d(c)&&(d(l)||(l=r.getById(x),d(l)?bK(l):(I5.id=x,l=new Oo(I5),r.add(l))),l.merge(c));l=void 0}r.resumeEvents()};Vr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),l=c[t],u=!d(l),m=!0;for(let p=s-1;p>=0;p--){let y=o[p].getById(e.id);if(d(y)){let f=y[t];if(d(f)){if(m)if(m=!1,d(f.merge)&&d(f.clone))l=f.clone(l);else{l=f;break}l.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=l};var yK=Vr;var qAn=T(S(),1);var KAn=T(S(),1);var GAn=T(S(),1);function gK(){this._removalFunctions=[]}gK.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};gK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Lr=gK;var NAn=T(S(),1);function TK(e,t){return te.compare(e.start,t.start)}function Rr(e){if(this._intervals=[],this._changedEvent=new ye,d(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Rr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Rr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Rr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Tn.equals(n[r],i[r],t))return!1;return!0};Rr.prototype.get=function(e){return this._intervals[e]};Rr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Rr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Rr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Rr.prototype.contains=function(e){return this.indexOf(e)>=0};var xK=new Tn;Rr.prototype.indexOf=function(e){let t=this._intervals;xK.start=e,xK.stop=e;let n=Lo(t,xK,TK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Tn.contains(t[n-1],e)?n-1:~n)};Rr.prototype.findInterval=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!d(t)||c.start.equals(t))&&(!d(n)||c.stop.equals(n))&&(!d(i)||c.isStartIncluded===i)&&(!d(o)||c.isStopIncluded===o))return r[s]}};Rr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||te.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Lo(n,e,TK);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=te.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((d(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(te.greaterThan(e.stop,n[i-1].stop)?e=new Tn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Tn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=te.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Tn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Tn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=te.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(d(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Tn({start:e.start,stop:te.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:te.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Tn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Rr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Lo(t,e,TK);n<0&&(n=~n);let i=!1;for(n>0&&(te.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(te.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Tn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Tn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Tn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&te.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Tn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Tn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(te.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Tn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Rr.prototype.intersect=function(e,t,n){let i=new Rr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],l=a[r];if(te.lessThan(c.stop,l.start))++o;else if(te.lessThan(l.stop,c.start))++r;else{if(d(n)||d(t)&&t(c.data,l.data)||!d(t)&&l.data===c.data){let u=Tn.intersect(c,l,new Tn,n);u.isEmpty||i.addInterval(u,t)}te.lessThan(c.stop,l.stop)||c.stop.equals(l.stop)&&!c.isStopIncluded&&l.isStopIncluded?++o:++r}}return i};Rr.fromJulianDateArray=function(e,t){d(t)||(t=new Rr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=g(e.isStartIncluded,!0),s=g(e.isStopIncluded,!0),a=g(e.leadingInterval,!1),c=g(e.trailingInterval,!1),l,u=0;a&&(++u,l=new Tn({start:Ye.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),l.data=d(o)?o(l,t.length):t.length,t.addInterval(l));for(let m=0;m<i-1;++m){let p=n[m],y=n[m+1];l=new Tn({start:p,stop:y,isStartIncluded:t.length===u?r:!0,isStopIncluded:m===i-2?s:!1}),l.data=d(o)?o(l,t.length):t.length,t.addInterval(l),p=y}return c&&(l=new Tn({start:n[i-1],stop:Ye.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),l.data=d(o)?o(l,t.length):t.length,t.addInterval(l)),t};var qa=new Jf,QW=[0,31,28,31,30,31,30,31,31,30,31,30,31];function _K(e,t,n){d(n)||(n=new te),te.toGregorianDate(e,qa);let i=qa.millisecond+t.millisecond,o=qa.second+t.second,r=qa.minute+t.minute,s=qa.hour+t.hour,a=qa.day+t.day,c=qa.month+t.month,l=qa.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),QW[2]=Qf(l)?29:28;a>QW[c]||c>=13;)a>QW[c]&&(a-=QW[c],++c),c>=13&&(--c,l+=Math.floor(c/12),c=c%12,++c),QW[2]=Qf(l)?29:28;return qa.millisecond=i,qa.second=o,qa.minute=r,qa.hour=s,qa.day=a,qa.month=c,qa.year=l,te.fromGregorianDate(qa,n)}var XKe=new te,IKe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function bae(e,t){if(!d(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(IKe);if(!d(n))return!1;if(d(n[1])&&(t.year=Number(n[1].replace(",","."))),d(n[2])&&(t.month=Number(n[2].replace(",","."))),d(n[3])&&(t.day=Number(n[3].replace(",","."))*7),d(n[4])&&(t.day+=Number(n[4].replace(",","."))),d(n[5])&&(t.hour=Number(n[5].replace(",","."))),d(n[6])&&(t.minute=Number(n[6].replace(",","."))),d(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),te.toGregorianDate(te.fromIso8601(e,XKe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var jW=new Jf;Rr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=te.fromIso8601(n[0]),o=te.fromIso8601(n[1]),r=[];if(!bae(n[2],jW))r.push(i,o);else{let s=te.clone(i);for(r.push(s);te.compare(s,o)<0;)s=_K(s,jW),te.compare(o,s)<=0&&te.clone(o,s),r.push(s)}return Rr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Rr.fromIso8601DateArray=function(e,t){return Rr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return te.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Rr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=g(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let l=0;l<c;++l)(bae(i[l],jW)||l===0)&&(o&&d(a)?s=_K(a,jW):s=_K(n,jW),r.push(s),a=s);return Rr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Zr=Rr;function WKe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);d(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function m_(){this._eventHelper=new Lr,this._definitionChanged=new ye,this._intervals=new Zr,this._intervals.changedEvent.addEventListener(m_.prototype._intervalsChanged,this)}Object.defineProperties(m_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});m_.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(d(n))return n.getValue(e,t)};m_.prototype.equals=function(e){return this===e||e instanceof m_&&this._intervals.equals(e._intervals,H.equals)};m_.prototype._intervalsChanged=function(){WKe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var $a=m_;function ly(){this._definitionChanged=new ye,this._composite=new $a,this._composite.definitionChanged.addEventListener(ly.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ly.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});ly.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(d(t))return t.getType(e)};ly.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(d(n))return n.getValue(e,t)};ly.prototype.equals=function(e){return this===e||e instanceof ly&&this._composite.equals(e._composite,H.equals)};ly.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var EC=ly;var s9n=T(S(),1);function dy(e){this._referenceFrame=g(e,io.FIXED),this._definitionChanged=new ye,this._composite=new $a,this._composite.definitionChanged.addEventListener(dy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(dy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});dy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,io.FIXED,t)};dy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(d(i))return i.getValueInReferenceFrame(e,t,n)};dy.prototype.equals=function(e){return this===e||e instanceof dy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,H.equals)};dy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Js=dy;var n5n=T(S(),1);var tMn=T(S(),1);var c9n=T(S(),1),PKe={ROUNDED:0,MITERED:1,BEVELED:2},Ii=Object.freeze(PKe);var P9n=T(S(),1);var C9n=T(S(),1);var Qs=[new h,new h],vKe=new h,wKe=new h,FKe=new h,AKe=new h,MKe=new h,NKe=new h,UKe=new h,kKe=new h,DKe=new h,XC=new h,P5=new h,qW={},SK=new he;function BKe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];SK=t.cartesianToCartographic(o,SK),n[i]=SK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function CK(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),l;if(t===n){for(l=0;l<a;l++)c[l]=t;return c.push(n),c}let m=(n-t)/a;for(l=1;l<a;l++){let p=t+l*m;c[l]=p}return c[0]=t,c.push(n),c}var v5=new h,w5=new h;function YKe(e,t,n,i){let o=new xr(n,i),r=o.projectPointOntoPlane(h.add(n,e,v5),v5),s=o.projectPointOntoPlane(h.add(n,t,w5),w5),a=D.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var OKe=new h(-1,0,0),h_=new F,KKe=new F,VK=new $,HKe=$.IDENTITY.clone(),zKe=new h,JKe=new se,yae=new h;function a0(e,t,n,i,o,r,s,a){let c=zKe,l=JKe;h_=vt.eastNorthUpToFixedFrame(e,o,h_),c=F.multiplyByPointAsVector(h_,OKe,c),c=h.normalize(c,c);let u=YKe(c,t,e,o);VK=$.fromRotationZ(u,VK),yae.z=r,h_=F.multiplyTransformation(h_,F.fromRotationTranslation(VK,yae,KKe),h_);let m=HKe;m[0]=s;for(let p=0;p<a;p++)for(let y=0;y<n.length;y+=3)l=h.fromArray(n,y,l),l=$.multiplyByVector(m,l,l),l=F.multiplyByPoint(h_,l,l),i.push(l.x,l.y,l.z);return i}var QKe=new h;function LK(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,QKe);i=a0(c,t,n,i,o,r[a/3],s,1)}return i}function jKe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let l=a.x-r,u=a.y-s;i[o++]=l,i[o++]=0,i[o++]=u,i[o++]=l,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function gae(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var xae=new Ae,_ae=new h,Tae=new $;function Sae(e,t,n,i,o,r,s,a,c,l){let u=h.angleBetween(h.subtract(t,e,XC),h.subtract(n,e,P5)),m=i===Ii.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=$.fromQuaternion(Ae.fromAxisAngle(h.negate(e,XC),u/(m+1),xae),Tae):p=$.fromQuaternion(Ae.fromAxisAngle(e,u/(m+1),xae),Tae);let y,f;if(t=h.clone(t,_ae),m>0){let x=l?2:1;for(let _=0;_<m;_++)t=$.multiplyByVector(p,t,t),y=h.subtract(t,e,XC),y=h.normalize(y,y),o||(y=h.negate(y,y)),f=r.scaleToGeodeticSurface(t,P5),s=a0(f,y,a,s,r,c,1,x)}else y=h.subtract(t,e,XC),y=h.normalize(y,y),o||(y=h.negate(y,y)),f=r.scaleToGeodeticSurface(t,P5),s=a0(f,y,a,s,r,c,1,1),n=h.clone(n,_ae),y=h.subtract(n,e,XC),y=h.normalize(y,y),o||(y=h.negate(y,y)),f=r.scaleToGeodeticSurface(n,P5),s=a0(f,y,a,s,r,c,1,1);return s}qW.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];D.equals(r,s)||n.push(s)}return n};qW.angleIsGreaterThanPi=function(e,t,n,i){let o=new xr(n,i),r=o.projectPointOntoPlane(h.add(n,e,v5),v5),s=o.projectPointOntoPlane(h.add(n,t,w5),w5);return s.x*r.y-s.y*r.x>=0};var qKe=new h,$Ke=new h;qW.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=BKe(e,r),a=i._granularity,c=i._cornerType,l=o?jKe(t,n):gae(t,n),u=o?gae(t,n):void 0,m=n.height/2,p=n.width/2,y=e.length,f=[],x=o?[]:void 0,_=vKe,C=wKe,V=FKe,L=AKe,Z=MKe,G=NKe,X=UKe,P=kKe,v=DKe,A=e[0],M=e[1];L=r.geodeticSurfaceNormal(A,L),_=h.subtract(M,A,_),_=h.normalize(_,_),P=h.cross(L,_,P),P=h.normalize(P,P);let b=s[0],R=s[1];o&&(x=a0(A,P,u,x,r,b+m,1,1)),v=h.clone(A,v),A=M,C=h.negate(_,C);let E,I;for(let Y=1;Y<y-1;Y++){let k=o?2:1;if(M=e[Y+1],A.equals(M)){It("Positions are too close and are considered equivalent with rounding error.");continue}_=h.subtract(M,A,_),_=h.normalize(_,_),V=h.add(_,C,V),V=h.normalize(V,V),L=r.geodeticSurfaceNormal(A,L);let O=h.multiplyByScalar(L,h.dot(_,L),qKe);h.subtract(_,O,O),h.normalize(O,O);let U=h.multiplyByScalar(L,h.dot(C,L),$Ke);if(h.subtract(C,U,U),h.normalize(U,U),!W.equalsEpsilon(Math.abs(h.dot(O,U)),1,W.EPSILON7)){V=h.cross(V,L,V),V=h.cross(L,V,V),V=h.normalize(V,V);let z=1/Math.max(.25,h.magnitude(h.cross(V,C,XC))),ee=qW.angleIsGreaterThanPi(_,C,A,r);ee?(Z=h.add(A,h.multiplyByScalar(V,z*p,V),Z),G=h.add(Z,h.multiplyByScalar(P,p,G),G),Qs[0]=h.clone(v,Qs[0]),Qs[1]=h.clone(G,Qs[1]),E=CK(Qs,b+m,R+m,a),I=Xi.generateArc({positions:Qs,granularity:a,ellipsoid:r}),f=LK(I,P,l,f,r,E,1),P=h.cross(L,_,P),P=h.normalize(P,P),X=h.add(Z,h.multiplyByScalar(P,p,X),X),c===Ii.ROUNDED||c===Ii.BEVELED?Sae(Z,G,X,c,ee,r,f,l,R+m,o):(V=h.negate(V,V),f=a0(A,V,l,f,r,R+m,z,k)),v=h.clone(X,v)):(Z=h.add(A,h.multiplyByScalar(V,z*p,V),Z),G=h.add(Z,h.multiplyByScalar(P,-p,G),G),Qs[0]=h.clone(v,Qs[0]),Qs[1]=h.clone(G,Qs[1]),E=CK(Qs,b+m,R+m,a),I=Xi.generateArc({positions:Qs,granularity:a,ellipsoid:r}),f=LK(I,P,l,f,r,E,1),P=h.cross(L,_,P),P=h.normalize(P,P),X=h.add(Z,h.multiplyByScalar(P,-p,X),X),c===Ii.ROUNDED||c===Ii.BEVELED?Sae(Z,G,X,c,ee,r,f,l,R+m,o):f=a0(A,V,l,f,r,R+m,z,k),v=h.clone(X,v)),C=h.negate(_,C)}else f=a0(v,P,l,f,r,b+m,1,1),v=A;b=R,R=s[Y+1],A=M}Qs[0]=h.clone(v,Qs[0]),Qs[1]=h.clone(A,Qs[1]),E=CK(Qs,b+m,R+m,a),I=Xi.generateArc({positions:Qs,granularity:a,ellipsoid:r}),f=LK(I,P,l,f,r,E,1),o&&(x=a0(A,P,u,x,r,R+m,1,1)),y=f.length;let w=o?y+x.length:y,N=new Float64Array(w);return N.set(f),o&&N.set(x,y),N};var Mm=qW;var ZK={},IC=new h,Zae=new h,eHe=new h,Cae=new h,Fc=[new h,new h],Gae=new h,Eae=new h,Xae=new h,tHe=new h,nHe=new h,iHe=new h,oHe=new h,rHe=new h,sHe=new h,aHe=new h,Vae=new Ae,Lae=new $;function F5(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,IC),h.subtract(n,e,Zae)),s=i===Ii.BEVELED?1:Math.ceil(r/W.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let l;o?l=$.fromQuaternion(Ae.fromAxisAngle(h.negate(e,IC),r/s,Vae),Lae):l=$.fromQuaternion(Ae.fromAxisAngle(e,r/s,Vae),Lae);let u=0;t=h.clone(t,IC);for(let m=0;m<s;m++)t=$.multiplyByVector(l,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function cHe(e){let t=Gae,n=Eae,i=Xae,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=F5(t,n,i,Ii.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=F5(t,n,i,Ii.ROUNDED,!1);return[r,c]}function Rae(e,t,n,i){let o=IC;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function RK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,IC),a=h.negate(s,Zae),c=0,l=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,eHe),p=h.add(m,a,Cae);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let y=h.add(m,s,Cae);r[l--]=y.z,r[l--]=y.y,r[l--]=y.x}return i.push(o,r),i}ZK.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;d(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),d(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var lHe=new h,dHe=new h;ZK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Gae,c=Eae,l=Xae,u=tHe,m=nHe,p=iHe,y=oHe,f=rHe,x=sHe,_=aHe,C=[],V=s?[]:void 0,L=s?[]:void 0,Z=n[0],G=n[1];c=h.normalize(h.subtract(G,Z,c),c),a=i.geodeticSurfaceNormal(Z,a),u=h.normalize(h.cross(a,c,u),u),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),y=h.clone(Z,y),Z=G,l=h.negate(c,l);let X,P=[],v,A=n.length;for(v=1;v<A-1;v++){a=i.geodeticSurfaceNormal(Z,a),G=n[v+1],c=h.normalize(h.subtract(G,Z,c),c),m=h.normalize(h.add(c,l,m),m);let b=h.multiplyByScalar(a,h.dot(c,a),lHe);h.subtract(c,b,b),h.normalize(b,b);let R=h.multiplyByScalar(a,h.dot(l,a),dHe);if(h.subtract(l,R,R),h.normalize(R,R),!W.equalsEpsilon(Math.abs(h.dot(b,R)),1,W.EPSILON7)){m=h.cross(m,a,m),m=h.cross(a,m,m),m=h.normalize(m,m);let I=o/Math.max(.25,h.magnitude(h.cross(m,l,IC))),w=Mm.angleIsGreaterThanPi(c,l,Z,i);m=h.multiplyByScalar(m,I,m),w?(f=h.add(Z,m,f),_=h.add(f,h.multiplyByScalar(u,o,_),_),x=h.add(f,h.multiplyByScalar(u,o*2,x),x),Fc[0]=h.clone(y,Fc[0]),Fc[1]=h.clone(_,Fc[1]),X=Xi.generateArc({positions:Fc,granularity:t,ellipsoid:i}),C=RK(X,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=h.clone(x,p),u=h.normalize(h.cross(a,c,u),u),x=h.add(f,h.multiplyByScalar(u,o*2,x),x),y=h.add(f,h.multiplyByScalar(u,o,y),y),r===Ii.ROUNDED||r===Ii.BEVELED?P.push({leftPositions:F5(f,p,x,r,w)}):P.push({leftPositions:Rae(Z,h.negate(m,m),x,w)})):(x=h.add(Z,m,x),_=h.add(x,h.negate(h.multiplyByScalar(u,o,_),_),_),f=h.add(x,h.negate(h.multiplyByScalar(u,o*2,f),f),f),Fc[0]=h.clone(y,Fc[0]),Fc[1]=h.clone(_,Fc[1]),X=Xi.generateArc({positions:Fc,granularity:t,ellipsoid:i}),C=RK(X,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=h.clone(f,p),u=h.normalize(h.cross(a,c,u),u),f=h.add(x,h.negate(h.multiplyByScalar(u,o*2,f),f),f),y=h.add(x,h.negate(h.multiplyByScalar(u,o,y),y),y),r===Ii.ROUNDED||r===Ii.BEVELED?P.push({rightPositions:F5(x,p,f,r,w)}):P.push({rightPositions:Rae(Z,m,f,w)})),l=h.negate(c,l)}Z=G}a=i.geodeticSurfaceNormal(Z,a),Fc[0]=h.clone(y,Fc[0]),Fc[1]=h.clone(Z,Fc[1]),X=Xi.generateArc({positions:Fc,granularity:t,ellipsoid:i}),C=RK(X,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z));let M;return r===Ii.ROUNDED&&(M=cHe(C)),{positions:C,corners:P,lefts:V,normals:L,endPositions:M}};var Mi=ZK;var Pae=new h,vae=new h,A5=new h,M5=new h,uHe=new h,wae=new h,uy=new h,WC=new h;function Fae(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Nm(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,l=h.normalize(h.cross(n,t,uy),uy);r.normal&&Mi.addAttribute(s,t,i,o),r.tangent&&Mi.addAttribute(a,l,i,o),r.bitangent&&Mi.addAttribute(c,n,i,o)}function Aae(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new hn,l,u=0,m=0,p,y=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,y+=f*2,m+=i[p+1].length-3;for(u+=3,m+=3,p=0;p<o.length;p++){l=o[p];let q=o[p].leftPositions;d(q)?(f=q.length,u+=f,y+=f):(f=o[p].rightPositions.length,m+=f,y+=f)}let x=d(r),_;x&&(_=r[0].length-3,u+=_,m+=_,_/=3,y+=_*6);let C=u+m,V=new Float64Array(C),L=t.normal?new Float32Array(C):void 0,Z=t.tangent?new Float32Array(C):void 0,G=t.bitangent?new Float32Array(C):void 0,X={normals:L,tangents:Z,bitangents:G},P=0,v=C-1,A,M,b,R,E=Pae,I=vae,w,N,Y=_/2,k=Ue.createTypedArray(C/3,y),O=0;if(x){N=A5,w=M5;let q=r[0];for(E=h.fromArray(a,0,E),I=h.fromArray(s,0,I),p=0;p<Y;p++)N=h.fromArray(q,(Y-1-p)*3,N),w=h.fromArray(q,(Y+p)*3,w),Mi.addAttribute(V,w,P),Mi.addAttribute(V,N,void 0,v),Nm(X,E,I,P,v,t),M=P/3,R=M+1,A=(v-2)/3,b=A-1,k[O++]=A,k[O++]=M,k[O++]=b,k[O++]=b,k[O++]=M,k[O++]=R,P+=3,v-=3}let U=0,J=0,z=i[U++],ee=i[U++];V.set(z,P),V.set(ee,v-ee.length+1),I=h.fromArray(s,J,I);let K,j;for(f=ee.length-3,p=0;p<f;p+=3)K=n.geodeticSurfaceNormal(h.fromArray(z,p,uy),uy),j=n.geodeticSurfaceNormal(h.fromArray(ee,f-p,WC),WC),E=h.normalize(h.add(K,j,E),E),Nm(X,E,I,P,v,t),M=P/3,R=M+1,A=(v-2)/3,b=A-1,k[O++]=A,k[O++]=M,k[O++]=b,k[O++]=b,k[O++]=M,k[O++]=R,P+=3,v-=3;for(K=n.geodeticSurfaceNormal(h.fromArray(z,f,uy),uy),j=n.geodeticSurfaceNormal(h.fromArray(ee,f,WC),WC),E=h.normalize(h.add(K,j,E),E),J+=3,p=0;p<o.length;p++){let q;l=o[p];let be=l.leftPositions,Te=l.rightPositions,ae,xe,_e=wae,Ve=A5,Ie=M5;if(E=h.fromArray(a,J,E),d(be)){for(Nm(X,E,I,void 0,v,t),v-=3,ae=R,xe=b,q=0;q<be.length/3;q++)_e=h.fromArray(be,q*3,_e),k[O++]=ae,k[O++]=xe-q-1,k[O++]=xe-q,Mi.addAttribute(V,_e,void 0,v),Ve=h.fromArray(V,(xe-q-1)*3,Ve),Ie=h.fromArray(V,ae*3,Ie),I=h.normalize(h.subtract(Ve,Ie,I),I),Nm(X,E,I,void 0,v,t),v-=3;_e=h.fromArray(V,ae*3,_e),Ve=h.subtract(h.fromArray(V,xe*3,Ve),_e,Ve),Ie=h.subtract(h.fromArray(V,(xe-q)*3,Ie),_e,Ie),I=h.normalize(h.add(Ve,Ie,I),I),Nm(X,E,I,P,void 0,t),P+=3}else{for(Nm(X,E,I,P,void 0,t),P+=3,ae=b,xe=R,q=0;q<Te.length/3;q++)_e=h.fromArray(Te,q*3,_e),k[O++]=ae,k[O++]=xe+q,k[O++]=xe+q+1,Mi.addAttribute(V,_e,P),Ve=h.fromArray(V,ae*3,Ve),Ie=h.fromArray(V,(xe+q)*3,Ie),I=h.normalize(h.subtract(Ve,Ie,I),I),Nm(X,E,I,P,void 0,t),P+=3;_e=h.fromArray(V,ae*3,_e),Ve=h.subtract(h.fromArray(V,(xe+q)*3,Ve),_e,Ve),Ie=h.subtract(h.fromArray(V,xe*3,Ie),_e,Ie),I=h.normalize(h.negate(h.add(Ie,Ve,I),I),I),Nm(X,E,I,void 0,v,t),v-=3}for(z=i[U++],ee=i[U++],z.splice(0,3),ee.splice(ee.length-3,3),V.set(z,P),V.set(ee,v-ee.length+1),f=ee.length-3,J+=3,I=h.fromArray(s,J,I),q=0;q<ee.length;q+=3)K=n.geodeticSurfaceNormal(h.fromArray(z,q,uy),uy),j=n.geodeticSurfaceNormal(h.fromArray(ee,f-q,WC),WC),E=h.normalize(h.add(K,j,E),E),Nm(X,E,I,P,v,t),R=P/3,M=R-1,b=(v-2)/3,A=b+1,k[O++]=A,k[O++]=M,k[O++]=b,k[O++]=b,k[O++]=M,k[O++]=R,P+=3,v-=3;P-=3,v+=3}if(E=h.fromArray(a,a.length-3,E),Nm(X,E,I,P,v,t),x){P+=3,v-=3,N=A5,w=M5;let q=r[1];for(p=0;p<Y;p++)N=h.fromArray(q,(_-p-1)*3,N),w=h.fromArray(q,p*3,w),Mi.addAttribute(V,N,void 0,v),Mi.addAttribute(V,w,P),Nm(X,E,I,P,v,t),R=P/3,M=R-1,b=(v-2)/3,A=b+1,k[O++]=A,k[O++]=M,k[O++]=b,k[O++]=b,k[O++]=M,k[O++]=R,P+=3,v-=3}if(c.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let q=new Float32Array(C/3*2),be,Te,ae=0;if(x){u/=3,m/=3;let xe=Math.PI/(_+1);Te=1/(u-_+1),be=1/(m-_+1);let _e,Ve=_/2;for(p=Ve+1;p<_+1;p++)_e=W.PI_OVER_TWO+xe*p,q[ae++]=be*(1+Math.cos(_e)),q[ae++]=.5*(1+Math.sin(_e));for(p=1;p<m-_+1;p++)q[ae++]=p*be,q[ae++]=0;for(p=_;p>Ve;p--)_e=W.PI_OVER_TWO-p*xe,q[ae++]=1-be*(1+Math.cos(_e)),q[ae++]=.5*(1+Math.sin(_e));for(p=Ve;p>0;p--)_e=W.PI_OVER_TWO-xe*p,q[ae++]=1-Te*(1+Math.cos(_e)),q[ae++]=.5*(1+Math.sin(_e));for(p=u-_;p>0;p--)q[ae++]=p*Te,q[ae++]=1;for(p=1;p<Ve+1;p++)_e=W.PI_OVER_TWO+xe*p,q[ae++]=Te*(1+Math.cos(_e)),q[ae++]=.5*(1+Math.sin(_e))}else{for(u/=3,m/=3,Te=1/(u-1),be=1/(m-1),p=0;p<m;p++)q[ae++]=p*be,q[ae++]=0;for(p=u;p>0;p--)q[ae++]=(p-1)*Te,q[ae++]=1}c.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:q})}return t.normal&&(c.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X.normals})),t.tangent&&(c.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X.tangents})),t.bitangent&&(c.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X.bitangents})),{attributes:c,indices:k}}function mHe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,l;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,y=Pae,f=vae,x=A5,_=M5,C=uHe,V=wae,L=c;for(l=0;l<s;l+=3){let Z=L+c;y=h.fromArray(n,l,y),f=h.fromArray(n,l+s,f),x=h.fromArray(n,(l+3)%s,x),f=h.subtract(f,y,f),x=h.subtract(x,y,x),_=h.normalize(h.cross(f,x,_),_),t.normal&&(Mi.addAttribute(u,_,Z),Mi.addAttribute(u,_,Z+3),Mi.addAttribute(u,_,L),Mi.addAttribute(u,_,L+3)),(t.tangent||t.bitangent)&&(V=h.fromArray(i,l,V),t.bitangent&&(Mi.addAttribute(p,V,Z),Mi.addAttribute(p,V,Z+3),Mi.addAttribute(p,V,L),Mi.addAttribute(p,V,L+3)),t.tangent&&(C=h.normalize(h.cross(V,_,C),C),Mi.addAttribute(m,C,Z),Mi.addAttribute(m,C,Z+3),Mi.addAttribute(m,C,L),Mi.addAttribute(m,C,L+3))),L+=6}if(t.normal){for(u.set(i),l=0;l<s;l+=3)u[l+s]=-i[l],u[l+s+1]=-i[l+1],u[l+s+2]=-i[l+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let Z=e.tangent.values;m.set(Z),m.set(Z,s),e.tangent.values=m}}if(t.st){let u=e.st.values,m=new Float32Array(a*6);m.set(u),m.set(u,a);let p=a*2;for(let y=0;y<2;y++){for(m[p++]=u[0],m[p++]=u[1],l=2;l<a;l+=2){let f=u[l],x=u[l+1];m[p++]=f,m[p++]=x,m[p++]=f,m[p++]=x}m[p++]=u[0],m[p++]=u[1]}e.st.values=m}return e}function GK(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function hHe(e,t){let n=new We({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Mi.computePositions(e),r=Aae(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,l=r.indices,u=c.position.values,m=u.length,p=new Float64Array(m*6),y=new Float64Array(m);y.set(u);let f=new Float64Array(m*4);u=ai.scaleToGeodeticHeight(u,s,i),f=GK(u,0,f),y=ai.scaleToGeodeticHeight(y,a,i),f=GK(y,m*2,f),p.set(u),p.set(y,m),p.set(f,m*2),c.position.values=p,c=mHe(c,t);let x,_=m/3;if(e.shadowVolume){let A=c.normal.values;m=A.length;let M=new Float32Array(m*6);for(x=0;x<m;x++)A[x]=-A[x];M.set(A,m),M=GK(A,m*4,M),c.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:M}),t.normal||(c.normal=void 0)}if(d(e.offsetAttribute)){let A=new Uint8Array(_*6);if(e.offsetAttribute===rn.TOP)A=A.fill(1,0,_).fill(1,_*2,_*4);else{let M=e.offsetAttribute===rn.NONE?0:1;A=A.fill(M)}c.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let C=l.length,V=_+_,L=Ue.createTypedArray(p.length/3,C*2+V*3);L.set(l);let Z=C;for(x=0;x<C;x+=3){let A=l[x],M=l[x+1],b=l[x+2];L[Z++]=b+_,L[Z++]=M+_,L[Z++]=A+_}let G,X,P,v;for(x=0;x<V;x+=2)G=x+V,X=G+V,P=G+1,v=X+1,L[Z++]=G,L[Z++]=X,L[Z++]=P,L[Z++]=P,L[Z++]=X,L[Z++]=v;return{attributes:c,indices:L}}var Iae=new h,$W=new h,Tu=new he;function Wae(e,t,n,i,o,r){let s=h.subtract(t,e,Iae);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,$W),c=h.cross(s,a,Iae);h.multiplyByScalar(c,i,c);let l=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,$W),n.cartesianToCartographic($W,Tu);let y=Tu.latitude,f=Tu.longitude;l=Math.min(l,y),u=Math.min(u,f),m=Math.max(m,y),p=Math.max(p,f),h.subtract(e,c,$W),n.cartesianToCartographic($W,Tu),y=Tu.latitude,f=Tu.longitude,l=Math.min(l,y),u=Math.min(u,f),m=Math.max(m,y),p=Math.max(p,f),o.latitude=l,o.longitude=u,r.latitude=m,r.longitude=p}var _u=new h,e2=new h,Vl=new he,Ll=new he;function Mae(e,t,n,i,o){e=Fae(e,t);let r=go(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new de;let a=n*.5;Vl.latitude=Number.POSITIVE_INFINITY,Vl.longitude=Number.POSITIVE_INFINITY,Ll.latitude=Number.NEGATIVE_INFINITY,Ll.longitude=Number.NEGATIVE_INFINITY;let c,l;if(i===Ii.ROUNDED){let p=r[0];h.subtract(p,r[1],_u),h.normalize(_u,_u),h.multiplyByScalar(_u,a,_u),h.add(p,_u,e2),t.cartesianToCartographic(e2,Tu),c=Tu.latitude,l=Tu.longitude,Vl.latitude=Math.min(Vl.latitude,c),Vl.longitude=Math.min(Vl.longitude,l),Ll.latitude=Math.max(Ll.latitude,c),Ll.longitude=Math.max(Ll.longitude,l)}for(let p=0;p<s-1;++p)Wae(r[p],r[p+1],t,a,Vl,Ll);let u=r[s-1];h.subtract(u,r[s-2],_u),h.normalize(_u,_u),h.multiplyByScalar(_u,a,_u),h.add(u,_u,e2),Wae(u,e2,t,a,Vl,Ll),i===Ii.ROUNDED&&(t.cartesianToCartographic(e2,Tu),c=Tu.latitude,l=Tu.longitude,Vl.latitude=Math.min(Vl.latitude,c),Vl.longitude=Math.min(Vl.longitude,l),Ll.latitude=Math.max(Ll.latitude,c),Ll.longitude=Math.max(Ll.longitude,l));let m=d(o)?o:new de;return m.north=Ll.latitude,m.south=Vl.latitude,m.east=Ll.longitude,m.west=Vl.longitude,m}function l0(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.width,i=g(e.height,0),o=g(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._vertexFormat=We.clone(g(e.vertexFormat,We.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+re.packedLength+We.packedLength+7}l0.pack=function(e,t,n){n=g(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=g(e._offsetAttribute,-1),t};var Nae=re.clone(re.UNIT_SPHERE),Uae=new We,c0={positions:void 0,ellipsoid:Nae,vertexFormat:Uae,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};l0.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=h.packedLength)o[f]=h.unpack(e,t);let r=re.unpack(e,t,Nae);t+=re.packedLength;let s=We.unpack(e,t,Uae);t+=We.packedLength;let a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t++],p=e[t++]===1,y=e[t];return d(n)?(n._positions=o,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=We.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=l,n._cornerType=u,n._granularity=m,n._shadowVolume=p,n._offsetAttribute=y===-1?void 0:y,n):(c0.positions=o,c0.width=a,c0.height=c,c0.extrudedHeight=l,c0.cornerType=u,c0.granularity=m,c0.shadowVolume=p,c0.offsetAttribute=y===-1?void 0:y,new l0(c0))};l0.computeRectangle=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.positions,i=e.width,o=g(e.ellipsoid,re.WGS84),r=g(e.cornerType,Ii.ROUNDED);return Mae(n,o,i,r,t)};l0.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Fae(t,i);let o=go(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c=e._vertexFormat,l={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)l.height=r,l.extrudedHeight=s,l.shadowVolume=e._shadowVolume,l.offsetAttribute=e._offsetAttribute,u=hHe(l,c);else{let y=Mi.computePositions(l);if(u=Aae(y,c,i),u.attributes.position.values=ai.scaleToGeodeticHeight(u.attributes.position.values,r,i),d(e._offsetAttribute)){let f=e._offsetAttribute===rn.NONE?0:1,x=u.attributes.position.values.length,_=new Uint8Array(x/3).fill(f);u.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let m=u.attributes,p=ce.fromVertices(m.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new dt({attributes:m,indices:u.indices,primitiveType:Fe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};l0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new l0({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(l0.prototype,{rectangle:{get:function(){return d(this._rectangle)||(this._rectangle=Mae(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var f_=l0;var _Mn=T(S(),1);var kae=new h,Dae=new h,fHe=new h;function pHe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Bae(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new hn,a,c=0,l=0,u,m=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,m+=p/3*4,l+=i[u+1].length-3;for(c+=3,l+=3,u=0;u<o.length;u++){a=o[u];let w=o[u].leftPositions;d(w)?(p=w.length,c+=p,m+=p/3*2):(p=o[u].rightPositions.length,l+=p,m+=p/3*2)}let y=d(r),f;y&&(f=r[0].length-3,c+=f,l+=f,f/=3,m+=f*4);let x=c+l,_=new Float64Array(x),C=0,V=x-1,L,Z,G,X,P,v,A=f/2,M=Ue.createTypedArray(x/3,m+4),b=0;if(M[b++]=C/3,M[b++]=(V-2)/3,y){n.push(C/3),v=kae,P=Dae;let w=r[0];for(u=0;u<A;u++)v=h.fromArray(w,(A-1-u)*3,v),P=h.fromArray(w,(A+u)*3,P),Mi.addAttribute(_,P,C),Mi.addAttribute(_,v,void 0,V),Z=C/3,X=Z+1,L=(V-2)/3,G=L-1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=X,C+=3,V-=3}let R=0,E=i[R++],I=i[R++];for(_.set(E,C),_.set(I,V-I.length+1),p=I.length-3,n.push(C/3,(V-2)/3),u=0;u<p;u+=3)Z=C/3,X=Z+1,L=(V-2)/3,G=L-1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=X,C+=3,V-=3;for(u=0;u<o.length;u++){let w;a=o[u];let N=a.leftPositions,Y=a.rightPositions,k,O=fHe;if(d(N)){for(V-=3,k=G,n.push(X),w=0;w<N.length/3;w++)O=h.fromArray(N,w*3,O),M[b++]=k-w-1,M[b++]=k-w,Mi.addAttribute(_,O,void 0,V),V-=3;n.push(k-Math.floor(N.length/6)),t===Ii.BEVELED&&n.push((V-2)/3+1),C+=3}else{for(C+=3,k=X,n.push(G),w=0;w<Y.length/3;w++)O=h.fromArray(Y,w*3,O),M[b++]=k+w,M[b++]=k+w+1,Mi.addAttribute(_,O,C),C+=3;n.push(k+Math.floor(Y.length/6)),t===Ii.BEVELED&&n.push(C/3-1),V-=3}for(E=i[R++],I=i[R++],E.splice(0,3),I.splice(I.length-3,3),_.set(E,C),_.set(I,V-I.length+1),p=I.length-3,w=0;w<I.length;w+=3)X=C/3,Z=X-1,G=(V-2)/3,L=G+1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=X,C+=3,V-=3;C-=3,V+=3,n.push(C/3,(V-2)/3)}if(y){C+=3,V-=3,v=kae,P=Dae;let w=r[1];for(u=0;u<A;u++)v=h.fromArray(w,(f-u-1)*3,v),P=h.fromArray(w,u*3,P),Mi.addAttribute(_,v,void 0,V),Mi.addAttribute(_,P,C),X=C/3,Z=X-1,G=(V-2)/3,L=G+1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=X,C+=3,V-=3;n.push(C/3)}else n.push(C/3,(V-2)/3);return M[b++]=C/3,M[b++]=(V-2)/3,s.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:s,indices:M,wallIndices:n}}function bHe(e){let t=e.ellipsoid,n=Mi.computePositions(e),i=Bae(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,l=a.position.values,u=l.length,m=new Float64Array(u);m.set(l);let p=new Float64Array(u*2);if(l=ai.scaleToGeodeticHeight(l,r,t),m=ai.scaleToGeodeticHeight(m,s,t),p.set(l),p.set(m,u),a.position.values=p,u/=3,d(e.offsetAttribute)){let L=new Uint8Array(u*2);if(e.offsetAttribute===rn.TOP)L=L.fill(1,0,u);else{let Z=e.offsetAttribute===rn.NONE?0:1;L=L.fill(Z)}a.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let y,f=c.length,x=Ue.createTypedArray(p.length/3,(f+o.length)*2);x.set(c);let _=f;for(y=0;y<f;y+=2){let L=c[y],Z=c[y+1];x[_++]=L+u,x[_++]=Z+u}let C,V;for(y=0;y<o.length;y++)C=o[y],V=C+u,x[_++]=C,x[_++]=V;return{attributes:a,indices:x}}function t2(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.width,i=g(e.height,0),o=g(e.extrudedHeight,i);this._positions=t,this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+re.packedLength+6}t2.pack=function(e,t,n){n=g(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=g(e._offsetAttribute,-1),t};var Yae=re.clone(re.UNIT_SPHERE),my={positions:void 0,ellipsoid:Yae,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};t2.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=re.unpack(e,t,Yae);t+=re.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t];return d(n)?(n._positions=o,n._ellipsoid=re.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=l,n._granularity=u,n._offsetAttribute=m===-1?void 0:m,n):(my.positions=o,my.width=s,my.height=a,my.extrudedHeight=c,my.cornerType=l,my.granularity=u,my.offsetAttribute=m===-1?void 0:m,new t2(my))};t2.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=pHe(t,i);let o=go(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},l;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,l=bHe(c);else{let p=Mi.computePositions(c);if(l=Bae(p,c.cornerType),l.attributes.position.values=ai.scaleToGeodeticHeight(l.attributes.position.values,r,i),d(e._offsetAttribute)){let y=l.attributes.position.values.length,f=e._offsetAttribute===rn.NONE?0:1,x=new Uint8Array(y/3).fill(f);l.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let u=l.attributes,m=ce.fromVertices(u.position.values,void 0,3);return new dt({attributes:u,indices:l.indices,primitiveType:Fe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var n2=t2;var PMn=T(S(),1);var yHe=new qn(0);function Ac(e){oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}d(Object.create)&&(Ac.prototype=Object.create(oi.prototype),Ac.prototype.constructor=Ac);Object.defineProperties(Ac.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ac.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!d(t.height)&&!d(t.extrudedHeight)&&Rc.isSupported(this._scene)};Ac.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||d(n)&&n!==t};Ac.prototype._computeCenter=fe.throwInstantiationError;Ac.prototype._onEntityPropertyChanged=function(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!d(o))return;d(o.zIndex)&&(d(o.height)||d(o.extrudedHeight))&&It(It.geometryZIndex),this._zIndex=g(o.zIndex,yHe),d(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(d(r)||d(s)){let a=new fm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new mx(this._scene,a,r,s)}};Ac.prototype.destroy=function(){d(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),oi.prototype.destroy.call(this)};Ac.getGeometryHeight=function(e,t){if(!d(e)){t!==Ke.NONE&&It(It.geometryHeightReference);return}return t!==Ke.CLAMP_TO_GROUND?e:0};Ac.getGeometryExtrudedHeight=function(e,t){if(!d(e)){t!==Ke.NONE&&It(It.geometryExtrudedHeightReference);return}return t!==Ke.CLAMP_TO_GROUND?e:Ac.CLAMP_TO_GROUND};Ac.CLAMP_TO_GROUND="clamp";Ac.computeGeometryOffsetAttribute=function(e,t,n,i){(!d(e)||!d(t))&&(t=Ke.NONE),(!d(n)||!d(i))&&(i=Ke.NONE);let o=0;if(t!==Ke.NONE&&o++,i===Ke.RELATIVE_TO_GROUND&&o++,o===2)return rn.ALL;if(o===1)return rn.TOP};var Hn=Ac;var Oae=new B,Kae=h.ZERO,Hae=new h,zae=new de;function gHe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Um(e,t){Hn.call(this,{entity:e,scene:t,geometryOptions:new gHe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}d(Object.create)&&(Um.prototype=Object.create(Hn.prototype),Um.prototype.constructor=Um);Um.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof At){let o;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Oae)),d(o)||(o=B.WHITE),i.color=Ut.fromColor(o)}return d(this._options.offsetAttribute)&&(i.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,Kae,Hae))),new _t({id:t,geometry:new f_(this._options),attributes:i})};Um.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Oae),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return d(this._options.offsetAttribute)&&(o.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,Kae,Hae))),new _t({id:t,geometry:new n2(this._options),attributes:o})};Um.prototype._computeCenter=function(e,t){let n=H.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!d(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Um.prototype._isHidden=function(e,t){return!d(t.positions)||!d(t.width)||oi.prototype._isHidden.call(this,e,t)};Um.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!H.isConstant(t.height)||!H.isConstant(t.extrudedHeight)||!H.isConstant(t.granularity)||!H.isConstant(t.width)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.cornerType)||!H.isConstant(t.zIndex)||this._onTerrain&&!H.isConstant(this._materialProperty)&&!(this._materialProperty instanceof At)};Um.prototype._setStaticOptions=function(e,t){let n=H.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),i=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),o=H.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),r=H.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,Ke.NONE);d(o)&&!d(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof At?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ye.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ye.MINIMUM_VALUE),s.granularity=H.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),s.cornerType=H.getValueOrUndefined(t.cornerType,Ye.MINIMUM_VALUE),s.offsetAttribute=Hn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Hn.getGeometryHeight(n,i),o=Hn.getGeometryExtrudedHeight(o,r),o===Hn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(f_.computeRectangle(s,zae)).minimumTerrainHeight),s.extrudedHeight=o};Um.DynamicGeometryUpdater=PC;function PC(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(PC.prototype=Object.create(ii.prototype),PC.prototype.constructor=PC);PC.prototype._isHidden=function(e,t,n){let i=this._options;return!d(i.positions)||!d(i.width)||ii.prototype._isHidden.call(this,e,t,n)};PC.prototype._setOptions=function(e,t,n){let i=this._options,o=H.getValueOrUndefined(t.height,n),r=H.getValueOrDefault(t.heightReference,n,Ke.NONE),s=H.getValueOrUndefined(t.extrudedHeight,n),a=H.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);d(s)&&!d(o)&&(o=0),i.positions=H.getValueOrUndefined(t.positions,n),i.width=H.getValueOrUndefined(t.width,n),i.granularity=H.getValueOrUndefined(t.granularity,n),i.cornerType=H.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Hn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Hn.getGeometryHeight(o,r),s=Hn.getGeometryExtrudedHeight(s,a),s===Hn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(f_.computeRectangle(i,zae)).minimumTerrainHeight),i.extrudedHeight=s};var i2=Um;var XNn=T(S(),1);var r5n=T(S(),1);function N5(){fe.throwInstantiationError()}Object.defineProperties(N5.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});N5.prototype.update=function(e){fe.throwInstantiationError()};N5.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Gr=N5;var VNn=T(S(),1);var h5n=T(S(),1);function of(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,d(t)&&(this.cameraPosition=t)}Object.defineProperties(of.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Jae=new h;of.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Jae);return XK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};of.prototype.isScaledSpacePointVisible=function(e){return XK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var xHe=new h;of.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return d(t)&&t<0&&n.minimumRadius>-t?(o=xHe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),XK(e,o,i)};of.prototype.computeHorizonCullingPoint=function(e,t,n){return qae(this._ellipsoid,e,t,n)};var Qae=re.clone(re.UNIT_SPHERE);of.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=jae(this._ellipsoid,n,Qae);return qae(o,e,t,i)};of.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return $ae(this._ellipsoid,e,t,n,i,o)};of.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=jae(this._ellipsoid,o,Qae);return $ae(s,e,t,n,i,r)};var _He=[];of.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=de.subsample(e,t,0,_He),o=ce.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var THe=new h;function jae(e,t,n){if(d(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,THe);e=re.fromCartesian3(i,n)}return e}function qae(e,t,n,i){d(i)||(i=new h);let o=nce(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],l=ece(e,c,o);if(l<0)return;r=Math.max(r,l)}return tce(o,r,i)}var U5=new h;function $ae(e,t,n,i,o,r){d(r)||(r=new h),i=g(i,3),o=g(o,h.ZERO);let s=nce(e,t),a=0;for(let c=0,l=n.length;c<l;c+=i){U5.x=n[c]+o.x,U5.y=n[c+1]+o.y,U5.z=n[c+2]+o.z;let u=ece(e,U5,s);if(u<0)return;a=Math.max(a,u)}return tce(s,a,r)}function XK(e,t,n){let i=t,o=n,r=h.subtract(e,i,Jae),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var SHe=new h,CHe=new h;function ece(e,t,n){let i=e.transformPositionToScaledSpace(t,SHe),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,CHe);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),l=1/r,u=Math.sqrt(o-1)*l;return 1/(a*l-c*u)}function tce(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var EK=new h;function nce(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,EK),h.normalize(EK,EK))}var d0=of;var Z5n=T(S(),1);function Er(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;d(n)&&(n=Pt.clone(n)),d(i)&&(i=Pt.clone(i)),d(o)&&(o=Gt.clone(o)),this._show=g(e.show,!0),this._position=h.clone(g(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=B.clone(g(e.color,B.WHITE)),this._outlineColor=B.clone(g(e.outlineColor,B.TRANSPARENT)),this._outlineWidth=g(e.outlineWidth,0),this._pixelSize=g(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=g(e.disableDepthTestDistance,0),this._id=e.id,this._collection=g(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var ice=Er.SHOW_INDEX=0,sce=Er.POSITION_INDEX=1,VHe=Er.COLOR_INDEX=2,LHe=Er.OUTLINE_COLOR_INDEX=3,RHe=Er.OUTLINE_WIDTH_INDEX=4,ZHe=Er.PIXEL_SIZE_INDEX=5,GHe=Er.SCALE_BY_DISTANCE_INDEX=6,EHe=Er.TRANSLUCENCY_BY_DISTANCE_INDEX=7,XHe=Er.DISTANCE_DISPLAY_CONDITION_INDEX=8,IHe=Er.DISABLE_DEPTH_DISTANCE_INDEX=9;Er.NUMBER_OF_PROPERTIES=10;function Su(e,t){let n=e._pointPrimitiveCollection;d(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Er.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Su(this,ice))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Su(this,sce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Pt.equals(t,e)||(this._scaleByDistance=Pt.clone(e,t),Su(this,GHe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Pt.equals(t,e)||(this._translucencyByDistance=Pt.clone(e,t),Su(this,EHe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Su(this,ZHe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Su(this,VHe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Su(this,LHe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Su(this,RHe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Su(this,XHe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Su(this,IHe))}},id:{get:function(){return this._id},set:function(e){this._id=e,d(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Su(this,ice))}}});Er.prototype.getPickId=function(e){return d(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Er.prototype._getActualPosition=function(){return this._actualPosition};Er.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Su(this,sce)};var oce=new se;Er._computeActualPosition=function(e,t,n){return t.mode===ie.SCENE3D?e:(F.multiplyByPoint(n,e,oce),Ji.computeActualWgs84Position(t,oce))};var rce=new se;Er._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,rce),rce);return Ji.wgs84ToWindowCoordinates(n,o,i)};Er.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;d(t)||(t=new D);let i=n.modelMatrix,o=Er._computeScreenSpacePosition(i,this._actualPosition,e,t);if(d(o))return o.y=e.canvas.clientHeight-o.y,o};Er.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return d(n)||(n=new He),n.x=r,n.y=s,n.width=a,n.height=c,n};Er.prototype.equals=function(e){return this===e||d(e)&&this._id===e._id&&h.equals(this._position,e._position)&&B.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&B.equals(this._outlineColor,e._outlineColor)&&Pt.equals(this._scaleByDistance,e._scaleByDistance)&&Pt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Er.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Xs=Er;var oNn=T(S(),1);var E5n=T(S(),1),hy=`in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerPercent;
in float v_pixelDistance;
in vec4 v_pickColor;

void main()
{
    // The distance in UV space from this fragment to the center of the point, at most 0.5.
    float distanceToCenter = length(gl_PointCoord - vec2(0.5));
    // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
    float maxDistance = max(0.0, 0.5 - v_pixelDistance);
    float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
    float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);

    vec4 color = mix(v_outlineColor, v_color, innerAlpha);
    color.a *= wholeAlpha;

// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
    if (color.a < 0.005)   // matches 0/255 and 1/255
    {
        discard;
    }
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
    if (color.a < 0.995)   // matches < 254/255
    {
        discard;
    }
#else
    if (color.a >= 0.995)  // matches 254/255 and 255/255
    {
        discard;
    }
#endif
#endif

    out_FragColor = czm_gammaCorrect(color);
    czm_writeLogDepth();
}
`;var I5n=T(S(),1),o2=`uniform float u_maxTotalPointSize;

in vec4 positionHighAndSize;
in vec4 positionLowAndOutline;
in vec4 compressedAttribute0;                       // color, outlineColor, pick color
in vec4 compressedAttribute1;                       // show, translucency by distance, some free space
in vec4 scaleByDistance;                            // near, nearScale, far, farScale
in vec3 distanceDisplayConditionAndDisableDepth;    // near, far, disableDepthTestDistance

out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerPercent;
out float v_pixelDistance;
out vec4 v_pickColor;

const float SHIFT_LEFT8 = 256.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;

void main()
{
    // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition

    // unpack attributes
    vec3 positionHigh = positionHighAndSize.xyz;
    vec3 positionLow = positionLowAndOutline.xyz;
    float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
    float totalSize = positionHighAndSize.w + outlineWidthBothSides;
    float outlinePercent = outlineWidthBothSides / totalSize;
    // Scale in response to browser-zoom.
    totalSize *= czm_pixelRatio;

    float temp = compressedAttribute1.x * SHIFT_RIGHT8;
    float show = floor(temp);

#ifdef EYE_DISTANCE_TRANSLUCENCY
    vec4 translucencyByDistance;
    translucencyByDistance.x = compressedAttribute1.z;
    translucencyByDistance.z = compressedAttribute1.w;

    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;

    temp = compressedAttribute1.y * SHIFT_RIGHT8;
    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif

    ///////////////////////////////////////////////////////////////////////////

    vec4 color;
    vec4 outlineColor;
    vec4 pickColor;

    // compressedAttribute0.z => pickColor.rgb

    temp = compressedAttribute0.z * SHIFT_RIGHT8;
    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor.r = floor(temp);

    // compressedAttribute0.x => color.rgb

    temp = compressedAttribute0.x * SHIFT_RIGHT8;
    color.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    color.g = (temp - floor(temp)) * SHIFT_LEFT8;
    color.r = floor(temp);

    // compressedAttribute0.y => outlineColor.rgb

    temp = compressedAttribute0.y * SHIFT_RIGHT8;
    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor.r = floor(temp);

    // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a

    temp = compressedAttribute0.w * SHIFT_RIGHT8;
    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    pickColor = pickColor / 255.0;

    temp = floor(temp) * SHIFT_RIGHT8;
    outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
    outlineColor /= 255.0;
    color.a = floor(temp);
    color /= 255.0;

    ///////////////////////////////////////////////////////////////////////////

    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;

    ///////////////////////////////////////////////////////////////////////////

#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
    float lengthSq;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        // 2D camera distance is a special case
        // treat all billboards as flattened to the z=0.0 plane
        lengthSq = czm_eyeHeight2D.y;
    }
    else
    {
        lengthSq = dot(positionEC.xyz, positionEC.xyz);
    }
#endif

#ifdef EYE_DISTANCE_SCALING
    totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
#endif
    if (totalSize > 0.0) {
        // Add padding for anti-aliasing on both sides.
        totalSize += 3.0;
    }

    // Clamp to max point size.
    totalSize = min(totalSize, u_maxTotalPointSize);
    // If size is too small, push vertex behind near plane for clipping.
    // Note that context.minimumAliasedPointSize "will be at most 1.0".
    if (totalSize < 1.0)
    {
        positionEC.xyz = vec3(0.0);
        totalSize = 1.0;
    }

    float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
    // push vertex behind near plane for clipping
    if (translucency < 0.004)
    {
        positionEC.xyz = vec3(0.0);
    }
#endif

#ifdef DISTANCE_DISPLAY_CONDITION
    float nearSq = distanceDisplayConditionAndDisableDepth.x;
    float farSq = distanceDisplayConditionAndDisableDepth.y;
    if (lengthSq < nearSq || lengthSq > farSq) {
        // push vertex behind camera to force it to be clipped
        positionEC.xyz = vec3(0.0, 0.0, 1.0);
    }
#endif

    gl_Position = czm_projection * positionEC;
    czm_vertexLogDepth();

#ifdef DISABLE_DEPTH_DISTANCE
    float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;
    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
    {
        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
    }

    if (disableDepthTestDistance != 0.0)
    {
        // Don't try to "multiply both sides" by w.  Greater/less-than comparisons won't work for negative values of w.
        float zclip = gl_Position.z / gl_Position.w;
        bool clipped = (zclip < -1.0 || zclip > 1.0);
        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
        {
            // Position z on the near plane.
            gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
            czm_vertexLogDepth(vec4(czm_currentFrustum.x));
#endif
        }
    }
#endif

    v_color = color;
    v_color.a *= translucency * show;
    v_outlineColor = outlineColor;
    v_outlineColor.a *= translucency * show;

    v_innerPercent = 1.0 - outlinePercent;
    v_pixelDistance = 2.0 / totalSize;
    gl_PointSize = totalSize * show;
    gl_Position *= show;

    v_pickColor = pickColor;
}
`;var WHe=Xs.SHOW_INDEX,PK=Xs.POSITION_INDEX,ace=Xs.COLOR_INDEX,PHe=Xs.OUTLINE_COLOR_INDEX,vHe=Xs.OUTLINE_WIDTH_INDEX,wHe=Xs.PIXEL_SIZE_INDEX,cce=Xs.SCALE_BY_DISTANCE_INDEX,lce=Xs.TRANSLUCENCY_BY_DISTANCE_INDEX,dce=Xs.DISTANCE_DISPLAY_CONDITION_INDEX,FHe=Xs.DISABLE_DEPTH_DISTANCE_INDEX,vK=Xs.NUMBER_OF_PROPERTIES,ec={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Cu(e){e=g(e,g.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(vK),this._maxPixelSize=1,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,So.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ie.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Cu.prototype,{length:{get:function(){return wK(this),this._pointPrimitives.length}}});function uce(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Cu.prototype.add=function(e){let t=new Xs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Cu.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Cu.prototype.removeAll=function(){uce(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function wK(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Cu.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Cu.prototype.contains=function(e){return d(e)&&e._pointPrimitiveCollection===this};Cu.prototype.get=function(e){return wK(this),this._pointPrimitives[e]};Cu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<vK;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function AHe(e,t,n){return new ip(e,[{index:ec.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[PK]},{index:ec.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[PK]},{index:ec.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[ace]},{index:ec.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[lce]},{index:ec.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[cce]},{index:ec.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:Q.FLOAT,usage:n[dce]}],t)}var IK=new On;function mce(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ie.SCENE3D&&(ce.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),On.fromCartesian(r,IK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[ec.positionHighAndSize],l=IK.high;c(o,l.x,l.y,l.z,s);let u=n[ec.positionLowAndOutline],m=IK.low;u(o,m.x,m.y,m.z,a)}var k5=65536,r2=256;function hce(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=B.floatToByte(r.red),l=B.floatToByte(r.green),u=B.floatToByte(r.blue),m=c*k5+l*r2+u;c=B.floatToByte(a.red),l=B.floatToByte(a.green),u=B.floatToByte(a.blue);let p=c*k5+l*r2+u;c=B.floatToByte(s.red),l=B.floatToByte(s.green),u=B.floatToByte(s.blue);let y=c*k5+l*r2+u,f=B.floatToByte(r.alpha)*k5+B.floatToByte(a.alpha)*r2+B.floatToByte(s.alpha),x=n[ec.compressedAttribute0];x(o,m,p,y,f)}function fce(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,l=i.translucencyByDistance;d(l)&&(r=l.near,s=l.nearValue,a=l.far,c=l.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=W.clamp(s,0,1),s=s===1?255:s*255|0;let m=(u?1:0)*r2+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,y=n[ec.compressedAttribute1];y(o,m,p,r,a)}function pce(e,t,n,i){let o=i._index,r=n[ec.scaleByDistance],s=0,a=1,c=1,l=1,u=i.scaleByDistance;d(u)&&(s=u.near,a=u.nearValue,c=u.far,l=u.farValue,(a!==1||l!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,l)}function bce(e,t,n,i){let o=i._index,r=n[ec.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;d(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let l=i.disableDepthTestDistance;l*=l,l>0&&(e._shaderDisableDepthDistance=!0,l===Number.POSITIVE_INFINITY&&(l=-1)),r(o,s,a,l)}function MHe(e,t,n,i){mce(e,t,n,i),hce(e,t,n,i),fce(e,t,n,i),pce(e,t,n,i),bce(e,t,n,i)}function WK(e,t,n,i,o,r){let s;i.mode===ie.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let l=t[c],u=l.position,m=Xs._computeActualPosition(u,i,o);d(m)&&(l._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function NHe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ie.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ie.SCENE3D||n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&WK(e,i,i.length,t,r,!0)):n===ie.MORPHING?WK(e,i,i.length,t,r,!0):(n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&WK(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function UHe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var kHe=[];Cu.prototype.update=function(e){if(wK(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,NHe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,l=e.passes,u=l.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let G=0;G<vK;++G)r[G]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=AHe(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G<n;++G){let X=this._pointPrimitives[G];X._dirty=!1,MHe(this,c,a,X)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let G=kHe;G.length=0,(r[PK]||r[vHe]||r[wHe])&&G.push(mce),(r[ace]||r[PHe])&&G.push(hce),(r[WHe]||r[lce])&&G.push(fce),r[cce]&&G.push(pce),(r[dce]||r[FHe])&&G.push(bce);let X=G.length;if(a=this._vaf.writers,o/n>.1){for(let P=0;P<o;++P){let v=i[P];v._dirty=!1;for(let A=0;A<X;++A)G[A](this,c,a,v)}this._vaf.commit()}else{for(let P=0;P<o;++P){let v=i[P];v._dirty=!1;for(let A=0;A<X;++A)G[A](this,c,a,v);this._vaf.subCommit(v._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!d(this._vaf)||!d(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=F.IDENTITY;e.mode===ie.SCENE3D?(p=this.modelMatrix,m=ce.clone(this._baseVolumeWC,this._boundingVolume)):m=ce.clone(this._baseVolume2D,this._boundingVolume),UHe(this,e,m);let y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===So.OPAQUE||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=De.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===So.TRANSLUCENT||this._blendOption===So.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=De.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new Be({sources:[o2]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===So.OPAQUE_AND_TRANSLUCENT&&(x=new Be({defines:["OPAQUE"],sources:[hy]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:ec}),x=new Be({defines:["TRANSLUCENT"],sources:[hy]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:ec})),this._blendOption===So.OPAQUE&&(x=new Be({sources:[hy]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:ec})),this._blendOption===So.TRANSLUCENT&&(x=new Be({sources:[hy]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:ec})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,Z=e.commandList;if(l.render||u){let G=this._colorCommands,X=this._blendOption===So.OPAQUE,P=this._blendOption===So.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let v=P?C*2:C;for(L=0;L<v;++L){let A=X||P&&L%2===0;V=G[L],d(V)||(V=G[L]=new nt),V.primitiveType=Fe.POINTS,V.pass=A||!P?Re.OPAQUE:Re.TRANSLUCENT,V.owner=this;let M=P?Math.floor(L/2):L;V.boundingVolume=m,V.modelMatrix=p,V.shaderProgram=A?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=_[M].va,V.renderState=A?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",Z.push(V)}}};Cu.prototype.isDestroyed=function(){return!1};Cu.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),uce(this._pointPrimitives),ue(this)};var vC=Cu;var sNn=T(S(),1),yce=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],FK=1,s2=8,c2=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==FK)throw new Error(`Got v${o} data when expected v${FK}.`);let r=yce[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=yce.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,s2,t),this.coords=new this.ArrayType(this.data,s2+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(s2+s+a+c),this.ids=new this.IndexArrayType(this.data,s2,t),this.coords=new this.ArrayType(this.data,s2+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(FK<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return MK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],l=[];for(;c.length;){let u=c.pop()||0,m=c.pop()||0,p=c.pop()||0;if(m-p<=a){for(let _=p;_<=m;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&l.push(r[_])}continue}let y=p+m>>1,f=s[2*y],x=s[2*y+1];f>=t&&f<=i&&x>=n&&x<=o&&l.push(r[y]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(y-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(y+1),c.push(m),c.push(1-u))}return l}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],l=i*i;for(;a.length;){let u=a.pop()||0,m=a.pop()||0,p=a.pop()||0;if(m-p<=s){for(let _=p;_<=m;_++)gce(r[2*_],r[2*_+1],t,n)<=l&&c.push(o[_]);continue}let y=p+m>>1,f=r[2*y],x=r[2*y+1];gce(f,x,t,n)<=l&&c.push(o[y]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(y-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(y+1),a.push(m),a.push(1-u))}return c}};function MK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;xce(e,t,s,i,o,r),MK(e,t,n,i,s-1,1-r),MK(e,t,n,s+1,o,1-r)}function xce(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let l=o-i+1,u=n-i+1,m=Math.log(l),p=.5*Math.exp(2*m/3),y=.5*Math.sqrt(m*p*(l-p)/l)*(u-l/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/l+y)),x=Math.min(o,Math.floor(n+(l-u)*p/l+y));xce(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(a2(e,t,i,n),t[2*o+r]>s&&a2(e,t,i,o);a<c;){for(a2(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?a2(e,t,i,c):(c++,a2(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function a2(e,t,n,i){AK(e,n,i),AK(t,2*n,2*i),AK(t,2*n+1,2*i+1)}function AK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function gce(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function km(e){e=g(e,g.EMPTY_OBJECT),this._enabled=g(e.enabled,!1),this._pixelRange=g(e.pixelRange,80),this._minimumClusterSize=g(e.minimumClusterSize,2),this._clusterBillboards=g(e.clusterBillboards,!0),this._clusterLabels=g(e.clusterLabels,!0),this._clusterPoints=g(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new ye,this.show=g(e.show,!0)}function _ce(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var DHe=new He;function Tce(e,t,n,i,o){if(d(e._labelCollection)&&i._clusterLabels?o=Qb.getScreenSpaceBoundingBox(e,t,o):d(e._billboardCollection)&&i._clusterBillboards?o=uo.getScreenSpaceBoundingBox(e,t,o):d(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Xs.getScreenSpaceBoundingBox(e,t,o)),_ce(o,n),i._clusterLabels&&!d(e._labelCollection)&&d(e.id)&&Cce(i,e.id.id)&&d(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Qb.getScreenSpaceBoundingBox(s,t,DHe);_ce(a,n),o=He.union(o,a,o)}return o}function BHe(e,t){if(e.clusterShow=!0,!d(e._labelCollection)&&d(e.id)&&Cce(t,e.id.id)&&d(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Sce(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Cce(e,t){return d(e)&&d(e._collectionIndicesByEntity[t])&&d(e._collectionIndicesByEntity[t].labelIndex)}function NK(e,t,n,i,o){if(!d(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ie.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&d(a._labelCollection),l=o._clusterBillboards&&d(a.id._billboard),u=o._clusterPoints&&d(a.id._point);if(c&&(u||l))continue;let m=a.computeScreenSpacePosition(n);d(m)&&t.push({index:s,collection:e,clustered:!1,coord:m})}}var YHe=new He,OHe=new He,KHe=new He;function HHe(e){return function(t){if(d(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!d(i)&&!d(o)&&!d(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;d(s)?s.removeAll():s=e._clusterLabelCollection=new qh({scene:n}),d(a)?a.removeAll():a=e._clusterBillboardCollection=new od({scene:n}),d(c)?c.removeAll():c=e._clusterPointCollection=new vC;let l=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],y=e._previousHeight,f=n.camera.positionCartographic.height,x=n.mapProjection.ellipsoid,_=n.camera.positionWC,C=new d0(x,_),V=[];e._clusterLabels&&NK(i,V,n,C,e),e._clusterBillboards&&NK(o,V,n,C,e),e._clusterPoints&&NK(r,V,n,C,e);let L,Z,G,X,P,v,A,M,b,R,E,I;if(V.length>0){let w=new c2(V.length,64,Uint32Array);for(let N=0;N<V.length;++N)w.add(V[N].coord.x,V[N].coord.y);if(w.finish(),f<y)for(G=m.length,L=0;L<G;++L){let N=m[L];if(!C.isPointVisible(N.position))continue;let Y=uo._computeScreenSpacePosition(F.IDENTITY,N.position,h.ZERO,D.ZERO,n);if(!d(Y))continue;let k=1-f/y,O=N.width=N.width*k,U=N.height=N.height*k;O=Math.max(O,N.minimumWidth),U=Math.max(U,N.minimumHeight);let J=Y.x-O*.5,z=Y.y-U*.5,ee=Y.x+O,K=Y.y+U;for(P=w.range(J,z,ee,K),v=P.length,R=0,b=[],Z=0;Z<v;++Z)A=P[Z],M=V[A],M.clustered||(++R,E=M.collection,I=M.index,b.push(E.get(I).id));if(R>=u)for(Sce(N.position,R,b,e),p.push(N),Z=0;Z<v;++Z)V[P[Z]].clustered=!0}for(G=V.length,L=0;L<G;++L){let N=V[L];if(N.clustered)continue;N.clustered=!0,E=N.collection,I=N.index;let Y=E.get(I);X=Tce(Y,N.coord,l,e,YHe);let k=He.clone(X,OHe);P=w.range(X.x,X.y,X.x+X.width,X.y+X.height),v=P.length;let O=h.clone(Y.position);for(R=1,b=[Y.id],Z=0;Z<v;++Z)if(A=P[Z],M=V[A],!M.clustered){let U=M.collection.get(M.index),J=Tce(U,M.coord,l,e,KHe);h.add(U.position,O,O),He.union(k,J,k),++R,b.push(U.id)}if(R>=u){let U=h.multiplyByScalar(O,1/R,O);for(Sce(U,R,b,e),p.push({position:U,width:k.width,height:k.height,minimumWidth:X.width,minimumHeight:X.height}),Z=0;Z<v;++Z)V[P[Z]].clustered=!0}else BHe(Y,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}km.prototype._initialize=function(e){this._scene=e;let t=HHe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(km.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function kK(e,t,n,i){return function(o){let r=this[e];d(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(d(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),d(r)&&d(s[i]))return r.get(s[i]);d(r)||(r=this[e]=new t({scene:this._scene}));let a,c,l=this[n];l.length>0?(a=l.pop(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function DK(e,t){let n=e._collectionIndicesByEntity[t];!d(n.billboardIndex)&&!d(n.labelIndex)&&!d(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}km.prototype.getLabel=kK("_labelCollection",qh,"_unusedLabelIndices","labelIndex");km.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!d(this._labelCollection)||!d(t)||!d(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,DK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};km.prototype.getBillboard=kK("_billboardCollection",od,"_unusedBillboardIndices","billboardIndex");km.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!d(this._billboardCollection)||!d(t)||!d(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,DK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};km.prototype.getPoint=kK("_pointCollection",vC,"_unusedPointIndices","pointIndex");km.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!d(this._pointCollection)||!d(t)||!d(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,DK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function UK(e){if(!d(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function zHe(e){e.enabled||(d(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),d(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),d(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,UK(e._labelCollection),UK(e._billboardCollection),UK(e._pointCollection))}km.prototype.update=function(e){if(!this.show)return;let t;d(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),d(this._billboardCollection)&&this._billboardCollection.length>0&&!d(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,zHe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),d(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),d(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),d(this._clusterPointCollection)&&this._clusterPointCollection.update(e),d(this._labelCollection)&&this._labelCollection.update(e),d(this._billboardCollection)&&this._billboardCollection.update(e),d(this._pointCollection)&&this._pointCollection.update(e)};km.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),d(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var ad=km;function BK(e){this._name=e,this._clock=void 0,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Es(this),this._entityCluster=new ad}Object.defineProperties(BK.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Gr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});BK.prototype.update=function(e){return!0};var l2=BK;var PUn=T(S(),1);var QNn=T(S(),1);var PNn=T(S(),1);var Vce={};Vce.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,l=new Float64Array(c*3),u,m=0,p=0,y=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let x=u/i*W.TWO_PI,_=Math.cos(x),C=Math.sin(x),V=_*n,L=C*n,Z=_*t,G=C*t;l[p+y]=V,l[p+y+1]=L,l[p+y+2]=s,l[p+f]=Z,l[p+f+1]=G,l[p+f+2]=r,p+=3,o&&(l[m++]=V,l[m++]=L,l[m++]=s,l[m++]=Z,l[m++]=G,l[m++]=r)}return l};var p_=Vce;var YK=new D,JHe=new h,QHe=new h,jHe=new h,qHe=new h;function u0(e){e=g(e,g.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=g(e.vertexFormat,We.DEFAULT),r=g(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=We.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}u0.packedLength=We.packedLength+5;u0.pack=function(e,t,n){return n=g(n,0),We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=g(e._offsetAttribute,-1),t};var Lce=new We,wC={vertexFormat:Lce,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};u0.unpack=function(e,t,n){t=g(t,0);let i=We.unpack(e,t,Lce);t+=We.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return d(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(wC.length=o,wC.topRadius=r,wC.bottomRadius=s,wC.slices=a,wC.offsetAttribute=c===-1?void 0:c,new u0(wC))};u0.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,l=p_.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,m=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,y=o.bitangent?new Float32Array(c*3):void 0,f,x=o.normal||o.tangent||o.bitangent;if(x){let P=o.tangent||o.bitangent,v=0,A=0,M=0,b=Math.atan2(i-n,t),R=JHe;R.z=Math.sin(b);let E=Math.cos(b),I=jHe,w=QHe;for(f=0;f<r;f++){let N=f/r*W.TWO_PI,Y=E*Math.cos(N),k=E*Math.sin(N);x&&(R.x=Y,R.y=k,P&&(I=h.normalize(h.cross(h.UNIT_Z,R,I),I)),o.normal&&(m[v++]=R.x,m[v++]=R.y,m[v++]=R.z,m[v++]=R.x,m[v++]=R.y,m[v++]=R.z),o.tangent&&(p[A++]=I.x,p[A++]=I.y,p[A++]=I.z,p[A++]=I.x,p[A++]=I.y,p[A++]=I.z),o.bitangent&&(w=h.normalize(h.cross(R,I,w),w),y[M++]=w.x,y[M++]=w.y,y[M++]=w.z,y[M++]=w.x,y[M++]=w.y,y[M++]=w.z))}for(f=0;f<r;f++)o.normal&&(m[v++]=0,m[v++]=0,m[v++]=-1),o.tangent&&(p[A++]=1,p[A++]=0,p[A++]=0),o.bitangent&&(y[M++]=0,y[M++]=-1,y[M++]=0);for(f=0;f<r;f++)o.normal&&(m[v++]=0,m[v++]=0,m[v++]=1),o.tangent&&(p[A++]=1,p[A++]=0,p[A++]=0),o.bitangent&&(y[M++]=0,y[M++]=1,y[M++]=0)}let _=12*r-12,C=Ue.createTypedArray(c,_),V=0,L=0;for(f=0;f<r-1;f++)C[V++]=L,C[V++]=L+2,C[V++]=L+3,C[V++]=L,C[V++]=L+3,C[V++]=L+1,L+=2;for(C[V++]=s-2,C[V++]=0,C[V++]=1,C[V++]=s-2,C[V++]=1,C[V++]=s-1,f=1;f<r-1;f++)C[V++]=s+f+1,C[V++]=s+f,C[V++]=s;for(f=1;f<r-1;f++)C[V++]=a,C[V++]=a+f,C[V++]=a+f+1;let Z=0;if(o.st){let P=Math.max(n,i);for(f=0;f<c;f++){let v=h.fromArray(l,f*3,qHe);u[Z++]=(v.x+P)/(2*P),u[Z++]=(v.y+P)/(2*P)}}let G=new hn;o.position&&(G.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:l})),o.normal&&(G.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(G.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(G.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(G.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),YK.x=t*.5,YK.y=Math.max(i,n);let X=new ce(h.ZERO,D.magnitude(YK));if(d(e._offsetAttribute)){t=l.length;let P=e._offsetAttribute===rn.NONE?0:1,v=new Uint8Array(t/3).fill(P);G.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}return new dt({attributes:G,indices:C,primitiveType:Fe.TRIANGLES,boundingSphere:X,offsetAttribute:e._offsetAttribute})};var OK;u0.getUnitCylinder=function(){return d(OK)||(OK=u0.createGeometry(new u0({topRadius:1,bottomRadius:1,length:1,vertexFormat:We.POSITION_ONLY}))),OK};var d2=u0;var uUn=T(S(),1);var KK=new D;function FC(e){e=g(e,g.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=g(e.slices,128),r=Math.max(g(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}FC.packedLength=6;FC.pack=function(e,t,n){return n=g(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=g(e._offsetAttribute,-1),t};var b_={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};FC.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return d(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(b_.length=i,b_.topRadius=o,b_.bottomRadius=r,b_.slices=s,b_.numberOfVerticalLines=a,b_.offsetAttribute=c===-1?void 0:c,new FC(b_))};FC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=p_.computePositions(t,n,i,o,!1),c=o*2,l;if(r>0){let x=Math.min(r,o);l=Math.round(o/x),c+=x}let u=Ue.createTypedArray(s,c*2),m=0,p;for(p=0;p<o-1;p++)u[m++]=p,u[m++]=p+1,u[m++]=p+o,u[m++]=p+1+o;if(u[m++]=o-1,u[m++]=0,u[m++]=o+o-1,u[m++]=o,r>0)for(p=0;p<o;p+=l)u[m++]=p,u[m++]=p+o;let y=new hn;y.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:a}),KK.x=t*.5,KK.y=Math.max(i,n);let f=new ce(h.ZERO,D.magnitude(KK));if(d(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===rn.NONE?0:1,_=new Uint8Array(t/3).fill(x);y.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new dt({attributes:y,indices:u,primitiveType:Fe.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var u2=FC;var Rce=h.ZERO,Zce=new h,$He=new h,Gce=new B;function eze(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function cd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new eze(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}d(Object.create)&&(cd.prototype=Object.create(oi.prototype),cd.prototype.constructor=cd);Object.defineProperties(cd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});cd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof At){let a;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Gce)),d(a)||(a=B.WHITE),s.color=Ut.fromColor(a)}return d(this._options.offsetAttribute)&&(s.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,Rce,Zce))),new _t({id:t,geometry:new d2(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};cd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Gce),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return d(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,Rce,Zce))),new _t({id:t,geometry:new u2(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:r})};cd.prototype._computeCenter=function(e,t){return H.getValueOrUndefined(this._entity.position,e,t)};cd.prototype._isHidden=function(e,t){return!d(e.position)||!d(t.length)||!d(t.topRadius)||!d(t.bottomRadius)||oi.prototype._isHidden.call(this,e,t)};cd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!H.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!H.isConstant(t.slices)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.numberOfVerticalLines)};cd.prototype._setStaticOptions=function(e,t){let n=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof At?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ye.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ye.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ye.MINIMUM_VALUE),i.slices=H.getValueOrUndefined(t.slices,Ye.MINIMUM_VALUE),i.numberOfVerticalLines=H.getValueOrUndefined(t.numberOfVerticalLines,Ye.MINIMUM_VALUE),i.offsetAttribute=n!==Ke.NONE?rn.ALL:void 0};cd.prototype._onEntityPropertyChanged=pp;cd.DynamicGeometryUpdater=AC;function AC(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(AC.prototype=Object.create(ii.prototype),AC.prototype.constructor=AC);AC.prototype._isHidden=function(e,t,n){let i=this._options,o=H.getValueOrUndefined(e.position,n,$He);return!d(o)||!d(i.length)||!d(i.topRadius)||!d(i.bottomRadius)||ii.prototype._isHidden.call(this,e,t,n)};AC.prototype._setOptions=function(e,t,n){let i=H.getValueOrDefault(t.heightReference,n,Ke.NONE),o=this._options;o.length=H.getValueOrUndefined(t.length,n),o.topRadius=H.getValueOrUndefined(t.topRadius,n),o.bottomRadius=H.getValueOrUndefined(t.bottomRadius,n),o.slices=H.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=H.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ke.NONE?rn.ALL:void 0};var m2=cd;var RYn=T(S(),1);var wUn=T(S(),1),tze={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Xr=Object.freeze(tze);var AUn=T(S(),1),nze={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},mo=Object.freeze(nze);var NUn=T(S(),1),ize={NONE:0,HOLD:1,EXTRAPOLATE:2},ld=Object.freeze(ize);var kUn=T(S(),1),Ece=T(Dl(),1);function oze(e){let t=new Ece.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var m0=oze;var KUn=T(S(),1);var rze=W.factorial;function HK(e,t,n,i,o,r){let s=0,a,c,l;if(i>0){for(c=0;c<o;c++){for(a=!1,l=0;l<r.length&&!a;l++)c===r[l]&&(a=!0);a||(r.push(c),s+=HK(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,l=0;l<r.length&&!a;l++)c===r[l]&&(a=!0);a||(s*=e-n[t[c]])}return s}var D5={type:"Hermite"};D5.getRequiredDataPoints=function(e,t){return t=g(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};D5.interpolateOrderZero=function(e,t,n,i,o){d(o)||(o=new Array(i));let r,s,a,c,l,u,m=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let _=new Array(m);for(p[r]=_,s=0;s<m;s++)_[s]=[]}let y=m,f=new Array(y);for(r=0;r<y;r++)f[r]=r;let x=m-1;for(c=0;c<i;c++){for(s=0;s<y;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<y;r++){let _=!1;for(s=0;s<y-r;s++){let C=t[f[s]],V=t[f[s+r]],L;V-C<=0?(u=f[s]*i+i*r+c,L=n[u],p[c][r].push(L/rze(r))):(L=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(L/(V-C))),_=_||L!==0}_||(x=r-1)}}for(a=0,l=0;a<=l;a++)for(r=a;r<=x;r++){let _=HK(e,f,t,a,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+a*i]+=C*_}}return o};var sze=[];D5.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);d(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,l=new Array(c*(o+1)),u;for(u=0;u<c;u++)for(let C=0;C<o+1;C++)l[u*(o+1)+C]=u;let m=l.length,p=sze,y=aze(p,l,t,n,i,o),f=[],x=m*(m+1)/2,_=Math.min(y,r);for(let C=0;C<=_;C++)for(u=C;u<=y;u++){f.length=0;let V=HK(e,l,t,C,u,f),L=Math.floor(u*(1-u)/2)+m*u;for(let Z=0;Z<i;Z++){let G=Math.floor(Z*x),X=p[G+L];s[Z+C*i]+=X*V}}return s};function aze(e,t,n,i,o,r){let s,a,c=-1,l=t.length,u=l*(l+1)/2;for(let m=0;m<o;m++){let p=Math.floor(m*u);for(s=0;s<l;s++)a=t[s]*o*(r+1)+m,e[p+s]=i[a];for(let y=1;y<l;y++){let f=0,x=Math.floor(y*(1-y)/2)+l*y,_=!1;for(s=0;s<l-y;s++){let C=n[t[s]],V=n[t[s+y]],L,Z;if(V-C<=0)a=t[s]*o*(r+1)+o*y+m,L=i[a],Z=L/W.factorial(y),e[p+x+f]=Z,f++;else{let G=Math.floor((y-1)*(2-y)/2)+l*(y-1);L=e[p+G+s+1]-e[p+G+s],Z=L/(V-C),e[p+x+f]=Z,f++}_=_||L!==0}_&&(c=Math.max(c,y))}}return c}var h2=D5;var JUn=T(S(),1);var zK={type:"Lagrange"};zK.getRequiredDataPoints=function(e){return Math.max(e+1,2)};zK.interpolateOrderZero=function(e,t,n,i,o){d(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let l=t[r]-t[s];c*=(e-t[s])/l}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var f2=zK;var qUn=T(S(),1);var JK={type:"Linear"};JK.getRequiredDataPoints=function(e){return 2};JK.interpolateOrderZero=function(e,t,n,i,o){d(o)||(o=new Array(i));let r,s,a,c=t[0],l=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+l*s-c*a)/(l-c);return o};var y_=JK;var nkn=T(S(),1);function tc(e,t,n){this.clock=g(e,0),this.cone=g(t,0),this.magnitude=g(n,1)}tc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return d(t)||(t=new tc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};tc.clone=function(e,t){if(d(e))return d(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new tc(e.clock,e.cone,e.magnitude)};tc.normalize=function(e,t){return d(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new tc(e.clock,e.cone,1)};tc.equals=function(e,t){return e===t||d(e)&&d(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};tc.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||d(e)&&d(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};tc.prototype.equals=function(e){return tc.equals(this,e)};tc.prototype.clone=function(e){return tc.clone(this,e)};tc.prototype.equalsEpsilon=function(e,t){return tc.equalsEpsilon(this,e,t)};tc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var p2=tc;var _2=T(Dl(),1);var Tkn=T(S(),1);var hkn=T(S(),1);var okn=T(S(),1),QK;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?QK=function(){return performance.now()}:QK=function(){return Date.now()};var gi=QK;function jK(e){e=g(e,g.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;d(t)?t=te.clone(t):d(n)?t=te.clone(n):d(i)?t=te.addDays(i,-1,new te):t=te.now(),d(n)?n=te.clone(n):n=te.clone(t),d(i)?i=te.clone(i):i=te.addDays(n,1,new te),this.startTime=n,this.stopTime=i,this.clockRange=g(e.clockRange,Xr.UNBOUNDED),this.canAnimate=g(e.canAnimate,!0),this.onTick=new ye,this.onStop=new ye,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=gi(),this.currentTime=t,this.multiplier=g(e.multiplier,1),this.shouldAnimate=g(e.shouldAnimate,!1),this.clockStep=g(e.clockStep,mo.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(jK.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){te.equals(this._currentTime,e)||(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===mo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=te.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});jK.prototype.tick=function(){let e=gi(),t=te.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===mo.SYSTEM_CLOCK)t=te.now(t);else{let i=this._multiplier;if(n===mo.TICK_DEPENDENT)t=te.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=te.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Xr.CLAMPED)te.lessThan(t,r)?t=te.clone(r,t):te.greaterThan(t,s)&&(t=te.clone(s,t),this.onStop.raiseEvent(this));else if(o===Xr.LOOP_STOP)for(te.lessThan(t,r)&&(t=te.clone(r,t));te.greaterThan(t,s);)t=te.addSeconds(r,te.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Dm=jK;function g_(){this._definitionChanged=new ye,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(g_.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:ul("startTime"),stopTime:ul("stopTime"),currentTime:ul("currentTime"),clockRange:ul("clockRange"),clockStep:ul("clockStep"),multiplier:ul("multiplier")});g_.prototype.clone=function(e){return d(e)||(e=new g_),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};g_.prototype.equals=function(e){return this===e||d(e)&&te.equals(this.startTime,e.startTime)&&te.equals(this.stopTime,e.stopTime)&&te.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};g_.prototype.merge=function(e){this.startTime=g(this.startTime,e.startTime),this.stopTime=g(this.stopTime,e.stopTime),this.currentTime=g(this.currentTime,e.currentTime),this.clockRange=g(this.clockRange,e.clockRange),this.clockStep=g(this.clockStep,e.clockStep),this.multiplier=g(this.multiplier,e.multiplier)};g_.prototype.getValue=function(e){return d(e)||(e=new Dm),e.startTime=g(this.startTime,e.startTime),e.stopTime=g(this.stopTime,e.stopTime),e.currentTime=g(this.currentTime,e.currentTime),e.clockRange=g(this.clockRange,e.clockRange),e.multiplier=g(this.multiplier,e.multiplier),e.clockStep=g(this.clockStep,e.clockStep),e};var Bm=g_;var Xkn=T(S(),1);var cze=B.WHITE,lze=.1,dze=new D(8,8),uze=new D(0,0),mze=new D(1,1);function MC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(MC.prototype,{isConstant:{get:function(){return H.isConstant(this._color)&&H.isConstant(this._cellAlpha)&&H.isConstant(this._lineCount)&&H.isConstant(this._lineThickness)&&H.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});MC.prototype.getType=function(e){return"Grid"};MC.prototype.getValue=function(e,t){return d(t)||(t={}),t.color=H.getValueOrClonedDefault(this._color,e,cze,t.color),t.cellAlpha=H.getValueOrDefault(this._cellAlpha,e,lze),t.lineCount=H.getValueOrClonedDefault(this._lineCount,e,dze,t.lineCount),t.lineThickness=H.getValueOrClonedDefault(this._lineThickness,e,mze,t.lineThickness),t.lineOffset=H.getValueOrClonedDefault(this._lineOffset,e,uze,t.lineOffset),t};MC.prototype.equals=function(e){return this===e||e instanceof MC&&H.equals(this._color,e._color)&&H.equals(this._cellAlpha,e._cellAlpha)&&H.equals(this._lineCount,e._lineCount)&&H.equals(this._lineThickness,e._lineThickness)&&H.equals(this._lineOffset,e._lineOffset)};var NC=MC;var Akn=T(S(),1);function UC(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(UC.prototype,{isConstant:{get:function(){return H.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});UC.prototype.getType=function(e){return"PolylineArrow"};UC.prototype.getValue=function(e,t){return d(t)||(t={}),t.color=H.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};UC.prototype.equals=function(e){return this===e||e instanceof UC&&H.equals(this._color,e._color)};var kC=UC;var Okn=T(S(),1);var hze=B.WHITE,fze=B.TRANSPARENT,pze=16,bze=255;function DC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(DC.prototype,{isConstant:{get:function(){return H.isConstant(this._color)&&H.isConstant(this._gapColor)&&H.isConstant(this._dashLength)&&H.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});DC.prototype.getType=function(e){return"PolylineDash"};DC.prototype.getValue=function(e,t){return d(t)||(t={}),t.color=H.getValueOrClonedDefault(this._color,e,hze,t.color),t.gapColor=H.getValueOrClonedDefault(this._gapColor,e,fze,t.gapColor),t.dashLength=H.getValueOrDefault(this._dashLength,e,pze,t.dashLength),t.dashPattern=H.getValueOrDefault(this._dashPattern,e,bze,t.dashPattern),t};DC.prototype.equals=function(e){return this===e||e instanceof DC&&H.equals(this._color,e._color)&&H.equals(this._gapColor,e._gapColor)&&H.equals(this._dashLength,e._dashLength)&&H.equals(this._dashPattern,e._dashPattern)};var BC=DC;var $kn=T(S(),1);var yze=B.WHITE,gze=.25,xze=1;function YC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(YC.prototype,{isConstant:{get:function(){return H.isConstant(this._color)&&H.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});YC.prototype.getType=function(e){return"PolylineGlow"};YC.prototype.getValue=function(e,t){return d(t)||(t={}),t.color=H.getValueOrClonedDefault(this._color,e,yze,t.color),t.glowPower=H.getValueOrDefault(this._glowPower,e,gze,t.glowPower),t.taperPower=H.getValueOrDefault(this._taperPower,e,xze,t.taperPower),t};YC.prototype.equals=function(e){return this===e||e instanceof YC&&H.equals(this._color,e._color)&&H.equals(this._glowPower,e._glowPower)&&H.equals(this._taperPower,e._taperPower)};var OC=YC;var aDn=T(S(),1);var _ze=B.WHITE,Tze=B.BLACK,Sze=1;function KC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(KC.prototype,{isConstant:{get:function(){return H.isConstant(this._color)&&H.isConstant(this._outlineColor)&&H.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});KC.prototype.getType=function(e){return"PolylineOutline"};KC.prototype.getValue=function(e,t){return d(t)||(t={}),t.color=H.getValueOrClonedDefault(this._color,e,_ze,t.color),t.outlineColor=H.getValueOrClonedDefault(this._outlineColor,e,Tze,t.outlineColor),t.outlineWidth=H.getValueOrDefault(this._outlineWidth,e,Sze),t};KC.prototype.equals=function(e){return this===e||e instanceof KC&&H.equals(this._color,e._color)&&H.equals(this._outlineColor,e._outlineColor)&&H.equals(this._outlineWidth,e._outlineWidth)};var fy=KC;var pDn=T(S(),1);function h0(e,t){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new Lr,this._referenceFrame=g(t,io.FIXED),this.setValue(e)}Object.defineProperties(h0.prototype,{isConstant:{get:function(){let e=this._value;if(!d(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!H.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});h0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,io.FIXED,t)};h0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!d(i))return;let o=i.length;d(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);d(c)&&(n[s]=c,s++),r++}return n.length=s,n};h0.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),d(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];d(o)&&t.add(o.definitionChanged,h0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};h0.prototype.equals=function(e){return this===e||e instanceof h0&&this._referenceFrame===e._referenceFrame&&H.arrayEquals(this._value,e._value)};h0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var f0=h0;var TDn=T(S(),1);function py(e){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new Lr,this.setValue(e)}Object.defineProperties(py.prototype,{isConstant:{get:function(){let e=this._value;if(!d(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!H.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});py.prototype.getValue=function(e,t){let n=this._value;if(!d(n))return;let i=n.length;d(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);d(a)&&(t[r]=a,r++),o++}return t.length=r,t};py.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),d(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];d(o)&&t.add(o.definitionChanged,py.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};py.prototype.equals=function(e){return this===e||e instanceof py&&H.arrayEquals(this._value,e._value)};py.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var HC=py;var RDn=T(S(),1);function x_(e){let t=e._targetProperty;if(!d(t)){let n=e._targetEntity;if(!d(n)){if(n=e._targetCollection.getById(e._targetId),!d(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(dd.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&d(t);++o)t=t[i[o]];e._targetProperty=t}return t}function dd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new ye,e.collectionChanged.addEventListener(dd.prototype._onCollectionChanged,this)}Object.defineProperties(dd.prototype,{isConstant:{get:function(){return H.isConstant(x_(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=x_(this);return d(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return x_(this)}}});dd.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new dd(e,n,i)};dd.prototype.getValue=function(e,t){let n=x_(this);return d(n)?n.getValue(e,t):void 0};dd.prototype.getValueInReferenceFrame=function(e,t,n){let i=x_(this);return d(i)?i.getValueInReferenceFrame(e,t,n):void 0};dd.prototype.getType=function(e){let t=x_(this);return d(t)?t.getType(e):void 0};dd.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};dd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){d(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};dd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;d(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(dd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):d(i)||(i=x_(this),d(i)&&this._definitionChanged.raiseEvent(this))};var p0=dd;var IDn=T(S(),1);var Cze={packedLength:1,pack:function(e,t,n){return n=g(n,0),t[n]=e,t},unpack:function(e,t,n){return t=g(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){d(i)||(i=[]),t=g(t,0),n=g(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-W.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+W.TWO_PI:o}},Vu=Cze;var QDn=T(S(),1);var UDn=T(S(),1);var Xce={packedLength:1,pack:function(e,t,n){n=g(n,0),t[n]=e},unpack:function(e,t,n){return t=g(t,0),e[t]}};function Ice(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Wce(e,t){return e instanceof te?e:typeof e=="string"?te.fromIso8601(e):te.addSeconds(t,e,new te)}var qK=[],$K=[];function B5(e,t,n,i,o){let r=0,s,a,c,l,u,m;for(;r<i.length;){u=Wce(i[r],e),c=Lo(t,u,te.compare);let p=0,y=0;if(c<0){for(c=~c,l=c*o,a=void 0,m=t[c];r<i.length&&(u=Wce(i[r],e),!(d(a)&&te.compare(a,u)>=0||d(m)&&te.compare(u,m)>=0));){for(qK[p++]=u,r=r+1,s=0;s<o;s++)$K[y++]=i[r],r=r+1;a=u}p>0&&($K.length=y,Ice(n,l,$K),qK.length=p,Ice(t,c,qK))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function Ym(e,t){let n=e;n===Number&&(n=Xce);let i=n.packedLength,o=g(n.packedInterpolationLength,i),r=0,s;if(d(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let l=t[c];l===Number&&(l=Xce);let u=l.packedLength;i+=u,o+=g(l.packedInterpolationLength,u),s[c]=l}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=y_,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new ye,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=ld.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ld.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Ym.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});Ym.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Lo(n,e,te.compare);if(a<0){if(a=~a,a===0){let Z=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ld.NONE||o!==0&&te.secondsDifference(Z,e)>o)return;if(this._backwardExtrapolationType===ld.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let Z=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ld.NONE||o!==0&&te.secondsDifference(e,Z)>o)return;if(this._forwardExtrapolationType===ld.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,l=this._yTable,u=this._interpolationAlgorithm,m=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let Z=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);Z!==this._numberOfPoints&&(this._numberOfPoints=Z,c.length=Z,l.length=Z*m)}let y=this._numberOfPoints-1;if(y<1)return;let f=0,x=i-1;if(x-f+1>=y+1){let Z=a-(y/2|0)-1;Z<f&&(Z=f);let G=Z+y;G>x&&(G=x,Z=G-y,Z<f&&(Z=f)),f=Z,x=G}let C=x-f+1;for(let Z=0;Z<C;++Z)c[Z]=te.secondsDifference(n[f+Z],n[x]);if(d(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,x,l);else{let Z=0,G=this._packedLength,X=f*G,P=(x+1)*G;for(;X<P;)l[Z]=s[X],X++,Z++}let V=te.secondsDifference(e,n[x]),L;if(p===0||!d(u.interpolate))L=u.interpolateOrderZero(V,c,l,m,this._interpolationResult);else{let Z=Math.floor(m/(p+1));L=u.interpolate(V,c,l,Z,p,p,this._interpolationResult)}return d(r.unpackInterpolationResult)?r.unpackInterpolationResult(L,s,f,x,t):r.unpack(L,0,t)}return r.unpack(s,a*this._packedLength,t)};Ym.prototype.setInterpolationOptions=function(e){if(!d(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;d(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),d(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Ym.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=d(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}B5(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ym.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=d(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let l=n[c],u=i.length;for(let m=0;m<u;m++)i[m].pack(l[m],a,a.length)}B5(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ym.prototype.addSamplesPackedArray=function(e,t){B5(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ym.prototype.removeSample=function(e){let t=Lo(this._times,e,te.compare);return t<0?!1:(Pce(this,t,1),!0)};function Pce(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Ym.prototype.removeSamples=function(e){let t=this._times,n=Lo(t,e.start,te.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Lo(t,e.stop,te.compare);i<0?i=~i:e.isStopIncluded&&++i,Pce(this,n,i-n)};Ym.prototype.equals=function(e){if(this===e)return!0;if(!d(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=d(t),i=e._derivativeTypes,o=d(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!te.equals(a[r],c[r]))return!1;let l=this._values,u=e._values;for(s=l.length,r=0;r<s;r++)if(l[r]!==u[r])return!1;return!0};Ym._mergeNewSamples=B5;var ud=Ym;function Lu(e,t){t=g(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new ud(h,n),this._definitionChanged=new ye,this._referenceFrame=g(e,io.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Lu.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});Lu.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,io.FIXED,t)};Lu.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),d(n))return dp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Lu.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Lu.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Lu.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Lu.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Lu.prototype.removeSample=function(e){return this._property.removeSample(e)};Lu.prototype.removeSamples=function(e){this._property.removeSamples(e)};Lu.prototype.equals=function(e){return this===e||e instanceof Lu&&H.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var js=Lu;var aBn=T(S(),1);var qDn=T(S(),1),Vze={HORIZONTAL:0,VERTICAL:1},Om=Object.freeze(Vze);var Lze=Om.HORIZONTAL,Rze=B.WHITE,Zze=B.BLACK,Gze=0,Eze=1;function zC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(zC.prototype,{isConstant:{get:function(){return H.isConstant(this._orientation)&&H.isConstant(this._evenColor)&&H.isConstant(this._oddColor)&&H.isConstant(this._offset)&&H.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});zC.prototype.getType=function(e){return"Stripe"};zC.prototype.getValue=function(e,t){return d(t)||(t={}),t.horizontal=H.getValueOrDefault(this._orientation,e,Lze)===Om.HORIZONTAL,t.evenColor=H.getValueOrClonedDefault(this._evenColor,e,Rze,t.evenColor),t.oddColor=H.getValueOrClonedDefault(this._oddColor,e,Zze,t.oddColor),t.offset=H.getValueOrDefault(this._offset,e,Gze),t.repeat=H.getValueOrDefault(this._repeat,e,Eze),t};zC.prototype.equals=function(e){return this===e||e instanceof zC&&H.equals(this._orientation,e._orientation)&&H.equals(this._evenColor,e._evenColor)&&H.equals(this._oddColor,e._oddColor)&&H.equals(this._offset,e._offset)&&H.equals(this._repeat,e._repeat)};var JC=zC;var bBn=T(S(),1);function by(e){this._definitionChanged=new ye,this._intervals=new Zr,this._intervals.changedEvent.addEventListener(by.prototype._intervalsChanged,this),this._referenceFrame=g(e,io.FIXED)}Object.defineProperties(by.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});by.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,io.FIXED,t)};by.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(d(i))return dp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};by.prototype.equals=function(e){return this===e||e instanceof by&&this._intervals.equals(e._intervals,H.equals)&&this._referenceFrame===e._referenceFrame};by.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var b0=by;var SBn=T(S(),1);function __(){this._definitionChanged=new ye,this._intervals=new Zr,this._intervals.changedEvent.addEventListener(__.prototype._intervalsChanged,this)}Object.defineProperties(__.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});__.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return d(n)&&typeof n.clone=="function"?n.clone(t):n};__.prototype.equals=function(e){return this===e||e instanceof __&&this._intervals.equals(e._intervals,H.equals)};__.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var y0=__;var DBn=T(S(),1);var XBn=T(S(),1);function QC(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new ye,this._normalize=g(t,!0),this.position=e}Object.defineProperties(QC.prototype,{isConstant:{get:function(){return H.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(d(t)&&this._subscription(),this._position=e,d(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var Xze=new h,vce=new h,wce=new te,eH=1/60;QC.prototype.getValue=function(e,t){return this._getValue(e,t)};QC.prototype._getValue=function(e,t,n){d(t)||(t=new h);let i=this._position;if(H.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,Xze),r=i.getValue(te.addSeconds(e,eH,wce),vce);if(!d(o)||!d(r)&&(r=o,o=i.getValue(te.addSeconds(e,-eH,wce),vce),!d(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);d(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,eH,t)};QC.prototype.equals=function(e){return this===e||e instanceof QC&&H.equals(this._position,e._position)};var T_=QC;function b2(e,t){this._velocityVectorProperty=new T_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new ye,this.ellipsoid=g(t,re.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(b2.prototype,{isConstant:{get:function(){return H.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Fce=new h,Ize=new h,Ace=new $;b2.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,Ize,Fce);if(d(n))return vt.rotationMatrixFromPositionVelocity(Fce,n,this._ellipsoid,Ace),Ae.fromRotationMatrix(Ace,t)};b2.prototype.equals=function(e){return this===e||e instanceof b2&&H.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var y2=b2;function yy(){}yy.packedLength=h.packedLength;yy.unpack=h.unpack;yy.pack=h.pack;var tH;function g2(e,t){return t[0]==="#"&&(t=tH+t),p0.fromString(e,t)}function Mce(e,t,n){if(d(n.reference))return g2(t,n.reference);if(d(n.velocityReference)){let i=g2(t,n.velocityReference);switch(e){case h:case yy:return new T_(i,e===yy);case Ae:return new y2(i)}}throw new me(`${JSON.stringify(n)} is not valid CZML.`)}function Wze(e,t){return new fm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Ni=new h,Mc=new p2,nc=new he,S_=new Tn,Y5=new Ae;function Pze(e){let t=e.rgbaf;if(d(t))return t;let n=e.rgba;if(!d(n))return;let i=n.length;if(i===B.packedLength)return[B.byteToFloat(n[0]),B.byteToFloat(n[1]),B.byteToFloat(n[2]),B.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=B.byteToFloat(n[o+1]),t[o+2]=B.byteToFloat(n[o+2]),t[o+3]=B.byteToFloat(n[o+3]),t[o+4]=B.byteToFloat(n[o+4]);return t}function Nce(e,t){let n=g(e.uri,e);return d(t)?t.getDerivedResource({url:n}):Ee.createIfNeeded(n)}function vze(e){let t=e.wsen;if(d(t))return t;let n=e.wsenDegrees;if(!d(n))return;let i=n.length;if(i===de.packedLength)return[W.toRadians(n[0]),W.toRadians(n[1]),W.toRadians(n[2]),W.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=W.toRadians(n[o+1]),t[o+2]=W.toRadians(n[o+2]),t[o+3]=W.toRadians(n[o+3]),t[o+4]=W.toRadians(n[o+4]);return t}function wze(e){let t=e.length;if(Mc.magnitude=1,t===2)return Mc.clock=e[0],Mc.cone=e[1],h.fromSpherical(Mc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],Mc.clock=e[i+1],Mc.cone=e[i+2],h.fromSpherical(Mc,Ni),n[o+1]=Ni.x,n[o+2]=Ni.y,n[o+3]=Ni.z;return n}function Fze(e){let t=e.length;if(t===3)return Mc.clock=e[0],Mc.cone=e[1],Mc.magnitude=e[2],h.fromSpherical(Mc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Mc.clock=e[i+1],Mc.cone=e[i+2],Mc.magnitude=e[i+3],h.fromSpherical(Mc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function Aze(e){let t=e.length;if(t===3)return nc.longitude=e[0],nc.latitude=e[1],nc.height=e[2],re.WGS84.cartographicToCartesian(nc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],nc.longitude=e[i+1],nc.latitude=e[i+2],nc.height=e[i+3],re.WGS84.cartographicToCartesian(nc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function Mze(e){let t=e.length;if(t===3)return nc.longitude=W.toRadians(e[0]),nc.latitude=W.toRadians(e[1]),nc.height=e[2],re.WGS84.cartographicToCartesian(nc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],nc.longitude=W.toRadians(e[i+1]),nc.latitude=W.toRadians(e[i+2]),nc.height=e[i+3],re.WGS84.cartographicToCartesian(nc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function nH(e){let t=e.cartesian;if(d(t))return t;let n=e.cartesianVelocity;if(d(n))return n;let i=e.unitCartesian;if(d(i))return i;let o=e.unitSpherical;if(d(o))return wze(o);let r=e.spherical;if(d(r))return Fze(r);let s=e.cartographicRadians;if(d(s))return Aze(s);let a=e.cartographicDegrees;if(d(a))return Mze(a);throw new me(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Uce(e,t){h.unpack(e,t,Ni),h.normalize(Ni,Ni),h.pack(Ni,e,t)}function Nze(e){let t=nH(e);if(t.length===3)return Uce(t,0),t;for(let n=1;n<t.length;n+=4)Uce(t,n);return t}function kce(e,t){Ae.unpack(e,t,Y5),Ae.normalize(Y5,Y5),Ae.pack(Y5,e,t)}function Uze(e){let t=e.unitQuaternion;if(d(t)){if(t.length===4)return kce(t,0),t;for(let n=1;n<t.length;n+=5)kce(t,n)}return t}function Dce(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?He:e.hasOwnProperty("cartesian2")?D:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?yy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?B:e.hasOwnProperty("arcType")?Jt:e.hasOwnProperty("classificationType")?kn:e.hasOwnProperty("colorBlendMode")?Ha:e.hasOwnProperty("cornerType")?Ii:e.hasOwnProperty("heightReference")?Ke:e.hasOwnProperty("horizontalOrigin")?bi:e.hasOwnProperty("date")?te:e.hasOwnProperty("labelStyle")?vo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Pt:e.hasOwnProperty("distanceDisplayCondition")?Gt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ae:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Om:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?de:e.hasOwnProperty("uri")?_2.default:e.hasOwnProperty("verticalOrigin")?In:Object}function kze(e,t,n){switch(e){case Jt:return Jt[g(t.arcType,t)];case Array:return t.array;case Boolean:return g(t.boolean,t);case He:return t.boundingRectangle;case D:return t.cartesian2;case h:return nH(t);case yy:return Nze(t);case B:return Pze(t);case kn:return kn[g(t.classificationType,t)];case Ha:return Ha[g(t.colorBlendMode,t)];case Ii:return Ii[g(t.cornerType,t)];case Ke:return Ke[g(t.heightReference,t)];case bi:return bi[g(t.horizontalOrigin,t)];case Image:return Nce(t,n);case te:return te.fromIso8601(g(t.date,t));case vo:return vo[g(t.labelStyle,t)];case Number:return g(t.number,t);case Pt:return t.nearFarScalar;case Gt:return t.distanceDisplayCondition;case Object:return g(g(t.object,t.value),t);case Ae:return Uze(t);case Vu:return g(t.number,t);case xn:return xn[g(g(t.shadowMode,t.shadows),t)];case String:return g(t.string,t);case Om:return Om[g(t.stripeOrientation,t)];case de:return vze(t);case _2.default:return Nce(t,n);case In:return In[g(t.verticalOrigin,t)];default:throw new me(e)}}var Dze={HERMITE:h2,LAGRANGE:f2,LINEAR:y_};function O5(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(d(n)||d(i))&&t.setInterpolationOptions({interpolationAlgorithm:Dze[n],interpolationDegree:i});let o=e.forwardExtrapolationType;d(o)&&(t.forwardExtrapolationType=ld[o]);let r=e.forwardExtrapolationDuration;d(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;d(s)&&(t.backwardExtrapolationType=ld[s]);let a=e.backwardExtrapolationDuration;d(a)&&(t.backwardExtrapolationDuration=a)}var Bce={iso8601:void 0};function or(e){if(d(e))return Bce.iso8601=e,Tn.fromIso8601(Bce)}function iH(e){let t=Ye.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Yce(e){let t=new $a;return t.intervals.addInterval(iH(e)),t}function Oce(e){let t=new Js(e.referenceFrame);return t.intervals.addInterval(iH(e)),t}function K5(e,t,n,i,o,r,s){let a=or(i.interval);d(o)&&(d(a)?a=Tn.intersect(a,o,S_):a=o);let c,l,u,m=!d(i.reference)&&!d(i.velocityReference),p=d(a)&&!a.equals(Ye.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return nle(t[n],a)}let y=!1;if(m){if(l=kze(e,i,r),!d(l))return;c=g(e.packedLength,1),u=g(l.length,1),y=!d(i.array)&&typeof l!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==Vu;if(!y&&!p){m?t[n]=new qn(f?e.unpack(l,0):l):t[n]=Mce(e,s,i);return}let x=t[n],_,C=i.epoch;if(d(C)&&(_=te.fromIso8601(C)),y&&!p){x instanceof ud||(t[n]=x=new ud(e)),x.addSamplesPackedArray(l,_),O5(i,x);return}let V;if(!y&&p){a=a.clone(),m?a.data=f?e.unpack(l,0):l:a.data=Mce(e,s,i),d(x)||(t[n]=x=m?new y0:new $a),m&&x instanceof y0?x.intervals.addInterval(a):x instanceof $a?(m&&(a.data=new qn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Yce(x),m&&(a.data=new qn(a.data)),x.intervals.addInterval(a));return}d(x)||(t[n]=x=new $a),x instanceof $a||(t[n]=x=Yce(x));let L=x.intervals;V=L.findInterval(a),(!d(V)||!(V.data instanceof ud))&&(V=a.clone(),V.data=new ud(e),L.addInterval(V)),V.data.addSamplesPackedArray(l,_),O5(i,V.data)}function nle(e,t){if(e instanceof ud){e.removeSamples(t);return}else if(e instanceof y0){e.intervals.removeInterval(t);return}else if(e instanceof $a){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Tn.intersect(n.get(i),t,S_);o.isEmpty||nle(o.data,t)}n.removeInterval(t);return}}function ge(e,t,n,i,o,r,s){if(d(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)K5(e,t,n,i[a],o,r,s);else K5(e,t,n,i,o,r,s)}function Kce(e,t,n,i,o,r){let s=or(n.interval);d(i)&&(d(s)?s=Tn.intersect(s,i,S_):s=i);let a=d(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),l,u,m=!d(n.reference),p=d(s)&&!s.equals(Ye.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return ile(e[t],s)}let y,f=!1;if(m&&(d(n.referenceFrame)&&(y=io[n.referenceFrame]),y=g(y,io.FIXED),l=nH(n),u=g(l.length,1),f=u>c),!f&&!p){m?e[t]=new Gc(h.unpack(l),y):e[t]=g2(r,n.reference);return}let x=e[t],_,C=n.epoch;if(d(C)&&(_=te.fromIso8601(C)),f&&!p){(!(x instanceof js)||d(y)&&x.referenceFrame!==y)&&(e[t]=x=new js(y,a)),x.addSamplesPackedArray(l,_),O5(n,x);return}let V;if(!f&&p){s=s.clone(),m?s.data=h.unpack(l):s.data=g2(r,n.reference),d(x)||(m?x=new b0(y):x=new Js(y),e[t]=x),m&&x instanceof b0&&d(y)&&x.referenceFrame===y?x.intervals.addInterval(s):x instanceof Js?(m&&(s.data=new Gc(s.data,y)),x.intervals.addInterval(s)):(e[t]=x=Oce(x),m&&(s.data=new Gc(s.data,y)),x.intervals.addInterval(s));return}d(x)?x instanceof Js||(e[t]=x=Oce(x)):e[t]=x=new Js(y);let L=x.intervals;V=L.findInterval(s),(!d(V)||!(V.data instanceof js)||d(y)&&V.data.referenceFrame!==y)&&(V=s.clone(),V.data=new js(y,a),L.addInterval(V)),V.data.addSamplesPackedArray(l,_),O5(n,V.data)}function ile(e,t){if(e instanceof js){e.removeSamples(t);return}else if(e instanceof b0){e.intervals.removeInterval(t);return}else if(e instanceof Js){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Tn.intersect(n.get(i),t,S_);o.isEmpty||ile(o.data,t)}n.removeInterval(t);return}}function ole(e,t,n,i,o,r){if(d(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Kce(e,t,n[s],i,o,r);else Kce(e,t,n,i,o,r)}function Hce(e,t,n,i){d(n.references)?H5(e,t,n.references,n.interval,i,HC,$a):(d(n.cartesian2)?n.array=D.unpackArray(n.cartesian2):d(n.cartesian)&&(n.array=D.unpackArray(n.cartesian)),d(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function zce(e,t,n,i,o,r){let s=or(n.interval);d(i)&&(d(s)?s=Tn.intersect(s,i,S_):s=i);let a=e[t],c,l;if(d(s)){a instanceof EC||(a=new EC,e[t]=a);let m=a.intervals;l=m.findInterval({start:s.start,stop:s.stop}),d(l)?c=l.data:(l=s.clone(),m.addInterval(l))}else c=a;let u;d(n.solidColor)?(c instanceof At||(c=new At),u=n.solidColor,ge(B,c,"color",u.color,void 0,void 0,r)):d(n.grid)?(c instanceof NC||(c=new NC),u=n.grid,ge(B,c,"color",u.color,void 0,o,r),ge(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),ge(D,c,"lineCount",u.lineCount,void 0,o,r),ge(D,c,"lineThickness",u.lineThickness,void 0,o,r),ge(D,c,"lineOffset",u.lineOffset,void 0,o,r)):d(n.image)?(c instanceof bb||(c=new bb),u=n.image,ge(Image,c,"image",u.image,void 0,o,r),ge(D,c,"repeat",u.repeat,void 0,o,r),ge(B,c,"color",u.color,void 0,o,r),ge(Boolean,c,"transparent",u.transparent,void 0,o,r)):d(n.stripe)?(c instanceof JC||(c=new JC),u=n.stripe,ge(Om,c,"orientation",u.orientation,void 0,o,r),ge(B,c,"evenColor",u.evenColor,void 0,o,r),ge(B,c,"oddColor",u.oddColor,void 0,o,r),ge(Number,c,"offset",u.offset,void 0,o,r),ge(Number,c,"repeat",u.repeat,void 0,o,r)):d(n.polylineOutline)?(c instanceof fy||(c=new fy),u=n.polylineOutline,ge(B,c,"color",u.color,void 0,o,r),ge(B,c,"outlineColor",u.outlineColor,void 0,o,r),ge(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):d(n.polylineGlow)?(c instanceof OC||(c=new OC),u=n.polylineGlow,ge(B,c,"color",u.color,void 0,o,r),ge(Number,c,"glowPower",u.glowPower,void 0,o,r),ge(Number,c,"taperPower",u.taperPower,void 0,o,r)):d(n.polylineArrow)?(c instanceof kC||(c=new kC),u=n.polylineArrow,ge(B,c,"color",u.color,void 0,void 0,r)):d(n.polylineDash)?(c instanceof BC||(c=new BC),u=n.polylineDash,ge(B,c,"color",u.color,void 0,void 0,r),ge(B,c,"gapColor",u.gapColor,void 0,void 0,r),ge(Number,c,"dashLength",u.dashLength,void 0,o,r),ge(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):d(n.checkerboard)&&(c instanceof ZC||(c=new ZC),u=n.checkerboard,ge(B,c,"evenColor",u.evenColor,void 0,o,r),ge(B,c,"oddColor",u.oddColor,void 0,o,r),ge(D,c,"repeat",u.repeat,void 0,o,r)),d(l)?l.data=c:e[t]=c}function md(e,t,n,i,o,r){if(d(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)zce(e,t,n[s],i,o,r);else zce(e,t,n,i,o,r)}function Bze(e,t,n,i){let o=t.name;d(o)&&(e.name=t.name)}function Yze(e,t,n,i){let o=t.description;d(o)&&ge(String,e,"description",o,void 0,i,n)}function Oze(e,t,n,i){let o=t.position;d(o)&&ole(e,"position",o,void 0,i,n)}function Kze(e,t,n,i){let o=t.viewFrom;d(o)&&ge(h,e,"viewFrom",o,void 0,i,n)}function Hze(e,t,n,i){let o=t.orientation;d(o)&&ge(Ae,e,"orientation",o,void 0,i,n)}function zze(e,t,n,i){let o=t.properties;if(d(o)){d(e.properties)||(e.properties=new ml);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)K5(Dce(s[a]),e.properties,r,s[a],void 0,i,n);else K5(Dce(s),e.properties,r,s,void 0,i,n)}}}function H5(e,t,n,i,o,r,s){let a=n.map(function(c){return g2(o,c)});if(d(i)){i=or(i);let c=e[t];if(!(c instanceof s)){let l=new s;l.intervals.addInterval(iH(c)),e[t]=c=l}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Jce(e,t,n,i){let o=n.references;d(o)?H5(e,t,o,n.interval,i,HC,$a):ge(Array,e,t,n,void 0,void 0,i)}function Qce(e,t,n,i){if(d(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Jce(e,t,n[o],i);else Jce(e,t,n,i)}function jce(e,t,n,i){let o=n.references;d(o)?H5(e,t,o,n.interval,i,f0,Js):(d(n.cartesian)?n.array=h.unpackArray(n.cartesian):d(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,re.WGS84):d(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,re.WGS84)),d(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function T2(e,t,n,i){if(d(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)jce(e,t,n[o],i);else jce(e,t,n,i)}function Jze(e){return h.unpackArray(e)}function Qze(e){return h.fromRadiansArrayHeights(e,re.WGS84)}function jze(e){return h.fromDegreesArrayHeights(e,re.WGS84)}function qce(e,t,n,i){let o=n.references;if(d(o)){let r=o.map(function(s){let a={};return H5(a,"positions",s,n.interval,i,f0,Js),a.positions});e[t]=new f0(r)}else d(n.cartesian)?n.array=n.cartesian.map(Jze):d(n.cartographicRadians)?n.array=n.cartographicRadians.map(Qze):d(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(jze)),d(n.array)&&ge(Array,e,t,n,void 0,void 0,i)}function qze(e,t,n,i){if(d(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)qce(e,t,n[o],i);else qce(e,t,n,i)}function $ze(e,t,n,i){if(d(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Hce(e,t,n[o],i);else Hce(e,t,n,i)}function eJe(e,t,n,i){let o=t.availability;if(!d(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)d(r)||(r=new Zr),r.addInterval(or(o[s]));else r=new Zr,r.addInterval(or(o));e.availability=r}function tJe(e,t,n,i,o){d(t)&&ge(yy,e,"alignedAxis",t,n,i,o)}function nJe(e,t,n,i){let o=t.billboard;if(!d(o))return;let r=or(o.interval),s=e.billboard;d(s)||(e.billboard=s=new Ua),ge(Boolean,s,"show",o.show,r,i,n),ge(Image,s,"image",o.image,r,i,n),ge(Number,s,"scale",o.scale,r,i,n),ge(D,s,"pixelOffset",o.pixelOffset,r,i,n),ge(h,s,"eyeOffset",o.eyeOffset,r,i,n),ge(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ge(In,s,"verticalOrigin",o.verticalOrigin,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(B,s,"color",o.color,r,i,n),ge(Vu,s,"rotation",o.rotation,r,i,n),tJe(s,o.alignedAxis,r,i,n),ge(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Pt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ge(Pt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ge(Pt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ge(He,s,"imageSubRegion",o.imageSubRegion,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function iJe(e,t,n,i){let o=t.box;if(!d(o))return;let r=or(o.interval),s=e.box;d(s)||(e.box=s=new nx),ge(Boolean,s,"show",o.show,r,i,n),ge(h,s,"dimensions",o.dimensions,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function oJe(e,t,n,i){let o=t.corridor;if(!d(o))return;let r=or(o.interval),s=e.corridor;d(s)||(e.corridor=s=new ox),ge(Boolean,s,"show",o.show,r,i,n),T2(s,"positions",o.positions,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(Ii,s,"cornerType",o.cornerType,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(kn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function rJe(e,t,n,i){let o=t.cylinder;if(!d(o))return;let r=or(o.interval),s=e.cylinder;d(s)||(e.cylinder=s=new rx),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"length",o.length,r,i,n),ge(Number,s,"topRadius",o.topRadius,r,i,n),ge(Number,s,"bottomRadius",o.bottomRadius,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ge(Number,s,"slices",o.slices,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function sJe(e,t){let n=e.version;if(d(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new me("Cesium only supports CZML version 1.");t._version=n}}if(!d(t._version))throw new me("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;d(e.name)&&(i.name=e.name);let o=e.clock;if(d(o)){let r=i.clock;d(r)?(r.interval=g(o.interval,r.interval),r.currentTime=g(o.currentTime,r.currentTime),r.range=g(o.range,r.range),r.step=g(o.step,r.step),r.multiplier=g(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function aJe(e,t,n,i){let o=t.ellipse;if(!d(o))return;let r=or(o.interval),s=e.ellipse;d(s)||(e.ellipse=s=new sx),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),ge(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(Vu,s,"rotation",o.rotation,r,i,n),ge(Vu,s,"stRotation",o.stRotation,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(kn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function cJe(e,t,n,i){let o=t.ellipsoid;if(!d(o))return;let r=or(o.interval),s=e.ellipsoid;d(s)||(e.ellipsoid=s=new ax),ge(Boolean,s,"show",o.show,r,i,n),ge(h,s,"radii",o.radii,r,i,n),ge(h,s,"innerRadii",o.innerRadii,r,i,n),ge(Number,s,"minimumClock",o.minimumClock,r,i,n),ge(Number,s,"maximumClock",o.maximumClock,r,i,n),ge(Number,s,"minimumCone",o.minimumCone,r,i,n),ge(Number,s,"maximumCone",o.maximumCone,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"stackPartitions",o.stackPartitions,r,i,n),ge(Number,s,"slicePartitions",o.slicePartitions,r,i,n),ge(Number,s,"subdivisions",o.subdivisions,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function lJe(e,t,n,i){let o=t.label;if(!d(o))return;let r=or(o.interval),s=e.label;d(s)||(e.label=s=new um),ge(Boolean,s,"show",o.show,r,i,n),ge(String,s,"text",o.text,r,i,n),ge(String,s,"font",o.font,r,i,n),ge(vo,s,"style",o.style,r,i,n),ge(Number,s,"scale",o.scale,r,i,n),ge(Boolean,s,"showBackground",o.showBackground,r,i,n),ge(B,s,"backgroundColor",o.backgroundColor,r,i,n),ge(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),ge(D,s,"pixelOffset",o.pixelOffset,r,i,n),ge(h,s,"eyeOffset",o.eyeOffset,r,i,n),ge(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ge(In,s,"verticalOrigin",o.verticalOrigin,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(B,s,"fillColor",o.fillColor,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Pt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ge(Pt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ge(Pt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function dJe(e,t,n,i){let o=t.model;if(!d(o))return;let r=or(o.interval),s=e.model;d(s)||(e.model=s=new mp),ge(Boolean,s,"show",o.show,r,i,n),ge(_2.default,s,"uri",o.gltf,r,i,n),ge(Number,s,"scale",o.scale,r,i,n),ge(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),ge(Number,s,"maximumScale",o.maximumScale,r,i,n),ge(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),ge(Boolean,s,"runAnimations",o.runAnimations,r,i,n),ge(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(B,s,"silhouetteColor",o.silhouetteColor,r,i,n),ge(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),ge(B,s,"color",o.color,r,i,n),ge(Ha,s,"colorBlendMode",o.colorBlendMode,r,i,n),ge(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,l=o.nodeTransformations;if(d(l))if(Array.isArray(l))for(a=0,c=l.length;a<c;++a)$ce(s,l[a],r,i,n);else $ce(s,l,r,i,n);let u=o.articulations;if(d(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)ele(s,u[a],r,i,n);else ele(s,u,r,i,n)}function $ce(e,t,n,i,o){let r=or(t.interval);d(n)&&(d(r)?r=Tn.intersect(r,n,S_):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,l=a.length;c<l;++c){let u=a[c];if(u==="interval")continue;let m=t[u];if(!d(m))continue;d(s)||(e.nodeTransformations=s=new ml),s.hasProperty(u)||s.addProperty(u);let p=s[u];d(p)||(s[u]=p=new cx),ge(h,p,"translation",m.translation,r,i,o),ge(Ae,p,"rotation",m.rotation,r,i,o),ge(h,p,"scale",m.scale,r,i,o)}}function ele(e,t,n,i,o){let r=or(t.interval);d(n)&&(d(r)?r=Tn.intersect(r,n,S_):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,l=a.length;c<l;++c){let u=a[c];if(u==="interval")continue;let m=t[u];d(m)&&(d(s)||(e.articulations=s=new ml),s.hasProperty(u)||s.addProperty(u),ge(Number,s,u,m,r,i,o))}}function uJe(e,t,n,i){let o=t.path;if(!d(o))return;let r=or(o.interval),s=e.path;d(s)||(e.path=s=new hp),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"leadTime",o.leadTime,r,i,n),ge(Number,s,"trailTime",o.trailTime,r,i,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"resolution",o.resolution,r,i,n),md(s,"material",o.material,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function mJe(e,t,n,i){let o=t.point;if(!d(o))return;let r=or(o.interval),s=e.point;d(s)||(e.point=s=new dx),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"pixelSize",o.pixelSize,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(B,s,"color",o.color,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Pt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ge(Pt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function x2(e){this.polygon=e,this._definitionChanged=new ye}Object.defineProperties(x2.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!d(e)||e.isConstant)&&(!d(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});x2.prototype.getValue=function(e,t){let n;d(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return d(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),d(i)&&(i=i.map(function(o){return new fa(o)}))),d(t)?(t.positions=n,t.holes=i,t):new fa(n,i)};x2.prototype.equals=function(e){return this===e||e instanceof x2&&H.equals(this.polygon._positions,e.polygon._positions)&&H.equals(this.polygon._holes,e.polygon._holes)};function hJe(e,t,n,i){let o=t.polygon;if(!d(o))return;let r=or(o.interval),s=e.polygon;d(s)||(e.polygon=s=new mm),ge(Boolean,s,"show",o.show,r,i,n),T2(s,"_positions",o.positions,n),qze(s,"_holes",o.holes,n),(d(s._positions)||d(s._holes))&&(s.hierarchy=new x2(s)),ge(Number,s,"height",o.height,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(Vu,s,"stRotation",o.stRotation,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),ge(Boolean,s,"closeTop",o.closeTop,r,i,n),ge(Boolean,s,"closeBottom",o.closeBottom,r,i,n),ge(Jt,s,"arcType",o.arcType,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(kn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function fJe(e){return e?Jt.GEODESIC:Jt.NONE}function pJe(e,t,n,i){let o=t.polyline;if(!d(o))return;let r=or(o.interval),s=e.polyline;if(d(s)||(e.polyline=s=new Ba),ge(Boolean,s,"show",o.show,r,i,n),T2(s,"positions",o.positions,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),md(s,"material",o.material,r,i,n),md(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),ge(Jt,s,"arcType",o.arcType,r,i,n),ge(Boolean,s,"clampToGround",o.clampToGround,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(kn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n),d(o.followSurface)&&!d(o.arcType)){let a={};ge(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Wze(a.followSurface,fJe)}}function bJe(e,t,n,i){let o=t.polylineVolume;if(!d(o))return;let r=or(o.interval),s=e.polylineVolume;d(s)||(e.polylineVolume=s=new ux),T2(s,"positions",o.positions,n),$ze(s,"shape",o.shape,n),ge(Boolean,s,"show",o.show,r,i,n),ge(Ii,s,"cornerType",o.cornerType,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function yJe(e,t,n,i){let o=t.rectangle;if(!d(o))return;let r=or(o.interval),s=e.rectangle;d(s)||(e.rectangle=s=new hm),ge(Boolean,s,"show",o.show,r,i,n),ge(de,s,"coordinates",o.coordinates,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Ke,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(Vu,s,"rotation",o.rotation,r,i,n),ge(Vu,s,"stRotation",o.stRotation,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(kn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function gJe(e,t,n,i){let o=t.tileset;if(!d(o))return;let r=or(o.interval),s=e.tileset;d(s)||(e.tileset=s=new lx),ge(Boolean,s,"show",o.show,r,i,n),ge(_2.default,s,"uri",o.uri,r,i,n),ge(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function xJe(e,t,n,i){let o=t.wall;if(!d(o))return;let r=or(o.interval),s=e.wall;d(s)||(e.wall=s=new fp),ge(Boolean,s,"show",o.show,r,i,n),T2(s,"positions",o.positions,n),Qce(s,"minimumHeights",o.minimumHeights,n),Qce(s,"maximumHeights",o.maximumHeights,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),md(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(B,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(xn,s,"shadows",o.shadows,r,i,n),ge(Gt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function tle(e,t,n,i,o){let r=e.id;if(d(r)||(r=Yn()),tH=r,!d(o._version)&&r!=="document")throw new me("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")sJe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;d(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}tH=void 0}function _Je(e){let t,n=e._documentPacket.clock;if(!d(n)){if(!d(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ye.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=te.secondsDifference(s,r),c=Math.round(a/120);return t=new Bm,t.startTime=te.clone(r),t.stopTime=te.clone(s),t.clockRange=Xr.LOOP_STOP,t.multiplier=c,t.currentTime=te.clone(r),t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}d(e._clock)?t=e._clock.clone():(t=new Bm,t.startTime=Ye.MINIMUM_VALUE.clone(),t.stopTime=Ye.MAXIMUM_VALUE.clone(),t.currentTime=Ye.MINIMUM_VALUE.clone(),t.clockRange=Xr.LOOP_STOP,t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=or(n.interval);return d(i)&&(t.startTime=i.start,t.stopTime=i.stop),d(n.currentTime)&&(t.currentTime=te.fromIso8601(n.currentTime)),d(n.range)&&(t.clockRange=g(Xr[n.range],Xr.LOOP_STOP)),d(n.step)&&(t.clockStep=g(mo[n.step],mo.SYSTEM_CLOCK_MULTIPLIER)),d(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function rle(e,t,n,i){n=g(n,g.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new St(s)),e._credit=s,typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),o=t.fetchJson(),r=g(r,t.clone());let a=e._resourceCredits,c=t.credits;if(d(c)){let l=c.length;for(let u=0;u<l;u++)a.push(c[u])}}return r=Ee.createIfNeeded(r),Gr.setLoading(e,!0),Promise.resolve(o).then(function(a){return TJe(e,a,r,i)}).catch(function(a){return Gr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function TJe(e,t,n,i){Gr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new sle,o.removeAll()),Rl._processCzml(t,o,n,void 0,e);let r=_Je(e),s=e._documentPacket;return d(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!d(e._name)&&d(n)&&(e._name=m0(n.getUrlComponent()),r=!0),Gr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function sle(){this.name=void 0,this.clock=void 0}function Rl(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._clock=void 0,this._documentPacket=new sle,this._version=void 0,this._entityCollection=new Es(this),this._entityCluster=new ad,this._credit=void 0,this._resourceCredits=[]}Rl.load=function(e,t){return new Rl().load(e,t)};Object.defineProperties(Rl.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Rl.updaters=[nJe,iJe,oJe,rJe,aJe,cJe,lJe,dJe,Bze,Yze,uJe,mJe,hJe,pJe,bJe,zze,yJe,Oze,gJe,Kze,xJe,Hze,eJe];Rl.prototype.process=function(e,t){return rle(this,e,t,!1)};Rl.prototype.load=function(e,t){return rle(this,e,t,!0)};Rl.prototype.update=function(e){return!0};Rl.processPacketData=ge;Rl.processPositionPacketData=ole;Rl.processMaterialPacketData=md;Rl._processCzml=function(e,t,n,i,o){if(i=g(i,Rl.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)tle(e[r],t,i,n,o);else tle(e,t,i,n,o)};var S2=Rl;var WYn=T(S(),1);function Nc(){this._dataSources=[],this._dataSourceAdded=new ye,this._dataSourceRemoved=new ye,this._dataSourceMoved=new ye}Object.defineProperties(Nc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Nc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Nc.prototype.remove=function(e,t){t=g(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Nc.prototype.removeAll=function(e){e=g(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};Nc.prototype.contains=function(e){return this.indexOf(e)!==-1};Nc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Nc.prototype.get=function(e){return this._dataSources[e]};Nc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function z5(e,t){return e.indexOf(t)}function ale(e,t,n){let i=e._dataSources,o=i.length-1;if(t=W.clamp(t,0,o),n=W.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Nc.prototype.raise=function(e){let t=z5(this._dataSources,e);ale(this,t,t+1)};Nc.prototype.lower=function(e){let t=z5(this._dataSources,e);ale(this,t,t-1)};Nc.prototype.raiseToTop=function(e){let t=z5(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Nc.prototype.lowerToBottom=function(e){let t=z5(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Nc.prototype.isDestroyed=function(){return!1};Nc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var C2=Nc;var Dei=T(S(),1);var OYn=T(S(),1);var NYn=T(S(),1);function qs(e){e=g(e,g.EMPTY_OBJECT),this._primitives=[],this._guid=Yn(),this._primitiveAdded=new ye,this._primitiveRemoved=new ye,this._zIndex=void 0,this.show=g(e.show,!0),this.destroyPrimitives=g(e.destroyPrimitives,!0)}Object.defineProperties(qs.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});qs.prototype.add=function(e,t){let n=d(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};qs.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};qs.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};qs.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};qs.prototype.contains=function(e){return!!(d(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function J5(e,t){return e._primitives.indexOf(t)}qs.prototype.raise=function(e){if(d(e)){let t=J5(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};qs.prototype.raiseToTop=function(e){if(d(e)){let t=J5(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};qs.prototype.lower=function(e){if(d(e)){let t=J5(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};qs.prototype.lowerToBottom=function(e){if(d(e)){let t=J5(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};qs.prototype.get=function(e){return this._primitives[e]};qs.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};qs.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];d(i.prePassesUpdate)&&i.prePassesUpdate(e)}};qs.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];d(o.updateForPass)&&o.updateForPass(e,t)}};qs.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];d(i.postPassesUpdate)&&i.postPassesUpdate(e)}};qs.prototype.isDestroyed=function(){return!1};qs.prototype.destroy=function(){return this.removeAll(),ue(this)};var Zl=qs;function rf(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(rf.prototype,{length:{get:function(){return this._length}}});rf.prototype.add=function(e,t){t=g(t,0);let n=this._collections[t];if(!d(n)){n=new Zl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};rf.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};rf.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};rf.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};rf.prototype.contains=function(e){if(!d(e))return!1;let t=this._collections[e._zIndex];return d(t)&&t.contains(e)};rf.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};rf.prototype.isDestroyed=function(){return!1};rf.prototype.destroy=function(){return this.removeAll(),ue(this)};var V2=rf;var l6n=T(S(),1);var QYn=T(S(),1);function jC(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Tt}jC.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};jC.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);d(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};jC.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};jC.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};jC.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),d(e)&&d(e.getBoundingSphere)?e.getBoundingSphere(t):lt.FAILED};var C_=jC;var mKn=T(S(),1);var ZOn=T(S(),1);var nOn=T(S(),1);var rH={},Q5=new h,cle=new h,lle=new Ae,dle=new $;function qC(e,t,n,i,o,r,s,a,c,l){let u=e+t;h.multiplyByScalar(i,Math.cos(u),Q5),h.multiplyByScalar(n,Math.sin(u),cle),h.add(Q5,cle,Q5);let m=Math.cos(e);m=m*m;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*m+o*p)/a;return Ae.fromAxisAngle(Q5,f,lle),$.fromQuaternion(lle,dle),$.multiplyByVector(dle,c,l),h.normalize(l,l),h.multiplyByScalar(l,a,l),l}var ule=new h,mle=new h,oH=new h,SJe=new h;rH.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,l=n?c:0;for(let u=0;u<c;u+=3){let m=u+1,p=u+2,y=h.fromArray(e,u,ule);i.scaleToGeodeticSurface(y,y);let f=h.clone(y,mle),x=i.geodeticSurfaceNormal(y,SJe),_=h.multiplyByScalar(x,o,oH);h.add(y,_,y),n&&(h.multiplyByScalar(x,r,_),h.add(f,_,f),a[u+l]=f.x,a[m+l]=f.y,a[p+l]=f.z),a[u]=y.x,a[m]=y.y,a[p]=y.z}return a};var CJe=new h,VJe=new h,LJe=new h;rH.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,l=o*o,u=o*i,m=h.magnitude(s),p=h.normalize(s,CJe),y=h.cross(h.UNIT_Z,s,VJe);y=h.normalize(y,y);let f=h.cross(p,y,LJe),x=1+Math.ceil(W.PI_OVER_TWO/a),_=W.PI_OVER_TWO/(x-1),C=W.PI_OVER_TWO-x*_;C<0&&(x-=Math.ceil(Math.abs(C)/_));let V=2*(x*(x+2)),L=t?new Array(V*3):void 0,Z=0,G=ule,X=mle,P=x*4*3,v=P-1,A=0,M=n?new Array(P):void 0,b,R,E,I,w;for(C=W.PI_OVER_TWO,G=qC(C,r,f,y,c,u,l,m,p,G),t&&(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z),n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x),C=W.PI_OVER_TWO-_,b=1;b<x+1;++b){if(G=qC(C,r,f,y,c,u,l,m,p,G),X=qC(Math.PI-C,r,f,y,c,u,l,m,p,X),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*b+2,R=1;R<E-1;++R)I=R/(E-1),w=h.lerp(G,X,I,oH),L[Z++]=w.x,L[Z++]=w.y,L[Z++]=w.z;L[Z++]=X.x,L[Z++]=X.y,L[Z++]=X.z}n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x,M[A++]=X.x,M[A++]=X.y,M[A++]=X.z),C=W.PI_OVER_TWO-(b+1)*_}for(b=x;b>1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,G=qC(-C,r,f,y,c,u,l,m,p,G),X=qC(C+Math.PI,r,f,y,c,u,l,m,p,X),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*(b-1)+2,R=1;R<E-1;++R)I=R/(E-1),w=h.lerp(G,X,I,oH),L[Z++]=w.x,L[Z++]=w.y,L[Z++]=w.z;L[Z++]=X.x,L[Z++]=X.y,L[Z++]=X.z}n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x,M[A++]=X.x,M[A++]=X.y,M[A++]=X.z)}C=W.PI_OVER_TWO,G=qC(-C,r,f,y,c,u,l,m,p,G);let N={};return t&&(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,N.positions=L,N.numPts=x),n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x,N.outerPositions=M),N};var Gl=rH;var $C=new h,sH=new h,aH=new h,hle=new h,ds=new D,fle=new $,RJe=new $,cH=new Ae,ple=new h,ble=new h,yle=new h,$5=new he,gle=new h,xle=new D,_le=new D;function Tle(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,l=n?e.length/3*2:e.length/3,u=t.shadowVolume,m=i.st?new Float32Array(l*2):void 0,p=i.normal?new Float32Array(l*3):void 0,y=i.tangent?new Float32Array(l*3):void 0,f=i.bitangent?new Float32Array(l*3):void 0,x=u?new Float32Array(l*3):void 0,_=0,C=ple,V=ble,L=yle,Z=new Zi(a),G=Z.project(a.cartesianToCartographic(o,$5),gle),X=a.scaleToGeodeticSurface(o,$C);a.geodeticSurfaceNormal(X,X);let P=fle,v=RJe;if(c!==0){let w=Ae.fromAxisAngle(X,c,cH);P=$.fromQuaternion(w,P),w=Ae.fromAxisAngle(X,-c,cH),v=$.fromQuaternion(w,v)}else P=$.clone($.IDENTITY,P),v=$.clone($.IDENTITY,v);let A=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,xle),M=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,_le),b=e.length,R=n?b:0,E=R/3*2;for(let w=0;w<b;w+=3){let N=w+1,Y=w+2,k=h.fromArray(e,w,$C);if(i.st){let O=$.multiplyByVector(P,k,sH),U=Z.project(a.cartesianToCartographic(O,$5),aH);h.subtract(U,G,U),ds.x=(U.x+r)/(2*r),ds.y=(U.y+s)/(2*s),A.x=Math.min(ds.x,A.x),A.y=Math.min(ds.y,A.y),M.x=Math.max(ds.x,M.x),M.y=Math.max(ds.y,M.y),n&&(m[_+E]=ds.x,m[_+1+E]=ds.y),m[_++]=ds.x,m[_++]=ds.y}(i.normal||i.tangent||i.bitangent||u)&&(C=a.geodeticSurfaceNormal(k,C),u&&(x[w+R]=-C.x,x[N+R]=-C.y,x[Y+R]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=h.normalize(h.cross(h.UNIT_Z,C,V),V),$.multiplyByVector(v,V,V)),i.normal&&(p[w]=C.x,p[N]=C.y,p[Y]=C.z,n&&(p[w+R]=-C.x,p[N+R]=-C.y,p[Y+R]=-C.z)),i.tangent&&(y[w]=V.x,y[N]=V.y,y[Y]=V.z,n&&(y[w+R]=-V.x,y[N+R]=-V.y,y[Y+R]=-V.z)),i.bitangent&&(L=h.normalize(h.cross(C,V,L),L),f[w]=L.x,f[N]=L.y,f[Y]=L.z,n&&(f[w+R]=L.x,f[N+R]=L.y,f[Y+R]=L.z))))}if(i.st){b=m.length;for(let w=0;w<b;w+=2)m[w]=(m[w]-A.x)/(M.x-A.x),m[w+1]=(m[w+1]-A.y)/(M.y-A.y)}let I=new hn;if(i.position){let w=Gl.raisePositionsToHeight(e,t,n);I.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:w})}if(i.st&&(I.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(I.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),i.bitangent&&(I.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),u&&(I.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),n&&d(t.offsetAttribute)){let w=new Uint8Array(l);if(t.offsetAttribute===rn.TOP)w=w.fill(1,0,l/2);else{let N=t.offsetAttribute===rn.NONE?0:1;w=w.fill(N)}I.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}return I}function Sle(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var V_=new h;function ZJe(e){let t=e.center;V_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,V_),e.height,V_),V_=h.add(t,V_,V_);let n=new ce(V_,e.semiMajorAxis),i=Gl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Tle(o,e,!1),a=Sle(r);return a=Ue.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function GJe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,l=t.stRotation,u=e.length/3*2,m=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,y=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,x=n.bitangent?new Float32Array(u*3):void 0,_=t.shadowVolume,C=_?new Float32Array(u*3):void 0,V=0,L=ple,Z=ble,G=yle,X=new Zi(s),P=X.project(s.cartesianToCartographic(i,$5),gle),v=s.scaleToGeodeticSurface(i,$C);s.geodeticSurfaceNormal(v,v);let A=Ae.fromAxisAngle(v,l,cH),M=$.fromQuaternion(A,fle),b=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,xle),R=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,_le),E=e.length,I=E/3*2;for(let N=0;N<E;N+=3){let Y=N+1,k=N+2,O=h.fromArray(e,N,$C),U;if(n.st){let z=$.multiplyByVector(M,O,sH),ee=X.project(s.cartesianToCartographic(z,$5),aH);h.subtract(ee,P,ee),ds.x=(ee.x+o)/(2*o),ds.y=(ee.y+r)/(2*r),b.x=Math.min(ds.x,b.x),b.y=Math.min(ds.y,b.y),R.x=Math.max(ds.x,R.x),R.y=Math.max(ds.y,R.y),p[V+I]=ds.x,p[V+1+I]=ds.y,p[V++]=ds.x,p[V++]=ds.y}O=s.scaleToGeodeticSurface(O,O),U=h.clone(O,sH),L=s.geodeticSurfaceNormal(O,L),_&&(C[N+E]=-L.x,C[Y+E]=-L.y,C[k+E]=-L.z);let J=h.multiplyByScalar(L,a,hle);if(O=h.add(O,J,O),J=h.multiplyByScalar(L,c,J),U=h.add(U,J,U),n.position&&(m[N+E]=U.x,m[Y+E]=U.y,m[k+E]=U.z,m[N]=O.x,m[Y]=O.y,m[k]=O.z),n.normal||n.tangent||n.bitangent){G=h.clone(L,G);let z=h.fromArray(e,(N+3)%E,hle);h.subtract(z,O,z);let ee=h.subtract(U,O,aH);L=h.normalize(h.cross(ee,z,L),L),n.normal&&(y[N]=L.x,y[Y]=L.y,y[k]=L.z,y[N+E]=L.x,y[Y+E]=L.y,y[k+E]=L.z),n.tangent&&(Z=h.normalize(h.cross(G,L,Z),Z),f[N]=Z.x,f[Y]=Z.y,f[k]=Z.z,f[N+E]=Z.x,f[N+1+E]=Z.y,f[N+2+E]=Z.z),n.bitangent&&(x[N]=G.x,x[Y]=G.y,x[k]=G.z,x[N+E]=G.x,x[Y+E]=G.y,x[k+E]=G.z)}}if(n.st){E=p.length;for(let N=0;N<E;N+=2)p[N]=(p[N]-b.x)/(R.x-b.x),p[N+1]=(p[N+1]-b.y)/(R.y-b.y)}let w=new hn;if(n.position&&(w.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})),n.st&&(w.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(w.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),n.tangent&&(w.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(w.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),_&&(w.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),d(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===rn.TOP)N=N.fill(1,0,u/2);else{let Y=t.offsetAttribute===rn.NONE?0:1;N=N.fill(Y)}w.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return w}function EJe(e){let t=e.length/3,n=Ue.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var j5=new ce,q5=new ce;function XJe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,$C),e.height,$C);j5.center=h.add(t,o,j5.center),j5.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),q5.center=h.add(t,o,q5.center),q5.radius=i;let r=Gl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,l=ce.union(j5,q5),u=Tle(s,e,!0),m=Sle(a),p=m.length;m.length=p*2;let y=s.length/3;for(let Z=0;Z<p;Z+=3)m[Z+p]=m[Z+2]+y,m[Z+1+p]=m[Z+1]+y,m[Z+2+p]=m[Z]+y;let f=Ue.createTypedArray(y*2/3,m),x=new dt({attributes:u,indices:f,primitiveType:Fe.TRIANGLES}),_=GJe(c,e);m=EJe(c);let C=Ue.createTypedArray(c.length*2/3,m),V=new dt({attributes:_,indices:C,primitiveType:Fe.TRIANGLES}),L=An.combineInstances([new _t({geometry:x}),new _t({geometry:V})]);return{boundingSphere:l,attributes:L[0].attributes,indices:L[0].indices}}function Cle(e,t,n,i,o,r,s){let c=Gl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,l=c.length/3,u=new Array(l);for(let p=0;p<l;++p)u[p]=h.fromArray(c,p*3);let m=de.fromCartesianArray(u,r,s);return m.width>W.PI&&(m.north=m.north>0?W.PI_OVER_TWO-W.EPSILON7:m.north,m.south=m.south<0?W.EPSILON7-W.PI_OVER_TWO:m.south,m.east=W.PI,m.west=-W.PI),m}function af(e){e=g(e,g.EMPTY_OBJECT);let t=e.center,n=g(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=g(e.granularity,W.RADIANS_PER_DEGREE),s=g(e.vertexFormat,We.DEFAULT),a=g(e.height,0),c=g(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=re.clone(n),this._rotation=g(e.rotation,0),this._stRotation=g(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=We.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}af.packedLength=h.packedLength+re.packedLength+We.packedLength+9;af.pack=function(e,t,n){return n=g(n,0),h.pack(e._center,t,n),n+=h.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=g(e._offsetAttribute,-1),t};var Vle=new h,Lle=new re,Rle=new We,sf={center:Vle,ellipsoid:Lle,vertexFormat:Rle,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};af.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Vle);t+=h.packedLength;let o=re.unpack(e,t,Lle);t+=re.packedLength;let r=We.unpack(e,t,Rle);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t++],p=e[t++],y=e[t++]===1,f=e[t];return d(n)?(n._center=h.clone(i,n._center),n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=l,n._height=u,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=y,n._offsetAttribute=f===-1?void 0:f,n):(sf.height=u,sf.extrudedHeight=p,sf.granularity=m,sf.stRotation=l,sf.rotation=c,sf.semiMajorAxis=s,sf.semiMinorAxis=a,sf.shadowVolume=y,sf.offsetAttribute=f===-1?void 0:f,new af(sf))};af.computeRectangle=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.center,i=g(e.ellipsoid,re.WGS84),o=e.semiMajorAxis,r=e.semiMinorAxis,s=g(e.granularity,W.RADIANS_PER_DEGREE),a=g(e.rotation,0);return Cle(n,o,r,a,s,i,t)};af.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=XJe(o);else if(r=ZJe(o),d(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===rn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:Fe.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};af.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new af({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};function IJe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Gl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return dt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(af.prototype,{rectangle:{get:function(){return d(this._rectangle)||(this._rectangle=Cle(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return d(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=IJe(this)),this._textureCoordinateRotationPoints}}});var Uc=af;var BOn=T(S(),1);var Zle=new h,L_=new h;function WJe(e){let t=e.center;L_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,L_),e.height,L_),L_=h.add(t,L_,L_);let n=new ce(L_,e.semiMajorAxis),i=Gl.computeEllipsePositions(e,!1,!0).outerPositions,o=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Gl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ue.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var eN=new ce,tN=new ce;function PJe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Zle),e.height,Zle);eN.center=h.add(t,o,eN.center),eN.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),tN.center=h.add(t,o,tN.center),tN.radius=i;let r=Gl.computeEllipsePositions(e,!1,!0).outerPositions,s=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Gl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ce.union(eN,tN),c=r.length/3;if(d(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===rn.TOP)f=f.fill(1,0,c/2);else{let x=e.offsetAttribute===rn.NONE?0:1;f=f.fill(x)}s.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let l=g(e.numberOfVerticalLines,16);l=W.clamp(l,0,c/2);let u=Ue.createTypedArray(c,c*2+l*2);c/=2;let m=0,p;for(p=0;p<c;++p)u[m++]=p,u[m++]=(p+1)%c,u[m++]=p+c,u[m++]=(p+1)%c+c;let y;if(l>0){let f=Math.min(l,c);y=Math.round(c/f);let x=Math.min(y*l,c);for(p=0;p<x;p+=y)u[m++]=p,u[m++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function e1(e){e=g(e,g.EMPTY_OBJECT);let t=e.center,n=g(e.ellipsoid,re.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=g(e.granularity,W.RADIANS_PER_DEGREE),s=g(e.height,0),a=g(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=re.clone(n),this._rotation=g(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(g(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}e1.packedLength=h.packedLength+re.packedLength+8;e1.pack=function(e,t,n){return n=g(n,0),h.pack(e._center,t,n),n+=h.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=g(e._offsetAttribute,-1),t};var Gle=new h,Ele=new re,g0={center:Gle,ellipsoid:Ele,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};e1.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Gle);t+=h.packedLength;let o=re.unpack(e,t,Ele);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t++],p=e[t];return d(n)?(n._center=h.clone(i,n._center),n._ellipsoid=re.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=l,n._extrudedHeight=u,n._numberOfVerticalLines=m,n._offsetAttribute=p===-1?void 0:p,n):(g0.height=c,g0.extrudedHeight=u,g0.granularity=l,g0.rotation=a,g0.semiMajorAxis=r,g0.semiMinorAxis=s,g0.numberOfVerticalLines=m,g0.offsetAttribute=p===-1?void 0:p,new e1(g0))};e1.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=PJe(o);else if(r=WJe(o),d(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===rn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:Fe.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var hd=e1;var Xle=new B,Ile=h.ZERO,Wle=new h,Ple=new de;function vJe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Km(e,t){Hn.call(this,{entity:e,scene:t,geometryOptions:new vJe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}d(Object.create)&&(Km.prototype=Object.create(Hn.prototype),Km.prototype.constructor=Km);Km.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof At){let o;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Xle)),d(o)||(o=B.WHITE),i.color=Ut.fromColor(o)}return d(this._options.offsetAttribute)&&(i.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,Ile,Wle))),new _t({id:t,geometry:new Uc(this._options),attributes:i})};Km.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Xle),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return d(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,Ile,Wle))),new _t({id:t,geometry:new hd(this._options),attributes:r})};Km.prototype._computeCenter=function(e,t){return H.getValueOrUndefined(this._entity.position,e,t)};Km.prototype._isHidden=function(e,t){let n=e.position;return!d(n)||!d(t.semiMajorAxis)||!d(t.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t)};Km.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!H.isConstant(t.rotation)||!H.isConstant(t.height)||!H.isConstant(t.extrudedHeight)||!H.isConstant(t.granularity)||!H.isConstant(t.stRotation)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.numberOfVerticalLines)||!H.isConstant(t.zIndex)||this._onTerrain&&!H.isConstant(this._materialProperty)&&!(this._materialProperty instanceof At)};Km.prototype._setStaticOptions=function(e,t){let n=H.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),i=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),o=H.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),r=H.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,Ke.NONE);d(o)&&!d(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof At?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ye.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ye.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ye.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=H.getValueOrUndefined(t.rotation,Ye.MINIMUM_VALUE),s.granularity=H.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),s.stRotation=H.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),s.numberOfVerticalLines=H.getValueOrUndefined(t.numberOfVerticalLines,Ye.MINIMUM_VALUE),s.offsetAttribute=Hn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Hn.getGeometryHeight(n,i),o=Hn.getGeometryExtrudedHeight(o,r),o===Hn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(Uc.computeRectangle(s,Ple)).minimumTerrainHeight),s.extrudedHeight=o};Km.DynamicGeometryUpdater=t1;function t1(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(t1.prototype=Object.create(ii.prototype),t1.prototype.constructor=t1);t1.prototype._isHidden=function(e,t,n){let i=this._options;return!d(i.center)||!d(i.semiMajorAxis)||!d(i.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t,n)};t1.prototype._setOptions=function(e,t,n){let i=this._options,o=H.getValueOrUndefined(t.height,n),r=H.getValueOrDefault(t.heightReference,n,Ke.NONE),s=H.getValueOrUndefined(t.extrudedHeight,n),a=H.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);d(s)&&!d(o)&&(o=0),i.center=H.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=H.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=H.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=H.getValueOrUndefined(t.rotation,n),i.granularity=H.getValueOrUndefined(t.granularity,n),i.stRotation=H.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=H.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Hn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Hn.getGeometryHeight(o,r),s=Hn.getGeometryExtrudedHeight(s,a),s===Hn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(Uc.computeRectangle(i,Ple)).minimumTerrainHeight),i.extrudedHeight=s};var L2=Km;var iHn=T(S(),1);var EKn=T(S(),1);var wJe=new h,FJe=new h,AJe=new h,MJe=new h,NJe=new h,UJe=new h(1,1,1),vle=Math.cos,wle=Math.sin;function x0(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.radii,UJe),n=g(e.innerRadii,t),i=g(e.minimumClock,0),o=g(e.maximumClock,W.TWO_PI),r=g(e.minimumCone,0),s=g(e.maximumCone,W.PI),a=Math.round(g(e.stackPartitions,64)),c=Math.round(g(e.slicePartitions,64)),l=g(e.vertexFormat,We.DEFAULT);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=We.clone(l),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}x0.packedLength=2*h.packedLength+We.packedLength+7;x0.pack=function(e,t,n){return n=g(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=g(e._offsetAttribute,-1),t};var Fle=new h,Ale=new h,Mle=new We,gy={radii:Fle,innerRadii:Ale,vertexFormat:Mle,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x0.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Fle);t+=h.packedLength;let o=h.unpack(e,t,Ale);t+=h.packedLength;let r=We.unpack(e,t,Mle);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t++],p=e[t];return d(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=We.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=l,n._stackPartitions=u,n._slicePartitions=m,n._offsetAttribute=p===-1?void 0:p,n):(gy.minimumClock=s,gy.maximumClock=a,gy.minimumCone=c,gy.maximumCone=l,gy.stackPartitions=u,gy.slicePartitions=m,gy.offsetAttribute=p===-1?void 0:p,new x0(gy))};x0.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,l=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/W.TWO_PI),l=Math.round(l*Math.abs(s-r)/W.PI),c<2&&(c=2),l<2&&(l=2);let u,m,p=0,y=[r],f=[i];for(u=0;u<l;u++)y.push(r+u*(s-r)/(l-1));for(y.push(s),m=0;m<c;m++)f.push(i+m*(o-i)/(c-1));f.push(o);let x=y.length,_=f.length,C=0,V=1,L=n.x!==t.x||n.y!==t.y||n.z!==t.z,Z=!1,G=!1,X=!1;L&&(V=2,r>0&&(Z=!0,C+=c-1),s<Math.PI&&(G=!0,C+=c-1),(o-i)%W.TWO_PI?(X=!0,C+=(l-1)*2+1):C+=1);let P=_*x*V,v=new Float64Array(P*3),A=new Array(P).fill(!1),M=new Array(P).fill(!1),b=c*l*V,R=6*(b+C+1-(c+l)*V),E=Ue.createTypedArray(b,R),I=a.normal?new Float32Array(P*3):void 0,w=a.tangent?new Float32Array(P*3):void 0,N=a.bitangent?new Float32Array(P*3):void 0,Y=a.st?new Float32Array(P*2):void 0,k=new Array(x),O=new Array(x);for(u=0;u<x;u++)k[u]=wle(y[u]),O[u]=vle(y[u]);let U=new Array(_),J=new Array(_);for(m=0;m<_;m++)J[m]=vle(f[m]),U[m]=wle(f[m]);for(u=0;u<x;u++)for(m=0;m<_;m++)v[p++]=t.x*k[u]*J[m],v[p++]=t.y*k[u]*U[m],v[p++]=t.z*O[u];let z=P/2;if(L)for(u=0;u<x;u++)for(m=0;m<_;m++)v[p++]=n.x*k[u]*J[m],v[p++]=n.y*k[u]*U[m],v[p++]=n.z*O[u],A[z]=!0,u>0&&u!==x-1&&m!==0&&m!==_-1&&(M[z]=!0),z++;p=0;let ee,K;for(u=1;u<x-2;u++)for(ee=u*_,K=(u+1)*_,m=1;m<_-2;m++)E[p++]=K+m,E[p++]=K+m+1,E[p++]=ee+m+1,E[p++]=K+m,E[p++]=ee+m+1,E[p++]=ee+m;if(L){let ke=x*_;for(u=1;u<x-2;u++)for(ee=ke+u*_,K=ke+(u+1)*_,m=1;m<_-2;m++)E[p++]=K+m,E[p++]=ee+m,E[p++]=ee+m+1,E[p++]=K+m,E[p++]=ee+m+1,E[p++]=K+m+1}let j,q;if(L){if(Z)for(q=x*_,u=1;u<_-2;u++)E[p++]=u,E[p++]=u+1,E[p++]=q+u+1,E[p++]=u,E[p++]=q+u+1,E[p++]=q+u;if(G)for(j=x*_-_,q=x*_*V-_,u=1;u<_-2;u++)E[p++]=j+u+1,E[p++]=j+u,E[p++]=q+u,E[p++]=j+u+1,E[p++]=q+u,E[p++]=q+u+1}if(X){for(u=1;u<x-2;u++)q=_*x+_*u,j=_*u,E[p++]=q,E[p++]=j+_,E[p++]=j,E[p++]=q,E[p++]=q+_,E[p++]=j+_;for(u=1;u<x-2;u++)q=_*x+_*(u+1)-1,j=_*(u+1)-1,E[p++]=j+_,E[p++]=q,E[p++]=j,E[p++]=j+_,E[p++]=q+_,E[p++]=q}let be=new hn;a.position&&(be.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:v}));let Te=0,ae=0,xe=0,_e=0,Ve=P/2,Ie,Me=re.fromCartesian3(t),ve=re.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<P;u++){Ie=A[u]?ve:Me;let ke=h.fromArray(v,u*3,wJe),ct=Ie.geodeticSurfaceNormal(ke,FJe);if(M[u]&&h.negate(ct,ct),a.st){let yt=D.negate(ct,NJe);Y[Te++]=Math.atan2(yt.y,yt.x)/W.TWO_PI+.5,Y[Te++]=Math.asin(ct.z)/Math.PI+.5}if(a.normal&&(I[ae++]=ct.x,I[ae++]=ct.y,I[ae++]=ct.z),a.tangent||a.bitangent){let yt=AJe,ot=0,ln;if(A[u]&&(ot=Ve),!Z&&u>=ot&&u<ot+_*2?ln=h.UNIT_X:ln=h.UNIT_Z,h.cross(ln,ct,yt),h.normalize(yt,yt),a.tangent&&(w[xe++]=yt.x,w[xe++]=yt.y,w[xe++]=yt.z),a.bitangent){let vn=h.cross(ct,yt,MJe);h.normalize(vn,vn),N[_e++]=vn.x,N[_e++]=vn.y,N[_e++]=vn.z}}}a.st&&(be.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:Y})),a.normal&&(be.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(be.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(be.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:N}))}if(d(e._offsetAttribute)){let ke=v.length,ct=e._offsetAttribute===rn.NONE?0:1,yt=new Uint8Array(ke/3).fill(ct);be.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:yt})}return new dt({attributes:be,indices:E,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromEllipsoid(Me),offsetAttribute:e._offsetAttribute})};var lH;x0.getUnitEllipsoid=function(){return d(lH)||(lH=x0.createGeometry(new x0({radii:new h(1,1,1),vertexFormat:We.POSITION_ONLY}))),lH};var Is=x0;var kJe=new At(B.WHITE),dH=h.ZERO,uH=new h,DJe=new h,BJe=new h,mH=new B,YJe=new h(1,1,1);function OJe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function fd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new OJe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}d(Object.create)&&(fd.prototype=Object.create(oi.prototype),fd.prototype.constructor=fd);Object.defineProperties(fd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});fd.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new gn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Un.fromDistanceDisplayCondition(a),l={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof At){let u;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,mH)),d(u)||(u=B.WHITE),r=Ut.fromColor(u),l.color=r}return d(this._options.offsetAttribute)&&(l.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,dH,uH))),new _t({id:i,geometry:new Is(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:l})};fd.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,mH),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new gn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(r),distanceDisplayCondition:Un.fromDistanceDisplayCondition(s),offset:void 0};return d(this._options.offsetAttribute)&&(a.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,dH,uH))),new _t({id:i,geometry:new sd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};fd.prototype._computeCenter=function(e,t){return H.getValueOrUndefined(this._entity.position,e,t)};fd.prototype._isHidden=function(e,t){return!d(e.position)||!d(t.radii)||oi.prototype._isHidden.call(this,e,t)};fd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!H.isConstant(e.orientation)||!t.radii.isConstant||!H.isConstant(t.innerRadii)||!H.isConstant(t.stackPartitions)||!H.isConstant(t.slicePartitions)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.minimumClock)||!H.isConstant(t.maximumClock)||!H.isConstant(t.minimumCone)||!H.isConstant(t.maximumCone)||!H.isConstant(t.subdivisions)};fd.prototype._setStaticOptions=function(e,t){let n=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof At?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ye.MINIMUM_VALUE,i.radii),i.innerRadii=H.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=H.getValueOrUndefined(t.minimumClock,Ye.MINIMUM_VALUE),i.maximumClock=H.getValueOrUndefined(t.maximumClock,Ye.MINIMUM_VALUE),i.minimumCone=H.getValueOrUndefined(t.minimumCone,Ye.MINIMUM_VALUE),i.maximumCone=H.getValueOrUndefined(t.maximumCone,Ye.MINIMUM_VALUE),i.stackPartitions=H.getValueOrUndefined(t.stackPartitions,Ye.MINIMUM_VALUE),i.slicePartitions=H.getValueOrUndefined(t.slicePartitions,Ye.MINIMUM_VALUE),i.subdivisions=H.getValueOrUndefined(t.subdivisions,Ye.MINIMUM_VALUE),i.offsetAttribute=n!==Ke.NONE?rn.ALL:void 0};fd.prototype._onEntityPropertyChanged=pp;fd.DynamicGeometryUpdater=R2;function R2(e,t,n){ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}d(Object.create)&&(R2.prototype=Object.create(ii.prototype),R2.prototype.constructor=R2);R2.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!H.getValueOrDefault(n.show,e,!0)){d(this._primitive)&&(this._primitive.show=!1),d(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=H.getValueOrUndefined(n.radii,e,DJe),o=d(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!d(o)||!d(i)){d(this._primitive)&&(this._primitive.show=!1),d(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=H.getValueOrDefault(n.fill,e,!0),s=H.getValueOrDefault(n.outline,e,!1),a=H.getValueOrClonedDefault(n.outlineColor,e,B.BLACK,mH),c=Yo.getValue(e,g(n.material,kJe),this._material),l=H.getValueOrUndefined(n.innerRadii,e,BJe),u=H.getValueOrUndefined(n.minimumClock,e),m=H.getValueOrUndefined(n.maximumClock,e),p=H.getValueOrUndefined(n.minimumCone,e),y=H.getValueOrUndefined(n.maximumCone,e),f=H.getValueOrUndefined(n.stackPartitions,e),x=H.getValueOrUndefined(n.slicePartitions,e),_=H.getValueOrUndefined(n.subdivisions,e),C=H.getValueOrDefault(n.outlineWidth,e,1),V=H.getValueOrDefault(n.heightReference,e,Ke.NONE),L=V!==Ke.NONE?rn.ALL:void 0,Z=this._scene.mode,G=Z===ie.SCENE3D&&V===Ke.NONE,X=this._options,P=this._geometryUpdater.shadowsProperty.getValue(e),A=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),M=H.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,dH,uH);if(!G||this._lastSceneMode!==Z||!d(this._primitive)||X.stackPartitions!==f||X.slicePartitions!==x||d(l)&&!h.equals(X.innerRadii!==l)||X.minimumClock!==u||X.maximumClock!==m||X.minimumCone!==p||X.maximumCone!==y||X.subdivisions!==_||this._lastOutlineWidth!==C||X.offsetAttribute!==L){let R=this._primitives;if(R.removeAndDestroy(this._primitive),R.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=Z,this._lastOutlineWidth=C,X.stackPartitions=f,X.slicePartitions=x,X.subdivisions=_,X.offsetAttribute=L,X.radii=h.clone(G?YJe:i,X.radii),d(l))if(G){let N=h.magnitude(i);X.innerRadii=h.fromElements(l.x/N,l.y/N,l.z/N,X.innerRadii)}else X.innerRadii=h.clone(l,X.innerRadii);else X.innerRadii=void 0;X.minimumClock=u,X.maximumClock=m,X.minimumCone=p,X.maximumCone=y;let E=new so({material:c,translucent:c.isTranslucent(),closed:!0});X.vertexFormat=E.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,G,this._modelMatrix);this._primitive=R.add(new Zn({geometryInstances:I,appearance:E,asynchronous:!1,shadows:P}));let w=this._geometryUpdater.createOutlineGeometryInstance(e,G,this._modelMatrix);this._outlinePrimitive=R.add(new Zn({geometryInstances:w,appearance:new sn({flat:!0,translucent:w.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:P})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=B.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=A,this._lastOffset=h.clone(M,this._lastOffset)}else if(this._primitive.ready){let R=this._primitive,E=this._outlinePrimitive;R.show=!0,E.show=!0,R.appearance.material=c;let I=this._attributes;d(I)||(I=R.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=gn.toValue(r,I.show),this._lastShow=r);let w=this._outlineAttributes;d(w)||(w=E.getGeometryInstanceAttributes(t),this._outlineAttributes=w),s!==this._lastOutlineShow&&(w.show=gn.toValue(s,w.show),this._lastOutlineShow=s),B.equals(a,this._lastOutlineColor)||(w.color=Ut.toValue(a,w.color),B.clone(a,this._lastOutlineColor)),Gt.equals(A,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Un.toValue(A,I.distanceDisplayCondition),w.distanceDisplayCondition=Un.toValue(A,w.distanceDisplayCondition),Gt.clone(A,this._lastDistanceDisplayCondition)),h.equals(M,this._lastOffset)||(I.offset=zi.toValue(M,I.offset),w.offset=zi.toValue(M,I.offset),h.clone(M,this._lastOffset))}G&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var Z2=fd;var KHn=T(S(),1);var pHn=T(S(),1);function n1(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.vertexFormat,We.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}n1.packedLength=We.packedLength;n1.pack=function(e,t,n){return n=g(n,0),We.pack(e._vertexFormat,t,n),t};var Nle=new We,KJe={vertexFormat:Nle};n1.unpack=function(e,t,n){t=g(t,0);let i=We.unpack(e,t,Nle);return d(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n):new n1(KJe)};var nN=new h(-.5,-.5,0),iN=new h(.5,.5,0);n1.createGeometry=function(e){let t=e._vertexFormat,n=new hn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=nN.x,o[1]=nN.y,o[2]=0,o[3]=iN.x,o[4]=nN.y,o[5]=0,o[6]=iN.x,o[7]=iN.y,o[8]=0,o[9]=nN.x,o[10]=iN.y,o[11]=0,n.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new dt({attributes:n,indices:i,primitiveType:Fe.TRIANGLES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var G2=n1;var LHn=T(S(),1);function i1(){this._workerName="createPlaneOutlineGeometry"}i1.packedLength=0;i1.pack=function(e,t){return t};i1.unpack=function(e,t,n){return d(n)?n:new i1};var xy=new h(-.5,-.5,0),oN=new h(.5,.5,0);i1.createGeometry=function(){let e=new hn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=xy.x,n[1]=xy.y,n[2]=xy.z,n[3]=oN.x,n[4]=xy.y,n[5]=xy.z,n[6]=oN.x,n[7]=oN.y,n[8]=xy.z,n[9]=xy.x,n[10]=oN.y,n[11]=xy.z,e.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new dt({attributes:e,indices:t,primitiveType:Fe.LINES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var E2=i1;var HJe=new h,Ule=new B;function zJe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Ru(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new zJe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}d(Object.create)&&(Ru.prototype=Object.create(oi.prototype),Ru.prototype.constructor=Ru);Ru.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof At){let y;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(y=this._materialProperty.color.getValue(e,Ule)),d(y)||(y=B.WHITE),o=Ut.fromColor(y),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,l=this._options,u=t.computeModelMatrix(e),m=H.getValueOrDefault(c.plane,e,l.plane),p=H.getValueOrUndefined(c.dimensions,e,l.dimensions);return l.plane=m,l.dimensions=p,u=hH(m,p,u,u),new _t({id:t,geometry:new G2(this._options),modelMatrix:u,attributes:i})};Ru.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Ule),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=H.getValueOrDefault(r.plane,e,s.plane),l=H.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=l,a=hH(c,l,a,a),new _t({id:t,geometry:new E2,modelMatrix:a,attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Ru.prototype._isHidden=function(e,t){return!d(t.plane)||!d(t.dimensions)||!d(e.position)||oi.prototype._isHidden.call(this,e,t)};Ru.prototype._getIsClosed=function(e){return!1};Ru.prototype._isDynamic=function(e,t){return!e.position.isConstant||!H.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!H.isConstant(t.outlineWidth)};Ru.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof At,i=this._options;i.vertexFormat=n?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ye.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ye.MINIMUM_VALUE,i.dimensions)};Ru.DynamicGeometryUpdater=o1;function o1(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(o1.prototype=Object.create(ii.prototype),o1.prototype.constructor=o1);o1.prototype._isHidden=function(e,t,n){let i=this._options,o=H.getValueOrUndefined(e.position,n,HJe);return!d(o)||!d(i.plane)||!d(i.dimensions)||ii.prototype._isHidden.call(this,e,t,n)};o1.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=H.getValueOrDefault(t.plane,n,i.plane),i.dimensions=H.getValueOrUndefined(t.dimensions,n,i.dimensions)};var JJe=new h,QJe=new h,jJe=new h,qJe=new h,$Je=new $,eQe=new $,tQe=new F;function hH(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,jJe),a=h.clone(h.UNIT_Z,QJe);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,JJe);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let l=$Je;$.setColumn(l,0,c,l),$.setColumn(l,1,a,l),$.setColumn(l,2,o,l);let u=h.fromElements(t.x,t.y,1,qJe),m=$.multiplyByScale(l,u,eQe),p=F.fromRotationTranslation(m,s,tQe);return F.multiplyTransformation(n,p,i)}Ru.createPrimitiveMatrix=hH;var X2=Ru;var tQn=T(S(),1);var yzn=T(S(),1);var nQe=new h,iQe=new He,oQe=new D,rQe=new D,sQe=new h,aQe=new h,cQe=new h,I2=new h,lQe=new h,dQe=new h,kle=new Ae,uQe=new $,mQe=new $,hQe=new h;function fQe(e,t,n,i,o,r,s,a,c){let l=e.positions,u=ai.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let m=Ue.createTypedArray(l.length,u.length);m.set(u);let p=uQe;if(i!==0){let b=Ae.fromAxisAngle(s,i,kle);if(p=$.fromQuaternion(b,p),t.tangent||t.bitangent){b=Ae.fromAxisAngle(s,-i,kle);let R=$.fromQuaternion(b,mQe);a=h.normalize($.multiplyByVector(R,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let y=rQe;t.st&&(y.x=n.x,y.y=n.y);let f=l.length,x=f*3,_=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,V=t.tangent?new Float32Array(x):void 0,L=t.bitangent?new Float32Array(x):void 0,Z=t.st?new Float32Array(f*2):void 0,G=0,X=0,P=0,v=0,A=0;for(let b=0;b<f;b++){let R=l[b];if(_[G++]=R.x,_[G++]=R.y,_[G++]=R.z,t.st)if(d(o)&&o.positions.length===f)Z[A++]=o.positions[b].x,Z[A++]=o.positions[b].y;else{let E=$.multiplyByVector(p,R,nQe),I=r(E,oQe);D.subtract(I,y,I);let w=W.clamp(I.x/n.width,0,1),N=W.clamp(I.y/n.height,0,1);Z[A++]=w,Z[A++]=N}t.normal&&(C[X++]=s.x,C[X++]=s.y,C[X++]=s.z),t.tangent&&(V[v++]=a.x,V[v++]=a.y,V[v++]=a.z),t.bitangent&&(L[P++]=c.x,L[P++]=c.y,L[P++]=c.z)}let M=new hn;return t.position&&(M.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_})),t.normal&&(M.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(M.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(M.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.st&&(M.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:Z})),new dt({attributes:M,indices:m,primitiveType:Fe.TRIANGLES})}function R_(e){e=g(e,g.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=g(e.vertexFormat,We.DEFAULT);this._vertexFormat=We.clone(i),this._polygonHierarchy=t,this._stRotation=g(e.stRotation,0),this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Bn.computeHierarchyPackedLength(t,h)+We.packedLength+re.packedLength+(d(n)?Bn.computeHierarchyPackedLength(n,D):1)+2}R_.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new R_(t)};R_.pack=function(e,t,n){return n=g(n,0),n=Bn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._stRotation,d(e._textureCoordinates)?n=Bn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var pQe=re.clone(re.UNIT_SPHERE),bQe=new We,yQe={polygonHierarchy:{}};R_.unpack=function(e,t,n){t=g(t,0);let i=Bn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,pQe);t+=re.packedLength;let r=We.unpack(e,t,bQe);t+=We.packedLength;let s=e[t++],a=e[t]===-1?void 0:Bn.unpackPolygonHierarchy(e,t,D);d(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return d(n)||(n=new R_(yQe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};R_.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=d(o),s=n.positions;if(s=go(s,h.equalsEpsilon,!0),s.length<3)return;let a=sQe,c=aQe,l=cQe,u=lQe,m=dQe;if(!qp.computeProjectTo2DArguments(s,I2,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(I2,h.ZERO,W.EPSILON6)){let A=e._ellipsoid.geodeticSurfaceNormal(I2,hQe);h.dot(a,A)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let y=qp.createProjectPointsTo2DFunction(I2,u,m),f=qp.createProjectPointTo2DFunction(I2,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(l=h.clone(m,l));let x=Bn.polygonsFromHierarchy(n,r,y,!1),_=x.hierarchy,C=x.polygons,V=function(A){return A},L=r?Bn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let Z=ce.fromPoints(s),G=Bn.computeBoundingRectangle(a,f,s,i,iQe),X=[];for(let A=0;A<C.length;A++){let M=new _t({geometry:fQe(C[A],t,G,i,r?L[A]:void 0,f,a,c,l)});X.push(M)}let P=An.combineInstances(X)[0];P.attributes.position.values=new Float64Array(P.attributes.position.values),P.indices=Ue.createTypedArray(P.attributes.position.values.length/3,P.indices);let v=P.attributes;return t.position||delete v.position,new dt({attributes:v,indices:P.indices,primitiveType:P.primitiveType,boundingSphere:Z})};var W2=R_;var oJn=T(S(),1);var Gzn=T(S(),1);function Ir(e,t){this.position=e,d(this.position)||(this.position=new D),this.tangentPlane=t,d(this.tangentPlane)||(this.tangentPlane=Ir.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ir.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=D.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(W.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=W.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=W.TWO_PI),e}}});var r1=new he,gQe=new h;Ir.prototype.getLatitude=function(e){d(e)||(e=re.WGS84),r1.latitude=this.conformalLatitude,r1.longitude=this.longitude,r1.height=0;let t=this.ellipsoid.cartographicToCartesian(r1,gQe);return e.cartesianToCartographic(t,r1),r1.latitude};var xQe=new Sn,_Qe=new h,TQe=new h;Ir.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ir.NORTH_POLE_TANGENT_PLANE,o=Ir.SOUTH_POLE;n<0&&(i=Ir.SOUTH_POLE_TANGENT_PLANE,o=Ir.NORTH_POLE);let r=xQe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,_Qe),h.normalize(r.direction,r.direction);let s=Si.rayPlane(r,i.plane,TQe),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),l=n*h.dot(i.yAxis,a);return d(t)?(t.position=new D(c,l),t.tangentPlane=i,t):new Ir(new D(c,l),i)};Ir.fromCartesianArray=function(e,t){let n=e.length;d(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Ir.fromCartesian(e[i],t[i]);return t};Ir.clone=function(e,t){if(d(e))return d(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ir(e.position,e.tangentPlane)};Ir.HALF_UNIT_SPHERE=Object.freeze(new re(.5,.5,.5));Ir.NORTH_POLE=Object.freeze(new h(0,0,.5));Ir.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ir.NORTH_POLE_TANGENT_PLANE=Object.freeze(new xr(Ir.NORTH_POLE,Ir.HALF_UNIT_SPHERE));Ir.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new xr(Ir.SOUTH_POLE,Ir.HALF_UNIT_SPHERE));var ic=Ir;var SQe=new he,Dle=new he;function CQe(e,t,n,i){let r=i.cartesianToCartographic(e,SQe).height,s=i.cartesianToCartographic(t,Dle);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Dle);a.height=r-100,i.cartographicToCartesian(a,n)}var Ble=new He,VQe=new h,LQe=new h,RQe=new h,ZQe=new h,GQe=new h,EQe=new h,rN=new h,cf=new h,s1=new h,XQe=new D,IQe=new D,WQe=new h,Yle=new Ae,PQe=new $,vQe=new $;function fH(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=d(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,l=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,m=e.rotationAxis,p=e.projectTo2d,y=e.ellipsoid,f=e.stRotation,x=e.perPositionHeight,_=XQe;_.x=u.x,_.y=u.y;let C=t.st?new Float32Array(2*(s/3)):void 0,V;t.normal&&(x&&c&&!a?V=n.attributes.normal.values:V=new Float32Array(s));let L=t.tangent?new Float32Array(s):void 0,Z=t.bitangent?new Float32Array(s):void 0,G=i?new Float32Array(s):void 0,X=0,P=0,v=LQe,A=RQe,M=ZQe,b=!0,R=PQe,E=vQe;if(f!==0){let N=Ae.fromAxisAngle(m,f,Yle);R=$.fromQuaternion(N,R),N=Ae.fromAxisAngle(m,-f,Yle),E=$.fromQuaternion(N,E)}else R=$.clone($.IDENTITY,R),E=$.clone($.IDENTITY,E);let I=0,w=0;c&&l&&(I=s/2,w=s/3,s/=2);for(let N=0;N<s;N+=3){let Y=h.fromArray(o,N,WQe);if(t.st&&!d(r)){let k=$.multiplyByVector(R,Y,VQe);k=y.scaleToGeodeticSurface(k,k);let O=p(k,IQe);D.subtract(O,_,O);let U=W.clamp(O.x/u.width,0,1),J=W.clamp(O.y/u.height,0,1);l&&(C[X+w]=U,C[X+1+w]=J),c&&(C[X]=U,C[X+1]=J),X+=2}if(t.normal||t.tangent||t.bitangent||i){let k=P+1,O=P+2;if(a){if(N+3<s){let U=h.fromArray(o,N+3,GQe);if(b){let J=h.fromArray(o,N+s,EQe);x&&CQe(Y,U,J,y),h.subtract(U,Y,U),h.subtract(J,Y,J),v=h.normalize(h.cross(J,U,v),v),b=!1}h.equalsEpsilon(U,Y,W.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(M=y.geodeticSurfaceNormal(Y,M),t.tangent&&(A=h.normalize(h.cross(M,v,A),A)))}else v=y.geodeticSurfaceNormal(Y,v),(t.tangent||t.bitangent)&&(x&&(rN=h.fromArray(V,P,rN),cf=h.cross(h.UNIT_Z,rN,cf),cf=h.normalize($.multiplyByVector(E,cf,cf),cf),t.bitangent&&(s1=h.normalize(h.cross(rN,cf,s1),s1))),A=h.cross(h.UNIT_Z,v,A),A=h.normalize($.multiplyByVector(E,A,A),A),t.bitangent&&(M=h.normalize(h.cross(v,A,M),M)));t.normal&&(e.wall?(V[P+I]=v.x,V[k+I]=v.y,V[O+I]=v.z):l&&(V[P+I]=-v.x,V[k+I]=-v.y,V[O+I]=-v.z),(c&&!x||a)&&(V[P]=v.x,V[k]=v.y,V[O]=v.z)),i&&(a&&(v=y.geodeticSurfaceNormal(Y,v)),G[P+I]=-v.x,G[k+I]=-v.y,G[O+I]=-v.z),t.tangent&&(e.wall?(L[P+I]=A.x,L[k+I]=A.y,L[O+I]=A.z):l&&(L[P+I]=-A.x,L[k+I]=-A.y,L[O+I]=-A.z),c&&(x?(L[P]=cf.x,L[k]=cf.y,L[O]=cf.z):(L[P]=A.x,L[k]=A.y,L[O]=A.z))),t.bitangent&&(l&&(Z[P+I]=M.x,Z[k+I]=M.y,Z[O+I]=M.z),c&&(x?(Z[P]=s1.x,Z[k]=s1.y,Z[O]=s1.z):(Z[P]=M.x,Z[k]=M.y,Z[O]=M.z))),P+=3}}t.st&&!d(r)&&(n.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.tangent&&(n.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.bitangent&&(n.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Z})),i&&(n.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:G}))}if(e.extrude&&d(e.offsetAttribute)){let u=o.length/3,m=new Uint8Array(u);if(e.offsetAttribute===rn.TOP)c&&l||a?m=m.fill(1,0,u/2):c&&(m=m.fill(1));else{let p=e.offsetAttribute===rn.NONE?0:1;m=m.fill(p)}n.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return n}var wQe=new he,FQe=new he,_y={westOverIDL:0,eastOverIDL:0},a1=new eu;function AQe(e,t,n,i,o){if(o=g(o,new de),!d(e)||e.length<3)return o.west=0,o.north=0,o.south=0,o.east=0,o;if(n===Jt.RHUMB)return de.fromCartesianArray(e,t,o);a1.ellipsoid.equals(t)||(a1=new eu(void 0,void 0,t)),o.west=Number.POSITIVE_INFINITY,o.east=Number.NEGATIVE_INFINITY,o.south=Number.POSITIVE_INFINITY,o.north=Number.NEGATIVE_INFINITY,_y.westOverIDL=Number.POSITIVE_INFINITY,_y.eastOverIDL=Number.NEGATIVE_INFINITY;let r=1/W.chordLength(i,t.maximumRadius),s=e.length,a=t.cartesianToCartographic(e[0],FQe),c=wQe,l;for(let u=1;u<s;u++)l=c,c=a,a=t.cartesianToCartographic(e[u],l),a1.setEndPoints(c,a),Ole(a1,r,o,_y);return l=c,c=a,a=t.cartesianToCartographic(e[0],l),a1.setEndPoints(c,a),Ole(a1,r,o,_y),o.east-o.west>_y.eastOverIDL-_y.westOverIDL&&(o.west=_y.westOverIDL,o.east=_y.eastOverIDL,o.east>W.PI&&(o.east=o.east-W.TWO_PI),o.west>W.PI&&(o.west=o.west-W.TWO_PI)),o}var MQe=new he;function Ole(e,t,n,i){let o=e.surfaceDistance,r=Math.ceil(o*t),s=r>0?o/(r-1):Number.POSITIVE_INFINITY,a=0;for(let c=0;c<r;c++){let l=e.interpolateUsingSurfaceDistance(a,MQe);a+=s;let u=l.longitude,m=l.latitude;n.west=Math.min(n.west,u),n.east=Math.max(n.east,u),n.south=Math.min(n.south,m),n.north=Math.max(n.north,m);let p=u>=0?u:u+W.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,p),i.eastOverIDL=Math.max(i.eastOverIDL,p)}}var Kle=[];function NQe(e,t,n,i,o,r,s,a,c,l){let u={walls:[]},m;if(s||a){let V=Bn.createGeometryFromPositions(e,t,n,i,r,c,l),L=V.attributes.position.values,Z=V.indices,G,X;if(s&&a){let P=L.concat(L);G=P.length/3,X=Ue.createTypedArray(G,Z.length*2),X.set(Z);let v=Z.length,A=G/2;for(m=0;m<v;m+=3){let M=X[m]+A,b=X[m+1]+A,R=X[m+2]+A;X[m+v]=R,X[m+1+v]=b,X[m+2+v]=M}if(V.attributes.position.values=P,r&&c.normal){let M=V.attributes.normal.values;V.attributes.normal.values=new Float32Array(P.length),V.attributes.normal.values.set(M)}if(c.st&&d(n)){let M=V.attributes.st.values;V.attributes.st.values=new Float32Array(G*2),V.attributes.st.values=M.concat(M)}V.indices=X}else if(a){for(G=L.length/3,X=Ue.createTypedArray(G,Z.length),m=0;m<Z.length;m+=3)X[m]=Z[m+2],X[m+1]=Z[m+1],X[m+2]=Z[m];V.indices=X}u.topAndBottom=new _t({geometry:V})}let p=o.outerRing,y=xr.fromPoints(p,e),f=y.projectPointsOntoPlane(p,Kle),x=ai.computeWindingOrder2D(f);x===Hr.CLOCKWISE&&(p=p.slice().reverse());let _=Bn.computeWallGeometry(p,n,e,i,r,l);u.walls.push(new _t({geometry:_}));let C=o.holes;for(m=0;m<C.length;m++){let V=C[m];y=xr.fromPoints(V,e),f=y.projectPointsOntoPlane(V,Kle),x=ai.computeWindingOrder2D(f),x===Hr.COUNTER_CLOCKWISE&&(V=V.slice().reverse()),_=Bn.computeWallGeometry(V,n,e,i,r,l),u.walls.push(new _t({geometry:_}))}return u}function pd(e){let t=e.polygonHierarchy,n=g(e.vertexFormat,We.DEFAULT),i=g(e.ellipsoid,re.WGS84),o=g(e.granularity,W.RADIANS_PER_DEGREE),r=g(e.stRotation,0),s=e.textureCoordinates,a=g(e.perPositionHeight,!1),c=a&&d(e.extrudedHeight),l=g(e.height,0),u=g(e.extrudedHeight,l);if(!c){let m=Math.max(l,u);u=Math.min(l,u),l=m}this._vertexFormat=We.clone(n),this._ellipsoid=re.clone(i),this._granularity=o,this._stRotation=r,this._height=l,this._extrudedHeight=u,this._closeTop=g(e.closeTop,!0),this._closeBottom=g(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=g(e.arcType,Jt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Bn.computeHierarchyPackedLength(t,h)+re.packedLength+We.packedLength+(s?Bn.computeHierarchyPackedLength(s,D):1)+12}pd.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new pd(t)};pd.pack=function(e,t,n){return n=g(n,0),n=Bn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=g(e._offsetAttribute,-1),t[n++]=e._arcType,d(e._textureCoordinates)?n=Bn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var UQe=re.clone(re.UNIT_SPHERE),kQe=new We,DQe={polygonHierarchy:{}};pd.unpack=function(e,t,n){t=g(t,0);let i=Bn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,UQe);t+=re.packedLength;let r=We.unpack(e,t,kQe);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++]===1,m=e[t++]===1,p=e[t++]===1,y=e[t++]===1,f=e[t++]===1,x=e[t++],_=e[t++],C=e[t]===-1?void 0:Bn.unpackPolygonHierarchy(e,t,D);d(C)?(t=C.startingIndex,delete C.startingIndex):t++;let V=e[t++];return d(n)||(n=new pd(DQe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=l,n._perPositionHeightExtrude=u,n._perPositionHeight=m,n._closeTop=p,n._closeBottom=y,n._shadowVolume=f,n._offsetAttribute=x===-1?void 0:x,n._arcType=_,n._textureCoordinates=C,n.packedLength=V,n};var BQe=new D,YQe=new D,OQe=new ic;function Hle(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),l=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==Jt.RHUMB){let p=D.subtract(t.position,e.position,BQe),y=D.dot(t.position,p)/D.dot(p,p);if(y>0&&y<1){let f=D.add(t.position,D.multiplyByScalar(p,-y,p),YQe),x=ic.clone(t,OQe);x.position=f;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(l=_)}}let u=t.x*e.y-e.x*t.y,m=Math.sign(u);m!==0&&(m*=D.angleBetween(t.position,e.position)),l>=0&&(o.northAngle+=m),l<=0&&(o.southAngle+=m)}var zle=new ic,KQe=new ic,Zu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};pd.computeRectangleFromPositions=function(e,t,n,i){if(d(i)||(i=new de),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Zu.northAngle=0,Zu.southAngle=0,Zu.westOverIdl=Number.POSITIVE_INFINITY,Zu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=ic.fromCartesian(e[0],KQe);for(let s=1;s<o;s++){let a=ic.fromCartesian(e[s],zle);Hle(a,r,t,n,Zu,i),r=ic.clone(a,r)}return Hle(ic.fromCartesian(e[0],zle),r,t,n,Zu,i),i.east-i.west>Zu.eastOverIdl-Zu.westOverIdl&&(i.west=Zu.westOverIdl,i.east=Zu.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Zu.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Zu.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};pd.computeRectangle=function(e,t){zr("PolygonGeometry.computeRectangle","PolygonGeometry.computeRectangle was deprecated in CesiumJS 1.110.  It will be removed in CesiumJS 1.112. Use PolygonGeometry.computeRectangleFromPositions instead.");let n=g(e.granularity,W.RADIANS_PER_DEGREE),i=g(e.arcType,Jt.GEODESIC),o=e.polygonHierarchy,r=g(e.ellipsoid,re.WGS84);return AQe(o.positions,r,i,n,t)};var HQe=new ic;function zQe(e,t,n){return e.height>=W.PI||e.width>=W.PI?ic.fromCartesian(t[0],HQe).tangentPlane:xr.fromPoints(t,n)}var Jle=new he;function JQe(e,t){return(n,i)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){d(i)||(i=[]);for(let r=0;r<n.length;++r){let s=t.cartesianToCartographic(n[r],Jle);i[r]=new D(s.longitude/W.PI,s.latitude/W.PI_OVER_TWO)}return i.length=n.length,i}return ic.fromCartesianArray(n,i)}return xr.fromPoints(n,t).projectPointsOntoPlane(n,i)}}function QQe(e,t,n){if(e.height>=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Jle);return d(r)||(r=new D),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return ic.fromCartesian(o,r)};let i=xr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function jQe(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?Bn.splitPolygonsOnEquator(o,t,n,r):o}function qQe(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return He.fromRectangle(t,void 0,Ble);let o=e,r=xr.fromPoints(o,n);return Bn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Ble)}pd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,l=e._arcType,u=e._textureCoordinates,m=d(u);if(r.positions.length<3)return;let y=e.rectangle,f=Bn.polygonsFromHierarchy(r,m,JQe(y,n),!s,n,jQe(y,n,l,s)),x=f.hierarchy,_=f.polygons,C=function(I){return I},V=m?Bn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,Z=qQe(L,y,n,o),G=[],X=e._height,P=e._extrudedHeight,v=e._perPositionHeightExtrude||!W.equalsEpsilon(X,P,0,W.EPSILON2),A={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:zQe(y,L,n).plane.normal,projectTo2d:QQe(y,L,n),boundingRectangle:Z,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:l},M;if(v)for(A.extrude=!0,A.top=a,A.bottom=c,A.shadowVolume=e._shadowVolume,A.offsetAttribute=e._offsetAttribute,M=0;M<_.length;M++){let I=NQe(n,_[M],m?V[M]:void 0,i,x[M],s,a,c,t,l),w;a&&c?(w=I.topAndBottom,A.geometry=Bn.scaleToGeodeticHeightExtruded(w.geometry,X,P,n,s)):a?(w=I.topAndBottom,w.geometry.attributes.position.values=ai.scaleToGeodeticHeight(w.geometry.attributes.position.values,X,n,!s),A.geometry=w.geometry):c&&(w=I.topAndBottom,w.geometry.attributes.position.values=ai.scaleToGeodeticHeight(w.geometry.attributes.position.values,P,n,!0),A.geometry=w.geometry),(a||c)&&(A.wall=!1,w.geometry=fH(A),G.push(w));let N=I.walls;A.wall=!0;for(let Y=0;Y<N.length;Y++){let k=N[Y];A.geometry=Bn.scaleToGeodeticHeightExtruded(k.geometry,X,P,n,s),k.geometry=fH(A),G.push(k)}}else for(M=0;M<_.length;M++){let I=new _t({geometry:Bn.createGeometryFromPositions(n,_[M],m?V[M]:void 0,i,s,t,l)});if(I.geometry.attributes.position.values=ai.scaleToGeodeticHeight(I.geometry.attributes.position.values,X,n,!s),A.geometry=I.geometry,I.geometry=fH(A),d(e._offsetAttribute)){let w=I.geometry.attributes.position.values.length,N=e._offsetAttribute===rn.NONE?0:1,Y=new Uint8Array(w/3).fill(N);I.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}G.push(I)}let b=An.combineInstances(G)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Ue.createTypedArray(b.attributes.position.values.length/3,b.indices);let R=b.attributes,E=ce.fromVertices(R.position.values);return t.position||delete R.position,new dt({attributes:R,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};pd.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new pd({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function $Qe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return dt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(pd.prototype,{rectangle:{get:function(){if(!d(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=pd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return d(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=$Qe(this)),this._textureCoordinateRotationPoints}}});var Z_=pd;var RJn=T(S(),1);var Qle=[],sN=[];function e4e(e,t,n,i,o){let s=xr.fromPoints(t,e).projectPointsOntoPlane(t,Qle);ai.computeWindingOrder2D(s)===Hr.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,l,u=t.length,m=0;if(i)for(c=new Float64Array(u*2*3),l=0;l<u;l++){let f=t[l],x=t[(l+1)%u];c[m++]=f.x,c[m++]=f.y,c[m++]=f.z,c[m++]=x.x,c[m++]=x.y,c[m++]=x.z}else{let f=0;if(o===Jt.GEODESIC)for(l=0;l<u;l++)f+=Bn.subdivideLineCount(t[l],t[(l+1)%u],n);else if(o===Jt.RHUMB)for(l=0;l<u;l++)f+=Bn.subdivideRhumbLineCount(e,t[l],t[(l+1)%u],n);for(c=new Float64Array(f*3),l=0;l<u;l++){let x;o===Jt.GEODESIC?x=Bn.subdivideLine(t[l],t[(l+1)%u],n,sN):o===Jt.RHUMB&&(x=Bn.subdivideRhumbLine(e,t[l],t[(l+1)%u],n,sN));let _=x.length;for(let C=0;C<_;++C)c[m++]=x[C]}}u=c.length/3;let p=u*2,y=Ue.createTypedArray(u,p);for(m=0,l=0;l<u-1;l++)y[m++]=l,y[m++]=l+1;return y[m++]=u-1,y[m++]=0,new _t({geometry:new dt({attributes:new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Fe.LINES})})}function t4e(e,t,n,i,o){let s=xr.fromPoints(t,e).projectPointsOntoPlane(t,Qle);ai.computeWindingOrder2D(s)===Hr.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,l,u=t.length,m=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),l=0;l<u;++l){m[l]=p/3;let _=t[l],C=t[(l+1)%u];c[p++]=_.x,c[p++]=_.y,c[p++]=_.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let _=0;if(o===Jt.GEODESIC)for(l=0;l<u;l++)_+=Bn.subdivideLineCount(t[l],t[(l+1)%u],n);else if(o===Jt.RHUMB)for(l=0;l<u;l++)_+=Bn.subdivideRhumbLineCount(e,t[l],t[(l+1)%u],n);for(c=new Float64Array(_*3*2),l=0;l<u;++l){m[l]=p/3;let C;o===Jt.GEODESIC?C=Bn.subdivideLine(t[l],t[(l+1)%u],n,sN):o===Jt.RHUMB&&(C=Bn.subdivideRhumbLine(e,t[l],t[(l+1)%u],n,sN));let V=C.length;for(let L=0;L<V;++L)c[p++]=C[L]}}u=c.length/(3*2);let y=m.length,f=(u*2+y)*2,x=Ue.createTypedArray(u+y,f);for(p=0,l=0;l<u;++l)x[p++]=l,x[p++]=(l+1)%u,x[p++]=l+u,x[p++]=(l+1)%u+u;for(l=0;l<y;l++){let _=m[l];x[p++]=_,x[p++]=_+u}return new _t({geometry:new dt({attributes:new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Fe.LINES})})}function G_(e){let t=e.polygonHierarchy,n=g(e.ellipsoid,re.WGS84),i=g(e.granularity,W.RADIANS_PER_DEGREE),o=g(e.perPositionHeight,!1),r=o&&d(e.extrudedHeight),s=g(e.arcType,Jt.GEODESIC),a=g(e.height,0),c=g(e.extrudedHeight,a);if(!r){let l=Math.max(a,c);c=Math.min(a,c),a=l}this._ellipsoid=re.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Bn.computeHierarchyPackedLength(t,h)+re.packedLength+8}G_.pack=function(e,t,n){return n=g(n,0),n=Bn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=g(e._offsetAttribute,-1),t[n]=e.packedLength,t};var n4e=re.clone(re.UNIT_SPHERE),i4e={polygonHierarchy:{}};G_.unpack=function(e,t,n){t=g(t,0);let i=Bn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,n4e);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,l=e[t++]===1,u=e[t++],m=e[t++],p=e[t];return d(n)||(n=new G_(i4e)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=l,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=m===-1?void 0:m,n.packedLength=p,n};G_.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new G_(t)};G_.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Bn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],l=W.chordLength(n,t.maximumRadius),u=e._height,m=e._extrudedHeight,p=e._perPositionHeightExtrude||!W.equalsEpsilon(u,m,0,W.EPSILON2),y,f;if(p)for(f=0;f<s.length;f++){if(a=t4e(t,s[f],l,o,r),a.geometry=Bn.scaleToGeodeticHeightExtruded(a.geometry,u,m,t,o),d(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,V=new Uint8Array(C);e._offsetAttribute===rn.TOP?V=V.fill(1,0,C/2):(y=e._offsetAttribute===rn.NONE?0:1,V=V.fill(y)),a.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}else for(f=0;f<s.length;f++){if(a=e4e(t,s[f],l,o,r),a.geometry.attributes.position.values=ai.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),d(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;y=e._offsetAttribute===rn.NONE?0:1;let V=new Uint8Array(C/3).fill(y);a.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}let x=An.combineInstances(c)[0],_=ce.fromVertices(x.attributes.position.values);return new dt({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var P2=G_;var jle="Entity polygons cannot have both height and perPositionHeight.  height will be ignored",qle="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",$le=new B,ede=h.ZERO,tde=new h,nde=new de,o4e=[],r4e=new D;function s4e(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function bd(e,t){Hn.call(this,{entity:e,scene:t,geometryOptions:new s4e(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}d(Object.create)&&(bd.prototype=Object.create(Hn.prototype),bd.prototype.constructor=bd);bd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof At){let s;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,$le)),d(s)||(s=B.WHITE),o.color=Ut.fromColor(s)}d(i.offsetAttribute)&&(o.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,ede,tde)));let r;return i.perPositionHeight&&!d(i.extrudedHeight)?r=new W2(i):r=new Z_(i),new _t({id:t,geometry:r,attributes:o})};bd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,$le),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(o),distanceDisplayCondition:Un.fromDistanceDisplayCondition(r),offset:void 0};d(i.offsetAttribute)&&(s.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,ede,tde)));let a;return i.perPositionHeight&&!d(i.extrudedHeight)?a=new yu(i):a=new P2(i),new _t({id:t,geometry:a,attributes:s})};bd.prototype._computeCenter=function(e,t){let n=H.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!d(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.mapProjection.ellipsoid,r=xr.fromPoints(i,o),s=r.projectPointsOntoPlane(i,o4e),a=s.length,c=0,l=a-1,u=new D;for(let p=0;p<a;l=p++){let y=s[p],f=s[l],x=y.x*f.y-f.x*y.y,_=D.add(y,f,r4e);_=D.multiplyByScalar(_,x,_),u=D.add(u,_,u),c+=x}let m=1/(c*3);return u=D.multiplyByScalar(u,m,u),r.projectPointOntoEllipsoid(u,t)};bd.prototype._isHidden=function(e,t){return!d(t.hierarchy)||oi.prototype._isHidden.call(this,e,t)};bd.prototype._isOnTerrain=function(e,t){let n=Hn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=d(i)&&(i.isConstant?i.getValue(Ye.MINIMUM_VALUE):!0);return n&&!o};bd.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!H.isConstant(t.height)||!H.isConstant(t.extrudedHeight)||!H.isConstant(t.granularity)||!H.isConstant(t.stRotation)||!H.isConstant(t.textureCoordinates)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.perPositionHeight)||!H.isConstant(t.closeTop)||!H.isConstant(t.closeBottom)||!H.isConstant(t.zIndex)||!H.isConstant(t.arcType)||this._onTerrain&&!H.isConstant(this._materialProperty)&&!(this._materialProperty instanceof At)};bd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof At,i=this._options;i.vertexFormat=n?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ye.MINIMUM_VALUE),r=H.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),s=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),a=H.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),c=H.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,Ke.NONE),l=H.getValueOrDefault(t.perPositionHeight,Ye.MINIMUM_VALUE,!1);r=Hn.getGeometryHeight(r,s);let u;l?(d(r)&&(r=void 0,It(jle)),s!==Ke.NONE&&l&&(r=void 0,It(qle))):(d(a)&&!d(r)&&(r=0),u=Hn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=H.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),i.stRotation=H.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),i.perPositionHeight=l,i.closeTop=H.getValueOrDefault(t.closeTop,Ye.MINIMUM_VALUE,!0),i.closeBottom=H.getValueOrDefault(t.closeBottom,Ye.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=H.getValueOrDefault(t.arcType,Ye.MINIMUM_VALUE,Jt.GEODESIC),i.textureCoordinates=H.getValueOrUndefined(t.textureCoordinates,Ye.MINIMUM_VALUE),a=Hn.getGeometryExtrudedHeight(a,c),a===Hn.CLAMP_TO_GROUND&&(a=li.getMinimumMaximumHeights(Z_.computeRectangle(i,nde)).minimumTerrainHeight),i.extrudedHeight=a};bd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=d(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};bd.DynamicGeometryUpdater=c1;function c1(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(c1.prototype=Object.create(ii.prototype),c1.prototype.constructor=c1);c1.prototype._isHidden=function(e,t,n){return!d(this._options.polygonHierarchy)||ii.prototype._isHidden.call(this,e,t,n)};c1.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=H.getValueOrUndefined(t.hierarchy,n);let o=H.getValueOrUndefined(t.height,n),r=H.getValueOrDefault(t.heightReference,n,Ke.NONE),s=H.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE),a=H.getValueOrUndefined(t.extrudedHeight,n),c=H.getValueOrUndefined(t.perPositionHeight,n);o=Hn.getGeometryHeight(o,s);let l;c?(d(o)&&(o=void 0,It(jle)),r!==Ke.NONE&&c&&(o=void 0,It(qle))):(d(a)&&!d(o)&&(o=0),l=Hn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=H.getValueOrUndefined(t.granularity,n),i.stRotation=H.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=H.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=H.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=H.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=H.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=l,i.height=o,i.arcType=H.getValueOrDefault(t.arcType,n,Jt.GEODESIC),a=Hn.getGeometryExtrudedHeight(a,s),a===Hn.CLAMP_TO_GROUND&&(a=li.getMinimumMaximumHeights(Z_.computeRectangle(i,nde)).minimumTerrainHeight),i.extrudedHeight=a};var v2=bd;var l4n=T(S(),1);var LQn=T(S(),1);function a4e(e,t,n,i){let o=new hn;i.position&&(o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=ai.triangulate(t),l=(a-1)*r*6+c.length*2,u=Ue.createTypedArray(s,l),m,p,y,f,x,_,C=r*2,V=0;for(m=0;m<a-1;m++){for(p=0;p<r-1;p++)y=p*2+m*r*2,_=y+C,f=y+1,x=f+C,u[V++]=f,u[V++]=y,u[V++]=x,u[V++]=x,u[V++]=y,u[V++]=_;y=r*2-2+m*r*2,f=y+1,x=f+C,_=y+C,u[V++]=f,u[V++]=y,u[V++]=x,u[V++]=x,u[V++]=y,u[V++]=_}if(i.st||i.tangent||i.bitangent){let G=new Float32Array(s*2),X=1/(a-1),P=1/n.height,v=n.height/2,A,M,b=0;for(m=0;m<a;m++){for(A=m*X,M=P*(t[0].y+v),G[b++]=A,G[b++]=M,p=1;p<r;p++)M=P*(t[p].y+v),G[b++]=A,G[b++]=M,G[b++]=A,G[b++]=M;M=P*(t[0].y+v),G[b++]=A,G[b++]=M}for(p=0;p<r;p++)A=0,M=P*(t[p].y+v),G[b++]=A,G[b++]=M;for(p=0;p<r;p++)A=(a-1)*X,M=P*(t[p].y+v),G[b++]=A,G[b++]=M;o.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:new Float32Array(G)})}let L=s-r*2;for(m=0;m<c.length;m+=3){let G=c[m]+L,X=c[m+1]+L,P=c[m+2]+L;u[V++]=G,u[V++]=X,u[V++]=P,u[V++]=P+r,u[V++]=X+r,u[V++]=G+r}let Z=new dt({attributes:o,indices:u,boundingSphere:ce.fromVertices(e),primitiveType:Fe.TRIANGLES});if(i.normal&&(Z=An.computeNormal(Z)),i.tangent||i.bitangent){try{Z=An.computeTangentAndBitangent(Z)}catch{It("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(Z.attributes.tangent=void 0),i.bitangent||(Z.attributes.bitangent=void 0),i.st||(Z.attributes.st=void 0)}return Z}function F2(e){e=g(e,g.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._vertexFormat=We.clone(g(e.vertexFormat,We.DEFAULT)),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+re.packedLength+We.packedLength+2}F2.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var ide=re.clone(re.UNIT_SPHERE),ode=new We,w2={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ide,vertexFormat:ode,cornerType:void 0,granularity:void 0};F2.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=re.unpack(e,t,ide);t+=re.packedLength;let c=We.unpack(e,t,ode);t+=We.packedLength;let l=e[t++],u=e[t];return d(n)?(n._positions=r,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=We.clone(c,n._vertexFormat),n._cornerType=l,n._granularity=u,n):(w2.polylinePositions=r,w2.shapePositions=s,w2.cornerType=l,w2.granularity=u,new F2(w2))};var c4e=new He;F2.createGeometry=function(e){let t=e._positions,n=go(t,h.equalsEpsilon),i=e._shape;if(i=Mm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ai.computeWindingOrder2D(i)===Hr.CLOCKWISE&&i.reverse();let o=He.fromPoints(i,c4e),r=Mm.computePositions(n,i,o,e,!0);return a4e(r,i,o,e._vertexFormat)};var A2=F2;var KQn=T(S(),1);function l4e(e,t){let n=new hn;n.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ue.createTypedArray(o,2*i*(s+1)),c,l,u=0;c=0;let m=c*i;for(l=0;l<i-1;l++)a[u++]=l+m,a[u++]=l+m+1;for(a[u++]=i-1+m,a[u++]=m,c=s-1,m=c*i,l=0;l<i-1;l++)a[u++]=l+m,a[u++]=l+m+1;for(a[u++]=i-1+m,a[u++]=m,c=0;c<s-1;c++){let y=i*c,f=y+i;for(l=0;l<i;l++)a[u++]=l+y,a[u++]=l+f}return new dt({attributes:n,indices:Ue.createTypedArray(o,a),boundingSphere:ce.fromVertices(e),primitiveType:Fe.LINES})}function N2(e){e=g(e,g.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+re.packedLength+2}N2.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var rde=re.clone(re.UNIT_SPHERE),M2={polylinePositions:void 0,shapePositions:void 0,ellipsoid:rde,height:void 0,cornerType:void 0,granularity:void 0};N2.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=re.unpack(e,t,rde);t+=re.packedLength;let c=e[t++],l=e[t];return d(n)?(n._positions=r,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=l,n):(M2.polylinePositions=r,M2.shapePositions=s,M2.cornerType=c,M2.granularity=l,new N2(M2))};var d4e=new He;N2.createGeometry=function(e){let t=e._positions,n=go(t,h.equalsEpsilon),i=e._shape;if(i=Mm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ai.computeWindingOrder2D(i)===Hr.CLOCKWISE&&i.reverse();let o=He.fromPoints(i,d4e),r=Mm.computePositions(n,i,o,e,!1);return l4e(r,i)};var U2=N2;var sde=new B;function u4e(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function lf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new u4e(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}d(Object.create)&&(lf.prototype=Object.create(oi.prototype),lf.prototype.constructor=lf);lf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof At){let c;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,sde)),d(c)||(c=B.WHITE),o=Ut.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new _t({id:t,geometry:new A2(this._options),attributes:i})};lf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,sde),o=this._distanceDisplayConditionProperty.getValue(e);return new _t({id:t,geometry:new U2(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};lf.prototype._isHidden=function(e,t){return!d(t.positions)||!d(t.shape)||oi.prototype._isHidden.call(this,e,t)};lf.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!H.isConstant(t.granularity)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.cornerType)};lf.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof At;o.vertexFormat=r?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ye.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ye.MINIMUM_VALUE,o.shape),o.granularity=d(n)?n.getValue(Ye.MINIMUM_VALUE):void 0,o.cornerType=d(i)?i.getValue(Ye.MINIMUM_VALUE):void 0};lf.DynamicGeometryUpdater=l1;function l1(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(l1.prototype=Object.create(ii.prototype),l1.prototype.constructor=l1);l1.prototype._isHidden=function(e,t,n){let i=this._options;return!d(i.polylinePositions)||!d(i.shapePositions)||ii.prototype._isHidden.call(this,e,t,n)};l1.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=H.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=H.getValueOrUndefined(t.shape,n),i.granularity=H.getValueOrUndefined(t.granularity,n),i.cornerType=H.getValueOrUndefined(t.cornerType,n)};var k2=lf;var sjn=T(S(),1);var w4n=T(S(),1);var pH=new h,lde=new h,dde=new h,ude=new h,mde=new de,m4e=new D,h4e=new ce,f4e=new ce;function hde(e,t){let n=new dt({attributes:new hn,primitiveType:Fe.TRIANGLES});return n.attributes.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function p4e(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,l=ude,u=dde,m=lde;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let y=h.fromArray(e,p,pH),f=c+1,x=c+2;m=n.geodeticSurfaceNormal(y,m),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,m,u),$.multiplyByVector(i,u,u),h.normalize(u,u),t.bitangent&&h.normalize(h.cross(m,u,l),l)),t.normal&&(r[c]=m.x,r[f]=m.y,r[x]=m.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[x]=u.z),t.bitangent&&(a[c]=l.x,a[f]=l.y,a[x]=l.z),c+=3}return hde(t,{positions:e,normals:r,tangents:s,bitangents:a})}var bH=new h,fde=new h;function b4e(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,l=0,u=!0,m=ude,p=dde,y=lde;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let x=h.fromArray(e,f,pH),_=h.fromArray(e,(f+6)%i,bH);if(u){let C=h.fromArray(e,(f+3)%i,fde);h.subtract(_,x,_),h.subtract(C,x,C),y=h.normalize(h.cross(C,_,y),y),u=!1}h.equalsEpsilon(_,x,W.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(m=n.geodeticSurfaceNormal(x,m),t.tangent&&(p=h.normalize(h.cross(m,y,p),p))),t.normal&&(o[a++]=y.x,o[a++]=y.y,o[a++]=y.z,o[a++]=y.x,o[a++]=y.y,o[a++]=y.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[l++]=m.x,s[l++]=m.y,s[l++]=m.z,s[l++]=m.x,s[l++]=m.y,s[l++]=m.z)}return hde(t,{positions:e,normals:o,tangents:r,bitangents:s})}function pde(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,l=o,u=o,m=0;s&&(c=1,u-=1,m+=1),a&&(l-=1,u-=1,m+=1),m+=r*u;let p=n.position?new Float64Array(m*3):void 0,y=n.st?new Float32Array(m*2):void 0,f=0,x=0,_=pH,C=m4e,V=Number.MAX_VALUE,L=Number.MAX_VALUE,Z=-Number.MAX_VALUE,G=-Number.MAX_VALUE;for(let R=c;R<l;++R)for(let E=0;E<r;++E)ls.computePosition(t,i,n.st,R,E,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(y[x++]=C.x,y[x++]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),G=Math.max(G,C.y));if(s&&(ls.computePosition(t,i,n.st,0,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(y[x++]=C.x,y[x++]=C.y,V=C.x,L=C.y,Z=C.x,G=C.y)),a&&(ls.computePosition(t,i,n.st,o-1,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(y[x++]=C.x,y[x]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),G=Math.max(G,C.y))),n.st&&(V<0||L<0||Z>1||G>1))for(let R=0;R<y.length;R+=2)y[R]=(y[R]-V)/(Z-V),y[R+1]=(y[R+1]-L)/(G-L);let X=p4e(p,n,i,t.tangentRotationMatrix),P=6*(r-1)*(u-1);s&&(P+=3*(r-1)),a&&(P+=3*(r-1));let v=Ue.createTypedArray(m,P),A=0,M=0,b;for(b=0;b<u-1;++b){for(let R=0;R<r-1;++R){let E=A,I=E+r,w=I+1,N=E+1;v[M++]=E,v[M++]=I,v[M++]=N,v[M++]=N,v[M++]=I,v[M++]=w,++A}++A}if(s||a){let R=m-1,E=m-1;s&&a&&(R=m-2);let I,w;if(A=0,s)for(b=0;b<r-1;b++)I=A,w=I+1,v[M++]=R,v[M++]=I,v[M++]=w,++A;if(a)for(A=(u-1)*r,b=0;b<r-1;b++)I=A,w=I+1,v[M++]=I,v[M++]=E,v[M++]=w,++A}return X.indices=v,n.st&&(X.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:y})),X}function d1(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function u1(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var yH=new We;function y4e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,l=t.width,u;if(n){let ot=We.clone(o,yH);ot.normal=!0,e._vertexFormat=ot}let m=pde(e,t);n&&(e._vertexFormat=o);let p=ai.scaleToGeodeticHeight(m.attributes.position.values,s,a,!1);p=new Float64Array(p);let y=p.length,f=y*2,x=new Float64Array(f);x.set(p);let _=ai.scaleToGeodeticHeight(m.attributes.position.values,r,a);x.set(_,y),m.attributes.position.values=x;let C=o.normal?new Float32Array(f):void 0,V=o.tangent?new Float32Array(f):void 0,L=o.bitangent?new Float32Array(f):void 0,Z=o.st?new Float32Array(f/3*2):void 0,G,X;if(o.normal){for(X=m.attributes.normal.values,C.set(X),u=0;u<y;u++)X[u]=-X[u];C.set(X,y),m.attributes.normal.values=C}if(n){X=m.attributes.normal.values,o.normal||(m.attributes.normal=void 0);let ot=new Float32Array(f);for(u=0;u<y;u++)X[u]=-X[u];ot.set(X,y),m.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:ot})}let P,v=d(i);if(v){let ot=y/3*2,ln=new Uint8Array(ot);i===rn.TOP?ln=ln.fill(1,0,ot/2):(P=i===rn.NONE?0:1,ln=ln.fill(P)),m.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:ln})}if(o.tangent){let ot=m.attributes.tangent.values;for(V.set(ot),u=0;u<y;u++)ot[u]=-ot[u];V.set(ot,y),m.attributes.tangent.values=V}if(o.bitangent){let ot=m.attributes.bitangent.values;L.set(ot),L.set(ot,y),m.attributes.bitangent.values=L}o.st&&(G=m.attributes.st.values,Z.set(G),Z.set(G,y/3*2),m.attributes.st.values=Z);let A=m.indices,M=A.length,b=y/3,R=Ue.createTypedArray(f/3,M*2);for(R.set(A),u=0;u<M;u+=3)R[u+M]=A[u+2]+b,R[u+1+M]=A[u+1]+b,R[u+2+M]=A[u]+b;m.indices=R;let E=t.northCap,I=t.southCap,w=c,N=2,Y=0,k=4,O=4;E&&(N-=1,w-=1,Y+=1,k-=2,O-=1),I&&(N-=1,w-=1,Y+=1,k-=2,O-=1),Y+=N*l+2*w-k;let U=(Y+O)*2,J=new Float64Array(U*3),z=n?new Float32Array(U*3):void 0,ee=v?new Uint8Array(U):void 0,K=o.st?new Float32Array(U*2):void 0,j=i===rn.TOP;v&&!j&&(P=i===rn.ALL?1:0,ee=ee.fill(P));let q=0,be=0,Te=0,ae=0,xe=l*w,_e;for(u=0;u<xe;u+=l)_e=u*3,J=d1(J,q,_e,p,_),q+=6,o.st&&(K=u1(K,be,u*2,G),be+=4),n&&(Te+=3,z[Te++]=X[_e],z[Te++]=X[_e+1],z[Te++]=X[_e+2]),j&&(ee[ae++]=1,ae+=1);if(I){let ot=E?xe+1:xe;for(_e=ot*3,u=0;u<2;u++)J=d1(J,q,_e,p,_),q+=6,o.st&&(K=u1(K,be,ot*2,G),be+=4),n&&(Te+=3,z[Te++]=X[_e],z[Te++]=X[_e+1],z[Te++]=X[_e+2]),j&&(ee[ae++]=1,ae+=1)}else for(u=xe-l;u<xe;u++)_e=u*3,J=d1(J,q,_e,p,_),q+=6,o.st&&(K=u1(K,be,u*2,G),be+=4),n&&(Te+=3,z[Te++]=X[_e],z[Te++]=X[_e+1],z[Te++]=X[_e+2]),j&&(ee[ae++]=1,ae+=1);for(u=xe-1;u>0;u-=l)_e=u*3,J=d1(J,q,_e,p,_),q+=6,o.st&&(K=u1(K,be,u*2,G),be+=4),n&&(Te+=3,z[Te++]=X[_e],z[Te++]=X[_e+1],z[Te++]=X[_e+2]),j&&(ee[ae++]=1,ae+=1);if(E){let ot=xe;for(_e=ot*3,u=0;u<2;u++)J=d1(J,q,_e,p,_),q+=6,o.st&&(K=u1(K,be,ot*2,G),be+=4),n&&(Te+=3,z[Te++]=X[_e],z[Te++]=X[_e+1],z[Te++]=X[_e+2]),j&&(ee[ae++]=1,ae+=1)}else for(u=l-1;u>=0;u--)_e=u*3,J=d1(J,q,_e,p,_),q+=6,o.st&&(K=u1(K,be,u*2,G),be+=4),n&&(Te+=3,z[Te++]=X[_e],z[Te++]=X[_e+1],z[Te++]=X[_e+2]),j&&(ee[ae++]=1,ae+=1);let Ve=b4e(J,o,a);o.st&&(Ve.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:K})),n&&(Ve.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:z})),v&&(Ve.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:ee}));let Ie=Ue.createTypedArray(U,Y*6),Me,ve,ke,ct;y=J.length/3;let yt=0;for(u=0;u<y-1;u+=2){Me=u,ct=(Me+2)%y;let ot=h.fromArray(J,Me*3,bH),ln=h.fromArray(J,ct*3,fde);h.equalsEpsilon(ot,ln,W.EPSILON10)||(ve=(Me+1)%y,ke=(ve+2)%y,Ie[yt++]=Me,Ie[yt++]=ve,Ie[yt++]=ct,Ie[yt++]=ct,Ie[yt++]=ve,Ie[yt++]=ke)}return Ve.indices=Ie,Ve=An.combineInstances([new _t({geometry:m}),new _t({geometry:Ve})]),Ve[0]}var g4e=[new h,new h,new h,new h],bde=new he,x4e=new he;function gH(e,t,n,i,o){if(n===0)return de.clone(e,o);let r=ls.computeOptions(e,t,n,0,mde,bde),s=r.height,a=r.width,c=g4e;return ls.computePosition(r,i,!1,0,0,c[0]),ls.computePosition(r,i,!1,0,a-1,c[1]),ls.computePosition(r,i,!1,s-1,0,c[2]),ls.computePosition(r,i,!1,s-1,a-1,c[3]),de.fromCartesianArray(c,i,o)}function df(e){e=g(e,g.EMPTY_OBJECT);let t=e.rectangle,n=g(e.height,0),i=g(e.extrudedHeight,n);this._rectangle=de.clone(t),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=g(e.rotation,0),this._stRotation=g(e.stRotation,0),this._vertexFormat=We.clone(g(e.vertexFormat,We.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}df.packedLength=de.packedLength+re.packedLength+We.packedLength+7;df.pack=function(e,t,n){return n=g(n,0),de.pack(e._rectangle,t,n),n+=de.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=g(e._offsetAttribute,-1),t};var yde=new de,gde=re.clone(re.UNIT_SPHERE),Ty={rectangle:yde,ellipsoid:gde,vertexFormat:yH,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};df.unpack=function(e,t,n){t=g(t,0);let i=de.unpack(e,t,yde);t+=de.packedLength;let o=re.unpack(e,t,gde);t+=re.packedLength;let r=We.unpack(e,t,yH);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],l=e[t++],u=e[t++],m=e[t++]===1,p=e[t];return d(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=l,n._extrudedHeight=u,n._shadowVolume=m,n._offsetAttribute=p===-1?void 0:p,n):(Ty.granularity=s,Ty.height=a,Ty.rotation=c,Ty.stRotation=l,Ty.extrudedHeight=u,Ty.shadowVolume=m,Ty.offsetAttribute=p===-1?void 0:p,new df(Ty))};df.computeRectangle=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.rectangle,i=g(e.granularity,W.RADIANS_PER_DEGREE),o=g(e.ellipsoid,re.WGS84),r=g(e.rotation,0);return gH(n,i,r,o,t)};var _4e=new $,ade=new Ae,T4e=new he;df.createGeometry=function(e){if(W.equalsEpsilon(e._rectangle.north,e._rectangle.south,W.EPSILON10)||W.equalsEpsilon(e._rectangle.east,e._rectangle.west,W.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=ls.computeOptions(t,e._granularity,i,o,mde,bde,x4e),a=_4e;if(o!==0||i!==0){let y=de.center(t,T4e),f=n.geodeticSurfaceNormalCartographic(y,bH);Ae.fromAxisAngle(f,-o,ade),$.fromQuaternion(ade,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,l=e._extrudedHeight,u=!W.equalsEpsilon(c,l,0,W.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let m,p;if(t=e._rectangle,u){m=y4e(e,s);let y=ce.fromRectangle3D(t,n,c,f4e),f=ce.fromRectangle3D(t,n,l,h4e);p=ce.union(y,f)}else{if(m=pde(e,s),m.attributes.position.values=ai.scaleToGeodeticHeight(m.attributes.position.values,c,n,!1),d(e._offsetAttribute)){let y=m.attributes.position.values.length,f=e._offsetAttribute===rn.NONE?0:1,x=new Uint8Array(y/3).fill(f);m.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ce.fromRectangle3D(t,n,c)}return r.position||delete m.attributes.position,new dt({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};df.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new df({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};var cde=new de,S4e=[new D,new D,new D],C4e=new $i,V4e=new he;function L4e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=de.clone(e._rectangle,cde),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=gH(t,n,o,i,cde),s=S4e;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=$i.fromRotation(e._stRotation,C4e),l=de.center(a,V4e);for(let f=0;f<3;++f){let x=s[f];x.x-=l.longitude,x.y-=l.latitude,$i.multiplyByVector(c,x,x),x.x+=l.longitude,x.y+=l.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let u=s[0],m=s[1],p=s[2],y=new Array(6);return D.pack(u,y),D.pack(m,y,2),D.pack(p,y,4),y}Object.defineProperties(df.prototype,{rectangle:{get:function(){return d(this._rotatedRectangle)||(this._rotatedRectangle=gH(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return d(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=L4e(this)),this._textureCoordinateRotationPoints}}});var E_=df;var xde=new B,_de=h.ZERO,Tde=new h,Sde=new de,R4e=new de,Z4e=new he;function G4e(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Hm(e,t){Hn.call(this,{entity:e,scene:t,geometryOptions:new G4e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}d(Object.create)&&(Hm.prototype=Object.create(Hn.prototype),Hm.prototype.constructor=Hm);Hm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof At){let o;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,xde)),d(o)||(o=B.WHITE),i.color=Ut.fromColor(o)}return d(this._options.offsetAttribute)&&(i.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,_de,Tde))),new _t({id:t,geometry:new E_(this._options),attributes:i})};Hm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,xde),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return d(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(H.getValueOrDefault(this._terrainOffsetProperty,e,_de,Tde))),new _t({id:t,geometry:new e_(this._options),attributes:r})};Hm.prototype._computeCenter=function(e,t){let n=H.getValueOrUndefined(this._entity.rectangle.coordinates,e,R4e);if(!d(n))return;let i=de.center(n,Z4e);return he.toCartesian(i,re.WGS84,t)};Hm.prototype._isHidden=function(e,t){return!d(t.coordinates)||oi.prototype._isHidden.call(this,e,t)};Hm.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!H.isConstant(t.height)||!H.isConstant(t.extrudedHeight)||!H.isConstant(t.granularity)||!H.isConstant(t.stRotation)||!H.isConstant(t.rotation)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.zIndex)||this._onTerrain&&!H.isConstant(this._materialProperty)&&!(this._materialProperty instanceof At)};Hm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof At,i=H.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),o=H.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,Ke.NONE),r=H.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),s=H.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,Ke.NONE);d(r)&&!d(i)&&(i=0);let a=this._options;a.vertexFormat=n?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ye.MINIMUM_VALUE,a.rectangle),a.granularity=H.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),a.stRotation=H.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),a.rotation=H.getValueOrUndefined(t.rotation,Ye.MINIMUM_VALUE),a.offsetAttribute=Hn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Hn.getGeometryHeight(i,o),r=Hn.getGeometryExtrudedHeight(r,s),r===Hn.CLAMP_TO_GROUND&&(r=li.getMinimumMaximumHeights(E_.computeRectangle(a,Sde)).minimumTerrainHeight),a.extrudedHeight=r};Hm.DynamicGeometryUpdater=m1;function m1(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(m1.prototype=Object.create(ii.prototype),m1.prototype.constructor=m1);m1.prototype._isHidden=function(e,t,n){return!d(this._options.rectangle)||ii.prototype._isHidden.call(this,e,t,n)};m1.prototype._setOptions=function(e,t,n){let i=this._options,o=H.getValueOrUndefined(t.height,n),r=H.getValueOrDefault(t.heightReference,n,Ke.NONE),s=H.getValueOrUndefined(t.extrudedHeight,n),a=H.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);d(s)&&!d(o)&&(o=0),i.rectangle=H.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=H.getValueOrUndefined(t.granularity,n),i.stRotation=H.getValueOrUndefined(t.stRotation,n),i.rotation=H.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Hn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Hn.getGeometryHeight(o,r),s=Hn.getGeometryExtrudedHeight(s,a),s===Hn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(E_.computeRectangle(i,Sde)).minimumTerrainHeight),i.extrudedHeight=s};var D2=Hm;var Sjn=T(S(),1);var Cde=new B,E4e=new Gt,X4e=new Gt,I4e=h.ZERO,W4e=new h;function zm(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.subscriptions=new Tt,this.showsUpdated=new Tt,this.itemsToRemove=[],this.invalidated=!1;let a;d(o)&&(a=o.definitionChanged.addEventListener(zm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}zm.prototype.onMaterialChanged=function(){this.invalidated=!0};zm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:d(t)?t.equals(n):!1};zm.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!H.isConstant(e.distanceDisplayConditionProperty)||!H.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};zm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return d(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};zm.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){d(i)&&(d(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;d(this.depthFailAppearanceType)&&(d(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Zn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{d(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;d(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(d(i)&&i.ready){i.show=!0,d(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),d(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof At)&&(this.depthFailMaterial=Yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let l=s[r],u=this.geometry.get(l.id),m=this.attributes.get(u.id.id);if(d(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!l.fillMaterialProperty.isConstant||c){let _=l.fillMaterialProperty.color,C=H.getValueOrDefault(_,e,B.WHITE,Cde);B.equals(m._lastColor,C)||(m._lastColor=B.clone(C,m._lastColor),m.color=Ut.toValue(C,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=l))}if(d(this.depthFailAppearanceType)&&l.depthFailMaterialProperty instanceof At&&(!l.depthFailMaterialProperty.isConstant||c)){let _=l.depthFailMaterialProperty.color,C=H.getValueOrDefault(_,e,B.WHITE,Cde);B.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=B.clone(C,m._lastDepthFailColor),m.depthFailColor=Ut.toValue(C,m.depthFailColor))}let p=l.entity.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=gn.toValue(p,m.show));let f=l.distanceDisplayConditionProperty;if(!H.isConstant(f)){let _=H.getValueOrDefault(f,e,X4e,E4e);Gt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Gt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Un.toValue(_,m.distanceDisplayCondition))}let x=l.terrainOffsetProperty;if(!H.isConstant(x)){let _=H.getValueOrDefault(x,e,I4e,W4e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=zi.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else d(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};zm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);d(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};zm.prototype.contains=function(e){return this.updaters.contains(e.id)};zm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!d(i)||!d(i.boundingSphere)||d(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};zm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;d(e)&&t.remove(e);let n=this.oldPrimitive;d(n)&&t.remove(n),d(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function h1(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}h1.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new zm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Vde(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}h1.prototype.remove=function(e){Vde(this._solidItems,e)||Vde(this._translucentItems,e)};function Lde(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let l=a[r];s.remove(l),e.add(n,l),i=!0}}return i}function aN(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let l=0;l<c;l++)e.add(n,a[l]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}h1.prototype.update=function(e){let t=aN(this,this._solidItems,e,!0);t=aN(this,this._translucentItems,e,t)&&t;let n=Lde(this,this._solidItems,e),i=Lde(this,this._translucentItems,e);return(n||i)&&(t=aN(this,this._solidItems,e,t)&&t,t=aN(this,this._translucentItems,e,t)&&t),t};function Rde(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return lt.FAILED}h1.prototype.getBoundingSphere=function(e,t){let n=Rde(this._solidItems,e,t);return n===lt.FAILED?Rde(this._translucentItems,e,t):n};function Zde(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}h1.prototype.removeAllPrimitives=function(){Zde(this._solidItems),Zde(this._translucentItems)};var Gu=h1;var Mjn=T(S(),1);var P4e=new Gt,v4e=new Gt,w4e=h.ZERO,F4e=new h;function Jm(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Jm.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt}Jm.prototype.onMaterialChanged=function(){this.invalidated=!0};Jm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=d(t)&&t.equals(n);return r=(!d(i)&&!d(o)||d(i)&&i.equals(o))&&r,r};Jm.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!H.isConstant(t.distanceDisplayConditionProperty)||!H.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Jm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return d(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var A4e=new B;Jm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){d(n)&&(d(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Yo.getValue(e,this.materialProperty,this.material);let a;d(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Zn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{d(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;d(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(d(n)&&n.ready){n.show=!0,d(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Yo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,d(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof At)&&(this.depthFailMaterial=Yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],l=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(d(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),d(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof At&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,C=H.getValueOrDefault(_,e,B.WHITE,A4e);B.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=B.clone(C,m._lastDepthFailColor),m.depthFailColor=Ut.toValue(C,m.depthFailColor))}let p=l.isShowing&&(c.hasConstantFill||c.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=gn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!H.isConstant(f)){let _=H.getValueOrDefault(f,e,v4e,P4e);Gt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Gt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Un.toValue(_,m.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!H.isConstant(x)){let _=H.getValueOrDefault(x,e,w4e,F4e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=zi.toValue(_,m.offset))}}this.updateShows(n)}else d(n)&&!n.ready&&(t=!1);return t};Jm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);d(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,l=a.show[0]===1;c!==l&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Jm.prototype.contains=function(e){return this.updaters.contains(e.id)};Jm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!d(i)||!d(i.boundingSphere)||d(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Jm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;d(e)&&t.remove(e);let n=this.oldPrimitive;d(n)&&t.remove(n),this.removeMaterialSubscription()};function f1(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}f1.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new Jm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};f1.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};f1.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};f1.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};f1.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Eu=f1;var e8n=T(S(),1);var kjn=T(S(),1),Ede=T(Gde(),1);function cN(){this._tree=new Ede.default}function X_(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}X_.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};cN.prototype.insert=function(e,t){let n=X_.fromRectangleAndId(e,t,new X_);this._tree.insert(n)};function M4e(e,t){return e.id===t.id}var N4e=new X_;cN.prototype.remove=function(e,t){let n=X_.fromRectangleAndId(e,t,N4e);this._tree.remove(n,M4e)};var U4e=new X_;cN.prototype.collides=function(e){let t=X_.fromRectangleAndId("",e,U4e);return this._tree.collides(t)};var I_=cN;var k4e=new B,D4e=new Gt,B4e=new Gt;function _0(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.subscriptions=new Tt,this.showsUpdated=new Tt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new I_}_0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};_0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!H.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};_0.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return d(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};_0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)d(i)&&(d(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Rc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{d(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;d(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(d(i)&&i.ready){i.show=!0,d(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let l=s[r],u=this.geometry.get(l.id),m=this.attributes.get(u.id.id);if(d(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!l.fillMaterialProperty.isConstant||c){let x=l.fillMaterialProperty.color,_=H.getValueOrDefault(x,e,B.WHITE,k4e);B.equals(m._lastColor,_)||(m._lastColor=B.clone(_,m._lastColor),m.color=Ut.toValue(_,m.color))}let p=l.entity.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=gn.toValue(p,m.show));let f=l.distanceDisplayConditionProperty;if(!H.isConstant(f)){let x=H.getValueOrDefault(f,e,B4e,D4e);Gt.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Gt.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Un.toValue(x,m.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else d(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};_0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);d(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};_0.prototype.contains=function(e){return this.updaters.contains(e.id)};_0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getBoundingSphere(e.entity);return d(i)?(i.clone(t),lt.DONE):lt.FAILED};_0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;d(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;d(n)&&(e.remove(n),this.oldPrimitive=void 0)};function p1(e,t){this._batches=[],this._primitives=e,this._classificationType=t}p1.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=H.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return d(r)||(r=new _0(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};p1.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};p1.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let l=0;l<c;l++){n=a[l],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};p1.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};p1.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var b1=p1;var f8n=T(S(),1);var Y4e=new Gt,O4e=new Gt;function Xu(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Xu.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new I_}Xu.prototype.onMaterialChanged=function(){this.invalidated=!0};Xu.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Xu.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof At&&t instanceof At?!0:d(t)&&t.equals(n)};Xu.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!H.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Xu.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return d(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Xu.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)d(n)&&(d(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Yo.getValue(e,this.materialProperty,this.material),n=new Rc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{d(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;d(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(d(n)&&n.ready){n.show=!0,d(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Yo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],l=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);d(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m));let p=l.isShowing&&(c.hasConstantFill||c.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=gn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!H.isConstant(f)){let x=H.getValueOrDefault(f,e,O4e,Y4e);Gt.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Gt.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Un.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else d(n)&&!n.ready&&(t=!1);return t};Xu.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);d(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,l=a.show[0]===1;c!==l&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Xu.prototype.contains=function(e){return this.updaters.contains(e.id)};Xu.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!d(i)||!d(i.boundingSphere)||d(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Xu.prototype.destroy=function(){let e=this.primitive,t=this.primitives;d(e)&&t.remove(e);let n=this.oldPrimitive;d(n)&&t.remove(n),this.removeMaterialSubscription()};function y1(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}y1.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Ql.shouldUseSphericalCoordinates(o.geometry.rectangle),s=H.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let l=n[c];if(l.isMaterial(t)&&l.usingSphericalTextureCoordinates===r&&l.zIndex===s&&!l.overlapping(o.geometry.rectangle)){l.add(e,t,o);return}}let a=new Xu(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};y1.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};y1.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};y1.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};y1.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var B2=y1;var E8n=T(S(),1);var K4e=new B,H4e=new Gt,z4e=new Gt,J4e=h.ZERO,Q4e=new h;function T0(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.updaters=new Tt,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.itemsToRemove=[],this.subscriptions=new Tt,this.showsUpdated=new Tt}T0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!H.isConstant(e.distanceDisplayConditionProperty)||!H.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};T0.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return d(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};T0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)d(i)&&(d(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Zn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new sn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{d(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;d(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(d(i)&&i.ready){i.show=!0,d(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let l=s[r],u=this.geometry.get(l.id),m=this.attributes.get(u.id.id);if(d(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!l.outlineColorProperty.isConstant||c){let _=l.outlineColorProperty,C=H.getValueOrDefault(_,e,B.WHITE,K4e);B.equals(m._lastColor,C)||(m._lastColor=B.clone(C,m._lastColor),m.color=Ut.toValue(C,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=l))}let p=l.entity.isShowing&&(l.hasConstantOutline||l.isOutlineVisible(e)),y=m.show[0]===1;p!==y&&(m.show=gn.toValue(p,m.show));let f=l.distanceDisplayConditionProperty;if(!H.isConstant(f)){let _=H.getValueOrDefault(f,e,z4e,H4e);Gt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Gt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Un.toValue(_,m.distanceDisplayCondition))}let x=l.terrainOffsetProperty;if(!H.isConstant(x)){let _=H.getValueOrDefault(x,e,J4e,Q4e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=zi.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else d(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};T0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);d(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};T0.prototype.contains=function(e){return this.updaters.contains(e.id)};T0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!d(i)||!d(i.boundingSphere)||d(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};T0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;d(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;d(n)&&(e.remove(n),this.oldPrimitive=void 0)};function g1(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Tt,this._translucentBatches=new Tt}g1.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),d(r)||(r=new T0(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),d(r)||(r=new T0(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};g1.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};g1.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,l,u=!0,m=!1;do{for(m=!1,n=0;n<s;n++){o=r[n],u=o.update(e),l=o.itemsToRemove;let p=l.length;if(p>0)for(m=!0,t=0;t<p;t++)i=l[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),l=o.itemsToRemove;let p=l.length;if(p>0)for(m=!0,t=0;t<p;t++)i=l[t],o.remove(i),this.add(e,i)}}while(m);return u};g1.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return lt.FAILED};g1.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var x1=g1;var I7n=T(S(),1);var $8n=T(S(),1);var A8n=T(S(),1);var Xde={};function j4e(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var q4e=new he,$4e=new he;function eje(e,t,n,i){t=go(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=d(i),s=d(n),a=new Array(o),c=new Array(o),l=new Array(o),u=t[0];a[0]=u;let m=e.cartesianToCartographic(u,q4e);s&&(m.height=n[0]),c[0]=m.height,r?l[0]=i[0]:l[0]=0;let p=c[0],y=l[0],f=p===y,x=1;for(let _=1;_<o;++_){let C=t[_],V=e.cartesianToCartographic(C,$4e);s&&(V.height=n[_]),f=f&&V.height===0,j4e(m,V)?m.height<V.height&&(c[x-1]=V.height):(a[x]=C,c[x]=V.height,r?l[x]=i[_]:l[x]=0,f=f&&c[x]===l[x],he.clone(V,m),++x)}if(!(f||x<2))return a.length=x,c.length=x,l.length=x,{positions:a,topHeights:c,bottomHeights:l}}var tje=new Array(2),nje=new Array(2),ije={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Xde.computePositions=function(e,t,n,i,o,r){let s=eje(e,t,n,i);if(!d(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,l,u,m=W.chordLength(o,e.maximumRadius),p=ije;if(p.minDistance=m,p.ellipsoid=e,r){let y=0,f;for(f=0;f<a-1;f++)y+=Xi.numberOfPoints(t[f],t[f+1],m)+1;l=new Float64Array(y*3),u=new Float64Array(y*3);let x=tje,_=nje;p.positions=x,p.height=_;let C=0;for(f=0;f<a-1;f++){x[0]=t[f],x[1]=t[f+1],_[0]=n[f],_[1]=n[f+1];let V=Xi.generateArc(p);l.set(V,C),_[0]=i[f],_[1]=i[f+1],u.set(Xi.generateArc(p),C),C+=V.length}}else p.positions=t,p.height=n,l=new Float64Array(Xi.generateArc(p)),p.height=i,u=new Float64Array(Xi.generateArc(p));return{bottomPositions:u,topPositions:l,numCorners:c}};var W_=Xde;var TH=new h,lN=new h,oje=new h,Ide=new h,rje=new h,sje=new h,aje=new h;function P_(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=g(e.vertexFormat,We.DEFAULT),r=g(e.granularity,W.RADIANS_PER_DEGREE),s=g(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=We.clone(o),this._granularity=r,this._ellipsoid=re.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;d(i)&&(a+=i.length),d(n)&&(a+=n.length),this.packedLength=a+re.packedLength+We.packedLength+1}P_.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=d(s)?s.length:0,t[n++]=r,d(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=d(a)?a.length:0,t[n++]=r,d(a))for(i=0;i<r;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._granularity,t};var Wde=re.clone(re.UNIT_SPHERE),Pde=new We,Y2={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Wde,vertexFormat:Pde,granularity:void 0};P_.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=re.unpack(e,t,Wde);t+=re.packedLength;let l=We.unpack(e,t,Pde);t+=We.packedLength;let u=e[t];return d(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._vertexFormat=We.clone(l,n._vertexFormat),n._granularity=u,n):(Y2.positions=r,Y2.minimumHeights=s,Y2.maximumHeights=a,Y2.granularity=u,new P_(Y2))};P_.fromConstantHeights=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=d(o),a=d(r);if(s||a){let l=t.length;n=s?new Array(l):void 0,i=a?new Array(l):void 0;for(let u=0;u<l;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new P_(c)};P_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=W_.computePositions(s,t,i,n,r,!0);if(!d(a))return;let c=a.bottomPositions,l=a.topPositions,u=a.numCorners,m=l.length,p=m*2,y=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,_=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,V=0,L=0,Z=0,G=0,X=0,P=aje,v=sje,A=rje,M=!0;m/=3;let b,R=0,E=1/(m-u-1);for(b=0;b<m;++b){let k=b*3,O=h.fromArray(l,k,TH),U=h.fromArray(c,k,lN);if(o.position&&(y[V++]=U.x,y[V++]=U.y,y[V++]=U.z,y[V++]=O.x,y[V++]=O.y,y[V++]=O.z),o.st&&(C[X++]=R,C[X++]=0,C[X++]=R,C[X++]=1),o.normal||o.tangent||o.bitangent){let J=h.clone(h.ZERO,Ide),z=h.subtract(O,s.geodeticSurfaceNormal(O,lN),lN);if(b+1<m&&(J=h.fromArray(l,k+3,Ide)),M){let ee=h.subtract(J,O,oje),K=h.subtract(z,O,TH);P=h.normalize(h.cross(K,ee,P),P),M=!1}h.equalsEpsilon(O,J,W.EPSILON10)?M=!0:(R+=E,o.tangent&&(v=h.normalize(h.subtract(J,O,v),v)),o.bitangent&&(A=h.normalize(h.cross(P,v,A),A))),o.normal&&(f[L++]=P.x,f[L++]=P.y,f[L++]=P.z,f[L++]=P.x,f[L++]=P.y,f[L++]=P.z),o.tangent&&(x[G++]=v.x,x[G++]=v.y,x[G++]=v.z,x[G++]=v.x,x[G++]=v.y,x[G++]=v.z),o.bitangent&&(_[Z++]=A.x,_[Z++]=A.y,_[Z++]=A.z,_[Z++]=A.x,_[Z++]=A.y,_[Z++]=A.z)}}let I=new hn;o.position&&(I.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:y})),o.normal&&(I.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(I.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(I.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(I.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C}));let w=p/3;p-=6*(u+1);let N=Ue.createTypedArray(w,p),Y=0;for(b=0;b<w-2;b+=2){let k=b,O=b+2,U=h.fromArray(y,k*3,TH),J=h.fromArray(y,O*3,lN);if(h.equalsEpsilon(U,J,W.EPSILON10))continue;let z=b+1,ee=b+3;N[Y++]=z,N[Y++]=k,N[Y++]=ee,N[Y++]=ee,N[Y++]=k,N[Y++]=O}return new dt({attributes:I,indices:N,primitiveType:Fe.TRIANGLES,boundingSphere:new ce.fromVertices(y)})};var O2=P_;var f7n=T(S(),1);var vde=new h,wde=new h;function v_(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=g(e.granularity,W.RADIANS_PER_DEGREE),r=g(e.ellipsoid,re.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=re.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;d(i)&&(s+=i.length),d(n)&&(s+=n.length),this.packedLength=s+re.packedLength+1}v_.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=d(s)?s.length:0,t[n++]=r,d(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=d(a)?a.length:0,t[n++]=r,d(a))for(i=0;i<r;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n]=e._granularity,t};var Fde=re.clone(re.UNIT_SPHERE),K2={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Fde,granularity:void 0};v_.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=re.unpack(e,t,Fde);t+=re.packedLength;let l=e[t];return d(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(c,n._ellipsoid),n._granularity=l,n):(K2.positions=r,K2.minimumHeights=s,K2.maximumHeights=a,K2.granularity=l,new v_(K2))};v_.fromConstantHeights=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=d(o),a=d(r);if(s||a){let l=t.length;n=s?new Array(l):void 0,i=a?new Array(l):void 0;for(let u=0;u<l;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new v_(c)};v_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=W_.computePositions(r,t,i,n,o,!1);if(!d(s))return;let a=s.bottomPositions,c=s.topPositions,l=c.length,u=l*2,m=new Float64Array(u),p=0;l/=3;let y;for(y=0;y<l;++y){let V=y*3,L=h.fromArray(c,V,vde),Z=h.fromArray(a,V,wde);m[p++]=Z.x,m[p++]=Z.y,m[p++]=Z.z,m[p++]=L.x,m[p++]=L.y,m[p++]=L.z}let f=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})}),x=u/3;u=2*x-4+x;let _=Ue.createTypedArray(x,u),C=0;for(y=0;y<x-2;y+=2){let V=y,L=y+2,Z=h.fromArray(m,V*3,vde),G=h.fromArray(m,L*3,wde);if(h.equalsEpsilon(Z,G,W.EPSILON10))continue;let X=y+1,P=y+3;_[C++]=X,_[C++]=V,_[C++]=X,_[C++]=P,_[C++]=V,_[C++]=L}return _[C++]=x-2,_[C++]=x-1,new dt({attributes:f,indices:_,primitiveType:Fe.LINES,boundingSphere:new ce.fromVertices(m)})};var H2=v_;var Ade=new B;function cje(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Qm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new cje(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}d(Object.create)&&(Qm.prototype=Object.create(oi.prototype),Qm.prototype.constructor=Qm);Qm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof At){let c;d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Ade)),d(c)||(c=B.WHITE),o=Ut.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new _t({id:t,geometry:new O2(this._options),attributes:i})};Qm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=H.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Ade),o=this._distanceDisplayConditionProperty.getValue(e);return new _t({id:t,geometry:new H2(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ut.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Qm.prototype._isHidden=function(e,t){return!d(t.positions)||oi.prototype._isHidden.call(this,e,t)};Qm.prototype._getIsClosed=function(e){return!1};Qm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!H.isConstant(t.minimumHeights)||!H.isConstant(t.maximumHeights)||!H.isConstant(t.outlineWidth)||!H.isConstant(t.granularity)};Qm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof At,s=this._options;s.vertexFormat=r?sn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ye.MINIMUM_VALUE,s.positions),s.minimumHeights=d(n)?n.getValue(Ye.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=d(i)?i.getValue(Ye.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=d(o)?o.getValue(Ye.MINIMUM_VALUE):void 0};Qm.DynamicGeometryUpdater=_1;function _1(e,t,n){ii.call(this,e,t,n)}d(Object.create)&&(_1.prototype=Object.create(ii.prototype),_1.prototype.constructor=_1);_1.prototype._isHidden=function(e,t,n){return!d(this._options.positions)||ii.prototype._isHidden.call(this,e,t,n)};_1.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=H.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=H.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=H.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=H.getValueOrUndefined(t.granularity,n)};var z2=Qm;var lje=[],Mde=[_E,m2,i2,L2,Z2,X2,v2,k2,D2,z2];function J2(e,t){this.entity=e,this.scene=t;let n=new Array(Mde.length),i=new ye;function o(s){i.raiseEvent(s)}let r=new Lr;for(let s=0;s<n.length;s++){let a=new Mde[s](e,t);r.add(a.geometryChanged,o),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(J2.prototype._onEntityPropertyChanged,this)}J2.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};J2.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};J2.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function Iu(e,t,n,i){n=g(n,e.primitives),i=g(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Tt,this._removedObjects=new Tt,this._changedObjects=new Tt;let o=xn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=Oo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new x1(n,e,s,!1),this._outlineBatches[o+s]=new x1(n,e,s,!0),this._closedColorBatches[s]=new Gu(n,sn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Gu(n,sn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Eu(n,so,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Eu(n,so,void 0,!0,s,!1),this._openColorBatches[s]=new Gu(n,sn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Gu(n,sn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Eu(n,so,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Eu(n,so,void 0,!1,s,!1);let a=kn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),l=[];if(r)for(s=0;s<a;++s)l.push(new B2(i,s,so)),c[s]=new b1(i,s);else for(s=0;s<a;++s)c[s]=new b1(i,s);this._groundColorBatches=c,this._groundMaterialBatches=l,this._dynamicBatch=new C_(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Tt,this._updaterSets=new Tt,this._entityCollection=t,t.collectionChanged.addEventListener(Iu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,lje)}Iu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,l,u,m=this;for(a=s.length-1;a>-1;a--)c=s[a],l=c.id,u=this._updaterSets.get(l),u.entity===c?u.forEach(function(x){m._removeUpdater(x),m._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],l=c.id,u=this._updaterSets.get(l),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(l),this._subscriptions.get(l)(),this._subscriptions.remove(l);for(a=n.length-1;a>-1;a--)c=n[a],l=c.id,u=new J2(c,this._scene),this._updaterSets.set(l,u),u.forEach(function(x){m._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(l,u.geometryChanged.addEventListener(Iu._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,y=this._batches,f=y.length;for(a=0;a<f;a++)p=y[a].update(e)&&p;return p};var dje=[],uje=new ce;Iu.prototype.getBoundingSphere=function(e,t){let n=dje,i=uje,o=0,r=lt.DONE,s=this._batches,a=s.length,c=e.id,l=this._updaterSets.get(c).updaters;for(let u=0;u<l.length;u++){let m=l[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(m,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=ce.clone(i,n[o]),o++)}}return o===0?lt.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),lt.DONE)};Iu.prototype.isDestroyed=function(){return!1};Iu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Iu.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Iu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Iu.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=xn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(d(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof At?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof At?d(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):d(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof At?d(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):d(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Iu._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!d(t.get(o))&&!d(n.get(o))&&n.set(o,i)};Iu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Q2=Iu;var R6n=T(S(),1);var mje=1,hje="30px sans-serif",fje=vo.FILL,pje=B.WHITE,bje=B.BLACK,yje=1,gje=!1,xje=new B(.165,.165,.165,.8),_je=new D(7,5),Tje=D.ZERO,Sje=h.ZERO,Cje=Ke.NONE,Vje=bi.CENTER,Lje=In.CENTER,Rje=new h,Zje=new B,Gje=new B,Eje=new B,Xje=new D,Ije=new h,Wje=new D,Pje=new Pt,vje=new Pt,wje=new Pt,Fje=new Gt;function Nde(e){this.entity=e,this.label=void 0,this.index=void 0}function Sy(e,t){t.collectionChanged.addEventListener(Sy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Sy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,l=r.label,u=s.isShowing&&s.isAvailable(e)&&H.getValueOrDefault(a._show,e,!0),m;if(u&&(m=H.getValueOrUndefined(s._position,e,Rje),c=H.getValueOrUndefined(a._text,e),u=d(m)&&d(c)),!u){SH(r,s,n);continue}H.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,y=H.getValueOrDefault(a._heightReference,e,Cje);d(l)||(l=n.getLabel(s),l.id=s,r.label=l,p=h.equals(l.position,m)&&l.heightReference===y),l.show=!0,l.position=m,l.text=c,l.scale=H.getValueOrDefault(a._scale,e,mje),l.font=H.getValueOrDefault(a._font,e,hje),l.style=H.getValueOrDefault(a._style,e,fje),l.fillColor=H.getValueOrDefault(a._fillColor,e,pje,Zje),l.outlineColor=H.getValueOrDefault(a._outlineColor,e,bje,Gje),l.outlineWidth=H.getValueOrDefault(a._outlineWidth,e,yje),l.showBackground=H.getValueOrDefault(a._showBackground,e,gje),l.backgroundColor=H.getValueOrDefault(a._backgroundColor,e,xje,Eje),l.backgroundPadding=H.getValueOrDefault(a._backgroundPadding,e,_je,Xje),l.pixelOffset=H.getValueOrDefault(a._pixelOffset,e,Tje,Wje),l.eyeOffset=H.getValueOrDefault(a._eyeOffset,e,Sje,Ije),l.heightReference=y,l.horizontalOrigin=H.getValueOrDefault(a._horizontalOrigin,e,Vje),l.verticalOrigin=H.getValueOrDefault(a._verticalOrigin,e,Lje),l.translucencyByDistance=H.getValueOrUndefined(a._translucencyByDistance,e,Pje),l.pixelOffsetScaleByDistance=H.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,vje),l.scaleByDistance=H.getValueOrUndefined(a._scaleByDistance,e,wje),l.distanceDisplayCondition=H.getValueOrUndefined(a._distanceDisplayCondition,e,Fje),l.disableDepthTestDistance=H.getValueOrUndefined(a._disableDepthTestDistance,e),p&&l._updateClamping()}return!0};Sy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!d(n)||!d(n.label))return lt.FAILED;let i=n.label;return t.center=h.clone(g(i._clampedPosition,i.position),t.center),t.radius=0,lt.DONE};Sy.prototype.isDestroyed=function(){return!1};Sy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Sy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};Sy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],d(r._label)&&d(r._position)&&s.set(r.id,new Nde(r));for(o=i.length-1;o>-1;o--)r=i[o],d(r._label)&&d(r._position)?s.contains(r.id)||s.set(r.id,new Nde(r)):(SH(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],SH(s.get(r.id),r,a),s.remove(r.id)};function SH(e,t,n){d(e)&&(e.label=void 0,n.removeLabel(t))}var j2=Sy;var eqn=T(S(),1);var v6n=T(S(),1);var E6n=T(S(),1);async function Aje(e,t,n,i){return d(i)||(i=!1),Uje(e,t,n,i)}function Mje(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(kde(i)):r=o.then(kde(i)).catch(kje(i)),e.shift(),t.push(r),!0}function Nje(e){return new Promise(function(t){setTimeout(t,e)})}function CH(e,t,n){return e.length?Mje(e,t,n)?CH(e,t):Nje(100).then(()=>CH(e,t)):Promise.resolve()}function Uje(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let l=o.positionToTileXY(n[r],t);if(!d(l))continue;let u=l.toString();if(!a.hasOwnProperty(u)){let m={x:l.x,y:l.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=m,s.push(m)}a[u].positions.push(n[r])}let c=[];return CH(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Ude(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function kde(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!Ude(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];Ude(s,i,n)}}):Promise.resolve()}}function kje(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var q2=Aje;var VH=new D;async function Dde(e,t,n){d(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let l=t[c],u=r.computeMaximumLevelAtPosition(l);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(l,1,VH);let p=e.loadTileDataAvailability(VH.x,VH.y,1);d(p)&&s.push(p)}let m=i[u];d(m)||(i[u]=m=[]),m.push(l)}await Promise.all(s),await Promise.all(i.map(function(c,l){if(d(c))return q2(e,l,c,n)}));let a=[];for(let c=0;c<t.length;++c){let l=t[c];r.computeMaximumLevelAtPosition(l)!==o[c]&&a.push(l)}return a.length>0&&await Dde(e,a,n),t}var S0=Dde;var Dje=1,Bje=0,Yje=!0,Oje=!0,Kje=xn.ENABLED,Hje=Ke.NONE,zje=B.RED,Jje=0,Qje=B.WHITE,jje=Ha.HIGHLIGHT,qje=.5,$je=new D(1,1),e8e=new F,t8e=new F,Bde=new B,Yde=new Array(4),n8e=new h;function uf(e,t){t.collectionChanged.addEventListener(uf.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Tt,this._onCollectionChanged(t,t.values,[],[])}async function i8e(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await Xm.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!d(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{d(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!d(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}uf.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,l=n[s.id],u=s.isShowing&&s.isAvailable(e)&&H.getValueOrDefault(a._show,e,!0),m;if(u&&(m=s.computeModelMatrix(e,e8e),c=Ee.createIfNeeded(H.getValueOrUndefined(a._uri,e)),u=d(m)&&d(c)),!u){d(l)&&l.modelPrimitive&&(l.modelPrimitive.show=!1);continue}if(!d(l)||c.url!==l.url){d(l?.modelPrimitive)&&(i.removeAndDestroy(l.modelPrimitive),delete n[s.id]),l={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,awaitingSampleTerrain:!1,clampedBoundingSphere:void 0,sampleTerrainFailed:!1},n[s.id]=l;let f=H.getValueOrDefault(a._incrementallyLoadTextures,e,Yje);i8e(this,s,c,f)}let p=l.modelPrimitive;if(!d(p))continue;p.show=!0,p.scale=H.getValueOrDefault(a._scale,e,Dje),p.minimumPixelSize=H.getValueOrDefault(a._minimumPixelSize,e,Bje),p.maximumScale=H.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(m,p.modelMatrix),p.shadows=H.getValueOrDefault(a._shadows,e,Kje),p.heightReference=H.getValueOrDefault(a._heightReference,e,Hje),p.distanceDisplayCondition=H.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=H.getValueOrDefault(a._silhouetteColor,e,zje,Bde),p.silhouetteSize=H.getValueOrDefault(a._silhouetteSize,e,Jje),p.color=H.getValueOrDefault(a._color,e,Qje,Bde),p.colorBlendMode=H.getValueOrDefault(a._colorBlendMode,e,jje),p.colorBlendAmount=H.getValueOrDefault(a._colorBlendAmount,e,qje),p.clippingPlanes=H.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=H.getValueOrDefault(a._clampAnimations,e,Oje),p.imageBasedLighting.imageBasedLightingFactor=H.getValueOrDefault(a._imageBasedLightingFactor,e,$je);let y=H.getValueOrUndefined(a._lightColor,e);if(d(y)&&(B.pack(y,Yde,0),y=h.unpack(Yde,0,n8e)),p.lightColor=y,p.customShader=H.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let f=H.getValueOrDefault(a._runAnimations,e,!0);l.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:Tl.REPEAT}):p.activeAnimations.removeAll(),l.animationsRunning=f);let x=H.getValueOrUndefined(a._nodeTransformations,e,l.nodeTransformationsScratch);if(d(x)){let V=Object.keys(x);for(let L=0,Z=V.length;L<Z;++L){let G=V[L],X=x[G];if(!d(X))continue;let P=p.getNode(G);if(!d(P))continue;let v=F.fromTranslationRotationScale(X,t8e);P.matrix=F.multiply(P.originalMatrix,v,v)}}let _=!1,C=H.getValueOrUndefined(a._articulations,e,l.articulationsScratch);if(d(C)){let V=Object.keys(C);for(let L=0,Z=V.length;L<Z;++L){let G=V[L],X=C[G];d(X)&&(_=!0,p.setArticulationStage(G,X))}}_&&p.applyArticulations()}}return!0};uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(uf.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)LH(this,e[i],t,n);return ue(this)};uf._sampleTerrainMostDetailed=S0;var T1=new h,Ode=new he;uf.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!d(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!d(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let r=this._scene.globe,s=d(r)?r.terrainProvider:void 0,a=i.heightReference!==Ke.NONE;if(d(r)&&a){let c=r.ellipsoid,l=i.modelMatrix;T1.x=l[12],T1.y=l[13],T1.z=l[14];let u=c.cartesianToCartographic(T1);if(!d(s.availability)){i.heightReference===Ke.CLAMP_TO_GROUND&&(u.height=0);let y=c.cartographicToCartesian(u);return ce.clone(i.boundingSphere,t),t.center=y,lt.DONE}let m=this._modelHash[e.id].clampedBoundingSphere;return this._modelHash[e.id].sampleTerrainFailed?(this._modelHash[e.id].sampleTerrainFailed=!1,lt.FAILED):d(m)?(ce.clone(m,t),this._modelHash[e.id].clampedBoundingSphere=void 0,lt.DONE):(m=new ce,this._modelHash[e.id].awaitingSampleTerrain||(he.clone(u,Ode),this._modelHash[e.id].awaitingSampleTerrain=!0,uf._sampleTerrainMostDetailed(s,[Ode]).then(f=>{if(this.isDestroyed())return;this._modelHash[e.id].awaitingSampleTerrain=!1;let x=f[0];i.heightReference===Ke.RELATIVE_TO_GROUND&&(x.height+=u.height),c.cartographicToCartesian(x,T1),ce.clone(i.boundingSphere,m),m.center=T1,this._modelHash[e.id].clampedBoundingSphere=ce.clone(m)}).catch(f=>{this.isDestroyed()||(this._modelHash[e.id].sampleTerrainFailed=!0,this._modelHash[e.id].awaitingSampleTerrain=!1)})),lt.PENDING)}return ce.clone(i.boundingSphere,t),lt.DONE};uf.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],d(r._model)&&d(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],d(r._model)&&d(r._position)?(o8e(r,a),s.set(r.id,r)):(LH(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],LH(this,r,a,c),s.remove(r.id)};function LH(e,t,n,i){let o=n[t.id];d(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function o8e(e,t){let n=t[e.id];d(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var $2=uf;var Eqn=T(S(),1);var aqn=T(S(),1);function Cy(e){this._definitionChanged=new ye,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Cy.prototype,{isConstant:{get:function(){return H.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return d(this._value)?this._value.referenceFrame:io.FIXED}}});Cy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,io.FIXED,t)};Cy.prototype.setValue=function(e){this._value!==e&&(this._value=e,d(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),d(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Cy.prototype.getValueInReferenceFrame=function(e,t,n){if(d(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),d(n)?re.WGS84.scaleToGeodeticSurface(n,n):void 0};Cy.prototype.equals=function(e){return this===e||e instanceof Cy&&this._value===e._value};Cy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var mf=Cy;var r8e=60,s8e=1,zde=new Tn,RH=new Tn,ZH=new Tn;function Kde(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function a8e(e,t,n,i,o,r,s,a,c){let l=a,u;u=e.getValueInReferenceFrame(t,r,c[l]),d(u)&&(c[l++]=u);let m=!d(o)||te.lessThanOrEquals(o,t)||te.greaterThanOrEquals(o,n),p=0,y=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p<y;){if(!m&&te.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[l]),d(u)&&(c[l++]=u),m=!0),te.greaterThan(f,t)&&te.lessThan(f,x)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[l]),d(u)&&(c[l++]=u)),p<y-1){if(s>0&&!_){let Z=i[p+1],G=te.secondsDifference(Z,f);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V<C){f=te.addSeconds(f,L,new te),V++;continue}}_=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[l]),d(u)&&(c[l++]=u),l}function c8e(e,t,n,i,o,r,s,a){let c,l=0,u=s,m=t,p=Math.max(r,60),y=!d(i)||te.lessThanOrEquals(i,t)||te.greaterThanOrEquals(i,n);for(;te.lessThan(m,n);)!y&&te.greaterThanOrEquals(m,i)&&(y=!0,c=e.getValueInReferenceFrame(i,o,a[u]),d(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),d(c)&&(a[u]=c,u++),l++,m=te.addSeconds(t,p*l,new te);return c=e.getValueInReferenceFrame(n,o,a[u]),d(c)&&(a[u]=c,u++),u}function l8e(e,t,n,i,o,r,s,a){ZH.start=t,ZH.stop=n;let c=s,l=e.intervals;for(let u=0;u<l.length;u++){let m=l.get(u);if(!Tn.intersect(m,ZH,zde).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=te.addSeconds(m.start,te.secondsDifference(m.stop,m.start)/2,new te));let y=e.getValueInReferenceFrame(p,o,a[c]);d(y)&&(a[c]=y,c++)}}return c}function d8e(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return d(c)&&(a[s++]=c),s}function u8e(e,t,n,i,o,r,s,a){RH.start=t,RH.stop=n;let c=s,l=e.intervals;for(let u=0;u<l.length;u++){let m=l.get(u);if(!Tn.intersect(m,RH,zde).isEmpty){let p=m.start,y=m.stop,f=t;te.greaterThan(p,f)&&(f=p);let x=n;te.lessThan(y,x)&&(x=y),c=Jde(m.data,f,x,i,o,r,c,a)}}return c}function Jde(e,t,n,i,o,r,s,a){for(;e instanceof p0;)e=e.resolvedProperty;if(e instanceof js){let c=e._property._times;s=a8e(e,t,n,c,i,o,r,s,a)}else e instanceof Js?s=u8e(e,t,n,i,o,r,s,a):e instanceof b0?s=l8e(e,t,n,i,o,r,s,a):e instanceof Gc||e instanceof mf&&H.isConstant(e)?s=d8e(e,t,n,i,o,r,s,a):s=c8e(e,t,n,i,o,r,s,a);return s}function Qde(e,t,n,i,o,r,s){d(s)||(s=[]);let a=Jde(e,t,n,i,o,r,0,s);return s.length=a,s}var Hde=new $;function eP(e,t){this._unusedIndexes=[],this._polylineCollection=new Pm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}eP.prototype.update=function(e){if(this._referenceFrame===io.INERTIAL){let t=vt.computeIcrfToFixedMatrix(e,Hde);d(t)||(t=vt.computeTemeToPseudoFixedMatrix(e,Hde)),F.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};eP.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,l=n.isShowing&&n.isAvailable(e)&&(!d(a)||a.getValue(e));if(l){let m=H.getValueOrUndefined(i._leadTime,e),p=H.getValueOrUndefined(i._trailTime,e),y=n._availability,f=d(y),x=d(m),_=d(p);if(l=f||x&&_,l){if(_&&(r=te.addSeconds(e,-p,new te)),x&&(s=te.addSeconds(e,m,new te)),f){let C=y.start,V=y.stop;(!_||te.greaterThan(C,r))&&(r=C),(!x||te.lessThan(V,s))&&(s=V)}l=te.lessThan(r,s)}}if(!l){d(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!d(c)){let m=this._unusedIndexes;if(m.length>0){let y=m.pop();c=this._polylineCollection.get(y),t.index=y}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=H.getValueOrDefault(i._resolution,e,r8e);c.show=!0,c.positions=Qde(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=Yo.getValue(e,i._material,c.material),c.width=H.getValueOrDefault(i._width,e,s8e),c.distanceDisplayCondition=H.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};eP.prototype.removeObject=function(e){let t=e.polyline;d(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};eP.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Vy(e,t){t.collectionChanged.addEventListener(Vy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Vy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&d(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,l=io.FIXED;this._scene.mode===ie.SCENE3D&&(l=a.referenceFrame);let u=this._updaters[l];if(c===u&&d(u)){u.updateObject(e,r);continue}d(c)&&c.removeObject(r),d(u)||(u=new eP(this._scene,l),u.update(e),this._updaters[l]=u),r.updater=u,d(u)&&u.updateObject(e,r)}return!0};Vy.prototype.isDestroyed=function(){return!1};Vy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Vy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Vy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],d(r._path)&&d(r._position)&&a.set(r.id,new Kde(r));for(o=i.length-1;o>-1;o--)r=i[o],d(r._path)&&d(r._position)?a.contains(r.id)||a.set(r.id,new Kde(r)):(s=a.get(r.id),d(s)&&(d(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),d(s)&&(d(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};Vy._subSample=Qde;var tP=Vy;var Dqn=T(S(),1);var jde=B.WHITE,qde=B.BLACK,$de=0,eue=1,tue=0,nue=new B,m8e=new h,iue=new B,oue=new Pt,rue=new Pt,sue=new Gt;function aue(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Ly(e,t){t.collectionChanged.addEventListener(Ly.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tt,this._onCollectionChanged(t,t.values,[],[])}Ly.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,l=r.billboard,u=H.getValueOrDefault(a._heightReference,e,Ke.NONE),m=s.isShowing&&s.isAvailable(e)&&H.getValueOrDefault(a._show,e,!0),p;if(m&&(p=H.getValueOrUndefined(s._position,e,m8e),m=d(p)),!m){nP(r,s,n);continue}H.isConstant(s._position)||(n._clusterDirty=!0);let y=!1,f=!1;if(u!==Ke.NONE&&!d(l)?(d(c)&&(nP(r,s,n),c=void 0),l=n.getBillboard(s),l.id=s,l.image=void 0,r.billboard=l,y=!0,f=h.equals(l.position,p)&&l.heightReference===u):u===Ke.NONE&&!d(c)&&(d(l)&&(nP(r,s,n),l=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),d(c))c.show=!0,c.position=p,c.scaleByDistance=H.getValueOrUndefined(a._scaleByDistance,e,oue),c.translucencyByDistance=H.getValueOrUndefined(a._translucencyByDistance,e,rue),c.color=H.getValueOrDefault(a._color,e,jde,nue),c.outlineColor=H.getValueOrDefault(a._outlineColor,e,qde,iue),c.outlineWidth=H.getValueOrDefault(a._outlineWidth,e,$de),c.pixelSize=H.getValueOrDefault(a._pixelSize,e,eue),c.distanceDisplayCondition=H.getValueOrUndefined(a._distanceDisplayCondition,e,sue),c.disableDepthTestDistance=H.getValueOrDefault(a._disableDepthTestDistance,e,tue);else if(d(l)){l.show=!0,l.position=p,l.scaleByDistance=H.getValueOrUndefined(a._scaleByDistance,e,oue),l.translucencyByDistance=H.getValueOrUndefined(a._translucencyByDistance,e,rue),l.distanceDisplayCondition=H.getValueOrUndefined(a._distanceDisplayCondition,e,sue),l.disableDepthTestDistance=H.getValueOrDefault(a._disableDepthTestDistance,e,tue),l.heightReference=u;let x=H.getValueOrDefault(a._color,e,jde,nue),_=H.getValueOrDefault(a._outlineColor,e,qde,iue),C=Math.round(H.getValueOrDefault(a._outlineWidth,e,$de)),V=Math.max(1,Math.round(H.getValueOrDefault(a._pixelSize,e,eue)));if(C>0?(l.scale=1,y=y||C!==r.outlineWidth||V!==r.pixelSize||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)):(l.scale=V/50,V=50,y=y||C!==r.outlineWidth||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)),y){r.color=B.clone(x,r.color),r.outlineColor=B.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,Z=x.toCssColorString(),G=_.toCssColorString(),X=JSON.stringify([Z,V,G,C]);l.setImage(X,Ox(L,Z,G,C,V))}f&&l._updateClamping()}}return!0};Ly.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!d(n)||!(d(n.pointPrimitive)||d(n.billboard)))return lt.FAILED;if(d(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!d(i._clampedPosition))return lt.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};Ly.prototype.isDestroyed=function(){return!1};Ly.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ly.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};Ly.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],d(r._point)&&d(r._position)&&s.set(r.id,new aue(r));for(o=i.length-1;o>-1;o--)r=i[o],d(r._point)&&d(r._position)?s.contains(r.id)||s.set(r.id,new aue(r)):(nP(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],nP(s.get(r.id),r,a),s.remove(r.id)};function nP(e,t,n){if(d(e)){let i=e.pointPrimitive;if(d(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;d(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var iP=Ly;var _ei=T(S(),1);var N$n=T(S(),1);var c$n=T(S(),1);var mue=[];function h8e(e,t,n,i,o){let r=mue;r.length=o;let s,a=n.red,c=n.green,l=n.blue,u=n.alpha,m=i.red,p=i.green,y=i.blue,f=i.alpha;if(B.equals(n,i)){for(s=0;s<o;s++)r[s]=B.clone(n);return r}let x=(m-a)/o,_=(p-c)/o,C=(y-l)/o,V=(f-u)/o;for(s=0;s<o;s++)r[s]=new B(a+s*x,c+s*_,l+s*C,u+s*V);return r}function oP(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=g(e.width,1),o=g(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=We.clone(g(e.vertexFormat,We.DEFAULT)),this._arcType=g(e.arcType,Jt.GEODESIC),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=re.clone(g(e.ellipsoid,re.WGS84)),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=d(n)?1+n.length*B.packedLength:1,this.packedLength=r+re.packedLength+We.packedLength+4}oP.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=d(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var hue=re.clone(re.UNIT_SPHERE),fue=new We,w_={positions:void 0,colors:void 0,ellipsoid:hue,vertexFormat:fue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};oP.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=re.unpack(e,t,hue);t+=re.packedLength;let c=We.unpack(e,t,fue);t+=We.packedLength;let l=e[t++],u=e[t++]===1,m=e[t++],p=e[t];return d(n)?(n._positions=r,n._colors=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=We.clone(c,n._vertexFormat),n._width=l,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(w_.positions=r,w_.colors=s,w_.width=l,w_.colorsPerVertex=u,w_.arcType=m,w_.granularity=p,new oP(w_))};var cue=new h,lue=new h,due=new h,uue=new h;oP.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,l,u,m=[],p=go(e._positions,h.equalsEpsilon,!1,m);if(d(i)&&m.length>0){let w=0,N=m[0];i=i.filter(function(Y,k){let O=!1;return o?O=k===N||k===0&&N===1:O=k+1===N,O?(w++,N=m[w],!1):!0})}let y=p.length;if(y<2||t<=0)return;if(r===Jt.GEODESIC||r===Jt.RHUMB){let w,N;r===Jt.GEODESIC?(w=W.chordLength(s,a.maximumRadius),N=Xi.numberOfPoints):(w=s,N=Xi.numberOfPointsRhumbLine);let Y=Xi.extractHeights(p,a);if(d(i)){let k=1;for(c=0;c<y-1;++c)k+=N(p[c],p[c+1],w);let O=new Array(k),U=0;for(c=0;c<y-1;++c){let J=p[c],z=p[c+1],ee=i[c],K=N(J,z,w);if(o&&c<k){let j=i[c+1],q=h8e(J,z,ee,j,K),be=q.length;for(l=0;l<be;++l)O[U++]=q[l]}else for(l=0;l<K;++l)O[U++]=B.clone(ee)}O[U]=B.clone(i[i.length-1]),i=O,mue.length=0}r===Jt.GEODESIC?p=Xi.generateCartesianArc({positions:p,minDistance:w,ellipsoid:a,height:Y}):p=Xi.generateCartesianRhumbArc({positions:p,granularity:w,ellipsoid:a,height:Y})}y=p.length;let f=y*4-4,x=new Float64Array(f*3),_=new Float64Array(f*3),C=new Float64Array(f*3),V=new Float32Array(f*2),L=n.st?new Float32Array(f*2):void 0,Z=d(i)?new Uint8Array(f*4):void 0,G=0,X=0,P=0,v=0,A;for(l=0;l<y;++l){l===0?(A=cue,h.subtract(p[0],p[1],A),h.add(p[0],A,A)):A=p[l-1],h.clone(A,due),h.clone(p[l],lue),l===y-1?(A=cue,h.subtract(p[y-1],p[y-2],A),h.add(p[y-1],A,A)):A=p[l+1],h.clone(A,uue);let w,N;d(Z)&&(l!==0&&!o?w=i[l-1]:w=i[l],l!==y-1&&(N=i[l]));let Y=l===0?2:0,k=l===y-1?2:4;for(u=Y;u<k;++u){h.pack(lue,x,G),h.pack(due,_,G),h.pack(uue,C,G),G+=3;let O=u-2<0?-1:1;if(V[X++]=2*(u%2)-1,V[X++]=O*t,n.st&&(L[P++]=l/(y-1),L[P++]=Math.max(V[X-2],0)),d(Z)){let U=u<2?w:N;Z[v++]=B.floatToByte(U.red),Z[v++]=B.floatToByte(U.green),Z[v++]=B.floatToByte(U.blue),Z[v++]=B.floatToByte(U.alpha)}}}let M=new hn;M.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x}),M.prevPosition=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),M.nextPosition=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C}),M.expandAndWidth=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:V}),n.st&&(M.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:L})),d(Z)&&(M.color=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:Z,normalize:!0}));let b=Ue.createTypedArray(f,y*6-6),R=0,E=0,I=y-1;for(l=0;l<I;++l)b[E++]=R,b[E++]=R+2,b[E++]=R+1,b[E++]=R+1,b[E++]=R+2,b[E++]=R+3,R+=4;return new dt({attributes:M,indices:b,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromPoints(p),geometryType:Hd.POLYLINES})};var C0=oP;var f8e=new qn(0),dN={},pue=new B,p8e=new At(B.WHITE),b8e=new qn(!0),y8e=new qn(xn.DISABLED),g8e=new qn(new Gt),x8e=new qn(kn.BOTH);function _8e(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function T8e(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function jm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(jm.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new ye,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new _8e,this._groundGeometryOptions=new T8e,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Oo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(jm.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!d(this._entity.availability)&&H.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});jm.prototype.isOutlineVisible=function(e){return!1};jm.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return g(n,!1)};jm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof At&&(d(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,pue)),d(a)||(a=B.WHITE),s.color=Ut.fromColor(a)),this.clampToGround?new _t({id:t,geometry:new qg(this._groundGeometryOptions),attributes:s}):(d(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof At&&(d(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,pue)),d(a)||(a=B.WHITE),s.depthFailColor=Ut.fromColor(a)),new _t({id:t,geometry:new C0(this._geometryOptions),attributes:s}))};jm.prototype.createOutlineGeometryInstance=function(e){};jm.prototype.isDestroyed=function(){return!1};jm.prototype.destroy=function(){this._entitySubscription(),ue(this)};jm.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!d(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(d(s)&&s.isConstant&&!s.getValue(Ye.MINIMUM_VALUE)||!d(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=g(o.material,p8e),l=c instanceof At;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=g(s,b8e),this._shadowsProperty=g(o.shadows,y8e),this._distanceDisplayConditionProperty=g(o.distanceDisplayCondition,g8e),this._classificationTypeProperty=g(o.classificationType,x8e),this._fillEnabled=!0,this._zIndex=g(a,f8e);let u=o.width,m=o.arcType,p=o.clampToGround,y=o.granularity;if(!r.isConstant||!H.isConstant(u)||!H.isConstant(m)||!H.isConstant(y)||!H.isConstant(p)||!H.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,x=r.getValue(Ye.MINIMUM_VALUE,f.positions);if(!d(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;l&&(!d(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof At)?_=Fr.VERTEX_FORMAT:_=Ds.VERTEX_FORMAT,f.vertexFormat=_,f.positions=x,f.width=d(u)?u.getValue(Ye.MINIMUM_VALUE):void 0,f.arcType=d(m)?m.getValue(Ye.MINIMUM_VALUE):void 0,f.granularity=d(y)?y.getValue(Ye.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=x,C.width=f.width,C.arcType=f.arcType,C.granularity=f.granularity,this._clampToGround=d(p)?p.getValue(Ye.MINIMUM_VALUE):!1,!this._clampToGround&&d(a)&&It("Entity polylines must have clampToGround: true when using zIndex.  zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};jm.prototype.createDynamicUpdater=function(e,t){return new rP(e,t,this)};var S1={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function rP(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function bue(e){if(d(e._line))return e._line;let t=e._geometryUpdater._scene.id,n=dN[t],i=e._primitives;!d(n)||n.isDestroyed()?(n=new Pm,dN[t]=n,i.add(n)):i.contains(n)||i.add(n);let o=n.add();return o.id=e._geometryUpdater._entity,e._line=o,o}rP.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=H.getValueOrUndefined(o,e,this._positions);t._clampToGround=H.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=H.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=H.getValueOrDefault(i._arcType,e,Jt.GEODESIC),t._groundGeometryOptions.granularity=H.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(d(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!H.getValueOrDefault(i._show,e,!0)||!d(r)||r.length<2)return;let u=t.fillMaterialProperty,m;if(u instanceof At)m=new Fr;else{let p=Yo.getValue(e,u,this._material);m=new Ds({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new dm({geometryInstances:t.createFillGeometryInstance(e),appearance:m,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),H.getValueOrUndefined(t.zIndex,e)),d(this._line)&&(this._line.show=!1);return}let a=bue(this);if(!n.isShowing||!n.isAvailable(e)||!H.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!d(r)||r.length<2){a.show=!1;return}let c=Jt.GEODESIC;c=H.getValueOrDefault(i._arcType,e,c);let l=t._scene.globe;c!==Jt.NONE&&d(l)&&(S1.ellipsoid=l.ellipsoid,S1.positions=r,S1.granularity=H.getValueOrUndefined(i._granularity,e),S1.height=Xi.extractHeights(r,l.ellipsoid),c===Jt.GEODESIC?r=Xi.generateCartesianArc(S1):r=Xi.generateCartesianRhumbArc(S1)),a.show=!0,a.positions=r.slice(),a.material=Yo.getValue(e,t.fillMaterialProperty,a.material),a.width=H.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=H.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};rP.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(d(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(d(n)&&d(n.boundingSphere))return ce.clone(n.boundingSphere,e),lt.DONE}return d(t)&&!t.ready?lt.PENDING:lt.DONE}else{let t=bue(this);if(t.show&&t.positions.length>0)return ce.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};rP.prototype.isDestroyed=function(){return!1};rP.prototype.destroy=function(){let t=this._geometryUpdater._scene.id,n=dN[t];d(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete dN[t])),d(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var sP=jm;var nei=T(S(),1);var S8e=new B,C8e=new Gt,V8e=new Gt;function qm(e,t,n,i,o){let r;n instanceof At?r=Fr:r=Ds,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Tt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tt,this.material=void 0,this.updatersWithAttributes=new Tt,this.attributes=new Tt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(qm.prototype.onMaterialChanged,this),this.subscriptions=new Tt,this.showsUpdated=new Tt,this.zIndex=i,this._asynchronous=o}qm.prototype.onMaterialChanged=function(){this.invalidated=!0};qm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof At&&t instanceof At?!0:d(t)&&t.equals(n)};qm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!H.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};qm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return d(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};qm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)d(n)&&(d(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new dm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ds&&(this.material=Yo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{d(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;d(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(d(n)&&n.ready){n.show=!0,d(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ds&&(this.material=Yo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],l=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(d(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,_=H.getValueOrDefault(x,e,B.WHITE,S8e);B.equals(m._lastColor,_)||(m._lastColor=B.clone(_,m._lastColor),m.color=Ut.toValue(_,m.color))}let p=l.isShowing&&(c.hasConstantFill||c.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=gn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!H.isConstant(f)){let x=H.getValueOrDefault(f,e,V8e,C8e);Gt.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Gt.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Un.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else d(n)&&!n.ready&&(t=!1);return t};qm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);d(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,l=a.show[0]===1;c!==l&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};qm.prototype.contains=function(e){return this.updaters.contains(e.id)};qm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!d(i)||!d(i.boundingSphere)||d(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};qm.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;d(e)&&t.remove(e);let n=this.oldPrimitive;d(n)&&t.remove(n),this.removeMaterialSubscription()};function C1(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=g(n,!0)}C1.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=H.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new qm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};C1.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};C1.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};C1.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};C1.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var aP=C1;var L8e=[];function yue(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function gue(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;d(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof At?1:2);let r;d(i)&&(r=i+o*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof At?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function hf(e,t,n,i){i=g(i,e.groundPrimitives),n=g(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Tt,this._removedObjects=new Tt,this._changedObjects=new Tt;let o,r=xn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Gu(n,Fr,void 0,!1,o),this._materialBatches[o]=new Eu(n,Ds,void 0,!1,o),this._colorBatches[o+r]=new Gu(n,Fr,Fr,!1,o),this._materialBatches[o+r]=new Eu(n,Ds,Fr,!1,o),this._colorBatches[o+r*2]=new Gu(n,Fr,Ds,!1,o),this._materialBatches[o+r*2]=new Eu(n,Ds,Ds,!1,o);this._dynamicBatch=new C_(n,i);let s=kn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new aP(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Tt,this._updaters=new Tt,this._entityCollection=t,t.collectionChanged.addEventListener(hf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,L8e)}hf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,l,u;for(a=s.length-1;a>-1;a--)c=s[a],l=c.id,u=this._updaters.get(l),u.entity===c?(yue(this,u),gue(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],l=c.id,u=this._updaters.get(l),yue(this,u),u.destroy(),this._updaters.remove(l),this._subscriptions.get(l)(),this._subscriptions.remove(l);for(a=n.length-1;a>-1;a--)c=n[a],l=c.id,u=new sP(c,this._scene),this._updaters.set(l,u),gue(this,e,u),this._subscriptions.set(l,u.geometryChanged.addEventListener(hf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,y=p.length;for(a=0;a<y;a++)m=p[a].update(e)&&m;return m};var R8e=[],Z8e=new ce;hf.prototype.getBoundingSphere=function(e,t){let n=R8e,i=Z8e,o=0,r=lt.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let l=0;l<a;l++){if(r=s[l].getBoundingSphere(c,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=ce.clone(i,n[o]),o++)}return o===0?lt.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),lt.DONE)};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(hf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};hf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!d(t.get(o))&&!d(n.get(o))&&n.set(o,i)};hf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var cP=hf;function Wu(e){Rc.initializeTerrainHeights(),dm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Lr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=g(e.visualizersCallback,Wu.defaultVisualizersCallback);let i=!1,o=new Zl,r=new Zl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let l=0,u=n.length;l<u;l++)this._onDataSourceAdded(n,n.get(l));let s=new l2;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let l=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),l._removeDefaultDataSourceListener=void 0,l._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}Wu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new iG(t,i),new Q2(e,i,n._primitives,n._groundPrimitives),new j2(t,i),new $2(e,i),new zW(e,i),new iP(t,i),new tP(e,i),new cP(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(Wu.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Wu.prototype.isDestroyed=function(){return!1};Wu.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),d(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Wu.prototype.update=function(e){if(!li.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(d(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return this._ready=t,t};Wu.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;d(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(d(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var G8e=[],E8e=new ce;Wu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return lt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let y=p.get(i);if(y.entities.contains(e)){r=y;break}}}if(!d(r))return lt.FAILED;let s=G8e,a=E8e,c=0,l=lt.DONE,u=r._visualizers,m=u.length;for(i=0;i<m;i++){let p=u[i];if(d(p.getBoundingSphere)){if(l=u[i].getBoundingSphere(e,a),!t&&l===lt.PENDING)return lt.PENDING;l===lt.DONE&&(s[c]=ce.clone(a,s[c]),c++)}}return c===0?lt.FAILED:(s.length=c,ce.fromBoundingSpheres(s,n),lt.DONE)};Wu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Zl),s=o.add(new V2);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Wu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let l=0;l<c;l++)a[l].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Wu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var lP=Wu;var rti=T(S(),1);var Kei=T(S(),1);function GH(e,t,n){this.heading=g(e,0),this.pitch=g(t,0),this.range=g(n,0)}GH.clone=function(e,t){if(d(e))return d(t)||(t=new GH),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Pu=GH;var xue=new $,_ue=new $,Tue=new $,X8e=new F,uN=new h,Sue=new h,EH=new h,XH=new h,Cue=new h,Vue=new h,V1=new te,I8e=1.25;function W8e(e,t,n,i,o,r,s){let a=e.scene.mode,c=o.getValue(r,e._lastCartesian);if(d(c)){let l=!1,u=!1,m,p,y;if(a===ie.SCENE3D){te.addSeconds(r,.001,V1);let V=o.getValue(V1,uN);if(d(V)||(te.addSeconds(r,-.001,V1),V=o.getValue(V1,uN),u=!0),d(V)){let L=vt.computeFixedToIcrfMatrix(r,xue),Z=vt.computeFixedToIcrfMatrix(V1,_ue),G;!d(L)||!d(Z)?(G=vt.computeTemeToPseudoFixedMatrix(r,Tue),L=$.transpose(G,xue),Z=vt.computeTemeToPseudoFixedMatrix(V1,_ue),$.transpose(Z,Z)):G=$.transpose(L,Tue);let X=$.multiplyByVector(L,c,Cue),P=$.multiplyByVector(Z,V,Vue);h.subtract(X,P,XH);let v=h.magnitude(XH)*1e3,A=W.GRAVITATIONALPARAMETER,M=-A/(v*v-2*A/h.magnitude(X));M<0||M>I8e*s.maximumRadius?(m=Sue,h.normalize(c,m),h.negate(m,m),y=h.clone(h.UNIT_Z,EH),p=h.cross(y,m,uN),h.magnitude(p)>W.EPSILON7&&(h.normalize(m,m),h.normalize(p,p),y=h.cross(m,p,EH),h.normalize(y,y),l=!0)):h.equalsEpsilon(c,V,W.EPSILON7)||(y=Sue,h.normalize(X,y),h.normalize(P,P),p=h.cross(y,P,EH),u&&(p=h.multiplyByScalar(p,-1,p)),h.equalsEpsilon(p,h.ZERO,W.EPSILON7)||(m=h.cross(p,y,uN),$.multiplyByVector(G,m,m),$.multiplyByVector(G,p,p),$.multiplyByVector(G,y,y),h.normalize(m,m),h.normalize(p,p),h.normalize(y,y),l=!0))}}d(e.boundingSphere)&&(c=e.boundingSphere.center);let f,x,_;i&&(f=h.clone(t.position,XH),x=h.clone(t.direction,Cue),_=h.clone(t.up,Vue));let C=X8e;l?(C[0]=m.x,C[1]=m.y,C[2]=m.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=y.x,C[9]=y.y,C[10]=y.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):vt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(h.clone(f,t.position),h.clone(x,t.direction),h.clone(_,t.up),h.cross(x,_,t.right))}if(n){let l=a===ie.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,l)}}function dP(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=g(n,re.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._offset3D=new h}Object.defineProperties(dP,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});dP.defaultOffset3D=new h(-14e3,3500,3500);var mN=new Pu,P8e=new h;dP.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ie.MORPHING)return;let r=this.entity,s=r.position;if(!d(s))return;let a=r!==this._lastEntity,c=o!==this._mode,l=n.camera,u=a||c,m=!0;if(a){let p=r.viewFrom,y=d(p);if(!y&&d(t)){mN.pitch=-W.PI_OVER_FOUR,mN.range=0;let f=s.getValue(e,P8e);if(d(f)){let x=2-1/Math.max(1,h.magnitude(f)/i.maximumRadius);mN.pitch*=x}l.viewBoundingSphere(t,mN),this.boundingSphere=t,u=!1,m=!1}else(!y||!d(p.getValue(e,this._offset3D)))&&h.clone(dP._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ie.SCENE2D&&h.clone(l.position,this._offset3D);this._lastEntity=r,this._mode=o,W8e(this,l,u,m,s,e,i)};var uP=dP;var Ani=T(S(),1);var mti=T(S(),1);function hP(){this._cache={}}hP.prototype.fromColor=function(e,t){return hN(void 0,void 0,e,t,this._cache)};hP.prototype.fromUrl=function(e,t,n){return hN(e,void 0,t,n,this._cache)};hP.prototype.fromMakiIconId=function(e,t,n){return hN($t(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};hP.prototype.fromText=function(e,t,n){return hN(void 0,e,t,n,this._cache)};var v8e=new B;function w8e(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,v8e).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Lue(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=B.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=B.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var mP=new Array(4);function hN(e,t,n,i,o){mP[0]=e,mP[1]=t,mP[2]=n,mP[3]=i;let r=JSON.stringify(mP),s=o[r];if(d(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(w8e(c,n,i),d(e)){let u=Ee.createIfNeeded(e).fetchImage().then(function(m){return Lue(c,m,i),o[r]=a,a});return o[r]=u,u}else if(d(t)){let l=Hx(t,{font:`bold ${i}px sans-serif`});Lue(c,l,i)}return o[r]=a,a}var V0=hP;var nni=T(S());var _ti=T(S());var yti=T(S());var fti=T(S());function IH(e){return e}function fN(e){if(e==null)return IH;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var l=2,u=a.length,m=new Array(u);for(m[0]=(t+=a[0])*i+r,m[1]=(n+=a[1])*o+s;l<u;)m[l]=a[l],++l;return m}}var Rti=T(S());var Sti=T(S());function Rue(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function WH(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Zue(e,n)})}:Zue(e,t)}function Zue(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=PH(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function PH(e,t){var n=fN(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],y=0,f=p.length;y<f;++y)m.push(n(p[y],y));u<0&&Rue(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,y=u.length;p<y;++p)o(u[p],m);return m.length<2&&m.push(m[0]),m}function a(u){for(var m=s(u);m.length<4;)m.push(m[0]);return m}function c(u){return u.map(a)}function l(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(l)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:m,coordinates:p}}return l(t)}var Wti=T(S());var Gti=T(S());var Fti=T(S());var Dti=T(S());var Mti=T(S());var Jti=T(S());var Oti=T(S());function pN(e){return h.fromDegrees(e[0],e[1],e[2])}var vH={"urn:ogc:def:crs:OGC:1.3:CRS84":pN,"EPSG:4326":pN,"urn:ogc:def:crs:EPSG::4326":pN},Gue={},Eue={},wH=48,FH,AH=B.ROYALBLUE,MH=B.YELLOW,NH=2,UH=B.fromBytes(255,255,0,100),kH=!1,U8e={small:24,medium:48,large:64},k8e=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Xue(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||k8e.indexOf(i)!==-1)continue;let o=e[i];d(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Xue(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function D8e(e,t,n){let i;return function(o,r){return d(i)||(i=e(t,n)),i}}function B8e(e,t){return new fm(D8e(Xue,e,t),!0)}function bN(e,t,n){let i=e.id;if(!d(i)||e.type!=="Feature")i=Yn();else{let s=2,a=i;for(;d(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(d(r)){o.properties=r;let s,a=r.title;if(d(a))o.name=a,s="title";else{let l=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let m=u.toLowerCase();if(l>1&&m==="title"){l=1,s=u;break}else l>2&&m==="name"?(l=2,s=u):l>3&&/title/i.test(u)?(l=3,s=u):l>4&&/name/i.test(u)&&(l=4,s=u)}d(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=d(c)?new qn(c):n(r,s))}return o}function DH(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Iue={Feature:Pue,FeatureCollection:Y8e,GeometryCollection:vue,LineString:Nue,MultiLineString:Uue,MultiPoint:Aue,MultiPolygon:Bue,Point:Fue,Polygon:Due,Topology:Yue},Wue={GeometryCollection:vue,LineString:Nue,MultiLineString:Uue,MultiPoint:Aue,MultiPolygon:Bue,Point:Fue,Polygon:Due,Topology:Yue};function Pue(e,t,n,i,o){if(t.geometry===null){bN(t,e._entityCollection,o.describe);return}if(!d(t.geometry))throw new me("feature.geometry is required.");let r=t.geometry.type,s=Wue[r];if(!d(s))throw new me(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Y8e(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Pue(e,r[s],void 0,i,o)}function vue(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],l=c.type,u=Wue[l];if(!d(u))throw new me(`Unknown geometry type: ${l}`);u(e,t,c,i,o)}}function wue(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(d(c)){let y=c["marker-color"];d(y)&&(s=B.fromCssColorString(y)),a=g(U8e[c["marker-size"]],a);let f=c["marker-symbol"];d(f)&&(r=f)}let l;d(r)?r.length===1?l=e._pinBuilder.fromText(r.toUpperCase(),s,a):l=e._pinBuilder.fromMakiIconId(r,s,a):l=e._pinBuilder.fromColor(s,a);let u=new Ua;u.verticalOrigin=new qn(In.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=Ke.CLAMP_TO_GROUND);let m=bN(t,e._entityCollection,o.describe);m.billboard=u,m.position=new Gc(n(i));let p=Promise.resolve(l).then(function(y){u.image=new qn(y)}).catch(function(){u.image=new qn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Fue(e,t,n,i,o){wue(e,t,i,n.coordinates,o)}function Aue(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)wue(e,t,i,r[s],o)}function Mue(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(d(a)){let u=a["stroke-width"];d(u)&&(s=new qn(u));let m,p=a.stroke;d(p)&&(m=B.fromCssColorString(p));let y=a["stroke-opacity"];d(y)&&y!==1&&(d(m)||(m=r.color.getValue().clone()),m.alpha=y),d(m)&&(r=new At(m))}let c=bN(t,e._entityCollection,o.describe),l=new Ba;c.polyline=l,l.clampToGround=o.clampToGround,l.material=r,l.width=s,l.positions=new qn(DH(i,n)),l.arcType=Jt.RHUMB}function Nue(e,t,n,i,o){Mue(e,t,i,n.coordinates,o)}function Uue(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Mue(e,t,i,r[s],o)}function kue(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(d(c)){let y=c["stroke-width"];d(y)&&(a=new qn(y));let f,x=c.stroke;d(x)&&(f=B.fromCssColorString(x));let _=c["stroke-opacity"];d(_)&&_!==1&&(d(f)||(f=r.getValue().clone()),f.alpha=_),d(f)&&(r=new qn(f));let C,V=c.fill,L=s.color.getValue();d(V)&&(C=B.fromCssColorString(V),C.alpha=L.alpha),_=c["fill-opacity"],d(_)&&_!==L.alpha&&(d(C)||(C=L.clone()),C.alpha=_),d(C)&&(s=new At(C))}let l=new mm;l.outline=new qn(!0),l.outlineColor=r,l.outlineWidth=a,l.material=s,l.arcType=Jt.RHUMB;let u=[];for(let y=1,f=i.length;y<f;y++)u.push(new fa(DH(i[y],n)));let m=i[0];l.hierarchy=new qn(new fa(DH(m,n),u)),m[0].length>2?l.perPositionHeight=new qn(!0):o.clampToGround||(l.height=0);let p=bN(t,e._entityCollection,o.describe);p.polygon=l}function Due(e,t,n,i,o){kue(e,t,i,n.coordinates,o)}function Bue(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)kue(e,t,i,r[s],o)}function Yue(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=WH(n,n.objects[r]),a=Iue[s.type];a(e,s,s,i,o)}}function Ry(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Es(this),this._promises=[],this._pinBuilder=new V0,this._entityCluster=new ad,this._credit=void 0,this._resourceCredits=[]}Ry.load=function(e,t){return new Ry().load(e,t)};Object.defineProperties(Ry,{markerSize:{get:function(){return wH},set:function(e){wH=e}},markerSymbol:{get:function(){return FH},set:function(e){FH=e}},markerColor:{get:function(){return AH},set:function(e){AH=e}},stroke:{get:function(){return MH},set:function(e){MH=e}},strokeWidth:{get:function(){return NH},set:function(e){NH=e}},fill:{get:function(){return UH},set:function(e){UH=e}},clampToGround:{get:function(){return kH},set:function(e){kH=e}},crsNames:{get:function(){return vH}},crsLinkHrefs:{get:function(){return Gue}},crsLinkTypes:{get:function(){return Eue}}});Object.defineProperties(Ry.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Ry.prototype.load=function(e,t){return Oue(this,e,t,!0)};Ry.prototype.process=function(e,t){return Oue(this,e,t,!1)};function Oue(e,t,n,i){Gr.setLoading(e,!0),n=g(n,g.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new St(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),r=t.fetchJson(),s=g(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(d(c)){let l=c.length;for(let u=0;u<l;u++)a.push(c[u])}}return n={describe:g(n.describe,B8e),markerSize:g(n.markerSize,wH),markerSymbol:g(n.markerSymbol,FH),markerColor:g(n.markerColor,AH),strokeWidthProperty:new qn(g(n.strokeWidth,NH)),strokeMaterialProperty:new At(g(n.stroke,MH)),fillMaterialProperty:new At(g(n.fill,UH)),clampToGround:g(n.clampToGround,kH)},Promise.resolve(r).then(function(a){return O8e(e,a,n,s,i)}).catch(function(a){throw Gr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Ry.prototype.update=function(e){return!0};function O8e(e,t,n,i,o){let r;d(i)&&(r=m0(i)),d(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Iue[t.type];if(!d(s))throw new me(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?pN:null;if(d(a)){if(!d(a.properties))throw new me("crs.properties is undefined.");let l=a.properties;if(a.type==="name"){if(c=vH[l.name],!d(c))throw new me(`Unknown crs name: ${l.name}`)}else if(a.type==="link"){let u=Gue[l.href];if(d(u)||(u=Eue[l.type]),!d(u))throw new me(`Unable to resolve crs link: ${JSON.stringify(l)}`);c=u(l)}else if(a.type==="EPSG"){if(c=vH[`EPSG:${l.code}`],!d(c))throw new me(`Unknown crs EPSG code: ${l.code}`)}else throw new me(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(l){return o&&e._entityCollection.removeAll(),l!==null&&s(e,t,t,l,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Gr.setLoading(e,!1),e})})}var fP=Ry;var Rri=T(S(),1);var Uoi=T(S());var Voi=T(S());var Nni=T(S()),Kue="4.0.0";var kni=T(S());function K8e(e){return e===void 0}function yd(e){return typeof e=="boolean"}function Hue(e,t){for(var n in t)t.hasOwnProperty(n)&&K8e(e[n])&&(e[n]=t[n]);return e}function zue(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Ao(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Zy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Gy(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var sii=T(S());var Hni=T(S());var Yni=T(S()),Ey=/[A-Za-z]/,Ws=/[\d]/;var gd=/\s/,yN=/['"]/,Jue=/[\x00-\x1F\x7F]/,Que=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,H8e=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,z8e=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,J8e=Que+H8e+z8e,jue=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Dni=new RegExp("[".concat(Que+jue,"]")),BH=J8e+jue,$m=new RegExp("[".concat(BH,"]"));var gN=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(gd):[],o=t.split(gd),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(gd):[],o=t.split(gd),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var Jni=T(S());function que(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},Z=V,G=Z.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var Z=L/2,G=Math.ceil(Z),X=-1*Math.floor(Z),P="";return X<0&&(P=V.substr(X)),V.substr(0,G)+n+P};if(e.length<=t)return e;var c=t-o,l=r(e);if(l.query){var u=l.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(l.query=l.query.substr(0,u[1].length),e=s(l))}if(e.length<=t||(l.host&&(l.host=l.host.replace(/^www\./,""),e=s(l)),e.length<=t))return e;var m="";if(l.host&&(m+=l.host),m.length>=c)return l.host.length==t?(l.host.substr(0,t-o)+n).substr(0,c+i):a(m,c).substr(0,c+i);var p="";if(l.path&&(p+="/"+l.path),l.query&&(p+="?"+l.query),p)if((m+p).length>=c){if((m+p).length==t)return(m+p).substr(0,t);var y=c-m.length;return(m+a(p,y)).substr(0,c+i)}else m+=p;if(l.fragment){var f="#"+l.fragment;if((m+f).length>=c){if((m+f).length==t)return(m+f).substr(0,t);var x=c-m.length;return(m+a(f,x)).substr(0,c+i)}else m+=f}if(l.scheme&&l.host){var _=l.scheme+"://";if((m+_).length<c)return(_+m).substr(0,t)}if(m.length<=t)return m;var C="";return c>0&&(C=m.substr(-1*Math.floor(c/2))),(m.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var jni=T(S());function $ue(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var eii=T(S());function eme(e,t,n){return zue(e,t,n)}var tme=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new gN({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?que(t,i):o==="middle"?$ue(t,i):eme(t,i)},e}();var loi=T(S());var Tii=T(S());var cii=T(S(),1),YH=function(e,t){return YH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},YH(e,t)};function ff(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");YH(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ps=function(){return Ps=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ps.apply(this,arguments)};var dii=T(S()),pf=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var bii=T(S());var mii=T(S()),Q8e="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",nme=new RegExp("^"+Q8e+"$");var j8e=/[\/?#]/,q8e=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,ime=/[?!:,.;^]/,OH=/https?:\/\//i,ome=new RegExp("^"+OH.source,"i"),rme=new RegExp(ime.source+"$"),$8e=/^(javascript|vbscript):/i,e7e=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,t7e=/^(?:\/\/)?([^/#?:]+)/;function xN(e){return Ey.test(e)}function KH(e){return Ey.test(e)||Ws.test(e)||e==="+"||e==="-"||e==="."}function L0(e){return $m.test(e)}function _N(e){return e==="_"||L0(e)}function HH(e){return $m.test(e)||q8e.test(e)||ime.test(e)}function TN(e){return j8e.test(e)}function zH(e){return nme.test(e.toLowerCase())}function sme(e){if($8e.test(e))return!1;var t=e.match(e7e);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!Ey.test(i))}function ame(e){var t=e.match(t7e);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!zH(o)}var n7e=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,i7e=/[:/?#]/;function cme(e){var t=e.split(i7e,1)[0];return n7e.test(t)}var o7e=/^(https?:\/\/)?(www\.)?/i,r7e=/^\/\//,lme=function(e){ff(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=c7e(n)),this.stripPrefix.scheme&&(n=s7e(n)),this.stripPrefix.www&&(n=a7e(n)),this.stripTrailingSlash&&(n=l7e(n)),this.decodePercentEncoding&&(n=d7e(n)),n},t}(pf);function s7e(e){return e.replace(ome,"")}function a7e(e){return e.replace(o7e,"$1")}function c7e(e){return e.replace(r7e,"")}function l7e(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function d7e(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch{return t}}var Lii=T(S());var dme=/^mailto:/i,u7e=new RegExp("[".concat(BH,"!#$%&'*+/=?^_`{|}~-]"));function ume(e){return $m.test(e)}function SN(e){return u7e.test(e)}function mme(e){var t=e.split(".").pop()||"";return zH(t)}var Eii=T(S());var hme=function(e){ff(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(pf);var Wii=T(S());function JH(e){return e==="_"||$m.test(e)}function fme(e){return e.length<=140}var pme=["twitter","facebook","instagram","tiktok"];var Aii=T(S());var bme=function(e){ff(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw Gy(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(pf);var Nii=T(S()),m7e={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},h7e=/[-\w.]/;function QH(e){return h7e.test(e)}function yme(e,t){var n=m7e[t];return n.test(e)}var gme=["twitter","instagram","soundcloud","tiktok"];var Bii=T(S());var xme=function(e){ff(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(pf);var Oii=T(S()),f7e=/[-. ]/,p7e=/[-. ()]/,b7e=/[,;]/,y7e=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,g7e=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,x7e=new RegExp("^".concat(y7e.source,"|").concat(g7e.source,"$"));function jH(e){return f7e.test(e)}function CN(e){return b7e.test(e)}function _me(e){var t=e.charAt(0)==="+"||p7e.test(e);return t&&x7e.test(e)}var Jii=T(S());var Tme=function(e){ff(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(pf);function Vme(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],l=e.length,u=[],m=0;m<l;m++){var p=e.charAt(m);if(u.length===0)_(p);else for(var y=u.length-1;y>=0;y--){var f=u[y];switch(f.state){case 11:X(f,p);break;case 12:P(f,p);break;case 0:C(f,p);break;case 1:V(f,p);break;case 2:L(f,p);break;case 3:Z(f,p);break;case 4:G(f,p);break;case 5:v(f,p);break;case 6:A(f,p);break;case 7:M(f,p);break;case 13:b(f,p);break;case 14:R(f,p);break;case 8:E(f,p);break;case 9:I(f,p);break;case 10:w(f,p);break;case 15:N(f,p);break;case 16:Y(f,p);break;case 17:k(f,p);break;case 18:O(f,p);break;case 19:U(f,p);break;case 20:J(f,p);break;case 21:z(f,p);break;case 22:ee(f,p);break;case 23:K(f,p);break;case 24:j(f,p);break;case 25:q(f,p);break;case 26:be(f,p);break;case 27:Te(f,p);break;case 28:ae(f,p);break;case 29:xe(f,p);break;case 30:_e(f,p);break;case 31:Ve(f,p);break;case 32:Me(f,p);break;case 33:ve(f,p);break;case 34:ke(f,p);break;case 35:ct(f,p);break;case 36:yt(f,p);break;case 37:Ie(f,p);break;case 38:ot(f,p);break;case 39:ln(f,p);break;case 40:vn(f,p);break;case 41:Dt(f,p);break;default:Gy(f.state)}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(pe){return Nt(pe)});return c;function _(pe){if(pe==="#")u.push(V7e(m,28));else if(pe==="@")u.push(L7e(m,30));else if(pe==="/")u.push($H(m,11));else if(pe==="+")u.push(ez(m,37));else if(pe==="(")u.push(ez(m,32));else{if(Ws.test(pe)&&(u.push(ez(m,38)),u.push(S7e(m,13))),ume(pe)){var Ce=pe.toLowerCase()==="m"?15:22;u.push(C7e(m,Ce))}xN(pe)&&u.push(qH(m,0)),$m.test(pe)&&u.push($H(m,5))}}function C(pe,Ce){Ce===":"?pe.state=2:Ce==="-"?pe.state=1:KH(Ce)||Ao(u,pe)}function V(pe,Ce){Ce==="-"||(Ce==="/"?(Ao(u,pe),u.push($H(m,11))):KH(Ce)?pe.state=0:Ao(u,pe))}function L(pe,Ce){Ce==="/"?pe.state=3:Ce==="."?Ao(u,pe):L0(Ce)?(pe.state=5,xN(Ce)&&u.push(qH(m,0))):Ao(u,pe)}function Z(pe,Ce){Ce==="/"?pe.state=4:HH(Ce)?(pe.state=10,pe.acceptStateReached=!0):Nt(pe)}function G(pe,Ce){Ce==="/"?pe.state=10:L0(Ce)?(pe.state=5,pe.acceptStateReached=!0):Ao(u,pe)}function X(pe,Ce){Ce==="/"?pe.state=12:Ao(u,pe)}function P(pe,Ce){L0(Ce)?pe.state=5:Ao(u,pe)}function v(pe,Ce){Ce==="."?pe.state=7:Ce==="-"?pe.state=6:Ce===":"?pe.state=8:TN(Ce)?pe.state=10:_N(Ce)||Nt(pe)}function A(pe,Ce){Ce==="-"||(Ce==="."?Nt(pe):L0(Ce)?pe.state=5:Nt(pe))}function M(pe,Ce){Ce==="."?Nt(pe):L0(Ce)?(pe.state=5,pe.acceptStateReached=!0):Nt(pe)}function b(pe,Ce){Ce==="."?pe.state=14:Ce===":"?pe.state=8:Ws.test(Ce)||(TN(Ce)?pe.state=10:$m.test(Ce)?Ao(u,pe):Nt(pe))}function R(pe,Ce){Ws.test(Ce)?(pe.octetsEncountered++,pe.octetsEncountered===4&&(pe.acceptStateReached=!0),pe.state=13):Nt(pe)}function E(pe,Ce){Ws.test(Ce)?pe.state=9:Nt(pe)}function I(pe,Ce){Ws.test(Ce)||(TN(Ce)?pe.state=10:Nt(pe))}function w(pe,Ce){HH(Ce)||Nt(pe)}function N(pe,Ce){Ce.toLowerCase()==="a"?pe.state=16:ee(pe,Ce)}function Y(pe,Ce){Ce.toLowerCase()==="i"?pe.state=17:ee(pe,Ce)}function k(pe,Ce){Ce.toLowerCase()==="l"?pe.state=18:ee(pe,Ce)}function O(pe,Ce){Ce.toLowerCase()==="t"?pe.state=19:ee(pe,Ce)}function U(pe,Ce){Ce.toLowerCase()==="o"?pe.state=20:ee(pe,Ce)}function J(pe,Ce){Ce.toLowerCase()===":"?pe.state=21:ee(pe,Ce)}function z(pe,Ce){SN(Ce)?pe.state=22:Ao(u,pe)}function ee(pe,Ce){Ce==="."?pe.state=23:Ce==="@"?pe.state=24:SN(Ce)?pe.state=22:Ao(u,pe)}function K(pe,Ce){Ce==="."?Ao(u,pe):Ce==="@"?Ao(u,pe):SN(Ce)?pe.state=22:Ao(u,pe)}function j(pe,Ce){L0(Ce)?pe.state=25:Ao(u,pe)}function q(pe,Ce){Ce==="."?pe.state=27:Ce==="-"?pe.state=26:_N(Ce)||Nt(pe)}function be(pe,Ce){Ce==="-"||Ce==="."?Nt(pe):_N(Ce)?pe.state=25:Nt(pe)}function Te(pe,Ce){Ce==="."||Ce==="-"?Nt(pe):L0(Ce)?(pe.state=25,pe.acceptStateReached=!0):Nt(pe)}function ae(pe,Ce){JH(Ce)?(pe.state=29,pe.acceptStateReached=!0):Ao(u,pe)}function xe(pe,Ce){JH(Ce)||Nt(pe)}function _e(pe,Ce){QH(Ce)?(pe.state=31,pe.acceptStateReached=!0):Ao(u,pe)}function Ve(pe,Ce){QH(Ce)||($m.test(Ce)?Ao(u,pe):Nt(pe))}function Ie(pe,Ce){Ws.test(Ce)?pe.state=38:(Ao(u,pe),_(Ce))}function Me(pe,Ce){Ws.test(Ce)?pe.state=33:Ao(u,pe),_(Ce)}function ve(pe,Ce){Ws.test(Ce)?pe.state=34:Ao(u,pe)}function ke(pe,Ce){Ws.test(Ce)?pe.state=35:Ao(u,pe)}function ct(pe,Ce){Ce===")"?pe.state=36:Ao(u,pe)}function yt(pe,Ce){Ws.test(Ce)?pe.state=38:jH(Ce)?pe.state=39:Ao(u,pe)}function ot(pe,Ce){pe.acceptStateReached=!0,CN(Ce)?pe.state=40:Ce==="#"?pe.state=41:Ws.test(Ce)||(Ce==="("?pe.state=32:jH(Ce)?pe.state=39:(Nt(pe),xN(Ce)&&u.push(qH(m,0))))}function ln(pe,Ce){Ws.test(Ce)?pe.state=38:Ce==="("?pe.state=32:(Nt(pe),_(Ce))}function vn(pe,Ce){CN(Ce)||(Ce==="#"?pe.state=41:Ws.test(Ce)?pe.state=38:Nt(pe))}function Dt(pe,Ce){CN(Ce)?pe.state=40:Ws.test(Ce)?Ao(u,pe):Nt(pe)}function Nt(pe){if(Ao(u,pe),!!pe.acceptStateReached){var Ce=pe.startIdx,Ht=e.slice(pe.startIdx,m);if(Ht=T7e(Ht),pe.type==="url"){var ut=e.charAt(pe.startIdx-1);if(ut==="@")return;var hi=pe.matchType;if(hi==="scheme"){var ji=OH.exec(Ht);if(ji&&(Ce=Ce+ji.index,Ht=Ht.slice(ji.index)),!sme(Ht))return}else if(hi==="tld"){if(!ame(Ht))return}else if(hi==="ipV4"){if(!cme(Ht))return}else Gy(hi);c.push(new lme({tagBuilder:n,matchedText:Ht,offset:Ce,urlMatchType:hi,url:Ht,protocolRelativeMatch:Ht.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(pe.type==="email")mme(Ht)&&c.push(new hme({tagBuilder:n,matchedText:Ht,offset:Ce,email:Ht.replace(dme,"")}));else if(pe.type==="hashtag")fme(Ht)&&c.push(new bme({tagBuilder:n,matchedText:Ht,offset:Ce,serviceName:s,hashtag:Ht.slice(1)}));else if(pe.type==="mention")yme(Ht,a)&&c.push(new xme({tagBuilder:n,matchedText:Ht,offset:Ce,serviceName:a,mention:Ht.slice(1)}));else if(pe.type==="phone"){if(Ht=Ht.replace(/ +$/g,""),_me(Ht)){var pc=Ht.replace(/[^0-9,;#]/g,"");c.push(new Tme({tagBuilder:n,matchedText:Ht,offset:Ce,number:pc,plusSign:Ht.charAt(0)==="+"}))}}else Gy(pe)}}}var _7e=/[\(\{\[]/,Sme=/[\)\}\]]/,Cme={")":"(","}":"{","]":"["};function T7e(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);_7e.test(i)?t[i]++:Sme.test(i)&&t[Cme[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Sme.test(r)){var s=Cme[r];if(t[s]<0)t[s]++,o--;else break}else if(rme.test(r))o--;else break;return e.slice(0,o+1)}function qH(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function $H(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function S7e(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function C7e(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function V7e(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function L7e(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function ez(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}var foi=T(S());function Lme(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new bf,c=0,l=e.length,u=0,m=0,p=a;c<l;){var y=e.charAt(c);switch(u){case 0:f(y);break;case 1:x(y);break;case 2:C(y);break;case 3:_(y);break;case 4:V(y);break;case 5:L(y);break;case 6:Z(y);break;case 7:G(y);break;case 8:X(y);break;case 9:P(y);break;case 10:v(y);break;case 11:A(y);break;case 12:M(y);break;case 13:b(y);break;case 14:R(y);break;case 15:E(y);break;case 16:I(y);break;case 17:w(y);break;case 18:N(y);break;case 19:Y(y);break;case 20:k(y);break;default:Gy(u)}c++}m<c&&z();function f(j){j==="<"&&U()}function x(j){j==="!"?u=13:j==="/"?(u=2,p=new bf(Ps(Ps({},p),{isClosing:!0}))):j==="<"?U():Ey.test(j)?(u=3,p=new bf(Ps(Ps({},p),{isOpening:!0}))):(u=0,p=a)}function _(j){gd.test(j)?(p=new bf(Ps(Ps({},p),{name:ee()})),u=4):j==="<"?U():j==="/"?(p=new bf(Ps(Ps({},p),{name:ee()})),u=12):j===">"?(p=new bf(Ps(Ps({},p),{name:ee()})),J()):!Ey.test(j)&&!Ws.test(j)&&j!==":"&&O()}function C(j){j===">"?O():Ey.test(j)?u=3:O()}function V(j){gd.test(j)||(j==="/"?u=12:j===">"?J():j==="<"?U():j==="="||yN.test(j)||Jue.test(j)?O():u=5)}function L(j){gd.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?J():j==="<"?U():yN.test(j)&&O()}function Z(j){gd.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?J():j==="<"?U():yN.test(j)?O():u=5)}function G(j){gd.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?O():j==="<"?U():u=10)}function X(j){j==='"'&&(u=11)}function P(j){j==="'"&&(u=11)}function v(j){gd.test(j)?u=4:j===">"?J():j==="<"&&U()}function A(j){gd.test(j)?u=4:j==="/"?u=12:j===">"?J():j==="<"?U():(u=4,K())}function M(j){j===">"?(p=new bf(Ps(Ps({},p),{isClosing:!0})),J()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new bf(Ps(Ps({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new bf(Ps(Ps({},p),{type:"doctype"})),u=20):O()}function R(j){j==="-"?u=15:j===">"?O():u=16}function E(j){j==="-"?u=18:j===">"?O():u=16}function I(j){j==="-"&&(u=17)}function w(j){j==="-"?u=18:u=16}function N(j){j===">"?J():j==="!"?u=19:j==="-"||(u=16)}function Y(j){j==="-"?u=17:j===">"?J():u=16}function k(j){j===">"?J():j==="<"&&U()}function O(){u=0,p=a}function U(){u=1,p=new bf({idx:c})}function J(){var j=e.slice(m,p.idx);j&&o(j,m),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),O(),m=c+1}function z(){var j=e.slice(m,c);o(j,m),m=c+1}function ee(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function K(){c--}}var bf=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var R7e=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Z7e(t.urls),this.email=yd(t.email)?t.email:this.email,this.phone=yd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=yd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=G7e(t.stripPrefix),this.stripTrailingSlash=yd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=yd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&gme.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&pme.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=E7e(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return Lme(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,l=s.split(c),u=a;l.forEach(function(m,p){if(p%2===0){var y=n.parseText(m,u);r.push.apply(r,y)}u+=m.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,l){return c.getOffset()-l.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Zy(t,function(n){return n.getType()==="hashtag"}),this.email||Zy(t,function(n){return n.getType()==="email"}),this.phone||Zy(t,function(n){return n.getType()==="phone"}),this.mention||Zy(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Zy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Zy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Zy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=Vme(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof gN)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new tme({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Kue,e}(),Rme=R7e;function Z7e(e){return e==null&&(e=!0),yd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:yd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:yd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:yd(e.ipV4Matches)?e.ipV4Matches:!0}}function G7e(e){return e==null&&(e=!0),yd(e)?{scheme:e,www:e}:{scheme:yd(e.scheme)?e.scheme:!0,www:yd(e.www)?e.www:!0}}function E7e(e){return typeof e=="number"?{length:e,location:"end"}:Hue(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var Zoi=T(S());var Loi=T(S());var Foi=T(S());var VN=Rme;var wme;typeof DOMParser<"u"&&(wme=new DOMParser);var X7e=new VN({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),LN=32,Zme=2414016,Gme=1,Eme=16093e3,Xme=.1,I7e=[null,void 0,"http://www.topografix.com/GPX/1/1"],Co={gpx:I7e};function W7e(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function tz(e,t){let n=yP(e,"id");return n=d(n)?n:Yn(),t.getOrCreateEntity(n)}function nz(e){let t=Ime(e,"lon"),n=Ime(e,"lat"),i=pP(e,"ele",Co.gpx);return h.fromDegrees(t,n,i)}function Ime(e,t){if(!d(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function yP(e,t){if(!d(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Xy(e,t,n){if(!d(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function iz(e,t,n){if(!d(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function pP(e,t,n){let i=Xy(e,t,n);if(d(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function El(e,t,n){let i=Xy(e,t,n);if(d(i))return i.textContent.trim()}function Fme(e){let t=new Ua;return t.width=LN,t.height=LN,t.scaleByDistance=new Pt(Zme,Gme,Eme,Xme),t.pixelOffsetScaleByDistance=new Pt(Zme,Gme,Eme,Xme),t.verticalOrigin=new qn(In.BOTTOM),t.image=e,t}function P7e(){let e=new um;return e.translucencyByDistance=new Pt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=vo.FILL_AND_OUTLINE,e}function Ame(e){let t=new Ba;return t.width=4,t.material=new fy,t.material.color=d(e)?e:B.RED,t.material.outlineWidth=2,t.material.outlineColor=B.BLACK,t}var Wme={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},bP;typeof document<"u"&&(bP=document.createElement("div"));function oz(e,t){let n,i="",o=Object.keys(Wme),r=o.length;for(n=0;n<r;n++){let u=o[n],m=Wme[u];m.value=g(El(e,m.tag,Co.gpx),""),d(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!d(i)||i==="")return;i=X7e.link(i),bP.innerHTML=i;let s=bP.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=B.WHITE,c=B.BLACK,l='<div class="cesium-infoBox-description-lighter" style="';return l+="overflow:auto;",l+="word-wrap:break-word;",l+=`background-color:${a.toCssColorString()};`,l+=`color:${c.toCssColorString()};`,l+='">',l+=`${bP.innerHTML}</div>`,bP.innerHTML="",l}function Mme(e,t,n,i){let o=nz(t),r=tz(t,n);r.position=o;let s=d(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,LN);r.billboard=Fme(s);let a=El(t,"name",Co.gpx);r.name=a,r.label=P7e(),r.label.text=a,r.description=oz(t,r),i.clampToGround&&(r.billboard.heightReference=Ke.CLAMP_TO_GROUND,r.label.heightReference=Ke.CLAMP_TO_GROUND)}function v7e(e,t,n,i){let o=tz(t,n);o.description=oz(t,o);let r=iz(t,"rtept",Co.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)Mme(e,r[a],n,i),s[a]=nz(r[a]);o.polyline=Ame(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function w7e(e,t,n,i){let o=tz(t,n);o.description=oz(t,o);let r=iz(t,"trkseg",Co.gpx),s=[],a=[],c,l=!0,u=new js;for(let m=0;m<r.length;m++)c=F7e(r[m]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),l=l&&!0):l=!1;if(l){let m=d(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,LN);o.billboard=Fme(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=Ke.CLAMP_TO_GROUND),o.availability=new Zr,o.availability.addInterval(new Tn({start:a[0],stop:a[a.length-1]}))}o.polyline=Ame(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function F7e(e){let t={positions:[],times:[]},n=iz(e,"trkpt",Co.gpx),i;for(let o=0;o<n.length;o++){let r=nz(n[o]);t.positions.push(r),i=El(n[o],"time",Co.gpx),d(i)&&t.times.push(te.fromIso8601(i))}return t}function A7e(e){let t=Xy(e,"metadata",Co.gpx);if(d(t)){let n={name:El(t,"name",Co.gpx),desc:El(t,"desc",Co.gpx),author:M7e(t),copyright:U7e(t),link:Nme(t),time:El(t,"time",Co.gpx),keywords:El(t,"keywords",Co.gpx),bounds:k7e(t)};if(d(n.name)||d(n.desc)||d(n.author)||d(n.copyright)||d(n.link)||d(n.time)||d(n.keywords)||d(n.bounds))return n}}function M7e(e){let t=Xy(e,"author",Co.gpx);if(d(t)){let n={name:El(t,"name",Co.gpx),email:N7e(t),link:Nme(t)};if(d(n.name)||d(n.email)||d(n.link))return n}}function N7e(e){let t=Xy(e,"email",Co.gpx);if(d(t)){let n=El(t,"id",Co.gpx),i=El(t,"domain",Co.gpx);return`${n}@${i}`}}function Nme(e){let t=Xy(e,"link",Co.gpx);if(d(t)){let n={href:yP(t,"href"),text:El(t,"text",Co.gpx),mimeType:El(t,"type",Co.gpx)};if(d(n.href)||d(n.text)||d(n.mimeType))return n}}function U7e(e){let t=Xy(e,"copyright",Co.gpx);if(d(t)){let n={author:yP(t,"author"),year:El(t,"year",Co.gpx),license:El(t,"license",Co.gpx)};if(d(n.author)||d(n.year)||d(n.license))return n}}function k7e(e){let t=Xy(e,"bounds",Co.gpx);if(d(t)){let n={minLat:pP(t,"minlat",Co.gpx),maxLat:pP(t,"maxlat",Co.gpx),minLon:pP(t,"minlon",Co.gpx),maxLon:pP(t,"maxlon",Co.gpx)};if(d(n.minLat)||d(n.maxLat)||d(n.minLon)||d(n.maxLon))return n}}var Pme={wpt:Mme,rte:v7e,trk:w7e};function D7e(e,t,n,i){let o=Object.keys(Pme),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Pme[a],l=t.childNodes,u=l.length;for(let m=0;m<u;m++){let p=l[m];p.localName===a&&Co.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function vme(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=yP(o,"version"),s=yP(o,"creator"),a,c=A7e(o);d(c)&&(a=c.name),o.localName==="gpx"?D7e(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let l,u=i.computeAvailability(),m=u.start,p=u.stop,y=te.equals(m,Ye.MINIMUM_VALUE),f=te.equals(p,Ye.MAXIMUM_VALUE);if(!y||!f){let _;y&&(_=new Date,_.setHours(0,0,0,0),m=te.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=te.fromDate(_)),l=new Bm,l.startTime=m,l.stopTime=p,l.currentTime=te.clone(m),l.clockRange=Xr.LOOP_STOP,l.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,l.multiplier=Math.round(Math.min(Math.max(te.secondsDifference(p,m)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),B7e(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),l!==e._clock&&(x=!0,e._clock=l),x&&e._changed.raiseEvent(e),Gr.setLoading(e,!1),e}function B7e(e,t){return!d(e)&&!d(t)?!1:d(e)&&d(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function Y7e(e,t,n,i){i=g(i,g.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(d(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?W7e(r).then(function(s){let a,c;try{a=wme.parseFromString(s,"application/xml")}catch(l){c=l.toString()}if(d(c)||a.body||a.documentElement.tagName==="parsererror"){let l=d(c)?c:a.documentElement.firstChild.nodeValue;throw l||(l=a.body.innerText),new me(l)}return vme(e,a,i)}):vme(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function L1(){this._changed=new ye,this._error=new ye,this._loading=new ye,this._clock=void 0,this._entityCollection=new Es(this),this._entityCluster=new ad,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new V0}L1.load=function(e,t){return new L1().load(e,t)};Object.defineProperties(L1.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});L1.prototype.update=function(e){return!0};L1.prototype.load=function(e,t){if(!d(e))throw new fe("data is required.");t=g(t,g.EMPTY_OBJECT),Gr.setLoading(this,!0);let n=this._name,i=this;return Y7e(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=te.equals(s,Ye.MINIMUM_VALUE),l=te.equals(a,Ye.MAXIMUM_VALUE);if(!c||!l){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=te.fromDate(m)),l&&(m=new Date,m.setHours(24,0,0,0),a=te.fromDate(m)),o=new Bm,o.startTime=s,o.stopTime=a,o.currentTime=te.clone(s),o.clockRange=Xr.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(te.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Gr.setLoading(i,!1),i}).catch(function(o){return Gr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var gP=L1;var Gri=T(S(),1);function O7e(e,t){this.position=e,this.headingPitchRoll=t}var xP=O7e;var Dci=T(S(),1);var PP=T(Dl(),1);var Qsi=T(S(),1);var Xri=T(S(),1);function WN(e){return PN(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function PN(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?PN(n):n),[])}var Ume=[0,1,2,3].concat(...WN([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function rr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,l=e.stat_desc.max_length,u,m,p,y,f,x,_=0;for(y=0;y<=15;y++)o.bl_count[y]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)m=o.heap[u],y=r[r[m*2+1]*2+1]+1,y>l&&(y=l,_++),r[m*2+1]=y,!(m>e.max_code)&&(o.bl_count[y]++,f=0,m>=c&&(f=a[m-c]),x=r[m*2],o.opt_len+=x*(y+f),s&&(o.static_len+=x*(s[m*2+1]+f)));if(_!==0){do{for(y=l-1;o.bl_count[y]===0;)y--;o.bl_count[y]--,o.bl_count[y+1]+=2,o.bl_count[l]--,_-=2}while(_>0);for(y=l;y!==0;y--)for(m=o.bl_count[y];m!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=y&&(o.opt_len+=(y-r[p*2+1])*r[p*2],r[p*2+1]=y),m--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,l,u,m;for(l=1;l<=15;l++)a[l]=c=c+s[l-1]<<1;for(u=0;u<=r;u++)m=o[u*2+1],m!==0&&(o[u*2]=n(a[m]++,m))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,l,u=-1,m;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=u=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)m=o.heap[++o.heap_len]=u<2?++u:0,r[m*2]=1,o.depth[m]=0,o.opt_len--,s&&(o.static_len-=s[m*2+1]);for(e.max_code=u,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);m=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),l=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=l,r[m*2]=r[c*2]+r[l*2],o.depth[m]=Math.max(o.depth[c],o.depth[l])+1,r[c*2+1]=r[l*2+1]=m,o.heap[1]=m++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}rr._length_code=[0,1,2,3,4,5,6,7].concat(...WN([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));rr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];rr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];rr.d_code=function(e){return e<256?Ume[e]:Ume[256+(e>>>7)]};rr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];rr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];rr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];rr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function _a(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var K7e=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],H7e=WN([[144,8],[112,9],[24,7],[8,8]]);_a.static_ltree=PN(K7e.map((e,t)=>[e,H7e[t]]));var z7e=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],J7e=WN([[30,5]]);_a.static_dtree=PN(z7e.map((e,t)=>[e,J7e[t]]));_a.static_l_desc=new _a(_a.static_ltree,rr.extra_lbits,256+1,286,15);_a.static_d_desc=new _a(_a.static_dtree,rr.extra_dbits,0,30,15);_a.static_bl_desc=new _a(null,rr.extra_blbits,0,19,7);var Q7e=9,j7e=8;function yf(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var Dme=0,XN=1,F_=2,eh=[new yf(0,0,0,0,Dme),new yf(4,4,8,4,XN),new yf(4,5,16,8,XN),new yf(4,6,32,32,XN),new yf(4,4,16,16,F_),new yf(8,16,32,32,F_),new yf(8,16,128,128,F_),new yf(8,32,128,256,F_),new yf(32,128,258,1024,F_),new yf(32,258,258,4096,F_)],RN=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],vu=0,ZN=1,_P=2,GN=3,q7e=32,rz=42,EN=113,TP=666,sz=8,$7e=0,az=1,e6e=2,fr=3,IN=258,xd=IN+fr+1;function kme(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function t6e(){let e=this,t,n,i,o,r,s,a,c,l,u,m,p,y,f,x,_,C,V,L,Z,G,X,P,v,A,M,b,R,E,I,w,N,Y,k=new rr,O=new rr,U=new rr;e.depth=[];let J,z,ee,K,j,q;e.bl_count=[],e.heap=[],w=[],N=[],Y=[];function be(){l=2*r,m[y-1]=0;for(let we=0;we<y-1;we++)m[we]=0;M=eh[b].max_lazy,E=eh[b].good_length,I=eh[b].nice_length,A=eh[b].max_chain,G=0,C=0,P=0,V=v=fr-1,Z=0,p=0}function Te(){let we;for(we=0;we<286;we++)w[we*2]=0;for(we=0;we<30;we++)N[we*2]=0;for(we=0;we<19;we++)Y[we*2]=0;w[256*2]=1,e.opt_len=e.static_len=0,z=ee=0}function ae(){k.dyn_tree=w,k.stat_desc=_a.static_l_desc,O.dyn_tree=N,O.stat_desc=_a.static_d_desc,U.dyn_tree=Y,U.stat_desc=_a.static_bl_desc,j=0,q=0,K=8,Te()}e.pqdownheap=function(we,je){let qe=e.heap,Qe=qe[je],pt=je<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&kme(we,qe[pt+1],qe[pt],e.depth)&&pt++,!kme(we,Qe,qe[pt],e.depth));)qe[je]=qe[pt],je=pt,pt<<=1;qe[je]=Qe};function xe(we,je){let qe=-1,Qe,pt=we[0*2+1],Bt=0,Vn=7,di=4;pt===0&&(Vn=138,di=3),we[(je+1)*2+1]=65535;for(let bo=0;bo<=je;bo++)Qe=pt,pt=we[(bo+1)*2+1],!(++Bt<Vn&&Qe==pt)&&(Bt<di?Y[Qe*2]+=Bt:Qe!==0?(Qe!=qe&&Y[Qe*2]++,Y[16*2]++):Bt<=10?Y[17*2]++:Y[18*2]++,Bt=0,qe=Qe,pt===0?(Vn=138,di=3):Qe==pt?(Vn=6,di=3):(Vn=7,di=4))}function _e(){let we;for(xe(w,k.max_code),xe(N,O.max_code),U.build_tree(e),we=19-1;we>=3&&Y[rr.bl_order[we]*2+1]===0;we--);return e.opt_len+=3*(we+1)+5+5+4,we}function Ve(we){e.pending_buf[e.pending++]=we}function Ie(we){Ve(we&255),Ve(we>>>8&255)}function Me(we){Ve(we>>8&255),Ve(we&255&255)}function ve(we,je){let qe,Qe=je;q>16-Qe?(qe=we,j|=qe<<q&65535,Ie(j),j=qe>>>16-q,q+=Qe-16):(j|=we<<q&65535,q+=Qe)}function ke(we,je){let qe=we*2;ve(je[qe]&65535,je[qe+1]&65535)}function ct(we,je){let qe,Qe=-1,pt,Bt=we[0*2+1],Vn=0,di=7,bo=4;for(Bt===0&&(di=138,bo=3),qe=0;qe<=je;qe++)if(pt=Bt,Bt=we[(qe+1)*2+1],!(++Vn<di&&pt==Bt)){if(Vn<bo)do ke(pt,Y);while(--Vn!==0);else pt!==0?(pt!=Qe&&(ke(pt,Y),Vn--),ke(16,Y),ve(Vn-3,2)):Vn<=10?(ke(17,Y),ve(Vn-3,3)):(ke(18,Y),ve(Vn-11,7));Vn=0,Qe=pt,Bt===0?(di=138,bo=3):pt==Bt?(di=6,bo=3):(di=7,bo=4)}}function yt(we,je,qe){let Qe;for(ve(we-257,5),ve(je-1,5),ve(qe-4,4),Qe=0;Qe<qe;Qe++)ve(Y[rr.bl_order[Qe]*2+1],3);ct(w,we-1),ct(N,je-1)}function ot(){q==16?(Ie(j),j=0,q=0):q>=8&&(Ve(j&255),j>>>=8,q-=8)}function ln(){ve(az<<1,3),ke(256,_a.static_ltree),ot(),1+K+10-q<9&&(ve(az<<1,3),ke(256,_a.static_ltree),ot()),K=7}function vn(we,je){let qe,Qe,pt;if(e.dist_buf[z]=we,e.lc_buf[z]=je&255,z++,we===0?w[je*2]++:(ee++,we--,w[(rr._length_code[je]+256+1)*2]++,N[rr.d_code(we)*2]++),!(z&8191)&&b>2){for(qe=z*8,Qe=G-C,pt=0;pt<30;pt++)qe+=N[pt*2]*(5+rr.extra_dbits[pt]);if(qe>>>=3,ee<Math.floor(z/2)&&qe<Math.floor(Qe/2))return!0}return z==J-1}function Dt(we,je){let qe,Qe,pt=0,Bt,Vn;if(z!==0)do qe=e.dist_buf[pt],Qe=e.lc_buf[pt],pt++,qe===0?ke(Qe,we):(Bt=rr._length_code[Qe],ke(Bt+256+1,we),Vn=rr.extra_lbits[Bt],Vn!==0&&(Qe-=rr.base_length[Bt],ve(Qe,Vn)),qe--,Bt=rr.d_code(qe),ke(Bt,je),Vn=rr.extra_dbits[Bt],Vn!==0&&(qe-=rr.base_dist[Bt],ve(qe,Vn)));while(pt<z);ke(256,we),K=we[256*2+1]}function Nt(){q>8?Ie(j):q>0&&Ve(j&255),j=0,q=0}function pe(we,je,qe){Nt(),K=8,qe&&(Ie(je),Ie(~je)),e.pending_buf.set(c.subarray(we,we+je),e.pending),e.pending+=je}function Ce(we,je,qe){ve(($7e<<1)+(qe?1:0),3),pe(we,je,!0)}function Ht(we,je,qe){let Qe,pt,Bt=0;b>0?(k.build_tree(e),O.build_tree(e),Bt=_e(),Qe=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Qe&&(Qe=pt)):Qe=pt=je+5,je+4<=Qe&&we!=-1?Ce(we,je,qe):pt==Qe?(ve((az<<1)+(qe?1:0),3),Dt(_a.static_ltree,_a.static_dtree)):(ve((e6e<<1)+(qe?1:0),3),yt(k.max_code+1,O.max_code+1,Bt+1),Dt(w,N)),Te(),qe&&Nt()}function ut(we){Ht(C>=0?C:-1,G-C,we),C=G,t.flush_pending()}function hi(){let we,je,qe,Qe;do{if(Qe=l-P-G,Qe===0&&G===0&&P===0)Qe=r;else if(Qe==-1)Qe--;else if(G>=r+r-xd){c.set(c.subarray(r,r+r),0),X-=r,G-=r,C-=r,we=y,qe=we;do je=m[--qe]&65535,m[qe]=je>=r?je-r:0;while(--we!==0);we=r,qe=we;do je=u[--qe]&65535,u[qe]=je>=r?je-r:0;while(--we!==0);Qe+=r}if(t.avail_in===0)return;we=t.read_buf(c,G+P,Qe),P+=we,P>=fr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(P<xd&&t.avail_in!==0)}function ji(we){let je=65535,qe;for(je>i-5&&(je=i-5);;){if(P<=1){if(hi(),P===0&&we==0)return vu;if(P===0)break}if(G+=P,P=0,qe=C+je,(G===0||G>=qe)&&(P=G-qe,G=qe,ut(!1),t.avail_out===0)||G-C>=r-xd&&(ut(!1),t.avail_out===0))return vu}return ut(we==4),t.avail_out===0?we==4?_P:vu:we==4?GN:ZN}function pc(we){let je=A,qe=G,Qe,pt,Bt=v,Vn=G>r-xd?G-(r-xd):0,di=I,bo=a,es=G+IN,ts=c[qe+Bt-1],Mo=c[qe+Bt];v>=E&&(je>>=2),di>P&&(di=P);do if(Qe=we,!(c[Qe+Bt]!=Mo||c[Qe+Bt-1]!=ts||c[Qe]!=c[qe]||c[++Qe]!=c[qe+1])){qe+=2,Qe++;do;while(c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&c[++qe]==c[++Qe]&&qe<es);if(pt=IN-(es-qe),qe=es-IN,pt>Bt){if(X=we,Bt=pt,pt>=di)break;ts=c[qe+Bt-1],Mo=c[qe+Bt]}}while((we=u[we&bo]&65535)>Vn&&--je!==0);return Bt<=P?Bt:P}function bs(we){let je=0,qe;for(;;){if(P<xd){if(hi(),P<xd&&we==0)return vu;if(P===0)break}if(P>=fr&&(p=(p<<_^c[G+(fr-1)]&255)&x,je=m[p]&65535,u[G&a]=m[p],m[p]=G),je!==0&&(G-je&65535)<=r-xd&&R!=2&&(V=pc(je)),V>=fr)if(qe=vn(G-X,V-fr),P-=V,V<=M&&P>=fr){V--;do G++,p=(p<<_^c[G+(fr-1)]&255)&x,je=m[p]&65535,u[G&a]=m[p],m[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else qe=vn(0,c[G]&255),P--,G++;if(qe&&(ut(!1),t.avail_out===0))return vu}return ut(we==4),t.avail_out===0?we==4?_P:vu:we==4?GN:ZN}function ys(we){let je=0,qe,Qe;for(;;){if(P<xd){if(hi(),P<xd&&we==0)return vu;if(P===0)break}if(P>=fr&&(p=(p<<_^c[G+(fr-1)]&255)&x,je=m[p]&65535,u[G&a]=m[p],m[p]=G),v=V,L=X,V=fr-1,je!==0&&v<M&&(G-je&65535)<=r-xd&&(R!=2&&(V=pc(je)),V<=5&&(R==1||V==fr&&G-X>4096)&&(V=fr-1)),v>=fr&&V<=v){Qe=G+P-fr,qe=vn(G-1-L,v-fr),P-=v-1,v-=2;do++G<=Qe&&(p=(p<<_^c[G+(fr-1)]&255)&x,je=m[p]&65535,u[G&a]=m[p],m[p]=G);while(--v!==0);if(Z=0,V=fr-1,G++,qe&&(ut(!1),t.avail_out===0))return vu}else if(Z!==0){if(qe=vn(0,c[G-1]&255),qe&&ut(!1),G++,P--,t.avail_out===0)return vu}else Z=1,G++,P--}return Z!==0&&(qe=vn(0,c[G-1]&255),Z=0),ut(we==4),t.avail_out===0?we==4?_P:vu:we==4?GN:ZN}function $r(we){return we.total_in=we.total_out=0,we.msg=null,e.pending=0,e.pending_out=0,n=EN,o=0,ae(),be(),0}e.deflateInit=function(we,je,qe,Qe,pt,Bt){return Qe||(Qe=sz),pt||(pt=j7e),Bt||(Bt=0),we.msg=null,je==-1&&(je=6),pt<1||pt>Q7e||Qe!=sz||qe<9||qe>15||je<0||je>9||Bt<0||Bt>2?-2:(we.dstate=e,s=qe,r=1<<s,a=r-1,f=pt+7,y=1<<f,x=y-1,_=Math.floor((f+fr-1)/fr),c=new Uint8Array(r*2),u=[],m=[],J=1<<pt+6,e.pending_buf=new Uint8Array(J*4),i=J*4,e.dist_buf=new Uint16Array(J),e.lc_buf=new Uint8Array(J),b=je,R=Bt,$r(we))},e.deflateEnd=function(){return n!=rz&&n!=EN&&n!=TP?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,m=null,u=null,c=null,e.dstate=null,n==EN?-3:0)},e.deflateParams=function(we,je,qe){let Qe=0;return je==-1&&(je=6),je<0||je>9||qe<0||qe>2?-2:(eh[b].func!=eh[je].func&&we.total_in!==0&&(Qe=we.deflate(1)),b!=je&&(b=je,M=eh[b].max_lazy,E=eh[b].good_length,I=eh[b].nice_length,A=eh[b].max_chain),R=qe,Qe)},e.deflateSetDictionary=function(we,je,qe){let Qe=qe,pt,Bt=0;if(!je||n!=rz)return-2;if(Qe<fr)return 0;for(Qe>r-xd&&(Qe=r-xd,Bt=qe-Qe),c.set(je.subarray(Bt,Bt+Qe),0),G=Qe,C=Qe,p=c[0]&255,p=(p<<_^c[1]&255)&x,pt=0;pt<=Qe-fr;pt++)p=(p<<_^c[pt+(fr-1)]&255)&x,u[pt&a]=m[p],m[p]=pt;return 0},e.deflate=function(we,je){let qe,Qe,pt,Bt,Vn;if(je>4||je<0)return-2;if(!we.next_out||!we.next_in&&we.avail_in!==0||n==TP&&je!=4)return we.msg=RN[2- -2],-2;if(we.avail_out===0)return we.msg=RN[2- -5],-5;if(t=we,Bt=o,o=je,n==rz&&(Qe=sz+(s-8<<4)<<8,pt=(b-1&255)>>1,pt>3&&(pt=3),Qe|=pt<<6,G!==0&&(Qe|=q7e),Qe+=31-Qe%31,n=EN,Me(Qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&je<=Bt&&je!=4)return t.msg=RN[2- -5],-5;if(n==TP&&t.avail_in!==0)return we.msg=RN[2- -5],-5;if(t.avail_in!==0||P!==0||je!=0&&n!=TP){switch(Vn=-1,eh[b].func){case Dme:Vn=ji(je);break;case XN:Vn=bs(je);break;case F_:Vn=ys(je);break;default:}if((Vn==_P||Vn==GN)&&(n=TP),Vn==vu||Vn==_P)return t.avail_out===0&&(o=-1),0;if(Vn==ZN){if(je==1)ln();else if(Ce(0,0,!1),je==3)for(qe=0;qe<y;qe++)m[qe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return je!=4?0:1}}function Bme(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Bme.prototype={deflateInit:function(e,t){let n=this;return n.dstate=new t6e,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate:function(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd:function(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams:function(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary:function(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf:function(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending:function(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function n6e(e){let t=this,n=new Bme,i=i6e(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let l,u,m=0,p=0,y=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,l=n.deflate(o),l!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.slice(0,n.next_out_index))),y+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=m&&(c(n.next_in_index),m=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(y),f.forEach(function(x){u.set(x,p),p+=x.length})):u=f[0]||new Uint8Array(0),u}},t.flush=function(){let a,c,l=0,u=0,m=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&m.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),m.forEach(function(p){c.set(p,l),l+=p.length}),c}}function i6e(e){return e+5*(Math.floor(e/16383)+1)}var Yme=n6e;var Wri=T(S(),1);var _d=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],dhe=1440,o6e=0,r6e=4,s6e=9,a6e=5,c6e=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],l6e=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],d6e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u6e=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],m6e=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],h6e=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Iy=15;function uz(){let e=this,t,n,i,o,r,s;function a(l,u,m,p,y,f,x,_,C,V,L){let Z,G,X,P,v,A,M,b,R,E,I,w,N,Y,k;E=0,v=m;do i[l[u+E]]++,E++,v--;while(v!==0);if(i[0]==m)return x[0]=-1,_[0]=0,0;for(b=_[0],A=1;A<=Iy&&i[A]===0;A++);for(M=A,b<A&&(b=A),v=Iy;v!==0&&i[v]===0;v--);for(X=v,b>v&&(b=v),_[0]=b,Y=1<<A;A<v;A++,Y<<=1)if((Y-=i[A])<0)return-3;if((Y-=i[v])<0)return-3;for(i[v]+=Y,s[1]=A=0,E=1,N=2;--v!==0;)s[N]=A+=i[E],N++,E++;v=0,E=0;do(A=l[u+E])!==0&&(L[s[A]++]=v),E++;while(++v<m);for(m=s[X],s[0]=v=0,E=0,P=-1,w=-b,r[0]=0,I=0,k=0;M<=X;M++)for(Z=i[M];Z--!==0;){for(;M>w+b;){if(P++,w+=b,k=X-w,k=k>b?b:k,(G=1<<(A=M-w))>Z+1&&(G-=Z+1,N=M,A<k))for(;++A<k&&!((G<<=1)<=i[++N]);)G-=i[N];if(k=1<<A,V[0]+k>dhe)return-3;r[P]=I=V[0],V[0]+=k,P!==0?(s[P]=v,o[0]=A,o[1]=b,A=v>>>w-b,o[2]=I-r[P-1]-A,C.set(o,(r[P-1]+A)*3)):x[0]=I}for(o[1]=M-w,E>=m?o[0]=128+64:L[E]<p?(o[0]=L[E]<256?0:32+64,o[2]=L[E++]):(o[0]=f[L[E]-p]+16+64,o[2]=y[L[E++]-p]),G=1<<M-w,A=v>>>w;A<k;A+=G)C.set(o,(I+A)*3);for(A=1<<M-1;v&A;A>>>=1)v^=A;for(v^=A,R=(1<<w)-1;(v&R)!=s[P];)P--,w-=b,R=(1<<w)-1}return Y!==0&&X!=1?-5:0}function c(l){let u;for(t||(t=[],n=[],i=new Int32Array(Iy+1),o=[],r=new Int32Array(Iy),s=new Int32Array(Iy+1)),n.length<l&&(n=[]),u=0;u<l;u++)n[u]=0;for(u=0;u<Iy+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,Iy),0),s.set(i.subarray(0,Iy+1),0)}e.inflate_trees_bits=function(l,u,m,p,y){let f;return c(19),t[0]=0,f=a(l,0,19,19,null,null,m,u,p,t,n),f==-3?y.msg="oversubscribed dynamic bit lengths tree":(f==-5||u[0]===0)&&(y.msg="incomplete dynamic bit lengths tree",f=-3),f},e.inflate_trees_dynamic=function(l,u,m,p,y,f,x,_,C){let V;return c(288),t[0]=0,V=a(m,0,l,257,d6e,u6e,f,p,_,t,n),V!=0||p[0]===0?(V==-3?C.msg="oversubscribed literal/length tree":V!=-4&&(C.msg="incomplete literal/length tree",V=-3),V):(c(288),V=a(m,l,u,0,m6e,h6e,x,y,_,t,n),V!=0||y[0]===0&&l>257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}uz.inflate_trees_fixed=function(e,t,n,i){return e[0]=s6e,t[0]=a6e,n[0]=c6e,i[0]=l6e,0};var vN=0,Ome=1,Kme=2,Hme=3,zme=4,Jme=5,Qme=6,cz=7,jme=8,wN=9;function f6e(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,l=0,u=0,m,p=0,y,f=0;function x(_,C,V,L,Z,G,X,P){let v,A,M,b,R,E,I,w,N,Y,k,O,U,J,z,ee;I=P.next_in_index,w=P.avail_in,R=X.bitb,E=X.bitk,N=X.write,Y=N<X.read?X.read-N-1:X.end-N,k=_d[_],O=_d[C];do{for(;E<20;)w--,R|=(P.read_byte(I++)&255)<<E,E+=8;if(v=R&k,A=V,M=L,ee=(M+v)*3,(b=A[ee])===0){R>>=A[ee+1],E-=A[ee+1],X.win[N++]=A[ee+2],Y--;continue}do{if(R>>=A[ee+1],E-=A[ee+1],b&16){for(b&=15,U=A[ee+2]+(R&_d[b]),R>>=b,E-=b;E<15;)w--,R|=(P.read_byte(I++)&255)<<E,E+=8;v=R&O,A=Z,M=G,ee=(M+v)*3,b=A[ee];do if(R>>=A[ee+1],E-=A[ee+1],b&16){for(b&=15;E<b;)w--,R|=(P.read_byte(I++)&255)<<E,E+=8;if(J=A[ee+2]+(R&_d[b]),R>>=b,E-=b,Y-=U,N>=J)z=N-J,N-z>0&&2>N-z?(X.win[N++]=X.win[z++],X.win[N++]=X.win[z++],U-=2):(X.win.set(X.win.subarray(z,z+2),N),N+=2,z+=2,U-=2);else{z=N-J;do z+=X.end;while(z<0);if(b=X.end-z,U>b){if(U-=b,N-z>0&&b>N-z)do X.win[N++]=X.win[z++];while(--b!==0);else X.win.set(X.win.subarray(z,z+b),N),N+=b,z+=b,b=0;z=0}}if(N-z>0&&U>N-z)do X.win[N++]=X.win[z++];while(--U!==0);else X.win.set(X.win.subarray(z,z+U),N),N+=U,z+=U,U=0;break}else if(!(b&64))v+=A[ee+2],v+=R&_d[b],ee=(M+v)*3,b=A[ee];else return P.msg="invalid distance code",U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,I-=U,E-=U<<3,X.bitb=R,X.bitk=E,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,X.write=N,-3;while(!0);break}if(b&64)return b&32?(U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,I-=U,E-=U<<3,X.bitb=R,X.bitk=E,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,X.write=N,1):(P.msg="invalid literal/length code",U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,I-=U,E-=U<<3,X.bitb=R,X.bitk=E,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,X.write=N,-3);if(v+=A[ee+2],v+=R&_d[b],ee=(M+v)*3,(b=A[ee])===0){R>>=A[ee+1],E-=A[ee+1],X.win[N++]=A[ee+2],Y--;break}}while(!0)}while(Y>=258&&w>=10);return U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,I-=U,E-=U<<3,X.bitb=R,X.bitk=E,P.avail_in=w,P.total_in+=I-P.next_in_index,P.next_in_index=I,X.write=N,0}e.init=function(_,C,V,L,Z,G){t=vN,l=_,u=C,m=V,p=L,y=Z,f=G,i=null},e.proc=function(_,C,V){let L,Z,G,X=0,P=0,v=0,A,M,b,R;for(v=C.next_in_index,A=C.avail_in,X=_.bitb,P=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M;;)switch(t){case vN:if(b>=258&&A>=10&&(_.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,V=x(l,u,m,p,y,f,_,C),v=C.next_in_index,A=C.avail_in,X=_.bitb,P=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M,V!=0)){t=V==1?cz:wN;break}r=l,i=m,o=p,t=Ome;case Ome:for(L=r;P<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(v++)&255)<<P,P+=8}if(Z=(o+(X&_d[L]))*3,X>>>=i[Z+1],P-=i[Z+1],G=i[Z],G===0){s=i[Z+2],t=Qme;break}if(G&16){a=G&15,n=i[Z+2],t=Kme;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}if(G&32){t=cz;break}return t=wN,C.msg="invalid literal/length code",V=-3,_.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);case Kme:for(L=a;P<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(v++)&255)<<P,P+=8}n+=X&_d[L],X>>=L,P-=L,r=u,i=y,o=f,t=Hme;case Hme:for(L=r;P<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(v++)&255)<<P,P+=8}if(Z=(o+(X&_d[L]))*3,X>>=i[Z+1],P-=i[Z+1],G=i[Z],G&16){a=G&15,c=i[Z+2],t=zme;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}return t=wN,C.msg="invalid distance code",V=-3,_.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);case zme:for(L=a;P<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(v++)&255)<<P,P+=8}c+=X&_d[L],X>>=L,P-=L,t=Jme;case Jme:for(R=M-c;R<0;)R+=_.end;for(;n!==0;){if(b===0&&(M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0)))return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);_.win[M++]=_.win[R++],b--,R==_.end&&(R=0),n--}t=vN;break;case Qme:if(b===0&&(M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0)))return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);V=0,_.win[M++]=s,b--,t=vN;break;case cz:if(P>7&&(P-=8,A++,v--),_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,_.read!=_.write)return _.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);t=jme;case jme:return V=1,_.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);case wN:return V=-3,_.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);default:return V=-2,_.bitb=X,_.bitk=P,C.avail_in=A,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V)}},e.free=function(){}}var qme=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R1=0,lz=1,$me=2,ehe=3,the=4,nhe=5,FN=6,AN=7,ihe=8,A_=9;function p6e(e,t){let n=this,i=R1,o=0,r=0,s=0,a,c=[0],l=[0],u=new f6e,m=0,p=new Int32Array(dhe*3),y=0,f=new uz;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=y),i==FN&&u.free(x),i=R1,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,Z,G,X,P,v;for(Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,X=n.write,P=X<n.read?n.read-X-1:n.end-X;;){let A,M,b,R,E,I,w,N;switch(i){case R1:for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}switch(C=V&7,m=C&1,C>>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=lz;break;case 1:A=[],M=[],b=[[]],R=[[]],uz.inflate_trees_fixed(A,M,b,R),u.init(A[0],M[0],b[0],0,R[0],0),V>>>=3,L-=3,i=FN;break;case 2:V>>>=3,L-=3,i=ehe;break;case 3:return V>>>=3,L-=3,i=A_,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_)}break;case lz:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if((~V>>>16&65535)!=(V&65535))return i=A_,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?$me:m!==0?AN:R1;break;case $me:if(G===0||P===0&&(X==n.end&&n.read!==0&&(X=0,P=X<n.read?n.read-X-1:n.end-X),P===0&&(n.write=X,_=n.inflate_flush(x,_),X=n.write,P=X<n.read?n.read-X-1:n.end-X,X==n.end&&n.read!==0&&(X=0,P=X<n.read?n.read-X-1:n.end-X),P===0)))return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);if(_=0,C=o,C>G&&(C=G),C>P&&(C=P),n.win.set(x.read_buf(Z,C),X),Z+=C,G-=C,X+=C,P-=C,(o-=C)!==0)break;i=m!==0?AN:R1;break;case ehe:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(r=C=V&16383,(C&31)>29||(C>>5&31)>29)return i=A_,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(v=0;v<C;v++)a[v]=0;V>>>=14,L-=14,s=0,i=the;case the:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}a[qme[s++]]=V&7,V>>>=3,L-=3}for(;s<19;)a[qme[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,l,p,x),C!=0)return _=C,_==-3&&(a=null,i=A_),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);s=0,i=nhe;case nhe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let Y,k;for(C=c[0];L<C;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(C=p[(l[0]+(V&_d[C]))*3+1],k=p[(l[0]+(V&_d[C]))*3+2],k<16)V>>>=C,L-=C,a[s++]=k;else{for(v=k==18?7:k-14,Y=k==18?11:3;L<C+v;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(V>>>=C,L-=C,Y+=V&_d[v],V>>>=v,L-=v,v=s,C=r,v+Y>258+(C&31)+(C>>5&31)||k==16&&v<1)return a=null,i=A_,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);k=k==16?a[v-1]:0;do a[v++]=k;while(--Y!==0);s=v}}if(l[0]=-1,E=[],I=[],w=[],N=[],E[0]=9,I[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,I,w,N,p,x),C!=0)return C==-3&&(a=null,i=A_),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);u.init(E[0],I[0],p,w[0],p,N[0]),i=FN;case FN:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,X=n.write,P=X<n.read?n.read-X-1:n.end-X,m===0){i=R1;break}i=AN;case AN:if(n.write=X,_=n.inflate_flush(x,_),X=n.write,P=X<n.read?n.read-X-1:n.end-X,n.read!=n.write)return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);i=ihe;case ihe:return _=1,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);case A_:return _=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);default:return _=-2,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,_,C){n.win.set(x.subarray(_,_+C),0),n.read=n.write=C},n.sync_point=function(){return i==lz?1:0}}var b6e=32,y6e=8,g6e=0,ohe=1,rhe=2,she=3,ahe=4,che=5,dz=6,SP=7,lhe=12,Wy=13,x6e=[0,0,255,255];function _6e(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=SP,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new p6e(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==r6e?-5:0,o=-5;;)switch(s.mode){case g6e:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=y6e){s.mode=Wy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Wy,n.msg="invalid win size",s.marker=5;break}s.mode=ohe;case ohe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Wy,n.msg="incorrect header check",s.marker=5;break}if(!(r&b6e)){s.mode=SP;break}s.mode=rhe;case rhe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=she;case she:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=ahe;case ahe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=che;case che:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=dz,2);case dz:return s.mode=Wy,n.msg="need dictionary",s.marker=0,-2;case SP:if(o=s.blocks.proc(n,o),o==-3){s.mode=Wy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=lhe;case lhe:return n.avail_in=0,1;case Wy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=dz)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=SP,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Wy&&(c.mode=Wy,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==x6e[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=SP,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function uhe(){}uhe.prototype={inflateInit:function(e){let t=this;return t.istate=new _6e,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd:function(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary:function(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};function T6e(e){let t=this,n=new uhe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=o6e,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let l=[],u,m,p=0,y=0,f=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),u=n.inflate(o),s&&u===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+n.msg);if((s||u===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?l.push(new Uint8Array(r)):l.push(r.slice(0,n.next_out_index))),f+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return l.length>1?(m=new Uint8Array(f),l.forEach(function(x){m.set(x,y),y+=x.length})):m=l[0]||new Uint8Array(0),m}},t.flush=function(){n.inflateEnd()}}var mhe=T6e;var vri=T(S(),1),S6e={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},Xl=Object.assign({},S6e);function MN(){return Xl}function Z1(e){if(e.baseURL!==void 0&&(Xl.baseURL=e.baseURL),e.chunkSize!==void 0&&(Xl.chunkSize=e.chunkSize),e.maxWorkers!==void 0&&(Xl.maxWorkers=e.maxWorkers),e.terminateWorkerTimeout!==void 0&&(Xl.terminateWorkerTimeout=e.terminateWorkerTimeout),e.useWebWorkers!==void 0&&(Xl.useWebWorkers=e.useWebWorkers),e.Deflate!==void 0&&(Xl.Deflate=e.Deflate),e.Inflate!==void 0&&(Xl.Inflate=e.Inflate),e.workerScripts!==void 0){if(e.workerScripts.deflate){if(!Array.isArray(e.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");Xl.workerScripts||(Xl.workerScripts={}),Xl.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!Array.isArray(e.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");Xl.workerScripts||(Xl.workerScripts={}),Xl.workerScripts.inflate=e.workerScripts.inflate}}}var Fri=T(S(),1);var usi=T(S(),1);var osi=T(S(),1);var Mri=T(S(),1),hhe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;hhe[e]=t}var mz=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^hhe[(n^t[i])&255];this.crc=n}get(){return~this.crc}},Py=mz;var Jri=T(S(),1);var Uri=T(S(),1),CP=C6e;function C6e(e){if(typeof TextEncoder>"u"){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Dri=T(S(),1),kc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=kc.getPartial(n);return i===32?e.concat(t):kc._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+kc.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=kc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=kc.getPartial(o);return i.push(kc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},VP={bytes:{fromBits(e){let n=kc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(kc.partial(8*(n&3),i)),t}}},hz={};hz.sha1=function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()};hz.sha1.prototype={blockSize:512,reset:function(){let e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){let t=this;typeof e=="string"&&(e=VP.utf8String.toBits(e));let n=t._buffer=kc.concat(t._buffer,e),i=t._length,o=t._length=i+kc.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){let e=this,t=e._buffer,n=e._h;t=kc.concat(t,[kc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i},_S:function(e,t){return t<<e|t>>>32-e},_block:function(e){let t=this,n=t._h,i=Array(80);for(let l=0;l<16;l++)i[l]=e[l];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let l=0;l<=79;l++){l>=16&&(i[l]=t._S(1,i[l-3]^i[l-8]^i[l-14]^i[l-16]));let u=t._S(5,o)+t._f(l,r,s,a)+c+i[l]+t._key[Math.floor(l/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var fz={};fz.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let l=s[r-1];(r%o===0||o===8&&r%o===4)&&(l=n[l>>>24]<<24^n[l>>16&255]<<16^n[l>>8&255]<<8^n[l&255],r%o===0&&(l=l<<8^l>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^l}for(let l=0;r;l++,r--){let u=s[l&3?r:r-4];r<=4||l<4?a[l]=u:a[l]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,l;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[u]=m,i[m]=u,l=o[c=o[a=o[u]]];let p=l*16843009^c*65537^a*257^u*16843008,y=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=y=y<<24^y>>>8,t[f][m]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],l=r[3],u=r[4],m=e[0]^n[0],p=e[t?3:1]^n[1],y=e[2]^n[2],f=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L<i;L++)_=s[m>>>24]^a[p>>16&255]^c[y>>8&255]^l[f&255]^n[x],C=s[p>>>24]^a[y>>16&255]^c[f>>8&255]^l[m&255]^n[x+1],V=s[y>>>24]^a[f>>16&255]^c[m>>8&255]^l[p&255]^n[x+2],f=s[f>>>24]^a[m>>16&255]^c[p>>8&255]^l[y&255]^n[x+3],x+=4,m=_,p=C,y=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[m>>>24]<<24^u[p>>16&255]<<16^u[y>>8&255]<<8^u[f&255]^n[x++],_=m,m=p,p=y,y=f,f=_;return o}};var fhe={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},pz={};pz.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=kc.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return kc.clamp(t,o)}};var G1={importKey(e){return new G1.hmacSha1(VP.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,l,u=new ArrayBuffer(o),m=new DataView(u),p=0,y=kc;for(t=VP.bytes.toBits(t),l=1;p<(o||1);l++){for(r=s=e.encrypt(y.concat(t,[l])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)m.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};G1.hmacSha1=class{constructor(e){let t=this,n=t._hash=hz.sha1,i=[[],[]],o=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>o&&(e=n.hash(e));for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var X1="Invalid pasword",E1=16,V6e="raw",phe={name:"PBKDF2"},L6e={name:"HMAC"},R6e="SHA-1",Z6e=Object.assign({hash:L6e},phe),bhe=Object.assign({iterations:1e3,hash:{name:R6e}},phe),G6e=["deriveBits"],RP=[8,12,16],LP=[16,24,32],vy=10,yhe=[0,0,0,0],kN=typeof crypto<"u",ghe=kN&&typeof crypto.subtle<"u",gf=VP.bytes,xhe=fz.aes,_he=pz.ctrGladman,The=G1.hmacSha1,NN=class{constructor(t,n,i){Object.assign(this,{password:t,signed:n,strength:i-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this;if(n.password){let o=Td(t,0,RP[n.strength]+2);await E6e(n,o,n.password),n.password=null,n.aesCtrGladman=new _he(new xhe(n.keys.key),Array.from(yhe)),n.hmac=new The(n.keys.authentication),t=Td(t,RP[n.strength]+2)}let i=new Uint8Array(t.length-vy-(t.length-vy)%E1);return She(n,t,i,0,vy,!0)}flush(){let t=this,n=t.pendingInput,i=Td(n,0,n.length-vy),o=Td(n,n.length-vy),r=new Uint8Array(0);if(i.length){let a=gf.toBits(i);t.hmac.update(a);let c=t.aesCtrGladman.update(a);r=gf.fromBits(c)}let s=!0;if(t.signed){let a=Td(gf.fromBits(t.hmac.digest()),0,vy);for(let c=0;c<vy;c++)a[c]!=o[c]&&(s=!1)}return{valid:s,data:r}}},UN=class{constructor(t,n){Object.assign(this,{password:t,strength:n-1,pendingInput:new Uint8Array(0)})}async append(t){let n=this,i=new Uint8Array(0);n.password&&(i=await X6e(n,n.password),n.password=null,n.aesCtrGladman=new _he(new xhe(n.keys.key),Array.from(yhe)),n.hmac=new The(n.keys.authentication));let o=new Uint8Array(i.length+t.length-t.length%E1);return o.set(i,0),She(n,t,o,i.length,0)}flush(){let t=this,n=new Uint8Array(0);if(t.pendingInput.length){let o=t.aesCtrGladman.update(gf.toBits(t.pendingInput));t.hmac.update(o),n=gf.fromBits(o)}let i=Td(gf.fromBits(t.hmac.digest()),0,vy);return{data:bz(n,i),signature:i}}};function She(e,t,n,i,o,r){let s=t.length-o;e.pendingInput.length&&(t=bz(e.pendingInput,t),n=v6e(n,s-s%E1));let a;for(a=0;a<=s-E1;a+=E1){let c=gf.toBits(Td(t,a,a+E1));r&&e.hmac.update(c);let l=e.aesCtrGladman.update(c);r||e.hmac.update(l),n.set(gf.fromBits(l),a+i)}return e.pendingInput=Td(t,a),n}async function E6e(e,t,n){await Che(e,n,Td(t,0,RP[e.strength]));let i=Td(t,RP[e.strength]),o=e.keys.passwordVerification;if(o[0]!=i[0]||o[1]!=i[1])throw new Error(X1)}async function X6e(e,t){let n=I6e(new Uint8Array(RP[e.strength]));return await Che(e,t,n),bz(n,e.keys.passwordVerification)}async function Che(e,t,n){let i=CP(t),o=await W6e(V6e,i,Z6e,!1,G6e),r=await P6e(Object.assign({salt:n},bhe),o,8*(LP[e.strength]*2+2)),s=new Uint8Array(r);e.keys={key:gf.toBits(Td(s,0,LP[e.strength])),authentication:gf.toBits(Td(s,LP[e.strength],LP[e.strength]*2)),passwordVerification:Td(s,LP[e.strength]*2)}}function I6e(e){return kN&&typeof crypto.getRandomValues=="function"?crypto.getRandomValues(e):fhe.getRandomValues(e)}function W6e(e,t,n,i,o){return kN&&ghe&&typeof crypto.subtle.importKey=="function"?crypto.subtle.importKey(e,t,n,i,o):G1.importKey(t)}async function P6e(e,t,n){return kN&&ghe&&typeof crypto.subtle.deriveBits=="function"?await crypto.subtle.deriveBits(e,t,n):G1.pbkdf2(t,e.salt,bhe.iterations,n)}function bz(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function v6e(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Td(e,t,n){return e.subarray(t,n)}var $ri=T(S(),1);var I1=12,DN=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Zhe(i,t)}append(t){let n=this;if(n.password){let i=Vhe(n,t.subarray(0,I1));if(n.password=null,i[I1-1]!=n.passwordVerification)throw new Error(X1);t=t.subarray(I1)}return Vhe(n,t)}flush(){return{valid:!0,data:new Uint8Array(0)}}},BN=class{constructor(t,n){let i=this;Object.assign(i,{password:t,passwordVerification:n}),Zhe(i,t)}append(t){let n=this,i,o;if(n.password){n.password=null;let r=crypto.getRandomValues(new Uint8Array(I1));r[I1-1]=n.passwordVerification,i=new Uint8Array(t.length+r.length),i.set(Lhe(n,r),0),o=I1}else i=new Uint8Array(t.length),o=0;return i.set(Lhe(n,t),o),i}flush(){return{data:new Uint8Array(0)}}};function Vhe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Ghe(e)^t[i],yz(e,n[i]);return n}function Lhe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Ghe(e)^t[i],yz(e,t[i]);return n}function Zhe(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new Py(e.keys[0]),e.crcKey2=new Py(e.keys[2]);for(let n=0;n<t.length;n++)yz(e,t.charCodeAt(n))}function yz(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=Rhe(e.keys[1]+Ehe(e.keys[0])),e.keys[1]=Rhe(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function Ghe(e){let t=e.keys[2]|2;return Ehe(Math.imul(t,t^1)>>>8)}function Ehe(e){return e&255}function Rhe(e){return e&4294967295}var ON="deflate",KN="inflate",YN="Invalid signature",gz=class{constructor(t,{signature:n,password:i,signed:o,compressed:r,zipCrypto:s,passwordVerification:a,encryptionStrength:c},{chunkSize:l}){let u=!!i;Object.assign(this,{signature:n,encrypted:u,signed:o,compressed:r,inflate:r&&new t({chunkSize:l}),crc32:o&&new Py,zipCrypto:s,decrypt:u&&s?new DN(i,a):new NN(i,o,c)})}async append(t){let n=this;return n.encrypted&&t.length&&(t=await n.decrypt.append(t)),n.compressed&&t.length&&(t=await n.inflate.append(t)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),t}async flush(){let t=this,n,i=new Uint8Array(0);if(t.encrypted){let o=t.decrypt.flush();if(!o.valid)throw new Error(YN);i=o.data}if((!t.encrypted||t.zipCrypto)&&t.signed){let o=new DataView(new Uint8Array(4).buffer);if(n=t.crc32.get(),o.setUint32(0,n),t.signature!=o.getUint32(0,!1))throw new Error(YN)}return t.compressed&&(i=await t.inflate.append(i)||new Uint8Array(0),await t.inflate.flush()),{data:i,signature:n}}},xz=class{constructor(t,{encrypted:n,signed:i,compressed:o,level:r,zipCrypto:s,password:a,passwordVerification:c,encryptionStrength:l},{chunkSize:u}){Object.assign(this,{encrypted:n,signed:i,compressed:o,deflate:o&&new t({level:r||5,chunkSize:u}),crc32:i&&new Py,zipCrypto:s,encrypt:n&&s?new BN(a,c):new UN(a,l)})}async append(t){let n=this,i=t;return n.compressed&&t.length&&(i=await n.deflate.append(t)),n.encrypted&&i.length&&(i=await n.encrypt.append(i)),(!n.encrypted||n.zipCrypto)&&n.signed&&t.length&&n.crc32.append(t),i}async flush(){let t=this,n,i=new Uint8Array(0);if(t.compressed&&(i=await t.deflate.flush()||new Uint8Array(0)),t.encrypted){i=await t.encrypt.append(i);let o=t.encrypt.flush();n=o.signature;let r=new Uint8Array(i.length+o.data.length);r.set(i,0),r.set(o.data,i.length),i=r}return(!t.encrypted||t.zipCrypto)&&t.signed&&(n=t.crc32.get()),{data:i,signature:n}}};function Xhe(e,t,n){if(t.codecType.startsWith(ON))return new xz(e,t,n);if(t.codecType.startsWith(KN))return new gz(e,t,n)}var asi=T(S(),1);var Ihe="init",Whe="append",_z="flush",w6e="message",Phe=!0,HN=(e,t,n,i,o,r,s)=>(Object.assign(e,{busy:!0,codecConstructor:t,options:Object.assign({},n),scripts:s,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,o(e)}}),r?A6e(e,i):F6e(e,i));function F6e(e,t){let n=Xhe(e.codecConstructor,e.options,t);return{async append(i){try{return await n.append(i)}catch(o){throw e.onTaskFinished(),o}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}}function A6e(e,t){let n,i={type:"module"};if(!e.interface){if(!Phe)e.worker=o(i,t.baseURL);else try{e.worker=o({},t.baseURL)}catch{Phe=!1,e.worker=o(i,t.baseURL)}e.worker.addEventListener(w6e,a,!1),e.interface={append(c){return r({type:Whe,data:c})},flush(){return r({type:_z})},abort(){e.onTaskFinished()}}}return e.interface;function o(c,l){let u,m;u=e.scripts[0],typeof u=="function"&&(u=u());try{m=new URL(u,l)}catch{m=u}return new Worker(m,c)}async function r(c){if(!n){let l=e.options,u=e.scripts.slice(1);await s({scripts:u,type:Ihe,options:l,config:{chunkSize:t.chunkSize}})}return s(c)}function s(c){let l=e.worker,u=new Promise((m,p)=>n={resolve:m,reject:p});try{if(c.data)try{c.data=c.data.buffer,l.postMessage(c,[c.data])}catch{l.postMessage(c)}else l.postMessage(c)}catch(m){n.reject(m),n=null,e.onTaskFinished()}return u}function a(c){let l=c.data;if(n){let u=l.error,m=l.type;if(u){let p=new Error(u.message);p.stack=u.stack,n.reject(p),n=null,e.onTaskFinished()}else if(m==Ihe||m==_z||m==Whe){let p=l.data;m==_z?(n.resolve({data:new Uint8Array(p),signature:l.signature}),n=null,e.onTaskFinished()):n.resolve(p&&new Uint8Array(p))}}}}var M_=[],Tz=[];function zN(e,t,n){let o=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||t.useWebWorkers===void 0&&n.useWebWorkers),r=o&&n.workerScripts?n.workerScripts[t.codecType]:[];if(M_.length<n.maxWorkers){let a={};return M_.push(a),HN(a,e,t,n,s,o,r)}else{let a=M_.find(c=>!c.busy);return a?(vhe(a),HN(a,e,t,n,s,o,r)):new Promise(c=>Tz.push({resolve:c,codecConstructor:e,options:t,webWorker:o,scripts:r}))}function s(a){if(Tz.length){let[{resolve:c,codecConstructor:l,options:u,webWorker:m,scripts:p}]=Tz.splice(0,1);c(HN(a,l,u,n,s,m,p))}else a.worker?(vhe(a),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(a.terminateTimeout=setTimeout(()=>{M_=M_.filter(c=>c!=a),a.terminate()},n.terminateWorkerTimeout))):M_=M_.filter(c=>c!=a)}}function vhe(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}var hsi=T(S(),1);var Fhe="Abort error";async function JN(e,t,n,i,o,r,s){let a=Math.max(r.chunkSize,64);return c();async function c(l=0,u=0){let m=s.signal,p=o();if(l<p){Sz(m,e);let y=await t.readUint8Array(l+i,Math.min(a,p-l)),f=y.length;Sz(m,e);let x=await e.append(y);if(Sz(m,e),u+=await whe(n,x),s.onprogress)try{s.onprogress(l+f,p)}catch{}return c(l+a,u)}else{let y=await e.flush();return u+=await whe(n,y.data),{signature:y.signature,length:u}}}}function Sz(e,t){if(e&&e.aborted)throw t.abort(),new Error(Fhe)}async function whe(e,t){return t.length&&await e.writeUint8Array(t),t.length}var psi=T(S(),1);var Cz="text/plain";var QN=class{constructor(){this.size=0}init(){this.initialized=!0}},jN=class extends QN{},ZP=class extends QN{writeUint8Array(t){this.size+=t.length}},qN=class extends jN{constructor(t){super(),this.blobReader=new N_(new Blob([t],{type:Cz}))}init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}readUint8Array(t,n){return this.blobReader.readUint8Array(t,n)}},$N=class extends ZP{constructor(t){super(),this.encoding=t,this.blob=new Blob([],{type:Cz})}writeUint8Array(t){super.writeUint8Array(t),this.blob=new Blob([this.blob,t.buffer],{type:Cz})}getData(){if(this.blob.text)return this.blob.text();{let t=new FileReader;return new Promise((n,i)=>{t.onload=o=>n(o.target.result),t.onerror=()=>i(t.error),t.readAsText(this.blob,this.encoding)})}}};var eU=class extends ZP{constructor(t){super(),this.data="data:"+(t||"")+";base64,",this.pending=[]}writeUint8Array(t){super.writeUint8Array(t);let n=0,i=this.pending,o=this.pending.length;for(this.pending="",n=0;n<Math.floor((o+t.length)/3)*3-o;n++)i+=String.fromCharCode(t[n]);for(;n<t.length;n++)this.pending+=String.fromCharCode(t[n]);i.length>2?this.data+=btoa(i):this.pending=i}getData(){return this.data+btoa(this.pending)}},N_=class extends jN{constructor(t){super(),this.blob=t,this.size=t.size}async readUint8Array(t,n){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(t,t+n).arrayBuffer());{let i=new FileReader;return new Promise((o,r)=>{i.onload=s=>o(new Uint8Array(s.target.result)),i.onerror=()=>r(i.error),i.readAsArrayBuffer(this.blob.slice(t,t+n))})}}},W1=class extends ZP{constructor(t){super(),this.contentType=t,this.arrayBuffersMaxlength=8,Ahe(this)}writeUint8Array(t){super.writeUint8Array(t),this.arrayBuffers.length==this.arrayBuffersMaxlength&&Mhe(this),this.arrayBuffers.push(t.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&Mhe(this),this.blob=this.pendingBlob,Ahe(this)),this.blob}};function Ahe(e){e.pendingBlob=new Blob([],{type:e.contentType}),e.arrayBuffers=[]}function Mhe(e){e.pendingBlob=new Blob([e.pendingBlob,...e.arrayBuffers],{type:e.contentType}),e.arrayBuffers=[]}var Psi=T(S(),1);var ysi=T(S(),1);var P1="/",Vz=new Date(2107,11,31),Lz=new Date(1980,0,1);var Ssi=T(S(),1);var xsi=T(S(),1),M6e="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Nhe=e=>{let t="";for(let n=0;n<e.length;n++)t+=M6e[e[n]];return t};var tU=N6e;function N6e(e,t){if(t&&t.trim().toLowerCase()=="cp437")return Nhe(e);if(typeof TextDecoder>"u"){let n=new FileReader;return new Promise((i,o)=>{n.onload=r=>i(r.target.result),n.onerror=()=>o(n.error),n.readAsText(new Blob([e]))})}else return new TextDecoder(t).decode(e)}var Vsi=T(S(),1),U6e=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],R0=class{constructor(t){U6e.forEach(n=>this[n]=t[n])}};var Gz="File format is not recognized",Y6e="End of central directory not found",O6e="End of Zip64 central directory not found",K6e="End of Zip64 central directory locator not found",H6e="Central directory header not found",z6e="Local file header not found",J6e="Zip64 extra field not found",Q6e="File contains encrypted entry",j6e="Encryption method not supported",Uhe="Compression method not supported",khe="utf-8",Dhe="cp437",Bhe=["uncompressedSize","compressedSize","offset"],dU=class{constructor(t,n={}){Object.assign(this,{reader:t,options:n,config:MN()})}async*getEntriesGenerator(t={}){let n=this,i=n.reader;if(i.initialized||await i.init(),i.size<22)throw new Error(Gz);let o=await nqe(i,101010256,i.size,22,65535*16);if(!o)throw new Error(Y6e);let r=oc(o),s=$s(r,12),a=$s(r,16),c=Sd(r,8),l=0;if(a==4294967295||s==4294967295||c==65535){let y=await wy(i,o.offset-20,20),f=oc(y);if($s(f,0)!=117853008)throw new Error(O6e);a=nU(f,8);let x=await wy(i,a,56),_=oc(x),C=o.offset-20-56;if($s(_,0)!=101075792&&a!=C){let V=a;a=C,l=a-V,x=await wy(i,a,56),_=oc(x)}if($s(_,0)!=101075792)throw new Error(K6e);c=nU(_,32),s=nU(_,40),a-=s}if(a<0||a>=i.size)throw new Error(Gz);let u=0,m=await wy(i,a,s),p=oc(m);if(s){let y=o.offset-s;if($s(p,u)!=33639248&&a!=y){let f=a;a=y,l=a-f,m=await wy(i,a,s),p=oc(m)}}if(a<0||a>=i.size)throw new Error(Gz);for(let y=0;y<c;y++){let f=new Xz(i,n.config,n.options);if($s(p,u)!=33639248)throw new Error(H6e);Ohe(f,p,u+6);let x=!!f.bitFlag.languageEncodingFlag,_=u+46,C=_+f.filenameLength,V=C+f.extraFieldLength,L=Sd(p,u+4),Z=(L&0)==0;Object.assign(f,{versionMadeBy:L,msDosCompatible:Z,compressedSize:0,uncompressedSize:0,commentLength:Sd(p,u+32),directory:Z&&(w1(p,u+38)&16)==16,offset:$s(p,u+42)+l,internalFileAttribute:$s(p,u+34),externalFileAttribute:$s(p,u+38),rawFilename:m.subarray(_,C),filenameUTF8:x,commentUTF8:x,rawExtraField:m.subarray(C,V)});let G=V+f.commentLength;f.rawComment=m.subarray(V,G);let X=v1(n,t,"filenameEncoding"),P=v1(n,t,"commentEncoding"),[v,A]=await Promise.all([tU(f.rawFilename,f.filenameUTF8?khe:X||Dhe),tU(f.rawComment,f.commentUTF8?khe:P||Dhe)]);f.filename=v,f.comment=A,!f.directory&&f.filename.endsWith(P1)&&(f.directory=!0),await Khe(f,f,p,u+6);let M=new R0(f);if(M.getData=(b,R)=>f.getData(b,M,R),u=G,t.onprogress)try{t.onprogress(y+1,c,new R0(f))}catch{}yield M}return!0}async getEntries(t={}){let n=[],i=this.getEntriesGenerator(t),o=i.next();for(;!(await o).done;)n.push((await o).value),o=i.next();return n}async close(){}};var Xz=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,extraFieldAES:a,compressionMethod:c,config:l,bitFlag:u,signature:m,rawLastModDate:p,compressedSize:y}=o,f=o.localDirectory={};r.initialized||await r.init();let x=await wy(r,s,30),_=oc(x),C=v1(o,i,"password");if(C=C&&C.length&&C,a&&a.originalCompressionMethod!=99)throw new Error(Uhe);if(c!=0&&c!=8)throw new Error(Uhe);if($s(_,0)!=67324752)throw new Error(z6e);Ohe(f,_,4),x=await wy(r,s,30+f.filenameLength+f.extraFieldLength),f.rawExtraField=x.subarray(30+f.filenameLength),await Khe(o,f,_,4),n.lastAccessDate=f.lastAccessDate,n.creationDate=f.creationDate;let V=o.encrypted&&f.encrypted,L=V&&!a;if(V){if(!L&&a.strength===void 0)throw new Error(j6e);if(!C)throw new Error(Q6e)}let Z=await zN(l.Inflate,{codecType:KN,password:C,zipCrypto:L,encryptionStrength:a&&a.strength,signed:v1(o,i,"checkSignature"),passwordVerification:L&&(u.dataDescriptor?p>>>8&255:m>>>24&255),signature:m,compressed:c!=0,encrypted:V,useWebWorkers:v1(o,i,"useWebWorkers")},l);t.initialized||await t.init();let G=v1(o,i,"signal"),X=s+30+f.filenameLength+f.extraFieldLength;return await JN(Z,r,t,X,()=>y,l,{onprogress:i.onprogress,signal:G}),t.getData()}};function Ohe(e,t,n){let i=e.rawBitFlag=Sd(t,n+2),o=(i&1)==1,r=$s(t,n+6);Object.assign(e,{encrypted:o,version:Sd(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:iqe(r),filenameLength:Sd(t,n+22),extraFieldLength:Sd(t,n+24)})}async function Khe(e,t,n,i){let o=t.rawExtraField,r=t.extraField=new Map,s=oc(new Uint8Array(o)),a=0;try{for(;a<o.length;){let x=Sd(s,a),_=Sd(s,a+2);r.set(x,{type:x,data:o.slice(a+4,a+4+_)}),a+=4+_}}catch{}let c=Sd(n,i+4);t.signature=$s(n,i+10),t.uncompressedSize=$s(n,i+18),t.compressedSize=$s(n,i+14);let l=r.get(1);l&&(q6e(l,t),t.extraFieldZip64=l);let u=r.get(28789);u&&(await Yhe(u,"filename","rawFilename",t,e),t.extraFieldUnicodePath=u);let m=r.get(25461);m&&(await Yhe(m,"comment","rawComment",t,e),t.extraFieldUnicodeComment=m);let p=r.get(39169);p?($6e(p,t,c),t.extraFieldAES=p):t.compressionMethod=c;let y=r.get(10);y&&(eqe(y,t),t.extraFieldNTFS=y);let f=r.get(21589);f&&(tqe(f,t),t.extraFieldExtendedTimestamp=f)}function q6e(e,t){t.zip64=!0;let n=oc(e.data);e.values=[];for(let o=0;o<Math.floor(e.data.length/8);o++)e.values.push(nU(n,0+o*8));let i=Bhe.filter(o=>t[o]==4294967295);for(let o=0;o<i.length;o++)e[i[o]]=e.values[o];Bhe.forEach(o=>{if(t[o]==4294967295)if(e[o]!==void 0)t[o]=e[o];else throw new Error(J6e)})}async function Yhe(e,t,n,i,o){let r=oc(e.data);e.version=w1(r,0),e.signature=$s(r,1);let s=new Py;s.append(o[n]);let a=oc(new Uint8Array(4));a.setUint32(0,s.get(),!0),e[t]=await tU(e.data.subarray(5)),e.valid=!o.bitFlag.languageEncodingFlag&&e.signature==$s(a,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function $6e(e,t,n){let i=oc(e.data);e.vendorVersion=w1(i,0),e.vendorId=w1(i,2);let o=w1(i,4);e.strength=o,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=Sd(i,5)}function eqe(e,t){let n=oc(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=Sd(n,i),s=Sd(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=oc(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let l=Ez(s),u=Ez(a),m=Ez(c),p={lastModDate:l,lastAccessDate:u,creationDate:m};Object.assign(e,p),Object.assign(t,p)}}catch{}}function tqe(e,t){let n=oc(e.data),i=w1(n,0),o=[],r=[];(i&1)==1&&(o.push("lastModDate"),r.push("rawLastModDate")),(i&2)==2&&(o.push("lastAccessDate"),r.push("rawLastAccessDate")),(i&4)==4&&(o.push("creationDate"),r.push("rawCreationDate"));let s=1;o.forEach((a,c)=>{if(e.data.length>=s+4){let l=$s(n,s);t[a]=e[a]=new Date(l*1e3);let u=r[c];e[u]=l}s+=4})}async function nqe(e,t,n,i,o){let r=new Uint8Array(4),s=oc(r);oqe(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(l){let u=n-l,m=await wy(e,u,l);for(let p=m.length-i;p>=0;p--)if(m[p]==r[0]&&m[p+1]==r[1]&&m[p+2]==r[2]&&m[p+3]==r[3])return{offset:u+p,buffer:m.slice(p,p+i).buffer}}}function v1(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function iqe(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function Ez(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function w1(e,t){return e.getUint8(t)}function Sd(e,t){return e.getUint16(t,!0)}function $s(e,t){return e.getUint32(t,!0)}function nU(e,t){return Number(e.getBigUint64(t,!0))}function oqe(e,t,n){e.setUint32(t,n,!0)}function oc(e){return new DataView(e.buffer)}function wy(e,t,n){return e.readUint8Array(t,n)}var Dsi=T(S(),1);var lqe="File already exists",dqe="Zip file comment exceeds 64KB",uqe="File entry comment exceeds 64KB",mqe="File entry name exceeds 64KB",Jhe="Version exceeds 65535",hqe="The strength must equal 1, 2, or 3",fqe="Extra field type exceeds 65535",pqe="Extra field data exceeds 64KB",Dz="Zip64 is not supported",Qhe=new Uint8Array([7,0,2,0,65,69,3,0,0]),jhe=24,Uz=0,hU=class{constructor(t,n={}){Object.assign(this,{writer:t,options:n,config:MN(),files:new Map,offset:t.size,pendingCompressedSize:0,pendingEntries:[],pendingAddFileCalls:new Set})}async add(t="",n,i={}){let o=this;if(Uz<o.config.maxWorkers){Uz++;let r;try{return r=bqe(o,t,n,i),this.pendingAddFileCalls.add(r),await r}finally{this.pendingAddFileCalls.delete(r),Uz--;let s=o.pendingEntries.shift();s&&o.add(s.name,s.reader,s.options).then(s.resolve).catch(s.reject)}}else return new Promise((r,s)=>o.pendingEntries.push({name:t,reader:n,options:i,resolve:r,reject:s}))}async close(t=new Uint8Array(0),n={}){for(;this.pendingAddFileCalls.size;)await Promise.all(Array.from(this.pendingAddFileCalls));return await xqe(this,t,n),this.writer.getData()}};async function bqe(e,t,n,i){if(t=t.trim(),i.directory&&!t.endsWith(P1)?t+=P1:i.directory=t.endsWith(P1),e.files.has(t))throw new Error(lqe);let o=CP(t);if(o.length>65535)throw new Error(mqe);let r=i.comment||"",s=CP(r);if(s.length>65535)throw new Error(uqe);let a=e.options.version||i.version||0;if(a>65535)throw new Error(Jhe);let c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(Jhe);let l=Ta(e,i,"lastModDate")||new Date,u=Ta(e,i,"lastAccessDate"),m=Ta(e,i,"creationDate"),p=Ta(e,i,"password"),y=Ta(e,i,"encryptionStrength")||3,f=Ta(e,i,"zipCrypto");if(p!==void 0&&y!==void 0&&(y<1||y>3))throw new Error(hqe);let x=new Uint8Array(0),_=i.extraField;if(_){let N=0,Y=0;_.forEach(k=>N+=4+k.length),x=new Uint8Array(N),_.forEach((k,O)=>{if(O>65535)throw new Error(fqe);if(k.length>65535)throw new Error(pqe);ta(x,new Uint16Array([O]),Y),ta(x,new Uint16Array([k.length]),Y+2),ta(x,k,Y+4),Y+=4+k.length})}let C=Ta(e,i,"extendedTimestamp");C===void 0&&(C=!0);let V=0,L=Ta(e,i,"keepOrder");L===void 0&&(L=!0);let Z=0,G=Ta(e,i,"msDosCompatible");G===void 0&&(G=!0);let X=Ta(e,i,"internalFileAttribute")||0,P=Ta(e,i,"externalFileAttribute")||0;n&&(n.initialized||await n.init(),Z=n.size,V=Tqe(Z));let v=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingCompressedSize>=4294967295||Z>=4294967295||V>=4294967295){if(i.zip64===!1||e.options.zip64===!1||!L)throw new Error(Dz);v=!0}e.pendingCompressedSize+=V,await Promise.resolve();let A=Ta(e,i,"level"),M=Ta(e,i,"useWebWorkers"),b=Ta(e,i,"bufferedWrite"),R=Ta(e,i,"dataDescriptor"),E=Ta(e,i,"dataDescriptorSignature"),I=Ta(e,i,"signal");R===void 0&&(R=!0),R&&E===void 0&&(E=!1);let w=await yqe(e,t,n,Object.assign({},i,{rawFilename:o,rawComment:s,version:a,versionMadeBy:c,lastModDate:l,lastAccessDate:u,creationDate:m,rawExtraField:x,zip64:v,password:p,level:A,useWebWorkers:M,encryptionStrength:y,extendedTimestamp:C,zipCrypto:f,bufferedWrite:b,keepOrder:L,dataDescriptor:R,dataDescriptorSignature:E,signal:I,msDosCompatible:G,internalFileAttribute:X,externalFileAttribute:P}));return V&&(e.pendingCompressedSize-=V),Object.assign(w,{name:t,comment:r,extraField:_}),new R0(w)}async function yqe(e,t,n,i){let o=e.files,r=e.writer,s=Array.from(o.values()).pop(),a={},c,l,u;o.set(t,a);try{let m,p,y;if(i.keepOrder&&(m=s&&s.lock),a.lock=y=new Promise(f=>u=f),i.bufferedWrite||e.lockWrite||!i.dataDescriptor?(p=new W1,p.init(),c=!0):(e.lockWrite=new Promise(f=>l=f),r.initialized||await r.init(),p=r),a=await gqe(n,p,e.config,i),a.lock=y,o.set(t,a),a.filename=t,c){let f=0,x=p.getData();await Promise.all([e.lockWrite,m]);let _;do _=Array.from(o.values()).find(C=>C.writingBufferedData),_&&await _.lock;while(_&&_.lock);if(a.writingBufferedData=!0,!i.dataDescriptor){let V=await qhe(x,0,26),L=new DataView(V);(!a.encrypted||i.zipCrypto)&&ho(L,14,a.signature),a.zip64?(ho(L,18,4294967295),ho(L,22,4294967295)):(ho(L,18,a.compressedSize),ho(L,22,a.uncompressedSize)),await r.writeUint8Array(new Uint8Array(V)),f=26}await _qe(r,x,f),delete a.writingBufferedData}if(a.offset=e.offset,a.zip64){let f=th(a.rawExtraFieldZip64);Il(f,20,BigInt(a.offset))}else if(a.offset>=4294967295)throw new Error(Dz);return e.offset+=a.length,a}catch(m){throw(c&&a.writingBufferedData||!c&&a.dataWritten)&&(m.corruptedEntry=e.hasCorruptedEntries=!0,a.uncompressedSize&&(e.offset+=a.uncompressedSize)),o.delete(t),m}finally{u(),l&&l()}}async function gqe(e,t,n,i){let{rawFilename:o,lastAccessDate:r,creationDate:s,password:a,level:c,zip64:l,zipCrypto:u,dataDescriptor:m,dataDescriptorSignature:p,directory:y,version:f,versionMadeBy:x,rawComment:_,rawExtraField:C,useWebWorkers:V,onprogress:L,signal:Z,encryptionStrength:G,extendedTimestamp:X,msDosCompatible:P,internalFileAttribute:v,externalFileAttribute:A}=i,M=!!(a&&a.length),b=c!==0&&!y,R;if(M&&!u){R=new Uint8Array(Qhe.length+2);let Me=th(R);Jo(Me,0,39169),ta(R,Qhe,2),fU(Me,8,G)}else R=new Uint8Array(0);let E,I;if(X){I=new Uint8Array(9+(r?4:0)+(s?4:0));let Me=th(I);Jo(Me,0,21589),Jo(Me,2,I.length-4);let ve=1+(r?2:0)+(s?4:0);fU(Me,4,ve),ho(Me,5,Math.floor(i.lastModDate.getTime()/1e3)),r&&ho(Me,9,Math.floor(r.getTime()/1e3)),s&&ho(Me,13,Math.floor(s.getTime()/1e3));try{E=new Uint8Array(36);let ke=th(E),ct=kz(i.lastModDate);Jo(ke,0,10),Jo(ke,2,32),Jo(ke,8,1),Jo(ke,10,24),Il(ke,12,ct),Il(ke,20,kz(r)||ct),Il(ke,28,kz(s)||ct)}catch{E=new Uint8Array(0)}}else E=I=new Uint8Array(0);let w={version:f||20,versionMadeBy:x,zip64:l,directory:!!y,filenameUTF8:!0,rawFilename:o,commentUTF8:!0,rawComment:_,rawExtraFieldZip64:l?new Uint8Array(jhe+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:E,rawExtraFieldAES:R,rawExtraField:C,extendedTimestamp:X,msDosCompatible:P,internalFileAttribute:v,externalFileAttribute:A},N=w.uncompressedSize=0,Y=2048;m&&(Y=Y|8);let k=0;b&&(k=8),l&&(w.version=w.version>45?w.version:45),M&&(Y=Y|1,u||(w.version=w.version>51?w.version:51,k=99,b&&(w.rawExtraFieldAES[9]=8))),w.compressionMethod=k;let O=w.headerArray=new Uint8Array(26),U=th(O);Jo(U,0,w.version),Jo(U,2,Y),Jo(U,4,k);let J=new Uint32Array(1),z=th(J),ee;i.lastModDate<Lz?ee=Lz:i.lastModDate>Vz?ee=Vz:ee=i.lastModDate,Jo(z,0,(ee.getHours()<<6|ee.getMinutes())<<5|ee.getSeconds()/2),Jo(z,2,(ee.getFullYear()-1980<<4|ee.getMonth()+1)<<5|ee.getDate());let K=J[0];ho(U,6,K),Jo(U,22,o.length);let j=R.length+I.length+E.length+w.rawExtraField.length;Jo(U,24,j);let q=new Uint8Array(30+o.length+j),be=th(q);ho(be,0,67324752),ta(q,O,4),ta(q,o,30),ta(q,R,30+o.length),ta(q,I,30+o.length+R.length),ta(q,E,30+o.length+R.length+I.length),ta(q,w.rawExtraField,30+o.length+R.length+I.length+E.length);let Te,ae=0;if(e){let Me=await zN(n.Deflate,{codecType:ON,level:c,password:a,encryptionStrength:G,zipCrypto:M&&u,passwordVerification:M&&u&&K>>8&255,signed:!0,compressed:b,encrypted:M,useWebWorkers:V},n);await t.writeUint8Array(q),w.dataWritten=!0,Te=await JN(Me,e,t,0,()=>e.size,n,{onprogress:L,signal:Z}),N=w.uncompressedSize=e.size,ae=Te.length}else await t.writeUint8Array(q),w.dataWritten=!0;let xe=new Uint8Array(0),_e,Ve=0;if(m&&(xe=new Uint8Array(l?p?24:20:p?16:12),_e=th(xe),p&&(Ve=4,ho(_e,0,134695760))),e){let Me=Te.signature;if((!M||u)&&Me!==void 0&&(ho(U,10,Me),w.signature=Me,m&&ho(_e,Ve,Me)),l){let ve=th(w.rawExtraFieldZip64);Jo(ve,0,1),Jo(ve,2,jhe),ho(U,14,4294967295),Il(ve,12,BigInt(ae)),ho(U,18,4294967295),Il(ve,4,BigInt(N)),m&&(Il(_e,Ve+4,BigInt(ae)),Il(_e,Ve+12,BigInt(N)))}else ho(U,14,ae),ho(U,18,N),m&&(ho(_e,Ve+4,ae),ho(_e,Ve+8,N))}m&&await t.writeUint8Array(xe);let Ie=q.length+ae+xe.length;return Object.assign(w,{compressedSize:ae,lastModDate:ee,rawLastModDate:K,creationDate:s,lastAccessDate:r,encrypted:M,length:Ie}),w}async function xqe(e,t,n){let i=e.writer,o=e.files,r=0,s=0,a=e.offset,c=o.size;for(let[,p]of o)s+=46+p.rawFilename.length+p.rawComment.length+p.rawExtraFieldZip64.length+p.rawExtraFieldAES.length+p.rawExtraFieldExtendedTimestamp.length+p.rawExtraFieldNTFS.length+p.rawExtraField.length;let l=n.zip64||e.options.zip64||!1;if(a>=4294967295||s>=4294967295||c>=65535){if(n.zip64===!1||e.options.zip64===!1)throw new Error(Dz);l=!0}let u=new Uint8Array(s+(l?98:22)),m=th(u);if(t&&t.length)if(t.length<=65535)Jo(m,r+20,t.length);else throw new Error(dqe);for(let[p,y]of Array.from(o.values()).entries()){let{rawFilename:f,rawExtraFieldZip64:x,rawExtraFieldAES:_,rawExtraField:C,rawComment:V,versionMadeBy:L,headerArray:Z,directory:G,zip64:X,msDosCompatible:P,internalFileAttribute:v,externalFileAttribute:A}=y,M,b;if(y.extendedTimestamp){b=y.rawExtraFieldNTFS,M=new Uint8Array(9);let E=th(M);Jo(E,0,21589),Jo(E,2,M.length-4),fU(E,4,1),ho(E,5,Math.floor(y.lastModDate.getTime()/1e3))}else b=M=new Uint8Array(0);let R=x.length+_.length+M.length+b.length+C.length;if(ho(m,r,33639248),Jo(m,r+4,L),ta(u,Z,r+6),Jo(m,r+30,R),Jo(m,r+32,V.length),ho(m,r+34,v),A?ho(m,r+38,A):G&&P&&fU(m,r+38,16),X?ho(m,r+42,4294967295):ho(m,r+42,y.offset),ta(u,f,r+46),ta(u,x,r+46+f.length),ta(u,_,r+46+f.length+x.length),ta(u,M,r+46+f.length+x.length+_.length),ta(u,b,r+46+f.length+x.length+_.length+M.length),ta(u,C,r+46+f.length+x.length+_.length+M.length+b.length),ta(u,V,r+46+f.length+R),r+=46+f.length+R+V.length,n.onprogress)try{n.onprogress(p+1,o.size,new R0(y))}catch{}}l&&(ho(m,r,101075792),Il(m,r+4,BigInt(44)),Jo(m,r+12,45),Jo(m,r+14,45),Il(m,r+24,BigInt(c)),Il(m,r+32,BigInt(c)),Il(m,r+40,BigInt(s)),Il(m,r+48,BigInt(a)),ho(m,r+56,117853008),Il(m,r+64,BigInt(a)+BigInt(s)),ho(m,r+72,1),c=65535,a=4294967295,s=4294967295,r+=76),ho(m,r,101010256),Jo(m,r+8,c),Jo(m,r+10,c),ho(m,r+12,s),ho(m,r+16,a),await i.writeUint8Array(u),t&&t.length&&await i.writeUint8Array(t)}function qhe(e,t,n){if(e.arrayBuffer)return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer();{let i=new FileReader;return new Promise((o,r)=>{i.onload=s=>o(s.target.result),i.onerror=()=>r(i.error),i.readAsArrayBuffer(t||n?e.slice(t,n):e)})}}async function _qe(e,t,n=0){await o();async function o(){if(n<t.size){let r=await qhe(t,n,n+536870912);await e.writeUint8Array(new Uint8Array(r)),n+=536870912,await o()}}}function kz(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Ta(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function Tqe(e){return e+5*(Math.floor(e/16383)+1)}function fU(e,t,n){e.setUint8(t,n)}function Jo(e,t,n){e.setUint16(t,n,!0)}function ho(e,t,n){e.setUint32(t,n,!0)}function Il(e,t,n){e.setBigUint64(t,n,!0)}function ta(e,t,n){e.set(t,n)}function th(e){return new DataView(e.buffer)}Z1({Deflate:Yme,Inflate:mhe});var nai=T(S(),1);function Sqe(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var En=Sqe;var oai=T(S(),1);function Cqe(e,t){this.position=e,this.headingPitchRange=t}var GP=Cqe;var cai=T(S(),1);function pU(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ye,this.tourEnd=new ye,this.entryStart=new ye,this.entryEnd=new ye,this._activeEntries=[]}pU.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};pU.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;tfe.call(this,e,t,function(i){n.playlistIndex=0,i||efe(n._activeEntries),n.tourEnd.raiseEvent(i)})};pU.prototype.stop=function(){efe(this._activeEntries)};function efe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function tfe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Vqe.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else d(n)&&n(!1)}function Vqe(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,tfe.call(this,e,t,n)}}var EP=pU;var Lai=T(S(),1);var xai=T(S(),1);var bai=T(S(),1),Wi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return this.None(e)},Out:function(e){return this.None(e)},InOut:function(e){return this.None(e)}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Wi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Wi.Bounce.In(e*2)*.5:Wi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),XP=function(){return performance.now()},Lqe=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=XP()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&delete this._tweens[i[o]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),F1={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=F1.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=F1.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=F1.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=F1.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},nfe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Bz=new Lqe,ife=function(){function e(t,n){n===void 0&&(n=Bz),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Wi.Linear.None,this._interpolationFunction=F1.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=nfe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=XP()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),l=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(u){var m=i[s];if(m.length===0)continue;for(var p=[a],y=0,f=m.length;y<f;y+=1){var x=this._handleRelativeValue(a,m[y]);if(isNaN(x)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}u&&(i[s]=p)}if((l==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var C in _)n[s][C]=_[C];o[s]=c?[]:{};var m=i[s];if(!this._isDynamic){var V={};for(var C in m)V[C]=m[C];i[s]=m=V}this._setupProperties(_,n[s],m,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=XP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=XP()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t===void 0&&(t=Bz),this._group=t,this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Wi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=F1.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){if(t===void 0&&(t=XP()),n===void 0&&(n=!0),this._isPaused)return!0;var i,o,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;n&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),o=(t-this._startTime)/this._duration,o=this._duration===0||o>1?1:o;var s=this._easingFunction(o);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,o),o===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),l=Array.isArray(a),u=!c&&l;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e}();var lai=nfe.nextId,xf=Bz,dai=xf.getAll.bind(xf),uai=xf.removeAll.bind(xf),mai=xf.add.bind(xf),hai=xf.remove.bind(xf),fai=xf.update.bind(xf);var Rqe={LINEAR_NONE:Wi.Linear.None,QUADRATIC_IN:Wi.Quadratic.In,QUADRATIC_OUT:Wi.Quadratic.Out,QUADRATIC_IN_OUT:Wi.Quadratic.InOut,CUBIC_IN:Wi.Cubic.In,CUBIC_OUT:Wi.Cubic.Out,CUBIC_IN_OUT:Wi.Cubic.InOut,QUARTIC_IN:Wi.Quartic.In,QUARTIC_OUT:Wi.Quartic.Out,QUARTIC_IN_OUT:Wi.Quartic.InOut,QUINTIC_IN:Wi.Quintic.In,QUINTIC_OUT:Wi.Quintic.Out,QUINTIC_IN_OUT:Wi.Quintic.InOut,SINUSOIDAL_IN:Wi.Sinusoidal.In,SINUSOIDAL_OUT:Wi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Wi.Sinusoidal.InOut,EXPONENTIAL_IN:Wi.Exponential.In,EXPONENTIAL_OUT:Wi.Exponential.Out,EXPONENTIAL_IN_OUT:Wi.Exponential.InOut,CIRCULAR_IN:Wi.Circular.In,CIRCULAR_OUT:Wi.Circular.Out,CIRCULAR_IN_OUT:Wi.Circular.InOut,ELASTIC_IN:Wi.Elastic.In,ELASTIC_OUT:Wi.Elastic.Out,ELASTIC_IN_OUT:Wi.Elastic.InOut,BACK_IN:Wi.Back.In,BACK_OUT:Wi.Back.Out,BACK_IN_OUT:Wi.Back.InOut,BOUNCE_IN:Wi.Bounce.In,BOUNCE_OUT:Wi.Bounce.Out,BOUNCE_IN_OUT:Wi.Bounce.InOut},Wr=Object.freeze(Rqe);function bU(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}bU.prototype.play=function(e,t,n){if(this.activeCamera=t,d(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(d(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ce(this.view.position);t.flyToBoundingSphere(o,i)}};bU.prototype.stop=function(){d(this.activeCamera)&&this.activeCamera.cancelFlight(),d(this.activeCallback)&&this.activeCallback(!0)};bU.prototype.getCameraOptions=function(e){let t={duration:this.duration};return d(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Wr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),d(e)&&(t=xt(t,e)),t};var IP=bU;var Gai=T(S(),1);function Yz(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Yz.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Yz.prototype.stop=function(){clearTimeout(this.timeout),d(this.activeCallback)&&this.activeCallback(!0)};var WP=Yz;var hfe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=Vg(t),hfe[t]}},jz;typeof DOMParser<"u"&&(jz=new DOMParser);var Zqe=new VN({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Fy=32,ofe=2414016,rfe=1,sfe=16093e3,afe=.1,cfe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],lfe=["http://www.google.com/kml/ext/2.2"],Gqe=["http://www.w3.org/2005/Atom"],Pe={kml:cfe,gx:lfe,atom:Gqe,kmlgx:cfe.concat(lfe)},qz={Document:Cfe,Folder:Hqe,Placemark:zqe,NetworkLink:i$e,GroundOverlay:e$e,PhotoOverlay:Rfe,ScreenOverlay:$qe,Tour:Qqe};function _f(e){this._dataSource=e,this._deferred=il(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(_f.prototype,{dataSource:{get:function(){return this._dataSource}}});_f.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};_f.prototype.addPromise=function(e){this._promises.push(e)};_f.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};_f.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Ld._getTimestamp()),this._process(e)};_f.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Ld._getTimestamp(),e._process(!0)},0)};_f.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};_f.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};_f.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;d(i);){let o=qz[i.localName];if(d(o)&&(Pe.kml.indexOf(i.namespaceURI)!==-1||Pe.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Ld._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Eqe(e){let t=e.slice(0,Math.min(4,e.size)),n=il(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Xqe(e){let t=il(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function ffe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(d(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return d(n)&&(e=n+i),e}function pfe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function Iqe(e,t){return Promise.resolve(e.getData(new $N)).then(function(n){n=ffe(n),n=pfe(n),t.kml=jz.parseFromString(n,"application/xml")})}function Oz(e,t){let n=g(hfe.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new eU(n))).then(function(i){t[e.filename]=i})}function Cd(e,t,n,i){let o=i.keys,r=new PP.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],l=c.getAttribute(n);if(d(l)){let m=new PP.default(l).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let y=o[p];c.setAttribute(n,i[y]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",y)}}}}function Vd(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=$z(a,i);d(c)&&s.setAttribute(n,c.url)}}function bfe(e,t,n){let i=us(e,"id");i=d(i)&&i.length!==0?i:Yn(),d(n)&&(i=n+i);let o=t.getById(i);return d(o)&&(i=Yn(),d(n)&&(i=n+i)),o=t.add(new Oo({id:i})),d(o.kml)||(o.addProperty("kml"),o.kml=new a$e),o}function vP(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function _U(e,t){if(!d(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!d(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function yU(e,t){if(!d(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!d(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=_U(n[s],t);return o}function Ay(e,t){if(!d(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function us(e,t){if(!d(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Pi(e,t,n){if(!d(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function dfe(e,t,n){if(!d(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function nh(e,t,n){if(!d(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ei(e,t,n){let i=Pi(e,t,n);if(d(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Xn(e,t,n){let i=Pi(e,t,n);if(d(i))return i.textContent.trim()}function ih(e,t,n){let i=Pi(e,t,n);if(d(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function $z(e,t,n){if(!d(e))return;let i;if(d(n)){e=e.replace(/\\/g,"/");let o=n[e];if(d(o))i=new Ee({url:o});else{let r=new PP.default(t.getUrlComponent()),s=new PP.default(e);o=n[s.absoluteTo(r)],d(o)&&(i=new Ee({url:o}))}}return d(i)||(i=t.getDerivedResource({url:e})),i}var Wl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Jz(e,t){if(!d(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Wl.maximumRed=r,Wl.red=void 0):(Wl.maximumRed=void 0,Wl.red=0),o>0?(Wl.maximumGreen=o,Wl.green=void 0):(Wl.maximumGreen=void 0,Wl.green=0),i>0?(Wl.maximumBlue=i,Wl.blue=void 0):(Wl.maximumBlue=void 0,Wl.blue=0),Wl.alpha=n,B.fromRandom(Wl)):new B(r,o,i,n)}function U_(e,t,n){let i=Xn(e,t,n);if(d(i))return Jz(i,Xn(e,"colorMode",n)==="random")}function Wqe(e){let t=Pi(e,"TimeStamp",Pe.kmlgx),n=Xn(t,"when",Pe.kmlgx);if(!d(t)||!d(n)||n.length===0)return;let i=te.fromIso8601(n),o=new Zr;return o.addInterval(new Tn({start:i,stop:Ye.MAXIMUM_VALUE})),o}function Pqe(e){let t=Pi(e,"TimeSpan",Pe.kmlgx);if(!d(t))return;let n,i=Pi(t,"begin",Pe.kmlgx),o=d(i)?te.fromIso8601(i.textContent):void 0,r=Pi(t,"end",Pe.kmlgx),s=d(r)?te.fromIso8601(r.textContent):void 0;if(d(o)&&d(s)){if(te.lessThan(s,o)){let a=o;o=s,s=a}n=new Zr,n.addInterval(new Tn({start:o,stop:s}))}else d(o)?(n=new Zr,n.addInterval(new Tn({start:o,stop:Ye.MAXIMUM_VALUE}))):d(s)&&(n=new Zr,n.addInterval(new Tn({start:Ye.MINIMUM_VALUE,stop:s})));return n}function yfe(){let e=new Ua;return e.width=Fy,e.height=Fy,e.scaleByDistance=new Pt(ofe,rfe,sfe,afe),e.pixelOffsetScaleByDistance=new Pt(ofe,rfe,sfe,afe),e}function eJ(){let e=new mm;return e.outline=!0,e.outlineColor=B.WHITE,e}function gfe(){let e=new um;return e.translucencyByDistance=new Pt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=vo.FILL_AND_OUTLINE,e}function tJ(e,t,n,i,o){let r=Xn(e,"href",Pe.kml);if(!d(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=g(ei(e,"x",Pe.gx),0),l=g(ei(e,"y",Pe.gx),0);c=Math.min(c/32,7),l=7-Math.min(l/32,7);let u=8*l+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=$z(r,n,i);if(o){let a=Xn(e,"refreshMode",Pe.kml),c=Xn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?It(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&It(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let l=g(Xn(e,"viewBoundScale",Pe.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=g(Xn(e,"viewFormat",Pe.kml),u),p=Xn(e,"httpQuery",Pe.kml);d(m)&&s.setQueryParameters(Bl(xU(m))),d(p)&&s.setQueryParameters(Bl(xU(p)));let y=t._ellipsoid;return iJ(s,t.camera,t.canvas,l,t._lastCameraView.bbox,y),s}return s}function vqe(e,t,n,i,o){let r=ei(t,"scale",Pe.kml),s=ei(t,"heading",Pe.kml),a=U_(t,"color",Pe.kml),c=Pi(t,"Icon",Pe.kml),l=tJ(c,e,i,o,!1);d(c)&&!d(l)&&(l=!1);let u=ei(c,"x",Pe.gx),m=ei(c,"y",Pe.gx),p=ei(c,"w",Pe.gx),y=ei(c,"h",Pe.gx),f=Pi(t,"hotSpot",Pe.kml),x=Ay(f,"x"),_=Ay(f,"y"),C=us(f,"xunits"),V=us(f,"yunits"),L=n.billboard;d(L)||(L=yfe(),n.billboard=L),L.image=l,L.scale=r,L.color=a,(d(u)||d(m)||d(p)||d(y))&&(L.imageSubRegion=new He(u,m,p,y)),d(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=h.UNIT_Z),r=g(r,1);let Z,G;d(x)&&(C==="pixels"?Z=-x*r:C==="insetPixels"?Z=(x-Fy)*r:C==="fraction"&&(Z=-x*Fy*r),Z+=Fy*.5*r),d(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+Fy)*r:V==="fraction"&&(G=_*Fy*r),G-=Fy*.5*r),(d(Z)||d(G))&&(L.pixelOffset=new D(Z,G))}function gU(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")vqe(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;d(c)||(c=gfe(),n.label=c),c.scale=g(ei(a,"scale",Pe.kml),c.scale),c.fillColor=g(U_(a,"color",Pe.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;d(c)||(c=new Ba,n.polyline=c),c.width=ei(a,"width",Pe.kml),c.material=U_(a,"color",Pe.kml),d(U_(a,"outerColor",Pe.gx))&&It("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),d(ei(a,"outerWidth",Pe.gx))&&It("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),d(ei(a,"physicalWidth",Pe.gx))&&It("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),d(ih(a,"labelVisibility",Pe.gx))&&It("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;d(c)||(c=eJ(),n.polygon=c),c.material=g(U_(a,"color",Pe.kml),c.material),c.fill=g(ih(a,"fill",Pe.kml),c.fill),c.outline=g(ih(a,"outline",Pe.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=g(Jz(Xn(a,"bgColor",Pe.kml)),B.WHITE),l=g(Jz(Xn(a,"textColor",Pe.kml)),B.BLACK),u=Xn(a,"text",Pe.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:l,text:u}}else if(a.localName==="ListStyle"){let c=Xn(a,"listItemType",Pe.kml);(c==="radioFolder"||c==="checkOffOnly")&&It(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function wqe(e,t,n,i,o){let r=new Oo,s,a=-1,c=t.childNodes,l=c.length;for(let m=0;m<l;m++){let p=c[m];(p.localName==="Style"||p.localName==="StyleMap")&&(a=m)}if(a!==-1){let m=c[a];if(m.localName==="Style")gU(e,m,r,i,o);else{let p=nh(m,"Pair",Pe.kml);for(let y=0;y<p.length;y++){let f=p[y],x=Xn(f,"key",Pe.kml);if(x==="normal"){let _=Xn(f,"styleUrl",Pe.kml);if(d(_))s=n.getById(_),d(s)||(s=n.getById(`#${_}`)),d(s)&&r.merge(s);else{let C=Pi(f,"Style",Pe.kml);gU(e,C,r,i,o)}}else It(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let u=Xn(t,"styleUrl",Pe.kml);if(d(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),y=p[0];m=`${i.getDerivedResource({url:y}).getUrlComponent()}#${p[1]}`}s=n.getById(m),d(s)||(s=n.getById(`#${m}`)),d(s)&&r.merge(s)}return r}function Fqe(e,t,n){return t.fetchXML().then(function(i){return xfe(e,i,n,t,!0)})}function xfe(e,t,n,i,o,r){let s,a,c,l,u=dfe(t,"Style",Pe.kml);if(d(u)){let x=u.length;for(s=0;s<x;s++)l=u[s],a=us(l,"id"),d(a)&&(a=`#${a}`,o&&d(i)&&(a=i.getUrlComponent()+a),d(n.getById(a))||(c=new Oo({id:a}),n.add(c),gU(e,l,c,i,r)))}let m=dfe(t,"StyleMap",Pe.kml);if(d(m)){let x=m.length;for(s=0;s<x;s++){let _=m[s];if(a=us(_,"id"),d(a)){let C=nh(_,"Pair",Pe.kml);for(let V=0;V<C.length;V++){let L=C[V],Z=Xn(L,"key",Pe.kml);if(Z==="normal"){if(a=`#${a}`,o&&d(i)&&(a=i.getUrlComponent()+a),!d(n.getById(a))){c=n.getOrCreateEntity(a);let G=Xn(L,"styleUrl",Pe.kml);if(d(G)){G[0]!=="#"&&(G=`#${G}`),o&&d(i)&&(G=i.getUrlComponent()+G);let X=n.getById(G);d(X)&&c.merge(X)}else l=Pi(L,"Style",Pe.kml),gU(e,l,c,i,r)}}else It(`kml-styleMap-${Z}`,`KML - Unsupported StyleMap key: ${Z}`)}}}}let p=[],y=t.getElementsByTagName("styleUrl"),f=y.length;for(s=0;s<f;s++){let x=y[s].textContent;if(x[0]!=="#"){let _=x.split("#");if(_.length===2){let C=_[0],V=i.getDerivedResource({url:C});p.push(Fqe(e,V,n))}}}return p}function nJ(e,t,n){let i=new p0(e,t.id,["position"]),o=new mf(t.position);t.polyline=d(n.polyline)?n.polyline.clone():new Ba,t.polyline.positions=new f0([i,o])}function _fe(e,t){return!d(e)&&!d(t)||e==="clampToGround"?Ke.CLAMP_TO_GROUND:e==="relativeToGround"?Ke.RELATIVE_TO_GROUND:e==="absolute"?Ke.NONE:t==="clampToSeaFloor"?(It("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ke.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(It("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ke.RELATIVE_TO_GROUND):(d(e)?It("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):It("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ke.CLAMP_TO_GROUND)}function Aqe(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((d(t)&&t!=="clampToGround"||d(n)&&n!=="clampToSeaFloor")&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g(t,n)}`),new mf(e))}function Mqe(e,t,n,i){if(!d(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(d(t)&&t!=="clampToGround"||d(n)&&n!=="clampToSeaFloor")&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function TU(e,t,n,i){let o=t.label;d(o)||(o=d(n.label)?n.label.clone():gfe(),t.label=o),o.text=t.name;let r=t.billboard;d(r)||(r=d(n.billboard)?n.billboard.clone():yfe(),t.billboard=r),d(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(B.YELLOW,64);let s=1;d(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new D(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),d(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function Tfe(e,t){let n=e.path;d(n)||(n=new hp,n.leadTime=0,e.path=n);let i=t.polyline;d(i)&&(n.material=i.material,n.width=i.width)}function Nqe(e,t,n,i,o){let r=Xn(n,"coordinates",Pe.kml),s=Xn(n,"altitudeMode",Pe.kml),a=Xn(n,"altitudeMode",Pe.gx),c=ih(n,"extrude",Pe.kml),l=e._ellipsoid,u=_U(r,l);return i.position=u,TU(e,i,o,_fe(s,a)),c&&vP(s,a)&&nJ(t,i,o),!0}function ufe(e,t,n,i,o){let r=Pi(n,"coordinates",Pe.kml),s=Xn(n,"altitudeMode",Pe.kml),a=Xn(n,"altitudeMode",Pe.gx),c=ih(n,"extrude",Pe.kml),l=ih(n,"tessellate",Pe.kml),u=vP(s,a),m=ei(n,"drawOrder",Pe.gx),p=e._ellipsoid,y=yU(r,p),f=o.polyline;if(u&&c){let x=new fp;i.wall=x,x.positions=y;let _=o.polygon;d(_)&&(x.fill=_.fill,x.material=_.material),x.outline=!0,d(f)?(x.outlineColor=d(f.material)?f.material.color:B.WHITE,x.outlineWidth=f.width):d(_)&&(x.outlineColor=d(_.material)?_.material.color:B.WHITE)}else if(e._clampToGround&&!u&&l){let x=new Ba;x.clampToGround=!0,i.polyline=x,x.positions=y,d(f)?(x.material=d(f.material)?f.material.color.getValue(Ye.MINIMUM_VALUE):B.WHITE,x.width=g(f.width,1)):(x.material=B.WHITE,x.width=1),x.zIndex=m}else d(m)&&It("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!l&&It("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=d(f)?f.clone():new Ba,i.polyline=f,f.positions=Mqe(y,s,a,p),(!l||u)&&(f.arcType=Jt.NONE);return!0}function Uqe(e,t,n,i,o){let r=Pi(n,"outerBoundaryIs",Pe.kml),s=Pi(r,"LinearRing",Pe.kml),a=Pi(s,"coordinates",Pe.kml),c=e._ellipsoid,l=yU(a,c),u=ih(n,"extrude",Pe.kml),m=Xn(n,"altitudeMode",Pe.kml),p=Xn(n,"altitudeMode",Pe.gx),y=vP(m,p),f=d(o.polygon)?o.polygon.clone():eJ(),x=o.polyline;if(d(x)&&(f.outlineColor=d(x.material)?x.material.color:B.WHITE,f.outlineWidth=x.width),i.polygon=f,y?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),d(l)){let _=new fa(l),C=nh(n,"innerBoundaryIs",Pe.kml);for(let V=0;V<C.length;V++){s=nh(C[V],"LinearRing",Pe.kml);for(let L=0;L<s.length;L++)a=Pi(s[L],"coordinates",Pe.kml),l=yU(a,c),d(l)&&_.holes.push(new fa(l))}f.hierarchy=_}return!0}function kqe(e,t,n,i,o){let r=Xn(n,"altitudeMode",Pe.kml),s=Xn(n,"altitudeMode",Pe.gx),a=nh(n,"coord",Pe.gx),c=nh(n,"angles",Pe.gx),l=nh(n,"when",Pe.kml),u=ih(n,"extrude",Pe.kml),m=vP(r,s),p=e._ellipsoid;c.length>0&&It("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let y=Math.min(a.length,l.length),f=[],x=[];for(let C=0;C<y;C++){let V=_U(a[C].textContent,p);f.push(V),x.push(te.fromIso8601(l[C].textContent))}let _=new js;return _.addSamples(x,f),i.position=_,TU(e,i,o,_fe(r,s)),Tfe(i,o),i.availability=new Zr,l.length>0&&i.availability.addInterval(new Tn({start:x[0],stop:x[x.length-1]})),m&&u&&nJ(t,i,o),!0}function mfe(e,t,n,i,o,r,s,a,c){let l=e[0],u=e[e.length-1],m=new js;m.addSamples(e,t),n.intervals.addInterval(new Tn({start:l,stop:u,isStartIncluded:c,isStopIncluded:c,data:Aqe(m,s,a)})),i.addInterval(new Tn({start:l,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Tn({start:l,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function Dqe(e,t,n,i,o){let r=ih(n,"interpolate",Pe.gx),s=nh(n,"Track",Pe.gx),a,c,l,u=!1,m=new y0,p=new Zr,y=new Js,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=nh(C,"when",Pe.kml),L=nh(C,"coord",Pe.gx),Z=Xn(C,"altitudeMode",Pe.kml),G=Xn(C,"altitudeMode",Pe.gx),X=vP(Z,G),P=ih(C,"extrude",Pe.kml),v=Math.min(L.length,V.length),A=[];a=[];for(let M=0;M<v;M++){let b=_U(L[M].textContent,f);A.push(b),a.push(te.fromIso8601(V[M].textContent))}r&&(d(c)&&mfe([c,a[0]],[l,A[0]],y,p,m,!1,"absolute",void 0,!1),c=a[v-1],l=A[A.length-1]),mfe(a,A,y,p,m,X&&P,Z,G,!0),u=u||X&&P}return i.availability=p,i.position=y,TU(e,i,o),Tfe(i,o),u&&(nJ(t,i,o),i.polyline.show=m),!0}var Sfe={Point:Nqe,LineString:ufe,LinearRing:ufe,Polygon:Uqe,Track:kqe,MultiTrack:Dqe,MultiGeometry:Bqe,Model:Yqe};function Bqe(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,l=s.length;c<l;c++){let u=s.item(c),m=Sfe[u.localName];if(d(m)){let p=bfe(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,m(e,t,u,p,o)&&(a=!0)}}return a}function Yqe(e,t,n,i,o){return It("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Oqe(e,t){let n=Pi(e,"ExtendedData",Pe.kml);if(!d(n))return;d(Pi(n,"SchemaData",Pe.kml))&&It("kml-schemaData","KML - SchemaData is unsupported"),d(us(n,"xmlns:prefix"))&&It("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=nh(n,"Data",Pe.kml);if(d(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=us(a,"name");d(c)&&(i[c]={displayName:Xn(a,"displayName",Pe.kml),value:Xn(a,"value",Pe.kml)})}}t.kml.extendedData=i}var fo;typeof document<"u"&&(fo=document.createElement("div"));function Kqe(e,t,n,i,o){let r,s,a,c=t.kml,l=c.extendedData,u=Xn(e,"description",Pe.kml),m=g(t.balloonStyle,n.balloonStyle),p=B.WHITE,y=B.BLACK,f=u;d(m)&&(p=g(m.bgColor,B.WHITE),y=g(m.textColor,B.BLACK),f=g(m.text,u));let x;if(d(f)){if(f=f.replace("$[name]",g(t.name,"")),f=f.replace("$[description]",g(u,"")),f=f.replace("$[address]",g(c.address,"")),f=f.replace("$[Snippet]",g(c.snippet,"")),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),d(l)){let V=f.match(/\$\[.+?\]/g);if(V!==null)for(r=0;r<V.length;r++){let L=V[r],Z=L.substr(2,L.length-3),G=/\/displayName$/.test(Z);Z=Z.replace(/\/displayName$/,""),x=l[Z],d(x)&&(x=G?x.displayName:x.value),d(x)&&(f=f.replace(L,g(x,"")))}}}else if(d(l)&&(a=Object.keys(l),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=l[s],f+=`<tr><th>${g(x.displayName,s)}</th><td>${g(x.value,"")}</td></tr>`;f+="</tbody></table>"}if(!d(f))return;f=Zqe.link(f),fo.innerHTML=f;let _=fo.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");d(i)&&i.keys.length>1&&(Cd(fo,"a","href",i),Cd(fo,"link","href",i),Cd(fo,"area","href",i),Cd(fo,"img","src",i),Cd(fo,"iframe","src",i),Cd(fo,"video","src",i),Cd(fo,"audio","src",i),Cd(fo,"source","src",i),Cd(fo,"track","src",i),Cd(fo,"input","src",i),Cd(fo,"embed","src",i),Cd(fo,"script","src",i),Cd(fo,"video","poster",i)),Vd(fo,"a","href",o),Vd(fo,"link","href",o),Vd(fo,"area","href",o),Vd(fo,"img","src",o),Vd(fo,"iframe","src",o),Vd(fo,"video","src",o),Vd(fo,"audio","src",o),Vd(fo,"source","src",o),Vd(fo,"track","src",o),Vd(fo,"input","src",o),Vd(fo,"embed","src",o),Vd(fo,"script","src",o),Vd(fo,"video","poster",o);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${y.toCssColorString()};`,C+='">',C+=`${fo.innerHTML}</div>`,fo.innerHTML="",t.description=C}function SU(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=bfe(t,i,n.context),c=a.kml,l=wqe(e,t,n.styleCollection,r,s),u=Xn(t,"name",Pe.kml);a.name=u,a.parent=o;let m=Pqe(t);d(m)||(m=Wqe(t)),a.availability=m,rJ(a);function p(L){return L?L.show&&p(L.parent):!0}let y=ih(t,"visibility",Pe.kml);a.show=p(o)&&g(y,!0);let f=Pi(t,"author",Pe.atom),x=c.author;x.name=Xn(f,"name",Pe.atom),x.uri=Xn(f,"uri",Pe.atom),x.email=Xn(f,"email",Pe.atom);let _=Pi(t,"link",Pe.atom),C=c.link;C.href=us(_,"href"),C.hreflang=us(_,"hreflang"),C.rel=us(_,"rel"),C.type=us(_,"type"),C.title=us(_,"title"),C.length=us(_,"length"),c.address=Xn(t,"address",Pe.kml),c.phoneNumber=Xn(t,"phoneNumber",Pe.kml),c.snippet=Xn(t,"Snippet",Pe.kml),Oqe(t,a),Kqe(t,a,l,s,r);let V=e._ellipsoid;return Lfe(t,a,V),Vfe(t,a,V),d(Pi(t,"Region",Pe.kml))&&It("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:l}}function Cfe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Hqe(e,t,n,i){let o=SU(e,t,n),r=Oe(n);r.parentEntity=o.entity,Cfe(e,t,r,i)}function zqe(e,t,n,i){let o=SU(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let l=0,u=c.length;l<u&&!a;l++){let m=c.item(l),p=Sfe[m.localName];d(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),TU(e,r,s))}var Jqe={FlyTo:qqe,Wait:jqe,SoundCue:Kz,AnimatedUpdate:Kz,TourControl:Kz};function Qqe(e,t,n,i){let o=Xn(t,"name",Pe.kml),r=us(t,"id"),s=new EP(o,r),a=Pi(t,"Playlist",Pe.gx);if(a){let c=e._ellipsoid,l=a.childNodes;for(let u=0;u<l.length;u++){let m=l[u];if(m.localName){let p=Jqe[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function Kz(e,t){It(`KML Tour unsupported node ${t.localName}`)}function jqe(e,t){let n=ei(t,"duration",Pe.gx);e.addPlaylistEntry(new WP(n))}function qqe(e,t,n){let i=ei(t,"duration",Pe.gx),o=Xn(t,"flyToMode",Pe.gx),r={kml:{}};Lfe(t,r,n),Vfe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new IP(i,o,s);e.addPlaylistEntry(a)}function Vfe(e,t,n){let i=Pi(e,"Camera",Pe.kml);if(d(i)){let o=g(ei(i,"longitude",Pe.kml),0),r=g(ei(i,"latitude",Pe.kml),0),s=g(ei(i,"altitude",Pe.kml),0),a=g(ei(i,"heading",Pe.kml),0),c=g(ei(i,"tilt",Pe.kml),0),l=g(ei(i,"roll",Pe.kml),0),u=h.fromDegrees(o,r,s,n),m=Aa.fromDegrees(a,c-90,l);t.kml.camera=new xP(u,m)}}function Lfe(e,t,n){let i=Pi(e,"LookAt",Pe.kml);if(d(i)){let o=g(ei(i,"longitude",Pe.kml),0),r=g(ei(i,"latitude",Pe.kml),0),s=g(ei(i,"altitude",Pe.kml),0),a=ei(i,"heading",Pe.kml),c=ei(i,"tilt",Pe.kml),l=g(ei(i,"range",Pe.kml),0);c=W.toRadians(g(c,0)),a=W.toRadians(g(a,0));let u=new Pu(a,c-W.PI_OVER_TWO,l),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new GP(m,u)}}function $qe(e,t,n,i){let o=n.screenOverlayContainer;if(!d(o))return;let r=n.sourceResource,s=n.uriResolver,a=Pi(t,"Icon",Pe.kml),c=tJ(a,e,r,s,!1);if(!d(c))return;let l=document.createElement("img");e._screenOverlays.push(l),l.src=c.url,l.onload=function(){let u=["position: absolute"],m=Pi(t,"screenXY",Pe.kml),p=Pi(t,"overlayXY",Pe.kml),y=Pi(t,"size",Pe.kml),f,x,_,C,V,L;d(y)&&(f=Ay(y,"x"),x=Ay(y,"y"),_=us(y,"xunits"),C=us(y,"yunits"),d(f)&&f!==-1&&f!==0&&(_==="fraction"?V=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(V=`width: ${f}px`),u.push(V)),d(x)&&x!==-1&&x!==0&&(C==="fraction"?L=`height: ${Math.floor(x*100)}%`:C==="pixels"&&(L=`height: ${x}px`),u.push(L))),l.style=u.join(";");let Z=0,G=l.height;d(p)&&(f=Ay(p,"x"),x=Ay(p,"y"),_=us(p,"xunits"),C=us(p,"yunits"),d(f)&&(_==="fraction"?Z=f*l.width:(_==="pixels"||_==="insetPixels")&&(Z=f)),d(x)&&(C==="fraction"?G=x*l.height:(C==="pixels"||C==="insetPixels")&&(G=x))),d(m)&&(f=Ay(m,"x"),x=Ay(m,"y"),_=us(m,"xunits"),C=us(m,"yunits"),d(f)&&(_==="fraction"?V=`left: calc(${Math.floor(f*100)}% - ${Z}px)`:_==="pixels"?V=`left: ${f-Z}px`:_==="insetPixels"&&(V=`right: ${f-Z}px`),u.push(V)),d(x)&&(C==="fraction"?L=`bottom: calc(${Math.floor(x*100)}% - ${G}px)`:C==="pixels"?L=`bottom: ${x-G}px`:C==="insetPixels"&&(L=`top: ${x-G}px`),u.push(L))),l.style=u.join(";")},o.appendChild(l)}function e$e(e,t,n,i){let r=SU(e,t,n).entity,s,a=!1,c=e._ellipsoid,l=yU(Pi(t,"LatLonQuad",Pe.gx),c),u=ei(t,"drawOrder",Pe.kml);if(d(l))s=eJ(),s.hierarchy=new fa(l),s.zIndex=u,r.polygon=s,a=!0;else{s=new hm,s.zIndex=u,r.rectangle=s;let f=Pi(t,"LatLonBox",Pe.kml);if(d(f)){let x=ei(f,"west",Pe.kml),_=ei(f,"south",Pe.kml),C=ei(f,"east",Pe.kml),V=ei(f,"north",Pe.kml);d(x)&&(x=W.negativePiToPi(W.toRadians(x))),d(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),d(C)&&(C=W.negativePiToPi(W.toRadians(C))),d(V)&&(V=W.clampToLatitudeRange(W.toRadians(V))),s.coordinates=new de(x,_,C,V);let L=ei(f,"rotation",Pe.kml);if(d(L)){let Z=W.toRadians(L);s.rotation=Z,s.stRotation=Z}}}let m=Pi(t,"Icon",Pe.kml),p=tJ(m,e,n.sourceResource,n.uriResolver,!0);if(d(p)){a&&It("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=ei(m,"x",Pe.gx),x=ei(m,"y",Pe.gx),_=ei(m,"w",Pe.gx),C=ei(m,"h",Pe.gx);(d(f)||d(x)||d(_)||d(C))&&It("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=U_(t,"color",Pe.kml),s.material.transparent=!0}else s.material=U_(t,"color",Pe.kml);let y=Xn(t,"altitudeMode",Pe.kml);d(y)?y==="absolute"?(s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):y!=="clampToGround"&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`):(y=Xn(t,"altitudeMode",Pe.gx),y==="relativeToSeaFloor"?(It("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):y==="clampToSeaFloor"?It("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):d(y)&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`))}function Rfe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),It(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var My={INTERVAL:0,EXPIRE:1,STOP:2};function xU(e){if(!d(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var t$e=new de,A1=new he,Hz=new D,n$e=new h;function iJ(e,t,n,i,o,r){function s(l){return l<-W.PI_OVER_TWO?-W.PI_OVER_TWO:l>W.PI_OVER_TWO?W.PI_OVER_TWO:l}function a(l){return l>W.PI?l-W.TWO_PI:l<-W.PI?l+W.TWO_PI:l}let c=Gg(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),d(t)&&t._mode!==ie.MORPHING){let l,u;if(o=g(o,t$e),d(n)&&(Hz.x=n.clientWidth*.5,Hz.y=n.clientHeight*.5,l=t.pickEllipsoid(Hz,r,n$e)),d(l)?u=r.cartesianToCartographic(l,A1):(u=de.center(o,A1),l=r.cartographicToCartesian(u)),d(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new de(a(u.longitude-C),s(u.latitude-V),a(u.longitude+C),s(u.latitude+V))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let m=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",m),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,l)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,A1),c=c.replace("[cameraLon]",W.toDegrees(A1.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(A1.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(A1.height).toString());let y=t.frustum,f=y.aspectRatio,x="",_="";if(d(f)){let C=W.toDegrees(y.fov);f>1?(x=C,_=C/f):(_=C,x=C*f)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");d(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Bl(c))}function i$e(e,t,n,i){let r=SU(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Pi(t,"Link",Pe.kml);if(d(c)||(c=Pi(t,"Url",Pe.kml)),d(c)){let l=Xn(c,"href",Pe.kml),u,m;if(d(l)){let p=l;if(l=$z(l,s,n.uriResolver),/^data:/.test(l.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=l.clone(),u=Xn(c,"viewRefreshMode",Pe.kml),u==="onRegion"){It("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=g(Xn(c,"viewBoundScale",Pe.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=g(Xn(c,"viewFormat",Pe.kml),_),V=Xn(c,"httpQuery",Pe.kml);d(C)&&l.setQueryParameters(Bl(xU(C))),d(V)&&l.setQueryParameters(Bl(xU(V)));let L=e._ellipsoid;iJ(l,e.camera,e.canvas,m,e._lastCameraView.bbox,L)}let y={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new Es,x=oJ(e,f,l,y).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let G=0;G<V.length;G++){let X=V[G];d(X.parent)||(X.parent=r,rJ(X)),C.add(X)}C.resumeEvents();let L=Xn(c,"refreshMode",Pe.kml),Z=g(ei(c,"refreshInterval",Pe.kml),0);if(L==="onInterval"&&Z>0||L==="onExpire"||u==="onStop"){let G=Pi(_,"NetworkLinkControl",Pe.kml),X=d(G),P=te.now(),v={id:Yn(),href:l,cookie:{},lastUpdated:P,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:P},A=0;if(X&&(v.cookie=Bl(g(Xn(G,"cookie",Pe.kml),"")),A=g(ei(G,"minRefreshPeriod",Pe.kml),0)),L==="onInterval")X&&(Z=Math.max(A,Z)),v.refreshMode=My.INTERVAL,v.time=Z;else if(L==="onExpire"){let M;if(X&&(M=Xn(G,"expires",Pe.kml)),d(M))try{let b=te.fromIso8601(M),R=te.secondsDifference(b,P);R>0&&R<A&&te.addSeconds(P,A,b),v.refreshMode=My.EXPIRE,v.time=b}catch{It("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else It("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else d(e.camera)?(v.refreshMode=My.STOP,v.time=g(ei(c,"viewRefreshTime",Pe.kml),0)):It("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");d(v.refreshMode)&&e._networkLinks.set(v.id,v)}}).catch(function(_){It(`An error occured during loading ${l.url}`),e._error.raiseEvent(e,_)});i.addPromise(x)}}}function o$e(e,t,n,i){let o=qz[t.localName];return d(o)?o(e,t,n,i):Rfe(e,t,n,i)}function Qz(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Pi(a,"Document",Pe.kml),l=Xn(c,"name",Pe.kml);d(l)||(l=m0(i.getUrlComponent())),d(e._name)||(e._name=l);let u=new Ld._DeferredLoading(e),m=new Es(e);return Promise.all(xfe(e,n,m,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let x=0;x<f.length;x++){let _=f[x];if(d(qz[_.localName])){p=_;break}}}let y={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),o$e(e,p,y,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function r$e(e,t,n,i,o){let r=$t("ThirdParty/Workers/z-worker-pako.js");Z1({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new dU(new N_(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],l={},u;for(let m=0;m<a.length;m++){let p=a[m];p.directory||(/\.kml$/i.test(p.filename)&&(!d(u)||!/\//i.test(p.filename))?(d(u)&&c.push(Oz(u,l)),u=p):c.push(Oz(p,l)))}return d(u)&&c.push(Iqe(u,l)),Promise.all(c).then(function(){if(s.close(),!d(l.kml))throw new me("KMZ file does not contain a KML document.");return l.keys=Object.keys(l),Qz(e,t,l.kml,i,l,o)})})}function oJ(e,t,n,i){i=g(i,g.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),c=n.fetchBlob(),o=g(o,n.clone());let l=e._resourceCredits,u=n.credits;if(d(u)){let m=u.length;for(let p=0;p<m;p++)l.push(u[p])}}else o=g(o,Ee.DEFAULT.clone());return o=Ee.createIfNeeded(o),d(a)&&(a=En(a)),Promise.resolve(c).then(function(l){return l instanceof Blob?Eqe(l).then(function(u){return u?r$e(e,t,l,o,a):Xqe(l).then(function(m){m=ffe(m),m=pfe(m);let p,y;try{p=jz.parseFromString(m,"application/xml")}catch(f){y=f.toString()}if(d(y)||p.body||p.documentElement.tagName==="parsererror"){let f=d(y)?y:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new me(f)}return Qz(e,t,p,o,r,a,s)})}):Qz(e,t,l,o,r,a,s)}).catch(function(l){return e._error.raiseEvent(e,l),console.log(l),Promise.reject(l)})}function Ld(e){e=g(e,g.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new ye,this._error=new ye,this._loading=new ye,this._refresh=new ye,this._unsupportedNode=new ye,this._clock=void 0,this._entityCollection=new Es(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new V0,this._networkLinks=new Tt,this._entityCluster=new ad,this.canvas=n,this.camera=t,this._lastCameraView={position:d(t)?h.clone(t.positionWC):void 0,direction:d(t)?h.clone(t.directionWC):void 0,up:d(t)?h.clone(t.upWC):void 0,bbox:d(t)?t.computeViewRectangle():de.clone(de.MAX_VALUE)},this._ellipsoid=g(e.ellipsoid,re.WGS84);let i=e.credit;typeof i=="string"&&(i=new St(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Ld.load=function(e,t){return t=g(t,g.EMPTY_OBJECT),new Ld(t).load(e,t)};Object.defineProperties(Ld.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Ld.prototype.load=function(e,t){t=g(t,g.EMPTY_OBJECT),Gr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=g(t.clampToGround,!1);let i=this;return oJ(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=te.equals(s,Ye.MINIMUM_VALUE),l=te.equals(a,Ye.MAXIMUM_VALUE);if(!c||!l){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=te.fromDate(m)),l&&(m=new Date,m.setHours(24,0,0,0),a=te.fromDate(m)),o=new Bm,o.startTime=s,o.stopTime=a,o.currentTime=te.clone(s),o.clockRange=Xr.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(te.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Gr.setLoading(i,!1),i}).catch(function(o){return Gr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Ld.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function rJ(e){let t=e.parent;if(d(t)){let n=t.availability;if(d(n)){let i=e.availability;d(i)?i.intersect(n):e.availability=n}}}function s$e(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Pi(r,"NetworkLinkControl",Pe.kml),c=d(a),l=0;if(c){if(d(Pi(a,"Update",Pe.kml))){It("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Bl(g(Xn(a,"cookie",Pe.kml),"")),l=g(ei(a,"minRefreshPeriod",Pe.kml),0)}let u=te.now(),m=t.refreshMode;if(m===My.INTERVAL)d(a)&&(t.time=Math.max(l,t.time));else if(m===My.EXPIRE){let P;if(d(a)&&(P=Xn(a,"expires",Pe.kml)),d(P))try{let v=te.fromIso8601(P),A=te.secondsDifference(v,u);A>0&&A<l&&te.addSeconds(u,l,v),t.time=v}catch{It("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else It("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,y=e._entityCollection,f=n.values;function x(P){y.remove(P);let v=P._children,A=v.length;for(let M=0;M<A;++M)x(v[M])}y.suspendEvents();let _=y.values.slice(),C;for(C=0;C<_.length;++C){let P=_[C];P.parent===p&&(P.parent=void 0,x(P))}for(y.resumeEvents(),y.suspendEvents(),C=0;C<f.length;C++){let P=f[C];d(P.parent)||(P.parent=p,rJ(P)),y.add(P)}y.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=y.computeAvailability(),L=V.start,Z=V.stop,G=te.equals(L,Ye.MINIMUM_VALUE),X=te.equals(Z,Ye.MAXIMUM_VALUE);if(!G||!X){let P=e._clock;(P.startTime!==L||P.stopTime!==Z)&&(P.startTime=L,P.stopTime=Z,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var zz=new Tt;Ld.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=te.now(),i=this;zz.removeAll();function o(u){let m=u._children,p=m.length;for(let y=0;y<p;++y){let f=m[y];zz.set(f.id,f),o(f)}}let r=!1,s=this._lastCameraView,a=this.camera;d(a)&&!(a.positionWC.equalsEpsilon(s.position,W.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,W.EPSILON7)&&a.upWC.equalsEpsilon(s.up,W.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Tt,l=!1;return t.values.forEach(function(u){let m=u.entity;if(!zz.contains(m.id)){if(!u.updating){let p=!1;if(u.refreshMode===My.INTERVAL?te.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===My.EXPIRE?te.greaterThan(n,u.time)&&(p=!0):u.refreshMode===My.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&te.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(m),u.updating=!0;let y=new Es,f=u.href.clone();f.setQueryParameters(u.cookie);let x=g(i._ellipsoid,re.WGS84);iJ(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),oJ(i,y,f,{context:m.id}).then(s$e(i,u,y,c,f)).catch(function(_){let C=`NetworkLink ${u.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),l=!0}}c.set(u.id,u)}}),l&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function a$e(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Ld._DeferredLoading=_f;Ld._getTimestamp=gi;var wP=Ld;var Oci=T(S(),1);function FP(){fe.throwInstantiationError()}FP.prototype.update=fe.throwInstantiationError;FP.prototype.getBoundingSphere=fe.throwInstantiationError;FP.prototype.isDestroyed=fe.throwInstantiationError;FP.prototype.destroy=fe.throwInstantiationError;var sJ=FP;var Tli=T(S(),1);var aJ=32,c$e="http://www.opengis.net/kml/2.2",rh="http://www.google.com/kml/ext/2.2",l$e="http://www.w3.org/2000/xmlns/";function CU(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var d$e=/^data:image\/([^,;]+)/;CU.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ee){if(e=Ee.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(d$e);n=`texture_${++this._count}`,d(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function u$e(e,t){return function(n){e._files[t]=n}}CU.prototype.model=function(e,t){let n=this._modelCallback;if(!d(n))throw new me("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(u$e(this,r))}return o};Object.defineProperties(CU.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function VU(e){this._time=e}VU.prototype.get=function(e,t,n){let i;return d(e)&&(i=d(e.getValue)?e.getValue(this._time,n):e),g(i,t)};VU.prototype.getColor=function(e,t){let n=this.get(e,t);if(d(n))return D_(n)};VU.prototype.getMaterialType=function(e){if(d(e))return e.getType(this._time)};function cJ(){this._ids={},this._styles={},this._count=0}cJ.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(d(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};cJ.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function Efe(){this._ids={}}Efe.prototype.get=function(e){if(!d(e))return this.get(Yn());let t=this._ids;return d(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function lJ(e){e=g(e,g.EMPTY_OBJECT);let t=e.entities,n=g(e.kmz,!1),i=lJ._createState(e),o=t.values.filter(function(l){return!d(l.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(l$e,"xmlns:gx",rh);let a=r.createElement("Document");s.appendChild(a),Ife(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?m$e(u,c.files):{kml:u,externalFiles:c.files}})}function m$e(e,t){let n=$t("ThirdParty/Workers/z-worker-pako.js");Z1({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new W1,o=new hU(i);return o.add("doc.kml",new qN(e)).then(function(){let r=Object.keys(t);return Xfe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function Xfe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new N_(n[o])).then(function(){return Xfe(e,t,n,i+1)})}lJ._createState=function(e){let t=e.entities,n=new cJ,i=t.computeAvailability(),o=d(e.time)?e.time:i.start,r=g(e.defaultAvailability,i),s=g(e.sampleDuration,60);r.start===Ye.MINIMUM_VALUE?r.stop===Ye.MAXIMUM_VALUE?r=new Tn:te.addSeconds(r.stop,-10*s,r.start):r.stop===Ye.MAXIMUM_VALUE&&te.addSeconds(r.start,10*s,r.stop);let a=new CU(e.modelCallback);return{kmlDoc:document.implementation.createDocument(c$e,"kml"),ellipsoid:g(e.ellipsoid,re.WGS84),idManager:new Efe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new VU(o),sampleDuration:s,defaultAvailability:new Zr([r])}};function Ife(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,l,u;for(let m=0;m<a;++m){let p=n[m];c=[],l=[],u=[],h$e(e,p,l,u),f$e(e,p.polyline,l,u),Gfe(e,p.rectangle,l,u,c),Gfe(e,p.polygon,l,u,c),g$e(e,p,p.model,l,u);let y,f=p.availability;d(f)&&(y=i.createElement("TimeSpan"),te.equals(f.start,Ye.MINIMUM_VALUE)||y.appendChild(fn(i,"begin",te.toIso8601(f.start))),te.equals(f.stop,Ye.MAXIMUM_VALUE)||y.appendChild(fn(i,"end",te.toIso8601(f.stop))));for(let C=0;C<c.length;++C){let V=c[C];V.setAttribute("id",s.get(p.id)),V.appendChild(fn(i,"name",p.name)),V.appendChild(fn(i,"visibility",p.show)),V.appendChild(fn(i,"description",p.description)),d(y)&&V.appendChild(y),t.appendChild(V)}let x=l.length;if(x>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(d(L)){let G=i.createElement("LabelStyle"),X=r.get(L.text);V=d(X)&&X.length>0?X:V;let P=r.getColor(L.fillColor);d(P)&&(G.appendChild(fn(i,"color",P)),G.appendChild(fn(i,"colorMode","normal")));let v=r.get(L.scale);d(v)&&G.appendChild(fn(i,"scale",v)),u.push(G)}C.appendChild(fn(i,"name",V)),C.appendChild(fn(i,"visibility",p.show)),C.appendChild(fn(i,"description",p.description)),d(y)&&C.appendChild(y),t.appendChild(C);let Z=u.length;if(Z>0){let G=i.createElement("Style");for(let X=0;X<Z;++X)G.appendChild(u[X]);C.appendChild(fn(i,"styleUrl",o.get(G)))}if(l.length===1)C.appendChild(l[0]);else if(l.length>1){let G=i.createElement("MultiGeometry");for(let X=0;X<x;++X)G.appendChild(l[X]);C.appendChild(G)}}let _=p._children;if(_.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(fn(i,"name",p.name)),C.appendChild(fn(i,"visibility",p.show)),C.appendChild(fn(i,"description",p.description)),t.appendChild(C),Ife(e,C,_)}}}var Pl=new h,Dc=new he,oh=new te;function h$e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=g(t.billboard,t.point);if(!d(a)&&!d(t.path))return;let c=t.position;if(!c.isConstant){Wfe(e,t,a,n,i);return}s.get(c,void 0,Pl);let l=fn(o,"coordinates",k_(Pl,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(B_(e,a.heightReference)),u.appendChild(m),u.appendChild(l),n.push(u);let p=a instanceof Ua?vfe(e,a):Pfe(e,a);i.push(p)}function Wfe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,l=t.position,u=!0;l instanceof Js?(c=l.intervals,u=!1):c=g(t.availability,e.defaultAvailability);let m=n instanceof mp,p,y,f,x=[];for(p=0;p<c.length;++p){let C=c.get(p),V=u?l:C.data,L=r.createElement("altitudeMode");V instanceof mf?(V=V._value,L.appendChild(B_(e,Ke.CLAMP_TO_GROUND))):d(n)?L.appendChild(B_(e,n.heightReference)):L.appendChild(B_(e,Ke.NONE));let Z=[],G=[];if(V.isConstant){a.get(V,void 0,Pl);let P=fn(r,"coordinates",k_(Pl,s));Z.push(te.toIso8601(C.start)),G.push(P),Z.push(te.toIso8601(C.stop)),G.push(P)}else if(V instanceof js)for(f=V._property._times,y=0;y<f.length;++y)Z.push(te.toIso8601(f[y])),V.getValueInReferenceFrame(f[y],io.FIXED,Pl),G.push(k_(Pl,s));else if(V instanceof ud){f=V._times;let P=V._values;for(y=0;y<f.length;++y)Z.push(te.toIso8601(f[y])),h.fromArray(P,y*3,Pl),G.push(k_(Pl,s))}else{let P=e.sampleDuration;C.start.clone(oh),C.isStartIncluded||te.addSeconds(oh,P,oh);let v=C.stop;for(;te.lessThan(oh,v);)V.getValue(oh,Pl),Z.push(te.toIso8601(oh)),G.push(k_(Pl,s)),te.addSeconds(oh,P,oh);C.isStopIncluded&&te.equals(oh,v)&&(V.getValue(oh,Pl),Z.push(te.toIso8601(oh)),G.push(k_(Pl,s)))}let X=r.createElementNS(rh,"Track");X.appendChild(L);for(let P=0;P<Z.length;++P){let v=fn(r,"when",Z[P]),A=fn(r,"coord",G[P],rh);X.appendChild(v),X.appendChild(A)}m&&X.appendChild(wfe(e,n)),x.push(X)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=r.createElementNS(rh,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(d(n)&&!m){let C=n instanceof Ua?vfe(e,n):Pfe(e,n);o.push(C)}let _=t.path;if(d(_)){let C=a.get(_.width),V=_.material;if(d(V)||d(C)){let L=r.createElement("LineStyle");d(C)&&L.appendChild(fn(r,"width",C)),dJ(e,V,L),o.push(L)}}}function Pfe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);d(r)&&(o.appendChild(fn(n,"color",r)),o.appendChild(fn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return d(s)&&o.appendChild(fn(n,"scale",s/aJ)),o}function vfe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(d(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(fn(n,"href",s));let y=i.get(t.imageSubRegion);d(y)&&(p.appendChild(fn(n,"x",y.x,rh)),p.appendChild(fn(n,"y",y.y,rh)),p.appendChild(fn(n,"w",y.width,rh)),p.appendChild(fn(n,"h",y.height,rh))),r.appendChild(p)}let a=i.getColor(t.color);d(a)&&(r.appendChild(fn(n,"color",a)),r.appendChild(fn(n,"colorMode","normal")));let c=i.get(t.scale);d(c)&&r.appendChild(fn(n,"scale",c));let l=i.get(t.pixelOffset);if(d(l)){c=g(c,1),D.divideByScalar(l,c,l);let p=i.get(t.width,aJ),y=i.get(t.height,aJ),f=i.get(t.horizontalOrigin,bi.CENTER);f===bi.CENTER?l.x-=p*.5:f===bi.RIGHT&&(l.x-=p);let x=i.get(t.verticalOrigin,In.CENTER);x===In.TOP?l.y+=y:x===In.CENTER&&(l.y+=y*.5);let _=n.createElement("hotSpot");_.setAttribute("x",-l.x),_.setAttribute("y",l.y),_.setAttribute("xunits","pixels"),_.setAttribute("yunits","pixels"),r.appendChild(_)}let u=i.get(t.rotation),m=i.get(t.alignedAxis);return d(u)&&h.equals(h.UNIT_Z,m)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(fn(n,"heading",u))),r}function f$e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!d(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),l=s.get(t.clampToGround,!1),u;l?(a.appendChild(fn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let m=t.positions,p=s.get(m),y=fn(o,"coordinates",k_(p,r));a.appendChild(y);let f=s.get(t.zIndex);l&&d(f)&&a.appendChild(fn(o,"drawOrder",f,rh)),n.push(a);let x=o.createElement("LineStyle"),_=s.get(t.width);d(_)&&x.appendChild(fn(o,"width",_)),dJ(e,t.material,x),i.push(x)}function p$e(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],l=[de.northeast,de.southeast,de.southwest,de.northwest];for(let y=0;y<4;++y)l[y](a,Dc),c.push(`${W.toDegrees(Dc.longitude)},${W.toDegrees(Dc.latitude)},${r}`);let u=fn(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function Zfe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)he.fromCartesian(t[u],r,Dc),s.push(`${W.toDegrees(Dc.longitude)},${W.toDegrees(Dc.latitude)},${i?Dc.height:n}`);let c=fn(o,"coordinates",s.join(" ")),l=o.createElement("LinearRing");return l.appendChild(c),l}function b$e(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,l=o.get(c),u=Array.isArray(l)?l:l.positions,m=i.createElement("outerBoundaryIs");m.appendChild(Zfe(e,u,r,s)),a.push(m);let p=l.holes;if(d(p)){let y=p.length;for(let f=0;f<y;++f){let x=i.createElement("innerBoundaryIs");x.appendChild(Zfe(e,p[f].positions,r,s)),a.push(x)}}return a}function Gfe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!d(t))return;let a=t instanceof hm;if(a&&s.getMaterialType(t.material)==="Image"){y$e(e,t,o);return}let c=r.createElement("Polygon"),l=s.get(t.extrudedHeight,0);l>0&&c.appendChild(fn(r,"extrude",!0));let u=a?p$e(e,t,l):b$e(e,t,l),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(B_(e,t.heightReference)),c.appendChild(p),n.push(c);let y=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&y.appendChild(fn(r,"fill",f)),dJ(e,t.material,y);let x=s.get(t.outline,!1);if(x){y.appendChild(fn(r,"outline",x));let _=r.createElement("LineStyle"),C=s.get(t.outlineWidth,1);_.appendChild(fn(r,"width",C));let V=s.getColor(t.outlineColor,B.BLACK);_.appendChild(fn(r,"color",V)),_.appendChild(fn(r,"colorMode","normal")),i.push(_)}i.push(y)}function y$e(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(B_(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);d(c)&&s.appendChild(fn(i,"altitude",c));let l=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(fn(i,"north",W.toDegrees(l.north))),u.appendChild(fn(i,"south",W.toDegrees(l.south))),u.appendChild(fn(i,"east",W.toDegrees(l.east))),u.appendChild(fn(i,"west",W.toDegrees(l.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),y=i.createElement("Icon");y.appendChild(fn(i,"href",p)),s.appendChild(y);let f=m.color;d(f)&&s.appendChild(fn(i,"color",D_(m.color))),n.push(s)}function wfe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(d(s)){let l=n.createElement("scale");l.appendChild(fn(n,"x",s)),l.appendChild(fn(n,"y",s)),l.appendChild(fn(n,"z",s)),r.appendChild(l)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(fn(n,"href",c)),r.appendChild(a),r}function g$e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!d(n))return;let c=t.position;if(!c.isConstant){Wfe(e,t,n,i,o);return}let l=wfe(e,n),u=r.createElement("altitudeMode");u.appendChild(B_(e,n.heightReference)),l.appendChild(u),a.get(c,void 0,Pl),he.fromCartesian(Pl,s,Dc);let m=r.createElement("Location");m.appendChild(fn(r,"longitude",W.toDegrees(Dc.longitude))),m.appendChild(fn(r,"latitude",W.toDegrees(Dc.latitude))),m.appendChild(fn(r,"altitude",Dc.height)),l.appendChild(m),i.push(l)}function dJ(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!d(t))return;let r=o.get(t);if(!d(r))return;let s,a=o.getMaterialType(t),c,l;switch(a){case"Image":s=D_(B.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=D_(r.color);break;case"PolylineOutline":s=D_(r.color),c=D_(r.outlineColor),l=r.outlineWidth,n.appendChild(fn(i,"outerColor",c,rh)),n.appendChild(fn(i,"outerWidth",l,rh));break;case"Stripe":s=D_(r.oddColor);break}d(s)&&(n.appendChild(fn(i,"color",s)),n.appendChild(fn(i,"colorMode","normal")))}function B_(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Ke.NONE),r;switch(o){case Ke.NONE:r=n.createTextNode("absolute");break;case Ke.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Ke.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function k_(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,Dc),i.push(`${W.toDegrees(Dc.longitude)},${W.toDegrees(Dc.latitude)},${Dc.height}`);return i.join(" ")}function fn(e,t,n,i){n=g(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=d(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function D_(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var uJ=lJ;var jPi=T(S(),1);var Vli=T(S(),1);function x$e(e){let t,n=e.name,i=e.message;d(n)&&d(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return d(o)&&(t+=`
${o}`),t}var Tf=x$e;var Lgi=T(S(),1);var kdi=T(S(),1);var Wdi=T(S(),1);var Rli=T(S(),1),_$e={NONE:0,LERC:1},Fu=Object.freeze(_$e);var idi=T(S(),1);var Uli=T(S(),1);var Gli=T(S(),1),T$e={NONE:0,BITS12:1},vs=Object.freeze(T$e);var Y_=new h,S$e=new h,Au=new D,LU=new F,C$e=new F,V$e=Math.pow(2,12);function rc(e,t,n,i,o,r,s,a,c,l){let u=vs.NONE,m,p;if(d(t)&&d(n)&&d(i)&&d(o)){let y=t.minimum,f=t.maximum,x=h.subtract(f,y,S$e),_=i-n;Math.max(h.maximumComponent(x),_)<V$e-1?u=vs.BITS12:u=vs.NONE,m=F.inverseTransformation(o,new F);let V=h.negate(y,Y_);F.multiply(F.fromTranslation(V,LU),m,m);let L=Y_;L.x=1/x.x,L.y=1/x.y,L.z=1/x.z,F.multiply(F.fromScale(L,LU),m,m),p=F.clone(o),F.setTranslation(p,h.ZERO,p),o=F.clone(o,new F);let Z=F.fromTranslation(y,LU),G=F.fromScale(x,C$e),X=F.multiply(Z,G,LU);F.multiply(o,X,o),F.multiply(p,X,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=m,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=g(s,!1),this.hasGeodeticSurfaceNormals=g(a,!1),this.exaggeration=g(c,1),this.exaggerationRelativeHeight=g(l,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}rc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,l=i.y;if(this.quantization===vs.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,Y_),n.x=W.clamp(n.x,0,1),n.y=W.clamp(n.y,0,1),n.z=W.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,m=W.clamp((o-this.minimumHeight)/u,0,1);D.fromElements(n.x,n.y,Au);let p=Kn.compressTextureCoordinates(Au);D.fromElements(n.z,m,Au);let y=Kn.compressTextureCoordinates(Au);D.fromElements(c,l,Au);let f=Kn.compressTextureCoordinates(Au);if(e[t++]=p,e[t++]=y,e[t++]=f,this.hasWebMercatorT){D.fromElements(s,0,Au);let x=Kn.compressTextureCoordinates(Au);e[t++]=x}}else h.subtract(n,this.center,Y_),e[t++]=Y_.x,e[t++]=Y_.y,e[t++]=Y_.z,e[t++]=o,e[t++]=c,e[t++]=l,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Kn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var L$e=new h,Ffe=new h;rc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let m=s*i+u,p=s*r+u;t[p]=e[m]}let a=this.decodePosition(t,s,L$e),c=n.geodeticSurfaceNormal(a,Ffe),l=s*r+this._offsetGeodeticSurfaceNormal;t[l]=c.x,t[l+1]=c.y,t[l+2]=c.z}};rc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};rc.prototype.decodePosition=function(e,t,n){if(d(n)||(n=new h),t*=this.stride,this.quantization===vs.BITS12){let i=Kn.decompressTextureCoordinates(e[t],Au);n.x=i.x,n.y=i.y;let o=Kn.decompressTextureCoordinates(e[t+1],Au);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};rc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Ffe),a=this.decodeHeight(e,t),c=Vc.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};rc.prototype.decodeTextureCoordinates=function(e,t,n){return d(n)||(n=new D),t*=this.stride,this.quantization===vs.BITS12?Kn.decompressTextureCoordinates(e[t+2],n):D.fromElements(e[t+4],e[t+5],n)};rc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===vs.BITS12?Kn.decompressTextureCoordinates(e[t+1],Au).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};rc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===vs.BITS12?Kn.decompressTextureCoordinates(e[t+3],Au).x:e[t+6]};rc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return D.fromElements(o,r,n)};rc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};rc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case vs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var RU={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},ZU={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};rc.prototype.getAttributes=function(e){let t=Q.FLOAT,n=Q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===vs.NONE){s(RU.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(RU.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(RU.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(ZU.compressed0,a?4:3),c&&s(ZU.compressed1,1),this.hasGeodeticSurfaceNormals&&s(ZU.geodeticSurfaceNormal,3)}return r};rc.prototype.getAttributeLocations=function(){return this.quantization===vs.NONE?RU:ZU};rc.clone=function(e,t){if(d(e))return d(t)||(t=new rc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var sc=rc;var Sf={};Sf.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var mJ=new h,R$e=new F,Z$e=new h,G$e=new h;Sf.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=W.PI_OVER_TWO,a=W.toRadians,c=e.heightmap,l=e.width,u=e.height,m=e.skirtHeight,p=m>0,y=g(e.isGeographic,!0),f=g(e.ellipsoid,re.WGS84),x=1/f.maximumRadius,_=de.clone(e.nativeRectangle),C=de.clone(e.rectangle),V,L,Z,G;d(C)?(V=C.west,L=C.south,Z=C.east,G=C.north):y?(V=a(_.west),L=a(_.south),Z=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),Z=_.east*x,G=s-2*o(r(-_.north*x)));let X=e.relativeToCenter,P=d(X);X=P?X:h.ZERO;let v=g(e.includeWebMercatorT,!1),A=g(e.exaggeration,1),M=g(e.exaggerationRelativeHeight,0),R=A!==1,E=g(e.structure,Sf.DEFAULT_STRUCTURE),I=g(E.heightScale,Sf.DEFAULT_STRUCTURE.heightScale),w=g(E.heightOffset,Sf.DEFAULT_STRUCTURE.heightOffset),N=g(E.elementsPerHeight,Sf.DEFAULT_STRUCTURE.elementsPerHeight),Y=g(E.stride,Sf.DEFAULT_STRUCTURE.stride),k=g(E.elementMultiplier,Sf.DEFAULT_STRUCTURE.elementMultiplier),O=g(E.isBigEndian,Sf.DEFAULT_STRUCTURE.isBigEndian),U=de.computeWidth(_),J=de.computeHeight(_),z=U/(l-1),ee=J/(u-1);y||(U*=x,J*=x);let K=f.radiiSquared,j=K.x,q=K.y,be=K.z,Te=65536,ae=-65536,xe=vt.eastNorthUpToFixedFrame(X,f),_e=F.inverseTransformation(xe,R$e),Ve,Ie;v&&(Ve=Ei.geodeticLatitudeToMercatorAngle(L),Ie=1/(Ei.geodeticLatitudeToMercatorAngle(G)-Ve));let Me=Z$e;Me.x=Number.POSITIVE_INFINITY,Me.y=Number.POSITIVE_INFINITY,Me.z=Number.POSITIVE_INFINITY;let ve=G$e;ve.x=Number.NEGATIVE_INFINITY,ve.y=Number.NEGATIVE_INFINITY,ve.z=Number.NEGATIVE_INFINITY;let ke=Number.POSITIVE_INFINITY,ct=l*u,yt=m>0?l*2+u*2:0,ot=ct+yt,ln=new Array(ot),vn=new Array(ot),Dt=new Array(ot),Nt=v?new Array(ot):[],pe=R?new Array(ot):[],Ce=0,Ht=u,ut=0,hi=l;p&&(--Ce,++Ht,--ut,++hi);let ji=1e-5;for(let Qe=Ce;Qe<Ht;++Qe){let pt=Qe;pt<0&&(pt=0),pt>=u&&(pt=u-1);let Bt=_.north-ee*pt;y?Bt=a(Bt):Bt=s-2*o(r(-Bt*x));let Vn=(Bt-L)/(G-L);Vn=W.clamp(Vn,0,1);let di=Qe===Ce,bo=Qe===Ht-1;m>0&&(di?Bt+=ji*J:bo&&(Bt-=ji*J));let es=t(Bt),ts=n(Bt),Mo=be*ts,Ki;v&&(Ki=(Ei.geodeticLatitudeToMercatorAngle(Bt)-Ve)*Ie);for(let ns=ut;ns<hi;++ns){let zn=ns;zn<0&&(zn=0),zn>=l&&(zn=l-1);let wn=pt*(l*Y)+zn*Y,mn;if(N===1)mn=c[wn];else{mn=0;let Ga;if(O)for(Ga=0;Ga<N;++Ga)mn=mn*k+c[wn+Ga];else for(Ga=N-1;Ga>=0;--Ga)mn=mn*k+c[wn+Ga]}mn=mn*I+w,ae=Math.max(ae,mn),Te=Math.min(Te,mn);let _i=_.west+z*zn;y?_i=a(_i):_i=_i*x;let ui=(_i-V)/(Z-V);ui=W.clamp(ui,0,1);let As=pt*l+zn;if(m>0){let Ga=ns===ut,Ch=ns===hi-1,DT=di||bo||Ga||Ch;if((di||bo)&&(Ga||Ch))continue;DT&&(mn-=m,Ga?(As=ct+(u-pt-1),_i-=ji*U):bo?As=ct+u+(l-zn-1):Ch?(As=ct+u+l+pt,_i+=ji*U):di&&(As=ct+u+l+u+zn))}let fi=es*t(_i),vr=es*n(_i),Sh=j*fi,cr=q*vr,qc=1/i(Sh*fi+cr*vr+Mo*ts),pg=Sh*qc,Or=cr*qc,bc=Mo*qc,Dd=new h;Dd.x=pg+fi*mn,Dd.y=Or+vr*mn,Dd.z=bc+ts*mn,F.multiplyByPoint(_e,Dd,mJ),h.minimumByComponent(mJ,Me,Me),h.maximumByComponent(mJ,ve,ve),ke=Math.min(ke,mn),ln[As]=Dd,Dt[As]=new D(ui,Vn),vn[As]=mn,v&&(Nt[As]=Ki),R&&(pe[As]=f.geodeticSurfaceNormal(Dd))}}let pc=ce.fromPoints(ln),bs;d(C)&&(bs=Wn.fromRectangle(C,Te,ae,f));let ys;P&&(ys=new d0(f).computeHorizonCullingPointPossiblyUnderEllipsoid(X,ln,Te));let $r=new ub(Me,ve,X),we=new sc(X,$r,ke,ae,xe,!1,v,R,A,M),je=new Float32Array(ot*we.stride),qe=0;for(let Qe=0;Qe<ot;++Qe)qe=we.encode(je,qe,ln[Qe],Dt[Qe],vn[Qe],void 0,Nt[Qe],pe[Qe]);return{vertices:je,maximumHeight:ae,minimumHeight:Te,encoding:we,boundingSphere3D:pc,orientedBoundingBox:bs,occludeePointInScaledSpace:ys}};var M1=Sf;var sdi=T(S(),1);function Ny(){fe.throwInstantiationError()}Object.defineProperties(Ny.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});Ny.prototype.interpolateHeight=fe.throwInstantiationError;Ny.prototype.isChildAvailable=fe.throwInstantiationError;Ny.prototype.createMesh=fe.throwInstantiationError;Ny.prototype.upsample=fe.throwInstantiationError;Ny.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;Ny.maximumAsynchronousTasks=5;var sh=Ny;var ldi=T(S(),1);function E$e(e,t,n,i,o,r,s,a,c,l,u,m,p,y,f,x){this.center=e,this.vertices=t,this.stride=g(l,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=u,this.encoding=m,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=y,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=x}var Mu=E$e;var pdi=T(S(),1);function Bc(){fe.throwInstantiationError()}Object.defineProperties(Bc.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var Afe=[];Bc.getRegularGridIndices=function(e,t){let n=Afe[e];d(n)||(Afe[e]=n=[]);let i=n[t];return d(i)||(e*t<W.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),kfe(e,t,i,0)),i};var Mfe=[];Bc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Mfe[e];d(n)||(Mfe[e]=n=[]);let i=n[t];if(!d(i)){let o=Bc.getRegularGridIndices(e,t),r=Ufe(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,l=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:l}}return i};var Nfe=[];Bc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Nfe[e];d(n)||(Nfe[e]=n=[]);let i=n[t];if(!d(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,l=r+a,u=Ufe(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,y=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,x=Ue.createTypedArray(c,l);kfe(e,t,x,0),Bc.addSkirtIndices(m,p,y,f,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:y,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Bc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=GU(e,a,r,s),a+=e.length,s=GU(t,a,r,s),a+=t.length,s=GU(n,a,r,s),a+=n.length,GU(i,a,r,s)};function Ufe(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function kfe(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,l=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=l,++o}++o}}function GU(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Bc.heightmapTerrainQuality=.25;Bc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Bc.heightmapTerrainQuality/(t*n)};Bc.prototype.requestTileGeometry=fe.throwInstantiationError;Bc.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Bc.prototype.getTileDataAvailable=fe.throwInstantiationError;Bc.prototype.loadTileDataAvailability=fe.throwInstantiationError;var Ur=Bc;function Z0(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=g(e.childTileMask,15),this._encoding=g(e.encoding,Fu.NONE);let t=M1.DEFAULT_STRUCTURE,n=e.structure;d(n)?n!==t&&(n.heightScale=g(n.heightScale,t.heightScale),n.heightOffset=g(n.heightOffset,t.heightOffset),n.elementsPerHeight=g(n.elementsPerHeight,t.elementsPerHeight),n.stride=g(n.stride,t.stride),n.elementMultiplier=g(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=g(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=g(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Fu.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Z0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Dfe="createVerticesFromHeightmap",X$e=new pi(Dfe),I$e=new pi(Dfe,sh.maximumAsynchronousTasks);Z0.prototype.createMesh=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=g(e.throttle,!0),c=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(de.center(u)),p=this._structure,f=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?I$e:X$e).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:u,relativeToCenter:m,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Zi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!d(_))return;let C=this;return Promise.resolve(_).then(function(V){let L;C._skirtHeight>0?L=Ur.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=Ur.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let Z=V.gridWidth*V.gridHeight;return C._mesh=new Mu(m,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,Z,V.minimumHeight,V.maximumHeight,ce.clone(V.boundingSphere3D),h.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Wn.clone(V.orientedBoundingBox),sc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};Z0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),l=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(de.center(l)),m=this._structure,y=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(y*4,1e3);let f=M1.computeVertices({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:l,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Zi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=Ur.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=Ur.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new Mu(u,f.vertices,x.indices,x.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};Z0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,l=r.isBigEndian,u=r.heightOffset,m=r.heightScale,p=d(this._mesh),y=this._encoding===Fu.LERC;if(!p&&y)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=Bfe(_,C,u,m,e,i,o,t,n)}else x=W$e(this._buffer,a,c,s,l,e,i,o,t,n),x=x*m+u;return x};Z0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!d(a))return;let c=this._width,l=this._height,u=this._structure,m=u.stride,p=new this._bufferType(c*l*m),y=a.vertices,f=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=u.heightOffset,V=u.heightScale,L=u.elementsPerHeight,Z=u.elementMultiplier,G=u.isBigEndian,X=Math.pow(Z,L-1);for(let P=0;P<l;++P){let v=W.lerp(_.north,_.south,P/(l-1));for(let A=0;A<c;++A){let M=W.lerp(_.west,_.east,A/(c-1)),b=Bfe(y,f,C,V,x,c,l,M,v);b=b<u.lowestEncodedHeight?u.lowestEncodedHeight:b,b=b>u.highestEncodedHeight?u.highestEncodedHeight:b,P$e(p,L,Z,X,m,G,P*c+A,b)}}return Promise.resolve(new Z0({buffer:p,width:c,height:l,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Z0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Z0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function W$e(e,t,n,i,o,r,s,a,c,l){let u=(c-r.west)*(s-1)/(r.east-r.west),m=(l-r.south)*(a-1)/(r.north-r.south),p=u|0,y=p+1;y>=s&&(y=s-1,p=s-2);let f=m|0,x=f+1;x>=a&&(x=a-1,f=a-2);let _=u-p,C=m-f;f=a-1-f,x=a-1-x;let V=EU(e,t,n,i,o,f*s+p),L=EU(e,t,n,i,o,f*s+y),Z=EU(e,t,n,i,o,x*s+p),G=EU(e,t,n,i,o,x*s+y);return Yfe(_,C,V,L,Z,G)}function Bfe(e,t,n,i,o,r,s,a,c){let l=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),m=l|0,p=m+1;p>=r&&(p=r-1,m=r-2);let y=u|0,f=y+1;f>=s&&(f=s-1,y=s-2);let x=l-m,_=u-y;y=s-1-y,f=s-1-f;let C=(t.decodeHeight(e,y*r+m)-n)/i,V=(t.decodeHeight(e,y*r+p)-n)/i,L=(t.decodeHeight(e,f*r+m)-n)/i,Z=(t.decodeHeight(e,f*r+p)-n)/i;return Yfe(x,_,C,V,L,Z)}function Yfe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function EU(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function P$e(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Sa=Z0;function N1(e){e=g(e,g.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,d(this._tilingScheme)||(this._tilingScheme=new Di({ellipsoid:g(e.ellipsoid,re.WGS84)})),this._levelZeroMaximumGeometricError=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye}Object.defineProperties(N1.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});N1.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Sa({buffer:new Uint8Array(16*16),width:16,height:16}))};N1.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};N1.prototype.getTileDataAvailable=function(e,t,n){};N1.prototype.loadTileDataAvailability=function(e,t,n){};var Cf=N1;var Bdi=T(S(),1),AP=`uniform vec4 u_initialColor;

#if TEXTURE_UNITS > 0
uniform sampler2D u_dayTextures[TEXTURE_UNITS];
uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];

#ifdef APPLY_ALPHA
uniform float u_dayTextureAlpha[TEXTURE_UNITS];
#endif

#ifdef APPLY_DAY_NIGHT_ALPHA
uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
#endif

#ifdef APPLY_SPLIT
uniform float u_dayTextureSplit[TEXTURE_UNITS];
#endif

#ifdef APPLY_BRIGHTNESS
uniform float u_dayTextureBrightness[TEXTURE_UNITS];
#endif

#ifdef APPLY_CONTRAST
uniform float u_dayTextureContrast[TEXTURE_UNITS];
#endif

#ifdef APPLY_HUE
uniform float u_dayTextureHue[TEXTURE_UNITS];
#endif

#ifdef APPLY_SATURATION
uniform float u_dayTextureSaturation[TEXTURE_UNITS];
#endif

#ifdef APPLY_GAMMA
uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
#endif

#ifdef APPLY_IMAGERY_CUTOUT
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
#endif

#ifdef APPLY_COLOR_TO_ALPHA
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
#endif

uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
#endif

#ifdef SHOW_REFLECTIVE_OCEAN
uniform sampler2D u_waterMask;
uniform vec4 u_waterMaskTranslationAndScale;
uniform float u_zoomedOutOceanSpecularIntensity;
#endif

#ifdef SHOW_OCEAN_WAVES
uniform sampler2D u_oceanNormalMap;
#endif

#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
uniform vec2 u_lightingFadeDistance;
#endif

#ifdef TILE_LIMIT_RECTANGLE
uniform vec4 u_cartographicLimitRectangle;
#endif

#ifdef GROUND_ATMOSPHERE
uniform vec2 u_nightFadeDistance;
#endif

#ifdef ENABLE_CLIPPING_PLANES
uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
uniform float u_minimumBrightness;
#endif

#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift; // Hue, saturation, brightness
#endif

#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif

#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif

#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif

#ifdef ENABLE_VERTEX_LIGHTING
uniform float u_lambertDiffuseMultiplier;
uniform float u_vertexShadowDarkness;
#endif

in vec3 v_positionMC;
in vec3 v_positionEC;
in vec3 v_textureCoordinates;
in vec3 v_normalMC;
in vec3 v_normalEC;

#ifdef APPLY_MATERIAL
in float v_height;
in float v_slope;
in float v_aspect;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
in float v_distance;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG)
in vec3 v_atmosphereRayleighColor;
in vec3 v_atmosphereMieColor;
in float v_atmosphereOpacity;
#endif

#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
    float startDistance = nearFarScalar.x;
    float startValue = nearFarScalar.y;
    float endDistance = nearFarScalar.z;
    float endValue = nearFarScalar.w;
    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
    return mix(startValue, endValue, t);
}
#endif

#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
#endif

#ifdef TRANSLUCENT
bool inTranslucencyRectangle()
{
    return
        v_textureCoordinates.x > u_translucencyRectangle.x &&
        v_textureCoordinates.x < u_translucencyRectangle.z &&
        v_textureCoordinates.y > u_translucencyRectangle.y &&
        v_textureCoordinates.y < u_translucencyRectangle.w;
}
#endif

vec4 sampleAndBlend(
    vec4 previousColor,
    sampler2D textureToSample,
    vec2 tileTextureCoordinates,
    vec4 textureCoordinateRectangle,
    vec4 textureCoordinateTranslationAndScale,
    float textureAlpha,
    float textureNightAlpha,
    float textureDayAlpha,
    float textureBrightness,
    float textureContrast,
    float textureHue,
    float textureSaturation,
    float textureOneOverGamma,
    float split,
    vec4 colorToAlpha,
    float nightBlend)
{
    // This crazy step stuff sets the alpha to 0.0 if this following condition is true:
    //    tileTextureCoordinates.s < textureCoordinateRectangle.s ||
    //    tileTextureCoordinates.s > textureCoordinateRectangle.p ||
    //    tileTextureCoordinates.t < textureCoordinateRectangle.t ||
    //    tileTextureCoordinates.t > textureCoordinateRectangle.q
    // In other words, the alpha is zero if the fragment is outside the rectangle
    // covered by this texture.  Would an actual 'if' yield better performance?
    vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;

    alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;

#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
    textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
#endif

    vec2 translation = textureCoordinateTranslationAndScale.xy;
    vec2 scale = textureCoordinateTranslationAndScale.zw;
    vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
    vec4 value = texture(textureToSample, textureCoordinates);
    vec3 color = value.rgb;
    float alpha = value.a;

#ifdef APPLY_COLOR_TO_ALPHA
    vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
    colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);
    alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
#endif

#if !defined(APPLY_GAMMA)
    vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
    color = tempColor.rgb;
    alpha = tempColor.a;
#else
    color = pow(color, vec3(textureOneOverGamma));
#endif

#ifdef APPLY_SPLIT
    float splitPosition = czm_splitPosition;
    // Split to the left
    if (split < 0.0 && gl_FragCoord.x > splitPosition) {
       alpha = 0.0;
    }
    // Split to the right
    else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
       alpha = 0.0;
    }
#endif

#ifdef APPLY_BRIGHTNESS
    color = mix(vec3(0.0), color, textureBrightness);
#endif

#ifdef APPLY_CONTRAST
    color = mix(vec3(0.5), color, textureContrast);
#endif

#ifdef APPLY_HUE
    color = czm_hue(color, textureHue);
#endif

#ifdef APPLY_SATURATION
    color = czm_saturation(color, textureSaturation);
#endif

    float sourceAlpha = alpha * textureAlpha;
    float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
    outAlpha += sign(outAlpha) - 1.0;

    vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;

    // When rendering imagery for a tile in multiple passes,
    // some GPU/WebGL implementation combinations will not blend fragments in
    // additional passes correctly if their computation includes an unmasked
    // divide-by-zero operation,
    // even if it's not in the output or if the output has alpha zero.
    //
    // For example, without sanitization for outAlpha,
    // this renders without artifacts:
    //   if (outAlpha == 0.0) { outColor = vec3(0.0); }
    //
    // but using czm_branchFreeTernary will cause portions of the tile that are
    // alpha-zero in the additional pass to render as black instead of blending
    // with the previous pass:
    //   outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
    //
    // So instead, sanitize against divide-by-zero,
    // store this state on the sign of outAlpha, and correct on return.

    return vec4(outColor, max(outAlpha, 0.0));
}

vec3 colorCorrect(vec3 rgb) {
#ifdef COLOR_CORRECT
    // Convert rgb color to hsb
    vec3 hsb = czm_RGBToHSB(rgb);
    // Perform hsb shift
    hsb.x += u_hsbShift.x; // hue
    hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation
    hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness
    // Convert shifted hsb back to rgb
    rgb = czm_HSBToRGB(hsb);
#endif
    return rgb;
}

vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);

const float fExposure = 2.0;

vec3 computeEllipsoidPosition()
{
    float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
    vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
    xy *= czm_viewport.zw * mpp * 0.5;

    vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));
    czm_ray ray = czm_ray(vec3(0.0), direction);

    vec3 ellipsoid_center = czm_view[3].xyz;

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);

    vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
    return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
}

void main()
{
#ifdef TILE_LIMIT_RECTANGLE
    if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
        v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
        {
            discard;
        }
#endif

#ifdef ENABLE_CLIPPING_PLANES
    float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
#endif

#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
    vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));   // normalized surface normal in model coordinates
    vec3 normalEC = czm_normal3D * normalMC;                                         // normalized surface normal in eye coordinates
#endif

#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
    float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
#else
    float nightBlend = 0.0;
#endif

    // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
    // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
    // fragments on the edges of tiles even though the vertex shader is outputting
    // coordinates strictly in the 0-1 range.
    vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);

#ifdef SHOW_TILE_BOUNDARIES
    if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
        v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
    {
        color = vec4(1.0, 0.0, 0.0, 1.0);
    }
#endif

#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
    float cameraDist;
    if (czm_sceneMode == czm_sceneMode2D)
    {
        cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
    }
    else if (czm_sceneMode == czm_sceneModeColumbusView)
    {
        cameraDist = -czm_view[3].z;
    }
    else
    {
        cameraDist = length(czm_view[3]);
    }
    float fadeOutDist = u_lightingFadeDistance.x;
    float fadeInDist = u_lightingFadeDistance.y;
    if (czm_sceneMode != czm_sceneMode3D) {
        vec3 radii = czm_ellipsoidRadii;
        float maxRadii = max(radii.x, max(radii.y, radii.z));
        fadeOutDist -= maxRadii;
        fadeInDist -= maxRadii;
    }
    float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
#else
    float fade = 0.0;
#endif

#ifdef SHOW_REFLECTIVE_OCEAN
    vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
    vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
    vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
    waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;

    float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;

    if (mask > 0.0)
    {
        mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);

        vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);
        vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);

        vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));

        color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
    }
#endif

#ifdef APPLY_MATERIAL
    czm_materialInput materialInput;
    materialInput.st = v_textureCoordinates.st;
    materialInput.normalEC = normalize(v_normalEC);
    materialInput.positionToEyeEC = -v_positionEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));     
    materialInput.slope = v_slope;
    materialInput.height = v_height;
    materialInput.aspect = v_aspect;
    czm_material material = czm_getMaterial(materialInput);
    vec4 materialColor = vec4(material.diffuse, material.alpha);
    color = alphaBlend(materialColor, color);
#endif

#ifdef ENABLE_VERTEX_LIGHTING
    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#elif defined(ENABLE_DAYNIGHT_SHADING)
    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
    diffuseIntensity = mix(1.0, diffuseIntensity, fade);
    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#else
    vec4 finalColor = color;
#endif

#ifdef ENABLE_CLIPPING_PLANES
    vec4 clippingPlanesEdgeColor = vec4(1.0);
    clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
    float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;

    if (clipDistance < clippingPlanesEdgeWidth)
    {
        finalColor = clippingPlanesEdgeColor;
    }
#endif

#ifdef HIGHLIGHT_FILL_TILE
    finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
#endif

#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
    vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
    vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif

#if defined(GROUND_ATMOSPHERE) || defined(FOG)
    if (!czm_backFacing())
    {
        bool dynamicLighting = false;
        #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
            dynamicLighting = true;     
        #endif

        vec3 rayleighColor;
        vec3 mieColor;
        float opacity;

        vec3 positionWC;
        vec3 lightDirection;

        // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
        // Otherwise, the scattering is computed in the vertex shader.
        #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
            positionWC = computeEllipsoidPosition();
            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
            computeAtmosphereScattering(
                positionWC,
                lightDirection,
                rayleighColor,
                mieColor,
                opacity
            );
        #else
            positionWC = v_positionMC;
            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
            rayleighColor = v_atmosphereRayleighColor;
            mieColor = v_atmosphereMieColor;
            opacity = v_atmosphereOpacity;
        #endif

        rayleighColor = colorCorrect(rayleighColor);
        mieColor = colorCorrect(mieColor);

        vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);

        // Fog is applied to tiles selected for fog, close to the Earth.
        #ifdef FOG
            vec3 fogColor = groundAtmosphereColor.rgb;
            
            // If there is lighting, apply that to the fog.
            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
                float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
                fogColor *= darken;                
            #endif

            #ifndef HDR
                fogColor.rgb = czm_acesTonemapping(fogColor.rgb);
                fogColor.rgb = czm_inverseGamma(fogColor.rgb);
            #endif
            
            const float modifier = 0.15;
            finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);

        #else
            // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
            // This value is larger near the "circumference", as it is further away from the camera. We use it to
            // brighten up that area of the ground atmosphere.
            const float transmittanceModifier = 0.5;
            float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);

            vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;

            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
                float fadeInDist = u_nightFadeDistance.x;
                float fadeOutDist = u_nightFadeDistance.y;
            
                float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
                float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
                vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);

                finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
            #endif
            
            #ifndef HDR
                finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
            #else
                finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
            #endif
            
            finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
        #endif
    }
#endif

#ifdef UNDERGROUND_COLOR
    if (czm_backFacing())
    {
        float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
        float distance = max(v_distance - distanceFromEllipsoid, 0.0);
        float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
        vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
        finalColor = alphaBlend(undergroundColor, finalColor);
    }
#endif

#ifdef TRANSLUCENT
    if (inTranslucencyRectangle())
    {
      vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
      finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
    }
#endif
    
    out_FragColor =  finalColor;
}


#ifdef SHOW_REFLECTIVE_OCEAN

float waveFade(float edge0, float edge1, float x)
{
    float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
    return pow(1.0 - y, 5.0);
}

float linearFade(float edge0, float edge1, float x)
{
    return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}

// Based on water rendering by Jonas Wagner:
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog

// low altitude wave settings
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;

// high altitude wave settings
const float oceanFrequencyHighAltitude = 125000.0;
const float oceanAnimationSpeedHighAltitude = 0.008;
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;

vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
{
    vec3 positionToEyeEC = -positionEyeCoordinates;
    float positionToEyeECLength = length(positionToEyeEC);

    // The double normalize below works around a bug in Firefox on Android devices.
    vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));

    // Fade out the waves as the camera moves far from the surface.
    float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);

#ifdef SHOW_OCEAN_WAVES
    // high altitude waves
    float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
    vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
    vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);

    // low altitude waves
    time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
    noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
    vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);

    // blend the 2 wave layers based on distance to surface
    float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
    float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
    vec3 normalTangentSpace =
        (highAltitudeFade * normalTangentSpaceHighAltitude) +
        (lowAltitudeFade * normalTangentSpaceLowAltitude);
    normalTangentSpace = normalize(normalTangentSpace);

    // fade out the normal perturbation as we move farther from the water surface
    normalTangentSpace.xy *= waveIntensity;
    normalTangentSpace = normalize(normalTangentSpace);
#else
    vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
#endif

    vec3 normalEC = enuToEye * normalTangentSpace;

    const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);

    // Use diffuse light to highlight the waves
    float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
    vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);

#ifdef SHOW_OCEAN_WAVES
    // Where diffuse light is low or non-existent, use wave highlights based solely on
    // the wave bumpiness and no particular light direction.
    float tsPerturbationRatio = normalTangentSpace.z;
    vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
    vec3 nonDiffuseHighlight = vec3(0.0);
#endif

    // Add specular highlights in 3D, and in all modes when zoomed in.
    float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
    float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
    float specular = specularIntensity * surfaceReflectance;

#ifdef HDR
    specular *= 1.4;

    float e = 0.2;
    float d = 3.3;
    float c = 1.7;

    vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
#else
    vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
#endif

    return vec4(color, imageryColor.a);
}

#endif // #ifdef SHOW_REFLECTIVE_OCEAN
`;var Odi=T(S(),1),MP=`#ifdef QUANTIZATION_BITS12
in vec4 compressed0;
in float compressed1;
#else
in vec4 position3DAndHeight;
in vec4 textureCoordAndEncodedNormals;
#endif

#ifdef GEODETIC_SURFACE_NORMALS
in vec3 geodeticSurfaceNormal;
#endif

#ifdef EXAGGERATION
uniform vec2 u_terrainExaggerationAndRelativeHeight;
#endif

uniform vec3 u_center3D;
uniform mat4 u_modifiedModelView;
uniform mat4 u_modifiedModelViewProjection;
uniform vec4 u_tileRectangle;

// Uniforms for 2D Mercator projection
uniform vec2 u_southAndNorthLatitude;
uniform vec2 u_southMercatorYAndOneOverHeight;

out vec3 v_positionMC;
out vec3 v_positionEC;

out vec3 v_textureCoordinates;
out vec3 v_normalMC;
out vec3 v_normalEC;

#ifdef APPLY_MATERIAL
out float v_slope;
out float v_aspect;
out float v_height;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
out float v_distance;
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE)
out vec3 v_atmosphereRayleighColor;
out vec3 v_atmosphereMieColor;
out float v_atmosphereOpacity;
#endif

// These functions are generated at runtime.
vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
float get2DYPositionFraction(vec2 textureCoordinates);

vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
{
    return u_modifiedModelViewProjection * vec4(position, 1.0);
}

float get2DMercatorYPositionFraction(vec2 textureCoordinates)
{
    // The width of a tile at level 11, in radians and assuming a single root tile, is
    //   2.0 * czm_pi / pow(2.0, 11.0)
    // We want to just linearly interpolate the 2D position from the texture coordinates
    // when we're at this level or higher.  The constant below is the expression
    // above evaluated and then rounded up at the 4th significant digit.
    const float maxTileWidth = 0.003068;
    float positionFraction = textureCoordinates.y;
    float southLatitude = u_southAndNorthLatitude.x;
    float northLatitude = u_southAndNorthLatitude.y;
    if (northLatitude - southLatitude > maxTileWidth)
    {
        float southMercatorY = u_southMercatorYAndOneOverHeight.x;
        float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;

        float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
        currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
        positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
    }
    return positionFraction;
}

float get2DGeographicYPositionFraction(vec2 textureCoordinates)
{
    return textureCoordinates.y;
}

vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
{
    float yPositionFraction = get2DYPositionFraction(textureCoordinates);
    vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
    return u_modifiedModelViewProjection * rtcPosition2D;
}

vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
{
    return getPositionPlanarEarth(position, 0.0, textureCoordinates);
}

vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
{
    return getPositionPlanarEarth(position, height, textureCoordinates);
}

vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
{
    // We do not do RTC while morphing, so there is potential for jitter.
    // This is unlikely to be noticeable, though.
    vec3 position3DWC = position + u_center3D;
    float yPositionFraction = get2DYPositionFraction(textureCoordinates);
    vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
    vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
    return czm_modelViewProjection * morphPosition;
}

#ifdef QUANTIZATION_BITS12
uniform vec2 u_minMaxHeight;
uniform mat4 u_scaleAndBias;
#endif

void main()
{
#ifdef QUANTIZATION_BITS12
    vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
    vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
    vec3 position = vec3(xy, zh.x);
    float height = zh.y;
    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);

    height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
    position = (u_scaleAndBias * vec4(position, 1.0)).xyz;

#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
    float encodedNormal = compressed1;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
    float encodedNormal = 0.0;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = compressed0.w;
#else
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = 0.0;
#endif

#else
    // A single float per element
    vec3 position = position3DAndHeight.xyz;
    float height = position3DAndHeight.w;
    vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;

#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = textureCoordAndEncodedNormals.z;
    float encodedNormal = textureCoordAndEncodedNormals.w;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = textureCoordAndEncodedNormals.z;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
    float webMercatorT = textureCoordAndEncodedNormals.z;
    float encodedNormal = 0.0;
#else
    float webMercatorT = textureCoordinates.y;
    float encodedNormal = 0.0;
#endif

#endif

    vec3 position3DWC = position + u_center3D;

#ifdef GEODETIC_SURFACE_NORMALS
    vec3 ellipsoidNormal = geodeticSurfaceNormal;
#else
    vec3 ellipsoidNormal = normalize(position3DWC);
#endif

#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
    float exaggeration = u_terrainExaggerationAndRelativeHeight.x;
    float relativeHeight = u_terrainExaggerationAndRelativeHeight.y;
    float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;

    // stop from going through center of earth
    float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
    newHeight = max(newHeight, -minRadius);

    vec3 offset = ellipsoidNormal * (newHeight - height);
    position += offset;
    position3DWC += offset;
    height = newHeight;
#endif

    gl_Position = getPosition(position, height, textureCoordinates);

    v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
    v_positionMC = position3DWC;  // position in model coordinates

    v_textureCoordinates = vec3(textureCoordinates, webMercatorT);

#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
    vec3 normalMC = czm_octDecode(encodedNormal);

#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
    vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
    vec3 rejection = normalMC - projection;
    normalMC = normalize(projection + rejection * exaggeration);
#endif

    v_normalMC = normalMC;
    v_normalEC = czm_normal3D * v_normalMC;
#endif

#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))

    bool dynamicLighting = false;

    #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
        dynamicLighting = true;
    #endif

#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
    vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
    vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif

    vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));

    computeAtmosphereScattering(
        position3DWC,
        lightDirection,
        v_atmosphereRayleighColor,
        v_atmosphereMieColor,
        v_atmosphereOpacity
    );
#endif

#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
    v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
#endif

#ifdef APPLY_MATERIAL
    float northPoleZ = czm_ellipsoidRadii.z;
    vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
    vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
    float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
    v_slope = acos(dotProd);
    vec3 normalRejected = ellipsoidNormal * dotProd;
    vec3 normalProjected = v_normalMC - normalRejected;
    vec3 aspectVector = normalize(normalProjected);
    v_aspect = acos(dot(aspectVector, vectorEastMC));
    float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
    v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
    v_height = height;
#endif
}
`;var Hdi=T(S(),1),G0=`uniform vec3 u_radiiAndDynamicAtmosphereColor;

uniform float u_atmosphereLightIntensity;
uniform float u_atmosphereRayleighScaleHeight;
uniform float u_atmosphereMieScaleHeight;
uniform float u_atmosphereMieAnisotropy;
uniform vec3 u_atmosphereRayleighCoefficient;
uniform vec3 u_atmosphereMieCoefficient;

const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

/**
 * Rational approximation to tanh(x)
*/
float approximateTanh(float x) {
    float x2 = x * x;
    return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
}

/**
 * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
 * the transmittance value for the ray.
 *
 * @param {czm_ray} primaryRay The ray from the camera to the position.
 * @param {float} primaryRayLength The length of the primary ray.
 * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
 * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
 * @param {vec3} mieColor The variable the Mie scattering will be written to.
 * @param {float} opacity The variable the transmittance will be written to.
 * @glslFunction
 */
void computeScattering(
    czm_ray primaryRay,
    float primaryRayLength,
    vec3 lightDirection,
    float atmosphereInnerRadius,
    out vec3 rayleighColor,
    out vec3 mieColor,
    out float opacity
) {

    // Initialize the default scattering amounts to 0.
    rayleighColor = vec3(0.0);
    mieColor = vec3(0.0);
    opacity = 0.0;

    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;

    vec3 origin = vec3(0.0);

    // Calculate intersection from the camera to the outer ring of the atmosphere.
    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);

    // Return empty colors if no intersection with the atmosphere geometry.
    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
        return;
    }

    // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
    // we implement a split strategy: sky or horizon.
    // For performance reasons, instead of a if/else branch
    // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
    float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
    // Value close to 0.0: close to the horizon
    // Value close to 1.0: above in the sky
    float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x));
    
    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
    float start_0 = primaryRayAtmosphereIntersect.start;
    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));

    // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
    // (1) from outer space we have to use more ray steps to get a realistic rendering
    // (2) within atmosphere we need fewer steps for faster rendering
    float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
    float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a));
    int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
    int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.

    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
    float rayPositionLength = primaryRayAtmosphereIntersect.start;
    // (1) Outside the atmosphere: constant rayStepLength
    // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
    float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
    float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
    float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));

    vec3 rayleighAccumulation = vec3(0.0);
    vec3 mieAccumulation = vec3(0.0);
    vec2 opticalDepth = vec2(0.0);
    vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);

    // Sample positions on the primary ray.
    for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {

        // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to break early instead
        if (i >= PRIMARY_STEPS) {
            break;
        }

        // Calculate sample position along viewpoint ray.
        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);

        // Calculate height of sample position above ellipsoid.
        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;

        // Calculate and accumulate density of particles at the sample position.
        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
        opticalDepth += sampleDensity;

        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
        czm_ray lightRay = czm_ray(samplePosition, lightDirection);
        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);

        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
        float lightPositionLength = 0.0;

        vec2 lightOpticalDepth = vec2(0.0);

        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
        for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {

            // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (j >= LIGHT_STEPS) {
                break;
            }

            // Calculate sample position along light ray.
            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);

            // Calculate height of the light sample position above ellipsoid.
            float lightHeight = length(lightPosition) - atmosphereInnerRadius;

            // Calculate density of photons at the light sample position.
            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;

            // Increment distance on light ray.
            lightPositionLength += lightStepLength;
        }

        // Compute attenuation via the primary ray and the light ray.
        vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));

        // Accumulate the scattering.
        rayleighAccumulation += sampleDensity.x * attenuation;
        mieAccumulation += sampleDensity.y * attenuation;

        // Increment distance on primary ray.
        rayPositionLength += (rayStepLength += rayStepLengthIncrease);
    }

    // Compute the scattering amount.
    rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
    mieColor = u_atmosphereMieCoefficient * mieAccumulation;

    // Compute the transmittance i.e. how much light is passing through the atmosphere.
    opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
}

vec4 computeAtmosphereColor(
    vec3 positionWC,
    vec3 lightDirection,
    vec3 rayleighColor,
    vec3 mieColor,
    float opacity
) {
    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);

    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
    float cosAngleSq = cosAngle * cosAngle;

    float G = u_atmosphereMieAnisotropy;
    float GSq = G * G;

    // The Rayleigh phase function.
    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
    // The Mie phase function.
    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));

    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
    vec3 rayleigh = rayleighPhase * rayleighColor;
    vec3 mie = miePhase * mieColor;

    vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;

    return vec4(color, opacity);
}
`;var Jdi=T(S(),1),U1=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {

    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
    
    float atmosphereInnerRadius = length(positionWC);

    computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );
}
`;var aui=T(S(),1);var $di=T(S(),1);var v$e=new D;function w$e(e,t){let n=e.unionClippingRegions,i=e.length,o=ss.useFloatTexture(t),r=ss.getTextureResolution(e,t,v$e),s=r.x,a=r.y,c=o?M$e(s,a):N$e(s,a);return c+=`
`,c+=n?F$e(i):A$e(i),c}function F$e(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float clipAmount;
    float pixelWidth = czm_metersPerPixel(position);
    bool breakAndDiscard = false;
    for (int i = 0; i < ${e}; ++i)
    {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
        if (amount <= 0.0)
        {
           breakAndDiscard = true;
           break;
        }
    }
    if (breakAndDiscard) {
        discard;
    }
    return clipAmount;
}
`}function A$e(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
    bool clipped = true;
    vec4 position = czm_windowToEyeCoordinates(fragCoord);
    vec3 clipNormal = vec3(0.0);
    vec3 clipPosition = vec3(0.0);
    float clipAmount = 0.0;
    float pixelWidth = czm_metersPerPixel(position);
    for (int i = 0; i < ${e}; ++i)
    {
        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
        clipNormal = clippingPlane.xyz;
        clipPosition = -clippingPlane.w * clipNormal;
        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
        clipAmount = max(amount, clipAmount);
        clipped = clipped && (amount <= 0.0);
    }
    if (clipped)
    {
        discard;
    }
    return clipAmount;
}
`}function M$e(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
    int pixY = clippingPlaneNumber / ${e};
    int pixX = clippingPlaneNumber - (pixY * ${e});
    float u = (float(pixX) + 0.5) * ${o};
    float v = (float(pixY) + 0.5) * ${r};
    vec4 plane = texture(packedClippingPlanes, vec2(u, v));
    return czm_transformPlane(plane, transform);
}
`}function N$e(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
    int clippingPlaneStartIndex = clippingPlaneNumber * 2;
    int pixY = clippingPlaneStartIndex / ${e};
    int pixX = clippingPlaneStartIndex - (pixY * ${e});
    float u = (float(pixX) + 0.5) * ${o};
    float v = (float(pixY) + 0.5) * ${r};
    vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
    vec4 plane;
    plane.xyz = czm_octDecode(oct, 65535.0);
    plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
    return czm_transformPlane(plane, transform);
}
`}var E0=w$e;function U$e(e,t,n,i,o){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o}function hJ(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function k$e(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ie.SCENE3D:o=t;break;case ie.SCENE2D:case ie.COLUMBUS_VIEW:o=n;break;case ie.MORPHING:o=i;break}return o}function D$e(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}hJ.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,l=e.applyAlpha,u=e.applyDayNightAlpha,m=e.applySplit,p=e.showReflectiveOcean,y=e.showOceanWaves,f=e.enableLighting,x=e.dynamicAtmosphereLighting,_=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,V=e.perFragmentGroundAtmosphere,L=e.hasVertexNormals,Z=e.useWebMercatorProjection,G=e.enableFog,X=e.enableClippingPlanes,P=e.clippingPlanes,v=e.clippedByBoundaries,A=e.hasImageryLayerCutout,M=e.colorCorrect,b=e.highlightFillTile,R=e.colorToAlpha,E=e.hasGeodeticSurfaceNormals,I=e.hasExaggeration,w=e.showUndergroundColor,N=e.translucent,Y=0,k="",U=n.renderedMesh.encoding;U.quantization===vs.BITS12&&(Y=1,k="QUANTIZATION_BITS12");let z=0,ee="";v&&(z=1,ee="TILE_LIMIT_RECTANGLE");let K=0,j="";A&&(K=1,j="APPLY_IMAGERY_CUTOUT");let q=t.mode,be=q|o<<2|r<<3|s<<4|a<<5|c<<6|l<<7|p<<8|y<<9|f<<10|x<<11|_<<12|C<<13|V<<14|L<<15|Z<<16|G<<17|Y<<18|m<<19|X<<20|z<<21|K<<22|M<<23|b<<24|R<<25|E<<26|I<<27|w<<28|N<<29|u<<30,Te=0;d(P)&&P.length>0&&(Te=X?P.clippingPlanesState:0);let ae=n.surfaceShader;if(d(ae)&&ae.numberOfDayTextures===i&&ae.flags===be&&ae.material===this.material&&ae.clippingShaderState===Te)return ae.shaderProgram;let xe=this._shadersByTexturesFlags[i];if(d(xe)||(xe=this._shadersByTexturesFlags[i]=[]),ae=xe[be],!d(ae)||ae.material!==this.material||ae.clippingShaderState!==Te){let _e=this.baseVertexShaderSource.clone(),Ve=this.baseFragmentShaderSource.clone();Te!==0&&Ve.sources.unshift(E0(P,t.context)),_e.defines.push(k),Ve.defines.push(`TEXTURE_UNITS ${i}`,ee,j),o&&Ve.defines.push("APPLY_BRIGHTNESS"),r&&Ve.defines.push("APPLY_CONTRAST"),s&&Ve.defines.push("APPLY_HUE"),a&&Ve.defines.push("APPLY_SATURATION"),c&&Ve.defines.push("APPLY_GAMMA"),l&&Ve.defines.push("APPLY_ALPHA"),u&&Ve.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Ve.defines.push("SHOW_REFLECTIVE_OCEAN"),_e.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&Ve.defines.push("SHOW_OCEAN_WAVES"),R&&Ve.defines.push("APPLY_COLOR_TO_ALPHA"),w&&(_e.defines.push("UNDERGROUND_COLOR"),Ve.defines.push("UNDERGROUND_COLOR")),N&&(_e.defines.push("TRANSLUCENT"),Ve.defines.push("TRANSLUCENT")),f&&(L?(_e.defines.push("ENABLE_VERTEX_LIGHTING"),Ve.defines.push("ENABLE_VERTEX_LIGHTING")):(_e.defines.push("ENABLE_DAYNIGHT_SHADING"),Ve.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(_e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),_&&(_e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(_e.defines.push("GROUND_ATMOSPHERE"),Ve.defines.push("GROUND_ATMOSPHERE"),V&&(_e.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ve.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),_e.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ve.defines.push("INCLUDE_WEB_MERCATOR_Y"),G&&(_e.defines.push("FOG"),Ve.defines.push("FOG")),m&&Ve.defines.push("APPLY_SPLIT"),X&&Ve.defines.push("ENABLE_CLIPPING_PLANES"),M&&Ve.defines.push("COLOR_CORRECT"),b&&Ve.defines.push("HIGHLIGHT_FILL_TILE"),E&&_e.defines.push("GEODETIC_SURFACE_NORMALS"),I&&_e.defines.push("EXAGGERATION");let Ie=`    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
    {
        vec4 color = initialColor;
`;A&&(Ie+=`        vec4 cutoutAndColorResult;
        bool texelUnclipped;
`);for(let ve=0;ve<i;++ve)A?Ie+=`        cutoutAndColorResult = u_dayTextureCutoutRectangles[${ve}];
        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
        cutoutAndColorResult = sampleAndBlend(
`:Ie+=`        color = sampleAndBlend(
`,Ie+=`            color,
            u_dayTextures[${ve}],
            u_dayTextureUseWebMercatorT[${ve}] ? textureCoordinates.xz : textureCoordinates.xy,
            u_dayTextureTexCoordsRectangle[${ve}],
            u_dayTextureTranslationAndScale[${ve}],
            ${l?`u_dayTextureAlpha[${ve}]`:"1.0"},
            ${u?`u_dayTextureNightAlpha[${ve}]`:"1.0"},
${u?`u_dayTextureDayAlpha[${ve}]`:"1.0"},
${o?`u_dayTextureBrightness[${ve}]`:"0.0"},
            ${r?`u_dayTextureContrast[${ve}]`:"0.0"},
            ${s?`u_dayTextureHue[${ve}]`:"0.0"},
            ${a?`u_dayTextureSaturation[${ve}]`:"0.0"},
            ${c?`u_dayTextureOneOverGamma[${ve}]`:"0.0"},
            ${m?`u_dayTextureSplit[${ve}]`:"0.0"},
            ${R?`u_colorsToAlpha[${ve}]`:"vec4(0.0)"},
        nightBlend        );
`,A&&(Ie+=`        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);Ie+=`        return color;
    }`,Ve.sources.push(Ie),_e.sources.push(k$e(q)),_e.sources.push(D$e(Z));let Me=Qt.fromCache({context:t.context,vertexShaderSource:_e,fragmentShaderSource:Ve,attributeLocations:U.getAttributeLocations()});ae=xe[be]=new U$e(i,be,this.material,Me,Te)}return n.surfaceShader=ae,ae.shaderProgram};hJ.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!d(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],d(t)&&t.shaderProgram.destroy())}return ue(this)};var NP=hJ;var eyi=T(S(),1);var lui=T(S(),1),B$e={NONE:-1,PARTIAL:0,FULL:1},sr=Object.freeze(B$e);var Jui=T(S(),1);var fui=T(S(),1);function XU(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=g(r,0),this.retry=!1,this.error=s}XU.reportError=function(e,t,n,i,o,r,s,a){let c=e;return d(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new XU(t,i,o,r,s,0,a),d(n)&&n.numberOfListeners>0?n.raiseEvent(c):d(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Tf(i)}`),c};XU.reportSuccess=function(e){d(e)&&(e.timesRetried=-1)};var Vo=XU;var bui=T(S(),1),Y$e={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ci=Object.freeze(Y$e);var gui=T(S(),1),O$e={START:0,LOADING:1,DONE:2,FAILED:3},ws=Object.freeze(O$e);var _ui=T(S(),1),K$e={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},ao=Object.freeze(K$e);function Qo(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=ao.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ce,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Qo.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===ao.RECEIVING||e===ao.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!d(s.loadingImagery)||s.loadingImagery.state!==ci.TRANSITIONING}return n}},renderedMesh:{get:function(){if(d(this.vertexArray))return this.mesh;if(d(this.fill))return this.fill.mesh}}});var H$e=new he;function fJ(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(d(t)&&t!==ie.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,H$e);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var z$e=new h,J$e=new h,Q$e=new h;Qo.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!d(r))return;let s=r.vertices,a=r.indices,c=r.encoding,l=a.length,u=Number.MAX_VALUE;for(let m=0;m<l;m+=3){let p=a[m],y=a[m+1],f=a[m+2],x=fJ(c,t,n,s,p,z$e),_=fJ(c,t,n,s,y,J$e),C=fJ(c,t,n,s,f,Q$e),V=Si.rayTriangleParametric(e,x,_,C,i);d(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?Sn.getPoint(e,u,o):void 0};Qo.prototype.freeResources=function(){d(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=ao.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Qo.prototype.freeVertexArray=function(){Qo._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Qo._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Qo.initialize=function(e,t,n){let i=e.data;d(i)||(i=e.data=new Qo),e.state===ws.START&&(j$e(e,t,n),e.state=ws.LOADING)};Qo.processStateMachine=function(e,t,n,i,o,r,s){Qo.initialize(e,n,i);let a=e.data;if(e.state===ws.LOADING&&q$e(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=d(a.vertexArray);let l=a.terrainState===ao.READY;e.upsampledFromParent=d(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(l&&u){let m=e._loadedCallbacks,p={};for(let y in m)m.hasOwnProperty(y)&&(m[y](e)||(p[y]=m[y]));e._loadedCallbacks=p,e.state=ws.DONE}c&&(e.renderable=!0)};Qo.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,l,u;for(l=0,u=c.length;l<u;++l){let m=c[l];if(!d(m.loadingImagery)){r=!1;continue}if(m.loadingImagery.state===ci.PLACEHOLDER){let y=m.loadingImagery.imageryLayer;if(y.ready){m.freeResources(),c.splice(l,1),y._createTileImagerySkeletons(e,t,l),--l,u=c.length;continue}else r=!1}let p=m.processStateMachine(e,n,i);a=a&&p,s=s||p||d(m.readyImagery),r=r&&d(m.loadingImagery)&&(m.loadingImagery.state===ci.FAILED||m.loadingImagery.state===ci.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Ofe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=sc.clone(s);c.hasGeodeticSurfaceNormals=t,c=sc.clone(c);let l=c.stride,u=new Float32Array(a*l);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=l,o!==e.mesh?(Qo._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Qo._createVertexArrayForMesh(i.context,o)):(Qo._freeVertexArray(e.vertexArray),e.vertexArray=Qo._createVertexArrayForMesh(i.context,o)),Qo._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Qo.prototype.addGeodeticSurfaceNormals=function(e,t){Ofe(this,!0,e,t)};Qo.prototype.removeGeodeticSurfaceNormals=function(e){Ofe(this,!1,void 0,e)};Qo.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.terrainExaggeration,s=t.terrainExaggerationRelativeHeight,a=r!==1,c=o.encoding,l=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(l||u){if(l)if(a&&!c.hasGeodeticSurfaceNormals){let m=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(m,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let m=e.customData,p=m.length;for(let y=0;y<p;y++){let f=m[y];f.level=-1}}}};function j$e(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!d(i)&&d(e.parent)){let o=e.parent,r=o.data;d(r)&&d(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=ao.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function q$e(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===ao.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Qo.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===ao.FAILED&&$$e(s,e,t,n,e.x,e.y,e.level),s.terrainState===ao.UNLOADED&&eet(s,n,e.x,e.y,e.level),s.terrainState===ao.RECEIVED&&net(s,t,n,e.x,e.y,e.level),s.terrainState===ao.TRANSFORMED&&(iet(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=ao.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)ret(t.context,s);else{let l=s._findAncestorTileWithTerrainData(e);d(l)&&d(l.data.waterMaskTexture)&&(s.waterMaskTexture=l.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,l,s.waterMaskTranslationAndScale))}}function $$e(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ws.FAILED;return}let c=a.data.terrainData,l=a.x,u=a.y,m=a.level;if(!d(c))return;let p=c.upsample(i.tilingScheme,l,u,m,o,r,s);d(p)&&(e.terrainState=ao.RECEIVING,Promise.resolve(p).then(function(y){d(y)&&(e.terrainData=y,e.terrainState=ao.RECEIVED)}).catch(function(){e.terrainState=ao.FAILED}))}function eet(e,t,n,i,o){function r(c){if(!d(c)){e.terrainState=ao.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=ao.RECEIVED,e.request=void 0}function s(c){if(e.request.state===$n.CANCELLED){e.terrainData=void 0,e.terrainState=ao.UNLOADED,e.request=void 0;return}e.terrainState=ao.FAILED,e.request=void 0;let l=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Vo.reportError(t._requestError,t,t.errorEvent,l,n,i,o),t._requestError.retry&&a()}function a(){let c=new Uo({throttle:!1,throttleByServer:!0,type:Jr.TERRAIN});e.request=c;let l=t.requestTileGeometry(n,i,o,c);d(l)?(e.terrainState=ao.RECEIVING,Promise.resolve(l).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=ao.UNLOADED,e.request=void 0)}a()}var tet={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function net(e,t,n,i,o,r){let s=n.tilingScheme,a=tet;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.terrainExaggeration,a.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,a.throttle=!0;let l=e.terrainData.createMesh(a);d(l)&&(e.terrainState=ao.TRANSFORMING,Promise.resolve(l).then(function(u){e.mesh=u,e.terrainState=ao.TRANSFORMED}).catch(function(){e.terrainState=ao.FAILED}))}Qo._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=mt.createVertexBuffer({context:e,typedArray:n,usage:Ne.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!d(s)||s.isDestroyed()){let a=t.indices;s=mt.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ni({context:e,attributes:o,indexBuffer:s})};Qo._freeVertexArray=function(e){if(d(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),d(t)&&!t.isDestroyed()&&d(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function iet(e,t,n,i,o,r,s){e.vertexArray=Qo._createVertexArrayForMesh(t,e.mesh),e.terrainState=ao.READY,e.fill=e.fill&&e.fill.destroy(s)}function oet(e){let t=e.cache.tile_waterMaskData;if(!d(t)){let n=Wt.create({context:e,pixelFormat:st.LUMINANCE,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function ret(e,t){let n=t.terrainData.waterMask,i=oet(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Wt.create({context:e,pixelFormat:st.LUMINANCE,pixelDatatype:Je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Qo.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;d(t)&&(!d(t.data)||!d(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Qo.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var Nu=Qo;var G0i=T(S(),1);var Epi=T(S(),1);var Spi=T(S(),1);var Hmi=T(S(),1);var imi=T(S(),1);function Uy(e){if(e=g(e,g.EMPTY_OBJECT),this._ellipsoid=g(e.ellipsoid,re.WGS84),this._numberOfLevelZeroTilesX=g(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=g(e.numberOfLevelZeroTilesY,1),this._projection=new Ei(this._ellipsoid),d(e.rectangleSouthwestInMeters)&&d(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new de(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Uy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Uy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Uy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Uy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(de.southwest(e)),o=n.project(de.northeast(e));return d(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new de(i.x,i.y,o.x,o.y)};Uy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,l=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*l,m=this._rectangleNortheastInMeters.y-(t+1)*l;return d(i)?(i.west=a,i.south=m,i.east=c,i.north=u,i):new de(a,m,c,u)};Uy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new D(o.west,o.south)),a=r.unproject(new D(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};Uy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,l=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,m=this._projection.project(e),p=m.x-this._rectangleSouthwestInMeters.x,y=this._rectangleNortheastInMeters.y-m.y,f=p/a|0;f>=o&&(f=o-1);let x=y/l|0;return x>=r&&(x=r-1),d(n)?(n.x=f,n.y=x,n):new D(f,x)};var kr=Uy;var cmi=T(S(),1);var pJ,Kfe="AAPK4db83df15a06415e9b7d45d826eec992u0REAmuLmykhOFOk_4e61HgsO_e3C_qGUgiWNGElpjpiMfO9_Qg5ZRyy8POvB5EF",k1={};k1.defaultAccessToken=Kfe;k1.defaultWorldImageryServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});k1.defaultWorldHillshadeServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});k1.defaultWorldOceanServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});k1.getDefaultTokenCredit=function(e){if(e===Kfe){if(!d(pJ)){let t='<b>             This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i>             with an API key from your ArcGIS Developer account before using the ArcGIS tile services.             You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';pJ=new St(t,!0)}return pJ}};var Rd=k1;var fmi=T(S(),1);function bJ(e){e=g(e,g.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ee.createIfNeeded(e.missingImageUrl),n=this;function i(r){d(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=nm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,l=e.pixelsToCheck;for(let u=0,m=l.length;a&&u<m;++u){let p=l[u],y=p.x*4+p.y*c;s[y+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}bJ.prototype.isReady=function(){return this._isReady};bJ.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!d(n)||d(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=nm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let l=0;l<4;++l){let u=c+l;if(i[u]!==n[u])return!1}}return!0};var UP=bJ;var ymi=T(S(),1);function yJ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}yJ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}d(n)&&(this.name=e[n])};yJ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];d(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var ah=yJ;var Cmi=T(S(),1);function D1(){fe.throwInstantiationError()}Object.defineProperties(D1.prototype,{rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError}});D1.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};D1.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};D1.prototype.pickFeatures=function(e,t,n,i,o){fe.throwInstantiationError()};var set=/\.ktx2$/i;D1.loadImage=function(e,t){let n=Ee.createIfNeeded(t);return set.test(n.url)?rl(n):d(e)&&d(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Yc=D1;var Lmi=T(S(),1),aet={SATELLITE:1,OCEANS:2,HILLSHADE:3},ch=Object.freeze(aet);function Hfe(e){this.useTiles=g(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=g(e.tilingScheme,new Di({ellipsoid:t})),this.rectangle=g(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new St(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=g(e.tileWidth,256),this.tileHeight=g(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Hfe.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!d(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new UP({missingImageUrl:zfe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function cet(e,t){let n=e.tileInfo;if(!d(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new kr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Di({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new me(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,d(e.fullExtent)){if(d(e.fullExtent.spatialReference)&&d(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ei,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new de(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=de.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new me(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}d(e.copyrightText)&&e.copyrightText.length>0&&(d(t.credit)?t.tileCredits=[new St(e.copyrightText)]:t.credit=new St(e.copyrightText))}function det(e,t){let n=`An error occurred while accessing ${e.url}`;throw d(t)&&d(t.message)&&(n+=`: ${t.message}`),new me(n)}async function uet(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();cet(i,t)}catch(i){det(e,i)}}function Vf(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=g(e.tilingScheme,new Di({ellipsoid:e.ellipsoid})),this._useTiles=g(e.usePreCachedTilesIfAvailable,!0),this._rectangle=g(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new St(t)),this.enablePickFeatures=g(e.enablePickFeatures,!0),this._errorEvent=new ye}Vf.fromBasemapType=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n,i,o;switch(e){case ch.SATELLITE:{n=g(t.token,Rd.defaultAccessToken),i=Ee.createIfNeeded(Rd.defaultWorldImageryServer),i.appendForwardSlash();let r=Rd.getDefaultTokenCredit(n);d(r)&&(o=St.clone(r))}break;case ch.OCEANS:{n=g(t.token,Rd.defaultAccessToken),i=Ee.createIfNeeded(Rd.defaultWorldOceanServer),i.appendForwardSlash();let r=Rd.getDefaultTokenCredit(n);d(r)&&(o=St.clone(r))}break;case ch.HILLSHADE:{n=g(t.token,Rd.defaultAccessToken),i=Ee.createIfNeeded(Rd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Rd.getDefaultTokenCredit(n);d(r)&&(o=St.clone(r))}break;default:}return Vf.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function zfe(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Zi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Vf.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Vf.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),d(t.token)&&n.setQueryParameters({token:t.token});let i=new Vf(t);i._resource=n;let o=new Hfe(t);return g(t.usePreCachedTilesIfAvailable,!0)&&await uet(n,o),o.build(i),i};Vf.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Vf.prototype.requestImage=function(e,t,n,i){return Yc.loadImage(this,zfe(this,e,t,n,i))};Vf.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Zi)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let l="visible";d(this._layers)&&(l+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:l};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let y=[],f=p.results;if(!d(f))return y;for(let x=0;x<f.length;++x){let _=f[x],C=new ah;if(C.data=_,C.name=_.value,C.properties=_.attributes,C.configureDescriptionFromProperties(_.attributes),_.geometryType==="esriGeometryPoint"&&_.geometry){let V=_.geometry.spatialReference&&_.geometry.spatialReference.wkid?_.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)C.position=he.fromDegrees(_.geometry.x,_.geometry.y,_.geometry.z);else if(V===102100||V===900913||V===3857){let L=new Ei;C.position=L.unproject(new h(_.geometry.x,_.geometry.y,_.geometry.z))}}y.push(C)}return y})};Vf._metadataCache={};var X0=Vf;var fhi=T(S(),1);var Jmi=T(S(),1),met={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},B1=Object.freeze(met);var qmi=T(S(),1);function kP(e){}kP.prototype.isReady=function(){return!0};kP.prototype.shouldDiscardImage=function(e){return kP.EMPTY_IMAGE===e};var IU;Object.defineProperties(kP,{EMPTY_IMAGE:{get:function(){return d(IU)||(IU=new Image,IU.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),IU}}});var Y1=kP;function Jfe(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Jfe.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof St)break;o.credit=new St(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],l=c.bbox;c.bbox=new de(W.toRadians(l[1]),W.toRadians(l[0]),W.toRadians(l[3]),W.toRadians(l[2]))}}};function het(e,t){if(e.resourceSets.length!==1)throw new me("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function fet(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw d(t)&&d(t.message)&&(i+=`: ${t.message}`),Vo.reportError(void 0,n,d(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new me(i)}async function pet(e,t,n){let i=e.url,o=ms._metadataCache[i];d(o)||(o=e.fetchJsonp("jsonp"),ms._metadataCache[i]=o);try{let r=await o;return het(r,t)}catch(r){fet(e,r,n)}}function ms(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=g(e.mapStyle,B1.AERIAL),this._culture=g(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,d(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Y1),this._proxy=e.proxy,this._credit=new St(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${ms.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new kr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new ye}Object.defineProperties(ms.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});ms.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=t.tileProtocol;d(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=g(t.mapStyle,B1.AERIAL),o=Ee.createIfNeeded(e);o.appendForwardSlash();let r=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:{incl:"ImageryProviders",key:t.key,uriScheme:n}}),s=new ms(t);s._resource=o;let a=new Jfe(t);return await pet(r,a),a.build(s),s};var bet=new de;ms.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,bet);return xet(this._attributionList,n,i)};ms.prototype.requestImage=function(e,t,n,i){let o=Yc.loadImage(this,yet(this,e,t,n,i));if(d(o))return o.catch(function(r){return d(r.blob)&&r.blob.size===0?Y1.EMPTY_IMAGE:Promise.reject(r)})};ms.prototype.pickFeatures=function(e,t,n,i,o){};ms.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};ms.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};ms._logoUrl=void 0;Object.defineProperties(ms,{logoUrl:{get:function(){return d(ms._logoUrl)||(ms._logoUrl=$t("Assets/Images/bing_maps_credit.png")),ms._logoUrl},set:function(e){ms._logoUrl=e}}});function yet(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:ms.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var get=new de;function xet(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let l=0,u=s.coverageAreas.length;!c&&l<u;++l){let m=a[l];if(t>=m.zoomMin&&t<=m.zoomMax){let p=de.intersection(n,m.bbox,get);d(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ms._metadataCache={};var DP=ms;var Ohi=T(S(),1);var Xhi=T(S(),1);var Qfe=/{[^}]+}/g,jfe={x:Vet,y:Ret,z:Eet,s:Xet,reverseX:Let,reverseY:Zet,reverseZ:Get,westDegrees:Iet,southDegrees:Wet,eastDegrees:Pet,northDegrees:vet,westProjected:wet,southProjected:Fet,eastProjected:Aet,northProjected:Met,width:Net,height:Uet},_et=xt(jfe,{i:ket,j:Det,reverseI:Bet,reverseJ:Yet,longitudeDegrees:Ket,latitudeDegrees:Het,longitudeProjected:zet,latitudeProjected:Jet,format:jet});function BP(e){e=g(e,g.EMPTY_OBJECT),this._errorEvent=new ye;let t=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():d(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._minimumLevel=g(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=g(e.tilingScheme,new kr({ellipsoid:e.ellipsoid})),this._rectangle=g(e.rectangle,this._tilingScheme.rectangle),this._rectangle=de.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new St(o)),this._credit=o,this._hasAlphaChannel=g(e.hasAlphaChannel,!0);let r=e.customTags,s=xt(jfe,r),a=xt(_et,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=g(e.enablePickFeatures,!0)}Object.defineProperties(BP.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});BP.prototype.getTileCredits=function(e,t,n){};BP.prototype.requestImage=function(e,t,n,i){return Yc.loadImage(this,Tet(this,e,t,n,i))};BP.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!d(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(l,u){return l.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let l=s._getFeatureInfoFormats[r],u=Cet(s,e,t,n,i,o,l.format);return++r,l.type==="json"?u.fetchJson().then(l.callback).catch(c):l.type==="xml"?u.fetchXML().then(l.callback).catch(c):l.type==="text"||l.type==="html"?u.fetchText().then(l.callback).catch(c):u.fetch({responseType:l.format}).then(a.bind(void 0,l)).catch(c)}return c()};var WU=!1,Zd=new de,PU=!1,YP=new de;function Tet(e,t,n,i,o){WU=!1,PU=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},l=s.match(Qfe);return d(l)&&l.forEach(function(u){let m=u.substring(1,u.length-1);d(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var gJ=!1,K1=new D,xJ=!1;function Cet(e,t,n,i,o,r,s){WU=!1,PU=!1,gJ=!1,xJ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),l=e._pickFeaturesTags,u={},m=c.match(Qfe);return d(m)&&m.forEach(function(p){let y=p.substring(1,p.length-1);d(l[y])&&(u[y]=l[y](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function H1(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Vet(e,t,n,i){return H1(e,"{x}",t)}function Let(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return H1(e,"{reverseX}",o)}function Ret(e,t,n,i){return H1(e,"{y}",n)}function Zet(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return H1(e,"{reverseY}",o)}function Get(e,t,n,i){let o=e.maximumLevel,r=d(o)&&i<o?o-i-1:i;return H1(e,"{reverseZ}",r)}function Eet(e,t,n,i){return H1(e,"{z}",i)}function Xet(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function vU(e,t,n,i){WU||(e.tilingScheme.tileXYToRectangle(t,n,i,Zd),Zd.west=W.toDegrees(Zd.west),Zd.south=W.toDegrees(Zd.south),Zd.east=W.toDegrees(Zd.east),Zd.north=W.toDegrees(Zd.north),WU=!0)}function Iet(e,t,n,i){return vU(e,t,n,i),Zd.west}function Wet(e,t,n,i){return vU(e,t,n,i),Zd.south}function Pet(e,t,n,i){return vU(e,t,n,i),Zd.east}function vet(e,t,n,i){return vU(e,t,n,i),Zd.north}function wU(e,t,n,i){PU||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,YP),PU=!0)}function wet(e,t,n,i){return wU(e,t,n,i),YP.west}function Fet(e,t,n,i){return wU(e,t,n,i),YP.south}function Aet(e,t,n,i){return wU(e,t,n,i),YP.east}function Met(e,t,n,i){return wU(e,t,n,i),YP.north}function Net(e,t,n,i){return e.tileWidth}function Uet(e,t,n,i){return e.tileHeight}function ket(e,t,n,i,o,r,s){return FU(e,t,n,i,o,r),K1.x}function Det(e,t,n,i,o,r,s){return FU(e,t,n,i,o,r),K1.y}function Bet(e,t,n,i,o,r,s){return FU(e,t,n,i,o,r),e.tileWidth-K1.x-1}function Yet(e,t,n,i,o,r,s){return FU(e,t,n,i,o,r),e.tileHeight-K1.y-1}var Oet=new de,O1=new h;function FU(e,t,n,i,o,r,s){if(gJ)return;_J(e,t,n,i,o,r);let a=O1,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Oet);K1.x=e.tileWidth*(a.x-c.west)/c.width|0,K1.y=e.tileHeight*(c.north-a.y)/c.height|0,gJ=!0}function Ket(e,t,n,i,o,r,s){return W.toDegrees(o)}function Het(e,t,n,i,o,r,s){return W.toDegrees(r)}function zet(e,t,n,i,o,r,s){return _J(e,t,n,i,o,r),O1.x}function Jet(e,t,n,i,o,r,s){return _J(e,t,n,i,o,r),O1.y}var Qet=new he;function _J(e,t,n,i,o,r,s){if(!xJ){if(e.tilingScheme.projection instanceof Zi)O1.x=W.toDegrees(o),O1.y=W.toDegrees(r);else{let a=Qet;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,O1)}xJ=!0}}function jet(e,t,n,i,o,r,s){return s}var Ca=BP;function Uu(e){Ca.call(this,e)}Uu._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Uu._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Eh)return Uu._metadataFailure(e,t);throw o}};Uu.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=g(t,g.EMPTY_OBJECT);let r=await Uu._requestMetadata(t,i,o);return new Uu(r)};d(Object.create)&&(Uu.prototype=Object.create(Ca.prototype),Uu.prototype.constructor=Uu);function qfe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function $fe(e,t,n){let i=e.positionToTileXY(de.southwest(t),n),o=e.positionToTileXY(de.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Uu._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,l,u,m,p=[],y=e.childNodes[0].childNodes;for(let v=0;v<y.length;v++)if(r.test(y.item(v).nodeName))l=y.item(v);else if(a.test(y.item(v).nodeName)){m=y.item(v);let A=y.item(v).childNodes;for(let M=0;M<A.length;M++)s.test(A.item(M).nodeName)&&p.push(A.item(M))}else c.test(y.item(v).nodeName)&&(u=y.item(v));let f;if(!d(m)||!d(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,d(o)&&Vo.reportError(void 0,o,o.errorEvent,f),new me(f);let x=g(t.fileExtension,l.getAttribute("extension")),_=g(t.tileWidth,parseInt(l.getAttribute("width"),10)),C=g(t.tileHeight,parseInt(l.getAttribute("height"),10)),V=g(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),L=g(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),Z=m.getAttribute("profile"),G=t.tilingScheme;if(!d(G))if(Z==="geodetic"||Z==="global-geodetic")G=new Di({ellipsoid:t.ellipsoid});else if(Z==="mercator"||Z==="global-mercator")G=new kr({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${Z}.`,d(o)&&Vo.reportError(void 0,o,o.errorEvent,f),new me(f);let X=de.clone(t.rectangle);if(!d(X)){let v,A,M,b;g(t.flipXY,!1)?(M=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(M=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let E=Z==="geodetic"||Z==="mercator";if(G.projection instanceof Zi||E)v=he.fromDegrees(M.x,M.y),A=he.fromDegrees(b.x,b.y);else{let I=G.projection;v=I.unproject(M),A=I.unproject(b)}X=new de(v.longitude,v.latitude,A.longitude,A.latitude)}return X=qfe(X,G),V=$fe(G,X,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:G,rectangle:X,tileWidth:_,tileHeight:C,minimumLevel:V,maximumLevel:L,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Uu._metadataFailure=function(e,t){let n=g(e.fileExtension,"png"),i=g(e.tileWidth,256),o=g(e.tileHeight,256),r=e.maximumLevel,s=d(e.tilingScheme)?e.tilingScheme:new kr({ellipsoid:e.ellipsoid}),a=g(e.rectangle,s.rectangle);a=qfe(a,s);let c=$fe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var ky=Uu;var rfi=T(S(),1);function epe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}epe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function qet(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!d(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new me(o)}if(!d(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new me(o)}if(t.version=i.version,d(n.projection)&&n.projection==="flat")t.tilingScheme=new Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!d(n.projection)||n.projection==="mercator")t.tilingScheme=new kr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new me(o)}return!0}function $et(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw d(e)&&d(e.message)&&(i+=`: ${e.message}`),Vo.reportError(void 0,n,d(n)?n._errorEvent:void 0,i),new me(i)}async function ett(e,t,n){try{let i=await e.fetchText();qet(i,t)}catch(i){$et(i,e,n)}}function vl(e){e=g(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new St(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${vl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new ye}Object.defineProperties(vl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});vl.fromUrl=async function(e,t,n){n=g(n,{});let i=g(n.path,"/default_map"),o=Ee.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new epe(n);s.channel=t,await ett(r,s);let a=new vl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};vl.prototype.getTileCredits=function(e,t,n){};vl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Yc.loadImage(this,o)};vl.prototype.pickFeatures=function(e,t,n,i,o){};vl._logoUrl=void 0;Object.defineProperties(vl,{logoUrl:{get:function(){return d(vl._logoUrl)||(vl._logoUrl=$t("Assets/Images/google_earth_credit.png")),vl._logoUrl},set:function(e){vl._logoUrl=e}}});var OP=vl;var mfi=T(S(),1);var ttt=/\/$/,tpe=new St('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function z1(e){e=g(e,g.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ee.createIfNeeded(g(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=g(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();ttt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;d(e.credit)?(s=e.credit,typeof s=="string"&&(s=new St(s))):s=tpe,this._resource=i,this._imageryProvider=new Ca({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(z1.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});z1.prototype.getTileCredits=function(e,t,n){};z1.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};z1.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};z1._defaultCredit=tpe;var KP=z1;var Vfi=T(S(),1);function O_(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=g(e.rectangle,de.MAX_VALUE),n=new Di({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new ye;let i=e.credit;typeof i=="string"&&(i=new St(i)),this._credit=i;let o=Ee.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(O_.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function ntt(e,t,n,i){let o=`Failed to load image ${e.url}`;d(t)&&d(t.message)&&(o+=`: ${t.message}`);let r=Vo.reportError(i,n,d(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return TJ(e,n,r);throw d(n)&&(n._hasError=!0),new me(o)}async function TJ(e,t,n){try{return await Yc.loadImage(null,e)}catch(i){return ntt(e,i,t,n)}}O_.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e),i=await TJ(n);t=g(t,g.EMPTY_OBJECT);let o=new O_({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};O_.prototype.getTileCredits=function(e,t,n){};O_.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!d(this._image)){let o=await TJ(this._resource,this);return this._image=o,Vo.reportSuccess(this._errorEvent),o}return this._image};O_.prototype.pickFeatures=function(e,t,n,i,o){};var HP=O_;var zfi=T(S(),1);var Xfi=T(S(),1);function itt(e,t,n){this.type=e,d(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,d(n)||(e==="json"?n=ott:e==="xml"?n=ctt:(e==="html"||e==="text")&&(n=npe)),this.callback=n}function ott(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new ah;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),d(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var SJ="http://www.mapinfo.com/mxp",rtt="http://www.esri.com/wms",stt="http://www.opengis.net/wfs",att="http://www.opengis.net/gml";function ctt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===SJ)return ltt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===rtt)return dtt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===stt)return utt(e);if(t.localName==="ServiceExceptionReport")throw new me(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?mtt(e):htt(e)}function ltt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(SJ,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(SJ,"Val");for(let l=0;l<a.length;++l){let u=a[l];if(u.hasAttribute("ref")){let m=u.getAttribute("ref"),p=u.textContent.trim();s[m]=p}}let c=new ah;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function dtt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let l=a[c];i[l.name]=l.value}n.push(AU(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let l=0;l<c.length;++l){let u=c[l];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(AU(a,i))}}return n}function utt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(att,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};CJ(r,s),t.push(AU(r,s))}return t}function mtt(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!d(n))throw new me("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};CJ(s,a),t.push(AU(s,a))}}return t}function CJ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&CJ(o,t)&&(t[o.localName]=o.textContent)}return n}function AU(e,t){let n=new ah;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function htt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new ah;return o.data=e,o.description=n.innerHTML,[o]}var ftt=/<body>\s*<\/body>/im,ptt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,btt=/<title>([\s\S]*)<\/title>/im;function npe(e){if(ftt.test(e)||ptt.test(e))return;let t,n=btt.exec(e);n&&n.length>1&&(t=n[1]);let i=new ah;return i.name=t,i.description=e,i.data=e,[i]}var K_=itt;var Afi=T(S(),1);function zP(e){e=g(e,g.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(zP.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});zP.prototype.getFromCache=function(e,t,n,i){let o=ipe(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(d(s)&&d(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};zP.prototype.checkApproachingInterval=function(e,t,n,i){let o=ipe(e,t,n),r=this._tilesRequestedForInterval,s=ope(this),a={key:o,priorityFunction:i.priorityFunction};(!d(s)||!rpe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};zP.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=ope(this);if(d(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=rpe(this,c,r),a||s.push(c)}}};function ipe(e,t,n){return`${e}-${t}-${n}`}function ytt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function ope(e){let t=e._times;if(!d(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=te.secondsDifference(c.stop,i),++a):(s=te.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function rpe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];d(r)||(r=o[i]={});let s=t.key;if(d(r[s]))return!0;let a=ytt(s),c=new Uo({throttle:!1,throttleByServer:!0,type:Jr.IMAGERY,priorityFunction:t.priorityFunction}),l=e._requestImageFunction(a.x,a.y,a.level,c,n);return d(l)?(r[s]={promise:l,request:c},!0):!1}var H_=zP;var gtt=[3034,3035,3042,3043,3044],xtt=[4471,4559];function lh(e){if(e=g(e,g.EMPTY_OBJECT),d(e.times)&&!d(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=g(e.getFeatureInfoUrl,e.url);let t=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(lh.DefaultParameters,!0),n.setQueryParameters(lh.GetFeatureInfoDefaultParameters,!0),d(e.parameters)&&t.setQueryParameters(spe(e.parameters)),d(e.getFeatureInfoParameters)&&n.setQueryParameters(spe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,d(e.times)&&(this._timeDynamicImagery=new H_({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,l,u){return ape(i,s,a,c,l,u)},reloadFunction:function(){d(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=g(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Ei?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!xtt.includes(a)||gtt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=g(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Ei?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ca({url:t,pickFeaturesUrl:n,tilingScheme:g(e.tilingScheme,new Di({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:g(e.getFeatureInfoFormats,lh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function ape(e,t,n,i,o,r){let s=d(r)?r.data:void 0,a=e._tileProvider;return d(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function _tt(e,t,n,i,o,r,s){let a=d(s)?s.data:void 0,c=e._tileProvider;return d(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(lh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});lh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};lh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return d(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),d(o)||(o=ape(this,e,t,n,i,s)),d(o)&&d(r)&&r.checkApproachingInterval(e,t,n,i),o};lh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=d(r)?r.currentInterval:void 0;return _tt(this,e,t,n,i,o,s)};lh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});lh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});lh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new K_("json","application/json")),Object.freeze(new K_("xml","text/xml")),Object.freeze(new K_("text","text/html"))]);function spe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var JP=lh;var spi=T(S(),1);var Ttt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function QP(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ee.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!d(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Ttt),this._useKvp=!0;else{let m={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(m),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=g(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=d(e.tilingScheme)?e.tilingScheme:new kr({ellipsoid:e.ellipsoid}),this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._minimumLevel=g(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=g(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,d(e.times)&&(this._timeDynamicImagery=new H_({clock:e.clock,times:e.times,requestImageFunction:function(m,p,y,f,x){return cpe(s,m,p,y,f,x)},reloadFunction:function(){d(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(de.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(de.northeast(this._rectangle),this._minimumLevel),l=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new ye;let u=e.credit;this._credit=typeof u=="string"?new St(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():d(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function cpe(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=d(s)?s[i]:i.toString(),c=e._subdomains,l=e._dimensions,u=d(r)?r.data:void 0,m,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({request:o}),m.setTemplateValues(p),d(l)&&m.setTemplateValues(l),d(u)&&m.setTemplateValues(u);else{let y={};y.tilematrix=a,y.layer=e._layer,y.style=e._style,y.tilerow=n,y.tilecol=t,y.tilematrixset=e._tileMatrixSetID,y.format=e._format,d(l)&&(y=xt(y,l)),d(u)&&(y=xt(y,u)),p={s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({queryParameters:y,request:o}),m.setTemplateValues(p)}return Yc.loadImage(e,m)}Object.defineProperties(QP.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,d(this._reload)&&this._reload())}}});QP.prototype.getTileCredits=function(e,t,n){};QP.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return d(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),d(o)||(o=cpe(this,e,t,n,i,s)),d(o)&&d(r)&&r.checkApproachingInterval(e,t,n,i),o};QP.prototype.pickFeatures=function(e,t,n,i,o){};var jP=QP;var Stt={ARCGIS_MAPSERVER:X0.fromUrl,BING:async(e,t)=>DP.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,OP.fromUrl(e,n,t)},MAPBOX:(e,t)=>new KP({url:e,...t}),SINGLE_TILE:HP.fromUrl,TMS:ky.fromUrl,URL_TEMPLATE:(e,t)=>new Ca({url:e,...t}),WMS:(e,t)=>new JP({url:e,...t}),WMTS:(e,t)=>new jP({url:e,...t})};function Lf(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new ye}Object.defineProperties(Lf.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Lf.fromAssetId=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=$l._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Lf._endpointCache[i];d(o)||(o=n.fetchJson(),Lf._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new me(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!d(a))s=await ky.fromUrl(new $l(r,n));else{let l=Stt[a];if(!d(l))throw new me(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},m=u.url;delete u.url,s=await l(m,u)}let c=new Lf(t);return s.errorEvent.addEventListener(function(l){l.provider=c,c._errorEvent.raiseEvent(l)}),c._tileCredits=$l.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Lf.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return d(i)?this._tileCredits.concat(i):this._tileCredits};Lf.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Lf.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Lf._endpointCache={};var I0=Lf;var Vpi=T(S(),1),Ctt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},W0=Object.freeze(Ctt);function Vtt(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.style,W0.AERIAL);return I0.fromAssetId(t)}var P0=Vtt;var Ipi=T(S(),1),qP=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var Ppi=T(S(),1),$P=`in vec4 position;
in float webMercatorT;

uniform vec2 u_textureDimensions;

out vec2 v_textureCoordinates;

void main()
{
    v_textureCoordinates = vec2(position.x, webMercatorT);
    gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
}
`;var Mpi=T(S(),1);function J1(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ci.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!d(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}J1.createPlaceholder=function(e){let t=new J1(e,0,0,0);return t.addReference(),t.state=ci.PLACEHOLDER,t};J1.prototype.addReference=function(){++this.referenceCount};J1.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),d(this.parent)&&this.parent.releaseReference(),d(this.image)&&d(this.image.destroy)&&this.image.destroy(),d(this.texture)&&this.texture.destroy(),d(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};J1.prototype.processStateMachine=function(e,t,n){this.state===ci.UNLOADED&&!n&&(this.state=ci.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ci.RECEIVED&&(this.state=ci.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ci.READY&&t&&!this.texture;(this.state===ci.TEXTURE_LOADED||i)&&(this.state=ci.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var Q1=J1;var Dpi=T(S(),1);function VJ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}VJ.prototype.freeResources=function(){d(this.readyImagery)&&this.readyImagery.releaseReference(),d(this.loadingImagery)&&this.loadingImagery.releaseReference()};VJ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ci.READY)return d(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;d(r)&&(r.state!==ci.READY||!this.useWebMercatorT&&!d(r.texture));)r.state!==ci.FAILED&&r.state!==ci.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(d(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,d(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ci.FAILED||i.state===ci.INVALID?d(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var j1=VJ;function xi(e,t){this._imageryProvider=e,this._readyEvent=new ye,this._errorEvent=new ye,t=g(t,g.EMPTY_OBJECT),e=g(e,g.EMPTY_OBJECT),this.alpha=g(t.alpha,g(e._defaultAlpha,1)),this.nightAlpha=g(t.nightAlpha,g(e._defaultNightAlpha,1)),this.dayAlpha=g(t.dayAlpha,g(e._defaultDayAlpha,1)),this.brightness=g(t.brightness,g(e._defaultBrightness,xi.DEFAULT_BRIGHTNESS)),this.contrast=g(t.contrast,g(e._defaultContrast,xi.DEFAULT_CONTRAST)),this.hue=g(t.hue,g(e._defaultHue,xi.DEFAULT_HUE)),this.saturation=g(t.saturation,g(e._defaultSaturation,xi.DEFAULT_SATURATION)),this.gamma=g(t.gamma,g(e._defaultGamma,xi.DEFAULT_GAMMA)),this.splitDirection=g(t.splitDirection,xi.DEFAULT_SPLIT),this.minificationFilter=g(t.minificationFilter,g(e._defaultMinificationFilter,xi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=g(t.magnificationFilter,g(e._defaultMagnificationFilter,xi.DEFAULT_MAGNIFICATION_FILTER)),this.show=g(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=g(t.rectangle,de.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new j1(Q1.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=g(t.colorToAlphaThreshold,xi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(xi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return d(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});xi.DEFAULT_BRIGHTNESS=1;xi.DEFAULT_CONTRAST=1;xi.DEFAULT_HUE=0;xi.DEFAULT_SATURATION=1;xi.DEFAULT_GAMMA=1;xi.DEFAULT_SPLIT=vc.NONE;xi.DEFAULT_MINIFICATION_FILTER=cn.LINEAR;xi.DEFAULT_MAGNIFICATION_FILTER=Ti.LINEAR;xi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;xi.fromProviderAsync=function(e,t){let n=new xi(void 0,t);return Ett(n,Promise.resolve(e)),n};xi.fromWorldImagery=function(e){return e=g(e,g.EMPTY_OBJECT),xi.fromProviderAsync(P0({style:e.style}),e)};xi.prototype.isBaseLayer=function(){return this._isBaseLayer};xi.prototype.isDestroyed=function(){return!1};xi.prototype.destroy=function(){return ue(this)};var upe=new de,lpe=new de,LJ=new de,mpe=new de;xi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return de.intersection(e.rectangle,t)};xi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!d(t)||d(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||d(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;d(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Ei&&e.rectangle.north<Ei.MaximumLatitude&&e.rectangle.south>-Ei.MaximumLatitude,s=de.intersection(o.rectangle,this._rectangle,upe),a=de.intersection(e.rectangle,s,lpe);if(!d(a)){if(!this.isBaseLayer())return!1;let E=s,I=e.rectangle;a=lpe,I.south>=E.north?a.north=a.south=E.north:I.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(I.south,E.south),a.north=Math.min(I.north,E.north)),I.west>=E.east?a.west=a.east=E.east:I.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(I.west,E.west),a.east=Math.min(I.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=Ztt(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),d(o.minimumLevel)){let E=o.minimumLevel;m<E&&(m=E)}let y=o.tilingScheme,f=y.positionToTileXY(de.northwest(a),m),x=y.positionToTileXY(de.southeast(a),m),_=e.rectangle.width/512,C=e.rectangle.height/512,V=y.tileXYToRectangle(f.x,f.y,m);Math.abs(V.south-e.rectangle.north)<C&&f.y<x.y&&++f.y,Math.abs(V.east-e.rectangle.west)<_&&f.x<x.x&&++f.x;let L=y.tileXYToRectangle(x.x,x.y,m);Math.abs(L.north-e.rectangle.south)<C&&x.y>f.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>f.x&&--x.x;let Z=de.clone(e.rectangle,mpe),G=y.tileXYToRectangle(f.x,f.y,m),X=de.intersection(G,s,LJ),P;r?(y.rectangleToNativeRectangle(Z,Z),y.rectangleToNativeRectangle(G,G),y.rectangleToNativeRectangle(X,X),y.rectangleToNativeRectangle(s,s),P=y.tileXYToNativeRectangle.bind(y),_=Z.width/512,C=Z.height/512):P=y.tileXYToRectangle.bind(y);let v,A=0,M=1,b;!this.isBaseLayer()&&Math.abs(X.west-Z.west)>=_&&(A=Math.min(1,(X.west-Z.west)/Z.width)),!this.isBaseLayer()&&Math.abs(X.north-Z.north)>=C&&(M=Math.max(0,(X.north-Z.south)/Z.height));let R=M;for(let E=f.x;E<=x.x;E++)if(v=A,G=P(E,f.y,m),X=de.simpleIntersection(G,s,LJ),!!d(X)){A=Math.min(1,(X.east-Z.west)/Z.width),E===x.x&&(this.isBaseLayer()||Math.abs(X.east-Z.east)<_)&&(A=1),M=R;for(let I=f.y;I<=x.y;I++){if(b=M,G=P(E,I,m),X=de.simpleIntersection(G,s,LJ),!d(X))continue;M=Math.max(0,(X.south-Z.south)/Z.height),I===x.y&&(this.isBaseLayer()||Math.abs(X.south-Z.south)<C)&&(M=0);let w=new se(v,M,A,b),N=this.getImageryFromCache(E,I,m);i.imagery.splice(n,0,new j1(N,w,r)),++n}}return!0};xi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,upe),i=c.rectangleToNativeRectangle(i,mpe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};xi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!d(s))return o();e.image=s,e.state=ci.RECEIVED,e.request=void 0,Vo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===$n.CANCELLED){e.state=ci.UNLOADED,e.request=void 0;return}e.state=ci.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Vo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Uo({throttle:!1,throttleByServer:!0,type:Jr.IMAGERY});e.request=s,e.state=ci.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!d(a)){e.state=ci.UNLOADED,e.request=void 0;return}d(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};xi.prototype._createTextureWebGL=function(e,t){let n=new dn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return d(i.internalFormat)?new Wt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Wt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?st.RGBA:st.RGB,sampler:n})};xi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(d(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(d(r)){if(!r.isReady()){t.state=ci.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ci.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ei?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ci.TEXTURE_LOADED};function dpe(e,t,n){return`${e}:${t}:${n}`}xi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===cn.LINEAR&&i===Ti.LINEAR&&!st.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=cn.LINEAR_MIPMAP_LINEAR;let r=kt.maximumTextureFilterAnisotropy,s=Math.min(r,g(this._maximumAnisotropy,r)),a=dpe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;d(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let l=c[a];d(l)||(l=c[a]=new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Ph.NICEST),t.sampler=l}else{let r=dpe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;d(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];d(a)||(a=s[r]=new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};xi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=g(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Zi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Kd({persists:!0,owner:this,preExecute:function(c){Rtt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ci.READY,t.releaseReference()},canceled:function(){t.state=ci.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ci.READY};xi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};xi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){d(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};xi.prototype.getImageryFromCache=function(e,t,n,i){let o=hpe(e,t,n),r=this._imageryCache[o];return d(r)||(r=new Q1(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};xi.prototype.removeImageryFromCache=function(e){let t=hpe(e.x,e.y,e.level);delete this._imageryCache[t]};function hpe(e,t,n){return JSON.stringify([e,t,n])}var MU={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},Ltt=Mt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Rtt(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!d(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){d(this.framebuffer)&&this.framebuffer.destroy(),d(this.vertexArray)&&this.vertexArray.destroy(),d(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(2*64*2),C=0;for(let X=0;X<64;++X){let P=X/63;_[C++]=0,_[C++]=P,_[C++]=1,_[C++]=P}let V={position:0,webMercatorT:1},L=Ur.getRegularGridIndices(2,64),Z=mt.createIndexBuffer({context:t,typedArray:L,usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:V.position,vertexBuffer:mt.createVertexBuffer({context:t,typedArray:_,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:mt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:Z});let G=new Be({sources:[$P]});o.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:qP,attributeLocations:V}),o.sampler=new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;MU.textureDimensions.x=r,MU.textureDimensions.y=s,MU.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),m=new Wt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&m.generateMipmap(Ph.NICEST);let p=i.south,y=i.north,f=Ltt,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,y,C);a=Math.sin(V);let Z=(.5*Math.log((1+a)/(1-a))-c)*u;f[x++]=Z,f[x++]=Z}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=MU,e.vertexArray=o.vertexArray}function Ztt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Zi?1:Math.cos(n),a=o.rectangle,l=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(l)/Math.log(2);return Math.round(u)|0}function Gtt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Ett(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Gtt(e._errorEvent,i)}}var na=xi;var ebi=T(S(),1);var X0i=T(S(),1),Xtt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=Xtt;var W0i=T(S(),1),fpe={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=fpe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},jn=fpe;function $1(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}$1.prototype.update=function(e,t,n){this.changedThisFrame&&(Tpe(e,t,this.tile,n),this.changedThisFrame=!1)};$1.prototype.destroy=function(e){this._destroyVertexArray(e),d(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};$1.prototype._destroyVertexArray=function(e){d(this.vertexArray)&&(d(e)?e.push(this.vertexArray):Nu._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Itt=new ny;$1.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Itt;a.clear();for(let l=0;l<t.length;++l){let u=t[l];d(u.data.vertexArray)&&a.enqueue(t[l])}let c=a.dequeue();for(;c!==void 0;){let l=c.findTileToWest(r),u=c.findTileToSouth(r),m=c.findTileToEast(r),p=c.findTileToNorth(r);hs(e,n,c,l,s,yn.EAST,!1,a,i),hs(e,n,c,u,s,yn.NORTH,!1,a,i),hs(e,n,c,m,s,yn.WEST,!1,a,i),hs(e,n,c,p,s,yn.SOUTH,!1,a,i);let y=l.findTileToNorth(r),f=l.findTileToSouth(r),x=m.findTileToNorth(r),_=m.findTileToSouth(r);hs(e,n,c,y,s,yn.SOUTHEAST,!1,a,i),hs(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),hs(e,n,c,f,s,yn.NORTHEAST,!1,a,i),hs(e,n,c,_,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function hs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let l=i;for(;l&&(l._lastSelectionResultFrame!==o||jn.wasKicked(l._lastSelectionResult)||jn.originalResult(l._lastSelectionResult)===jn.CULLED);){if(s)return;let u=l.parent;if(r>=yn.NORTHWEST&&u!==void 0)switch(r){case yn.NORTHWEST:l=l===u.northwestChild?u:void 0;break;case yn.NORTHEAST:l=l===u.northeastChild?u:void 0;break;case yn.SOUTHWEST:l=l===u.southwestChild?u:void 0;break;case yn.SOUTHEAST:l=l===u.southeastChild?u:void 0;break}else l=u}if(l!==void 0){if(l._lastSelectionResult===jn.RENDERED){if(d(l.data.vertexArray))return;Wtt(e,t,n,l,r,o,a,c);return}if(jn.originalResult(i._lastSelectionResult)!==jn.CULLED)switch(r){case yn.WEST:hs(e,t,n,i.northwestChild,o,r,!0,a,c),hs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:hs(e,t,n,i.southeastChild,o,r,!0,a,c),hs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:hs(e,t,n,i.southwestChild,o,r,!0,a,c),hs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:hs(e,t,n,i.northeastChild,o,r,!0,a,c),hs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:hs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:hs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:hs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:hs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new fe("Invalid edge")}}}function Wtt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new $1(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Ptt(e,t,n,i,o,a)}function Ptt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;d(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Tpe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let l,u;switch(o){case yn.WEST:l=s.westMeshes,u=s.westTiles;break;case yn.SOUTH:l=s.southMeshes,u=s.southTiles;break;case yn.EAST:l=s.eastMeshes,u=s.eastTiles;break;case yn.NORTH:l=s.northMeshes,u=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||l[0]!==a||l.length!==1,l[0]=a,u[0]=n,l.length=1,u.length=1;return}let m,p,y,f,x=n.rectangle,_,C=i.rectangle;switch(o){case yn.WEST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.greaterThan(x.north,f.south,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case yn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.lessThan(x.west,f.east,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case yn.EAST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.lessThan(x.south,f.north,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case yn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.greaterThan(x.east,f.west,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.greaterThanOrEquals(x.west,f.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||l[m]!==a,l[m]=a,u[m]=n):(s.changedThisFrame=!0,l.splice(m,p-m,a),u.splice(m,p-m,n))}var z_=new he,vtt=new he,q1=new h,EJ=new h,RJ=new D,ZJ=new D,Gd=new D;function OU(){this.height=0,this.encodedNormal=new D}function NU(e,t,n,i,o,r,s,a,c){if(d(o))return o;let l;if(d(r)&&d(s))l=(r.height+s.height)*.5;else if(d(r))l=r.height;else if(d(s))l=s.height;else if(d(a))l=a.height;else{let m=e.tile.data.tileBoundingRegion,p=0,y=0;d(m)&&(p=m.minimumHeight,y=m.maximumHeight),l=(p+y)*.5}return Spe(e,t,n,i,l,c),c}var wtt={minimumHeight:0,maximumHeight:0},Ftt=new h,ppe=new OU,bpe=new OU,ype=new OU,gpe=new OU,Att=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Mtt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Tpe(e,t,n,i){Nu.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,l=a!==1,u=n.tilingScheme.ellipsoid,m=kU(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,ype),p=kU(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,ppe),y=kU(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,bpe),f=kU(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,gpe);m=NU(r,u,0,1,m,p,f,y,ype),p=NU(r,u,0,0,p,m,y,f,ppe),y=NU(r,u,1,1,y,p,f,m,bpe),f=NU(r,u,1,1,f,y,m,p,gpe);let x=p.height,_=y.height,C=m.height,V=f.height,L=Math.min(x,_,C,V),Z=Math.max(x,_,C,V),G=(L+Z)*.5,X,P,v=e.getLevelMaximumGeometricError(n.level),A=u.maximumRadius-v,M=Math.acos(A/u.maximumRadius)*4;if(M*=1.5,s.width>M&&Z-L<=v){let E=new Sa({width:9,height:9,buffer:Att,structure:{heightOffset:Z}}),I=Mtt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(I)}else{let E=l,I=de.center(s,vtt);I.height=G;let w=u.cartographicToCartesian(I,Ftt),N=new sc(w,void 0,void 0,void 0,void 0,!0,!0,E,a,c),Y=5,k;for(k=r.westMeshes,X=0,P=k.length;X<P;++X)Y+=k[X].eastIndicesNorthToSouth.length;for(k=r.southMeshes,X=0,P=k.length;X<P;++X)Y+=k[X].northIndicesWestToEast.length;for(k=r.eastMeshes,X=0,P=k.length;X<P;++X)Y+=k[X].westIndicesSouthToNorth.length;for(k=r.northMeshes,X=0,P=k.length;X<P;++X)Y+=k[X].southIndicesEastToWest.length;let O=wtt;O.minimumHeight=L,O.maximumHeight=Z;let U=N.stride,J=new Float32Array(Y*U),z=0,ee=z;z=UU(u,s,N,J,z,0,1,m.height,m.encodedNormal,1,O),z=BU(r,u,N,J,z,r.westTiles,r.westMeshes,yn.EAST,O);let K=z;z=UU(u,s,N,J,z,0,0,p.height,p.encodedNormal,0,O),z=BU(r,u,N,J,z,r.southTiles,r.southMeshes,yn.NORTH,O);let j=z;z=UU(u,s,N,J,z,1,0,y.height,y.encodedNormal,0,O),z=BU(r,u,N,J,z,r.eastTiles,r.eastMeshes,yn.WEST,O);let q=z;z=UU(u,s,N,J,z,1,1,f.height,f.encodedNormal,1,O),z=BU(r,u,N,J,z,r.northTiles,r.northMeshes,yn.SOUTH,O),L=O.minimumHeight,Z=O.maximumHeight;let be=Wn.fromRectangle(s,L,Z,n.tilingScheme.ellipsoid),Te=Ei.geodeticLatitudeToMercatorAngle(s.south),ae=1/(Ei.geodeticLatitudeToMercatorAngle(s.north)-Te),xe=(Ei.geodeticLatitudeToMercatorAngle(I.latitude)-Te)*ae,_e=u.geodeticSurfaceNormalCartographic(z_,EJ),Ve=Kn.octEncode(_e,RJ),Ie=z;N.encode(J,z*U,be.center,D.fromElements(.5,.5,Gd),G,Ve,xe,_e),++z;let Me=z,ve=Me<256?1:2,ke=(Me-1)*3,ct=ke*ve,yt=(J.length-Me*U)*Float32Array.BYTES_PER_ELEMENT,ot;if(yt>=ct){let Ce=Me*U*Float32Array.BYTES_PER_ELEMENT;ot=Me<256?new Uint8Array(J.buffer,Ce,ke):new Uint16Array(J.buffer,Ce,ke)}else ot=Me<256?new Uint8Array(ke):new Uint16Array(ke);J=new Float32Array(J.buffer,0,Me*U);let ln=0;for(X=0;X<Me-2;++X)ot[ln++]=Ie,ot[ln++]=X,ot[ln++]=X+1;ot[ln++]=Ie,ot[ln++]=X,ot[ln++]=0;let vn=[];for(X=K;X>=ee;--X)vn.push(X);let Dt=[];for(X=j;X>=K;--X)Dt.push(X);let Nt=[];for(X=q;X>=j;--X)Nt.push(X);let pe=[];for(pe.push(0),X=Ie-1;X>=q;--X)pe.push(X);r.mesh=new Mu(N.center,J,ot,ke,Me,L,Z,ce.fromOrientedBoundingBox(be),Ott(e,be.center,s,L,Z),N.stride,be,N,vn,Dt,Nt,pe)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=Nu._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);d(E)&&d(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}d(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function UU(e,t,n,i,o,r,s,a,c,l,u){let m=z_;m.longitude=W.lerp(t.west,t.east,r),m.latitude=W.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,q1),y;n.hasGeodeticSurfaceNormals&&(y=e.geodeticSurfaceNormal(p,EJ));let f=ZJ;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,l,y),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var YU=new de;function ev(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=de.clone(e.rectangle,YU),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=de.clone(e.rectangle,YU),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,l=o.north-o.south,u=(r.south-o.south)/l,m=(r.north-o.south)/l,p=(n.x-a)/(c-a),y=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(y)<Math.EPSILON5?y=0:Math.abs(y-1)<Math.EPSILON5&&(y=1),i.x=p,i.y=y,i}var Ntt=new D;function GJ(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Utt=new D,ktt=new h;function Dtt(e,t,n,i,o,r,s,a,c,l){let u=i.encoding,m=i.vertices,p=ev(t,n,u.decodeTextureCoordinates(m,o,Gd),Gd),y=ev(t,n,u.decodeTextureCoordinates(m,r,ZJ),ZJ),f;c?f=(s-p.x)/(y.x-p.x):f=(a-p.y)/(y.y-p.y);let x=u.decodeHeight(m,o),_=u.decodeHeight(m,r),C=n.rectangle;z_.longitude=W.lerp(C.west,C.east,s),z_.latitude=W.lerp(C.south,C.north,a),l.height=z_.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(m,o,Ntt),Z=u.getOctEncodedNormal(m,r,Utt),G=Kn.octDecode(L.x,L.y,q1),X=Kn.octDecode(Z.x,Z.y,ktt);V=h.lerp(G,X,f,q1),h.normalize(V,V),Kn.octEncode(V,l.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(z_,q1),Kn.octEncode(V,l.encodedNormal)}function Spe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(z_,q1);Kn.octEncode(s,r.encodedNormal)}function kU(e,t,n,i,o,r,s,a,c,l,u){if(_pe(e,t,a,s,!1,n,i,u)||_pe(e,t,l,c,!0,n,i,u))return u;let p;if(XJ(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],GJ(r,p,n,i,u),u;let y;if(n===0?i===0?y=DU(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):y=DU(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?y=DU(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):y=DU(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),d(y))return Spe(e,t,n,i,y,u),u}function DU(e,t,n,i,o,r,s,a){let c=xpe(e,t,!1,n,s,a),l=xpe(i,o,!0,r,s,a);return d(c)&&d(l)?(c+l)*.5:d(c)?c:l}function BU(e,t,n,i,o,r,s,a,c){for(let l=0;l<r.length;++l)o=Btt(e,t,n,i,o,r[l],s[l],a,c);return o}function Btt(e,t,n,i,o,r,s,a,c){let l=r.rectangle;a===yn.EAST&&e.tile.x===0?(l=de.clone(r.rectangle,YU),l.west-=W.TWO_PI,l.east-=W.TWO_PI):a===yn.WEST&&r.x===0&&(l=de.clone(r.rectangle,YU),l.west+=W.TWO_PI,l.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Gd),m=Gd.x,p=Gd.y);let y,f;switch(a){case yn.WEST:y=s.westIndicesSouthToNorth,f=!1;break;case yn.NORTH:y=s.northIndicesWestToEast,f=!0;break;case yn.EAST:y=s.eastIndicesNorthToSouth,f=!1;break;case yn.SOUTH:y=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,Z,G;C.hasWebMercatorT&&(Z=Ei.geodeticLatitudeToMercatorAngle(u.south),G=1/(Ei.geodeticLatitudeToMercatorAngle(u.north)-Z));for(let X=0;X<y.length;++X){let P=y[X],v=C.decodeTextureCoordinates(V,P,Gd);ev(x,_,v,v);let A=v.x,M=v.y,b=f?A:M;if(b<0||b>1||Math.abs(A-m)<W.EPSILON5&&Math.abs(M-p)<W.EPSILON5)continue;let R=Math.abs(A)<W.EPSILON5||Math.abs(A-1)<W.EPSILON5,E=Math.abs(M)<W.EPSILON5||Math.abs(M-1)<W.EPSILON5;if(R&&E)continue;let I=C.decodePosition(V,P,q1),w=C.decodeHeight(V,P),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,P,RJ):(N=RJ,N.x=0,N.y=0);let Y=M;if(C.hasWebMercatorT){let O=W.lerp(u.south,u.north,M);Y=(Ei.geodeticLatitudeToMercatorAngle(O)-Z)*G}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,EJ)),n.encode(i,o*L,I,v,w,N,Y,k),c.minimumHeight=Math.min(c.minimumHeight,w),c.maximumHeight=Math.max(c.maximumHeight,w),++o}return o}function xpe(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let l=s;l!==a;l+=c){let u=e[l],m=t[l];if(!XJ(m,u))continue;let p;switch(i){case yn.WEST:p=u.westIndicesSouthToNorth;break;case yn.SOUTH:p=u.southIndicesEastToWest;break;case yn.EAST:p=u.eastIndicesNorthToSouth;break;case yn.NORTH:p=u.northIndicesWestToEast;break}let y=p[n?0:p.length-1];if(d(y))return u.encoding.decodeHeight(u.vertices,y)}}function XJ(e,t){return d(t)&&(!d(e.data.fill)||!e.data.fill.changedThisFrame)}function _pe(e,t,n,i,o,r,s,a){let c,l,u,m,p,y=i[o?0:n.length-1],f=n[o?0:n.length-1];if(XJ(y,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,l=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,l=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,l=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,l=o,u=!o),c.length>0)){m=o?0:c.length-1,p=c[m],f.encoding.decodeTextureCoordinates(f.vertices,p,Gd);let x=ev(y,e.tile,Gd,Gd);if(x.x===r&&x.y===s)return GJ(f,p,r,s,a),!0;if(m=Lo(c,l?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,Gd);let V=ev(y,e.tile,Gd,Gd);return u?l?V.x-r:V.y-s:l?r-V.x:s-V.y}),m<0){if(m=~m,m>0&&m<c.length)return Dtt(t,y,e.tile,f,c[m-1],c[m],r,s,l,a),!0}else return GJ(f,c[m],r,s,a),!0}return!1}var Ytt=[new h,new h,new h,new h];function Ott(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Ytt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var eV=$1;function jo(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=xn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new ye,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(jo.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(jo.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(jo.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(jo.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ye,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new B(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=de.clone(de.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0}Object.defineProperties(jo.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(d(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,d(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}}});function Ktt(e,t){let n=e.loadingImagery;d(n)||(n=e.readyImagery);let i=t.loadingImagery;return d(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}jo.prototype.update=function(e){this._imageryLayers._update()};function Htt(e,t){let n=t.creditDisplay,i=e._terrainProvider;d(i)&&d(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&d(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}jo.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Ktt)})),Htt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Nu._freeVertexArray(t[i]);t.length=0};jo.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,o=t.length;i<o;++i){let r=t[i];d(r)&&(r.length=0)}let n=this._clippingPlanes;d(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};jo.prototype.endUpdate=function(e){if(!d(this._renderState)){this._renderState=De.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ka.LESS}}),this._blendRenderState=De.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ka.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Oe(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=De.fromCache(s),s=Oe(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=De.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&eV.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,o=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(d(c))for(let l=0,u=c.length;l<u;++l){let m=c[l],p=m.data.tileBoundingRegion;ynt(this,m,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Zpe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}jo.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Zpe(t[n],e)};jo.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};jo.prototype.getLevelMaximumGeometricError=function(e){return d(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};jo.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;d(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===jn.CULLED_BUT_NEEDED,o=n.terrainState),Nu.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==sr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Nu.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var ztt=new ce,Gpe=new de,Jtt=new de,Qtt=new he;function HU(e,t){if(t.west<t.east)return t;let n=de.clone(t,Jtt);return de.center(e,Qtt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function Epe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(d(n)&&n.enabled||!de.equals(e.cartographicLimitRectangle,de.MAX_VALUE))}jo.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=Epe(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return sr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return sr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;d(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let l=HU(e.rectangle,this.cartographicLimitRectangle),u=de.simpleIntersection(l,e.rectangle,Gpe);if(!d(u))return sr.NONE;if(de.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ie.SCENE3D&&(c=ztt,ce.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ie.MORPHING&&d(r.renderedMesh)&&(c=ce.union(s.boundingSphere,c,c))),!d(c))return sr.PARTIAL;let m=this._clippingPlanes;if(d(m)&&m.enabled){let x=m.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==qt.INSIDE,x===qt.OUTSIDE)return sr.NONE}let p,y=a.computeVisibility(c);if(y===qt.OUTSIDE?p=sr.NONE:y===qt.INTERSECTING?p=sr.PARTIAL:y===qt.INSIDE&&(p=sr.FULL),p===sr.NONE)return p;let f=t.mode===ie.SCENE3D&&t.camera.frustum instanceof en;if(t.mode===ie.SCENE3D&&!f&&d(n)&&!o){let x=r.occludeePointInScaledSpace;return!d(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?p:sr.NONE}return p};jo.prototype.canRefine=function(e){return d(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var jtt=[],qtt=[];jo.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=jtt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;d(n)&&(o=n.terrainState===ao.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(d(s))for(a=0,c=s.length;a<c;++a){let m=s[a],p=m.loadingImagery,y=!d(p)||p.state===ci.FAILED||p.state===ci.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=y&&i[f]}let l=this.quadtree._lastSelectionFrameNumber,u=qtt;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let m=u.pop(),p=m._lastSelectionResultFrame===l?m._lastSelectionResult:jn.NONE;if(p===jn.RENDERED){let y=m.data;if(!d(y))continue;if(!o&&m.data.terrainState===ao.READY)return!1;let f=m.data.imagery;for(a=0,c=f.length;a<c;++a){let x=f[a],_=x.loadingImagery,C=!d(_)||_.state===ci.FAILED||_.state===ci.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===jn.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0};var $tt=new h;jo.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=h.subtract(i.center,o,$tt),a=h.magnitude(s);return a<W.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var Cpe=new F,KU=new F,ent=new se,tnt=new se,nnt=new se,int=new h,Vpe=new h,ont=new h,rnt=new h;jo.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let l=i[a];d(l.readyImagery)&&l.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];d(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;d(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var snt=[new h,new h,new h,new h];function Lpe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=snt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}jo.prototype.computeDistanceToTile=function(e,t){ant(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,l=Math.abs(c-r),u=Math.abs(c-s);l>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function ant(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Nu);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new bu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,l=e,u=i.mesh,m=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let y=p.data;if(y!==void 0){let f=y.mesh,x=y.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}l=p}if(l!==void 0){let p=n.terrainExaggeration,y=n.terrainExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Vc.getHeight(r.minimumHeight,p,y),r.maximumHeight=Vc.getHeight(r.maximumHeight,p,y)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Wn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ce.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),d(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Lpe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Lpe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=l,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}jo.prototype.isDestroyed=function(){return!1};jo.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function cnt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,l;for(l=0;l<c;++l)if(o=a[l],r=g(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=l;break}if(s!==-1){let u=s+e;if(o=a[u],r=d(o)?g(o.readyImagery,o.loadingImagery):void 0,!d(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(l=s;l<u;++l)a[l].freeResources();a.splice(s,e)}return!0}}jo.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(d(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,l=c.length,u=-1,m=0;for(a=0;a<l;++a){let y=c[a];if(g(y.readyImagery,y.loadingImagery).imageryLayer===e)u===-1&&(u=a),++m;else if(u!==-1)break}if(u===-1)return;let p=u+m;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=cnt(m,e,n),s.state=ws.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ws.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==jn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};jo.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],l=c.loadingImagery;if(d(l)||(l=c.readyImagery),l.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),d(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};jo.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};jo.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var lnt=new F,dnt=new F;function Rpe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,Vpe);return F.setTranslation(i,o,Cpe),Cpe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,Vpe);return F.setTranslation(i,r,KU),F.multiply(o,KU,KU),KU},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return d(i)&&d(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=d(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,lnt):F.IDENTITY;return F.inverseTranspose(o,dnt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new B(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new F,tileRectangle:new se,terrainExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new D,scaleAndBias:new F,clippingPlanesEdgeColor:B.clone(B.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:B.clone(B.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return d(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function unt(e,t,n){let i=n.data,o,r;if(d(i.vertexArray)?(o=i.mesh,r=i.vertexArray):d(i.fill)&&d(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!d(o)||!d(r))){if(d(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=mnt(e,r,o),i.wireframeVertexArray.mesh=o}}function mnt(e,t,n){let o={indices:n.indices,primitiveType:Fe.TRIANGLES};An.toWireframe(o);let r=o.indices,s=mt.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var Xpe,Ipe,zU;(function(){let e=new _t({geometry:sm.fromDimensions({dimensions:new h(2,2,2)})}),t=new _t({geometry:new e0({radius:1})}),n=new F,i,o;function r(s){return new Zn({geometryInstances:s,appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})}Xpe=function(s,a){return s===i||(zU(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Ut.fromColor(a),o=r(e)),o},Ipe=function(s,a){return s===i||(zU(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Ut.fromColor(a),o=r(t)),o},zU=function(){d(o)&&(o.destroy(),o=void 0,i=void 0)}})();var hnt=new se(0,0,0,0),fnt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},pnt=B.TRANSPARENT,bnt=new Pt;function ynt(e,t,n){let i=t.data;d(i.vertexArray)||(i.fill===void 0&&(i.fill=new eV(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(d(r)&&d(r.credits)){let pe=r.credits;for(let Ce=0,Ht=pe.length;Ce<Ht;++Ce)o.addCreditToNextFrame(pe[Ce])}let s=kt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!d(a)&&d(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let l=n.cameraUnderground,u=n.globeTranslucencyState,m=u.translucent,p=u.frontFaceAlphaByDistance,y=u.backFaceAlphaByDistance,f=u.rectangle,x=g(e.undergroundColor,pnt),_=g(e.undergroundColorAlphaByDistance,bnt),C=Epe(e,n)&&n.mode===ie.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,Z=e.hasWaterMask&&d(a),G=e.oceanNormalMap,X=Z&&d(G),P=e.terrainProvider,v=d(P)&&e.terrainProvider.hasVertexNormals,A=n.fog.enabled&&n.fog.renderable&&!l,M=e.showGroundAtmosphere&&n.mode===ie.SCENE3D,b=xn.castShadows(e.shadows)&&!m,R=xn.receiveShadows(e.shadows)&&!m,E=e.hueShift,I=e.saturationShift,w=e.brightnessShift,N=!(W.equalsEpsilon(E,0,W.EPSILON7)&&W.equalsEpsilon(I,0,W.EPSILON7)&&W.equalsEpsilon(w,0,W.EPSILON7)),Y=!1;if(M){let pe=h.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;Y=pe>Ce}Z&&--s,X&&--s,d(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,d(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,s-=u.numberOfTextureUniforms;let k=i.renderedMesh,O=k.center,U=k.encoding,J=i.tileBoundingRegion,z=n.terrainExaggeration,ee=n.terrainExaggerationRelativeHeight,K=z!==1,j=U.hasGeodeticSurfaceNormals,q=ent,be=0,Te=0,ae=0,xe=0,_e=!1;if(n.mode!==ie.SCENE3D){let pe=n.mapProjection,Ce=pe.project(de.southwest(t.rectangle),ont),Ht=pe.project(de.northeast(t.rectangle),rnt);if(q.x=Ce.x,q.y=Ce.y,q.z=Ht.x,q.w=Ht.y,n.mode!==ie.MORPHING&&(O=int,O.x=0,O.y=(q.z+q.x)*.5,O.z=(q.w+q.y)*.5,q.x-=O.y,q.y-=O.z,q.z-=O.y,q.w-=O.z),n.mode===ie.SCENE2D&&U.quantization===vs.BITS12){let ut=1/(Math.pow(2,12)-1)*.5,hi=(q.z-q.x)*ut,ji=(q.w-q.y)*ut;q.x-=hi,q.y-=ji,q.z+=hi,q.w+=ji}pe instanceof Ei&&(be=t.rectangle.south,Te=t.rectangle.north,ae=Ei.geodeticLatitudeToMercatorAngle(be),xe=1/(Ei.geodeticLatitudeToMercatorAngle(Te)-ae),_e=!0)}let Ve=fnt;Ve.frameState=n,Ve.surfaceTile=i,Ve.showReflectiveOcean=Z,Ve.showOceanWaves=X,Ve.enableLighting=e.enableLighting,Ve.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ve.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ve.showGroundAtmosphere=M,Ve.atmosphereLightIntensity=e.atmosphereLightIntensity,Ve.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ve.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ve.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ve.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ve.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ve.perFragmentGroundAtmosphere=Y,Ve.hasVertexNormals=v,Ve.useWebMercatorProjection=_e,Ve.clippedByBoundaries=i.clippedByBoundaries,Ve.hasGeodeticSurfaceNormals=j,Ve.hasExaggeration=K;let Ie=i.imagery,Me=0,ve=Ie.length,ke=e.showSkirts&&!l&&!m,ct=e.backFaceCulling&&!l&&!m,yt=ct?e._renderState:e._disableCullingRenderState,ot=ct?e._blendRenderState:e._disableCullingBlendRenderState,ln=yt,vn=e._firstPassInitialColor,Dt=n.context;if(d(e._debug.boundingSphereTile)||zU(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let pe=e._drawCommands.length;for(let Ce=0;Ce<pe;++Ce)e._uniformMaps[Ce]=Rpe(n,e)}do{let pe=0,Ce,Ht;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new nt,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new ce,Ce.orientedBoundingBox=void 0,Ht=Rpe(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(Ht)):(Ce=e._drawCommands[e._usedDrawCommands],Ht=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let fi=J.boundingVolume,vr=J.boundingSphere;d(fi)?Xpe(fi,B.RED).update(n):d(vr)&&Ipe(vr,B.RED).update(n)}let ut=Ht.properties;se.clone(vn,ut.initialColor),ut.oceanNormalMap=G,ut.lightingFadeDistance.x=e.lightingFadeOutDistance,ut.lightingFadeDistance.y=e.lightingFadeInDistance,ut.nightFadeDistance.x=e.nightFadeOutDistance,ut.nightFadeDistance.y=e.nightFadeInDistance,ut.atmosphereLightIntensity=e.atmosphereLightIntensity,ut.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ut.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ut.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ut.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ut.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ut.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let hi=l?y:p,ji=l?p:y;d(hi)&&(se.fromElements(hi.near,hi.nearValue,hi.far,hi.farValue,ut.frontFaceAlphaByDistance),se.fromElements(ji.near,ji.nearValue,ji.far,ji.farValue,ut.backFaceAlphaByDistance)),se.fromElements(_.near,_.nearValue,_.far,_.farValue,ut.undergroundColorAlphaByDistance),B.clone(x,ut.undergroundColor),ut.lambertDiffuseMultiplier=V,ut.vertexShadowDarkness=L;let pc=!d(i.vertexArray)&&d(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;pc&&B.clone(e.fillHighlightColor,ut.fillHighlightColor),ut.terrainExaggerationAndRelativeHeight.x=z,ut.terrainExaggerationAndRelativeHeight.y=ee,ut.center3D=k.center,h.clone(O,ut.rtc),se.clone(q,ut.tileRectangle),ut.southAndNorthLatitude.x=be,ut.southAndNorthLatitude.y=Te,ut.southMercatorYAndOneOverHeight.x=ae,ut.southMercatorYAndOneOverHeight.y=xe;let bs=tnt,ys=HU(t.rectangle,e.cartographicLimitRectangle),$r=nnt,we=HU(t.rectangle,f);h.fromElements(E,I,w,ut.hsbShift);let je=t.rectangle,qe=1/je.width,Qe=1/je.height;bs.x=(ys.west-je.west)*qe,bs.y=(ys.south-je.south)*Qe,bs.z=(ys.east-je.west)*qe,bs.w=(ys.north-je.south)*Qe,se.clone(bs,ut.localizedCartographicLimitRectangle),$r.x=(we.west-je.west)*qe,$r.y=(we.south-je.south)*Qe,$r.z=(we.east-je.west)*qe,$r.w=(we.north-je.south)*Qe,se.clone($r,ut.localizedTranslucencyRectangle);let pt=A&&W.fog(t._distance,n.fog.density)>W.EPSILON3;N=N&&(pt||M);let Bt=!1,Vn=!1,di=!1,bo=!1,es=!1,ts=!1,Mo=!1,Ki=!1,ns=!1,zn=!1;for(;pe<s&&Me<ve;){let fi=Ie[Me],vr=fi.readyImagery;if(++Me,!d(vr)||vr.imageryLayer.alpha===0)continue;let Sh=fi.useWebMercatorT?vr.textureWebMercator:vr.texture,cr=vr.imageryLayer;d(fi.textureTranslationAndScale)||(fi.textureTranslationAndScale=cr._calculateTextureTranslationAndScale(t,fi)),ut.dayTextures[pe]=Sh,ut.dayTextureTranslationAndScale[pe]=fi.textureTranslationAndScale,ut.dayTextureTexCoordsRectangle[pe]=fi.textureCoordinateRectangle,ut.dayTextureUseWebMercatorT[pe]=fi.useWebMercatorT,ut.dayTextureAlpha[pe]=cr.alpha,ts=ts||ut.dayTextureAlpha[pe]!==1,ut.dayTextureNightAlpha[pe]=cr.nightAlpha,Mo=Mo||ut.dayTextureNightAlpha[pe]!==1,ut.dayTextureDayAlpha[pe]=cr.dayAlpha,Mo=Mo||ut.dayTextureDayAlpha[pe]!==1,ut.dayTextureBrightness[pe]=cr.brightness,Bt=Bt||ut.dayTextureBrightness[pe]!==na.DEFAULT_BRIGHTNESS,ut.dayTextureContrast[pe]=cr.contrast,Vn=Vn||ut.dayTextureContrast[pe]!==na.DEFAULT_CONTRAST,ut.dayTextureHue[pe]=cr.hue,di=di||ut.dayTextureHue[pe]!==na.DEFAULT_HUE,ut.dayTextureSaturation[pe]=cr.saturation,bo=bo||ut.dayTextureSaturation[pe]!==na.DEFAULT_SATURATION,ut.dayTextureOneOverGamma[pe]=1/cr.gamma,es=es||ut.dayTextureOneOverGamma[pe]!==1/na.DEFAULT_GAMMA,ut.dayTextureSplit[pe]=cr.splitDirection,Ki=Ki||ut.dayTextureSplit[pe]!==0;let kd=ut.dayTextureCutoutRectangles[pe];if(d(kd)||(kd=ut.dayTextureCutoutRectangles[pe]=new se),se.clone(se.ZERO,kd),d(cr.cutoutRectangle)){let Or=HU(je,cr.cutoutRectangle),bc=de.simpleIntersection(Or,je,Gpe);ns=d(bc)||ns,kd.x=(Or.west-je.west)*qe,kd.y=(Or.south-je.south)*Qe,kd.z=(Or.east-je.west)*qe,kd.w=(Or.north-je.south)*Qe}let qc=ut.colorsToAlpha[pe];d(qc)||(qc=ut.colorsToAlpha[pe]=new se);let pg=d(cr.colorToAlpha)&&cr.colorToAlphaThreshold>0;if(zn=zn||pg,pg){let Or=cr.colorToAlpha;qc.x=Or.red,qc.y=Or.green,qc.z=Or.blue,qc.w=cr.colorToAlphaThreshold}else qc.w=-1;if(d(vr.credits)){let Or=vr.credits;for(let bc=0,Dd=Or.length;bc<Dd;++bc)o.addCreditToNextFrame(Or[bc])}++pe}ut.dayTextures.length=pe,ut.waterMask=a,se.clone(c,ut.waterMaskTranslationAndScale),ut.minMaxHeight.x=U.minimumHeight,ut.minMaxHeight.y=U.maximumHeight,F.clone(U.matrix,ut.scaleAndBias);let wn=e._clippingPlanes,mn=d(wn)&&wn.enabled&&t.isClipped;mn&&(ut.clippingPlanesEdgeColor=B.clone(wn.edgeColor,ut.clippingPlanesEdgeColor),ut.clippingPlanesEdgeWidth=wn.edgeWidth),Ve.numberOfDayTextures=pe,Ve.applyBrightness=Bt,Ve.applyContrast=Vn,Ve.applyHue=di,Ve.applySaturation=bo,Ve.applyGamma=es,Ve.applyAlpha=ts,Ve.applyDayNightAlpha=Mo,Ve.applySplit=Ki,Ve.enableFog=pt,Ve.enableClippingPlanes=mn,Ve.clippingPlanes=wn,Ve.hasImageryLayerCutout=ns,Ve.colorCorrect=N,Ve.highlightFillTile=pc,Ve.colorToAlpha=zn,Ve.showUndergroundColor=C,Ve.translucent=m;let _i=i.renderedMesh.indices.length;ke||(_i=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ve),Ce.castShadows=b,Ce.receiveShadows=R,Ce.renderState=ln,Ce.primitiveType=Fe.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=_i,Ce.uniformMap=Ht,Ce.pass=Re.GLOBE,e._debug.wireframe&&(unt(Dt,e,t),d(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Fe.LINES,Ce.count=_i*2));let ui=Ce.boundingVolume,As=Ce.orientedBoundingBox;n.mode!==ie.SCENE3D?(ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,J.minimumHeight,J.maximumHeight,ui),h.fromElements(ui.center.z,ui.center.x,ui.center.y,ui.center),n.mode===ie.MORPHING&&(ui=ce.union(J.boundingSphere,ui,ui))):(Ce.boundingVolume=ce.clone(J.boundingSphere,ui),Ce.orientedBoundingBox=Wn.clone(J.boundingVolume,As)),Ce.dirty=!0,m&&u.updateDerivedCommands(Ce,n),Zpe(Ce,n),ln=ot,vn=hnt}while(Me<ve)}var tv=jo;var ryi=T(S(),1);function Wpe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=de.clone(de.MAX_VALUE)}Object.defineProperties(Wpe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Pt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Pt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){d(e)||(e=de.clone(de.MAX_VALUE)),de.clone(e,this._rectangle)}}});var nv=Wpe;var fyi=T(S(),1);function fs(){this._layers=[],this.layerAdded=new ye,this.layerRemoved=new ye,this.layerMoved=new ye,this.layerShownOrHidden=new ye}Object.defineProperties(fs.prototype,{length:{get:function(){return this._layers.length}}});fs.prototype.add=function(e,t){d(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};fs.prototype.addImageryProvider=function(e,t){let n=new na(e);return this.add(n,t),n};fs.prototype.remove=function(e,t){t=g(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};fs.prototype.removeAll=function(e){e=g(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};fs.prototype.contains=function(e){return this.indexOf(e)!==-1};fs.prototype.indexOf=function(e){return this._layers.indexOf(e)};fs.prototype.get=function(e){return this._layers[e]};function JU(e,t){return e.indexOf(t)}function Ppe(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}fs.prototype.raise=function(e){let t=JU(this._layers,e);Ppe(this,t,t+1)};fs.prototype.lower=function(e){let t=JU(this._layers,e);Ppe(this,t,t-1)};fs.prototype.raiseToTop=function(e){let t=JU(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};fs.prototype.lowerToBottom=function(e){let t=JU(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var gnt=new de;function vpe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!d(r)&&a<o.length;++a){let c=o[a];de.contains(c.rectangle,t)&&(r=c)}if(!d(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],l=c.readyImagery;if(!d(l)||!l.imageryLayer.ready)continue;let u=l.imageryLayer.imageryProvider;if(n&&!d(u.pickFeatures)||!de.contains(l.rectangle,t))continue;let m=gnt,p=1/1024;m.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),de.contains(m,t)&&i(l)}}fs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!d(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[];if(vpe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};fs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!d(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(vpe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);d(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let l=s[c],u=r[c];if(d(l)&&l.length>0)for(let m=0;m<l.length;++m){let p=l[m];p.imageryLayer=u,d(p.position)||(p.position=i),a.push(p)}}return a})};fs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};fs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};fs.prototype.isDestroyed=function(){return!1};fs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};fs.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(d(i._show)&&(d(n)||(n=[]),n.push(i)),i._show=i.show);if(d(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var iv=fs;var zyi=T(S(),1);var gyi=T(S(),1);function wpe(e){this._ellipsoid=new d0(e.ellipsoid,h.ZERO)}Object.defineProperties(wpe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var ov=wpe;var Vyi=T(S(),1);function Oc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=jn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ws.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Oc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new Oc({tilingScheme:e,x:s,y:r,level:0});return i};Oc.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(d(t)&&d(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(d(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Oc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return d(this._southwestChild)||(this._southwestChild=new Oc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return d(this._southeastChild)||(this._southeastChild=new Oc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return d(this._northwestChild)||(this._northwestChild=new Oc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return d(this._northeastChild)||(this._northeastChild=new Oc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ws.DONE}},eligibleForUnloading:{get:function(){let e=!0;return d(this.data)&&(e=this.data.eligibleForUnloading,d(e)||(e=!0)),e}}});Oc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};Oc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Oc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Oc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Oc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Oc.prototype.freeResources=function(){this.state=ws.START,this.renderable=!1,this.upsampledFromParent=!1,d(this.data)&&d(this.data.freeResources)&&this.data.freeResources(),QU(this._southwestChild),this._southwestChild=void 0,QU(this._southeastChild),this._southeastChild=void 0,QU(this._northwestChild),this._northwestChild=void 0,QU(this._northeastChild),this._northeastChild=void 0};function QU(e){d(e)&&e.freeResources()}var rv=Oc;var Zyi=T(S(),1);function jU(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}jU.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};jU.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&d(this._lastBeforeStartOfFrame)&&this.count>e&&d(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Fpe(this,t)),t=i}};function Fpe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}jU.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!d(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(d(e.replacementPrevious)||d(e.replacementNext))&&Fpe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var sv=jU;function ku(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new sv,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=g(e.maximumScreenSpaceError,2),this.tileCacheSize=g(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new ov({ellipsoid:n}),this._tileLoadProgressEvent=new ye,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(ku.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});ku.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function xnt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Mpe(e);let n=e._levelZeroTiles;if(d(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}ku.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;d(t);)t.state!==ws.START&&e(t),t=t.replacementNext};ku.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};ku.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};ku.prototype.update=function(e){d(this._tileProvider.update)&&this._tileProvider.update(e)};function Mpe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}ku.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(xnt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Mpe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};ku.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Cnt(this,e),Pnt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function _nt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=ye.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}ku.prototype.endFrame=function(e){!e.passes.render||e.mode===ie.MORPHING||(Ent(this,e),Wnt(this,e),_nt(this,e))};ku.prototype.isDestroyed=function(){return!1};ku.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var cv,Ape=new he;function Tnt(e,t){let n=de.center(e.rectangle,Ape),i=n.longitude-cv.longitude,o=n.latitude-cv.latitude;n=de.center(t.rectangle,Ape);let r=n.longitude-cv.longitude,s=n.latitude-cv.latitude;return i*i+o*o-(r*r+s*s)}var Snt=new h,av=[];function Cnt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!d(e._levelZeroTiles)){let x=r.tilingScheme;if(d(x)){let _=r.tilingScheme;e._levelZeroTiles=rv.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(av.length<C)for(av=new Array(C),o=0;o<C;++o)av[o]===void 0&&(av[o]=new lv)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;cv=t.camera.positionCartographic,a.sort(Tnt);let l=e._addHeightCallbacks,u=e._removeHeightCallbacks,m=t.frameNumber,p;if(l.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(m,l,u);l.length=0,u.length=0}let y=t.camera;e._cameraPositionCartographic=y.positionCartographic;let f=F.getTranslation(y.transform,Snt);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Va(e,s,r,t,c,!1,av[o]):(v0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=m}function v0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function lv(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Npe(){this.southwest=new lv,this.southeast=new lv,this.northwest=new lv,this.northeast=new lv}Npe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var PJ=new Array(31);for(let e=0;e<PJ.length;++e)PJ[e]=new Npe;function Vnt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Znt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,l=n.northwestChild,u=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:jn.NONE,y=e.tileProvider;if(s||i){let f=jn.originalResult(p)===jn.RENDERED,x=jn.originalResult(p)===jn.CULLED||p===jn.NONE,_=n.state===ws.DONE,C=f||x||_;if(C||d(y.canRenderWithoutLosingDetail)&&(C=y.canRenderWithoutLosingDetail(n)),C){s&&v0(e,e._tileLoadQueueMedium,n,t),qU(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&v0(e,e._tileLoadQueueHigh,n,t)}if(y.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&l.upsampledFromParent&&u.upsampledFromParent){qU(e,n),v0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(Lnt(e,a,c,l,u,t,i,o),x!==e._tilesToRender.length){let Z=o.allAreRenderable,G=o.anyWereRenderedLastFrame,X=o.notYetRenderableCount,P=!1;if(!Z&&!G){let v=e._tilesToRender;for(let M=x;M<v.length;++M){let b=v[M];for(;b!==void 0&&b._lastSelectionResult!==jn.KICKED&&b!==n;)b._lastSelectionResult=jn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,qU(e,n),n._lastSelectionResult=jn.RENDERED;let A=p===jn.RENDERED;!A&&X>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,v0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,P=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=A,A||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!P&&v0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.RENDERED,qU(e,n),v0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Lnt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,l=e._tileProvider,u=e._occluders,m=PJ[t.level],p=m.southwest,y=m.southeast,f=m.northwest,x=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Va(e,t,l,r,u,s,p),Va(e,n,l,r,u,s,y),Va(e,i,l,r,u,s,f),Va(e,o,l,r,u,s,x)):(Va(e,i,l,r,u,s,f),Va(e,t,l,r,u,s,p),Va(e,o,l,r,u,s,x),Va(e,n,l,r,u,s,y)):c.latitude<t.rectangle.north?(Va(e,n,l,r,u,s,y),Va(e,t,l,r,u,s,p),Va(e,o,l,r,u,s,x),Va(e,i,l,r,u,s,f)):(Va(e,o,l,r,u,s,x),Va(e,i,l,r,u,s,f),Va(e,n,l,r,u,s,y),Va(e,t,l,r,u,s,p)),m.combine(a)}function Rnt(e,t){let n=t.rectangle;return d(e._cameraPositionCartographic)&&de.contains(n,e._cameraPositionCartographic)||d(e._cameraReferenceFrameOriginCartographic)&&de.contains(n,e._cameraReferenceFrameOriginCartographic)}function Va(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==sr.NONE)return Vnt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Rnt(e,t)){(!d(t.data)||!d(t.data.vertexArray))&&v0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:jn.NONE;c!==jn.CULLED_BUT_NEEDED&&c!==jn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=jn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(v0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=jn.CULLED):t._lastSelectionResult=jn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Znt(e,t,n){if(t.mode===ie.SCENE2D||t.camera.frustum instanceof en||t.camera.frustum instanceof yr)return Gnt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Gnt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;d(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),m=l/u;return t.fog.enabled&&t.mode!==ie.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function qU(e,t){e._tilesToRender.push(t)}function Ent(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=gi()+e._loadQueueTimeSlice,s=e._tileProvider,a=IJ(e,t,s,r,n,!1);a=IJ(e,t,s,r,i,a),IJ(e,t,s,r,o,a)}function Xnt(e,t){return e._loadPriority-t._loadPriority}function IJ(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Xnt);for(let s=0,a=o.length;s<a&&(gi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var tV=new Sn,WJ=new he,Dy=new h,Int=[];function Wnt(e,t){if(!d(e.tileProvider.tilingScheme))return;let n=Int;n.length=0;let i=e._tileToUpdateHeights,o=gi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,l=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let m=i[0];if(!d(m.data)||!d(m.data.mesh)){let x=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:jn.NONE;(x===jn.RENDERED||x===jn.CULLED_BUT_NEEDED)&&n.push(m),i.shift(),e._lastTileIndex=0;continue}let p=m.customData,y=p.length,f=!1;for(u=e._lastTileIndex;u<y;++u){let x=p[u],_=m.data.terrainData,C=d(_)&&_.wasCreatedByUpsampling();if(m.level>x.level&&!C){if(d(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=h.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,l)),a===ie.SCENE3D){let L=l.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,tV.direction),Z=l.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,tV.origin);if(!d(Z)){let G=0;d(m.data.tileBoundingRegion)&&(G=m.data.tileBoundingRegion.minimumHeight);let X=Math.min(G,-11500),P=h.multiplyByScalar(L,Math.abs(X)+1,Dy);h.subtract(x.positionOnEllipsoidSurface,P,tV.origin)}}else he.clone(x.positionCartographic,WJ),WJ.height=-11500,c.project(WJ,Dy),h.fromElements(Dy.z,Dy.x,Dy.y,Dy),h.clone(Dy,tV.origin),h.clone(h.UNIT_X,tV.direction);let V=m.data.pick(tV,a,c,!1,Dy);d(V)&&(d(x.callback)&&x.callback(V),x.level=m.level)}if(gi()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function Pnt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var dv=ku;function dh(e){e=g(e,re.WGS84);let t=new Cf({ellipsoid:e}),n=new iv;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new NP,this._material=void 0,this._surface=new dv({tileProvider:new tv({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ye,this._undergroundColor=B.clone(B.BLACK),this._undergroundColorAlphaByDistance=new Pt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new nv,wJ(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ee({url:$t("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(dh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return d(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){d(e)||(e=de.clone(de.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),d(this._material)&&wJ(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,wJ(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=B.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Pt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function wJ(e){let t=[],n=d(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[G0,U1];d(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(AP),e._surfaceShaderSet.baseVertexShaderSource=new Be({sources:[G0,U1,MP],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Be({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function vnt(e){return function(t,n){let i=ce.distanceSquaredTo(t.pickBoundingSphere,e),o=ce.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var wnt=[],Fnt={start:0,stop:0};dh.prototype.pickWorldCoordinates=function(e,t,n,i){n=g(n,!0);let o=t.mode,r=t.mapProjection,s=wnt;s.length=0;let a=this._surface._tilesToRender,c=a.length,l,u;for(u=0;u<c;++u){l=a[u];let p=l.data;if(!d(p))continue;let y=p.pickBoundingSphere;if(o!==ie.SCENE3D)p.pickBoundingSphere=y=ce.fromRectangleWithHeights2D(l.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,y),h.fromElements(y.center.z,y.center.x,y.center.y,y.center);else if(d(p.renderedMesh))ce.clone(p.tileBoundingRegion.boundingSphere,y);else continue;let f=Si.raySphere(e,y,Fnt);d(f)&&s.push(p)}s.sort(vnt(e.origin));let m;for(c=s.length,u=0;u<c&&(m=s[u].pick(e,t.mode,t.mapProjection,n,i),!d(m));++u);return m};var Ant=new he;dh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),d(n)&&t.mode!==ie.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Ant);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var Mnt=new h,Upe=new h,Nnt=new he,Unt=new Sn;function vJ(e,t){return d(e)&&de.contains(e.rectangle,t)?e:void 0}dh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!d(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!de.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;d(n);)n=vJ(n._southwestChild,e)||vJ(n._southeastChild,e)||vJ(n._northwestChild,e)||n._northeastChild,d(n)&&d(n.data)&&d(n.data.renderedMesh)&&(r=n);if(n=r,!d(n)||!d(n.data)||!d(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,Mnt),l=Unt,u=a.geodeticSurfaceNormal(c,l.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,l.origin);if(!d(m)){let y;d(n.data.tileBoundingRegion)&&(y=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(g(y,0),-11500),x=h.multiplyByScalar(u,Math.abs(f)+1,Upe);h.subtract(c,x,l.origin)}let p=n.data.pick(l,void 0,s,!1,Upe);if(d(p))return a.cartesianToCartographic(p,Nnt).height};dh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};dh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=this.showWaterEffect&&d(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(d(c)){let l=this;a.fetchImage().then(function(u){c===l._oceanNormalMapResource.url&&(l._oceanNormalMap=l._oceanNormalMap&&l._oceanNormalMap.destroy(),l._oceanNormalMap=new Wt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ie.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};dh.prototype.render=function(e){this.show&&(d(this._material)&&this._material.update(e.context),this._surface.render(e))};dh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var uv=dh;var Wxi=T(S(),1);var Bgi=T(S(),1);var vgi=T(S(),1);var Zgi=T(S(),1);function knt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var mv=knt;var e0e={},Dnt=32.184,Bnt=2451545,kpe=-.0529921,Dpe=-.1059842,Bpe=13.0120009,Ype=13.3407154,Ope=.9856003,Kpe=26.4057084,Hpe=13.064993,zpe=.3287146,Jpe=1.7484877,Qpe=-.1589763,jpe=.0036096,qpe=.1643573,$pe=12.9590088,FJ=new te;e0e.ComputeMoon=function(e,t){d(e)||(e=te.now()),FJ=te.addSeconds(e,Dnt,FJ);let n=te.totalDays(FJ)-Bnt,i=n/Qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+kpe*n)*W.RADIANS_PER_DEGREE,r=(250.089+Dpe*n)*W.RADIANS_PER_DEGREE,s=(260.008+Bpe*n)*W.RADIANS_PER_DEGREE,a=(176.625+Ype*n)*W.RADIANS_PER_DEGREE,c=(357.529+Ope*n)*W.RADIANS_PER_DEGREE,l=(311.589+Kpe*n)*W.RADIANS_PER_DEGREE,u=(134.963+Hpe*n)*W.RADIANS_PER_DEGREE,m=(276.617+zpe*n)*W.RADIANS_PER_DEGREE,p=(34.226+Jpe*n)*W.RADIANS_PER_DEGREE,y=(15.134+Qpe*n)*W.RADIANS_PER_DEGREE,f=(119.743+jpe*n)*W.RADIANS_PER_DEGREE,x=(239.961+qpe*n)*W.RADIANS_PER_DEGREE,_=(25.053+$pe*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),Z=Math.sin(a),G=Math.sin(c),X=Math.sin(l),P=Math.sin(u),v=Math.sin(m),A=Math.sin(p),M=Math.sin(y),b=Math.sin(f),R=Math.sin(x),E=Math.sin(_),I=Math.cos(o),w=Math.cos(r),N=Math.cos(s),Y=Math.cos(a),k=Math.cos(c),O=Math.cos(l),U=Math.cos(u),J=Math.cos(m),z=Math.cos(p),ee=Math.cos(y),K=Math.cos(f),j=Math.cos(x),q=Math.cos(_),be=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*Z+.0072*X-.0052*M+.0043*E)*W.RADIANS_PER_DEGREE,Te=(66.5392+.013*i+1.5419*I+.0239*w-.0278*N+.0068*Y-.0029*O+9e-4*U+8e-4*ee-9e-4*q)*W.RADIANS_PER_DEGREE,ae=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*Z+.0252*G-.0066*X-.0047*P-.0046*v+.0028*A+.0052*M+.004*b+.0019*R-.0044*E)*W.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*I*kpe+.1208*w*Dpe-.0642*N*Bpe+.0158*Y*Ype+.0252*k*Ope-.0066*O*Kpe-.0047*U*Hpe-.0046*J*zpe+.0028*z*Jpe+.0052*ee*Qpe+.004*K*jpe+.0019*j*qpe-.0044*q*$pe)/86400*W.RADIANS_PER_DEGREE;return d(t)||(t=new mv),t.rightAscension=be,t.declination=Te,t.rotation=ae,t.rotationRate=xe,t};var hv=e0e;function t0e(e){(!d(e)||typeof e!="function")&&(e=hv.ComputeMoon),this._computeFunction=e}var Ynt=new h,Ont=new h,Knt=new h;function Hnt(e,t,n){let i=Ynt;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Knt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,Ont);return d(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var znt=new $,Jnt=new Ae;t0e.prototype.evaluate=function(e,t){d(e)||(e=te.now());let n=this._computeFunction(e),i=Hnt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Ae.fromAxisAngle(h.UNIT_Z,o,Jnt),s=$.fromQuaternion(Ae.conjugate(r,r),znt);return $.multiply(s,i,i)};var fv=t0e;var yxi=T(S(),1);var Ogi=T(S(),1),nV=`uniform vec3 u_radii;
uniform vec3 u_oneOverEllipsoidRadiiSquared;

in vec3 v_positionEC;

vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
{
    vec3 positionEC = czm_pointAlongRay(ray, intersection);
    vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
    vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
    vec3 sphericalNormal = normalize(positionMC / u_radii);
    vec3 normalMC = geodeticNormal * side;              // normalized surface normal (always facing the viewer) in model coordinates
    vec3 normalEC = normalize(czm_normal * normalMC);   // normalized surface normal in eye coordinates

    vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);
    vec3 positionToEyeEC = -positionEC;

    czm_materialInput materialInput;
    materialInput.s = st.s;
    materialInput.st = st;
    materialInput.str = (positionMC + u_radii) / u_radii;
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
    materialInput.positionToEyeEC = positionToEyeEC;
    czm_material material = czm_getMaterial(materialInput);

#ifdef ONLY_SUN_LIGHTING
    return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
#else
    return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}

void main()
{
    // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
    // in the vertex shader. Only when it is larger than some constant, march along the ray.
    // Otherwise perform one intersection test which will be the common case.

    // Test if the ray intersects a sphere with the ellipsoid's maximum radius.
    // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
    // may cause false negatives. This will discard fragments before marching the ray forward.
    float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
    vec3 direction = normalize(v_positionEC);
    vec3 ellipsoidCenter = czm_modelView[3].xyz;

    float t1 = -1.0;
    float t2 = -1.0;

    float b = -2.0 * dot(direction, ellipsoidCenter);
    float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;

    float discriminant = b * b - 4.0 * c;
    if (discriminant >= 0.0) {
        t1 = (-b - sqrt(discriminant)) * 0.5;
        t2 = (-b + sqrt(discriminant)) * 0.5;
    }

    if (t1 < 0.0 && t2 < 0.0) {
        discard;
    }

    float t = min(t1, t2);
    if (t < 0.0) {
        t = 0.0;
    }

    // March ray forward to intersection with larger sphere and find
    czm_ray ray = czm_ray(t * direction, direction);

    vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);

    if (czm_isEmpty(intersection))
    {
        discard;
    }

    // If the viewer is outside, compute outsideFaceColor, with normals facing outward.
    vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);

    // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
    vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);

    out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
    out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);

#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
    t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
    vec3 positionEC = czm_pointAlongRay(ray, t);
    vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
#ifdef LOG_DEPTH
    czm_writeLogDepth(1.0 + positionCC.w);
#else
    float z = positionCC.z / positionCC.w;

    float n = czm_depthRange.near;
    float f = czm_depthRange.far;

    gl_FragDepth = (z * (f - n) + f + n) * 0.5;
#endif
#endif
}
`;var Hgi=T(S(),1),iV=`in vec3 position;

uniform vec3 u_radii;

out vec3 v_positionEC;

void main()
{
    // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
    // Scale to consider the radii.  We could also do this once on the CPU when using the BoxGeometry,
    // but doing it here allows us to change the radii without rewriting the vertex data, and
    // allows all ellipsoids to reuse the same vertex data.
    vec4 p = vec4(u_radii * position, 1.0);

    v_positionEC = (czm_modelView * p).xyz;     // position in eye coordinates
    gl_Position = czm_modelViewProjection * p;  // position in clip coordinates

    // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
    // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
    // ellipsoid (does not write depth) that was rendered in the farther frustum.
    //
    // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
    // artifacts since some fragments can be alpha blended twice.  This is solved by only rendering
    // the ellipsoid in the closest frustum to the viewer.
    gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);

    czm_vertexLogDepth();
}
`;var AJ={position:0};function $U(e){e=g(e,g.EMPTY_OBJECT),this.center=h.clone(g(e.center,h.ZERO)),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ce,this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=g(e.show,!0),this.material=g(e.material,ki.fromType(ki.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.onlySunLighting=g(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=g(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new nt({owner:g(e._owner,this)}),this._pickCommand=new nt({owner:g(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Qnt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(d(t))return t;let n=cl.createGeometry(cl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:We.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:AJ,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}$U.prototype.update=function(e){if(!this.show||e.mode!==ie.SCENE3D||!d(this.center)||!d(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!d(this._rs)||i)&&(this._translucent=n,this._rs=De.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),d(this._va)||(this._va=Qnt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),ce.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,l=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,m,p;(s||a||i||l)&&(m=new Be({sources:[iV]}),p=new Be({sources:[this.material.shaderSource,nV]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:AJ}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=xt(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let y=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Re.TRANSLUCENT:Re.OPAQUE,y.push(u)),f.pick){let x=this._pickCommand;(!d(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!d(this._pickSP)||l)&&(m=new Be({sources:[iV]}),p=new Be({sources:[this.material.shaderSource,nV],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:AJ}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Re.TRANSLUCENT:Re.OPAQUE,y.push(x)}};$U.prototype.isDestroyed=function(){return!1};$U.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var pv=$U;function bv(e){e=g(e,g.EMPTY_OBJECT);let t=e.textureUrl;d(t)||(t=$t("Assets/Textures/moonSmall.jpg")),this.show=g(e.show,!0),this.textureUrl=t,this._ellipsoid=g(e.ellipsoid,re.MOON),this.onlySunLighting=g(e.onlySunLighting,!0),this._ellipsoidPrimitive=new pv({radii:this.ellipsoid.radii,material:ki.fromType(ki.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new fv}Object.defineProperties(bv.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var ek=new $,jnt=new $,qnt=new h,tk=[];bv.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;d(vt.computeIcrfToFixedMatrix(n,ek))||vt.computeTemeToPseudoFixedMatrix(n,ek);let i=this._axes.evaluate(n,jnt);$.transpose(i,i),$.multiply(ek,i,i);let o=ab.computeMoonPositionInEarthInertialFrame(n,qnt);$.multiplyByVector(ek,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=tk,tk.length=0,t.update(e),e.commandList=r,tk.length===1?tk[0]:void 0};bv.prototype.isDestroyed=function(){return!1};bv.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var yv=bv;var YWi=T(S(),1);var vxi=T(S(),1);var MJ=[],NJ=[];function $nt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=MJ,l=NJ,u,m;for(u=0;u<s;++u)c[u]=e[i+u];for(m=0;m<a;++m)l[m]=e[o+m+1];u=0,m=0;for(let p=i;p<=r;++p){let y=c[u],f=l[m];u<s&&(m>=a||t(y,f,n)<=0)?(e[p]=y,++u):m<a&&(e[p]=f,++m)}}function UJ(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);UJ(e,t,n,i,r),UJ(e,t,n,r+1,o),$nt(e,t,n,i,r,o)}function eit(e,t,n){let i=e.length,o=Math.ceil(i*.5);MJ.length=o,NJ.length=o,UJ(e,t,n,0,i-1),MJ.length=0,NJ.length=0}var w0=eit;var Yxi=T(S(),1);function ac(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var nk=new h;Object.defineProperties(ac.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,nk),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,nk);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,nk),nk)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});ac.fromBoundingSphere=function(e,t,n){return d(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new ac(e,t)};var i0e=new h;ac.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,i0e),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var tit=new h;ac.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,tit),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,i0e),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var nit=new h;ac.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return sr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,nit),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?sr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?sr.FULL:sr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?sr.PARTIAL:sr.FULL))}}return sr.NONE};var ik=new h;ac.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,ik),ik),c=-h.dot(a,o),l=ac._anyRotationVector(o,a,c),u=ac._horizonToPlaneNormalDotProduct(e,a,c,l,n[0]);if(!u)return;let m;for(let y=1;y<s;++y){if(m=ac._horizonToPlaneNormalDotProduct(e,a,c,l,n[y]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,ik),ik)};var iit=[];ac.computeOccludeePointFromRectangle=function(e,t){t=g(t,re.WGS84);let n=de.subsample(e,t,0,iit),i=ce.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return ac.computeOccludeePoint(new ce(o,t.minimumRadius),i.center,n)};var oit=new h;ac._anyRotationVector=function(e,t,n){let i=h.abs(t,oit),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var rit=new h;ac._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,rit);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>W.EPSILON13)return h.normalize(s,new h)}return o};var kJ=new h,sit=new h,ok=new h,n0e=new h;ac._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,kJ),s=h.clone(e.center,sit),a=e.radius,c=h.subtract(s,r,ok),l=h.magnitudeSquared(c),u=a*a;if(l<u)return!1;let m=l-u,p=Math.sqrt(m),f=1/Math.sqrt(l),_=p*f*p;c=h.normalize(c,c);let C=h.add(r,h.multiplyByScalar(c,_,n0e),n0e),V=Math.sqrt(m-_*_),L=this._rotationVector(s,t,n,r,i),Z=h.fromElements(L.x*L.x*c.x+(L.x*L.y-L.z)*c.y+(L.x*L.z+L.y)*c.z,(L.x*L.y+L.z)*c.x+L.y*L.y*c.y+(L.y*L.z-L.x)*c.z,(L.x*L.z-L.y)*c.x+(L.y*L.z+L.x)*c.y+L.z*L.z*c.z,kJ);Z=h.normalize(Z,Z);let G=h.multiplyByScalar(Z,V,kJ);L=h.normalize(h.subtract(h.add(C,G,ok),s,ok),ok);let X=h.dot(t,L);L=h.normalize(h.subtract(h.subtract(C,G,L),s,L),L);let P=h.dot(t,L);return X<P?X:P};var gv=ac;var r_i=T(S(),1);var $xi=T(S(),1);function Rf(e){e=g(e,g.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this._cullingVolume=new Qr,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function DJ(e){let t=e.top,n=e.bottom,i=e.right,o=e.left,r=e.near,s=e.far;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Rf.prototype,{projectionMatrix:{get:function(){return DJ(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return DJ(this),this._infinitePerspective}}});var ait=new h,cit=new h,lit=new h,dit=new h;Rf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,l=this.far,u=h.cross(t,n,ait),m=cit;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=lit;h.multiplyByScalar(t,l,p),h.add(e,p,p);let y=dit;h.multiplyByScalar(u,a,y),h.add(m,y,y),h.subtract(y,e,y),h.normalize(y,y),h.cross(y,n,y),h.normalize(y,y);let f=i[0];return d(f)||(f=i[0]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),h.multiplyByScalar(u,s,y),h.add(m,y,y),h.subtract(y,e,y),h.cross(n,y,y),h.normalize(y,y),f=i[1],d(f)||(f=i[1]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),h.multiplyByScalar(n,r,y),h.add(m,y,y),h.subtract(y,e,y),h.cross(u,y,y),h.normalize(y,y),f=i[2],d(f)||(f=i[2]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),h.multiplyByScalar(n,o,y),h.add(m,y,y),h.subtract(y,e,y),h.cross(y,u,y),h.normalize(y,y),f=i[3],d(f)||(f=i[3]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),f=i[4],d(f)||(f=i[4]=new se),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-h.dot(t,m),h.negate(t,y),f=i[5],d(f)||(f=i[5]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,p),this._cullingVolume};Rf.prototype.getPixelDimensions=function(e,t,n,i,o){DJ(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Rf.prototype.clone=function(e){return d(e)||(e=new Rf),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Rf.prototype.equals=function(e){return d(e)&&e instanceof Rf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Rf.prototype.equalsEpsilon=function(e,t,n){return e===this||d(e)&&e instanceof Rf&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var Kc=Rf;function wl(e){e=g(e,g.EMPTY_OBJECT),this._offCenterFrustum=new Kc,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this.xOffset=g(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=g(e.yOffset,0),this._yOffset=this.yOffset}wl.packedLength=6;wl.pack=function(e,t,n){return n=g(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};wl.unpack=function(e,t,n){return t=g(t,0),d(n)||(n=new wl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function uh(e){let t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset)&&(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}Object.defineProperties(wl.prototype,{projectionMatrix:{get:function(){return uh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return uh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return uh(this),this._fovy}},sseDenominator:{get:function(){return uh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return uh(this),this._offCenterFrustum}}});wl.prototype.computeCullingVolume=function(e,t,n){return uh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};wl.prototype.getPixelDimensions=function(e,t,n,i,o){return uh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};wl.prototype.clone=function(e){return d(e)||(e=new wl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};wl.prototype.equals=function(e){return!d(e)||!(e instanceof wl)?!1:(uh(this),uh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};wl.prototype.equalsEpsilon=function(e,t,n){return!d(e)||!(e instanceof wl)?!1:(uh(this),uh(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ri=wl;var x_i=T(S(),1);var a_i=T(S(),1),xv=`in vec2 v_textureCoordinates;
const float M_PI = 3.141592653589793;

float vdcRadicalInverse(int i)
{
    float r;
    float base = 2.0;
    float value = 0.0;
    float invBase = 1.0 / base;
    float invBi = invBase;
    for (int x = 0; x < 100; x++)
    {
        if (i <= 0)
        {
            break;
        }
        r = mod(float(i), base);
        value += r * invBi;
        invBi *= invBase;
        i = int(float(i) * invBase);
    }
    return value;
}

vec2 hammersley2D(int i, int N)
{
    return vec2(float(i) / float(N), vdcRadicalInverse(i));
}

vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)
{
    float a = roughness * roughness;
    float phi = 2.0 * M_PI * xi.x;
    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));
    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
    vec3 tangentX = normalize(cross(upVector, N));
    vec3 tangentY = cross(N, tangentX);
    return tangentX * H.x + tangentY * H.y + N * H.z;
}

float G1_Smith(float NdotV, float k)
{
    return NdotV / (NdotV * (1.0 - k) + k);
}

float G_Smith(float roughness, float NdotV, float NdotL)
{
    float k = roughness * roughness / 2.0;
    return G1_Smith(NdotV, k) * G1_Smith(NdotL, k);
}

vec2 integrateBrdf(float roughness, float NdotV)
{
    vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
    float A = 0.0;
    float B = 0.0;
    const int NumSamples = 1024;
    for (int i = 0; i < NumSamples; i++)
    {
        vec2 xi = hammersley2D(i, NumSamples);
        vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));
        vec3 L = 2.0 * dot(V, H) * H - V;
        float NdotL = clamp(L.z, 0.0, 1.0);
        float NdotH = clamp(H.z, 0.0, 1.0);
        float VdotH = clamp(dot(V, H), 0.0, 1.0);
        if (NdotL > 0.0)
        {
            float G = G_Smith(roughness, NdotV, NdotL);
            float G_Vis = G * VdotH / (NdotH * NdotV);
            float Fc = pow(1.0 - VdotH, 5.0);
            A += (1.0 - Fc) * G_Vis;
            B += Fc * G_Vis;
        }
    }
    return vec2(A, B) / float(NumSamples);
}

void main()
{
    out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
}
`;function _v(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(_v.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function uit(e,t,n){let i=t.createViewportQuadCommand(xv,{framebuffer:n,renderState:De.fromCache({viewport:new He(0,0,256,256)})});e._drawCommand=i}_v.prototype.update=function(e){if(!d(this._colorTexture)){let t=e.context,n=new Wt({context:t,width:256,height:256,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:dn.NEAREST});this._colorTexture=n;let i=new Us({context:t,colorTextures:[n],destroyAttachments:!1});uit(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};_v.prototype.isDestroyed=function(){return!1};_v.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var Tv=_v;var lTi=T(S(),1);var I_i=T(S(),1);var a0e={};function mit(e,t,n){let i,o,r;if(e instanceof Ri){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof Kc)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var hit=new h,o0e=new h;function c0e(e,t,n,i){if(d(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(l){let u=n(l);if(l<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let m=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-m)}}return function(o){return W.lerp(e,t,o)}}function YJ(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!d(r)){let a=e.position,c=t,l=e.up,u=e.right,m=e.frustum,p=h.subtract(a,c,hit),y=h.magnitude(h.multiplyByScalar(l,h.dot(p,l),o0e)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),o0e));r=Math.min(mit(m,y,f)*.2,1e9)}if(s<r){let l=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(u-l)+l;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function Sv(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var l0e=new h;function fit(e,t,n,i,o,r,s,a){let c=e.camera,l=h.clone(c.position,l0e),u=c.pitch,m=Sv(c.heading,i),p=Sv(c.roll,r),y=YJ(c,n,l.z,n.z,s),f=c0e(u,o,y,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:W.lerp(m,i,C),pitch:f(C),roll:W.lerp(p,r,C)}}),D.lerp(l,n,C,c.position),c.position.z=y(C)}return x}function pit(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function bit(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var yit=new he,git=new he;function xit(e,t,n,i,o,r,s,a,c,l){let u=e.camera,p=e.mapProjection.ellipsoid,y=he.clone(u.positionCartographic,yit),f=u.pitch,x=Sv(u.heading,i),_=Sv(u.roll,r),C=p.cartesianToCartographic(n,git);y.longitude=W.zeroToTwoPi(y.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(d(a)){let X=W.zeroToTwoPi(a),P=Math.min(y.longitude,C.longitude),v=Math.max(y.longitude,C.longitude),A=X>=P&&X<=v;if(d(c)){let M=Math.abs(y.longitude-C.longitude),b=W.TWO_PI-M;(A?M:b)<(A?b:M)*c&&!A&&(V=!0)}else A||(V=!0)}V?pit(y,C):bit(y,C);let L=YJ(u,n,y.height,C.height,s),Z=c0e(f,o,L,l);function G(){let X=y.longitude,P=C.longitude,v=y.latitude,A=C.latitude;return function(b){let R=b.time/t,E=h.fromRadians(W.lerp(X,P,R),W.lerp(v,A,R),L(R),p);u.setView({destination:E,orientation:{heading:W.lerp(x,i,R),pitch:Z(R),roll:W.lerp(_,r,R)}})}}return G()}function _it(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,l0e),l=Sv(a.heading,i),u=a.frustum.right-a.frustum.left,m=YJ(a,n,u,n.z,s);function p(y){let f=y.time/t;a.setView({orientation:{heading:W.lerp(l,i,f)}}),D.lerp(c,n,f,a.position);let x=m(f),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var r0e=new he,Tit=new h;function BJ(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function s0e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}a0e.createTween=function(e,t){t=g(t,g.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ie.MORPHING)return BJ();let o=g(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,l=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==ie.SCENE3D&&(s.cartesianToCartographic(n,r0e),n=r.project(r0e,Tit));let p=e.camera,y=t.endTransform;d(y)&&p._setTransform(y);let f=t.duration;d(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=g(t.heading,0),_=g(t.pitch,-W.PI_OVER_TWO),C=g(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=s0e(V,t.complete),Z=s0e(V,t.cancel),G=p.frustum,X=e.mode===ie.SCENE2D;if(X=X&&D.equalsEpsilon(p.position,n,W.EPSILON6),X=X&&W.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,W.EPSILON6),X=X||e.mode!==ie.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),X=X&&W.equalsEpsilon(W.negativePiToPi(x),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(C),W.negativePiToPi(p.roll),W.EPSILON10),X)return BJ(L,Z);let P=new Array(4);if(P[ie.SCENE2D]=_it,P[ie.SCENE3D]=xit,P[ie.COLUMBUS_VIEW]=fit,f<=0)return BJ(function(){P[i](e,1,n,x,_,C,a,c,l,u)({time:1}),typeof L=="function"&&L()},Z);let v=P[i](e,f,n,x,_,C,a,c,l,u);if(!d(m)){let A=p.positionCartographic.height,M=i===ie.SCENE3D?s.cartesianToCartographic(n).height:n.z;A>M&&A>11500?m=Wr.CUBIC_OUT:m=Wr.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:v,complete:L,cancel:Z}};var Cv=a0e;var P_i=T(S(),1),Sit={ROTATE:0,INFINITE_SCROLL:1},Fl=Object.freeze(Sit);function jt(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Ri,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new ye,this._moveEnd=new ye,this._changed=new ye,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,y0e(this),this._mode=ie.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,E0e(this,jt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*jt.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}jt.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);jt.TRANSFORM_2D_INVERSE=F.inverseTransformation(jt.TRANSFORM_2D,new F);jt.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-95,-20,-70,90);jt.DEFAULT_VIEW_FACTOR=.5;jt.DEFAULT_OFFSET=new Pu(0,-W.PI_OVER_FOUR,0);function y0e(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Cit(e){if(!d(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=gi()):e.timeSinceMoved=Math.max(gi()-e._lastMovedTimestamp,0)/1e3}}jt.prototype.canPreloadFlight=function(){return d(this._currentFlight)&&this._mode!==ie.SCENE2D};jt.prototype._updateCameraChanged=function(){let e=this;if(Cit(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;d(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;if(o>t&&(e._changed.raiseEvent(o),e._changedHeading=n),e._mode===ie.SCENE2D){if(!d(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let l=e.position,u=e._changedPosition,m=e.frustum,p=e._changedFrustum,y=l.x+m.left,f=l.x+m.right,x=u.x+p.left,_=u.x+p.right,C=l.y+m.bottom,V=l.y+m.top,L=u.y+p.bottom,Z=u.y+p.top,G=Math.max(y,x),X=Math.min(f,_),P=Math.max(C,L),v=Math.min(V,Z),A;if(G>=X||P>=V)A=1;else{let M=p;y<x&&f>_&&C<L&&V>Z&&(M=m),A=1-(X-G)*(v-P)/((M.right-M.left)*(M.top-M.bottom))}A>t&&(e._changed.raiseEvent(A),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!d(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let r=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),s;d(e.frustum.fovy)?s=r/(e.frustum.fovy*.5):s=r;let c=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function Vit(e){vt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Lit=new he,Rit=new h,rk=new h,Zit=new se,Git=new se,Eit=new se,Xit=new se,Iit=new se;function Wit(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,Zit),o=n.cartesianToCartographic(i,Lit),r=t.project(o,Rit),s=Git;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,Iit),c=se.add(F.getColumn(e._transform,0,rk),i,rk);n.cartesianToCartographic(c,o),t.project(o,r);let l=Eit;l.x=r.z,l.y=r.x,l.z=r.y,l.w=0,h.subtract(l,s,l),l.x=0;let u=Xit;if(h.magnitudeSquared(l)>W.EPSILON10)h.cross(a,l,u);else{let m=se.add(F.getColumn(e._transform,1,rk),i,rk);n.cartesianToCartographic(m,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0,h.magnitudeSquared(u)<W.EPSILON10&&(se.clone(se.UNIT_Y,l),se.clone(se.UNIT_Z,u))}h.cross(u,a,l),h.normalize(l,l),h.cross(a,l,u),h.normalize(u,u),F.setColumn(e._actualTransform,0,l,e._actualTransform),F.setColumn(e._actualTransform,1,u,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var OJ=new h;function lc(e){let t=e._mode,n=!1,i=0;t===ie.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,l=!h.equals(c,e.up);l&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let u=e._right,m=!h.equals(u,e.right);m&&(h.normalize(e.right,e.right),u=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===ie.COLUMBUS_VIEW||e._mode===ie.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(jt.TRANSFORM_2D,e._actualTransform):e._mode===ie.COLUMBUS_VIEW?Vit(e):Wit(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let y=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(y,o,e._positionWC),t===ie.SCENE3D||t===ie.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=OJ;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===ie.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||l||m){let f=h.dot(s,h.cross(c,u,OJ));if(Math.abs(1-f)>W.EPSILON2){let x=1/h.magnitudeSquared(c),_=h.dot(c,s)*x,C=h.multiplyByScalar(s,_,OJ);c=h.normalize(h.subtract(c,C,e._up),e._up),h.clone(c,e.up),u=h.cross(s,c,e._right),h.clone(u,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(y,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(l||p)&&(e._upWC=F.multiplyByPointAsVector(y,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=F.multiplyByPointAsVector(y,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||l||m||p)&&y0e(e)}function g0e(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function x0e(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function _0e(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var ck=new F,lk=new F;Object.defineProperties(jt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return lc(this),this._invTransform}},viewMatrix:{get:function(){return lc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return lc(this),this._invViewMatrix}},positionCartographic:{get:function(){return lc(this),this._positionCartographic}},positionWC:{get:function(){return lc(this),this._positionWC}},directionWC:{get:function(){return lc(this),this._directionWC}},upWC:{get:function(){return lc(this),this._upWC}},rightWC:{get:function(){return lc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,ck),n=vt.eastNorthUpToFixedFrame(this.positionWC,e,lk);this._setTransform(n);let i=g0e(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,ck),n=vt.eastNorthUpToFixedFrame(this.positionWC,e,lk);this._setTransform(n);let i=x0e(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,ck),n=vt.eastNorthUpToFixedFrame(this.positionWC,e,lk);this._setTransform(n);let i=_0e(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});jt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ie.MORPHING,t=this._mode===ie.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ie.SCENE2D&&V0e(this,this.position)};var Pit=new h,vit=new h,wit=new h;jt.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Pit),n=h.clone(this.upWC,vit),i=h.clone(this.directionWC,wit);F.clone(e,this._transform),this._transformChanged=!0,lc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),lc(this)};var Fit=new D,Ait=new Sn,Mit=new h,Nit=new h;function T0e(e){if(!F.equals(F.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Fit;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(d(n)){let a=e.getPickRay(i,Ait);o=n.pickWorldCoordinates(a,t,!0,Mit)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Nit));let s;if(d(o)||d(r)){let a=d(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=d(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}jt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof en&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=T0e(this)))};var dk=new h,QJ=new F,Uit=new F,jJ=new Ae,qJ=new $,S0e=new he;function kit(e,t,n){let i=F.clone(e.transform,QJ),o=vt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Uit);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Ae.fromHeadingPitchRoll(n,jJ),s=$.fromQuaternion(r,qJ);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Dit(e,t,n,i){let o=F.clone(e.transform,QJ);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,S0e);t=a.project(c,dk)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Ae.fromHeadingPitchRoll(n,jJ),s=$.fromQuaternion(r,qJ);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Bit(e,t,n,i){let o=F.clone(e.transform,QJ);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,l=c.ellipsoid.cartesianToCartographic(t,S0e);t=c.project(l,dk)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Fl.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Ae.fromHeadingPitchRoll(n,jJ),s=$.fromQuaternion(r,qJ);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Yit=new h,Oit=new h,Kit=new h;function C0e(e,t,n,i){let o=h.clone(n.direction,Yit),r=h.clone(n.up,Oit);if(e._scene.mode===ie.SCENE3D){let a=e._projection.ellipsoid,c=vt.eastNorthUpToFixedFrame(t,a,ck),l=F.inverseTransformation(c,lk);F.multiplyByPointAsVector(l,o,o),F.multiplyByPointAsVector(l,r,r)}let s=h.cross(o,r,Kit);return i.heading=g0e(o,r),i.pitch=x0e(o),i.roll=_0e(o,r,s),i}var JJ={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},oV=new Aa;jt.prototype.setView=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.orientation,g.EMPTY_OBJECT),n=this._mode;if(n===ie.MORPHING)return;d(e.endTransform)&&this._setTransform(e.endTransform);let i=g(e.convert,!0),o=g(e.destination,h.clone(this.positionWC,dk));d(o)&&d(o.west)&&(o=this.getRectangleCameraCoordinates(o,dk),i=!1),d(t.direction)&&(t=C0e(this,o,t,JJ.orientation)),oV.heading=g(t.heading,0),oV.pitch=g(t.pitch,-W.PI_OVER_TWO),oV.roll=g(t.roll,0),n===ie.SCENE3D?kit(this,o,oV):n===ie.SCENE2D?Bit(this,o,oV,i):Dit(this,o,oV,i)};var Hit=new h;jt.prototype.flyHome=function(e){let t=this._mode;if(t===ie.MORPHING&&this._scene.completeMorph(),t===ie.SCENE2D)this.flyTo({destination:jt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===ie.SCENE3D){let n=this.getRectangleCameraCoordinates(jt.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*jt.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===ie.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,Hit).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};jt.prototype.worldToCameraCoordinates=function(e,t){return d(t)||(t=new se),lc(this),F.multiplyByVector(this._actualInvTransform,e,t)};jt.prototype.worldToCameraCoordinatesPoint=function(e,t){return d(t)||(t=new h),lc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};jt.prototype.worldToCameraCoordinatesVector=function(e,t){return d(t)||(t=new h),lc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};jt.prototype.cameraToWorldCoordinates=function(e,t){return d(t)||(t=new se),lc(this),F.multiplyByVector(this._actualTransform,e,t)};jt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return d(t)||(t=new h),lc(this),F.multiplyByPoint(this._actualTransform,e,t)};jt.prototype.cameraToWorldCoordinatesVector=function(e,t){return d(t)||(t=new h),lc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function V0e(e,t){let n=e._scene.mapMode2D===Fl.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var d0e=new h;jt.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,d0e),h.add(n,d0e,n),this._mode===ie.SCENE2D&&V0e(this,n),this._adjustOrthographicFrustum(!0)};jt.prototype.moveForward=function(e){e=g(e,this.defaultMoveAmount),this._mode===ie.SCENE2D?uk(this,e):this.move(this.direction,e)};jt.prototype.moveBackward=function(e){e=g(e,this.defaultMoveAmount),this._mode===ie.SCENE2D?uk(this,-e):this.move(this.direction,-e)};jt.prototype.moveUp=function(e){e=g(e,this.defaultMoveAmount),this.move(this.up,e)};jt.prototype.moveDown=function(e){e=g(e,this.defaultMoveAmount),this.move(this.up,-e)};jt.prototype.moveRight=function(e){e=g(e,this.defaultMoveAmount),this.move(this.right,e)};jt.prototype.moveLeft=function(e){e=g(e,this.defaultMoveAmount),this.move(this.right,-e)};jt.prototype.lookLeft=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.up,-e)};jt.prototype.lookRight=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.up,e)};jt.prototype.lookUp=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.right,-e)};jt.prototype.lookDown=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.right,e)};var zit=new Ae,Jit=new $;jt.prototype.look=function(e,t){let n=g(t,this.defaultLookAmount),i=Ae.fromAxisAngle(e,-n,zit),o=$.fromQuaternion(i,Jit),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};jt.prototype.twistLeft=function(e){e=g(e,this.defaultLookAmount),this.look(this.direction,e)};jt.prototype.twistRight=function(e){e=g(e,this.defaultLookAmount),this.look(this.direction,-e)};var Qit=new Ae,jit=new $;jt.prototype.rotate=function(e,t){let n=g(t,this.defaultRotateAmount),i=Ae.fromAxisAngle(e,-n,Qit),o=$.fromQuaternion(i,jit);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};jt.prototype.rotateDown=function(e){e=g(e,this.defaultRotateAmount),L0e(this,e)};jt.prototype.rotateUp=function(e){e=g(e,this.defaultRotateAmount),L0e(this,-e)};var qit=new h,$it=new h,eot=new h,u0e=new h;function L0e(e,t){let n=e.position;if(d(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,qit),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,u0e),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,$it),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,u0e)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let l=h.cross(s,i,eot);e.rotate(l,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}jt.prototype.rotateRight=function(e){e=g(e,this.defaultRotateAmount),R0e(this,-e)};jt.prototype.rotateLeft=function(e){e=g(e,this.defaultRotateAmount),R0e(this,e)};function R0e(e,t){d(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function uk(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Fl.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Fl.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Z0e(e,t){e.move(e.direction,t)}jt.prototype.zoomIn=function(e){e=g(e,this.defaultZoomAmount),this._mode===ie.SCENE2D?uk(this,e):Z0e(this,e)};jt.prototype.zoomOut=function(e){e=g(e,this.defaultZoomAmount),this._mode===ie.SCENE2D?uk(this,-e):Z0e(this,-e)};jt.prototype.getMagnitude=function(){if(this._mode===ie.SCENE3D)return h.magnitude(this.position);if(this._mode===ie.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ie.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var tot=new F;jt.prototype.lookAt=function(e,t){let n=vt.eastNorthUpToFixedFrame(e,re.WGS84,tot);this.lookAtTransform(n,t)};var not=new h,iot=new Ae,oot=new Ae,rot=new $;function G0e(e,t,n){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let i=Ae.fromAxisAngle(h.UNIT_Y,-t,iot),o=Ae.fromAxisAngle(h.UNIT_Z,-e,oot),r=Ae.multiply(o,i,o),s=$.fromQuaternion(r,rot),a=h.clone(h.UNIT_X,not);return $.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}jt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!d(t))return;let n;if(d(t.heading)?n=G0e(t.heading,t.pitch,t.range):n=t,this._mode===ie.SCENE2D){D.clone(D.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<W.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(F.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<W.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var Vv=new he,sot=new he,aot=new h,cot=new h,lot=new h,dot=new h,uot=new h,mot=new h,hot=new h,KJ=new h,fot={direction:new h,right:new h,up:new h},m0e;function cc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function E0e(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:fot,s=t.north,a=t.south,c=t.east,l=t.west;l>c&&(c+=W.TWO_PI);let u=(l+c)*.5,m;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)m=0;else{let A=Vv;A.longitude=u,A.latitude=s,A.height=0;let M=sot;M.longitude=u,M.latitude=a,M.height=0;let b=m0e;(!d(b)||b.ellipsoid!==o)&&(m0e=b=new eu(void 0,void 0,o)),b.setEndPoints(A,M),m=b.interpolateUsingFraction(.5,Vv).latitude}let p=Vv;p.longitude=u,p.latitude=m,p.height=0;let y=o.cartographicToCartesian(p,hot),f=Vv;f.longitude=c,f.latitude=s;let x=o.cartographicToCartesian(f,aot);f.longitude=l;let _=o.cartographicToCartesian(f,lot);f.longitude=u;let C=o.cartographicToCartesian(f,uot);f.latitude=a;let V=o.cartographicToCartesian(f,mot);f.longitude=c;let L=o.cartographicToCartesian(f,dot);f.longitude=l;let Z=o.cartographicToCartesian(f,cot);h.subtract(_,y,_),h.subtract(L,y,L),h.subtract(x,y,x),h.subtract(Z,y,Z),h.subtract(C,y,C),h.subtract(V,y,V);let G=o.geodeticSurfaceNormal(y,r.direction);h.negate(G,G);let X=h.cross(G,h.UNIT_Z,r.right);h.normalize(X,X);let P=h.cross(X,G,r.up),v;if(e.frustum instanceof en){let A=Math.max(h.distance(x,_),h.distance(L,Z)),M=Math.max(h.distance(x,L),h.distance(_,Z)),b,R,E=e.frustum._offCenterFrustum,I=E.right/E.top,w=M*I;A>w?(b=A,R=b/I):(R=M,b=w),v=Math.max(b,R)}else{let A=Math.tan(e.frustum.fovy*.5),M=e.frustum.aspectRatio*A;if(v=Math.max(cc(G,P,_,A),cc(G,P,L,A),cc(G,P,x,A),cc(G,P,Z,A),cc(G,P,C,A),cc(G,P,V,A),cc(G,X,_,M),cc(G,X,L,M),cc(G,X,x,M),cc(G,X,Z,M),cc(G,X,C,M),cc(G,X,V,M)),a<0&&s>0){let b=Vv;b.longitude=l,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,KJ);h.subtract(R,y,R),v=Math.max(v,cc(G,P,R,A),cc(G,X,R,M)),b.longitude=c,R=o.cartographicToCartesian(b,KJ),h.subtract(R,y,R),v=Math.max(v,cc(G,P,R,A),cc(G,X,R,M))}}return h.add(y,h.multiplyByScalar(G,-v,KJ),n)}var pot=new he,bot=new h,yot=new h;function got(e,t,n){let i=e._projection;t.west>t.east&&(t=de.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=pot;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,bot);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,yot);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,d(e.frustum.fovy)){let l=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*l;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/l)*.5}else{let l=a.x-c.x,u=a.y-c.y;n.z=Math.max(l,u)}return n}var xot=new he,_ot=new h,Tot=new h;function Sot(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Fl.INFINITE_SCROLL?o+=W.TWO_PI:(t=de.MAX_VALUE,o=t.east));let r=xot;r.longitude=o,r.latitude=t.north;let s=i.project(r,_ot);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Tot),c=Math.abs(s.x-a.x)*.5,l=Math.abs(s.y-a.y)*.5,u,m,p=e.frustum.right/e.frustum.top,y=l*p;return c>y?(u=c,m=u/p):(m=l,u=y),l=Math.max(2*u,2*m),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=l,n=i.project(r,n),n}jt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(d(t)||(t=new h),n===ie.SCENE3D)return E0e(this,e,t);if(n===ie.COLUMBUS_VIEW)return got(this,e,t);if(n===ie.SCENE2D)return Sot(this,e,t)};var Cot=new Sn;function Vot(e,t,n,i){n=g(n,re.WGS84);let o=e.getPickRay(t,Cot),r=Si.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return Sn.getPoint(o,s,i)}var Lot=new Sn;function Rot(e,t,n,i){let r=e.getPickRay(t,Lot).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Zot=new Sn;function Got(e,t,n,i){let o=e.getPickRay(t,Zot),r=-o.origin.x/o.direction.x;Sn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}jt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(d(n)||(n=new h),t=g(t,re.WGS84),this._mode===ie.SCENE3D)n=Vot(this,e,t,n);else if(this._mode===ie.SCENE2D)n=Rot(this,e,this._projection,n);else if(this._mode===ie.COLUMBUS_VIEW)n=Got(this,e,this._projection,n);else return;return n}};var Eot=new h,Xot=new h,Iot=new h;function Wot(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,l=2/o*t.x-1,u=2/r*(r-t.y)-1,m=e.positionWC;h.clone(m,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Eot);h.add(m,p,p);let y=h.multiplyByScalar(e.rightWC,l*c*a,Xot),f=h.multiplyByScalar(e.upWC,u*c*s,Iot),x=h.add(p,y,n.direction);return h.add(x,f,x),h.subtract(x,m,x),h.normalize(x,x),n}var sk=new h;function Pot(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;d(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let l=2/r*(r-t.y)-1;l*=(s.top-s.bottom)*.5;let u=n.origin;return h.clone(e.position,u),h.multiplyByScalar(e.right,c,sk),h.add(sk,u,u),h.multiplyByScalar(e.up,l,sk),h.add(sk,u,u),h.clone(e.directionWC,n.direction),(e._mode===ie.COLUMBUS_VIEW||e._mode===ie.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}jt.prototype.getPickRay=function(e,t){d(t)||(t=new Sn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return d(i.aspectRatio)&&d(i.fov)&&d(i.near)?Wot(this,e,t):Pot(this,e,t)};var vot=new h,wot=new h;jt.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,vot),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),wot);return Math.max(0,h.magnitude(n)-e.radius)};var Fot=new D;jt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Fot);return Math.max(o.x,o.y)};function Aot(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let l=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(l,e.position)}return{easingFunction:Wr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Mot=new h,h0e=new h,Not=new h,Uot=new h;function kot(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,Mot),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,h0e),h0e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Not);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,l=h.magnitude(h.subtract(n,s,Uot)),u=c*l,m=a*l,p=e._maxCoord.x,y=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(m-y,y);if(n.z<-f||n.z>f||n.y<-x||n.y>x){let _=s.y<-f||s.y>f,C=s.z<-x||s.z>x;if(_||C)return Aot(e,n,s,f,x,t)}}jt.prototype.createCorrectPositionTween=function(e){if(this._mode===ie.COLUMBUS_VIEW)return kot(this,e)};var Dot=new h,Fs={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};jt.prototype.cancelFlight=function(){d(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};jt.prototype.completeFlight=function(){if(d(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Fs.destination,e.orientation.heading=Fs.heading,e.orientation.pitch=Fs.pitch,e.orientation.roll=Fs.roll,this.setView(e),d(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};jt.prototype.flyTo=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.destination;if(this._mode===ie.MORPHING)return;this.cancelFlight();let i=t instanceof de;i&&(t=this.getRectangleCameraCoordinates(t,Dot));let o=g(e.orientation,g.EMPTY_OBJECT);if(d(o.direction)&&(o=C0e(this,t,o,JJ.orientation)),d(e.duration)&&e.duration<=0){let u=JJ;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;Fs.destination=t,Fs.heading=o.heading,Fs.pitch=o.pitch,Fs.roll=o.roll,Fs.duration=e.duration,Fs.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),d(e.complete)&&e.complete()},Fs.cancel=e.cancel,Fs.endTransform=e.endTransform,Fs.convert=i?!1:e.convert,Fs.maximumHeight=e.maximumHeight,Fs.pitchAdjustHeight=e.pitchAdjustHeight,Fs.flyOverLongitude=e.flyOverLongitude,Fs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Fs.easingFunction=e.easingFunction;let a=this._scene,c=Cv.createTween(a,Fs);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let l=this._scene.preloadFlightCamera;this._mode!==ie.SCENE2D&&(d(l)||(l=jt.clone(this)),l.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=l.frustum.computeCullingVolume(l.positionWC,l.directionWC,l.upWC))};function Bot(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Yot(e,t){let n=e.frustum,i=n.offCenterFrustum;d(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Oot=100;function X0e(e,t,n){n=Pu.clone(d(n)?n:jt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!d(r)||r===0){let s=t.radius;s===0?n.range=Oot:e.frustum instanceof en||e._mode===ie.SCENE2D?n.range=Yot(e,s):n.range=Bot(e,s),n.range=W.clamp(n.range,i,o)}return n}jt.prototype.viewBoundingSphere=function(e,t){t=X0e(this,e,t),this.lookAt(e.center,t)};var Kot=new F,Hot=new h,zot=new h,Jot=new h,Qot=new h,jot=new se,qot=new Ae,$ot=new $;jt.prototype.flyToBoundingSphere=function(e,t){t=g(t,g.EMPTY_OBJECT);let n=this._mode===ie.SCENE2D||this._mode===ie.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=X0e(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,Hot):o=G0e(i.heading,i.pitch,i.range);let r=vt.eastNorthUpToFixedFrame(e.center,re.WGS84,Kot);F.multiplyByPoint(r,o,o);let s,a;if(!n){if(s=h.subtract(e.center,o,zot),h.normalize(s,s),a=F.multiplyByPointAsVector(r,h.UNIT_Z,Jot),1-Math.abs(h.dot(s,a))<W.EPSILON6){let l=Ae.fromAxisAngle(s,i.heading,qot),u=$.fromQuaternion(l,$ot);h.fromCartesian4(F.getColumn(r,1,jot),a),$.multiplyByVector(u,a,a)}let c=h.cross(s,a,Qot);h.cross(c,s,a),h.normalize(a,a)}this.flyTo({destination:o,orientation:{direction:s,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var f0e=new h,p0e=new h,HJ=new h,b0e=new h,Lv=[new h,new h,new h,new h];function ert(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,f0e),r=h.magnitude(o),s=h.normalize(o,p0e),a,c;h.equalsEpsilon(s,h.UNIT_Z,W.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,HJ),HJ),c=h.normalize(h.cross(s,a,b0e),b0e));let l=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,f0e),m=l/r,p=h.multiplyByScalar(a,m,p0e),y=h.multiplyByScalar(c,m,HJ),f=h.add(u,y,Lv[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let x=h.subtract(u,y,Lv[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let _=h.subtract(u,y,Lv[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let C=h.add(u,y,Lv[3]);return h.add(C,p,C),h.multiplyComponents(n,C,C),Lv}var zJ=new D,trt=new h,By=[new he,new he,new he,new he];function ak(e,t,n,i,o,r){zJ.x=e,zJ.y=t;let s=i.pickEllipsoid(zJ,o,trt);return d(s)?(By[n]=o.cartesianToCartographic(s,By[n]),1):(By[n]=o.cartesianToCartographic(r[n],By[n]),0)}jt.prototype.computeViewRectangle=function(e,t){e=g(e,re.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ce(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===qt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,l=ert(this,e);if(c+=ak(0,0,0,this,e,l),c+=ak(0,a,1,this,e,l),c+=ak(s,a,2,this,e,l),c+=ak(s,0,3,this,e,l),c<2)return de.MAX_VALUE;t=de.fromCartographicArray(By,t);let u=0,m=By[3].longitude;for(let p=0;p<4;++p){let y=By[p].longitude,f=Math.abs(y-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=y}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,By[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};jt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ie.SCENE2D||this.frustum instanceof Ri)return;let e=this._scene;this.frustum=new Ri,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};jt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ie.SCENE2D||this.frustum instanceof en)return;let e=T0e(this),t=this._scene;this.frustum=new en,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};jt.clone=function(e,t){return d(t)||(t=new jt(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var co=jt;var uTi=T(S(),1);function nrt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Du=nrt;var xTi=T(S(),1);var w0e=T(Dl(),1),I0e=576,irt=100,Rv="#ffffff",$J="#48b";function F0e(e,t){this.credit=e,this.count=g(t,1)}function ort(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(St.equals(o,t))return!0}return!1}function rrt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;St.equals(n,t)||(d(t)&&e._cesiumCreditContainer.removeChild(t.element),d(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var A0e="cesium-credit-delimiter";function W0e(e){let t=document.createElement("span");return t.textContent=e,t.className=A0e,t}function P0e(e,t){if(d(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function v0e(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(d(a)){if(r=s,d(n)&&(r*=2,s>0)){let l=r-1;if(o.length<=l)e.appendChild(W0e(n));else{let u=o[l];u.className!==A0e&&e.replaceChild(W0e(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(P0e(c,i));else{let l=o[r];l._creditId!==a._id&&e.replaceChild(P0e(c,i),l)}}}for(++r;r<o.length;)e.removeChild(o[r])}function srt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<I0e?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=I0e&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function dc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` }
`,n}function art(e){let t="";t+=dc(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),t+=dc(".cesium-credit-lightbox",{"background-color":"#303336",color:Rv,position:"relative","min-height":`${irt}px`,margin:"auto"}),t+=dc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:Rv}),t+=dc(".cesium-credit-lightbox > ul > li a:hover",{color:$J}),t+=dc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=dc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=dc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=dc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:Rv}),t+=dc(".cesium-credit-lightbox-close:hover",{color:$J}),t+=dc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=dc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=dc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=dc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:Rv}),t+=dc(".cesium-credit-expand-link:hover",{color:$J}),t+=dc(".cesium-credit-text",{color:Rv}),t+=dc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=g(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function ar(e,t,n){let i=this;n=g(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let l=document.createElement("ul");r.appendChild(l);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let m=document.createElement("div");m.className="cesium-credit-textContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),art(e);let y=St.clone(ar.cesiumCredit);this._delimiter=g(t," \u2022 "),this._screenContainer=m,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=l,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=y,this._previousCesiumCredit=void 0,this._currentCesiumCredit=y,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Tt,lightboxCredits:new Tt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function M0e(e,t,n,i){i=g(i,1);let o=t.get(n.id);if(d(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new F0e(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}ar.prototype.addCreditToNextFrame=function(e){if(e.isIon()){d(this._defaultCredit)||(this._defaultCredit=St.clone(N0e())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,M0e(this,t,e)};ar.prototype.addStaticCredit=function(e){let t=this._staticCredits;ort(t,e)||t.push(e)};ar.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};ar.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};ar.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};ar.prototype.update=function(){this._expanded&&srt(this)};ar.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&St.equals(ar.cesiumCredit,this._cesiumCredit)||M0e(this,s,r,Number.MAX_VALUE)}St.equals(ar.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=St.clone(ar.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};ar.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;v0e(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",v0e(this._creditList,t,void 0,"li"),rrt(this)};ar.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};ar.prototype.isDestroyed=function(){return!1};ar._cesiumCredit=void 0;ar._cesiumCreditInitialized=!1;var mk;function N0e(){if(!d(mk)){let e=$t("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new w0e.default(e).path()),mk=new St(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return ar._cesiumCreditInitialized||(ar._cesiumCredit=mk,ar._cesiumCreditInitialized=!0),mk}Object.defineProperties(ar,{cesiumCredit:{get:function(){return N0e(),ar._cesiumCredit},set:function(e){ar._cesiumCredit=e,ar._cesiumCreditInitialized=!0}}});ar.CreditDisplayElement=F0e;var Zv=ar;var ySi=T(S(),1);var ATi=T(S(),1);var hk=0,crt=1;function J_(e){let t=e.frustum,n=e.orientation,i=e.origin,o=g(e.vertexFormat,We.DEFAULT),r=g(e._drawNearPlane,!0),s,a;t instanceof Ri?(s=hk,a=Ri.packedLength):t instanceof en&&(s=crt,a=en.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ae.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Ae.packedLength+We.packedLength}J_.pack=function(e,t,n){n=g(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===hk?(Ri.pack(o,t,n),n+=Ri.packedLength):(en.pack(o,t,n),n+=en.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ae.pack(e._orientation,t,n),n+=Ae.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._drawNearPlane?1:0,t};var lrt=new Ri,drt=new en,urt=new Ae,mrt=new h,hrt=new We;J_.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o;i===hk?(o=Ri.unpack(e,t,lrt),t+=Ri.packedLength):(o=en.unpack(e,t,drt),t+=en.packedLength);let r=h.unpack(e,t,mrt);t+=h.packedLength;let s=Ae.unpack(e,t,urt);t+=Ae.packedLength;let a=We.unpack(e,t,hrt);t+=We.packedLength;let c=e[t]===1;if(!d(n))return new J_({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Ae.clone(s,n._orientation),n._vertexFormat=We.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function rV(e,t,n,i,o,r,s,a){let c=e/3*2;for(let l=0;l<4;++l)d(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),d(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),d(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var frt=new $,prt=new F,eQ=new F,U0e=new h,k0e=new h,D0e=new h,brt=new h,yrt=new h,grt=new h,Yy=new Array(3),Gv=new Array(4);Gv[0]=new se(-1,-1,1,1);Gv[1]=new se(1,-1,1,1);Gv[2]=new se(1,1,1,1);Gv[3]=new se(-1,1,1,1);var B0e=new Array(4);for(let e=0;e<4;++e)B0e[e]=new se;J_._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,frt),l=g(r,U0e),u=g(s,k0e),m=g(a,D0e);l=$.getColumn(c,0,l),u=$.getColumn(c,1,u),m=$.getColumn(c,2,m),h.normalize(l,l),h.normalize(u,u),h.normalize(m,m),h.negate(l,l);let p=F.computeView(e,m,u,l,prt),y,f,x=i.projectionMatrix;if(n===hk){let _=F.multiply(x,p,eQ);f=F.inverse(_,eQ)}else y=F.inverseTransformation(p,eQ);d(f)?(Yy[0]=i.near,Yy[1]=i.far):(Yy[0]=0,Yy[1]=i.near,Yy[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(Gv[C],B0e[C]);if(d(f)){V=F.multiplyByVector(f,V,V);let L=1/V.w;h.multiplyByScalar(V,L,V),h.subtract(V,e,V),h.normalize(V,V);let Z=h.dot(m,V);h.multiplyByScalar(V,Yy[_]/Z,V),h.add(V,e,V)}else{let L=i.offCenterFrustum;d(L)&&(i=L);let Z=Yy[_],G=Yy[_+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(Z-G)-Z-G)*.5,V.w=1,F.multiplyByVector(y,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};J_.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);J_._computeNearFarPlanes(i,o,t,n,c);let l=3*4*2;c[l]=c[3*4],c[l+1]=c[3*4+1],c[l+2]=c[3*4+2],c[l+3]=c[0],c[l+4]=c[1],c[l+5]=c[2],c[l+6]=c[3*3],c[l+7]=c[3*3+1],c[l+8]=c[3*3+2],c[l+9]=c[3*7],c[l+10]=c[3*7+1],c[l+11]=c[3*7+2],l+=3*4,c[l]=c[3*5],c[l+1]=c[3*5+1],c[l+2]=c[3*5+2],c[l+3]=c[3],c[l+4]=c[3+1],c[l+5]=c[3+2],c[l+6]=c[0],c[l+7]=c[1],c[l+8]=c[2],c[l+9]=c[3*4],c[l+10]=c[3*4+1],c[l+11]=c[3*4+2],l+=3*4,c[l]=c[3],c[l+1]=c[3+1],c[l+2]=c[3+2],c[l+3]=c[3*5],c[l+4]=c[3*5+1],c[l+5]=c[3*5+2],c[l+6]=c[3*6],c[l+7]=c[3*6+1],c[l+8]=c[3*6+2],c[l+9]=c[3*2],c[l+10]=c[3*2+1],c[l+11]=c[3*2+2],l+=3*4,c[l]=c[3*2],c[l+1]=c[3*2+1],c[l+2]=c[3*2+2],c[l+3]=c[3*6],c[l+4]=c[3*6+1],c[l+5]=c[3*6+2],c[l+6]=c[3*7],c[l+7]=c[3*7+1],c[l+8]=c[3*7+2],c[l+9]=c[3*3],c[l+10]=c[3*3+1],c[l+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(d(s.normal)||d(s.tangent)||d(s.bitangent)||d(s.st)){let p=d(s.normal)?new Float32Array(12*a):void 0,y=d(s.tangent)?new Float32Array(3*4*a):void 0,f=d(s.bitangent)?new Float32Array(3*4*a):void 0,x=d(s.st)?new Float32Array(2*4*a):void 0,_=U0e,C=k0e,V=D0e,L=h.negate(_,brt),Z=h.negate(C,yrt),G=h.negate(V,grt);l=0,r&&(rV(l,p,y,f,x,G,_,C),l+=3*4),rV(l,p,y,f,x,V,L,C),l+=3*4,rV(l,p,y,f,x,L,G,C),l+=3*4,rV(l,p,y,f,x,Z,G,L),l+=3*4,rV(l,p,y,f,x,_,V,C),l+=3*4,rV(l,p,y,f,x,C,V,L),d(p)&&(u.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),d(y)&&(u.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),d(f)&&(u.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),d(x)&&(u.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:x}))}let m=new Uint16Array(6*a);for(let p=0;p<a;++p){let y=p*6,f=p*4;m[y]=f,m[y+1]=f+1,m[y+2]=f+2,m[y+3]=f,m[y+4]=f+2,m[y+5]=f+3}return new dt({attributes:u,indices:m,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromVertices(c)})};var Q_=J_;var qTi=T(S(),1);var tQ=0,xrt=1;function Ev(e){let t=e.frustum,n=e.orientation,i=e.origin,o=g(e._drawNearPlane,!0),r,s;t instanceof Ri?(r=tQ,s=Ri.packedLength):t instanceof en&&(r=xrt,s=en.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ae.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Ae.packedLength}Ev.pack=function(e,t,n){n=g(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===tQ?(Ri.pack(o,t,n),n+=Ri.packedLength):(en.pack(o,t,n),n+=en.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ae.pack(e._orientation,t,n),n+=Ae.packedLength,t[n]=e._drawNearPlane?1:0,t};var _rt=new Ri,Trt=new en,Srt=new Ae,Crt=new h;Ev.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o;i===tQ?(o=Ri.unpack(e,t,_rt),t+=Ri.packedLength):(o=en.unpack(e,t,Trt),t+=en.packedLength);let r=h.unpack(e,t,Crt);t+=h.packedLength;let s=Ae.unpack(e,t,Srt);t+=Ae.packedLength;let a=e[t]===1;if(!d(n))return new Ev({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Ae.clone(s,n._orientation),n._drawNearPlane=a,n};Ev.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);Q_._computeNearFarPlanes(i,o,t,n,s);let a=new hn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,l,u=r?2:1,m=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,l=p*4,m[c]=l,m[c+1]=l+1,m[c+2]=l+1,m[c+3]=l+2,m[c+4]=l+2,m[c+5]=l+3,m[c+6]=l+3,m[c+7]=l;for(p=0;p<2;++p)c=(u+p)*8,l=p*4,m[c]=l,m[c+1]=l+4,m[c+2]=l+1,m[c+3]=l+5,m[c+4]=l+2,m[c+5]=l+6,m[c+6]=l+3,m[c+7]=l+7;return new dt({attributes:a,indices:m,primitiveType:Fe.LINES,boundingSphere:ce.fromVertices(s)})};var Xv=Ev;function fk(e){e=g(e,g.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=g(e.color,B.CYAN),this._updateOnChange=g(e.updateOnChange,!0),this.show=g(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Vrt=new h,Lrt=new $,Rrt=new Ae,Zrt=new Ri,Grt=new Kc,Ert=new en,Xrt=new yr,Irt=new B,Wrt=[1,1e5];fk.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ri?a=Zrt:s instanceof Kc?a=Grt:s instanceof en?a=Ert:a=Xrt,a=s.clone(a);let c,l=this._frustumSplits;!d(l)||l.length<=1?(l=Wrt,l[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far,c=1):c=l.length-1;let u=r.positionWC,m=r.directionWC,p=r.upWC,y=r.rightWC;y=h.negate(y,Vrt);let f=Lrt;$.setColumn(f,0,y,f),$.setColumn(f,1,p,f),$.setColumn(f,2,m,f);let x=Ae.fromRotationMatrix(f,Rrt);for(t.length=n.length=c,i=0;i<c;++i)a.near=l[i],a.far=l[i+1],t[i]=new Zn({geometryInstances:new _t({geometry:new Q_({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ut.fromColor(B.fromAlpha(this._color,.1,Irt))},id:this.id,pickPrimitive:this}),appearance:new sn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Zn({geometryInstances:new _t({geometry:new Xv({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ut.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};fk.prototype.isDestroyed=function(){return!1};fk.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var Zf=fk;var YSi=T(S(),1);var xSi=T(S(),1),Iv=`in vec4 positionEC;

void main()
{
    vec3 position;
    vec3 direction;
    if (czm_orthographicIn3D == 1.0)
    {
        vec2 uv = (gl_FragCoord.xy -  czm_viewport.xy) / czm_viewport.zw;
        vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
        vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
        position = vec3(mix(minPlane, maxPlane, uv), 0.0);
        direction = vec3(0.0, 0.0, -1.0);
    } 
    else 
    {
        position = vec3(0.0);
        direction = normalize(positionEC.xyz);
    }

    czm_ray ray = czm_ray(position, direction);

    vec3 ellipsoid_center = czm_view[3].xyz;

    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
    if (!czm_isEmpty(intersection))
    {
        out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
    }
    else
    {
        discard;
    }

    czm_writeLogDepth();
}
`;var TSi=T(S(),1),Wv=`in vec4 position;

out vec4 positionEC;

void main()
{
    positionEC = czm_modelView * position;
    gl_Position = czm_projection * positionEC;

    czm_vertexLogDepth();
}
`;function vv(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=g(e,0)}var Pv=Mt.supportsTypedArrays()?new Float32Array(12):[],Y0e=new h,O0e=new h,nQ=new h,K0e=new h,pk=new h;function Prt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof en)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,Y0e),y=h.normalize(p,O0e),f=h.normalize(h.cross(h.UNIT_Z,p,nQ),nQ),x=h.normalize(h.cross(y,f,K0e),K0e),_=h.magnitude(p),C=Math.sqrt(_*_-1);o=h.multiplyByScalar(y,1/_,Y0e);let V=C/_;r=h.multiplyByScalar(f,V,O0e),s=h.multiplyByScalar(x,V,nQ)}let a=h.add(o,s,pk);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,Pv,0);let c=h.subtract(o,s,pk);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,Pv,3);let l=h.add(o,s,pk);h.add(l,r,l),h.multiplyComponents(n,l,l),h.pack(l,Pv,6);let u=h.subtract(o,s,pk);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,Pv,9),Pv}vv.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ie.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(d(this._command)||(this._rs=De.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ce(h.ZERO,i.maximumRadius),pass:Re.OPAQUE,owner:this})),!d(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Be({sources:[Wv]}),a=new Be({sources:[Iv]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Prt(i,e);if(d(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new dt({attributes:{position:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Fe.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};vv.prototype.execute=function(e,t){this._mode===ie.SCENE3D&&this._command.execute(e,t)};vv.prototype.isDestroyed=function(){return!1};vv.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var wv=vv;var QSi=T(S(),1);function Fv(){}var vrt=/\bgl_FragDepth\b/,wrt=/\bdiscard\b/;function Frt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!d(n)){let i=t._attributeLocations,o=t.fragmentShaderSource,r,s=!1,a=o.sources,c=a.length;for(r=0;r<c;++r)if(vrt.test(a[r])||wrt.test(a[r])){s=!0;break}let l=!1,u=o.defines;for(c=u.length,r=0;r<c;++r)if(u[r]==="LOG_DEPTH"){l=!0;break}let m;!s&&!l?(m=`void main() 
{ 
    out_FragColor = vec4(1.0); 
} 
`,o=new Be({sources:[m]})):!s&&l&&(m=`void main() 
{ 
    out_FragColor = vec4(1.0); 
    czm_writeLogDepth(); 
} 
`,o=new Be({defines:["LOG_DEPTH"],sources:[m]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}function Art(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!d(i)){let o=De.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=De.fromCache(o),n[t.id]=i}return i}Fv.createDepthOnlyDerivedCommand=function(e,t,n,i){d(i)||(i={});let o,r;return d(i.depthOnlyCommand)&&(o=i.depthOnlyCommand.shaderProgram,r=i.depthOnlyCommand.renderState),i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!d(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Frt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Art(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Mrt=/\s+czm_writeLogDepth\(/,Nrt=/\s+czm_vertexLogDepth\(/;function Urt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!d(i)){let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=d(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=d(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,l=!1,u=r.sources,m=u.length;for(a=0;a<m;++a)if(Nrt.test(u[a])){l=!0;break}if(!l){for(a=0;a<m;++a)u[a]=Be.replaceMain(u[a],"czm_log_depth_main");c=`

void main() 
{ 
    czm_log_depth_main(); 
    czm_vertexLogDepth(); 
} 
`,u.push(c)}for(u=s.sources,m=u.length,l=!1,a=0;a<m;++a)Mrt.test(u[a])&&(l=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(l=!0);let p="";if(!l){for(a=0;a<m;a++)u[a]=Be.replaceMain(u[a],"czm_log_depth_main");p+=`
void main() 
{ 
    czm_log_depth_main(); 
    czm_writeLogDepth(); 
} 
`}u.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}return i}Fv.createLogDepthCommand=function(e,t,n){d(n)||(n={});let i;return d(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!d(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Urt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function krt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!d(i)){let o=t._attributeLocations,r=t.fragmentShaderSource,s=r.sources,a=s.length,l=s.some(p=>p.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () 
{ 
    czm_non_pick_main(); 
    if (${l}.a == 0.0) { 
        discard; 
    } 
    ${l} = ${n}; 
} `,m=new Array(a+1);for(let p=0;p<a;++p)m[p]=Be.replaceMain(s[p],"czm_non_pick_main");m[a]=u,r=new Be({sources:m,defines:r.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:o})}return i}function Drt(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!d(i)){let o=De.getState(t);o.blending.enabled=!1,o.depthMask=!0,i=De.fromCache(o),n[t.id]=i}return i}Fv.createPickDerivedCommand=function(e,t,n,i){d(i)||(i={});let o,r;return d(i.pickCommand)&&(o=i.pickCommand.shaderProgram,r=i.pickCommand.renderState),i.pickCommand=nt.shallowClone(t,i.pickCommand),!d(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=krt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Drt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function Brt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!d(n)){let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();o.defines=d(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=d(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}return n}Fv.createHdrCommand=function(e,t,n){d(n)||(n={});let i;return d(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!d(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Brt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var F0=Fv;var iCi=T(S(),1);function bk(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!d(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Yrt=new Ae,H0e=new Ae,Ort=new $;function Krt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Ae.fromAxisAngle(o,n,H0e),c=Ae.fromAxisAngle(r,i,Yrt),l=Ae.multiply(c,a,c),u=Ae.fromAxisAngle(s,t,H0e);Ae.multiply(u,l,l);let m=$.fromQuaternion(l,Ort);$.multiplyByVector(m,r,r),$.multiplyByVector(m,s,s),$.multiplyByVector(m,o,o)}bk.prototype.update=function(){if(!d(this._alpha))return;d(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Krt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};bk.prototype.isDestroyed=function(){return!1};bk.prototype.destroy=function(){return this._removeListener(),ue(this)};var Av=bk;var lCi=T(S(),1);function z0e(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var yk=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],Gf=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<Gf.length;++e)Gf[e]*=1e6;var J0e=Gf[1],iQ=Gf[Gf.length-1];for(let e=0;e<Gf.length;++e)Gf[e]=(Gf[e]-iQ)/(J0e-iQ);var ia=0;function Hrt(e){let t=yk,n=t.length;if(e<t[0])return ia=0,ia;if(e>t[n-1])return ia=n-2,ia;if(e>=t[ia]){if(ia+1<n&&e<t[ia+1])return ia;if(ia+2<n&&e<t[ia+2])return++ia,ia}else if(ia-1>=0&&e>=t[ia-1])return--ia,ia;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ia=i,ia}var zrt=new h;z0e.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!d(i)||i.height>8e5||e.mode!==ie.SCENE3D){e.fog.enabled=!1;return}let o=i.height,r=Hrt(o),s=W.clamp((o-yk[r])/(yk[r+1]-yk[r]),0,1),a=W.lerp(Gf[r],Gf[r+1],s),c=this.density*1e6,l=c/J0e*iQ;a=a*(c-l)*1e-6;let u=h.normalize(n.positionWC,zrt),m=Math.abs(h.dot(n.directionWC,u));a*=1-m,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Mv=z0e;var mCi=T(S(),1);function Jrt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ie.SCENE3D,this.morphTime=ie.getMorphTime(ie.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var Nv=Jrt;var RCi=T(S(),1);var oa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},j_=oa.DERIVED_COMMANDS_MAXIMUM_LENGTH,rbe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function q_(){this._frontFaceAlphaByDistance=new Pt(0,1,0,1),this._backFaceAlphaByDistance=new Pt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=de.clone(de.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(j_),this._derivedBlendCommandTypes=new Array(j_),this._derivedPickCommandTypes=new Array(j_),this._derivedCommandTypesToUpdate=new Array(j_),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(q_.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});q_.prototype.update=function(e){let t=e.globe;if(!d(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Q0e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Q0e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=j0e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=j0e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=$rt(this,e,t),this._sunVisibleThroughGlobe=Qrt(this,e),this._environmentVisible=jrt(this,e),this._useDepthPlane=qrt(this,e),this._numberOfTextureUniforms=est(this),this._rectangle=de.clone(t.translucency.rectangle,this._rectangle),tst(this,e)};function Q0e(e,t,n,i){return e?d(n)?(Pt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function j0e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Qrt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function jrt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function qrt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function $rt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ie.SCENE2D&&t.context.depthTexture}function est(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function tst(e,t){e._derivedCommandsLength=oQ(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=oQ(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=oQ(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<j_;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!d(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=bst())}function oQ(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,l=e._requiresManualDepthTest,u=i?oa.PICK_FRONT_FACE:l?oa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:oa.TRANSLUCENT_FRONT_FACE,m=i?oa.PICK_BACK_FACE:l?oa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:oa.TRANSLUCENT_BACK_FACE;return t.mode===ie.SCENE2D?(o[r++]=oa.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=oa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=oa.DEPTH_ONLY_BACK_FACE),o[r++]=oa.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=oa.DEPTH_ONLY_FRONT_FACE),o[r++]=oa.OPAQUE_BACK_FACE,o[r++]=u),r)}function Bu(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function q0e(e,t){return e.indexOf(t)>-1}function nst(e,t){Bu(e.defines,"TRANSLUCENT"),Bu(t.defines,"TRANSLUCENT")}function ist(e,t){Bu(e.defines,"GROUND_ATMOSPHERE"),Bu(t.defines,"GROUND_ATMOSPHERE"),Bu(e.defines,"FOG"),Bu(t.defines,"FOG"),Bu(e.defines,"TRANSLUCENT"),Bu(t.defines,"TRANSLUCENT")}function rQ(e,t){if(q0e(t.defines,"TILE_LIMIT_RECTANGLE")||q0e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() 
{ 
    out_FragColor = vec4(1.0); 
} 
`;t.sources=[n]}function sQ(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Be.replaceMain(n[r],"czm_globe_translucency_main");let o=`

uniform sampler2D u_classificationTexture; 
void main() 
{ 
    vec2 st = gl_FragCoord.xy / czm_viewport.zw; 
#ifdef MANUAL_DEPTH_TEST 
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); 
    if (logDepthOrDepth != 0.0) 
    { 
        vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); 
        float depthEC = eyeCoordinate.z / eyeCoordinate.w; 
        if (v_positionEC.z < depthEC) 
        { 
            discard; 
        } 
    } 
#endif 
    czm_globe_translucency_main(); 
    vec4 classificationColor = texture(u_classificationTexture, st); 
    if (classificationColor.a > 0.0) 
    { 
        // Reverse premultiplication process to get the correct composited result of the classification primitives 
        classificationColor.rgb /= classificationColor.a; 
    } 
    out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); 
} 
`;n.push(o)}function sbe(e,t){sQ(e,t),Bu(e.defines,"GROUND_ATMOSPHERE"),Bu(t.defines,"GROUND_ATMOSPHERE"),Bu(e.defines,"FOG"),Bu(t.defines,"FOG")}function ost(e,t){sQ(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function rst(e,t){sbe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function $0e(e,t){let n=`uniform sampler2D u_classificationTexture; 
void main() 
{ 
    vec2 st = gl_FragCoord.xy / czm_viewport.zw; 
    vec4 pickColor = texture(u_classificationTexture, st); 
    if (pickColor == vec4(0.0)) 
    { 
        discard; 
    } 
    out_FragColor = pickColor; 
} 
`;t.sources=[n]}function sst(e,t,n,i,o,r){if(!d(o))return t;if(!i&&d(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!d(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),l=t.fragmentShaderSource.clone();c.defines=d(c.defines)?c.defines.slice(0):[],l.defines=d(l.defines)?l.defines.slice(0):[],o(c,l),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:l,attributeLocations:a})}return s}function ast(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function cst(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function lst(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function dst(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ust(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ebe(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function tbe(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function mst(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function hst(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function fst(e,t,n,i,o){if(!d(i))return e;if(!n&&d(t))return t;let r=o[e.id];if(!d(r)){let s=De.getState(e);i(s),r=De.fromCache(s),o[e.id]=r}return r}function sV(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function pst(e,t,n,i,o){return d(o)?!i&&d(n)?n:xt(t,o(e),!1):t}function mh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function bst(){return[new mh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:nst,getRenderStateFunction:ast,getUniformMapFunction:void 0}),new mh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:ist,getRenderStateFunction:cst,getUniformMapFunction:void 0}),new mh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:rQ,getRenderStateFunction:lst,getUniformMapFunction:void 0}),new mh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:rQ,getRenderStateFunction:dst,getUniformMapFunction:void 0}),new mh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:rQ,getRenderStateFunction:ust,getUniformMapFunction:void 0}),new mh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:sQ,getRenderStateFunction:ebe,getUniformMapFunction:sV}),new mh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:sbe,getRenderStateFunction:tbe,getUniformMapFunction:sV}),new mh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ost,getRenderStateFunction:ebe,getUniformMapFunction:sV}),new mh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:rst,getRenderStateFunction:tbe,getUniformMapFunction:sV}),new mh({pass:Re.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:$0e,getRenderStateFunction:mst,getUniformMapFunction:sV}),new mh({pass:Re.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:$0e,getRenderStateFunction:hst,getUniformMapFunction:sV})]}var nbe=new Array(j_),ibe=new Array(j_);q_.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)ibe[o]=this._derivedCommandPacks[n[o]],nbe[o]=rbe[n[o]];yst(this,e,i,n,nbe,ibe,t)}};function yst(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!d(a)||c){t.dirty=!1,d(a)||(a={},t.derivedCommands.globeTranslucency=a);let l=s.frameNumber,u=g(a.uniformMapDirtyFrame,0),m=g(a.shaderProgramDirtyFrame,0),p=g(a.renderStateDirtyFrame,0),y=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;y&&(a.uniformMapDirtyFrame=l),f&&(a.shaderProgramDirtyFrame=l),x&&(a.renderStateDirtyFrame=l),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],Z=a[L],G,X,P;d(Z)?(G=Z.uniformMap,X=Z.shaderProgram,P=Z.renderState):(G=void 0,X=void 0,P=void 0),Z=nt.shallowClone(t,Z),a[L]=Z;let v=g(Z.derivedCommands.uniformMapDirtyFrame,0),A=g(Z.derivedCommands.shaderProgramDirtyFrame,0),M=g(Z.derivedCommands.renderStateDirtyFrame,0),b=y||v<u,R=f||A<m,E=x||M<p;b&&(Z.derivedCommands.uniformMapDirtyFrame=l),R&&(Z.derivedCommands.shaderProgramDirtyFrame=l),E&&(Z.derivedCommands.renderStateDirtyFrame=l),Z.derivedCommands.type=V,Z.pass=C.pass,Z.pickOnly=C.pickOnly,Z.uniformMap=pst(e,t.uniformMap,G,b,C.getUniformMapFunction),Z.shaderProgram=sst(s.context,t.shaderProgram,X,R,C.getShaderProgramFunction,L),Z.renderState=fst(t.renderState,P,E,C.getRenderStateFunction,C.renderStateCache)}}}q_.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=rbe[o[a]];n.commandList.push(s[c])}};function abe(e,t,n,i,o,r,s){for(let a=0;a<t;++a){let c=e[a],l=c.derivedCommands.type;(!d(s)||s.indexOf(l)>-1)&&n(c,i,o,r)}}function obe(e,t,n,i,o,r){for(let s=0;s<t;++s)n(e[s],i,o,r)}var gst=[oa.OPAQUE_FRONT_FACE,oa.OPAQUE_BACK_FACE],xst=[oa.DEPTH_ONLY_FRONT_FACE,oa.DEPTH_ONLY_BACK_FACE,oa.DEPTH_ONLY_FRONT_AND_BACK_FACE];q_.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Re.GLOBE],a=e.indices[Re.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),abe(s,a,t,i,r,o,gst))};q_.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Re.GLOBE],a=e.indices[Re.GLOBE],c=e.commands[Re.TERRAIN_CLASSIFICATION],l=e.indices[Re.TERRAIN_CLASSIFICATION];if(a===0||l===0)return;let u=this._frontFaceTranslucent,m=this._backFaceTranslucent;if((!u||!m)&&obe(c,l,t,i,r,o),!u&&!m)return;this._globeTranslucencyFramebuffer=n;let p=r.uniformState.globeDepthTexture,y=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,abe(s,a,t,i,r,o,xst),r.depthTexture){let f=n.packDepth(r,o);r.uniformState.globeDepthTexture=f}obe(c,l,t,i,r,o),r.uniformState.globeDepthTexture=p,o.framebuffer=y};var Uv=q_;var HCi=T(S(),1);var GCi=T(S(),1),Al=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function Ef(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new mi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new mi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ti({color:new B(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new B(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Ef.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Ef.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var _st={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Dn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Dn.NEVER,reference:0,mask:Ft.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Tst={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Dn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Dn.NEVER,reference:0,mask:Ft.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Sst={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ft.setCesium3DTileBit(),stencilMask:Ft.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Cst=`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform sampler2D classifiedTexture;
in vec2 v_textureCoordinates;
void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    if (color.a == 0.0)
    {
        discard;
    }
    bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
#ifdef UNCLASSIFIED
    vec4 highlightColor = czm_invertClassificationColor;
    if (isClassified)
    {
        discard;
    }
#else
    vec4 highlightColor = vec4(1.0);
    if (!isClassified)
    {
        discard;
    }
#endif
    out_FragColor = color * highlightColor;
    gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
}
`,Vst=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    if (color.a == 0.0)
    {
        discard;
    }
#ifdef UNCLASSIFIED
    out_FragColor = color * czm_invertClassificationColor;
#else
    out_FragColor = color;
#endif
}
`;Ef.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!d(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),d(this._previousFramebuffer)||(this._depthStencilTexture=new Wt({context:e,width:s,height:a,pixelFormat:st.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Kl({context:e,width:s,height:a,format:xc.DEPTH24_STENCIL8,numSamples:t})))),!d(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let l,u;d(this._previousFramebuffer)?(l=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(l=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(l),d(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),d(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(l),this._fboClassified.update(e,s,a))}if(d(this._rsUnclassified)||(this._rsUnclassified=De.fromCache(_st),this._rsClassified=De.fromCache(Tst),this._rsDefault=De.fromCache(Sst)),!d(this._unclassifiedCommand)||o||r){d(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let l=d(this._previousFramebuffer)?Vst:Cst,u=new Be({defines:["UNCLASSIFIED"],sources:[l]}),m=new Be({sources:[l]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:d(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{renderState:d(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),d(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),d(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Al,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Ef.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Ef.prototype.clear=function(e,t){d(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Ef.prototype.executeClassified=function(e,t){if(!d(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Ef.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Ef.prototype.isDestroyed=function(){return!1};Ef.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),d(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var aV=Ef;var qCi=T(S(),1);function gk(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(gk.prototype,{total:{get:function(){return this._total}}});function Oy(e){let t=new Array(ba.NUMBER_OF_JOB_TYPES);t[ba.TEXTURE]=new gk(d(e)?e[ba.TEXTURE]:10),t[ba.PROGRAM]=new gk(d(e)?e[ba.PROGRAM]:10),t[ba.BUFFER]=new gk(d(e)?e[ba.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Oy.getTimestamp=gi;Object.defineProperties(Oy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Oy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Oy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Oy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,l;for(l=0;l<c&&(r=n[l],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++l);if(l===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Oy.getTimestamp();e.execute();let a=Oy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var kv=Oy;var o1i=T(S(),1);function xk(e){e=g(e,g.EMPTY_OBJECT);let t=En(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=gi(),this._lastMsSampleTime=gi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(xk.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});xk.prototype.update=function(e){let t=gi(),n=g(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};xk.prototype.destroy=function(){return ue(this)};var A0=xk;var $Ri=T(S(),1);var u1i=T(S(),1);function $_(){this._framebuffer=new mi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties($_.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Lst(e,t,n){let i=n.width,o=n.height;e._framebuffer.update(t,i,o)}function Rst(e,t,n){if(!d(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
    out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r);
}
`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:De.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}$_.prototype.update=function(e,t){Lst(this,e,t),Rst(this,e,t)};var Zst=new se,Gst=new se(1,1/255,1/65025,1/16581375);$_.prototype.getDepth=function(e,t,n){if(!d(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,Zst);return se.divideByScalar(o,255,o),se.dot(o,Gst)};$_.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};$_.prototype.isDestroyed=function(){return!1};$_.prototype.destroy=function(){return this._framebuffer.destroy(),d(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=d(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Dv=$_;var ZRi=T(S(),1);var p1i=T(S(),1);function Est(e,t){this.near=g(e,0),this.far=g(t,0);let n=Re.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var Bv=Est;var P1i=T(S(),1);var y1i=T(S(),1),Ky=`uniform highp sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function Xf(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new mi,this._tempCopyDepthFramebuffer=new mi,this._updateDepthFramebuffer=new mi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new He,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Xf.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function Xst(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function cbe(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!He.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,He.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=He.clone(o.viewport,e._scissorRectangle),s=!0),(!d(e._rs)||!He.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Dn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Dn.NEVER,reference:Ft.CESIUM_3D_TILE_MASK,mask:Ft.CESIUM_3D_TILE_MASK}})),d(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Ky,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,d(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Al,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,d(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Ky,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,d(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Al,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,d(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new B(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Xf.prototype.update=function(e,t,n,i,o,r){let s=n.width,a=n.height,c=o?e.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),cbe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=o,this._clearGlobeDepth=r};Xf.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Xf.prototype.executeCopyDepth=function(e,t){d(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Xf.prototype.executeUpdateDepth=function(e,t,n,i){let o=d(i)?i:t.framebuffer.depthStencilTexture;if(n||o!==this.colorFramebufferManager.getDepthStencilTexture()){if(d(this._updateDepthCommand)){if(!d(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==o||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,r,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(o),this._updateDepthFramebuffer.update(e,r,s),cbe(this,e,r,s,t)}this._tempCopyDepthTexture=o,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}d(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Xf.prototype.executeCopyColor=function(e,t){d(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Xf.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;d(i)&&(B.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Xf.prototype.isDestroyed=function(){return!1};Xf.prototype.destroy=function(){return Xst(this),d(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),d(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),d(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),d(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var Yv=Xf;var Y1i=T(S(),1);function eT(){this._framebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new mi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new He,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(eT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Ist(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Wst(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Pst(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!He.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,He.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=He.clone(o.viewport,e._scissorRectangle),s=!0),(!d(e._renderState)||!He.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),d(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Ky,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),d(e._clearCommand)||(e._clearCommand=new ti({color:new B(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}eT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Wst(this,n,o,r,e),Pst(this,n,o,r,i),this._useHdr=e};eT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};eT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};eT.prototype.isDestroyed=function(){return!1};eT.prototype.destroy=function(){return Ist(this),ue(this)};var Ov=eT;var hVi=T(S(),1);var K1i=T(S(),1),cV=`#ifdef MRT
layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;
#else
layout (location = 0) out vec4 out_FragColor;
#endif

uniform vec4 u_bgColor;
uniform sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
    {
#ifdef MRT
        out_FragData_0 = u_bgColor;
        out_FragData_1 = vec4(u_bgColor.a);
#else
        out_FragColor = u_bgColor;
#endif
        return;
    }
    
    discard;
}
`;var z1i=T(S(),1),Kv=`/**
 * Compositing for Weighted Blended Order-Independent Transparency. See:
 * - http://jcgt.org/published/0002/02/09/
 * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
 */

uniform sampler2D u_opaque;
uniform sampler2D u_accumulation;
uniform sampler2D u_revealage;

in vec2 v_textureCoordinates;

void main()
{
    vec4 opaque = texture(u_opaque, v_textureCoordinates);
    vec4 accum = texture(u_accumulation, v_textureCoordinates);
    float r = texture(u_revealage, v_textureCoordinates).r;

#ifdef MRT
    vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
#else
    vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
#endif

    out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;

    if (opaque != czm_backgroundColor)
    {
        out_FragColor.a = 1.0;
    }
}
`;function M0(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new mi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new mi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new B(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new B(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new B(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new B(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new He,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function lbe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function aQ(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function dbe(e){lbe(e),aQ(e)}function vst(e,t,n,i){lbe(e),e._accumulationTexture=new Wt({context:t,width:n,height:i,pixelFormat:st.RGBA,pixelDatatype:Je.FLOAT});let o=new Float32Array(n*i*4);e._revealageTexture=new Wt({context:t,pixelFormat:st.RGBA,pixelDatatype:Je.FLOAT,source:{arrayBufferView:o,width:n,height:i},flipY:!1})}function wst(e,t){aQ(e);let n=ne.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(aQ(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,l=e._adjustAlphaFBO.status===n;(!s||!a||!c||!l)&&(dbe(e),e._translucentMultipassSupport=!1,i=!1)}return i}M0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!d(a)||a.width!==r||a.height!==s||i!==this._useHDR,l=this._numSamples!==o;if((c||l)&&(this._numSamples=o,vst(this,e,r,s)),(!d(this._translucentFBO.framebuffer)||c||l)&&!wst(this,e))return;this._useHDR=i;let u=this,m,p;d(this._compositeCommand)||(m=new Be({sources:[Kv]}),this._translucentMRTSupport&&m.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})),d(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new Be({defines:["MRT"],sources:[cV]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new Be({sources:[cV]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let y=!He.equals(this._viewport,t.viewport),f=y!==this._useScissorTest;this._useScissorTest=y,He.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=He.clone(t.viewport,this._scissorRectangle),f=!0),(!d(this._rs)||!He.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=De.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),d(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),d(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Fst={enabled:!0,color:new B(0,0,0,0),equationRgb:ma.ADD,equationAlpha:ma.ADD,functionSourceRgb:_o.ONE,functionDestinationRgb:_o.ONE,functionSourceAlpha:_o.ZERO,functionDestinationAlpha:_o.ONE_MINUS_SOURCE_ALPHA},Ast={enabled:!0,color:new B(0,0,0,0),equationRgb:ma.ADD,equationAlpha:ma.ADD,functionSourceRgb:_o.ONE,functionDestinationRgb:_o.ONE,functionSourceAlpha:_o.ONE,functionDestinationAlpha:_o.ONE},Mst={enabled:!0,color:new B(0,0,0,0),equationRgb:ma.ADD,equationAlpha:ma.ADD,functionSourceRgb:_o.ZERO,functionDestinationRgb:_o.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:_o.ZERO,functionDestinationAlpha:_o.ONE_MINUS_SOURCE_ALPHA};function cQ(e,t,n,i){let o=n[i.id];if(!d(o)){let r=De.getState(i);r.depthMask=!1,r.blending=t,o=De.fromCache(r),n[i.id]=o}return o}function Nst(e,t,n){return cQ(t,Fst,e._translucentRenderStateCache,n)}function Ust(e,t,n){return cQ(t,Ast,e._translucentRenderStateCache,n)}function kst(e,t,n){return cQ(t,Mst,e._alphaRenderStateCache,n)}var Dst=`    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
    float ai = czm_out_FragColor.a;
    float wzi = czm_alphaWeight(ai);
    out_FragData_0 = vec4(Ci * wzi, ai);
    out_FragData_1 = vec4(ai * wzi);
`,Bst=`    vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
    float ai = czm_out_FragColor.a;
    float wzi = czm_alphaWeight(ai);
    out_FragColor = vec4(Ci, ai) * wzi;
`,Yst=`    float ai = czm_out_FragColor.a;
    out_FragColor = vec4(ai);
`;function lQ(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(d(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return Be.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
bool czm_discard = false;
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],l="";for(let u=0;u<c.length;u++){let m=c[u];l=`layout (location = ${m[1]}) out vec4 ${m[0]};
${l}`}return a.sources.push(l),a.sources.push(`void main()
{
    czm_translucent_main();
    if (czm_discard)
    {
        discard;
    }
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Ost(e,t){return lQ(e,t,"translucentMRT",Dst)}function Kst(e,t){return lQ(e,t,"translucentMultipass",Bst)}function Hst(e,t){return lQ(e,t,"alphaMultipass",Yst)}M0.prototype.createDerivedCommands=function(e,t,n){if(d(n)||(n={}),this._translucentMRTSupport){let a,c;return d(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!d(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Ost(t,e.shaderProgram),n.translucentCommand.renderState=Nst(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return d(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!d(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Kst(t,e.shaderProgram),n.translucentCommand.renderState=Ust(this,t,e.renderState),n.alphaCommand.shaderProgram=Hst(t,e.shaderProgram),n.alphaCommand.renderState=kst(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function zst(e,t,n,i,o,r){let s,a,c,{context:l,frameState:u}=t,{useLogDepth:m,shadowState:p}=u,y=t._hdr,f=i.framebuffer,x=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(l,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(l,i);let _=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=m?s.derivedCommands.logDepth.command:s,s=y?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,l,i,_);for(d(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,l,i,_)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=m?s.derivedCommands.logDepth.command:s,s=y?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,l,i,_);d(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,l,i,_)),i.framebuffer=f}function Jst(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:l}=a,u=t._hdr,m=i.framebuffer,p=l.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let y=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let f,x;for(let _=0;_<o.length;++_)f=o[_],f=c?f.derivedCommands.logDepth.command:f,f=u?f.derivedCommands.hdr.command:f,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,n(x,t,s,i,y);d(r)&&(f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,n(x,t,s,i,y)),i.framebuffer=m}M0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Jst(this,e,t,n,i,o);return}zst(this,e,t,n,i,o)};M0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};M0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,B.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};M0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};M0.prototype.isDestroyed=function(){return!1};M0.prototype.destroy=function(){return dbe(this),d(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),d(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),d(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var Hv=M0;var xVi=T(S(),1);function zv(){this._framebuffer=new mi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(zv.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Qst(e){e._framebuffer.destroy()}function jst(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Na(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new He},o.viewport=new He,e._passState=o}zv.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&jst(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};zv.prototype.isDestroyed=function(){return!1};zv.prototype.destroy=function(){return Qst(this),ue(this)};var Jv=zv;var GVi=T(S(),1);function jv(e){let t=new Na(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new He},t.viewport=new He,this._context=e,this._fb=new mi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}jv.prototype.begin=function(e,t){let n=this._context,i=t.width,o=t.height;return He.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var Qv=new B;jv.prototype.end=function(e){let t=g(e.width,1),n=g(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),l=0,u=0,m=0,p=-1;for(let y=0;y<s;++y){if(-a<=l&&l<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+l+a);Qv.red=B.byteToFloat(o[f]),Qv.green=B.byteToFloat(o[f+1]),Qv.blue=B.byteToFloat(o[f+2]),Qv.alpha=B.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(Qv);if(d(x))return x}if(l===u||l<0&&-l===u||l>0&&l===1-u){let f=m;m=-p,p=f}l+=m,u+=p}};jv.prototype.isDestroyed=function(){return!1};jv.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var qv=jv;var wVi=T(S(),1);function N0(){this._numSamples=1,this._colorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new B(0,0,0,0),this._clearCommand=new ti({color:new B(0,0,0,0),depth:1,owner:this})}function qst(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(N0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});N0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};N0.prototype.clear=function(e,t,n){B.clone(n,this._clearCommand.color),B.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};N0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};N0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};N0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};N0.prototype.isDestroyed=function(){return!1};N0.prototype.destroy=function(){return qst(this),ue(this)};var tT=N0;var WLi=T(S(),1);var NVi=T(S(),1);function nT(){}nT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};nT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Be.findPositionVarying(e),s=d(r);if(t&&!s){let a=o.length;for(let l=0;l<a;++l)o[l]=Be.replaceMain(o[l],"czm_shadow_cast_main");let c=`out vec3 v_positionEC; 
void main() 
{ 
    czm_shadow_cast_main(); 
    v_positionEC = (czm_inverseProjection * gl_Position).xyz; 
}`;o.push(c)}return new Be({defines:i,sources:o})};nT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Be.findPositionVarying(e),a=d(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=Be.replaceMain(r[u],"czm_shadow_cast_main");let l="";return t&&(a||(l+=`in vec3 v_positionEC; 
`),l+=`uniform vec4 shadowMap_lightPositionEC; 
`),i?l+=`void main() 
{ 
`:l+=`void main() 
{ 
    czm_shadow_cast_main(); 
    if (out_FragColor.a == 0.0) 
    { 
       discard; 
    } 
`,t?l+=`    float distance = length(${s}); 
    if (distance >= shadowMap_lightPositionEC.w) 
    { 
        discard; 
    } 
    distance /= shadowMap_lightPositionEC.w; // radius 
    out_FragColor = czm_packDepth(distance); 
`:n?l+=`    out_FragColor = vec4(1.0); 
`:l+=`    out_FragColor = czm_packDepth(gl_FragCoord.z); 
`,l+=`} 
`,r.push(l),new Be({defines:o,sources:r})};nT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,l=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${l}${u}${t}${n}${i}`};nT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Be({defines:i,sources:o})};nT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Be.findNormalVarying(e),s=!i&&d(r)||i&&o,a=Be.findPositionVarying(e),c=d(a),l=t._usesDepthTexture,u=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,y=t._numberOfCascades>1,f=t.debugCascadeColors,x=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let X=0;X<L;++X)V[X]=Be.replaceMain(V[X],"czm_shadow_receive_main");m?C.push("USE_CUBE_MAP_SHADOW"):l&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!m&&C.push("USE_SOFT_SHADOWS"),y&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let Z="";m?Z+=`uniform samplerCube shadowMap_textureCube; 
`:Z+=`uniform sampler2D shadowMap_texture; 
`;let G;return c?G=`    return vec4(${a}, 1.0); 
`:G=`#ifndef LOG_DEPTH 
    return czm_windowToEyeCoordinates(gl_FragCoord); 
#else 
    return vec4(v_logPositionEC, 1.0); 
#endif 
`,Z+=`uniform mat4 shadowMap_matrix; 
uniform vec3 shadowMap_lightDirectionEC; 
uniform vec4 shadowMap_lightPositionEC; 
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; 
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; 
#ifdef LOG_DEPTH 
in vec3 v_logPositionEC; 
#endif 
vec4 getPositionEC() 
{ 
${G}} 
vec3 getNormalEC() 
{ 
${s?`    return normalize(${r}); 
`:`    return vec3(1.0); 
`}} 
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) 
{ 
${_.normalOffset&&s?`    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; 
    float normalOffsetScale = 1.0 - nDotL; 
    vec3 offset = normalOffset * normalOffsetScale * normalEC; 
    positionEC.xyz += offset; 
`:""}} 
`,Z+=`void main() 
{ 
    czm_shadow_receive_main(); 
    vec4 positionEC = getPositionEC(); 
    vec3 normalEC = getNormalEC(); 
    float depth = -positionEC.z; 
`,Z+=`    czm_shadowParameters shadowParameters; 
    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; 
    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; 
    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; 
    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; 
`,i?Z+=`    shadowParameters.depthBias *= max(depth * 0.01, 1.0); 
`:u||(Z+=`    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); 
`),m?Z+=`    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; 
    float distance = length(directionEC); 
    directionEC = normalize(directionEC); 
    float radius = shadowMap_lightPositionEC.w; 
    // Stop early if the fragment is beyond the point light radius 
    if (distance > radius) 
    { 
        return; 
    } 
    vec3 directionWC  = czm_inverseViewRotation * directionEC; 
    shadowParameters.depth = distance / radius; 
    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    shadowParameters.texCoords = directionWC; 
    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); 
`:p?Z+=`    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); 
    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Spot light uses a perspective projection, so perform the perspective divide 
    shadowPosition /= shadowPosition.w; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
`:y?Z+=`    float maxDepth = shadowMap_cascadeSplits[1].w; 
    // Stop early if the eye depth exceeds the last cascade 
    if (depth > maxDepth) 
    { 
        return; 
    } 
    // Get the cascade based on the eye-space depth 
    vec4 weights = czm_cascadeWeights(depth); 
    // Apply normal offset 
    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    // Transform position into the cascade 
    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; 
    // Get visibility 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
    // Fade out shadows that are far away 
    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; 
    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); 
    visibility = mix(visibility, 1.0, fade); 
${f?`    // Draw cascade colors for debugging 
    out_FragColor *= czm_cascadeColor(weights); 
`:""}`:Z+=`    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); 
    applyNormalOffset(positionEC, normalEC, nDotL); 
    vec4 shadowPosition = shadowMap_matrix * positionEC; 
    // Stop early if the fragment is not in the shadow bounds 
    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) 
    { 
        return; 
    } 
    shadowParameters.texCoords = shadowPosition.xy; 
    shadowParameters.depth = shadowPosition.z; 
    shadowParameters.nDotL = nDotL; 
    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); 
`,Z+=`    out_FragColor.rgb *= visibility; 
} 
`,V.push(Z),new Be({defines:C,sources:V})};var If=nT;function Wf(e){e=g(e,g.EMPTY_OBJECT);let t=e.context;this._enabled=g(e.enabled,!0),this._softShadows=g(e.softShadows,!1),this._normalOffset=g(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=g(e.fromLightSource,!0),this.darkness=g(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=g(e.fadingEnabled,!0),this.maximumDistance=g(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Mt.isInternetExplorer()||Mt.isEdge()||(Mt.isChrome()||Mt.isFirefox())&&Mt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new _k,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ce,this._isPointLight=g(e.isPointLight,!1),this._pointLightRadius=g(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:g(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?g(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new yr:d(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new $st(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,uQ(this),this._clearCommand=new ti({depth:1,color:new B}),this._clearPassState=new Na(t),this._size=g(e.size,2048),this.size=this._size}Wf.MAXIMUM_DISTANCE=2e4;function $st(e){this.camera=new _k,this.passState=new Na(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function dQ(e,t){return De.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function uQ(e){let t=!e._usesDepthTexture;e._primitiveRenderState=dQ(t,e._primitiveBias),e._terrainRenderState=dQ(t,e._terrainBias),e._pointRenderState=dQ(t,e._pointBias)}Wf.prototype.debugCreateRenderStates=function(){uQ(this)};Object.defineProperties(Wf.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){rat(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function mQ(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;d(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function eat(e,t){let n=new Kl({context:t,width:e._textureSize.x,height:e._textureSize.y,format:xc.DEPTH_COMPONENT16}),i=new Wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:dn.NEAREST}),o=new Us({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function tat(e,t){let n=new Wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:st.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:dn.NEAREST}),i=new Us({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function nat(e,t){let n=new Kl({context:t,width:e._textureSize.x,height:e._textureSize.y,format:xc.DEPTH_COMPONENT16}),i=new Ma({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,sampler:dn.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Us({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function hbe(e,t){e._isPointLight?nat(e,t):e._usesDepthTexture?tat(e,t):eat(e,t)}function iat(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,uQ(e),mQ(e),hbe(e,t))}function oat(e,t){(!d(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(mQ(e),hbe(e,t),iat(e,t),fbe(e,t))}function fbe(e,t,n){n=g(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function rat(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=kt.maximumCubeMapSize>=t?t:kt.maximumCubeMapSize,o.x=t,o.y=t;let r=new He(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=kt.maximumTextureSize>=t?t:kt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new He(0,0,t,t)):i===4&&(t=kt.maximumTextureSize>=t*2?t:kt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new He(0,0,t,t),n[1].passState.viewport=new He(t,0,t,t),n[2].passState.viewport=new He(0,t,t,t),n[3].passState.viewport=new He(t,t,t,t));e._clearPassState.viewport=new He(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,l=a.y/o.y,u=a.width/o.x,m=a.height/o.y;s.textureOffsets=new F(u,0,0,c,0,m,0,l,0,0,1,0,0,0,0,1)}}var sat=new He;function aat(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; 
in vec2 v_textureCoordinates; 
void main() 
{ 
    vec2 uv = v_textureCoordinates; 
    vec3 dir; 
 
    if (uv.y < 0.5) 
    { 
        if (uv.x < 0.333) 
        { 
            dir.x = -1.0; 
            dir.y = uv.x * 6.0 - 1.0; 
            dir.z = uv.y * 4.0 - 1.0; 
        } 
        else if (uv.x < 0.666) 
        { 
            dir.y = -1.0; 
            dir.x = uv.x * 6.0 - 3.0; 
            dir.z = uv.y * 4.0 - 1.0; 
        } 
        else 
        { 
            dir.z = -1.0; 
            dir.x = uv.x * 6.0 - 5.0; 
            dir.y = uv.y * 4.0 - 1.0; 
        } 
    } 
    else 
    { 
        if (uv.x < 0.333) 
        { 
            dir.x = 1.0; 
            dir.y = uv.x * 6.0 - 1.0; 
            dir.z = uv.y * 4.0 - 3.0; 
        } 
        else if (uv.x < 0.666) 
        { 
            dir.y = 1.0; 
            dir.x = uv.x * 6.0 - 3.0; 
            dir.z = uv.y * 4.0 - 3.0; 
        } 
        else 
        { 
            dir.z = 1.0; 
            dir.x = uv.x * 6.0 - 5.0; 
            dir.y = uv.y * 4.0 - 3.0; 
        } 
    } 
 
    float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); 
    out_FragColor = vec4(vec3(shadow), 1.0); 
} 
`:n=`uniform sampler2D shadowMap_texture; 
in vec2 v_textureCoordinates; 
void main() 
{ 
${e._usesDepthTexture?`    float shadow = texture(shadowMap_texture, v_textureCoordinates).r; 
`:`    float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); 
`}    out_FragColor = vec4(vec3(shadow), 1.0); 
} 
`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Re.OVERLAY,i}function cat(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=sat;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;d(a)||(a=aat(e,n),e._debugShadowViewCommand=a),(!d(a.renderState)||!He.equals(a.renderState.viewport,s))&&(a.renderState=De.fromCache({viewport:He.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Pf=new Array(8);Pf[0]=new se(-1,-1,-1,1);Pf[1]=new se(1,-1,-1,1);Pf[2]=new se(1,1,-1,1);Pf[3]=new se(-1,1,-1,1);Pf[4]=new se(-1,-1,1,1);Pf[5]=new se(1,-1,1,1);Pf[6]=new se(1,1,1,1);Pf[7]=new se(-1,1,1,1);var Hy=new F,hQ=new Array(8);for(let e=0;e<8;++e)hQ[e]=new se;function lat(e,t){let n=new _t({geometry:new sm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Ut.fromColor(t)}}),i=new _t({geometry:new e0({radius:.5}),attributes:{color:Ut.fromColor(t)}});return new Zn({geometryInstances:[n,i],appearance:new sn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var dat=[B.RED,B.GREEN,B.BLUE,B.MAGENTA],uat=new h;function mat(e,t){cat(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Zf({camera:e._sceneCamera,color:B.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Zf({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Zf({camera:e._passes[i].camera,color:dat[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!d(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Ae.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,uat),a=F.fromTranslationQuaternionRotationScale(i,o,s,Hy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=lat(a,B.YELLOW)}e._debugLightFrustum.update(t)}else(!d(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Zf({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function _k(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new F}_k.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var hat=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);_k.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(hat,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var fat=new Array(5),pat=new Ri,bat=new Array(4),pbe=new h,bbe=new h;function yat(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,l=r/o,u=.9,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,u=.9);let p=bat,y=fat;for(y[0]=o,y[s]=r,a=0;a<s;++a){let M=(a+1)/s,b=o*Math.pow(l,M),R=o+c*M,E=W.lerp(R,b,u);y[a+1]=E,p[a]=E-y[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let M=y[0];for(a=0;a<s-1;++a)M+=p[a],y[a+1]=M}se.unpack(y,0,e._cascadeSplits[0]),se.unpack(y,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let f=n.frustum,x=f.left,_=f.right,C=f.bottom,V=f.top,L=f.near,Z=f.far,G=n.positionWC,X=n.directionWC,P=n.upWC,v=i.frustum.clone(pat),A=n.getViewProjection();for(a=0;a<s;++a){v.near=y[a],v.far=y[a+1];let M=F.multiply(v.projectionMatrix,i.viewMatrix,Hy),b=F.inverse(M,Hy),R=F.multiply(A,b,Hy),E=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,pbe),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,bbe);for(let O=0;O<8;++O){let U=se.clone(Pf[O],hQ[O]);F.multiplyByVector(R,U,U),h.divideByScalar(U,U.w,U),h.minimumByComponent(U,E,E),h.maximumByComponent(U,I,I)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let w=e._passes[a],N=w.camera;N.clone(n);let Y=N.frustum;Y.left=x+E.x*(_-x),Y.right=x+I.x*(_-x),Y.bottom=C+E.y*(V-C),Y.top=C+I.y*(V-C),Y.near=L+E.z*(Z-L),Y.far=L+I.z*(Z-L),w.cullingVolume=N.frustum.computeCullingVolume(G,X,P);let k=e._cascadeMatrices[a];F.multiply(N.getViewProjection(),i.inverseViewMatrix,k),F.multiply(w.textureOffsets,k,k)}}var gat=new F,xat=new h,_at=new h,ube=new h;function Tat(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,Hy),r=F.inverse(o,Hy),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,xat);a=h.cross(c,s,_at),h.normalize(a,a),h.normalize(c,c);let l=h.fromElements(0,0,0,ube),u=F.computeView(l,s,a,c,gat),m=F.multiply(u,r,Hy),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,pbe),y=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,bbe);for(let Z=0;Z<8;++Z){let G=se.clone(Pf[Z],hQ[Z]);F.multiplyByVector(m,G,G),h.divideByScalar(G,G.w,G),h.minimumByComponent(G,p,p),h.maximumByComponent(G,y,y)}y.z+=1e3,p.z-=10;let f=ube;f.x=-(.5*(p.x+y.x)),f.y=-(.5*(p.y+y.y)),f.z=-y.z;let x=F.fromTranslation(f,Hy);u=F.multiply(x,u,u);let _=.5*(y.x-p.x),C=.5*(y.y-p.y),V=y.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,F.clone(u,n.viewMatrix),F.inverse(u,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Sat=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Cat=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Vat=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Lat(e,t){let n=new Ri;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Sat[i],o.upWC=Cat[i],o.rightWC=Vat[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Rat=new h,Zat=new h,ybe=new ce,mbe=ybe.center;function Gat(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=ybe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Rat),s=h.negate(i.directionWC,Zat),a=h.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,mbe),mbe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere)}}function Eat(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=co.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Gat(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Wf.prototype.update=function(e){if(Eat(this,e),this._needsUpdate)if(oat(this,e.context),this._isPointLight&&Lat(this,e),this._cascadesEnabled&&(Tat(this,e),this._numberOfCascades>1&&yat(this,e)),this._isPointLight)this._shadowMapCullingVolume=Qr.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&mat(this,e)};Wf.prototype.updatePass=function(e,t){fbe(this,e,t)};var Xat=new D;function gbe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=Xat;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return xt(t,o,!1)}function Iat(e,t,n,i,o,r){let s,a,c;if(d(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=nt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!d(s)||o!==n.shaderProgram.id||t){let l=n.shaderProgram,u=n.pass===Re.GLOBE,m=n.pass!==Re.TRANSLUCENT,p=e._isPointLight,y=e._usesDepthTexture,f=If.getShadowCastShaderKeyword(p,u,y,m);if(s=i.shaderCache.getDerivedShaderProgram(l,f),!d(s)){let _=l.vertexShaderSource,C=l.fragmentShaderSource,V=If.createShadowCastVertexShader(_,p,u),L=If.createShadowCastFragmentShader(C,p,y,m);s=i.shaderCache.createDerivedShaderProgram(l,f,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:l._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Oe(a,!1),a.cull=Oe(a.cull,!1),a.cull.enabled=!1,a=De.fromCache(a)),c=gbe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Wf.createReceiveDerivedCommand=function(e,t,n,i,o){d(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,l=t.pass===Re.GLOBE,u=!1;if(l&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;d(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=nt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let y=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!d(m)||f||n||y){let x=If.getShadowReceiveShaderKeyword(e[0],t.castShadows,l,u);if(m=i.shaderCache.getDerivedShaderProgram(s,x),!d(m)){let _=If.createShadowReceiveVertexShader(a,l,u),C=If.createShadowReceiveFragmentShader(c,e[0],t.castShadows,l,u);m=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=gbe(e[0],t.uniformMap,l)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Wf.createCastDerivedCommand=function(e,t,n,i,o){if(d(o)||(o={}),t.castShadows){let r=o.castCommands;d(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=Iat(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Wf.prototype.isDestroyed=function(){return!1};Wf.prototype.destroy=function(){mQ(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var U0=Wf;var iRi=T(S(),1);var vLi=T(S(),1),$v=`uniform sampler2D u_opaqueDepthTexture;
uniform sampler2D u_translucentDepthTexture;

in vec2 v_textureCoordinates;

void main()
{
    float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
    float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
    translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
    out_FragColor = czm_packDepth(translucentDepth);
}
`;var FLi=T(S(),1),iT=`uniform sampler2D colorTexture;

#ifdef DEBUG_SHOW_DEPTH
uniform sampler2D u_packedTranslucentDepth;
#endif

in vec2 v_textureCoordinates;

void main()
{
#ifdef DEBUG_SHOW_DEPTH
    if (v_textureCoordinates.x < 0.5)
    {
        out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
        out_FragColor.a = 1.0;
    }
#else
    vec4 color = texture(colorTexture, v_textureCoordinates);

#ifdef PICK
    if (color == vec4(0.0))
    {
        discard;
    }
#else
    // Reverse premultiplication process to get the correct composited result of the classification primitives
    color.rgb /= color.a;
#endif
    out_FragColor = color;
#endif
}
`;var Wat=!1;function zy(e){this._drawClassificationFBO=new mi({createDepthAttachments:!1}),this._accumulationFBO=new mi({createDepthAttachments:!1}),this._packFBO=new mi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ti({color:new B(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new He,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(zy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function xbe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function _be(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Pat(e,t,n,i){xbe(e),e._translucentDepthStencilTexture=new Wt({context:t,width:n,height:i,pixelFormat:st.DEPTH_STENCIL,pixelDatatype:Je.UNSIGNED_INT_24_8,sampler:dn.NEAREST})}function vat(e,t,n,i){_be(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function wat(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(Pat(e,t,o,r),vat(e,t,o,r));let s,a;if(d(e._packDepthCommand)||(s=new Be({sources:[$v]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!d(e._compositeCommand)){s=new Be({sources:[iT]}),a={colorTexture:function(){return e._textureToComposite}},Wat&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,m=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new Be({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),y=nt.shallowClone(u);y.shaderProgram=p,u.derivedCommands.pick=y}d(e._copyCommand)||(s=new Be({sources:[iT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),d(e._accumulateCommand)||(s=new Be({sources:[iT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!He.equals(e._viewport,n.viewport),l=c!==e._useScissorTest;e._useScissorTest=c,He.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=He.clone(n.viewport,e._scissorRectangle),l=!0),(!d(e._rsDepth)||!He.equals(e._viewport,e._rsDepth.viewport)||l)&&(e._rsDepth=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),d(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!d(e._rsAccumulate)||!He.equals(e._viewport,e._rsAccumulate.viewport)||l)&&(e._rsAccumulate=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Dn.EQUAL,reference:Ft.CESIUM_3D_TILE_MASK}})),d(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!d(e._rsComp)||!He.equals(e._viewport,e._rsComp.viewport)||l)&&(e._rsComp=De.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),d(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}zy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=i.length,s,a,c=e.frameState.useLogDepth,l=e.context,u=n.framebuffer;for(a=0;a<r;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(wat(this,l,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(l,n),a=0;a<r;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let m=s.derivedCommands.depth.depthOnlyCommand;t(m,e,l,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(l,n)),n.framebuffer=u}};zy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(o,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Re.CESIUM_3D_TILE_CLASSIFICATION],l=i.indices[Re.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<l;++u)t(c[u],e,o,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};zy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Fat(this,e,t)};function Fat(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}zy.prototype.isSupported=function(){return this._supported};zy.prototype.isDestroyed=function(){return!1};zy.prototype.destroy=function(){return xbe(this),_be(this),d(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),d(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var ew=zy;function Aat(){this.command=void 0,this.near=void 0,this.far=void 0}function Tk(e,t,n){let i=e.context,o;i.depthTexture&&(o=new Yv);let r;e._useOIT&&i.depthTexture&&(r=new Hv(i));let s=new Na(i);s.viewport=He.clone(n),this.camera=t,this._cameraClone=co.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new qv(i),this.pickDepthFramebuffer=new Jv,this.sceneFramebuffer=new tT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new Ov,this.oit=r,this.translucentTileClassification=new ew(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Tbe=new h,Sbe=new h;function Mat(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),o=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),o)}function Nat(e,t,n){let i=1/Math.max(1,Mat(e.position,t.position));return h.multiplyByScalar(e.position,i,Tbe),h.multiplyByScalar(t.position,i,Sbe),h.equalsEpsilon(Tbe,Sbe,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}Tk.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Nat(t,n,W.EPSILON15)?(this._cameraStartFired&&gi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=gi(),co.clone(t,n),!0)};function Uat(e,t,n,i){let o=t.frameState,r=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ie.SCENE2D,c=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let l;a?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),l=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):l=Math.ceil(Math.log(i/n)/Math.log(s));let u=e.frustumCommandsList;u.length=l;for(let m=0;m<l;++m){let p,y;a?(p=Math.min(i-c,n+m*c),y=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,m)*n),y=Math.min(i,s*p));let f=u[m];d(f)?(f.near=p,f.far=y):f=u[m]=new Bv(p,y)}}function kat(e,t,n,i,o){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let r=e.frustumCommandsList,s=r.length;for(let a=0;a<s;++a){let c=r[a],l=c.near,u=c.far;if(i>u)continue;if(o<l)break;let m=n.pass,p=c.indices[m]++;if(c.commands[m][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=d(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var Cbe=new Qr,Dat=new Tc;Tk.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,o=n.positionWC,r=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,l=c.length,u=Re.NUMBER_OF_PASSES;for(let R=0;R<l;++R)for(let E=0;E<u;++E)c[R].indices[E]=0;r.length=0,s.length=0;let m=this._commandExtents,p=m.length,y=0,f=+Number.MAX_VALUE,x=-Number.MAX_VALUE,_=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,Z=t.mode===ie.SCENE3D?t.occluder:void 0,G=t.cullingVolume,X=Cbe.planes;for(let R=0;R<5;++R)X[R]=G.planes[R];G=Cbe;let P=a.length;for(let R=0;R<P;++R){let E=a[R],I=E.pass;if(I===Re.COMPUTE)r.push(E);else if(I===Re.OVERLAY)s.push(E);else{let w,N,Y=E.boundingVolume;if(d(Y)){if(!e.isVisible(E,G,Z))continue;let O=Y.computePlaneDistances(o,i,Dat);if(w=O.start,N=O.stop,f=Math.min(f,w),x=Math.max(x,N),_&&E.receiveShadows&&w<U0.MAXIMUM_DISTANCE&&!(I===Re.GLOBE&&w<-100&&N>100)){let U=N-w;I!==Re.GLOBE&&w<100&&(L=Math.min(L,U)),C=Math.min(C,w),V=Math.max(V,N)}}else E instanceof ti?(w=n.frustum.near,N=n.frustum.far):(w=n.frustum.near,N=n.frustum.far,f=Math.min(f,w),x=Math.max(x,N));let k=m[y];d(k)||(k=m[y]=new Aat),k.command=E,k.near=w,k.far=N,y++}}_&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),V=Math.max(Math.min(V,n.frustum.far),C)),_&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=V,t.shadowState.closestObjectSize=L),Uat(this,e,f,x);let v,A;for(v=0;v<y;v++)A=m[v],kat(this,e,A.command,A.near,A.far);if(y<p)for(v=y;v<p&&(A=m[v],!!d(A.command));v++)A.command=void 0;let M=c.length,b=t.frustumSplits;b.length=M+1;for(let R=0;R<M;++R)b[R]=c[R].near,R===M-1&&(b[R+1]=c[R].far)};Tk.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var oT=Tk;var Lbe=.1,Bat=new Du({pass:Xo.MOST_DETAILED_PRELOAD}),Yat=new Du({pass:Xo.MOST_DETAILED_PICK}),fQ=new Du({pass:Xo.PICK});function La(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new He(0,0,1,1),n=new co(e);n.frustum=new en({width:Lbe,aspectRatio:1,near:.1}),this._pickOffscreenView=new oT(e,n,t)}La.prototype.update=function(){this._pickPositionCacheDirty=!0};La.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return d(i)||(i=new Dv,n[t]=i),i};var Oat=new yr,Kat=new h,Sk=new h,Hat=new D,zat=new F;function Jat(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;d(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let l=2*(o.height-t.y-o.y)/o.height-1;l*=(s.top-s.bottom)*.5;let u=F.clone(r.transform,zat);r._setTransform(F.IDENTITY);let m=h.clone(r.position,Kat);h.multiplyByScalar(r.right,c,Sk),h.add(Sk,m,m),h.multiplyByScalar(r.up,l,Sk),h.add(Sk,m,m),r._setTransform(u),e.mode===ie.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,Hat),y=Oat;return y.right=p.x*.5,y.left=-y.right,y.top=p.y*.5,y.bottom=-y.top,y.near=s.near,y.far=s.far,y.computeCullingVolume(m,r.directionWC,r.upWC)}var Qat=new Kc,jat=new D;function qat(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),l=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,m=2*(o.height-t.y-o.y)/o.height-1,p=u*a*l,y=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,jat),x=f.x*n*.5,_=f.y*i*.5,C=Qat;return C.top=y+_,C.bottom=y-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function Rbe(e,t,n,i,o){let r=e.camera.frustum;return r instanceof en||r instanceof yr?Jat(e,t,n,i,o):qat(e,t,n,i,o)}var lV=3,tw=3,vf=new He(0,0,lV,tw),Zbe=new D,pQ=new B(0,0,0,0);La.prototype.pick=function(e,t,n,i){lV=g(n,3),tw=g(i,lV);let o=e.context,r=o.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=o.drawingBufferWidth,c.height=o.drawingBufferHeight;let l=a.passState;l.viewport=He.clone(c,l.viewport);let u=Ji.transformWindowToDrawingBuffer(e,t,Zbe);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=Rbe(e,u,lV,tw,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=fQ,r.update(s),e.updateEnvironment(),vf.x=u.x-(lV-1)*.5,vf.y=e.drawingBufferHeight-u.y-(tw-1)*.5,vf.width=lV,vf.height=tw,l=a.pickFramebuffer.begin(vf,a.viewport),e.updateAndExecuteCommands(l,pQ),e.resolveFramebuffers(l);let m=a.pickFramebuffer.end(vf);return o.endFrame(),m};function $at(e,t){let n=e.context,i=e.frameState,o=e.environmentState,r=e.defaultView;e.view=r;let s=r.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=r.passState;a.viewport=He.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=Rbe(e,t,1,1,s),i.tilesetPassState=fQ,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,a=r.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,pQ),e.resolveFramebuffers(a),n.endFrame()}var ect=new Ri,tct=new Kc,nct=new en,ict=new yr;La.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let o=e.frameState,r=e.context,s=r.uniformState,a=e.defaultView;e.view=a;let c=Ji.transformWindowToDrawingBuffer(e,t,Zbe);e.pickTranslucentDepth?$at(e,c):(e.updateFrameState(),s.update(o),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let l=e.camera,u;d(l.frustum.fov)?u=l.frustum.clone(ect):d(l.frustum.infiniteProjectionMatrix)?u=l.frustum.clone(tct):d(l.frustum.width)?u=l.frustum.clone(nct):u=l.frustum.clone(ict);let m=a.frustumCommandsList,p=m.length;for(let y=0;y<p;++y){let x=this.getPickDepth(e,y).getDepth(r,c.x,c.y);if(d(x)&&x>0&&x<1){let _=m[y],C;return e.mode===ie.SCENE2D?(C=l.position.z,l.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,s.update(o),s.updateFrustum(u)):(u.near=_.near*(y!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,s.updateFrustum(u)),n=Ji.drawingBufferToWgs84Coordinates(e,c,x,n),e.mode===ie.SCENE2D&&(l.position.z=C,s.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var oct=new he;La.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),d(n)&&e.mode!==ie.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,oct);o.cartographicToCartesian(r,n)}return n};function Gbe(e,t){let n,i,o=[],r=[],s=[],a=[];d(e)||(e=Number.MAX_VALUE);let c=t();for(;d(c);){let l=c.object,u=c.position,m=c.exclude;if(d(u)&&!d(l)){o.push(c);break}if(!d(l)||!d(l.primitive)||!m&&(o.push(c),0>=--e))break;let p=l.primitive,y=!1;typeof p.getGeometryInstanceAttributes=="function"&&d(l.id)&&(i=p.getGeometryInstanceAttributes(l.id),d(i)&&d(i.show)&&(y=!0,i.show=gn.toValue(!1,i.show),s.push(i))),l instanceof Ss&&(y=!0,l.show=!1,a.push(l)),y||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=gn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}La.prototype.drillPick=function(e,t,n,i,o){let r=this;return Gbe(n,function(){let c=r.pick(e,t,i,o);if(d(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Vbe=new h,rct=new h;function sct(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Ebe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,Vbe),s=h.cross(o,r,Vbe),a=h.cross(o,s,rct);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=g(n,Lbe),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function act(e,t,n){let i=t.frameState,o=n.ray,r=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=Ebe(e,o,r,a),l=Bat;l.camera=a,l.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let y=s[p];y.show&&t.primitives.contains(y)&&(y.updateForPass(i,l),u=u&&l.ready)}return u&&n._completePick(),u}La.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)act(this,e,t[n])&&t.splice(n--,1)};function Xbe(e,t,n){let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);r.show&&(d(r.isCesium3DTileset)?(!d(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof Zl&&Xbe(r,t,n))}}function Ck(e,t,n,i,o,r){let s=[];if(Xbe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new sct(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function cct(e,t){return!d(e)||!d(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function lct(e,t,n,i,o,r,s){let a=t.context,c=a.uniformState,l=t.frameState,u=e._pickOffscreenView;t.view=u,Ebe(e,n,o,u.camera),vf=He.clone(u.viewport,vf);let m=u.pickFramebuffer.begin(vf,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=Yat:l.tilesetPassState=fQ,c.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(m,pQ),t.resolveFramebuffers(m);let p,y=u.pickFramebuffer.end(vf);if(t.context.depthTexture){let f=u.frustumCommandsList.length;for(let x=0;x<f;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(d(C)&&C>0&&C<1){let V=u.frustumCommandsList[x],L=V.near*(x!==0?t.opaqueFrustumNearOffset:1),Z=V.far,G=L+C*(Z-L);p=Sn.getPoint(n,G);break}}}if(t.view=t.defaultView,a.endFrame(),d(y)||d(p))return{object:y,position:p,exclude:!d(p)&&r||cct(y,i)}}function Ibe(e,t,n,i,o,r,s,a){return Gbe(i,function(){return lct(e,t,n,o,r,s,a)})}function dV(e,t,n,i,o,r,s){let a=Ibe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function Wbe(e,t,n,i,o,r,s,a){return Ibe(e,t,n,i,o,r,s,a)}function Vk(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}La.prototype.pickFromRay=function(e,t,n,i){return dV(this,e,t,n,i,!1,!1)};La.prototype.drillPickFromRay=function(e,t,n,i,o){return Wbe(this,e,t,n,i,o,!1,!1)};La.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=Sn.clone(t),n=d(n)?n.slice():n,Vk(e,Ck(o,e,t,n,i,function(){return dV(o,e,t,n,i,!1,!0)}))};La.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=Sn.clone(t),i=d(i)?i.slice():i,Vk(e,Ck(r,e,t,i,o,function(){return Wbe(r,e,t,n,i,o,!1,!0)}))};var dct=new h,uct=new h,mct=new Sn,Pbe=new he;function bQ(e,t){let n=e.globe,i=d(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=li._defaultMaxTerrainHeight,r=i.geodeticSurfaceNormalCartographic(t,uct),s=he.toCartesian(t,i,dct),a=mct;a.origin=s,a.direction=r;let c=new Sn;return Sn.getPoint(a,o,c.origin),h.negate(r,c.direction),c}function vbe(e,t){let n=e.globe,i=d(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=he.fromCartesian(t,i,Pbe);return bQ(e,o)}function wbe(e,t){let n=e.globe,i=d(n)?n.ellipsoid:e.mapProjection.ellipsoid;return he.fromCartesian(t,i,Pbe).height}function hct(e,t,n,i,o){let r=bQ(t,n);return Ck(e,t,r,i,o,function(){let s=dV(e,t,r,i,o,!0,!0);if(d(s))return wbe(t,s.position)})}function fct(e,t,n,i,o,r){let s=vbe(t,n);return Ck(e,t,s,i,o,function(){let a=dV(e,t,s,i,o,!0,!0);if(d(a))return h.clone(a.position,r)})}La.prototype.sampleHeight=function(e,t,n,i){let o=bQ(e,t),r=dV(this,e,o,n,i,!0,!1);if(d(r))return wbe(e,r.position)};La.prototype.clampToHeight=function(e,t,n,i,o){let r=vbe(e,t),s=dV(this,e,r,n,i,!0,!1);if(d(s))return h.clone(s.position,o)};La.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=d(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=hct(this,e,t[s],n,i);return Vk(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};La.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=d(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=fct(this,e,t[s],n,i,t[s]);return Vk(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};La.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var nw=La;var SEi=T(S(),1);var jGi=T(S(),1);var tZi=T(S(),1),iw=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#endif
    color = czm_acesTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var iZi=T(S(),1),ow=`uniform sampler2D randomTexture;
uniform sampler2D depthTexture;
uniform float intensity;
uniform float bias;
uniform float lengthCap;
uniform float stepSize;
uniform float frustumLength;

in vec2 v_textureCoordinates;

vec4 clipToEye(vec2 uv, float depth)
{
    vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
    vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
    posEC = posEC / posEC.w;
    return posEC;
}

//Reconstruct Normal Without Edge Removation
vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)
{
    vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);
    vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);
    vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);
    vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);

    vec3 up = posInCamera.xyz - posInCameraUp.xyz;
    vec3 down = posInCameraDown.xyz - posInCamera.xyz;
    vec3 left = posInCamera.xyz - posInCameraLeft.xyz;
    vec3 right = posInCameraRight.xyz - posInCamera.xyz;

    vec3 DX = length(left) < length(right) ? left : right;
    vec3 DY = length(up) < length(down) ? up : down;

    return normalize(cross(DY, DX));
}

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    vec4 posInCamera = clipToEye(v_textureCoordinates, depth);

    if (posInCamera.z > frustumLength)
    {
        out_FragColor = vec4(1.0);
        return;
    }

    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
    float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));
    float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));
    float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));
    float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));
    vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);

    float ao = 0.0;
    vec2 sampleDirection = vec2(1.0, 0.0);
    float gapAngle = 90.0 * czm_radiansPerDegree;

    // RandomNoise
    float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x;

    //Loop for each direction
    for (int i = 0; i < 4; i++)
    {
        float newGapAngle = gapAngle * (float(i) + randomVal);
        float cosVal = cos(newGapAngle);
        float sinVal = sin(newGapAngle);

        //Rotate Sampling Direction
        vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);
        float localAO = 0.0;
        float localStepSize = stepSize;

        //Loop for each step
        for (int j = 0; j < 6; j++)
        {
            vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;

            //Exception Handling
            if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)
            {
                break;
            }

            float stepDepthInfo = czm_readDepth(depthTexture, newCoords);
            vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);
            vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;
            float len = length(diffVec);

            if (len > lengthCap)
            {
                break;
            }

            float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );
            float weight = len / lengthCap;
            weight = 1.0 - weight * weight;

            if (dotVal < bias)
            {
                dotVal = 0.0;
            }

            localAO = max(localAO, dotVal * weight);
            localStepSize += stepSize;
        }
        ao += localAO;
    }

    ao /= 4.0;
    ao = 1.0 - clamp(ao, 0.0, 1.0);
    ao = pow(ao, intensity);
    out_FragColor = vec4(vec3(ao), 1.0);
}
`;var rZi=T(S(),1),rw=`uniform sampler2D colorTexture;
uniform sampler2D ambientOcclusionTexture;
uniform bool ambientOcclusionOnly;
in vec2 v_textureCoordinates;

void main(void)
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
    out_FragColor = ambientOcclusionOnly ? ao : ao * color;
}
`;var aZi=T(S(),1),sw=`uniform sampler2D colorTexture;
uniform float gradations;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
#ifdef CZM_SELECTED_FEATURE
    if (czm_selected()) {
        out_FragColor = vec4(rgb, 1.0);
        return;
    }
#endif
    float luminance = czm_luminance(rgb);
    float darkness = luminance * gradations;
    darkness = (darkness - fract(darkness)) / gradations;
    out_FragColor = vec4(vec3(darkness), 1.0);
}
`;var lZi=T(S(),1),aw=`uniform sampler2D colorTexture;
uniform sampler2D bloomTexture;
uniform bool glowOnly;

in vec2 v_textureCoordinates;

void main(void)
{
    vec4 color = texture(colorTexture, v_textureCoordinates);

#ifdef CZM_SELECTED_FEATURE
    if (czm_selected()) {
        out_FragColor = color;
        return;
    }
#endif

    vec4 bloom = texture(bloomTexture, v_textureCoordinates);
    out_FragColor = glowOnly ? bloom : bloom + color;
}
`;var uZi=T(S(),1),cw=`uniform sampler2D colorTexture;
uniform float brightness;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
    vec3 target = vec3(0.0);
    out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
}
`;var hZi=T(S(),1),lw=`uniform sampler2D colorTexture;
uniform float contrast;
uniform float brightness;

in vec2 v_textureCoordinates;

void main(void)
{
    vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
    sceneColor = czm_RGBToHSB(sceneColor);
    sceneColor.z += brightness;
    sceneColor = czm_HSBToRGB(sceneColor);

    float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
    sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
    out_FragColor = vec4(sceneColor, 1.0);
}
`;var pZi=T(S(),1),dw=`uniform sampler2D colorTexture;
uniform sampler2D blurTexture;
uniform sampler2D depthTexture;
uniform float focalDistance;

in vec2 v_textureCoordinates;

vec4 toEye(vec2 uv, float depth)
{
   vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
   vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
   posInCamera = posInCamera / posInCamera.w;
   return posInCamera;
}

float computeDepthBlur(float depth)
{
    float f;
    if (depth < focalDistance)
    {
        f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
    }
    else
    {
        f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
        f = pow(f, 0.1);
    }
    f *= f;
    f = clamp(f, 0.0, 1.0);
    return pow(f, 0.5);
}

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    vec4 posInCamera = toEye(v_textureCoordinates, depth);
    float d = computeDepthBlur(-posInCamera.z);
    out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
}
`;var yZi=T(S(),1),uw=`uniform sampler2D depthTexture;

in vec2 v_textureCoordinates;

void main(void)
{
    float depth = czm_readDepth(depthTexture, v_textureCoordinates);
    out_FragColor = vec4(vec3(depth), 1.0);
}
`;var xZi=T(S(),1),mw=`uniform sampler2D depthTexture;
uniform float length;
uniform vec4 color;

in vec2 v_textureCoordinates;

void main(void)
{
    float directions[3];
    directions[0] = -1.0;
    directions[1] = 0.0;
    directions[2] = 1.0;

    float scalars[3];
    scalars[0] = 3.0;
    scalars[1] = 10.0;
    scalars[2] = 3.0;

    float padx = czm_pixelRatio / czm_viewport.z;
    float pady = czm_pixelRatio / czm_viewport.w;

#ifdef CZM_SELECTED_FEATURE
    bool selected = false;
    for (int i = 0; i < 3; ++i)
    {
        float dir = directions[i];
        selected = selected || czm_selected(vec2(-padx, dir * pady));
        selected = selected || czm_selected(vec2(padx, dir * pady));
        selected = selected || czm_selected(vec2(dir * padx, -pady));
        selected = selected || czm_selected(vec2(dir * padx, pady));
        if (selected)
        {
            break;
        }
    }
    if (!selected)
    {
        out_FragColor = vec4(color.rgb, 0.0);
        return;
    }
#endif

    float horizEdge = 0.0;
    float vertEdge = 0.0;

    for (int i = 0; i < 3; ++i)
    {
        float dir = directions[i];
        float scale = scalars[i];

        horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
        horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;

        vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
        vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
    }

    float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
    out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
}
`;var TZi=T(S(),1),hw=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif

// See slides 142 and 143:
//     http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#endif

	const float A = 0.22; // shoulder strength
	const float B = 0.30; // linear strength
	const float C = 0.10; // linear angle
	const float D = 0.20; // toe strength
	const float E = 0.01; // toe numerator
	const float F = 0.30; // toe denominator

	const float white = 11.2; // linear white point value

	vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
	float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;

	c = czm_inverseGamma(c / w);
	out_FragColor = vec4(c, fragmentColor.a);
}
`;var CZi=T(S(),1),fw=`in vec2 v_textureCoordinates;

uniform sampler2D colorTexture;

const float fxaaQualitySubpix = 0.5;
const float fxaaQualityEdgeThreshold = 0.125;
const float fxaaQualityEdgeThresholdMin = 0.0833;

void main()
{
    vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
    vec4 color = FxaaPixelShader(
        v_textureCoordinates,
        colorTexture,
        fxaaQualityRcpFrame,
        fxaaQualitySubpix,
        fxaaQualityEdgeThreshold,
        fxaaQualityEdgeThresholdMin);
    float alpha = texture(colorTexture, v_textureCoordinates).a;
    out_FragColor = vec4(color.rgb, alpha);
}
`;var LZi=T(S(),1),Jy=`#define SAMPLES 8

uniform float delta;
uniform float sigma;
uniform float direction; // 0.0 for x direction, 1.0 for y direction

uniform sampler2D colorTexture;

#ifdef USE_STEP_SIZE
uniform float stepSize;
#else
uniform vec2 step;
#endif

in vec2 v_textureCoordinates;

//  Incremental Computation of the Gaussian:
//  https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html

void main()
{
    vec2 st = v_textureCoordinates;
    vec2 dir = vec2(1.0 - direction, direction);

#ifdef USE_STEP_SIZE
    vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
#else
    vec2 step = step;
#endif

    vec3 g;
    g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
    g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
    g.z = g.y * g.y;

    vec4 result = texture(colorTexture, st) * g.x;
    for (int i = 1; i < SAMPLES; ++i)
    {
        g.xy *= g.yz;

        vec2 offset = float(i) * dir * step;
        result += texture(colorTexture, st - offset) * g.x;
        result += texture(colorTexture, st + offset) * g.x;
    }

    out_FragColor = result;
}
`;var ZZi=T(S(),1),pw=`uniform sampler2D colorTexture;
uniform sampler2D dirtTexture;
uniform sampler2D starTexture;
uniform vec2 dirtTextureDimensions;
uniform float distortion;
uniform float ghostDispersal;
uniform float haloWidth;
uniform float dirtAmount;
uniform float earthRadius;
uniform float intensity;

in vec2 v_textureCoordinates;

// whether it is in space or not
// 6500000.0 is empirical value
#define DISTANCE_TO_SPACE 6500000.0

// return ndc from world coordinate biased earthRadius
vec4 getNDCFromWC(vec3 WC, float earthRadius)
{
    vec4 positionEC = czm_view * vec4(WC, 1.0);
    positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
    return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
}

// Check if current pixel is included Earth
// if then mask it gradually
float isInEarth(vec2 texcoord, vec2 sceneSize)
{
    vec2 NDC = texcoord * 2.0 - 1.0;
    vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
    vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
    NDC.xy -= earthPosSC.xy;

    float X = abs(NDC.x) * sceneSize.x;
    float Y = abs(NDC.y) * sceneSize.y;

    return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
}

// For Chromatic effect
vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
{
    vec2 sceneSize = czm_viewport.zw;
    vec3 color;
    if(isSpace)
    {
        color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
        color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
        color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
    }
    else
    {
        color.r = texture(tex, texcoord + direction * distortion.r).r;
        color.g = texture(tex, texcoord + direction * distortion.g).g;
        color.b = texture(tex, texcoord + direction * distortion.b).b;
    }
    return vec4(clamp(color, 0.0, 1.0), 0.0);
}

void main(void)
{
    vec4 originalColor = texture(colorTexture, v_textureCoordinates);
    vec3 rgb = originalColor.rgb;
    bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;

    // Sun position
    vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
    vec4 sunPositionEC = czm_view * sunPos;
    vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
    sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);

    // If sun is not in the screen space, use original color.
    if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
    {
        // Lens flare is disabled when not in space until #5932 is fixed.
        //    https://github.com/CesiumGS/cesium/issues/5932
        out_FragColor = originalColor;
        return;
    }

    vec2 texcoord = vec2(1.0) - v_textureCoordinates;
    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
    vec2 invPixelSize = 1.0 / pixelSize;
    vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);

    // ghost vector to image centre:
    vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
    vec3 direction = normalize(vec3(ghostVec, 0.0));

    // sample ghosts:
    vec4 result = vec4(0.0);
    vec4 ghost = vec4(0.0);
    for (int i = 0; i < 4; ++i)
    {
        vec2 offset = fract(texcoord + ghostVec * float(i));
        // Only bright spots from the centre of the source image
        ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
    }
    result += ghost;

    // sample halo
    vec2 haloVec = normalize(ghostVec) * haloWidth;
    float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
    weightForHalo = pow(1.0 - weightForHalo, 5.0);

    result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;

    // dirt on lens
    vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
    if (dirtTexCoords.x > 1.0)
    {
        dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) :  fract(dirtTexCoords.x);
    }
    if (dirtTexCoords.y > 1.0)
    {
        dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) :  fract(dirtTexCoords.y);
    }
    result += dirtAmount * texture(dirtTexture, dirtTexCoords);

    // Rotating starburst texture's coordinate
    // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
    float camrot = czm_view[0].z + czm_view[1].y;
    float cosValue = cos(camrot);
    float sinValue = sin(camrot);
    mat3 rotation = mat3(
        cosValue, -sinValue, 0.0,
        sinValue, cosValue, 0.0,
        0.0, 0.0, 1.0
    );

    vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
    vec3 st2 = vec3((rotation * st1).xy, 1.0);
    vec3 st3 = st2 * 0.5 + vec3(0.5);
    vec2 lensStarTexcoord = st3.xy;
    float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
    float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);

    if (!isSpace)
    {
        result *= oneMinusWeightForLensFlare * intensity * 0.2;
    }
    else
    {
        result *= oneMinusWeightForLensFlare * intensity;
        result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
    }

    result += texture(colorTexture, v_textureCoordinates);

    out_FragColor = result;
}
`;var EZi=T(S(),1),bw=`uniform sampler2D colorTexture;
uniform vec3 white;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif

// See equation 4:
//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#endif
    color = (color * (1.0 + color / white)) / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var IZi=T(S(),1),yw=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

float rand(vec2 co)
{
    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
}

void main(void)
{
    float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
    vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
    vec3 green = vec3(0.0, 1.0, 0.0);
    out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
}
`;var PZi=T(S(),1),gw=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif

// See equation 3:
//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
    float exposure = texture(autoExposure, vec2(0.5)).r;
    color /= exposure;
#endif
    color = color / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var wZi=T(S(),1),xw=`uniform sampler2D colorTexture;
uniform sampler2D silhouetteTexture;

in vec2 v_textureCoordinates;

void main(void)
{
    vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
    vec4 color = texture(colorTexture, v_textureCoordinates);
    out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
}
`;var AZi=T(S(),1);/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */var _w=`/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h

// Steps used to integrate into Cesium:
// * The following defines are set:
//       #define FXAA_PC 1
//       #define FXAA_WEBGL_1 1
//       #define FXAA_GREEN_AS_LUMA 1
//       #define FXAA_EARLY_EXIT 1
//       #define FXAA_GLSL_120 1
// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
//   /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
// * There are no implicit conversions from ivec* to vec* so replace:
//       #define FxaaInt2 ivec2
//           with
//       #define FxaaInt2 vec2
// * The texture2DLod function is only available in vertex shaders so replace:
//       #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
//       #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
//           with
//       #define FxaaTexTop(t, p) texture(t, p)
//       #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
// * The following parameters to FxaaPixelShader are unused and can be removed:
//       fxaaConsolePosPos
//       fxaaConsoleRcpFrameOpt
//       fxaaConsoleRcpFrameOpt2
//       fxaaConsole360RcpFrameOpt2
//       fxaaConsoleEdgeSharpness
//       fxaaConsoleEdgeThreshold
//       fxaaConsoleEdgeThresholdMi
//       fxaaConsole360ConstDir

//
// Choose the quality preset.
// This needs to be compiled into the shader as it effects code.
// Best option to include multiple presets is to
// in each shader define the preset, then include this file.
//
// OPTIONS
// -----------------------------------------------------------------------
// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
// 39       - no dither, very expensive
//
// NOTES
// -----------------------------------------------------------------------
// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
// 13 = about same speed as FXAA 3.9 and better than 12
// 23 = closest to FXAA 3.9 visually and performance wise
//  _ = the lowest digit is directly related to performance
// _  = the highest digit is directly related to style
//
//#define FXAA_QUALITY_PRESET 12


#if (FXAA_QUALITY_PRESET == 10)
    #define FXAA_QUALITY_PS 3
    #define FXAA_QUALITY_P0 1.5
    #define FXAA_QUALITY_P1 3.0
    #define FXAA_QUALITY_P2 12.0
#endif
#if (FXAA_QUALITY_PRESET == 11)
    #define FXAA_QUALITY_PS 4
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 3.0
    #define FXAA_QUALITY_P3 12.0
#endif
#if (FXAA_QUALITY_PRESET == 12)
    #define FXAA_QUALITY_PS 5
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 4.0
    #define FXAA_QUALITY_P4 12.0
#endif
#if (FXAA_QUALITY_PRESET == 13)
    #define FXAA_QUALITY_PS 6
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 4.0
    #define FXAA_QUALITY_P5 12.0
#endif
#if (FXAA_QUALITY_PRESET == 14)
    #define FXAA_QUALITY_PS 7
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 4.0
    #define FXAA_QUALITY_P6 12.0
#endif
#if (FXAA_QUALITY_PRESET == 15)
    #define FXAA_QUALITY_PS 8
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 4.0
    #define FXAA_QUALITY_P7 12.0
#endif
#if (FXAA_QUALITY_PRESET == 20)
    #define FXAA_QUALITY_PS 3
    #define FXAA_QUALITY_P0 1.5
    #define FXAA_QUALITY_P1 2.0
    #define FXAA_QUALITY_P2 8.0
#endif
#if (FXAA_QUALITY_PRESET == 21)
    #define FXAA_QUALITY_PS 4
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 8.0
#endif
#if (FXAA_QUALITY_PRESET == 22)
    #define FXAA_QUALITY_PS 5
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 8.0
#endif
#if (FXAA_QUALITY_PRESET == 23)
    #define FXAA_QUALITY_PS 6
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 8.0
#endif
#if (FXAA_QUALITY_PRESET == 24)
    #define FXAA_QUALITY_PS 7
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 3.0
    #define FXAA_QUALITY_P6 8.0
#endif
#if (FXAA_QUALITY_PRESET == 25)
    #define FXAA_QUALITY_PS 8
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 4.0
    #define FXAA_QUALITY_P7 8.0
#endif
#if (FXAA_QUALITY_PRESET == 26)
    #define FXAA_QUALITY_PS 9
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 4.0
    #define FXAA_QUALITY_P8 8.0
#endif
#if (FXAA_QUALITY_PRESET == 27)
    #define FXAA_QUALITY_PS 10
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 4.0
    #define FXAA_QUALITY_P9 8.0
#endif
#if (FXAA_QUALITY_PRESET == 28)
    #define FXAA_QUALITY_PS 11
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 4.0
    #define FXAA_QUALITY_P10 8.0
#endif
#if (FXAA_QUALITY_PRESET == 29)
    #define FXAA_QUALITY_PS 12
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.5
    #define FXAA_QUALITY_P2 2.0
    #define FXAA_QUALITY_P3 2.0
    #define FXAA_QUALITY_P4 2.0
    #define FXAA_QUALITY_P5 2.0
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 2.0
    #define FXAA_QUALITY_P10 4.0
    #define FXAA_QUALITY_P11 8.0
#endif
#if (FXAA_QUALITY_PRESET == 39)
    #define FXAA_QUALITY_PS 12
    #define FXAA_QUALITY_P0 1.0
    #define FXAA_QUALITY_P1 1.0
    #define FXAA_QUALITY_P2 1.0
    #define FXAA_QUALITY_P3 1.0
    #define FXAA_QUALITY_P4 1.0
    #define FXAA_QUALITY_P5 1.5
    #define FXAA_QUALITY_P6 2.0
    #define FXAA_QUALITY_P7 2.0
    #define FXAA_QUALITY_P8 2.0
    #define FXAA_QUALITY_P9 2.0
    #define FXAA_QUALITY_P10 4.0
    #define FXAA_QUALITY_P11 8.0
#endif

#define FxaaBool bool
#define FxaaFloat float
#define FxaaFloat2 vec2
#define FxaaFloat3 vec3
#define FxaaFloat4 vec4
#define FxaaHalf float
#define FxaaHalf2 vec2
#define FxaaHalf3 vec3
#define FxaaHalf4 vec4
#define FxaaInt2 vec2
#define FxaaTex sampler2D

#define FxaaSat(x) clamp(x, 0.0, 1.0)
#define FxaaTexTop(t, p) texture(t, p)
#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))

FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }

FxaaFloat4 FxaaPixelShader(
    //
    // Use noperspective interpolation here (turn off perspective interpolation).
    // {xy} = center of pixel
    FxaaFloat2 pos,
    //
    // Input color texture.
    // {rgb_} = color in linear or perceptual color space
    // if (FXAA_GREEN_AS_LUMA == 0)
    //     {___a} = luma in perceptual color space (not linear)
    FxaaTex tex,
    //
    // Only used on FXAA Quality.
    // This must be from a constant/uniform.
    // {x_} = 1.0/screenWidthInPixels
    // {_y} = 1.0/screenHeightInPixels
    FxaaFloat2 fxaaQualityRcpFrame,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_SUBPIX define.
    // It is here now to allow easier tuning.
    // Choose the amount of sub-pixel aliasing removal.
    // This can effect sharpness.
    //   1.00 - upper limit (softer)
    //   0.75 - default amount of filtering
    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)
    //   0.25 - almost off
    //   0.00 - completely off
    FxaaFloat fxaaQualitySubpix,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
    // It is here now to allow easier tuning.
    // The minimum amount of local contrast required to apply algorithm.
    //   0.333 - too little (faster)
    //   0.250 - low quality
    //   0.166 - default
    //   0.125 - high quality
    //   0.063 - overkill (slower)
    FxaaFloat fxaaQualityEdgeThreshold,
    //
    // Only used on FXAA Quality.
    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
    // It is here now to allow easier tuning.
    // Trims the algorithm from processing darks.
    //   0.0833 - upper limit (default, the start of visible unfiltered edges)
    //   0.0625 - high quality (faster)
    //   0.0312 - visible limit (slower)
    // Special notes when using FXAA_GREEN_AS_LUMA,
    //   Likely want to set this to zero.
    //   As colors that are mostly not-green
    //   will appear very dark in the green channel!
    //   Tune by looking at mostly non-green content,
    //   then start at zero and increase until aliasing is a problem.
    FxaaFloat fxaaQualityEdgeThresholdMin
) {
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posM;
    posM.x = pos.x;
    posM.y = pos.y;
    FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
    #define lumaM rgbyM.y
    FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
    FxaaFloat maxSM = max(lumaS, lumaM);
    FxaaFloat minSM = min(lumaS, lumaM);
    FxaaFloat maxESM = max(lumaE, maxSM);
    FxaaFloat minESM = min(lumaE, minSM);
    FxaaFloat maxWN = max(lumaN, lumaW);
    FxaaFloat minWN = min(lumaN, lumaW);
    FxaaFloat rangeMax = max(maxWN, maxESM);
    FxaaFloat rangeMin = min(minWN, minESM);
    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
    FxaaFloat range = rangeMax - rangeMin;
    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
    FxaaBool earlyExit = range < rangeMaxClamped;
/*--------------------------------------------------------------------------*/
    if(earlyExit)
        return rgbyM;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
    FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNS = lumaN + lumaS;
    FxaaFloat lumaWE = lumaW + lumaE;
    FxaaFloat subpixRcpRange = 1.0/range;
    FxaaFloat subpixNSWE = lumaNS + lumaWE;
    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNESE = lumaNE + lumaSE;
    FxaaFloat lumaNWNE = lumaNW + lumaNE;
    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
/*--------------------------------------------------------------------------*/
    FxaaFloat lumaNWSW = lumaNW + lumaSW;
    FxaaFloat lumaSWSE = lumaSW + lumaSE;
    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
/*--------------------------------------------------------------------------*/
    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
    FxaaBool horzSpan = edgeHorz >= edgeVert;
    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
/*--------------------------------------------------------------------------*/
    if(!horzSpan) lumaN = lumaW;
    if(!horzSpan) lumaS = lumaE;
    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
/*--------------------------------------------------------------------------*/
    FxaaFloat gradientN = lumaN - lumaM;
    FxaaFloat gradientS = lumaS - lumaM;
    FxaaFloat lumaNN = lumaN + lumaM;
    FxaaFloat lumaSS = lumaS + lumaM;
    FxaaBool pairN = abs(gradientN) >= abs(gradientS);
    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
    if(pairN) lengthSign = -lengthSign;
    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posB;
    posB.x = posM.x;
    posB.y = posM.y;
    FxaaFloat2 offNP;
    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
    if(!horzSpan) posB.x += lengthSign * 0.5;
    if( horzSpan) posB.y += lengthSign * 0.5;
/*--------------------------------------------------------------------------*/
    FxaaFloat2 posN;
    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
    FxaaFloat2 posP;
    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
    FxaaFloat subpixE = subpixC * subpixC;
    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
/*--------------------------------------------------------------------------*/
    if(!pairN) lumaNN = lumaSS;
    FxaaFloat gradientScaled = gradient * 1.0/4.0;
    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
    FxaaFloat subpixF = subpixD * subpixE;
    FxaaBool lumaMLTZero = lumaMM < 0.0;
/*--------------------------------------------------------------------------*/
    lumaEndN -= lumaNN * 0.5;
    lumaEndP -= lumaNN * 0.5;
    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
    FxaaBool doneNP = (!doneN) || (!doneP);
    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
/*--------------------------------------------------------------------------*/
    if(doneNP) {
        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
        doneN = abs(lumaEndN) >= gradientScaled;
        doneP = abs(lumaEndP) >= gradientScaled;
        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
        doneNP = (!doneN) || (!doneP);
        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
/*--------------------------------------------------------------------------*/
        #if (FXAA_QUALITY_PS > 3)
        if(doneNP) {
            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
            doneN = abs(lumaEndN) >= gradientScaled;
            doneP = abs(lumaEndP) >= gradientScaled;
            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
            doneNP = (!doneN) || (!doneP);
            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
/*--------------------------------------------------------------------------*/
            #if (FXAA_QUALITY_PS > 4)
            if(doneNP) {
                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                doneN = abs(lumaEndN) >= gradientScaled;
                doneP = abs(lumaEndP) >= gradientScaled;
                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
                doneNP = (!doneN) || (!doneP);
                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
/*--------------------------------------------------------------------------*/
                #if (FXAA_QUALITY_PS > 5)
                if(doneNP) {
                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                    doneN = abs(lumaEndN) >= gradientScaled;
                    doneP = abs(lumaEndP) >= gradientScaled;
                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
                    doneNP = (!doneN) || (!doneP);
                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
/*--------------------------------------------------------------------------*/
                    #if (FXAA_QUALITY_PS > 6)
                    if(doneNP) {
                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                        doneN = abs(lumaEndN) >= gradientScaled;
                        doneP = abs(lumaEndP) >= gradientScaled;
                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
                        doneNP = (!doneN) || (!doneP);
                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
/*--------------------------------------------------------------------------*/
                        #if (FXAA_QUALITY_PS > 7)
                        if(doneNP) {
                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                            doneN = abs(lumaEndN) >= gradientScaled;
                            doneP = abs(lumaEndP) >= gradientScaled;
                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
                            doneNP = (!doneN) || (!doneP);
                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
/*--------------------------------------------------------------------------*/
    #if (FXAA_QUALITY_PS > 8)
    if(doneNP) {
        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
        doneN = abs(lumaEndN) >= gradientScaled;
        doneP = abs(lumaEndP) >= gradientScaled;
        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
        doneNP = (!doneN) || (!doneP);
        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
/*--------------------------------------------------------------------------*/
        #if (FXAA_QUALITY_PS > 9)
        if(doneNP) {
            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
            doneN = abs(lumaEndN) >= gradientScaled;
            doneP = abs(lumaEndP) >= gradientScaled;
            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
            doneNP = (!doneN) || (!doneP);
            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
/*--------------------------------------------------------------------------*/
            #if (FXAA_QUALITY_PS > 10)
            if(doneNP) {
                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                doneN = abs(lumaEndN) >= gradientScaled;
                doneP = abs(lumaEndP) >= gradientScaled;
                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
                doneNP = (!doneN) || (!doneP);
                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
/*--------------------------------------------------------------------------*/
                #if (FXAA_QUALITY_PS > 11)
                if(doneNP) {
                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                    doneN = abs(lumaEndN) >= gradientScaled;
                    doneP = abs(lumaEndP) >= gradientScaled;
                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
                    doneNP = (!doneN) || (!doneP);
                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
/*--------------------------------------------------------------------------*/
                    #if (FXAA_QUALITY_PS > 12)
                    if(doneNP) {
                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
                        doneN = abs(lumaEndN) >= gradientScaled;
                        doneP = abs(lumaEndP) >= gradientScaled;
                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
                        doneNP = (!doneN) || (!doneP);
                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
/*--------------------------------------------------------------------------*/
                    }
                    #endif
/*--------------------------------------------------------------------------*/
                }
                #endif
/*--------------------------------------------------------------------------*/
            }
            #endif
/*--------------------------------------------------------------------------*/
        }
        #endif
/*--------------------------------------------------------------------------*/
    }
    #endif
/*--------------------------------------------------------------------------*/
                        }
                        #endif
/*--------------------------------------------------------------------------*/
                    }
                    #endif
/*--------------------------------------------------------------------------*/
                }
                #endif
/*--------------------------------------------------------------------------*/
            }
            #endif
/*--------------------------------------------------------------------------*/
        }
        #endif
/*--------------------------------------------------------------------------*/
    }
/*--------------------------------------------------------------------------*/
    FxaaFloat dstN = posM.x - posN.x;
    FxaaFloat dstP = posP.x - posM.x;
    if(!horzSpan) dstN = posM.y - posN.y;
    if(!horzSpan) dstP = posP.y - posM.y;
/*--------------------------------------------------------------------------*/
    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
    FxaaFloat spanLength = (dstP + dstN);
    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
    FxaaFloat spanLengthRcp = 1.0/spanLength;
/*--------------------------------------------------------------------------*/
    FxaaBool directionN = dstN < dstP;
    FxaaFloat dst = min(dstN, dstP);
    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
    FxaaFloat subpixG = subpixF * subpixF;
    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
/*--------------------------------------------------------------------------*/
    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
    return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
}
`;var KZi=T(S(),1);function rT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new mi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(rT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(d(e))return e[e.length-1].getColorTexture(0)}}});function Fbe(e){let t=e._framebuffers;if(!d(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function pct(e,t){Fbe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new mi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Abe(e){let t=e._commands;if(!d(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function bct(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function yct(e,t){let n=`uniform sampler2D colorTexture; 
in vec2 v_textureCoordinates; 
float sampleTexture(vec2 offset) { 
`;return e===0?n+=`    vec4 color = texture(colorTexture, v_textureCoordinates + offset); 
    return czm_luminance(color.rgb); 
`:n+=`    return texture(colorTexture, v_textureCoordinates + offset).r; 
`,n+=`}

`,n+=`uniform vec2 colorTextureDimensions; 
uniform vec2 minMaxLuminance; 
uniform sampler2D previousLuminance; 
void main() { 
    float color = 0.0; 
    float xStep = 1.0 / colorTextureDimensions.x; 
    float yStep = 1.0 / colorTextureDimensions.y; 
    int count = 0; 
    for (int i = 0; i < 3; ++i) { 
        for (int j = 0; j < 3; ++j) { 
            vec2 offset; 
            offset.x = -xStep + float(i) * xStep; 
            offset.y = -yStep + float(j) * yStep; 
            if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { 
                continue; 
            } 
            color += sampleTexture(offset); 
            ++count; 
        } 
    } 
    if (count > 0) { 
        color /= float(count); 
    } 
`,e===t-1&&(n+=`    float previous = texture(previousLuminance, vec2(0.5)).r; 
    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); 
    color = previous + (color - previous) / (60.0 * 1.5); 
    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); 
`),n+=`    out_FragColor = vec4(color); 
} 
`,n}function gct(e,t){Abe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(yct(r,i),{framebuffer:n[r].framebuffer,uniformMap:bct(e,r)});e._commands=o}rT.prototype.clear=function(e){let t=this._framebuffers;if(!d(t))return;let n=this._clearCommand;d(n)||(n=this._clearCommand=new ti({color:new B(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};rT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,pct(this,e),gct(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};rT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!d(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};rT.prototype.isDestroyed=function(){return!1};rT.prototype.destroy=function(){return Fbe(this),Abe(this),ue(this)};var Tw=rT;var pGi=T(S(),1);var zZi=T(S(),1),xct={NEAREST:0,LINEAR:1},Ed=xct;function sT(e){e=g(e,g.EMPTY_OBJECT);let t=e.fragmentShader,n=g(e.textureScale,1),i=g(e.pixelFormat,st.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=g(e.forcePowerOfTwo,!1),this._sampleMode=g(e.sampleMode,Ed.NEAREST),this._pixelFormat=i,this._pixelDatatype=g(e.pixelDatatype,Je.UNSIGNED_BYTE),this._clearColor=g(e.clearColor,B.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let o=new Na;o.scissorTest={enabled:!0,rectangle:d(e.scissorRectangle)?He.clone(e.scissorRectangle):new He},this._passState=o,this._ready=!1;let r=e.name;d(r)||(r=Yn()),this._name=r,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(sT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(d(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(d(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var _ct=/uniform\s+sampler2D\s+depthTexture/g;sT.prototype._isSupported=function(e){return!_ct.test(this._fragmentShader)||e.depthTexture};function Tct(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];d(a)&&a!==r&&a instanceof Wt&&!d(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Wt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function Sct(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Cct(e,t){return function(){let n=e[t]();if(d(n))return n.dimensions}}function Vct(e){if(d(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i)if(i.hasOwnProperty(r)){typeof i[r]!="function"?(t[r]=Sct(e,r),n[r]=Tct(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Wt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Cct(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Lct(e,t){if(d(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(d(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE 
uniform sampler2D czm_idTexture; 
uniform sampler2D czm_selectedIdTexture; 
uniform float czm_selectedIdTextureStep; 
in vec2 v_textureCoordinates; 
bool czm_selected(vec2 offset) 
{ 
    bool selected = false;
    vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); 
    for (int i = 0; i < ${o}; ++i) 
    { 
        vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); 
        if (all(equal(id, selectedId))) 
        { 
            return true; 
        } 
    } 
    return false; 
} 

bool czm_selected() 
{ 
    return czm_selected(vec2(0.0)); 
} 

${n}`}let i=new Be({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Rct(e){let t=e._sampleMode,n,i;t===Ed.LINEAR?(n=cn.LINEAR,i=Ti.LINEAR):(n=cn.NEAREST,i=Ti.NEAREST);let o=e._sampler;(!d(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Zct(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Gct(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Ect(e,t){let n,i,o,r=e._texturesToRelease,s=r.length;for(n=0;n<s;++n)i=r[n],i=i&&i.destroy();r.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let m=a[n];o=m.name;let p=m.source;e._actualUniforms[o]=new Wt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!d(e._texturePromise)){e._ready=!0;return}if(c.length===0||d(e._texturePromise))return;s=c.length;let l=e._uniforms,u=[];for(n=0;n<s;++n){o=c[n];let m=l[o],p=e._textureCache.getStageByName(m);if(d(p))e._actualUniforms[o]=Gct(e,m);else if(typeof m=="string"){let y=new Ee({url:m});u.push(y.fetchImage().then(Zct(e,o)))}else e._texturesToCreate.push({name:o,source:m})}c.length=0,u.length>0?(e._ready=!1,e._texturePromise=Promise.all(u).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function Mbe(e){d(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!d(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i)i.hasOwnProperty(o)&&i[o]instanceof Wt&&(d(t.getStageByName(n[o]))||i[o].destroy(),e._dirtyUniforms.push(o))}function Xct(e){let t=d(e._selected)?e._selected.length:0,n=d(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,d(e._selected)&&d(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):d(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&d(e._combinedSelected)){if(!d(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function Ict(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!d(n))return;let i,o,r=0,s=n.length;for(i=0;i<s;++i)o=n[i],d(o.pickIds)?r+=o.pickIds.length:d(o.pickId)&&++r;if(s===0||r===0){let u=new Uint8Array(4);u[0]=255,u[1]=255,u[2]=255,u[3]=255,e._selectedIdTexture=new Wt({context:t,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:u,width:1,height:1},sampler:dn.NEAREST});return}let a,c=0,l=new Uint8Array(r*4);for(i=0;i<s;++i)if(o=n[i],d(o.pickIds)){let u=o.pickIds,m=u.length;for(let p=0;p<m;++p)a=u[p].color,l[c]=B.floatToByte(a.red),l[c+1]=B.floatToByte(a.green),l[c+2]=B.floatToByte(a.blue),l[c+3]=B.floatToByte(a.alpha),c+=4}else d(o.pickId)&&(a=o.pickId.color,l[c]=B.floatToByte(a.red),l[c+1]=B.floatToByte(a.green),l[c+2]=B.floatToByte(a.blue),l[c+3]=B.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Wt({context:t,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:l,width:r,height:1},sampler:dn.NEAREST})}sT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Mbe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Xct(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=d(this._selected)?this._selected.length:0,this._parentSelectedLength=d(this._parentSelected)?this._parentSelected.length:0,Ict(this,e),Vct(this),Ect(this,e),Lct(this,e),Rct(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!d(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!d(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=De.fromCache({viewport:new He(0,0,i.width,i.height)}))),this._command.renderState=o};sT.prototype.execute=function(e,t,n,i){if(!d(this._command)||!d(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,dn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;d(o)&&(o.context=e),this._command.execute(e,o)};sT.prototype.isDestroyed=function(){return!1};sT.prototype.destroy=function(){return Mbe(this),ue(this)};var po=sT;var TGi=T(S(),1);function aT(e){e=g(e,g.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=g(e.inputPreviousStageTexture,!0);let t=e.name;d(t)||(t=Yn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(aT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});aT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};aT.prototype.get=function(e){return this._stages[e]};function Wct(e){let t=d(e._selected)?e._selected.length:0,n=d(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,d(e._selected)&&d(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):d(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&d(e._combinedSelected)){if(!d(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}aT.prototype.update=function(e,t){this._selectedDirty=Wct(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=d(this._selected)?this._selected.length:0,this._parentSelectedLength=d(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};aT.prototype.isDestroyed=function(){return!1};aT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Hc=aT;var Pr={};function Lk(e){let o=`#define USE_STEP_SIZE
${Jy}`,r=new po({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Ed.LINEAR}),s=new po({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Ed.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let l=r.uniforms,u=s.uniforms;l.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let l=r.uniforms,u=s.uniforms;l.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let l=r.uniforms,u=s.uniforms;l.stepSize=u.stepSize=c}}}),new Hc({name:e,stages:[r,s],uniforms:a})}Pr.createBlurStage=function(){return Lk("czm_blur")};Pr.createDepthOfFieldStage=function(){let e=Lk("czm_depth_of_field_blur"),t=new po({name:"czm_depth_of_field_composite",fragmentShader:dw,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Hc({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Pr.createEdgeDetectionStage=function(){let e=Yn();return new po({name:`czm_edge_detection_${e}`,fragmentShader:mw,uniforms:{length:.25,color:B.clone(B.BLACK)}})};Pr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Pct(e){if(!d(e))return Pr.createEdgeDetectionStage();let t=new Hc({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; 
`,o+=`        vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); 
        if (edge${a}.a > 0.0) 
        { 
            color = edge${a}; 
            break; 
        } 
`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates; 
void main() { 
    vec4 color = vec4(0.0); 
    for (int i = 0; i < ${e.length}; i++) 
    { 
${o}    } 
    out_FragColor = color; 
} 
`,s=new po({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Hc({name:"czm_edge_detection_composite",stages:[t,s]})}Pr.createSilhouetteStage=function(e){let t=Pct(e),n=new po({name:"czm_silhouette_color_edges",fragmentShader:xw,uniforms:{silhouetteTexture:t.name}});return new Hc({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Pr.isSilhouetteSupported=function(e){return e.context.depthTexture};Pr.createBloomStage=function(){let e=new po({name:"czm_bloom_contrast_bias",fragmentShader:lw,uniforms:{contrast:128,brightness:-.3}}),t=Lk("czm_bloom_blur"),n=new Hc({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new po({name:"czm_bloom_generate_composite",fragmentShader:aw,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Hc({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Pr.createAmbientOcclusionStage=function(){let e=new po({name:"czm_ambient_occlusion_generate",fragmentShader:ow,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=Lk("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new Hc({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new po({name:"czm_ambient_occlusion_composite",fragmentShader:rw,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),o={};return Object.defineProperties(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(r){e.uniforms.intensity=r}},bias:{get:function(){return e.uniforms.bias},set:function(r){e.uniforms.bias=r}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(r){e.uniforms.lengthCap=r}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(r){e.uniforms.stepSize=r}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(r){e.uniforms.frustumLength=r}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(r){e.uniforms.randomTexture=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(r){i.uniforms.ambientOcclusionOnly=r}}}),new Hc({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Pr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var vct=`#define FXAA_QUALITY_PRESET 39 
${_w}
${fw}`;Pr.createFXAAStage=function(){return new po({name:"czm_FXAA",fragmentShader:vct,sampleMode:Ed.LINEAR})};Pr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=iw,new po({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Pr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=hw,new po({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Pr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=gw,new po({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Pr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=bw,new po({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:B.WHITE,autoExposure:void 0}})};Pr.createAutoExposureStage=function(){return new Tw};Pr.createBlackAndWhiteStage=function(){return new po({name:"czm_black_and_white",fragmentShader:sw,uniforms:{gradations:5}})};Pr.createBrightnessStage=function(){return new po({name:"czm_brightness",fragmentShader:cw,uniforms:{brightness:.5}})};Pr.createNightVisionStage=function(){return new po({name:"czm_night_vision",fragmentShader:yw})};Pr.createDepthViewStage=function(){return new po({name:"czm_depth_view",fragmentShader:uw})};Pr.createLensFlareStage=function(){return new po({name:"czm_lens_flare",fragmentShader:pw,uniforms:{dirtTexture:$t("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:$t("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var Yu=Pr;var rEi=T(S(),1);function k0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function Cw(e){for(;d(e.length);)e=e.get(e.length-1);return e.name}function yQ(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(d(o)){let a=e.getStageByName(o);r[Cw(a)]=!0}let s=i.uniforms;if(d(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let l=0;l<c;++l){let u=s[a[l]];if(typeof u=="string"){let m=e.getStageByName(u);d(m)&&(r[Cw(m)]=!0)}}}return i.name}function Sw(e,t,n,i,o){if(d(i.enabled)&&!i.enabled||d(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!d(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let m=0;m<c;++m){let p=i.get(m);d(p.length)?a=Sw(e,t,n,p,o):a=yQ(e,t,n,p,o),s&&(o=a)}let l,u;if(s)for(l=1;l<c;++l)u=Cw(i.get(l)),d(n[u])||(n[u]={}),n[u][r]=!0;else for(l=1;l<c;++l){u=Cw(i.get(l));let m=n[u];for(let p=0;p<l;++p)m[Cw(i.get(p))]=!0}return a}function wct(e,t){let n={};if(d(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=Sw(e,t,n,i,void 0);a=Sw(e,t,n,o,a),a=yQ(e,t,n,r,a),a=Sw(e,t,n,e,a),yQ(e,t,n,s,a)}else Sw(e,t,n,e,void 0);return n}function Fct(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,l=o._clearColor,u,m,p=e._framebuffers,y=p.length;for(u=0;u<y;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!B.equals(l,m.clearColor))continue;let f=m.stages,x=f.length,_=!1;for(let C=0;C<x;++C)if(n[f[C]]){_=!0;break}if(!_)break}return d(m)&&u<y?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:l,stages:[t],buffer:new mi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function Act(e,t){let n=wct(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Fct(e,i,n[i]))}function gQ(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Mct(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,l=Math.ceil(n*c),u=Math.ceil(i*c),m=Math.min(l,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(m)||(m=W.nextPowerOfTwo(m)),l=m,u=m),a.buffer.update(t,l,u),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}k0.prototype.updateDependencies=function(){this._updateDependencies=!0};k0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=d(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=d(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=d(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=d(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!d(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(gQ(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Act(this,e);let c=e.drawingBufferWidth,l=e.drawingBufferHeight,u=this._width!==c||this._height!==l;!n&&!u||(this._width=c,this._height=l,this._updateDependencies=!1,gQ(this),Mct(this,e))};k0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};k0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};k0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};k0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(d(t))return t.buffer.framebuffer};k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){return gQ(this),ue(this)};var cT=k0;var aEi=T(S(),1),Vw={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===Vw.REINHARD||e===Vw.MODIFIED_REINHARD||e===Vw.FILMIC||e===Vw.ACES}},Qy=Object.freeze(Vw);var xQ=[];function zc(){let e=Yu.createFXAAStage(),t=Yu.createAmbientOcclusionStage(),n=Yu.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Yu.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Qy.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new cT(this),r={},s=xQ;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let l=c.length;if(d(l))for(let u=0;u<l;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(zc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return _Q(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(d(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!d(t))continue;if(d(t.selected))return!0;let n=t.length;if(d(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;d(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case Qy.REINHARD:n=Yu.createReinhardTonemappingStage(t);break;case Qy.MODIFIED_REINHARD:n=Yu.createModifiedReinhardTonemappingStage(t);break;case Qy.FILMIC:n=Yu.createFilmicTonemappingStage(t);break;default:n=Yu.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,d(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function _Q(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._stages=t}zc.prototype.add=function(e){let t=this._stageNames,n=xQ;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(d(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};zc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=xQ;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(d(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};zc.prototype.contains=function(e){return d(e)&&d(e._index)&&e._textureCache===this._textureCache};zc.prototype.get=function(e){return _Q(this),this._stages[e]};zc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};zc.prototype.getStageByName=function(e){return this._stageNames[e]};zc.prototype.update=function(e,t,n){_Q(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages,s=o.length=r.length,a,c,l=0;for(a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&(o[l++]=c);o.length=l;let u=l!==i.length;if(!u){for(a=0;a<l;++a)if(o[a]!==i[a]){u=!0;break}}let m=this._ao,p=this._bloom,y=this._autoExposure,f=this._tonemapping,x=this._fxaa;f.enabled=n;let _=m.enabled&&m._isSupported(e),C=p.enabled&&p._isSupported(e),V=f.enabled&&f._isSupported(e),L=x.enabled&&x._isSupported(e);if((u||this._textureCacheDirty||_!==this._aoEnabled||C!==this._bloomEnabled||V!==this._tonemappingEnabled||L!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=C,this._tonemappingEnabled=V,this._fxaaEnabled=L,this._textureCacheDirty=!1),d(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!d(this._randomTexture)&&_){s=256*256*3;let Z=new Uint8Array(s);for(a=0;a<s;a+=3)Z[a]=Math.floor(Math.random()*255);this._randomTexture=new Wt({context:e,pixelFormat:st.RGB,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:Z,width:256,height:256},sampler:new dn({wrapS:Gn.REPEAT,wrapT:Gn.REPEAT,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),m.update(e,t),p.update(e,t),f.update(e,t),this._autoExposureEnabled&&y.update(e,t),s=r.length,a=0;a<s;++a)r[a].update(e,t);for(l=0,a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&l++;u=l!==o.length,u&&this.update(e,t,n)};zc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function lT(e){for(;d(e.length);)e=e.get(e.length-1);return e.outputTexture}zc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(d(t))return lT(t)};function wf(e,t,n,i,o){if(d(e.execute)){e.execute(t,n,i,o);return}let r=e.length,s;if(e.inputPreviousStageTexture)for(wf(e.get(0),t,n,i,o),s=1;s<r;++s)wf(e.get(s),t,lT(e.get(s-1)),i,o);else for(s=0;s<r;++s)wf(e.get(s),t,n,i,o)}zc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,l=this._autoExposure,u=this._tonemapping,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),y=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!m&&!p&&!f&&r===0)return;let _=t;m&&a.ready&&(wf(a,e,_,n,i),_=lT(a)),p&&c.ready&&(wf(c,e,_,n,i),_=lT(c)),y&&l.ready&&wf(l,e,_,n,i),f&&u.ready&&(wf(u,e,_,n,i),_=lT(u));let C=_;if(r>0){wf(o[0],e,_,n,i);for(let V=1;V<r;++V)wf(o[V],e,lT(o[V-1]),n,i);C=lT(o[r-1])}x&&s.ready&&wf(s,e,C,n,i)};zc.prototype.copy=function(e,t){if(!d(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Al,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};zc.prototype.isDestroyed=function(){return!1};zc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var Lw=zc;var tXi=T(S(),1);var AEi=T(S(),1);var VEi=T(S(),1),Nct={SHIFT:0,CTRL:1,ALT:2},ra=Object.freeze(Nct);var REi=T(S(),1),Uct={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},_n=Object.freeze(Uct);function jy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function RQ(e,t){let n=e;return d(t)&&(n+=`+${t}`),n}function dT(e){if(e.shiftKey)return ra.SHIFT;if(e.ctrlKey)return ra.CTRL;if(e.altKey)return ra.ALT}var ps={LEFT:0,MIDDLE:1,RIGHT:2};function Xd(e,t,n,i){function o(r){i(e,r)}Mt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function kct(e){let t=e._element,n=d(t.disableRootEvents)?t:document;Mt.supportsPointerEvents()?(Xd(e,"pointerdown",t,Hct),Xd(e,"pointerup",t,zbe),Xd(e,"pointermove",t,zct),Xd(e,"pointercancel",t,zbe)):(Xd(e,"mousedown",t,Jbe),Xd(e,"mouseup",n,Qbe),Xd(e,"mousemove",n,jbe),Xd(e,"touchstart",t,Oct),Xd(e,"touchend",n,Bbe),Xd(e,"touchmove",n,Kct),Xd(e,"touchcancel",n,Bbe)),Xd(e,"dblclick",t,Bct);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Xd(e,i,t,Yct)}function Dct(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Nbe={position:new D};function ZQ(e){e._lastSeenTouchEvent=gi()}function GQ(e){return gi()-e._lastSeenTouchEvent>hh.mouseEmulationIgnoreMilliseconds}function LQ(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Jbe(e,t){if(!GQ(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ps.LEFT)i=_n.LEFT_DOWN;else if(n===ps.MIDDLE)i=_n.MIDDLE_DOWN;else if(n===ps.RIGHT)i=_n.RIGHT_DOWN;else return;let o=jy(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=dT(t),s=e.getInputAction(i,r);d(s)&&(D.clone(o,Nbe.position),s(Nbe),t.preventDefault())}var Ube={position:new D},kbe={position:new D};function TQ(e,t,n,i){let o=dT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(d(r)||d(s)){let a=jy(e,i,e._primaryPosition);if(d(r)&&(D.clone(a,Ube.position),r(Ube)),d(s)){let c=e._primaryStartPosition;LQ(c,a,e._clickPixelTolerance)&&(D.clone(a,kbe.position),s(kbe))}}}function Qbe(e,t){if(!GQ(e))return;let n=t.button;n!==ps.LEFT&&n!==ps.MIDDLE&&n!==ps.RIGHT||(e._buttonDown[ps.LEFT]&&(TQ(e,_n.LEFT_UP,_n.LEFT_CLICK,t),e._buttonDown[ps.LEFT]=!1),e._buttonDown[ps.MIDDLE]&&(TQ(e,_n.MIDDLE_UP,_n.MIDDLE_CLICK,t),e._buttonDown[ps.MIDDLE]=!1),e._buttonDown[ps.RIGHT]&&(TQ(e,_n.RIGHT_UP,_n.RIGHT_CLICK,t),e._buttonDown[ps.RIGHT]=!1))}var SQ={startPosition:new D,endPosition:new D};function jbe(e,t){if(!GQ(e))return;let n=dT(t),i=jy(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(_n.MOUSE_MOVE,n);d(r)&&(D.clone(o,SQ.startPosition),D.clone(i,SQ.endPosition),r(SQ)),D.clone(i,o),(e._buttonDown[ps.LEFT]||e._buttonDown[ps.MIDDLE]||e._buttonDown[ps.RIGHT])&&t.preventDefault()}var Dbe={position:new D};function Bct(e,t){let n=t.button,i;if(n===ps.LEFT)i=_n.LEFT_DOUBLE_CLICK;else return;let o=dT(t),r=e.getInputAction(i,o);d(r)&&(jy(e,t,Dbe.position),r(Dbe))}function Yct(e,t){let n;if(d(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!d(n))return;let i=dT(t),o=e.getInputAction(_n.WHEEL,i);d(o)&&(o(n),t.preventDefault())}function Oct(e,t){ZQ(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,jy(e,r,new D));Rk(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,D.clone(a.get(s)))}function Bbe(e,t){ZQ(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);Rk(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var Ybe={position:new D},CQ={position1:new D,position2:new D},Obe={position:new D},Kbe={position:new D},Hbe={position:new D};function Rk(e,t){let n=dT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[ps.LEFT]){if(e._buttonDown[ps.LEFT]=!1,d(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(_n.LEFT_UP,n),d(r)&&(D.clone(e._primaryPosition,Obe.position),r(Obe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(_n.LEFT_CLICK,n),d(s))){let c=e._primaryStartPosition,l=e._previousPositions.values[0];LQ(c,l,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,Kbe.position),s(Kbe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(_n.PINCH_END,n),d(r)&&r()),o===1&&!a){let c=i.values[0];D.clone(c,e._primaryPosition),D.clone(c,e._primaryStartPosition),D.clone(c,e._primaryPreviousPosition),e._buttonDown[ps.LEFT]=!0,r=e.getInputAction(_n.LEFT_DOWN,n),d(r)&&(D.clone(c,Ybe.position),r(Ybe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(_n.RIGHT_CLICK,n),d(s))){let l=e._primaryStartPosition,u=e._previousPositions.values[0];LQ(l,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,Hbe.position),s(Hbe))}},hh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(_n.PINCH_START,n),d(r)&&(D.clone(i.values[0],CQ.position1),D.clone(i.values[1],CQ.position2),r(CQ),t.preventDefault()))}function Kct(e,t){ZQ(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let l=a.get(s);d(l)&&jy(e,r,l)}qbe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),c.get(s))}var VQ={startPosition:new D,endPosition:new D},Rw={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function qbe(e,t){let n=dT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[ps.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(_n.MOUSE_MOVE,n),d(s)&&(D.clone(c,VQ.startPosition),D.clone(a,VQ.endPosition),s(VQ)),D.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(_n.PINCH_MOVE,n),d(s))){let a=i.values[0],c=i.values[1],l=o.values[0],u=o.values[1],m=c.x-a.x,p=c.y-a.y,y=Math.sqrt(m*m+p*p)*.25,f=u.x-l.x,x=u.y-l.y,_=Math.sqrt(f*f+x*x)*.25,C=(c.y+a.y)*.125,V=(u.y+l.y)*.125,L=Math.atan2(p,m),Z=Math.atan2(x,f);D.fromElements(0,_,Rw.distance.startPosition),D.fromElements(0,y,Rw.distance.endPosition),D.fromElements(Z,V,Rw.angleAndHeight.startPosition),D.fromElements(L,C,Rw.angleAndHeight.endPosition),s(Rw)}}function Hct(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,jy(e,t,new D)),Rk(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else Jbe(e,t)}function zbe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),Rk(e,t),e._previousPositions.remove(i)}else Qbe(e,t)}function zct(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!d(o))return;jy(e,t,o),qbe(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else jbe(e,t)}function hh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-hh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Tt,this._previousPositions=new Tt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=g(e,document),kct(this)}hh.prototype.setInputAction=function(e,t,n){let i=RQ(t,n);this._inputEvents[i]=e};hh.prototype.getInputAction=function(e,t){let n=RQ(e,t);return this._inputEvents[n]};hh.prototype.removeInputAction=function(e,t){let n=RQ(e,t);delete this._inputEvents[n]};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){return Dct(this),ue(this)};hh.mouseEmulationIgnoreMilliseconds=800;hh.touchHoldDelayMilliseconds=1500;var Id=hh;function uT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}uT.prototype.completeMorph=function(){d(this._completeMorph)&&this._completeMorph()};uT.prototype.morphTo2D=function(e,t){d(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof en,!(this._previousMode===ie.SCENE2D||this._previousMode===ie.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ie.SCENE2D,!0),n._mode=ie.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ie.COLUMBUS_VIEW?Zlt(this,e):vlt(this,e,t),e===0&&d(this._completeMorph)&&this._completeMorph())};var Jct=new h,Qct=new h,jct=new h,qct=new h,$ct=new h,elt=new h,tlt=new h,nlt=new he,ilt=new F,olt=new Ri,rlt=new en,slt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};uT.prototype.morphToColumbusView=function(e,t){d(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ie.COLUMBUS_VIEW||this._previousMode===ie.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ie.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=Jct,o=Qct,r=jct;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let l=n.camera;if(this._previousMode===ie.SCENE2D)h.clone(l.position,i),i.z=l.frustum.right-l.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(l.positionWC,i),h.clone(l.directionWC,o),h.clone(l.upWC,r);let u=t.scaleToGeodeticSurface(i,tlt),m=vt.eastNorthUpToFixedFrame(u,t,ilt);F.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,nlt),i),F.multiplyByPointAsVector(m,o,o),F.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=rlt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=olt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=slt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Flt(a);Zw(this,c),this._previousMode===ie.SCENE2D?wlt(this,e,a,c):(a.position2D=F.multiplyByPoint(co.TRANSFORM_2D,i,qct),a.direction2D=F.multiplyByPointAsVector(co.TRANSFORM_2D,o,$ct),a.up2D=F.multiplyByPointAsVector(co.TRANSFORM_2D,r,elt),n._mode=ie.MORPHING,lye(this,e,a,c)),e===0&&d(this._completeMorph)&&this._completeMorph()};var IQ={position:new h,direction:new h,up:new h,frustum:void 0},eye=new Ri;uT.prototype.morphTo3D=function(e,t){d(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ie.SCENE3D||this._previousMode===ie.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ie.SCENE3D,!0),n._mode=ie.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ie.SCENE2D)ylt(this,e,t);else{let i;e>0?(i=IQ,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=tye(this,t);let o,r=n.camera;r.frustum instanceof en?o=r.frustum.clone():(o=eye,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=uye(i);Zw(this,s),XQ(this,e,i,s)}e===0&&d(this._completeMorph)&&this._completeMorph()}};uT.prototype.isDestroyed=function(){return!1};uT.prototype.destroy=function(){return Zk(this),ue(this)};function Zw(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Id(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,_n.LEFT_DOWN),e._morphHandler.setInputAction(n,_n.MIDDLE_DOWN),e._morphHandler.setInputAction(n,_n.RIGHT_DOWN),e._morphHandler.setInputAction(n,_n.WHEEL)}}function Zk(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var alt=new he,clt=new h,llt=new F;function tye(e,t){let n=e._scene,i=n.camera,o=IQ,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,alt);t.cartographicToCartesian(c,r);let l=t.scaleToGeodeticSurface(r,clt),u=vt.eastNorthUpToFixedFrame(l,t,llt);return F.multiplyByPointAsVector(u,i.direction,s),F.multiplyByPointAsVector(u,i.up,a),o}var dlt=new h,ult=new h,mlt=new h,hlt=new h,flt=new h,plt=new h;function XQ(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,dlt),a=h.clone(r.direction,ult),c=h.clone(r.up,mlt),l=F.multiplyByPoint(co.TRANSFORM_2D_INVERSE,n.position,hlt),u=F.multiplyByPointAsVector(co.TRANSFORM_2D_INVERSE,n.direction,flt),m=F.multiplyByPointAsVector(co.TRANSFORM_2D_INVERSE,n.up,plt);function p(f){Ou(s,l,f.time,r.position),Ou(a,u,f.time,r.direction),Ou(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let y=o.tweens.add({duration:t,easingFunction:Wr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dye(e,o,0,1,t,i)}});e._currentTweens.push(y)}var blt=new en,nye=new h,iye=new h,oye=new h,WQ=new h,rye=new h,sye=new h;function ylt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=IQ,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=tye(e,n));let s;e._morphToOrthographic?(s=blt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=eye,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=uye(r);Zw(e,a);let c;e._morphToOrthographic?c=function(){XQ(e,t,r,a)}:c=function(){cye(e,t,r,function(){XQ(e,t,r,a)})},t>0?(i._mode=ie.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,WQ),complete:function(){i._mode=ie.MORPHING,c()}})):c()}function Ou(e,t,n,i){return h.lerp(e,t,n,i)}function aye(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof en)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,l=n.position.z*Math.tan(a*.5);s.frustum.far=l/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let y=l/Math.tan(s.frustum.fov*.5);i(s,y)}let m=r.tweens.add({duration:t,easingFunction:Wr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var glt=new h,xlt=new h,_lt=new h,EQ=new h,Tlt=new h,Slt=new h,Clt=new yr,Vlt=new Sn,Llt=new h,Rlt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Zlt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,glt),r=h.clone(i.direction,xlt),s=h.clone(i.up,_lt),a=h.negate(h.UNIT_Z,Tlt),c=h.clone(h.UNIT_Y,Slt),l=EQ;if(t>0)h.clone(h.ZERO,EQ),l.z=5*n.mapProjection.ellipsoid.maximumRadius;else{h.clone(o,EQ);let _=Vlt;F.multiplyByPoint(co.TRANSFORM_2D,o,_.origin),F.multiplyByPointAsVector(co.TRANSFORM_2D,r,_.direction);let C=n.globe;if(d(C)){let V=C.pickWorldCoordinates(_,n,!0,Llt);d(V)&&(F.multiplyByPoint(co.TRANSFORM_2D_INVERSE,V,l),l.z+=h.distance(o,l))}}let u=Clt;u.right=l.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=Rlt;m.position=l,m.direction=a,m.up=c,m.frustum=u;let p=mye(m);Zw(e,p);function y(_){Ou(o,l,_.time,i.position),Ou(r,a,_.time,i.direction),Ou(s,c,_.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Wr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){aye(e,t,m,f,p)}});e._currentTweens.push(x)}var $be=new he,Glt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new yr},Elt={position:new h,direction:new h,up:new h,frustum:void 0},Xlt=new h,Ilt=new Sn,Wlt=new F,Plt=new h;function vlt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Glt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,$be),i.mapProjection.project($be,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=Ilt;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),y=n.scaleToGeodeticSurface(o.positionWC,Plt),f=vt.eastNorthUpToFixedFrame(y,n,Wlt);F.inverseTransformation(f,f),F.multiplyByPointAsVector(f,p,p),F.multiplyByPointAsVector(co.TRANSFORM_2D,p,p);let x=i.globe;if(d(x)){let _=x.pickWorldCoordinates(m,i,!0,Xlt);if(d(_)){let C=h.distance(r.position2D,_);_.x+=C,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}F.multiplyByPoint(co.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(co.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(co.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=Elt;F.multiplyByPoint(co.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let l=mye(c);Zw(e,l);function u(){aye(e,t,r,s,l)}lye(e,t,r,u)}function cye(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,l=s*Math.tan(a*.5);r.frustum.far=l/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=l/Math.tan(r.frustum.fov*.5)}let m=o.tweens.add({duration:t,easingFunction:Wr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function wlt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,WQ),a=h.clone(n.direction,rye),c=h.clone(n.up,sye);o._mode=ie.MORPHING;function l(){r.frustum=n.frustum.clone();let u=h.clone(r.position,nye),m=h.clone(r.direction,iye),p=h.clone(r.up,oye);u.z=s.z;function y(x){Ou(u,s,x.time,r.position),Ou(m,a,x.time,r.direction),Ou(p,c,x.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:Wr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?l():cye(e,0,n,l)}function lye(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,nye),a=h.clone(r.direction,iye),c=h.clone(r.up,oye),l=h.clone(n.position2D,WQ),u=h.clone(n.direction2D,rye),m=h.clone(n.up2D,sye);function p(f){Ou(s,l,f.time,r.position),Ou(a,u,f.time,r.direction),Ou(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let y=o.tweens.add({duration:t,easingFunction:Wr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dye(e,o,1,0,t,i)}});e._currentTweens.push(y)}function dye(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Wr.QUARTIC_OUT};d(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function uye(e){return function(t){let n=t._scene;n._mode=ie.SCENE3D,n.morphTime=ie.getMorphTime(ie.SCENE3D),Zk(t);let i=n.camera;(t._previousMode!==ie.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=d(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ie.SCENE3D,r)}}function mye(e){return function(t){let n=t._scene;n._mode=ie.SCENE2D,n.morphTime=ie.getMorphTime(ie.SCENE2D),Zk(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=d(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ie.SCENE2D,o)}}function Flt(e){return function(t){let n=t._scene;n._mode=ie.COLUMBUS_VIEW,n.morphTime=ie.getMorphTime(ie.COLUMBUS_VIEW),Zk(t);let i=n.camera;(t._previousModeMode!==ie.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=d(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ie.COLUMBUS_VIEW,r)}}var Gw=uT;var QXi=T(S(),1);var hXi=T(S(),1);var iXi=T(S(),1),Alt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},vi=Object.freeze(Alt);function uc(e,t){let n=e;return d(t)&&(n+=`+${t}`),n}function Mlt(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function hye(e,t,n){let i=uc(vi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let l=e._movement[i];d(l)||(l=e._movement[i]={}),l.distance={startPosition:new D,endPosition:new D},l.angleAndHeight={startPosition:new D,endPosition:new D},l.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},_n.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},_n.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(Mlt(u,l),o[i]=!1,l.prevAngle=l.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,l.distance.endPosition),D.clone(u.angleAndHeight.endPosition,l.angleAndHeight.endPosition));let m=l.angleAndHeight.endPosition.x,p=l.prevAngle,y=Math.PI*2;for(;m>=p+Math.PI;)m-=y;for(;m<p-Math.PI;)m+=y;l.angleAndHeight.endPosition.x=-m*n.clientWidth/12,l.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},_n.PINCH_MOVE,t)}function fye(e,t){let n=uc(vi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];d(s)||(s=e._movement[n]={});let a=e._lastMovement[n];d(a)||(a=e._lastMovement[n]={startPosition:new D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,e._eventHandler.setInputAction(function(c){let l=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=l,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},_n.WHEEL,t)}function uV(e,t,n){let i=uc(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;o[i]=!1,r[i]=new D;let c=e._lastMovement[i];d(c)||(c=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let l,u;n===vi.LEFT_DRAG?(l=_n.LEFT_DOWN,u=_n.LEFT_UP):n===vi.RIGHT_DRAG?(l=_n.RIGHT_DOWN,u=_n.RIGHT_UP):n===vi.MIDDLE_DRAG&&(l=_n.MIDDLE_DOWN,u=_n.MIDDLE_UP),e._eventHandler.setInputAction(function(m){e._buttonsDown++,c.valid=!1,o[i]=!0,s[i]=new Date,D.clone(m.position,r[i])},l,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,a[i]=new Date},u,t)}function pye(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function bye(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in vi)if(vi.hasOwnProperty(s)){let a=vi[s];if(d(a)){let c=uc(a,t);n[c]=!0,d(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new D,endPosition:new D,valid:!1}),d(e._movement[c])||(e._movement[c]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in vi)if(vi.hasOwnProperty(a)){let c=vi[a];if(d(c)){let l=uc(c,t);r[l]&&(n[l]?(pye(i[l],o[l]),o[l].valid=!0,pye(s,i[l]),n[l]=!1):D.clone(s.endPosition,i[l].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},_n.MOUSE_MOVE,t)}function Ku(e){this._eventHandler=new Id(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,fye(this,void 0),hye(this,void 0,e),uV(this,void 0,vi.LEFT_DRAG),uV(this,void 0,vi.RIGHT_DRAG),uV(this,void 0,vi.MIDDLE_DRAG),bye(this,void 0);for(let t in ra)if(ra.hasOwnProperty(t)){let n=ra[t];d(n)&&(fye(this,n),hye(this,n,e),uV(this,n,vi.LEFT_DRAG),uV(this,n,vi.RIGHT_DRAG),uV(this,n,vi.MIDDLE_DRAG),bye(this,n))}}Object.defineProperties(Ku.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[uc(vi.WHEEL)]||!this._update[uc(vi.WHEEL,ra.SHIFT)]||!this._update[uc(vi.WHEEL,ra.CTRL)]||!this._update[uc(vi.WHEEL,ra.ALT)];return this._buttonsDown>0||e}}});Ku.prototype.isMoving=function(e,t){let n=uc(e,t);return!this._update[n]};Ku.prototype.getMovement=function(e,t){let n=uc(e,t);return this._movement[n]};Ku.prototype.getLastMovement=function(e,t){let n=uc(e,t),i=this._lastMovement[n];if(i.valid)return i};Ku.prototype.isButtonDown=function(e,t){let n=uc(e,t);return this._isDown[n]};Ku.prototype.getStartMousePosition=function(e,t){if(e===vi.WHEEL)return this._currentMousePosition;let n=uc(e,t);return this._eventStartPosition[n]};Ku.prototype.getButtonPressTime=function(e,t){let n=uc(e,t);return this._pressTime[n]};Ku.prototype.getButtonReleaseTime=function(e,t){let n=uc(e,t);return this._releaseTime[n]};Ku.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Ku.prototype.isDestroyed=function(){return!1};Ku.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var Ew=Ku;var SXi=T(S(),1);function Gk(e,t,n,i,o,r,s,a,c,l){this._tweens=e,this._tweenjs=t,this._startObject=Oe(n),this._stopObject=Oe(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=l,this.needsStart=!0}Object.defineProperties(Gk.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});Gk.prototype.cancelTween=function(){this._tweens.remove(this)};function fh(){this._tweens=[]}Object.defineProperties(fh.prototype,{length:{get:function(){return this._tweens.length}}});fh.prototype.add=function(e){if(e=g(e,g.EMPTY_OBJECT),e.duration===0)return d(e.complete)&&e.complete(),new Gk(this);let t=e.duration/Qn.SECONDS_PER_MILLISECOND,n=g(e.delay,0),i=n/Qn.SECONDS_PER_MILLISECOND,o=g(e.easingFunction,Wr.LINEAR_NONE),r=e.startObject,s=new ife(r);s.to(Oe(e.stopObject),t),s.delay(i),s.easing(o),d(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(g(e.complete,null)),s.repeat(g(e._repeat,0));let a=new Gk(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};fh.prototype.addProperty=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:g(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};fh.prototype.addAlpha=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&d(t.uniforms[o])&&d(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:g(e.startValue,0)},stopObject:{alpha:g(e.stopValue,1)},duration:g(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};fh.prototype.addOffsetIncrement=function(e){e=g(e,g.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};fh.prototype.remove=function(e){if(!d(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),d(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};fh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),d(n.cancel)&&n.cancel()}e.length=0};fh.prototype.contains=function(e){return d(e)&&this._tweens.indexOf(e)!==-1};fh.prototype.get=function(e){return this._tweens[e]};fh.prototype.update=function(e){let t=this._tweens,n=0;for(e=d(e)?e/Qn.SECONDS_PER_MILLISECOND:gi();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var mT=fh;function Iw(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=vi.LEFT_DRAG,this.zoomEventTypes=[vi.RIGHT_DRAG,vi.WHEEL,vi.PINCH],this.rotateEventTypes=vi.LEFT_DRAG,this.tiltEventTypes=[vi.MIDDLE_DRAG,vi.PINCH,{eventType:vi.LEFT_DRAG,modifier:ra.CTRL},{eventType:vi.RIGHT_DRAG,modifier:ra.CTRL}],this.lookEventTypes={eventType:vi.LEFT_DRAG,modifier:ra.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new Ew(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new mT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Nlt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Ult(e){return D.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var klt=.4;function Dlt(e,t,n,i,o,r,s){let a=r[s];d(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),l=e.getButtonReleaseTime(t,n),u=c&&l&&(l.getTime()-c.getTime())/1e3,p=l&&(new Date().getTime()-l.getTime())/1e3;if(c&&l&&u<klt){let y=Nlt(p,i),f=e.getLastMovement(t,n);if(!d(f)||Ult(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=D.clone(f.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,y,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Blt(e,t){if(d(t)){let n=e[t];d(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(d(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],d(n)&&(n.inertiaEnabled=!1)}}}var yye=[];function Jc(e,t,n,i,o,r){if(!d(n))return;let s=e._aggregator;Array.isArray(n)||(yye[0]=n,n=yye);let a=n.length;for(let c=0;c<a;++c){let l=n[c],u=d(l.eventType)?l.eventType:l,m=l.modifier,p=s.isMoving(u,m)&&s.getMovement(u,m),y=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,y,p),Blt(e,r)):o<1&&Dlt(s,u,m,o,i,e,r))}}var Ek=new Sn,Ylt=new h,Olt=new D,Klt=new h,Hlt=new D,zlt=new h,Jlt=new h,Qlt=new h,jlt=new h,Eye=new h,qlt=new h,$lt=new h,edt=new h,tdt=new h,ndt=new h,idt=new h,odt=new h,rdt=new h,sdt=new h,adt=new h,hT=new h,gye=new h,xye=new h,PQ={orientation:new Aa};function kQ(e,t,n,i,o,r){let s=1;d(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,l=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,m=o-l,p=i*m;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let y=a/e._scene.canvas.clientHeight;y=Math.min(y,e.maximumMovementRatio);let f=p*y;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!d(e._globe)){if(f>0&&Math.abs(o-l)<1||f<0&&Math.abs(o-u)<1)return;o-f<l?f=o-l-1:o-f>u&&(f=o-u)}let x=e._scene,_=x.camera,C=x.mode,V=PQ.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof en){Math.abs(f)>0&&(_.zoomIn(f),_._adjustOrthographicFrustum(!0));return}let L=g(n.inertiaEnabled,D.equals(t,e._zoomMouseStart)),Z=e._zoomingOnVector,G=e._rotatingZoom,X;if(L||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),d(e._globe)&&C===ie.SCENE2D?(X=_.getPickRay(t,Ek).origin,X=h.fromElements(X.y,X.z,X.x)):d(e._globe)&&(X=D0(e,t,Ylt)),d(X)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(X,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,Z=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let P=C===ie.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===ie.SCENE2D){let v=e._zoomWorldPosition,A=_.position;if(!h.equals(v,A)&&_.positionCartographic.height<e._maxCoord.x*2){let M=_.position.x,b=h.subtract(v,A,Klt);h.normalize(b,b);let R=h.distance(v,A)*f/(_.getMagnitude()*.5);_.move(b,R*.5),(_.position.x<0&&M>0||_.position.x>0&&M<0)&&(X=_.getPickRay(t,Ek).origin,X=h.fromElements(X.y,X.z,X.x),e._zoomWorldPosition=h.clone(X,e._zoomWorldPosition))}}else if(C===ie.SCENE3D){let v=h.normalize(_.position,Eye);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,v))<.6)P=!0;else{let A=x.canvas,M=Hlt;M.x=A.clientWidth/2,M.y=A.clientHeight/2;let b=D0(e,M,zlt);if(!d(b))P=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,v)>=-.5)P=!0;else{let R=$lt;h.clone(_.position,R);let E=e._zoomWorldPosition,I=qlt;if(I=h.normalize(E,I),h.dot(I,v)<0)return;let w=adt,N=ndt;h.clone(_.direction,N),h.add(R,h.multiplyByScalar(N,1e3,hT),w);let Y=idt,k=odt;h.subtract(E,R,Y),h.normalize(Y,k);let O=h.dot(v,k);if(O>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-O),J=h.magnitude(R),z=h.magnitude(E),ee=J-f,K=h.magnitude(Y),j=Math.asin(W.clamp(K/z*Math.sin(U),-1,1)),q=Math.asin(W.clamp(ee/z*Math.sin(U),-1,1)),be=j-q+U,Te=edt;h.normalize(R,Te);let ae=tdt;ae=h.cross(k,Te,ae),ae=h.normalize(ae,ae),h.normalize(h.cross(Te,ae,hT),N),h.multiplyByScalar(h.normalize(w,hT),h.magnitude(w)-f,w),h.normalize(R,R),h.multiplyByScalar(R,ee,R);let xe=rdt;h.multiplyByScalar(h.add(h.multiplyByScalar(Te,Math.cos(be)-1,gye),h.multiplyByScalar(N,Math.sin(be),xye),hT),ee,xe),h.add(R,xe,R),h.normalize(w,Te),h.normalize(h.cross(Te,ae,hT),N);let _e=sdt;h.multiplyByScalar(h.add(h.multiplyByScalar(Te,Math.cos(be)-1,gye),h.multiplyByScalar(N,Math.sin(be),xye),hT),h.magnitude(w),_e),h.add(w,_e,w),h.clone(R,_.position),h.normalize(h.subtract(w,R,hT),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(PQ);return}else{let R=h.normalize(b,Jlt),E=h.normalize(e._zoomWorldPosition,Qlt),I=h.dot(E,R);if(I>0&&I<1){let w=W.acosClamped(I),N=h.cross(E,R,jlt),Y=Math.abs(w)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,k=f/Y;_.rotate(N,w*k)}}}}e._rotatingZoom=!P}if(!L&&P||Z){let v,A=Ji.wgs84ToWindowCoordinates(x,e._zoomWorldPosition,Olt);C!==ie.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&d(A)?v=_.getPickRay(A,Ek):v=_.getPickRay(t,Ek);let M=v.direction;(C===ie.COLUMBUS_VIEW||C===ie.SCENE2D)&&h.fromElements(M.y,M.z,M.x,M),_.move(M,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(PQ)}var cdt=new Sn,ldt=new Sn,ddt=new h;function udt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,cdt).origin,s=o.getPickRay(n.endPosition,ldt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,ddt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function _ye(e,t,n){d(n.distance)&&(n=n.distance);let o=e._scene.camera;kQ(e,t,n,e._zoomFactor,o.getMagnitude())}var mdt=new D,hdt=new D;function Tye(e,t,n){if(d(n.angleAndHeight)){fdt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=mdt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=D.normalize(c,c);let l=hdt;l.x=2/s*n.endPosition.x-1,l.y=2/a*(a-n.endPosition.y)-1,l=D.normalize(l,l);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let m=W.acosClamped(l.x);l.y<0&&(m=W.TWO_PI-m);let p=m-u;o.twistRight(p)}function fdt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function pdt(e){let t=e._scene.mapMode2D===Fl.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(Jc(e,e.enableTranslate,e.translateEventTypes,udt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,_ye,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jc(e,e.enableRotate,e.tiltEventTypes,Tye,e.inertiaSpin,"_lastInertiaTiltMovement")):(Jc(e,e.enableZoom,e.zoomEventTypes,_ye,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jc(e,e.enableRotate,e.translateEventTypes,Tye,e.inertiaSpin,"_lastInertiaSpinMovement"))}var Xye=new Sn,bdt=new h,ydt=new h;function D0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,bdt)),!d(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,Xye),l=o.pickWorldCoordinates(c,i,a,ydt),u=d(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=d(l)?h.distance(l,r.positionWC):Number.POSITIVE_INFINITY;return u<m?h.clone(s,n):h.clone(l,n)}var gdt=new he;function Fk(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ie.SCENE3D){let c=t.cartesianToCartographic(i.position,gdt);d(c)&&(r=c.height)}else r=i.position.z;let s=g(e._scene.globeHeight,0);return Math.abs(s-r)}var xdt=new h;function Iye(e,t){let n=t.origin,i=t.direction,o=Fk(e),r=h.normalize(n,xdt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function Wye(e,t,n,i){let o=h.distance(t.origin,n),r=Fk(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),Sn.getPoint(t,o,i)}function Pye(e,t,n,i){let o;return d(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=Fk(e))):o=Fk(e),Sn.getPoint(t,o,i)}var _dt=new D;function vye(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,_dt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,DQ(e,t,e._strafeStartPosition),t.endPosition=n}var Sye=new Sn,Tdt=new Sn,vQ=new h,Sdt=new h,Cdt=new h,Vdt=new h,Ldt=new on(h.UNIT_X,0),Rdt=new D,Zdt=new D;function Gdt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Pd(e,t,n);return}if(e._strafing){vye(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,Rdt),a=D.clone(n.endPosition,Zdt),c=o.getPickRay(s,Sye),l=h.clone(h.ZERO,Vdt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=D0(e,s,vQ),d(m)&&(l.x=m.x)),r||l.x>o.position.z&&d(m)){let L=m;r&&(L=Pye(e,c,m,vQ)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),h.clone(L,e._strafeStartPosition),e._strafing=!0,DQ(e,n,e._strafeStartPosition);return}let p=on.fromPointNormal(l,u,Ldt);c=o.getPickRay(s,Sye);let y=Si.rayPlane(c,p,vQ),f=o.getPickRay(a,Tdt),x=Si.rayPlane(f,p,Sdt);if(!d(y)||!d(x)){e._looking=!0,Pd(e,t,n),D.clone(t,e._translateMousePosition);return}let _=h.subtract(y,x,Cdt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=h.magnitude(_);V>W.EPSILON6&&(h.normalize(_,_),o.move(_,V))}var wye=new D,Wk=new Sn,Pk=new h,Edt=new h,Fye=new F,Xdt=new F,Idt=new h,Wdt=new on(h.UNIT_X,0),wQ=new h,MQ=new he,Aye=new F,Pdt=new Ae,vdt=new $,vk=new h;function wdt(e,t,n){if(d(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Pd(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Fdt(e,t,n)):Adt(e,t,n)}function Fdt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=wye;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,Wk),c=h.UNIT_X,l=a.origin,u=a.direction,m,p=h.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(m=-h.dot(c,l)/p),!d(m)||m<=0){e._looking=!0,Pd(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let y=h.multiplyByScalar(u,m,Pk);h.add(l,y,y);let f=i.mapProjection,x=f.ellipsoid;h.fromElements(y.y,y.z,y.x,y);let _=f.unproject(y,MQ);x.cartographicToCartesian(_,y);let C=vt.eastNorthUpToFixedFrame(y,x,Fye),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=F.clone(o.transform,Aye);o._setTransform(C),Wd(e,t,n,h.UNIT_Z),o._setTransform(Z),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function Adt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,Pk);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=D0(e,t,Pk)),!d(s)){a=o.getPickRay(t,Wk);let b=a.origin,R=a.direction,E,I=h.dot(c,R);if(Math.abs(I)>W.EPSILON6&&(E=-h.dot(c,b)/I),!d(E)||E<=0){e._looking=!0,Pd(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(R,E,Pk),h.add(b,s,s)}r&&(d(a)||(a=o.getPickRay(t,Wk)),Wye(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let l=i.canvas,u=wye;u.x=l.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,Wk);let m=h.clone(h.ZERO,Idt);m.x=s.x;let p=on.fromPointNormal(m,c,Wdt),y=Si.rayPlane(a,p,Edt),f=o._projection,x=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,MQ);x.cartographicToCartesian(_,s);let C=vt.eastNorthUpToFixedFrame(s,x,Fye),V;d(y)?(h.fromElements(y.y,y.z,y.x,y),_=f.unproject(y,MQ),x.cartographicToCartesian(_,y),V=vt.eastNorthUpToFixedFrame(y,x,Xdt)):V=C;let L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=h.UNIT_Z,X=F.clone(o.transform,Aye);o._setTransform(C);let P=h.cross(h.UNIT_Z,h.normalize(o.position,wQ),wQ),v=h.dot(o.right,P);if(Wd(e,t,n,G,!1,!0),o._setTransform(V),v<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(G=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,Wd(e,t,n,G,!0,!1),o.constrainedAxis=R}else Wd(e,t,n,G,!0,!1);if(d(o.constrainedAxis)){let b=h.cross(o.direction,o.constrainedAxis,vk);h.equalsEpsilon(b,h.ZERO,W.EPSILON6)||(h.dot(b,o.right)<0&&h.negate(b,b),h.cross(b,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(X),e._globe=L,e._ellipsoid=Z;let A=Z.maximumRadius;e._rotateFactor=1/A,e._rotateRateRangeAdjustment=A;let M=h.clone(o.positionWC,wQ);if(e.enableCollisionDetection&&OQ(e),!h.equals(o.positionWC,M)){o._setTransform(V),o.worldToCameraCoordinatesPoint(M,M);let b=h.magnitudeSquared(M);h.magnitudeSquared(o.position)>b&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(b),o.position));let R=h.angleBetween(M,o.position),E=h.cross(M,o.position,M);h.normalize(E,E);let I=Ae.fromAxisAngle(E,R,Pdt),w=$.fromQuaternion(I,vdt);$.multiplyByVector(w,o.direction,o.direction),$.multiplyByVector(w,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(X)}}var Mye=new D,Nye=new Sn,Uye=new h;function Mdt(e,t,n){d(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=Mye,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,Nye),l=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=D0(e,a,Uye));let y;if(d(p)&&(y=h.distance(l,p)),s){let f=Iye(e,c,m);d(y)?y=Math.min(y,f):y=f}if(!d(y)){let f=h.UNIT_X;y=-h.dot(f,l)/h.dot(f,u)}kQ(e,t,n,e._zoomFactor,y)}function Ndt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))Jc(e,e.enableRotate,e.rotateEventTypes,Wd,e.inertiaSpin,"_lastInertiaSpinMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,Dye,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Jc(e,e.enableTilt,e.tiltEventTypes,wdt,e.inertiaSpin,"_lastInertiaTiltMovement"),Jc(e,e.enableTranslate,e.translateEventTypes,Gdt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,Mdt,e.inertiaZoom,"_lastInertiaZoomMovement"),Jc(e,e.enableLook,e.lookEventTypes,Pd),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);d(o)&&(e._tween=i.add(o))}i.update()}}var Udt=new Sn,kdt=new on(h.UNIT_X,0),Ddt=new h,Bdt=new h;function DQ(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Udt),s=h.clone(o.direction,Bdt);i.mode===ie.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=on.fromPointNormal(n,s,kdt),c=Si.rayPlane(r,a,Ddt);d(c)&&(s=h.subtract(n,c,s),i.mode===ie.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var Cye=new h,kye=new he,NQ=new h,UQ=new re,Ydt=new h,Odt=new h,Kdt=new h;function Hdt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){Wd(e,t,n);return}let a,c,l=s.geodeticSurfaceNormal(o.position,Ydt);if(D.equals(t,e._rotateMousePosition)){if(e._looking)Pd(e,t,n,l);else if(e._rotating)Wd(e,t,n);else if(e._strafing)vye(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=NQ,c.x=c.y=c.z=a,s=re.fromCartesian3(c,UQ),AQ(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,kye).height,m=e._globe;if(d(m)&&u<e._minimumPickingTerrainHeight){let p=D0(e,n.startPosition,Kdt);if(d(p)){let y=!1,f=o.getPickRay(n.startPosition,Xye);if(r)y=!0,Pye(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,Odt);Math.abs(h.dot(f.direction,x))<.05?y=!0:y=h.magnitude(o.position)<h.magnitude(p)}y?(D.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,DQ(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=NQ,c.x=c.y=c.z=a,s=re.fromCartesian3(c,UQ),AQ(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Pd(e,t,n,l)}else d(o.pickEllipsoid(n.startPosition,e._ellipsoid,Cye))?(AQ(e,t,n,e._ellipsoid),h.clone(Cye,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,Wd(e,t,n)):(e._looking=!0,Pd(e,t,n,l));D.clone(t,e._rotateMousePosition)}function Wd(e,t,n,i,o,r){o=g(o,!1),r=g(r,!1);let s=e._scene,a=s.camera,c=s.canvas,l=a.constrainedAxis;d(i)&&(a.constrainedAxis=i);let u=h.magnitude(a.position),m=e._rotateFactor*(u-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,y=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),y=Math.min(y,e.maximumMovementRatio);let f=m*p*Math.PI*2,x=m*y*Math.PI;o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=l}var FQ=se.clone(se.UNIT_W),Vye=se.clone(se.UNIT_W),Xk=new h,mV=new h,Ik=new h,Lye=new h,zdt=new D,Jdt=new D,Qdt=new D,jdt=new D,qdt=new Sn;function AQ(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,zdt),a=D.clone(n.endPosition,Jdt),c=i.cartesianToCartographic(r.positionWC,kye).height,l,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(l=h.clone(e._panLastWorldPosition,FQ),!d(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(l=D0(e,s,FQ)),!d(e._globe)&&d(l))){let m=h.subtract(l,r.positionWC,mV),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),mV),y=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,y,o.pixelRatio,jdt),x=D.subtract(a,s,Qdt),_=h.multiplyByScalar(r.rightWC,x.x*f.x,mV),C=h.normalize(r.positionWC,Eye),V=r.getPickRay(a,qdt).direction,L=h.subtract(V,h.projectVector(V,r.rightWC,Ik),Ik),Z=h.angleBetween(L,r.directionWC),G=1;d(r.frustum.fov)&&(G=Math.max(Math.tan(Z),.1));let X=Math.abs(h.dot(r.directionWC,C)),P=-x.y*f.y*2/Math.sqrt(G)*(1-X),v=h.multiplyByScalar(V,P,Ik);X=Math.abs(h.dot(r.upWC,C));let A=h.multiplyByScalar(r.upWC,-x.y*(1-X)*f.y,Lye);u=h.add(l,_,Vye),u=h.add(u,v,u),u=h.add(u,A,u),h.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!d(l)||!d(u))&&(l=r.pickEllipsoid(s,i,FQ),u=r.pickEllipsoid(a,i,Vye)),!d(l)||!d(u)){e._rotating=!0,Wd(e,t,n);return}if(l=r.worldToCameraCoordinates(l,l),u=r.worldToCameraCoordinates(u,u),d(r.constrainedAxis)){let m=r.constrainedAxis,p=h.mostOrthogonalAxis(m,Xk);h.cross(p,m,p),h.normalize(p,p);let y=h.cross(m,p,mV),f=h.magnitude(l),x=h.dot(m,l),_=Math.acos(x/f),C=h.multiplyByScalar(m,x,Ik);h.subtract(l,C,C),h.normalize(C,C);let V=h.magnitude(u),L=h.dot(m,u),Z=Math.acos(L/V),G=h.multiplyByScalar(m,L,Lye);h.subtract(u,G,G),h.normalize(G,G);let X=Math.acos(h.dot(C,p));h.dot(C,y)<0&&(X=W.TWO_PI-X);let P=Math.acos(h.dot(G,p));h.dot(G,y)<0&&(P=W.TWO_PI-P);let v=X-P,A;h.equalsEpsilon(m,r.position,W.EPSILON2)?A=r.right:A=h.cross(m,r.position,Xk);let M=h.cross(m,A,Xk),b=h.dot(M,h.subtract(l,m,mV)),R=h.dot(M,h.subtract(u,m,mV)),E;b>0&&R>0?E=Z-_:b>0&&R<=0?h.dot(r.position,m)>0?E=-_-Z:E=_+Z:E=_-Z,r.rotateRight(v),r.rotateUp(E)}else{h.normalize(l,l),h.normalize(u,u);let m=h.dot(l,u),p=h.cross(l,u,Xk);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let y=Math.acos(m);r.rotate(p,y)}}}var $dt=new h,eut=new he,Rye=0;function Dye(e,t,n){d(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,l;c?l=t:(l=Mye,l.x=a.clientWidth/2,l.y=a.clientHeight/2);let u=s.getPickRay(l,Nye),m,p=o.cartesianToCartographic(s.position,eut).height,y=Math.abs(Rye)<e.minimumPickingTerrainDistanceWithInertia;(i?y:p<e._minimumPickingTerrainHeight)&&(m=D0(e,l,Uye));let x;if(d(m)&&(x=h.distance(u.origin,m),Rye=x),c){let C=Iye(e,u,p);d(x)?x=Math.min(x,C):x=C}d(x)||(x=p);let _=h.normalize(s.position,$dt);kQ(e,t,n,e._zoomFactor,x,h.dot(_,s.direction))}var Bye=new D,wk=new Sn,Xw=new h,tut=new h,Yye=new F,nut=new F,Oye=new F,iut=new Ae,out=new $,BQ=new he,YQ=new h;function rut(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(d(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,YQ);Pd(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,BQ);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,aut(e,t,n)):cut(e,t,n)}var sut=new he;function aut(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,sut).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,l=Bye;l.x=c.clientWidth/2,l.y=c.clientHeight/2;let u=r.getPickRay(l,wk),m,p=Si.rayEllipsoid(u,i);if(d(p))m=Sn.getPoint(u,p.start,Xw);else if(a>e._minimumTrackBallHeight){let V=Si.grazingAltitudeLocation(u,i);if(!d(V))return;let L=i.cartesianToCartographic(V,BQ);L.height=0,m=i.cartographicToCartesian(L,Xw)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,YQ);Pd(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let y=vt.eastNorthUpToFixedFrame(m,i,Yye),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=F.clone(r.transform,Oye);r._setTransform(y),Wd(e,t,n,h.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function cut(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,l;if(D.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,Xw);else{if(a=D0(e,t,Xw),!d(a)){if(c=r.getPickRay(t,wk),l=Si.rayEllipsoid(c,i),!d(l)){if(i.cartesianToCartographic(r.position,BQ).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,YQ);Pd(e,t,n,R),D.clone(t,e._tiltCenterMousePosition)}return}a=Sn.getPoint(c,l.start,Xw)}s&&(d(c)||(c=r.getPickRay(t,wk)),Wye(e,c,a,a)),D.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=Bye;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,wk);let p=h.magnitude(a),y=h.fromElements(p,p,p,NQ),f=re.fromCartesian3(y,UQ);if(l=Si.rayEllipsoid(c,f),!d(l))return;let x=h.magnitude(c.origin)>p?l.start:l.stop,_=Sn.getPoint(c,x,tut),C=vt.eastNorthUpToFixedFrame(a,i,Yye),V=vt.eastNorthUpToFixedFrame(_,f,nut),L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=h.UNIT_Z,X=F.clone(r.transform,Oye);r._setTransform(V);let P=h.cross(_,r.positionWC,vk);if(h.dot(r.rightWC,P)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(G=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,Wd(e,t,n,G,!0,!1),r.constrainedAxis=R}else Wd(e,t,n,G,!0,!1);if(r._setTransform(C),Wd(e,t,n,G,!1,!0),d(r.constrainedAxis)){let b=h.cross(r.direction,r.constrainedAxis,vk);h.equalsEpsilon(b,h.ZERO,W.EPSILON6)||(h.dot(b,r.right)<0&&h.negate(b,b),h.cross(b,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(X),e._globe=L,e._ellipsoid=Z;let A=Z.maximumRadius;e._rotateFactor=1/A,e._rotateRateRangeAdjustment=A;let M=h.clone(r.positionWC,vk);if(e.enableCollisionDetection&&OQ(e),!h.equals(r.positionWC,M)){r._setTransform(V),r.worldToCameraCoordinatesPoint(M,M);let b=h.magnitudeSquared(M);h.magnitudeSquared(r.position)>b&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(b),r.position));let R=h.angleBetween(M,r.position),E=h.cross(M,r.position,M);h.normalize(E,E);let I=Ae.fromAxisAngle(E,R,iut),w=$.fromQuaternion(I,out);$.multiplyByVector(w,r.direction,r.direction),$.multiplyByVector(w,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(X)}}var lut=new D,dut=new D,Zye=new Sn,Gye=new Sn,uut=new h,mut=new h;function Pd(e,t,n,i){let r=e._scene.camera,s=lut;s.x=n.startPosition.x,s.y=0;let a=dut;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,Zye),l=r.getPickRay(a,Gye),u=0,m,p;r.frustum instanceof en?(m=c.origin,p=l.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=l.direction);let y=h.dot(m,p);y<1&&(u=Math.acos(y)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(d(i)?r.look(i,-u):d(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,Zye),l=r.getPickRay(a,Gye),u=0,r.frustum instanceof en?(m=c.origin,p=l.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=l.direction),y=h.dot(m,p),y<1&&(u=Math.acos(y)),u=n.startPosition.y>n.endPosition.y?-u:u,i=g(i,f),d(i)){let x=r.direction,_=h.negate(i,uut),C=h.equalsEpsilon(x,i,W.EPSILON2),V=h.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){y=h.dot(x,i);let L=W.acosClamped(y);u>0&&u>L&&(u=L-W.EPSILON4),y=h.dot(x,_),L=W.acosClamped(y),u<0&&-u>L&&(u=-L+W.EPSILON4);let Z=h.cross(i,x,mut);r.look(Z,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function hut(e){Jc(e,e.enableRotate,e.rotateEventTypes,Hdt,e.inertiaSpin,"_lastInertiaSpinMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,Dye,e.inertiaZoom,"_lastInertiaZoomMovement"),Jc(e,e.enableTilt,e.tiltEventTypes,rut,e.inertiaSpin,"_lastInertiaTiltMovement"),Jc(e,e.enableLook,e.lookEventTypes,Pd)}var fut=new F,put=new he;function OQ(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(!d(i)||n===ie.SCENE2D||n===ie.MORPHING)return;let o=t.camera,r=i.ellipsoid,s=t.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,fut),c=h.magnitude(o.position),o._setTransform(F.IDENTITY));let l=put;n===ie.SCENE3D?r.cartesianToCartographic(o.position,l):s.unproject(o.position,l);let u=!1;if(l.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(d(m)){let p=m+e.minimumZoomDistance;l.height<p&&(l.height=p,n===ie.SCENE3D?r.cartographicToCartesian(l,o.position):s.project(l,o.position),u=!0)}}d(a)&&(o._setTransform(a),u&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}Iw.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ie.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var but=new h,yut=new h;Iw.prototype.update=function(){let e=this._scene,t=e.camera,n=e.globe,i=e.mode;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=d(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let o=d(this._globe)?this._globe.terrainExaggeration:1,r=d(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=Vc.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Vc.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Vc.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&d(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,but),c=h.clone(t.directionWC,yut);i===ie.SCENE2D?pdt(this):i===ie.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,Ndt(this)):i===ie.SCENE3D&&(this._horizontalRotationAxis=void 0,hut(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC))&&OQ(this),this._aggregator.reset()};Iw.prototype.isDestroyed=function(){return!1};Iw.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var Ww=Iw;var xIi=T(S(),1);var qXi=T(S(),1),Pw=`uniform sampler2D colorTexture;
uniform sampler2D colorTexture2;

uniform vec2 center;
uniform float radius;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color0 = texture(colorTexture, v_textureCoordinates);
    vec4 color1 = texture(colorTexture2, v_textureCoordinates);

    float x = length(gl_FragCoord.xy - center) / radius;
    float t = smoothstep(0.5, 0.8, x);
    out_FragColor = mix(color0 + color1, color1, t);
}
`;var eIi=T(S(),1),vw=`uniform sampler2D colorTexture;

uniform float avgLuminance;
uniform float threshold;
uniform float offset;

in vec2 v_textureCoordinates;

float key(float avg)
{
    float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
    return max(0.0, guess) + 0.1;
}

// See section 9. "The bright-pass filter" of Realtime HDR Rendering
// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf

void main()
{
    vec4 color = texture(colorTexture, v_textureCoordinates);
    vec3 xyz = czm_RGBToXYZ(color.rgb);
    float luminance = xyz.r;

    float scaledLum = key(avgLuminance) * luminance / avgLuminance;
    float brightLum = max(scaledLum - threshold, 0.0);
    float brightness = brightLum / (offset + brightLum);

    xyz.r = brightness;
    out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
}
`;function B0(){this._sceneFramebuffer=new tT;let e=.125,t=new Array(6);t[0]=new po({fragmentShader:Al,textureScale:e,forcePowerOfTwo:!0,sampleMode:Ed.LINEAR});let n=t[1]=new po({fragmentShader:vw,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new po({fragmentShader:Jy,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new po({fragmentShader:Jy,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new po({fragmentShader:Al,sampleMode:Ed.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new po({fragmentShader:Pw,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Hc({stages:t});let o=new cT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}B0.prototype.get=function(e){return this._stages.get(e)};B0.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var gut=new se,Kye=new D,xut=new D,Hye=new F;function _ut(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,Hye),l=F.multiplyByPoint(r,o,gut),u=vt.pointToGLWindowCoordinates(s,c,o,Kye);l.x+=W.SOLAR_RADIUS;let m=vt.pointToGLWindowCoordinates(a,c,l,l),p=D.magnitude(D.subtract(m,u,m))*30*2,y=xut;y.x=p,y.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(y.x,y.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,Z=new He;Z.width=V,Z.height=L,c=F.computeViewportTransformation(Z,0,1,Hye),u=vt.pointToGLWindowCoordinates(s,c,o,Kye),y.x*=V/f,y.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(u.x-y.x*.5,0),G.y=Math.max(u.y-y.y*.5,0),G.width=Math.min(y.x,f),G.height=Math.min(y.y,x);for(let X=1;X<4;++X)He.clone(G,_.get(X).scissorRectangle)}B0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};B0.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),_ut(this,t,n),o};B0.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};B0.prototype.copy=function(e,t){if(!d(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Al,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};B0.prototype.isDestroyed=function(){return!1};B0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var ww=B0;var RIi=T(S(),1);function zye(){this._cachedShowFrustumsShaders={}}function Tut(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Sut(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Be.replaceMain(u,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
`,a+=`uniform vec3 debugShowFrustumsColor;
`,a+=`void main() 
{ 
    czm_Debug_main(); 
`;let c;if(s>0)for(c=0;c<s;++c)a+=`    out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
`,a+=`    out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
`;else a+=`    out_FragColor.rgb *= debugShowCommandsColor;
`,a+=`    out_FragColor.rgb *= debugShowFrustumsColor;
`;a+="}",o.sources.push(a);let l=Tut(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:l})}var Fw=new B;function Cut(e,t){let n;return d(t.uniformMap)?n=t.uniformMap:n={},d(n.debugShowCommandsColor)||d(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(d(t._debugColor)||(t._debugColor=B.fromRandom()),t._debugColor):B.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(Fw.red=t.debugOverlappingFrustums&1?1:0,Fw.green=t.debugOverlappingFrustums&2?1:0,Fw.blue=t.debugOverlappingFrustums&4?1:0,Fw.alpha=1,Fw):B.WHITE}),n}var Vut=new nt;zye.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];d(o)||(o=Sut(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=nt.shallowClone(t,Vut);r.shaderProgram=o,r.uniformMap=Cut(e,t),r.execute(e.context,n)};var Aw=zye;var Mk=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Yi(e){e=g(e,g.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Oe(e.contextOptions),r=d(n),s=new QZ(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),d(i)||(i=t.parentNode),this._id=Yn(),this._jobScheduler=new kv,this._frameState=new Nv(s,new Zv(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=g(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new nL(s),this._globe=void 0,this._globeTranslucencyState=new Uv,this._primitives=new Zl,this._groundPrimitives=new Zl,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new mT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=g(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new wv(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new B,stencil:0,owner:this}),this._depthClearCommand=new ti({depth:1,owner:this}),this._stencilClearCommand=new ti({stencil:0}),this._classificationStencilClearCommand=new ti({stencil:0,renderState:De.fromCache({stencilMask:Ft.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new Gw(this),this._preUpdate=new ye,this._postUpdate=new ye,this._renderError=new ye,this._preRender=new ye,this._postRender=new ye,this._minimumDisableDepthTestDistance=0,this._debugInspector=new Aw,this._msaaSamples=g(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ye,this.morphComplete=new ye,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=B.clone(B.BLACK),this._mode=ie.SCENE3D,this._mapProjection=d(e.mapProjection)?e.mapProjection:new Zi,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new Mv,this._shadowMapCamera=new co(this),this.shadowMap=new U0({context:s,lightCamera:this._shadowMapCamera,enabled:g(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=B.clone(B.WHITE),this._actualInvertClassificationColor=B.clone(this._invertClassificationColor),this._invertClassification=new aV,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new Lw,this._brdfLutGenerator=new Tv,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new Ww(this),this._cameraUnderground=!1,this._mapMode2D=g(e.mapMode2D,Fl.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=g(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=g(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=wa.requestCompletedEvent.addEventListener(Mk(this)),this._removeTaskProcessorListenerCallback=pi.taskCompletedEvent.addEventListener(Mk(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new He(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new co(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new co(this),this.preloadFlightCullingVolume=void 0,this._picking=new nw(this),this._defaultView=new oT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new tp,qye(this,0,te.now()),this.updateFrameState(),this.initializeFrame()}function Lut(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];d(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(Mk(e))),n.push(t.terrainProviderChanged.addEventListener(Mk(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Yi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return kt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return kt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return pm.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Lut(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(d(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(d(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),d(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(d(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ie.SCENE2D?this.morphTo2D(0):e===ie.SCENE3D?this.morphTo3D(0):e===ie.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new co(this),d(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Av(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,kt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Yi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Jye(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;d(t.pickId)&&(c.picking=F0.createPickDerivedCommand(e,t,o,c.picking)),t.pickOnly||(c.depth=F0.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=F0.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=U0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Re.TRANSLUCENT&&d(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=d(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}Yi.prototype.updateDerivedCommands=function(e){if(!d(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,o=t.shadowState.lastDirtyTime;e.lastDirtyTime!==o&&(e.lastDirtyTime=o,e.dirty=!0,i=!0);let r=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=d(a.logDepth),l=d(a.hdr),u=d(a.originalCommand),m=r&&!c,p=s&&!l,y=(!r||!s)&&!u;if(e.dirty=e.dirty||m||p||y,e.dirty){e.dirty=!1;let f=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=U0.createCastDerivedCommand(f,e,i,n,a.shadows)),(c||m)&&(a.logDepth=F0.createLogDepthCommand(e,n,a.logDepth),Jye(this,a.logDepth.command,i)),(u||y)&&Jye(this,e,i)}};var Rut=new Du({pass:Xo.RENDER}),KQ=new Du({pass:Xo.PRELOAD}),HQ=new Du({pass:Xo.PRELOAD_FLIGHT}),Zut=new Du({pass:Xo.REQUEST_RENDER_MODE_DEFER_CHECK}),Qye=new ce,zQ;function Gut(e){let t=e.globe;if(e._mode===ie.SCENE3D&&d(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return Qye.radius=n.minimumRadius+i,zQ=gv.fromBoundingSphere(Qye,e.camera.positionWC,zQ),zQ}}Yi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function qye(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=te.clone(n,i.time)}Yi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Gut(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof en||this.camera.frustum instanceof yr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,d(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),d(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=B.clone(this.invertClassificationColor,this._actualInvertClassificationColor),aV.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,d(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Yi.prototype.isVisible=function(e,t,n){return d(e)&&(!d(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==qt.OUTSIDE&&(!d(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var Ak=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Ak=F.inverseTransformation(Ak,Ak);function Eut(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;d(t._debugVolume)&&t._debugVolume.destroy();let a,c=h.clone(s.center);if(o.mode!==ie.SCENE3D){c=F.multiplyByPoint(Ak,c,c);let p=o.mapProjection,y=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(y)}if(d(s.radius)){let p=s.radius;a=An.toWireframe(Is.createGeometry(new Is({radii:new h(p,p,p),vertexFormat:sn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Zn({geometryInstances:new _t({geometry:a,modelMatrix:F.fromTranslation(c),attributes:{color:new Ut(1,0,0,1)}}),appearance:new sn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=An.toWireframe(cl.createGeometry(cl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:sn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Zn({geometryInstances:new _t({geometry:a,modelMatrix:F.fromRotationTranslation(p,c,new F),attributes:{color:new Ut(1,0,0,1)}}),appearance:new sn({flat:!0,translucent:!1}),asynchronous:!1})}let l=o.commandList,u=o.commandList=[];t._debugVolume.update(o),e=u[0],o.useLogDepth&&(e=F0.createLogDepthCommand(e,r).command);let m;d(i)&&(m=n.framebuffer,n.framebuffer=i),e.execute(r,n),d(m)&&(n.framebuffer=m),o.commandList=l}function Ra(e,t,n,i,o){let r=t._frameState;if(d(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(n,i);return}e.debugShowBoundingVolume&&d(e.boundingVolume)&&Eut(e,t,i,o),r.useLogDepth&&d(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.depth&&t._hdr&&d(e.derivedCommands)&&d(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&d(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(d(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&d(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function Mw(e,t,n,i){let o=t._frameState,r=e.derivedCommands;d(r)&&(o.useLogDepth&&d(r.logDepth)&&(e=r.logDepth.command),r=e.derivedCommands,d(r.picking)?(e=r.picking.pickCommand,e.execute(n,i)):d(r.depth)&&(e=r.depth.depthOnlyCommand,e.execute(n,i)))}function $ye(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Xut(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function Iut(e,t,n,i,o){let r=e.context;w0(i,$ye,e.camera.positionWC),d(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function Wut(e,t,n,i,o){let r=e.context;w0(i,Xut,e.camera.positionWC),d(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function Put(e,t,n,i){let o=e.context;w0(i,$ye,e.camera.positionWC);let r=i.length;for(let s=0;s<r;++s)t(i[s],e,o,n)}var vut=new Ri,wut=new Kc,Fut=new en,Aut=new yr;function JQ(e,t){let n=e.camera,i=e.context,o=e.frameState,r=i.uniformState;r.updateCamera(n);let s;d(n.frustum.fov)?s=n.frustum.clone(vut):d(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(wut):d(n.frustum.width)?s=n.frustum.clone(Fut):s=n.frustum.clone(Aut),s.near=n.frustum.near,s.far=n.frustum.far,r.updateFrustum(s),r.updatePass(Re.ENVIRONMENT);let a=o.passes,c=a.pick,l=e._environmentState,u=e._view,m=l.renderTranslucentDepthForPick,p=l.useWebVR;if(!c){let R=l.skyBoxCommand;if(d(R)&&Ra(R,e,i,t),l.isSkyAtmosphereVisible&&Ra(l.skyAtmosphereCommand,e,i,t),l.isSunVisible&&(l.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let E;l.useGlobeDepthFramebuffer?E=u.globeDepth.framebuffer:l.usePostProcess?E=u.sceneFramebuffer.framebuffer:E=l.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,E),t.framebuffer=E}l.isMoonVisible&&l.moonCommand.execute(i,t)}let y;l.useOIT?(d(e._executeOITFunction)||(e._executeOITFunction=function(R,E,I,w,N){u.globeDepth.prepareColorTextures(i),u.oit.executeCommands(R,E,I,w,N)}),y=e._executeOITFunction):a.render?y=Iut:y=Wut;let f=u.frustumCommandsList,x=f.length,_=l.clearGlobeDepth,C=l.useDepthPlane,V=e._globeTranslucencyState,L=V.translucent,Z=e._view.globeTranslucencyFramebuffer,G=e._depthClearCommand,X=e._stencilClearCommand,P=e._classificationStencilClearCommand,v=e._depthPlane,A=l.usePostProcessSelected,M=n.position.z,b;for(let R=0;R<x;++R){let E=x-R-1,I=f[E];e.mode===ie.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&X.execute(i,t),r.updatePass(Re.GLOBE);let w=I.commands[Re.GLOBE],N=I.indices[Re.GLOBE];if(L)V.executeGlobeCommands(I,Ra,Z,e,t);else for(b=0;b<N;++b)Ra(w[b],e,i,t);let Y=u.globeDepth;if(d(Y)&&l.useGlobeDepthFramebuffer&&Y.executeCopyDepth(i,t),!l.renderTranslucentDepthForPick)if(r.updatePass(Re.TERRAIN_CLASSIFICATION),w=I.commands[Re.TERRAIN_CLASSIFICATION],N=I.indices[Re.TERRAIN_CLASSIFICATION],L)V.executeGlobeClassificationCommands(I,Ra,Z,e,t);else for(b=0;b<N;++b)Ra(w[b],e,i,t);if(_&&(G.execute(i,t),C&&v.execute(i,t)),!l.useInvertClassification||c||l.renderTranslucentDepthForPick){for(r.updatePass(Re.CESIUM_3D_TILE),w=I.commands[Re.CESIUM_3D_TILE],N=I.indices[Re.CESIUM_3D_TILE],b=0;b<N;++b)Ra(w[b],e,i,t);if(N>0&&(d(Y)&&l.useGlobeDepthFramebuffer&&(Y.prepareColorTextures(i,_),Y.executeUpdateDepth(i,t,_,Y.depthStencilTexture)),!l.renderTranslucentDepthForPick))for(r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION),w=I.commands[Re.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION],b=0;b<N;++b)Ra(w[b],e,i,t)}else{e._invertClassification.clear(i,t);let J=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,r.updatePass(Re.CESIUM_3D_TILE),w=I.commands[Re.CESIUM_3D_TILE],N=I.indices[Re.CESIUM_3D_TILE],b=0;b<N;++b)Ra(w[b],e,i,t);for(d(Y)&&l.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),Y.executeUpdateDepth(i,t,_,e._invertClassification._fbo.getDepthStencilTexture())),r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),w=I.commands[Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],b=0;b<N;++b)Ra(w[b],e,i,t);for(t.framebuffer=J,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&P.execute(i,t),r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION),w=I.commands[Re.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION],b=0;b<N;++b)Ra(w[b],e,i,t)}for(N>0&&i.stencilBuffer&&X.execute(i,t),r.updatePass(Re.VOXELS),w=I.commands[Re.VOXELS],N=I.indices[Re.VOXELS],w.length=N,Put(e,Ra,t,w),r.updatePass(Re.OPAQUE),w=I.commands[Re.OPAQUE],N=I.indices[Re.OPAQUE],b=0;b<N;++b)Ra(w[b],e,i,t);E!==0&&e.mode!==ie.SCENE2D&&(s.near=I.near,r.updateFrustum(s));let k;if(!c&&l.useInvertClassification&&o.invertClassificationColor.alpha<1&&(k=e._invertClassification),r.updatePass(Re.TRANSLUCENT),w=I.commands[Re.TRANSLUCENT],w.length=I.indices[Re.TRANSLUCENT],y(e,Ra,t,w,k),I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION]>0&&u.translucentTileClassification.isSupported()&&(u.translucentTileClassification.executeTranslucentCommands(e,Ra,t,w,Y.depthStencilTexture),u.translucentTileClassification.executeClassificationCommands(e,Ra,t,I)),i.depthTexture&&e.useDepthPicking&&(l.useGlobeDepthFramebuffer||m)){let J=Y.depthStencilTexture,z=e._picking.getPickDepth(e,E);z.update(i,J),z.executeCopyDepth(i,t)}if(c||!A)continue;let U=t.framebuffer;if(t.framebuffer=u.sceneFramebuffer.getIdFramebuffer(),s.near=E!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),r.updatePass(Re.GLOBE),w=I.commands[Re.GLOBE],N=I.indices[Re.GLOBE],L)V.executeGlobeCommands(I,Mw,Z,e,t);else for(b=0;b<N;++b)Mw(w[b],e,i,t);for(_&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),_&&C&&v.execute(i,t),r.updatePass(Re.CESIUM_3D_TILE),w=I.commands[Re.CESIUM_3D_TILE],N=I.indices[Re.CESIUM_3D_TILE],b=0;b<N;++b)Mw(w[b],e,i,t);for(r.updatePass(Re.OPAQUE),w=I.commands[Re.OPAQUE],N=I.indices[Re.OPAQUE],b=0;b<N;++b)Mw(w[b],e,i,t);for(r.updatePass(Re.TRANSLUCENT),w=I.commands[Re.TRANSLUCENT],N=I.indices[Re.TRANSLUCENT],b=0;b<N;++b)Mw(w[b],e,i,t);t.framebuffer=U}}function ege(e){e.context.uniformState.updatePass(Re.COMPUTE);let n=e._environmentState.sunComputeCommand;d(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,o=i.length;for(let r=0;r<o;++r)i[r].execute(e._computeEngine)}function Mut(e,t){e.context.uniformState.updatePass(Re.OVERLAY);let i=e.context,o=e._overlayCommandList,r=o.length;for(let s=0;s<r;++s)o[s].execute(i,t)}function Nut(e,t,n){let i=n.shadowMapCullingVolume,o=n.isPointLight,r=n.passes,s=r.length,a=t.length;for(let c=0;c<a;++c){let l=t[c];if(e.updateDerivedCommands(l),l.castShadows&&(l.pass===Re.GLOBE||l.pass===Re.CESIUM_3D_TILE||l.pass===Re.OPAQUE||l.pass===Re.TRANSLUCENT)&&e.isVisible(l,i))if(o)for(let u=0;u<s;++u)r[u].commandList.push(l);else if(s===1)r[0].commandList.push(l);else{let u=!1;for(let m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(l,p))r[m].commandList.push(l),u=!0;else if(u)break}}}}function tge(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let o=e.context,r=o.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,l=c.length;for(let m=0;m<l;++m)c[m].commandList.length=0;let u=e.frameState.commandList;Nut(e,u,a);for(let m=0;m<l;++m){let p=a.passes[m];r.updateCamera(p.camera),a.updatePass(o,m);let y=p.commandList.length;for(let f=0;f<y;++f){let x=p.commandList[f];r.updatePass(x.pass),Ra(x.derivedCommands.shadows.castCommands[s],e,o,p.passState)}}}}var Uut=new h;Yi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?kut(this,e,t):i!==ie.SCENE2D||this._mapMode2D===Fl.ROTATE?qy(!0,this,e,t):(QQ(this,e,t),Qut(this,e))};function kut(e,t,n){let i=e._view,o=i.camera,s=e._environmentState.renderTranslucentDepthForPick;QQ(e,t,n),nge(e),i.createPotentiallyVisibleSet(e),ege(e),s||tge(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=co.clone(o,e._cameraVR);c.frustum=o.frustum;let l=o.frustum.near,u=l*g(e.focalLength,5),m=g(e.eyeSeparation,u/30),p=h.multiplyByScalar(c.right,m*.5,Uut);o.frustum.aspectRatio=a.width/a.height;let y=.5*m*l/u;h.add(c.position,p,o.position),o.frustum.xOffset=y,JQ(e,t),a.x=a.width,h.subtract(c.position,p,o.position),o.frustum.xOffset=-y,JQ(e,t),co.clone(c,o)}var Dut=new he(Math.PI,W.PI_OVER_TWO),But=new h,Yut=new h,Out=new F,Kut=new F,Hut=new h,zut=new h,Jut=new He;function Qut(e,t){let n=e.context,i=e.frameState,o=e.camera,r=t.viewport,s=He.clone(r,Jut);t.viewport=s;let a=Dut,c=But;e.mapProjection.project(a,c);let u=h.clone(o.position,Yut),m=F.clone(o.transform,Kut),p=o.frustum.clone();o._setTransform(F.IDENTITY);let y=F.computeViewportTransformation(s,0,1,Out),f=o.frustum.projectionMatrix,x=o.positionWC.y,_=h.fromElements(W.sign(x)*c.x-x,0,-o.positionWC.x,Hut),C=vt.pointToGLWindowCoordinates(f,y,_,zut);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)qy(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,o.position.x*=W.sign(o.position.x),o.frustum.right=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),qy(!0,e,t),s.x=C.x,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),qy(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let Z=o.frustum.right;o.frustum.right=c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),qy(!0,e,t),s.x=C.x,s.width=V+L-C.x,o.position.x=-o.position.x,o.frustum.left=-o.frustum.right,o.frustum.right=Z-o.frustum.right*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),qy(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let Z=o.frustum.left;o.frustum.left=-c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),qy(!0,e,t),s.x=V,s.width=C.x-V,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=Z-o.frustum.left*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),qy(!1,e,t)}o._setTransform(m),h.clone(u,o.position),o.frustum=p.clone(),t.viewport=r}function qy(e,t,n,i){let o=t._environmentState,r=t._view,s=o.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),nge(t),r.createPotentiallyVisibleSet(t),e&&(d(i)&&QQ(t,n,i),ege(t),s||tge(t)),JQ(t,n)}var jye=new Qr;Yi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.skyAtmosphere,s=this.globe,a=this._globeTranslucencyState;if(!i||this._mode!==ie.SCENE2D&&t.camera.frustum instanceof en||!a.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{d(r)?(d(s)?(r.setDynamicAtmosphereColor(s.enableLighting&&s.dynamicAtmosphereLighting,s.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!s.show||s._surface._tilesToRender.length>0):n.isReadyForAtmosphere=!0,n.skyAtmosphereCommand=r.update(e,s),d(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=d(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=d(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=d(x)?x.drawCommand:void 0,n.sunComputeCommand=d(x)?x.computeCommand:void 0,n.moonCommand=d(this.moon)?this.moon.update(e):void 0}let c=n.clearGlobeDepth=d(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===ie.SCENE2D);(n.useDepthPlane=c&&this.mode===ie.SCENE3D&&a.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ie.SCENE2D&&!o;let u=e.mode===ie.SCENE3D&&!a.sunVisibleThroughGlobe?e.occluder:void 0,m=e.cullingVolume,p=jye.planes;for(let x=0;x<5;++x)p[x]=m.planes[x];m=jye,n.isSkyAtmosphereVisible=d(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,m,u),n.isMoonVisible=this.isVisible(n.moonCommand,m,u);let y=this.specularEnvironmentMaps,f=this._specularEnvironmentMapAtlas;d(y)&&(!d(f)||f.url!==y)?(f=f&&f.destroy(),this._specularEnvironmentMapAtlas=new pm(y)):!d(y)&&d(f)&&(f.destroy(),this._specularEnvironmentMapAtlas=void 0),d(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function jut(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Zf({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),d(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function qut(e){let t=e._frameState,n=t.shadowMaps,i=n.length,o=i>0&&!t.passes.pick&&e.mode===ie.SCENE3D;if(o!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=o),t.shadowState.lightShadowsEnabled=!1,!!o){for(let r=0;r<i;++r)if(n[r]!==t.shadowState.shadowMaps[r]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let r=0;r<i;++r){let s=n[r];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function nge(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),jut(e),qut(e),e._globe&&e._globe.render(t)}function QQ(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,c=e._frameState.passes.pick;d(s.globeDepth)&&(s.globeDepth.picking=c);let l=r.useWebVR;r.originalFramebuffer=t.framebuffer,d(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new ww:d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!d(e.sun)&&d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;B.clone(n,u.color),u.execute(i,t);let m=r.useGlobeDepthFramebuffer=d(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,y=r.useOIT=!c&&d(p)&&p.isSupported();y&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),x=r.usePostProcess=f.ready,r.usePostProcessSelected=x&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!l?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),d(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&d(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&r.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),d(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&y){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Yi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,o=i.globeDepth;d(o)&&o.prepareColorTextures(t);let r=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,l=s?o.colorFramebufferManager:void 0,u=i.sceneFramebuffer._colorFramebuffer,m=i.sceneFramebuffer.idFramebuffer;r&&(e.framebuffer=a?u.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let y=u;s&&!r&&(y=l);let f=this.postProcessStages,x=y.getColorTexture(0),_=m.getColorTexture(0),C=g(l,u).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,c)}!r&&!a&&s&&(e.framebuffer=c,o.executeCopyColor(t,e))};function $ut(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function emt(e){let t=e._globe,i=e.camera.positionCartographic;if(d(t)&&t.show&&d(i))return t.getHeight(i)}function tmt(e){let t=e.camera,n=e._mode,i=e.globe,o=e._screenSpaceCameraController,r=t.positionCartographic;if(!d(r))return!1;if(!o.onMap()&&r.height<0)return!0;if(!d(i)||!i.show||n===ie.SCENE2D||n===ie.MORPHING)return!1;let s=e._globeHeight;return d(s)&&r.height<s}Yi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=emt(this),this._cameraUnderground=tmt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),d(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function nmt(e,t){if(e.debugShowFramesPerSecond){if(!d(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new A0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else d(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function imt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),d(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function omt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),wa.update()}var rmt=new B;function smt(e){let t=e._frameState,n=e.context,i=n.uniformState,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Rut;let r=g(e.backgroundColor,B.BLACK);e._hdr&&(r=B.clone(r,rmt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,e.fog.update(t),i.update(t);let s=e.shadowMap;d(s)&&s.enabled&&(!d(e.light)||e.light instanceof tp?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=He.clone(a,c.viewport),d(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,Mut(e,c),d(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function fT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function amt(e){return e._picking.updateMostDetailedRayPicks(e)}Yi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,d(e)||(e=te.now());let n=this._view.checkForCameraUpdates(this),i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ie.MORPHING;if(!i&&d(this.maximumRenderTimeChange)&&d(this._lastRenderTime)){let o=Math.abs(te.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=te.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);qye(this,o,e),t.newFrame=!0}fT(this,imt),this.primitives.show&&(fT(this,amt),fT(this,cmt),fT(this,lmt),i||fT(this,dmt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),fT(this,smt)),nmt(this,i),fT(this,omt),$ut(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Yi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Yi.prototype.requestRender=function(){this._renderRequested=!0};Yi.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};Yi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Yi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Yi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Yi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function cmt(e){let t=e._frameState;KQ.camera=t.camera,KQ.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,KQ)}function lmt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;HQ.camera=e.preloadFlightCamera,HQ.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,HQ)}function dmt(e){e.primitives.updateForPass(e._frameState,Zut)}Yi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Yi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Yi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Yi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Yi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Yi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Yi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Yi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Yi.prototype.cartesianToCanvasCoordinates=function(e,t){return Ji.wgs84ToWindowCoordinates(this,e,t)};Yi.prototype.completeMorph=function(){this._transitioner.completeMorph()};Yi.prototype.morphTo2D=function(e){let t,n=this.globe;d(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=g(e,2),this._transitioner.morphTo2D(e,t)};Yi.prototype.morphToColumbusView=function(e){let t,n=this.globe;d(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=g(e,2),this._transitioner.morphToColumbusView(e,t)};Yi.prototype.morphTo3D=function(e){let t,n=this.globe;d(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=g(e,2),this._transitioner.morphTo3D(e,t)};function umt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){d(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{d(e)&&d(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Yi.prototype.setTerrain=function(e){return umt(this,e),e};Yi.prototype.isDestroyed=function(){return!1};Yi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),d(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var Nw=Yi;var S2i=T(S(),1);var KWi=T(S(),1),hV=`float interpolateByDistance(vec4 nearFarScalar, float distance)
{
    float startDistance = nearFarScalar.x;
    float startValue = nearFarScalar.y;
    float endDistance = nearFarScalar.z;
    float endValue = nearFarScalar.w;
    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
    return mix(startValue, endValue, t);
}

vec3 getLightDirection(vec3 positionWC)
{
    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
    vec3 lightDirection =
        positionWC * float(lightEnum == 0.0) +
        czm_lightDirectionWC * float(lightEnum == 1.0) +
        czm_sunDirectionWC * float(lightEnum == 2.0);
    return normalize(lightDirection);
}

void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
{
    float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;

    // Adjustment to the atmosphere radius applied based on the camera height.
    float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
    float distanceAdjustMax = czm_ellipsoidRadii.x;
    float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
    float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);

    // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit 
    // for the position on the ellipsoid.
    float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
    float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;

    // Setup the primary ray: from the camera position to the vertex position.
    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);

    underTranslucentGlobe = 0.0;

    // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
    #if defined(GLOBE_TRANSLUCENT)

        // Check for intersection with the inner radius of the atmopshere.
        czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
        if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
            
            // Compute position on globe.
            vec3 direction = normalize(positionWC);
            czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
            czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
            vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);

            // Control the color using the camera angle.
            float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));

            // Control the opacity using the distance from Earth.
            opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
            vec3 horizonColor = vec3(0.1, 0.2, 0.3);
            vec3 nearColor = vec3(0.0);

            rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
            
            // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
            underTranslucentGlobe = 1.0;
            return;
        }
    #endif

    computeScattering(
        primaryRay,
        length(cameraToPositionWC),
        lightDirection,
        atmosphereInnerRadius,
        rayleighColor,
        mieColor,
        opacity
    );

    // Alter the opacity based on how close the viewer is to the ground.
    // (0.0 = At edge of atmosphere, 1.0 = On ground)
    float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
    opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);

    // Alter alpha based on time of day (0.0 = night , 1.0 = day)
    float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
    opacity *= pow(nightAlpha, 0.5);
}
`;var zWi=T(S(),1),Uw=`in vec3 v_outerPositionWC;

uniform vec3 u_hsbShift;

#ifndef PER_FRAGMENT_ATMOSPHERE
in vec3 v_mieColor;
in vec3 v_rayleighColor;
in float v_opacity;
in float v_translucent;
#endif

void main (void)
{
    vec3 lightDirection = getLightDirection(v_outerPositionWC);
   
    vec3 mieColor;
    vec3 rayleighColor;
    float opacity;
    float translucent;

    #ifdef PER_FRAGMENT_ATMOSPHERE
        computeAtmosphereScattering(
            v_outerPositionWC,
            lightDirection,
            rayleighColor,
            mieColor,
            opacity,
            translucent
        );
    #else
        mieColor = v_mieColor;
        rayleighColor = v_rayleighColor;
        opacity = v_opacity;
        translucent = v_translucent;
    #endif

    vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);

    #ifndef HDR
        color.rgb = czm_acesTonemapping(color.rgb);
        color.rgb = czm_inverseGamma(color.rgb);
    #endif

    #ifdef COLOR_CORRECT
        // Convert rgb color to hsb
        vec3 hsb = czm_RGBToHSB(color.rgb);
        // Perform hsb shift
        hsb.x += u_hsbShift.x; // hue
        hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation
        hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness
        // Convert shifted hsb back to rgb
        color.rgb = czm_HSBToRGB(hsb);
    #endif

    // For the parts of the sky atmosphere that are not behind a translucent globe,
    // we mix in the default opacity so that the sky atmosphere still appears at distance.
    // This is needed because the opacity in the sky atmosphere is initially adjusted based
    // on the camera height.
    if (translucent == 0.0) {
        color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
    }

    out_FragColor = color;
}
`;var QWi=T(S(),1),kw=`in vec4 position;

out vec3 v_outerPositionWC;

#ifndef PER_FRAGMENT_ATMOSPHERE
out vec3 v_mieColor;
out vec3 v_rayleighColor;
out float v_opacity;
out float v_translucent;
#endif

void main(void)
{
    vec4 positionWC = czm_model * position;
    vec3 lightDirection = getLightDirection(positionWC.xyz);

    #ifndef PER_FRAGMENT_ATMOSPHERE
        computeAtmosphereScattering(
            positionWC.xyz,
            lightDirection,
            v_rayleighColor,
            v_mieColor,
            v_opacity,
            v_translucent
        );
    #endif
    
    v_outerPositionWC = positionWC.xyz;
    gl_Position = czm_modelViewProjection * position;
}
`;function fV(e){e=g(e,re.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(fV.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});fV.prototype.setDynamicAtmosphereColor=function(e,t){let n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};var jQ=new F;fV.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ie.SCENE3D&&n!==ie.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,jQ),o=F.multiplyTransformation(i,Zo.Y_UP_TO_Z_UP,jQ),r=F.multiply(this._scaleMatrix,o,jQ);F.clone(r,this._modelMatrix);let s=e.context,a=mmt(this),c=e.globeTranslucencyState.translucent,l=this.perFragmentAtmosphere||c||!d(t)||!t.show,u=this._command;if(!d(u.vertexArray)){let p=Is.createGeometry(new Is({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:We.POSITION_ONLY}));u.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:An.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),u.renderState=De.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let m=a|l<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),l&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let y=new Be({defines:p,sources:[G0,hV,kw]}),f=new Be({defines:p,sources:[G0,hV,Uw]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:y,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function mmt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}fV.prototype.isDestroyed=function(){return!1};fV.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var Dw=fV;var z2i=T(S(),1);var V2i=T(S(),1),Bw=`uniform samplerCube u_cubeMap;

in vec3 v_texCoord;

void main()
{
    vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
    out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
}
`;var R2i=T(S(),1),Yw=`in vec3 position;

out vec3 v_texCoord;

void main()
{
    vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
    gl_Position = czm_projection * vec4(p, 1.0);
    v_texCoord = position.xyz;
}
`;function Nk(e){this.sources=e.sources,this._sources=void 0,this.show=g(e.show,!0),this._command=new nt({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}Nk.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ie.SCENE3D&&e.mode!==ie.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let r=this.sources;typeof r.positiveX=="string"?tG(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Ma({context:i,source:r}))}let o=this._command;if(!d(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return n._cubeMap}};let r=cl.createGeometry(cl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:We.POSITION_ONLY})),s=this._attributeLocations=An.createAttributeLocations(r);o.vertexArray=ni.fromGeometry({context:i,geometry:r,attributeLocations:s,bufferUsage:Ne.STATIC_DRAW}),o.renderState=De.fromCache({blending:un.ALPHA_BLEND})}if(!d(o.shaderProgram)||this._useHdr!==t){let r=new Be({defines:[t?"HDR":""],sources:[Bw]});o.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:Yw,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t}if(d(this._cubeMap))return o};Nk.prototype.isDestroyed=function(){return!1};Nk.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var Ow=Nk;var EPi=T(S(),1);var Q2i=T(S(),1),Kw=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color = texture(u_texture, v_textureCoordinates);
    out_FragColor = czm_gammaCorrect(color);
}
`;var q2i=T(S(),1),Hw=`uniform float u_radiusTS;

in vec2 v_textureCoordinates;

vec2 rotate(vec2 p, vec2 direction)
{
    return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
}

vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
{
    vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
    float radius = length(rotatedPosition) * lengthScalar;
    float burst = 1.0 - smoothstep(0.0, 0.55, radius);
    return vec4(burst);
}

void main()
{
    float lengthScalar = 2.0 / sqrt(2.0);
    vec2 position = v_textureCoordinates - vec2(0.5);
    float radius = length(position) * lengthScalar;
    float surface = step(radius, u_radiusTS);
    vec4 color = vec4(vec2(1.0), surface + 0.2, surface);

    float glow = 1.0 - smoothstep(0.0, 0.55, radius);
    color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;

    vec4 burst = vec4(0.0);

    // The following loop has been manually unrolled for speed, to
    // avoid sin() and cos().
    //
    //for (float i = 0.4; i < 3.2; i += 1.047) {
    //    vec2 direction = vec2(sin(i), cos(i));
    //    burst += 0.4 * addBurst(position, direction, lengthScalar);
    //
    //    direction = vec2(sin(i - 0.08), cos(i - 0.08));
    //    burst += 0.3 * addBurst(position, direction, lengthScalar);
    //}

    burst += 0.4 * addBurst(position, vec2(0.38942,  0.92106), lengthScalar);  // angle == 0.4
    burst += 0.4 * addBurst(position, vec2(0.99235,  0.12348), lengthScalar);  // angle == 0.4 + 1.047
    burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);  // angle == 0.4 + 1.047 * 2.0

    burst += 0.3 * addBurst(position, vec2(0.31457,  0.94924), lengthScalar);  // angle == 0.4 - 0.08
    burst += 0.3 * addBurst(position, vec2(0.97931,  0.20239), lengthScalar);  // angle == 0.4 + 1.047 - 0.08
    burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);  // angle == 0.4 + 1.047 * 2.0 - 0.08

    // End of manual loop unrolling.

    color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;

    out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
}
`;var ePi=T(S(),1),zw=`in vec2 direction;

uniform float u_size;

out vec2 v_textureCoordinates;

void main() 
{
    vec4 position;
    if (czm_morphTime == 1.0)
    {
        position = vec4(czm_sunPositionWC, 1.0);
    }
    else
    {
        position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
    }
    
    vec4 positionEC = czm_view * position;
    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
    
    vec2 halfSize = vec2(u_size * 0.5);
    halfSize *= ((direction * 2.0) - 1.0);
    
    gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
    
    v_textureCoordinates = direction;
}
`;function Qw(){this.show=!0,this._drawCommand=new nt({primitiveType:Fe.TRIANGLES,boundingVolume:new ce,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ce,this._boundingVolume2D=new ce,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(Qw.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var hmt=new D,fmt=new D,pmt=new se,Jw=new se;Qw.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ie.SCENE2D||i===ie.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!d(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let Z=Math.max(r,s);Z=Math.pow(2,Math.ceil(Math.log(Z)/Math.log(2))-2),Z=Math.max(1,Z);let G=n?o.halfFloatingPointTexture?Je.HALF_FLOAT:Je.FLOAT:Je.UNSIGNED_BYTE;this._texture=new Wt({context:o,width:Z,height:Z,pixelFormat:st.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let X=this,P={u_radiusTS:function(){return X._radiusTS}};this._commands.computeCommand=new Kd({fragmentShaderSource:Hw,outputTexture:this._texture,uniformMap:P,persists:!1,owner:this,postExecute:function(){X._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!d(a.vertexArray)){let Z={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let X=mt.createVertexBuffer({context:o,typedArray:G,usage:Ne.STATIC_DRAW}),P=[{index:Z.direction,vertexBuffer:X,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],v=mt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:P,indexBuffer:v}),a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:zw,fragmentShaderSource:Kw,attributeLocations:Z}),a.renderState=De.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,l=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,m=this._boundingVolume2D;h.clone(c,u.center),m.center.x=l.z,m.center.y=l.x,m.center.z=l.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,m.radius=u.radius,i===ie.SCENE3D?ce.clone(u,a.boundingVolume):i===ie.COLUMBUS_VIEW&&ce.clone(m,a.boundingVolume);let p=Ji.computeActualWgs84Position(e,c,Jw),y=h.magnitude(h.subtract(p,e.camera.position,Jw)),f=o.uniformState.projection,x=pmt;x.x=0,x.y=0,x.z=-y,x.w=1;let _=F.multiplyByVector(f,x,Jw),C=Ji.clipToGLWindowCoordinates(t.viewport,_,hmt);x.x=W.SOLAR_RADIUS;let V=F.multiplyByVector(f,x,Jw),L=Ji.clipToGLWindowCoordinates(t.viewport,V,fmt);return this._size=D.magnitude(D.subtract(L,C,Jw)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};Qw.prototype.isDestroyed=function(){return!1};Qw.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var jw=Qw;function pV(e){return $t(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function bmt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!d(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){let r="An error occurred while rendering.  Rendering has stopped.";e.showErrorPanel(r,void 0,o)}}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function ige(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,d(e._scene)&&(e._scene.pixelRatio=t),t}function oge(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=ige(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function rge(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;d(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function pT(e,t){e=En(e),t=g(t,g.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Mt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Mt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}g(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=d(t.creditContainer)?En(t.creditContainer):n;c.appendChild(a);let l=d(t.creditViewport)?En(t.creditViewport):n,u=g(t.showRenderLoopErrors,!0),m=g(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=m,this._forceResize=!1,this._clock=d(t.clock)?t.clock:new Dm,oge(this);try{let p=new Nw({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:g(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=h.UNIT_Z,ige(this),rge(this);let y=g(p.mapProjection.ellipsoid,re.WGS84),f=t.globe;d(f)||(f=new uv(y)),f!==!1&&(p.globe=f,p.globe.shadows=g(t.terrainShadows,xn.RECEIVE_ONLY));let x=t.skyBox;d(x)||(x=new Ow({sources:{positiveX:pV("px"),negativeX:pV("mx"),positiveY:pV("py"),negativeY:pV("my"),positiveZ:pV("pz"),negativeZ:pV("mz")}})),x!==!1&&(p.skyBox=x,p.sun=new jw,p.moon=new yv);let _=t.skyAtmosphere;d(_)||(_=new Dw(y),_.show=t.globe!==!1&&f.show),_!==!1&&(p.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(d(C)||(C=na.fromWorldImagery()),p.imageryLayers.add(C)),d(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),d(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new Id(i),d(t.sceneMode)&&(t.sceneMode===ie.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ie.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=g(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(L,Z){if(V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors){let G="An error occurred while rendering.  Rendering has stopped.";V.showErrorPanel(G,void 0,Z)}},p.renderError.addEventListener(this._onRenderError)}catch(p){if(u){let y="Error constructing CesiumWidget.",f='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:';this.showErrorPanel(y,f,p)}throw p}}Object.defineProperties(pT.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&bmt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});pT.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),d(window.addEventListener)&&window.addEventListener("resize",c,!1);let l=d(t),u=d(n);if(l||u){let y=document.createElement("div");if(y.className="cesium-widget-errorPanel-message",a.appendChild(y),u){let f=Tf(n);l||(typeof n=="string"&&(n=new Error(n)),t=Tf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${f}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(f)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}y.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){d(c)&&d(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},m.appendChild(p),i.appendChild(o)};pT.prototype.isDestroyed=function(){return!1};pT.prototype.destroy=function(){d(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};pT.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,oge(this),rge(this),this._scene.requestRender())};pT.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var qw=pT;var $Pi=T(S(),1),$w=`uniform sampler2D u_noiseTexture;
uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
in vec2 v_offset;
in vec3 v_maximumSize;
in vec4 v_color;
in float v_slice;
in float v_brightness;

float wrap(float value, float rangeLength) {
    if(value < 0.0) {
        float absValue = abs(value);
        float modValue = mod(absValue, rangeLength);
        return mod(rangeLength - modValue, rangeLength);
    }
    return mod(value, rangeLength);
}

vec3 wrapVec(vec3 value, float rangeLength) {
    return vec3(wrap(value.x, rangeLength),
                wrap(value.y, rangeLength),
                wrap(value.z, rangeLength));
}

vec2 voxelToUV(vec3 voxelIndex) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    float noiseTextureRows = u_noiseTextureDimensions.y;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;

    float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
    vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
                                            inverseNoiseTextureRows / textureSliceWidth);
    vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
    float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
    float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);

    float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
    float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
    return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
}

// Interpolate a voxel with its neighbor (along the positive X-axis)
vec4 lerpSamplesX(vec3 voxelIndex, float x) {
    vec2 uv0 = voxelToUV(voxelIndex);
    vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
    vec4 sample0 = texture(u_noiseTexture, uv0);
    vec4 sample1 = texture(u_noiseTexture, uv1);
    return mix(sample0, sample1, x);
}

vec4 sampleNoiseTexture(vec3 position) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
    vec3 lerpValue = fract(recenteredPos);
    vec3 voxelIndex = floor(recenteredPos);

    vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
    vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
    vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
    vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);

    vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
    vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
    return mix(yLerp0, yLerp1, lerpValue.z);
}

// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
bool intersectSphere(vec3 origin, vec3 dir, float slice,
                     out vec3 point, out vec3 normal) {
    float A = dot(dir, dir);
    float B = dot(origin, dir);
    float C = dot(origin, origin) - 0.25;
    float discriminant = (B * B) - (A * C);
    if(discriminant < 0.0) {
        return false;
    }
    float root = sqrt(discriminant);
    float t = (-B - root) / A;
    if(t < 0.0) {
        t = (-B + root) / A;
    }
    point = origin + t * dir;

    if(slice >= 0.0) {
        point.z = (slice / 2.0) - 0.5;
        if(length(point) > 0.5) {
            return false;
        }
    }

    normal = normalize(point);
    point -= czm_epsilon2 * normal;
    return true;
}

// Transforms the ray origin and direction into unit sphere space,
// then transforms the result back into the ellipsoid's space.
bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
                        out vec3 point, out vec3 normal) {
    if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
        return false;
    }

    vec3 o = (origin - center) / scale;
    vec3 d = dir / scale;
    vec3 p, n;
    bool intersected = intersectSphere(o, d, slice, p, n);
    if(intersected) {
        point = (p * scale) + center;
        normal = n;
    }
    return intersected;
}

// Assume that if phase shift is being called for octave i,
// the frequency is of i - 1. This saves us from doing extra
// division / multiplication operations.
vec2 phaseShift2D(vec2 p, vec2 freq) {
    return (czm_pi / 2.0) * sin(freq.yx * p.yx);
}

vec2 phaseShift3D(vec3 p, vec2 freq) {
    return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
}

// The cloud texture function derived from Gardner's 1985 paper,
// "Visual Simulation of Clouds."
// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
const float T0    = 0.6;  // contrast of the texture pattern
const float k     = 0.1;  // computed to produce a maximum value of 1
const float C0    = 0.8;  // coefficient
const float FX0   = 0.6;  // frequency X
const float FY0   = 0.6;  // frequency Y
const int octaves = 5;

float T(vec3 point) {
    vec2 sum = vec2(0.0);
    float Ci = C0;
    vec2 FXY = vec2(FX0, FY0);
    vec2 PXY = vec2(0.0);
    for(int i = 1; i <= octaves; i++) {
        PXY = phaseShift3D(point, FXY);
        Ci *= 0.707;
        FXY *= 2.0;
        vec2 sinTerm = sin(FXY * point.xy + PXY);
        sum += Ci * sinTerm + vec2(T0);
    }
    return k * sum.x * sum.y;
}

const float a = 0.5;  // fraction of surface reflection due to ambient or scattered light,
const float t = 0.4;  // fraction of texture shading
const float s = 0.25; // fraction of specular reflection

float I(float Id, float Is, float It) {
    return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
}

const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));

vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
               float brightness) {
    vec3 cloudPoint, cloudNormal;
    if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
                            cloudPoint, cloudNormal)) {
        return vec4(0.0);
    }

    float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);  // diffuse reflection
    float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);   // specular reflection
    float It = T(cloudPoint);                                 // texture function
    float intensity = I(Id, Is, It);
    vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));

    vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
    float W = noise.x;
    float W2 = noise.y;
    float W3 = noise.z;

    // The dot product between the cloud's normal and the ray's direction is greatest
    // in the center of the ellipsoid's surface. It decreases towards the edge.
    // Thus, it is used to blur the areas leading to the edges of the ellipsoid,
    // so that no harsh lines appear.

    // The first (and biggest) layer of worley noise is then subtracted from this.
    // The final result is scaled up so that the base cloud is not too translucent.
    float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
    float TR = pow(ndDot, 3.0) - W; // translucency
    TR *= 1.3;

    // Subtracting the second and third layers of worley noise is more complicated.
    // If these layers of noise were simply subtracted from the current translucency,
    // the shape derived from the first layer of noise would be completely deleted.
    // The erosion of this noise should thus be constricted to the edges of the cloud.
    // However, because the edges of the ellipsoid were already blurred away, mapping
    // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
    // The value of (0.5 - ndDot) provides the best compromise.
    float minusDot = 0.5 - ndDot;

    // Even with the previous calculation, subtracting the second layer of wnoise
    // erode too much of the cloud. The addition of it, however, will detailed
    // volume to the cloud. As long as the noise is only added and not subtracted,
    // the results are aesthetically pleasing.

    // The minusDot product is mapped in a way that it is larger at the edges of
    // the ellipsoid, so a subtraction and min operation are used instead of
    // an addition and max one.
    TR -= min(minusDot * W2, 0.0);

    // The third level of worley noise is subtracted from the result, with some
    // modifications. First, a scalar is added to minusDot so that the noise
    // starts affecting the shape farther away from the center of the ellipsoid's
    // surface. Then, it is scaled down so its impact is not too intense.
    TR -= 0.8 * (minusDot + 0.25) * W3;

    // The texture function's shading does not correlate with the shape of the cloud
    // produced by the layers of noise, so an extra shading scalar is calculated.
    // The darkest areas of the cloud are assigned to be where the noise erodes
    // the cloud the most. This is then interpolated based on the translucency
    // and the diffuse shading term of that point in the cloud.
    float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);

    // To avoid values that are too dark, this scalar is increased by a small amount
    // and clamped so it never goes to zero.
    shading = clamp(shading + 0.2, 0.3, 1.0);

    // Finally, the contrast of the cloud's color is increased.
    vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
    return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
}

void main() {
#ifdef DEBUG_BILLBOARDS
    out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
#endif
    // To avoid calculations with high values,
    // we raycast from an arbitrarily smaller space.
    vec2 coordinate = v_maximumSize.xy * v_offset;

    vec3 ellipsoidScale = 0.82 * v_maximumSize;
    vec3 ellipsoidCenter = vec3(0.0);

    float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
    vec3 eye = vec3(0, 0, -10.0 - zOffset);
    vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
    vec3 rayOrigin = eye;
#ifdef DEBUG_ELLIPSOIDS
    vec3 point, normal;
    if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
                          point, normal)) {
        out_FragColor = v_brightness * v_color;
    }
#else
#ifndef DEBUG_BILLBOARDS
    vec4 cloud = drawCloud(rayOrigin, rayDir,
                           ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
    if(cloud.w < 0.01) {
        discard;
    }
    out_FragColor = cloud;
#endif
#endif
}
`;var tvi=T(S(),1),eF=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScaleX;
in vec4 positionLowAndScaleY;
in vec4 packedAttribute0;
in vec4 packedAttribute1;
in vec4 color;

out vec2 v_offset;
out vec3 v_maximumSize;
out vec4 v_color;
out float v_slice;
out float v_brightness;

void main() {
    // Unpack attributes.
    vec3 positionHigh = positionHighAndScaleX.xyz;
    vec3 positionLow = positionLowAndScaleY.xyz;
    vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);

    float show = packedAttribute0.x;
    float brightness = packedAttribute0.y;
    vec2 coordinates = packedAttribute0.wz;
    vec3 maximumSize = packedAttribute1.xyz;
    float slice = packedAttribute1.w;

#ifdef INSTANCED
    vec2 dir = direction;
#else
    vec2 dir = coordinates;
#endif

    vec2 offset = dir - vec2(0.5, 0.5);
    vec2 scaledOffset = scale * offset;
    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
    vec4 positionEC = czm_modelViewRelativeToEye * p;
    positionEC.xy += scaledOffset;
    
    positionEC.xyz *= show;
    gl_Position = czm_projection * positionEC;

    v_offset = offset;
    v_maximumSize = maximumSize;
    v_color = color;
    v_slice = slice;
    v_brightness = brightness;
}
`;var ivi=T(S(),1),tF=`uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
uniform vec3 u_noiseOffset;
in vec2 v_position;

float wrap(float value, float rangeLength) {
    if(value < 0.0) {
        float absValue = abs(value);
        float modValue = mod(absValue, rangeLength);
        return mod(rangeLength - modValue, rangeLength);
    }
    return mod(value, rangeLength);
}

vec3 wrapVec(vec3 value, float rangeLength) {
    return vec3(wrap(value.x, rangeLength),
                wrap(value.y, rangeLength),
                wrap(value.z, rangeLength));
}

vec3 random3(vec3 p) {
    float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
    float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
    return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
}

// Frequency corresponds to cell size.
// The higher the frequency, the smaller the cell size.
vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    vec3 cell = centerCell + offset;
    cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
    cell += floor(u_noiseOffset / u_noiseDetail);
    vec3 p = offset + random3(cell);
    return p;
}

float worleyNoise(vec3 p, float freq) {
    vec3 centerCell = floor(p * freq);
    vec3 pointInCell = fract(p * freq);
    float shortestDistance = 1000.0;

    for(float z = -1.0; z <= 1.0; z++) {
        for(float y = -1.0; y <= 1.0; y++) {
            for(float x = -1.0; x <= 1.0; x++) {
                vec3 offset = vec3(x, y, z);
                vec3 point = getWorleyCellPoint(centerCell, offset, freq);

                float distance = length(pointInCell - point);
                if(distance < shortestDistance) {
                    shortestDistance = distance;
                }
            }
        }
    }

    return shortestDistance;
}

const float MAX_FBM_ITERATIONS = 10.0;

float worleyFBMNoise(vec3 p, float octaves, float scale) {
    float noise = 0.0;
    float freq = 1.0;
    float persistence = 0.625;
    for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
        if(i >= octaves) {
            break;
        }

        noise += worleyNoise(p * scale, freq * scale) * persistence;
        persistence *= 0.5;
        freq *= 2.0;
    }
    return noise;
}

void main() {
    float textureSliceWidth = u_noiseTextureDimensions.x;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
    float x = mod(v_position.x, textureSliceWidth);
    float y = mod(v_position.y, textureSliceWidth);
    float sliceRow = floor(v_position.y / textureSliceWidth);
    float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;

    vec3 position = vec3(x, y, z);
    position /= u_noiseDetail;
    float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
    float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
    float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
    out_FragColor = vec4(worley0, worley1, worley2, 1.0);
}
`;var rvi=T(S(),1),nF=`uniform vec3 u_noiseTextureDimensions;
in vec2 position;

out vec2 v_position;

void main()
{
    gl_Position = vec4(position, 0.1, 1.0);

    float textureSliceWidth = u_noiseTextureDimensions.x;
    float noiseTextureRows = u_noiseTextureDimensions.y;
    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
    vec2 transformedPos = (position * 0.5) + vec2(0.5);
    transformedPos *= textureSliceWidth;
    transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
    transformedPos.y *= noiseTextureRows;
    v_position = transformedPos;
}
`;var avi=T(S(),1),iF=`
in vec2 v_textureCoordinates;

void main()
{
    czm_materialInput materialInput;
    
    materialInput.s = v_textureCoordinates.s;
    materialInput.st = v_textureCoordinates;
    materialInput.str = vec3(v_textureCoordinates, 0.0);
    materialInput.normalEC = vec3(0.0, 0.0, -1.0);
    
    czm_material material = czm_getMaterial(materialInput);

    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
}
`;var vvi=T(S(),1);var hvi=T(S(),1);function gV(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var bT=new de;function ymt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}gV.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let y=t;y<=i;++y)ymt(e,y,p,s)||s.push(new bV(r,void 0,0,y,p));r.tileXYToRectangle(t,n,e,bT);let a=bT.west,c=bT.north;r.tileXYToRectangle(i,o,e,bT);let l=bT.east,u=bT.south,m=new Smt(e,a,u,l,c);for(let p=0;p<s.length;++p){let y=s[p];qQ(y.extent,m)&&Cmt(this._maximumLevel,y,m)}};gV.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(yV(i.extent,e)){t=i;break}}return d(t)?oF(void 0,t,e):-1};var gmt=[],xmt=[],_mt=new de,Tmt=new de;gV.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=gmt;t.length=0,e.east<e.west?(t.push(de.fromRadians(-Math.PI,e.south,e.east,e.north,_mt)),t.push(de.fromRadians(e.west,e.south,Math.PI,e.north,Tmt))):t.push(e);let n=xmt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)rF(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(d(n[i])&&n[i].length===0)return i;return 0};var sge=new he;gV.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,bT);return de.center(i,sge),this.computeMaximumLevelAtPosition(sge)>=e};gV.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function bV(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(bV.prototype,{nw:{get:function(){return this._nw||(this._nw=new bV(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new bV(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new bV(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new bV(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Smt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function qQ(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Cmt(e,t,n){for(;t.level<e;)if(Uk(t.nw.extent,n))t=t.nw;else if(Uk(t.ne.extent,n))t=t.ne;else if(Uk(t.sw.extent,n))t=t.sw;else if(Uk(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Lo(t.rectangles,n.level,Vmt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Vmt(e,t){return e.level-t}function Uk(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function yV(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function oF(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&yV(t._nw.extent,n),s=t._ne&&yV(t._ne.extent,n),a=t._sw&&yV(t._sw.extent,n),c=t._se&&yV(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,oF(t,t._nw,n))),s&&(i=Math.max(i,oF(t,t._ne,n))),a&&(i=Math.max(i,oF(t,t._sw,n))),c&&(i=Math.max(i,oF(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];yV(a,n)&&(i=a.level)}t=t.parent}return i}function rF(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||qQ(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Lmt(e[s.level],s)}rF(e,t._nw,n),rF(e,t._ne,n),rF(e,t._sw,n),rF(e,t._se,n)}function Lmt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];qQ(o,t)?(o.west<t.west&&n.push(new de(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new de(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new de(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new de(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var ph=gV;var Rmt=15;function age(e){this.ellipsoid=g(e.ellipsoid,re.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}age.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Zmt(e,t){let n=t.copyrightText;d(n)&&(e.credit=new St(n));let i=t.spatialReference,o=g(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=de.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Di(s);else if(o===3857){let l=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>l&&(t.extent.xmax=l),t.extent.ymax>l&&(t.extent.ymax=l),t.extent.xmin<-l&&(t.extent.xmin=-l),t.extent.ymin<-l&&(t.extent.ymin=-l),s.rectangleSouthwestInMeters=new D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new kr(s)}else throw new me("Invalid spatial reference");let a=t.tileInfo;if(!d(a))throw new me("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Fu.LERC:Fu.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new ph(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new ph(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),d(t.minValues)&&d(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Gmt(e,t,n){try{let i=await t.fetchJson();Zmt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Vo.reportError(void 0,n,d(n)?n._errorEvent:void 0,o),i}}function $y(e){e=g(e,g.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new ye}Object.defineProperties($y.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});$y.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),d(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new age(t);await Gmt(o,i);let r=new $y(t);return o.build(r),r._resource=n,r};$y.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!d($Q(this,n+1,e*2,t*2))){let m=cge(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!d(c)||!d(s))return;let l=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new Sa({buffer:m[0],width:l._width,height:l._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):Rmt,structure:l._terrainDataStructure,encoding:l._encoding})}).catch(function(m){return d(a)&&a.state===$n.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=$n.CANCELLED,Promise.reject(m)})):Promise.reject(m)})};function $Q(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}$y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};$y.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=$Q(this,n,e,t);if(d(i))return i;cge(this,n,e,t)};$y.prototype.loadTileDataAvailability=function(e,t,n){};function Emt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},l=new D(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=l.x,y=m?l.y+1:l.y;if(!u){for(let f=e.y;f<y;++f)if(i[f*t+l.x]!==s){u=!0;break}u?(a.push(new D(l.x,e.y)),--l.x,--p,c.endX=l.x):l.x===o?(c.endX=l.x,u=!0):++l.x}if(!m){let f=l.y*t;for(let x=e.x;x<=p;++x)if(i[f+x]!==s){m=!0;break}m?(a.push(new D(e.x,l.y)),--l.y,c.endY=l.y):l.y===r?(c.endY=l.y,m=!0):++l.y}}return{endingIndices:a,range:c,value:s}}function Xmt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new D(0,0)];for(;a.length>0;){let c=a.pop(),l=Emt(c,n,i,o);if(l.value===1){let m=l.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let u=l.endingIndices;u.length>0&&(a=a.concat(u))}return r}function cge(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(d(c[a]))return c[a];let l=new Uo({throttle:!1,throttleByServer:!0,type:Jr.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:l}).fetchJson();return d(m)?(m=m.then(function(p){let y=Xmt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let x=0;x<y.length;++x){let _=y[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return $Q(e,t,n,i)}),c[a]={promise:m,request:l},m=m.finally(function(p){return delete c[a],p}),{promise:m,request:l}):{}}var e4=$y;var kvi=T(S(),1);var lge="https://dev.virtualearth.net/REST/v1/Locations";function t4(e){e=g(e,g.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};d(e.culture)&&(n.culture=e.culture),this._resource=new Ee({url:lge,queryParameters:n}),this._credit=new St('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(t4.prototype,{url:{get:function(){return lge}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});t4.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],l=r[3];return{displayName:o.name,destination:de.fromDegrees(a,s,l,c)}})})};var n4=t4;var Yvi=T(S(),1);function i4(){}Object.defineProperties(i4.prototype,{credit:{get:function(){}}});i4.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var o4=i4;var $vi=T(S(),1);var Imt=new se,dge=new h,xV=new h;function Wmt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){d(c)||(c=new h);let l=(a-i)*o;return h.lerp(r,s,l,c)}}return function(i,o){d(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Imt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,l,u,m,p;return r===0?(c=t[0],l=t[1],u=e.firstTangent,m=h.subtract(t[2],c,dge),h.multiplyByScalar(m,.5,m),p=F.multiplyByVector(Ub.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],l=t[r+1],m=e.lastTangent,u=h.subtract(l,t[r-1],dge),h.multiplyByScalar(u,.5,u),p=F.multiplyByVector(Ub.hermiteCoefficientMatrix,a,a)):(c=t[r-1],l=t[r],u=t[r+1],m=t[r+2],p=F.multiplyByVector(eg.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(l,p.y,xV),h.add(o,xV,o),h.multiplyByScalar(u,p.z,xV),h.add(o,xV,o),h.multiplyByScalar(m,p.w,xV),h.add(o,xV,o)}}var Pmt=new h,vmt=new h;function eg(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(d(i)||(i=Pmt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!d(o))){let r=t.length-1;o=vmt,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=Wmt(this),this._lastTimeIndex=0}Object.defineProperties(eg.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});eg.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);eg.prototype.findTimeInterval=ro.prototype.findTimeInterval;eg.prototype.wrapTime=ro.prototype.wrapTime;eg.prototype.clampTime=ro.prototype.clampTime;eg.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var r4=eg;var Bwi=T(S(),1);var xwi=T(S(),1);var owi=T(S(),1);var kk={};kk.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){d(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let l=s+a+c,u,m,p,y,f,x;return l===1?s?(u=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),y=(e-i)/(n-i),r.push(2),r.push(0),y!==1&&(r.push(-1),r.push(1),r.push(0),r.push(y)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):l===2?!s&&n!==e?(y=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(y),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(x=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):l!==3&&(r.push(0),r.push(1),r.push(2)),r};kk.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let l=n-s,u=s-o,m=r-a,p=i-a,y=1/(m*l+u*p),f=t-a,x=e-s,_=(m*x+u*f)*y,C=(-p*x+l*f)*y,V=1-_-C;return d(c)?(c.x=_,c.y=C,c.z=V,c):new h(_,C,V)};kk.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let l=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=l/m,y=u/m;if(p>=0&&p<=1&&y>=0&&y<=1)return d(c)||(c=new D),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Y0=kk;function tg(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=Bk(e.westIndices,o,t),this._southIndices=Bk(e.southIndices,r,t),this._eastIndices=Bk(e.eastIndices,o,t),this._northIndices=Bk(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=g(e.childTileMask,15),this._createdByUpsampling=g(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(tg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return d(this._mesh)}}});var Dk=[];function Bk(e,t,n){Dk.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)Dk[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(Dk.sort(t),Ue.createTypedArray(n,Dk)):e}var uge="createVerticesFromQuantizedTerrainMesh",wmt=new pi(uge),Fmt=new pi(uge,sh.maximumAsynchronousTasks);tg.prototype.createMesh=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=g(e.throttle,!0),c=t.ellipsoid,l=t.tileXYToRectangle(n,i,o),m=(a?Fmt:wmt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:l,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!d(m))return;let p=this;return Promise.resolve(m).then(function(y){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ue.createTypedArray(x,y.indices),C=new Float32Array(y.vertices),V=y.center,L=y.minimumHeight,Z=y.maximumHeight,G=p._boundingSphere,X=p._orientedBoundingBox,P=g(h.clone(y.occludeePointInScaledSpace),p._horizonOcclusionPoint),v=y.vertexStride,A=sc.clone(y.encoding);return p._mesh=new Mu(V,C,_,y.indexCountWithoutSkirts,f,L,Z,G,P,v,X,A,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Amt=new pi("upsampleQuantizedTerrainMesh",sh.maximumAsynchronousTasks);tg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!d(this._mesh))return;let c=t*2!==o,l=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=Amt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:l,childRectangle:m,ellipsoid:u});if(!d(p))return;let y=Math.min(this._westSkirtHeight,this._eastSkirtHeight);y=Math.min(y,this._southSkirtHeight),y=Math.min(y,this._northSkirtHeight);let f=c?y*.5:this._westSkirtHeight,x=l?y*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:y*.5,C=l?this._northSkirtHeight:y*.5,V=this._credits;return Promise.resolve(p).then(function(L){let Z=new Uint16Array(L.vertices),G=Ue.createTypedArray(Z.length/3,L.indices),X;return d(L.encodedNormals)&&(X=new Uint8Array(L.encodedNormals)),new tg({quantizedVertices:Z,indices:G,encodedNormals:X,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:ce.clone(L.boundingSphere),orientedBoundingBox:Wn.clone(L.orientedBoundingBox),horizonOcclusionPoint:h.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:f,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var s4=32767,mge=new h;tg.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=s4;let o=W.clamp((n-e.south)/e.height,0,1);return o*=s4,d(this._mesh)?kmt(this,i,o):Dmt(this,i,o)};function hge(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),l=Math.max(n,o,s),u=Math.min(i,r,a),m=Math.max(i,r,a);return e>=c&&e<=l&&t>=u&&t<=m}var Mmt=new D,Nmt=new D,Umt=new D;function kmt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let l=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,l,Mmt),y=r.decodeTextureCoordinates(o,u,Nmt),f=r.decodeTextureCoordinates(o,m,Umt);if(hge(t,n,p.x,p.y,y.x,y.y,f.x,f.y)){let x=Y0.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,f.x,f.y,mge);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,l),C=r.decodeHeight(o,u),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}}function Dmt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let l=s[a],u=s[a+1],m=s[a+2],p=i[l],y=i[u],f=i[m],x=o[l],_=o[u],C=o[m];if(hge(t,n,p,x,y,_,f,C)){let V=Y0.computeBarycentricCoordinates(t,n,p,x,y,_,f,C,mge);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[l]+V.y*r[u]+V.z*r[m];return W.lerp(e._minimumHeight,e._maximumHeight,L/s4)}}}}tg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};tg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var yT=tg;function Bmt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function pge(e){this.requestVertexNormals=g(e.requestVertexNormals,!1),this.requestWaterMask=g(e.requestWaterMask,!1),this.requestMetadata=g(e.requestMetadata,!0),this.ellipsoid=e.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}pge.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=d(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function bge(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Vo.reportError(e.previousError,n,d(n)?n._errorEvent:void 0,x),new me(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Vo.reportError(e.previousError,n,d(n)?n._errorEvent:void 0,x),new me(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,d(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Vo.reportError(e.previousError,n,d(n)?n._errorEvent:void 0,x),new me(x)}let c=t.tiles,l=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,l),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new kr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Vo.reportError(e.previousError,n,d(n)?n._errorEvent:void 0,x),new me(x)}if(e.levelZeroMaximumGeometricError=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Vo.reportError(e.previousError,n,d(n)?n._errorEvent:void 0,x),new me(x)}let u;d(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:d(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),d(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),d(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let m=t.metadataAvailability,p=t.available,y;if(d(p)&&!d(m)){y=new ph(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let _=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);d(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let V=0;V<_.length;++V){let L=_[V],Z=C-L.endY-1,G=C-L.startY-1;e.overallAvailability[x].push([L.startX,Z,L.endX,G]),y.addAvailableTileRange(x,L.startX,Z,L.endX,G)}}}else d(m)&&(u=new ph(e.tilingScheme,l),y=new ph(e.tilingScheme,l),e.overallAvailability[0]=[[0,0,1,0]],y.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,d(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Bmt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:y,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return d(f)?d(y)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await l4(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Ymt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(d(t)&&(i+=`
${t.message}`),e.previousError=Vo.reportError(e.previousError,n,d(n)?n._errorEvent:void 0,i),e.previousError.retry)return l4(e,n);throw new me(i)}async function Omt(e,t,n){await bge(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new ph(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new St(e.attribution);e.tileCredits.push(o)}return!0}async function l4(e,t){try{let n=await e.layerJsonResource.fetchJson();return Omt(e,n,t)}catch(n){return d(n)&&n.statusCode===404?(await bge(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Ymt(e,n,t)}}function bh(e){e=g(e,g.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=g(e.requestVertexNormals,!1),this._requestWaterMask=g(e.requestWaterMask,!1),this._requestMetadata=g(e.requestMetadata,!0),this._errorEvent=new ye;let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var a4={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function fge(e){return!d(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Kmt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Sa({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Hmt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,l=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*l,p=3,y=Uint16Array.BYTES_PER_ELEMENT*p,f=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*f,C=new DataView(t),V=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let Z=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new ce(new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+u,!0));a+=m;let X=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let P=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=new Uint16Array(t,a,P*3);a+=P*y,P>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let A=v.subarray(0,P),M=v.subarray(P,2*P),b=v.subarray(P*2,3*P);Kn.zigZagDeltaDecode(A,M,b),a%x!==0&&(a+=x-a%x);let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=Ue.createTypedArrayFromArrayBuffer(P,t,a,R*f);a+=R*_;let I=0,w=E.length;for(let ae=0;ae<w;++ae){let xe=E[ae];E[ae]=I-xe,xe===0&&++I}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ue.createTypedArrayFromArrayBuffer(P,t,a,N);a+=N*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ue.createTypedArrayFromArrayBuffer(P,t,a,k);a+=k*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ue.createTypedArrayFromArrayBuffer(P,t,a,U);a+=U*x;let z=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let ee=Ue.createTypedArrayFromArrayBuffer(P,t,a,z);a+=z*x;let K,j;for(;a<C.byteLength;){let ae=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ae===a4.OCT_VERTEX_NORMALS&&e._requestVertexNormals)K=new Uint8Array(t,a,P*2);else if(ae===a4.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,xe);else if(ae===a4.METADATA&&e._requestMetadata){let _e=C.getUint32(a,!0);if(_e>0){let Ie=Go(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,_e).available;if(d(Ie))for(let Me=0;Me<Ie.length;++Me){let ve=n+Me+1,ke=Ie[Me],ct=e._tilingScheme.getNumberOfYTilesAtLevel(ve);for(let yt=0;yt<ke.length;++yt){let ot=ke[yt],ln=ct-ot.endY-1,vn=ct-ot.startY-1;e.availability.addAvailableTileRange(ve,ot.startX,ln,ot.endX,vn),r.availability.addAvailableTileRange(ve,ot.startX,ln,ot.endX,vn)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=xe}let q=e.getLevelMaximumGeometricError(n)*5,be=e._tilingScheme.tileXYToRectangle(i,o,n),Te=Wn.fromRectangle(be,L,Z,e._tilingScheme.ellipsoid);return new yT({center:V,minimumHeight:L,maximumHeight:Z,boundingSphere:G,orientedBoundingBox:Te,horizonOcclusionPoint:X,quantizedVertices:v,encodedNormals:K,indices:E,westIndices:Y,southIndices:O,eastIndices:J,northIndices:ee,westSkirtHeight:q,southSkirtHeight:q,eastSkirtHeight:q,northSkirtHeight:q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}bh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let l=0;l<s;++l){let u=o[l];if(!d(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let m=d4(this,e,t,n,u,l===0);m.result&&(a=!0,c=c.then(()=>m.promise))}return!d(r)&&a?c.then(()=>this.requestTileGeometry(e,t,n,i)):yge(this,e,t,n,r,i)};function yge(e,t,n,i,o,r){if(!d(o))return Promise.reject(new me("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let l,u,m=s[(t+a+i)%s.length],p=o.resource;d(p._ionEndpoint)&&!d(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),l=fge(void 0)):l=fge(c);let y=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:l,request:r}).fetchArrayBuffer();if(d(y))return y.then(function(f){return d(f)?d(e._heightmapStructure)?Kmt(e,f,i,t,n):Hmt(e,f,i,t,n,o):Promise.reject(new me("Mesh buffer doesn't exist."))})}Object.defineProperties(bh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});bh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};bh.fromIonAssetId=async function(e,t){let n=await $l.fromAssetId(e);return bh.fromUrl(n,t)};bh.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=new pge(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await l4(i);let o=new bh(t);return i.build(o),o};bh.prototype.getTileDataAvailable=function(e,t,n){if(!d(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(d4(this,e,t,n,i[r],r===0).result)return;return!1};bh.prototype.loadTileDataAvailability=function(e,t,n){if(!d(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=d4(this,e,t,n,i[r],r===0);if(d(s.promise))return s.promise}};function c4(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function d4(e,t,n,i,o,r){if(!d(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,l=o.availability,u=c4(o,t,n,i);for(;d(u);){if(l.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let m;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,m=o.availabilityPromiseCache[s],!d(m))){let p=new Uo({throttle:!1,throttleByServer:!0,type:Jr.TERRAIN});m=yge(e,u.x,u.y,u.level,o,p),d(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=c4(o,u.x,u.y,u.level)}return{result:!1}}bh._getAvailabilityTile=c4;var sF=bh;var jwi=T(S(),1);function O0(e){e=g(e,g.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Uc(n),this._workerName="createCircleGeometry"}O0.packedLength=Uc.packedLength;O0.pack=function(e,t,n){return Uc.pack(e._ellipseGeometry,t,n)};var zmt=new Uc({center:new h,semiMajorAxis:1,semiMinorAxis:1}),mc={center:new h,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new We,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};O0.unpack=function(e,t,n){let i=Uc.unpack(e,t,zmt);return mc.center=h.clone(i._center,mc.center),mc.ellipsoid=re.clone(i._ellipsoid,mc.ellipsoid),mc.height=i._height,mc.extrudedHeight=i._extrudedHeight,mc.granularity=i._granularity,mc.vertexFormat=We.clone(i._vertexFormat,mc.vertexFormat),mc.stRotation=i._stRotation,mc.shadowVolume=i._shadowVolume,d(n)?(mc.semiMajorAxis=i._semiMajorAxis,mc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Uc(mc),n):(mc.radius=i._semiMajorAxis,new O0(mc))};O0.createGeometry=function(e){return Uc.createGeometry(e._ellipseGeometry)};O0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new O0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(O0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var u4=O0;var oFi=T(S(),1);function _V(e){e=g(e,g.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new hd(n),this._workerName="createCircleOutlineGeometry"}_V.packedLength=hd.packedLength;_V.pack=function(e,t,n){return hd.pack(e._ellipseGeometry,t,n)};var Jmt=new hd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),vd={center:new h,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};_V.unpack=function(e,t,n){let i=hd.unpack(e,t,Jmt);return vd.center=h.clone(i._center,vd.center),vd.ellipsoid=re.clone(i._ellipsoid,vd.ellipsoid),vd.height=i._height,vd.extrudedHeight=i._extrudedHeight,vd.granularity=i._granularity,vd.numberOfVerticalLines=i._numberOfVerticalLines,d(n)?(vd.semiMajorAxis=i._semiMajorAxis,vd.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new hd(vd),n):(vd.radius=i._semiMajorAxis,new _V(vd))};_V.createGeometry=function(e){return hd.createGeometry(e._ellipseGeometry)};var m4=_V;var fFi=T(S(),1);function TV(e){e=g(e,g.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,d(this._tilingScheme)||(this._tilingScheme=new Di({ellipsoid:g(e.ellipsoid,re.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye;let n=e.credit;typeof n=="string"&&(n=new St(n)),this._credit=n}Object.defineProperties(TV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});TV.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!d(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Sa({buffer:c,width:r,height:s})})};TV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};TV.prototype.getTileDataAvailable=function(e,t,n){};TV.prototype.loadTileDataAvailability=function(e,t,n){};var h4=TV;var bFi=T(S(),1);function gge(e){this.proxy=e}gge.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var f4=gge;var _Fi=T(S(),1);function yh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=d(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(yh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(d(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});yh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new yh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};yh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(d(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};yh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)xge(this,t)};yh.prototype.insert=function(e){let t,n=this._maximumLength;if(d(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,xge(this,i),t};yh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],_ge(this,0)),this._array[e-1]=void 0,t};yh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=p4(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&_ge(this,n)}return this._array[e-1]=void 0,t};yh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};yh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[p4(this,1,2)?1:2]};function Yk(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function aF(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function p4(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function xge(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=aF(e,t,i);for(o!==n&&(Yk(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(aF(e,t,r)!==o)break;Yk(e,t,r),t=r}}function _ge(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){aF(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let l=0;l<c;l++){let u=a+l;aF(e,u,r)===i&&(r=u)}}if(aF(e,r,t)===i&&(Yk(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);p4(e,r,a)===i&&Yk(e,r,a)}t=r}}var gT=yh;var SFi=T(S(),1),Qmt={SEARCH:0,AUTOCOMPLETE:1},ng=Object.freeze(Qmt);var ZFi=T(S(),1);function Ok(){fe.throwInstantiationError()}Object.defineProperties(Ok.prototype,{credit:{get:fe.throwInstantiationError}});Ok.getCreditsFromResult=function(e){if(d(e.attributions))return e.attributions.map(St.getIonCredit)};Ok.prototype.geocode=fe.throwInstantiationError;var SV=Ok;var XFi=T(S(),1);function Tge(){fe.throwInstantiationError()}Tge.createGeometry=function(e){fe.throwInstantiationError()};var b4=Tge;var jFi=T(S(),1),nht=T(y4(),1);var AFi=T(S(),1);var PFi=T(S(),1);function jmt(e,t){return(e&t)!==0}var hc=jmt;var qmt=[1,2,4,8],Sge=15,$mt=16,eht=64,tht=128;function Ff(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}Ff.clone=function(e,t){return d(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Ff(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Ff.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Ff.prototype.hasSubtree=function(){return hc(this._bits,$mt)};Ff.prototype.hasImagery=function(){return hc(this._bits,eht)};Ff.prototype.hasTerrain=function(){return hc(this._bits,tht)};Ff.prototype.hasChildren=function(){return hc(this._bits,Sge)};Ff.prototype.hasChild=function(e){return hc(this._bits,qmt[e])};Ff.prototype.getChildBitmask=function(){return this._bits&Sge};var cF=Ff;function iht(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var oht=iht(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y
wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB
\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\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3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1
ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS
>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88
\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function wd(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(wd.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});wd.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ee)&&(t=e.url);let n=Ee.createIfNeeded(t);n.appendForwardSlash();let i=new wd;i._resource=n;try{await rht(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${Vge(i,"",1).url}: ${o}`;throw new me(r)}return i};wd.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;hc(t,r)?hc(e,r)&&(s|=1):(s|=2,hc(e,r)||(s|=1)),i+=s}return i};wd.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];hc(s,2)?hc(s,1)||(t|=r):(n|=r,hc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};wd.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(d(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),d(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Cge=new pi("decodeGoogleEarthEnterprisePacket");wd.prototype.getQuadTreePacket=function(e,t,n){t=g(t,1),e=g(e,"");let o=Vge(this,e,t,n).fetchArrayBuffer();if(!d(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return Cge.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(l){let u,m=-1;if(e!==""){m=e.length+1;let f=l[e];u=r[e],u._bits|=f._bits,delete l[e]}let p=Object.keys(l);p.sort(function(f,x){return f.length-x.length});let y=p.length;for(let f=0;f<y;++f){let x=p[f];if(l[x]!==null){let C=cF.clone(l[x]),V=x.length;if(V===m)C.setParent(u);else if(V>1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};wd.prototype.populateSubtree=function(e,t,n,i){let o=wd.tileXYToQuadKey(e,t,n);return _4(this,o,i)};function _4(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(d(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(d(c))return c.then(function(){return s=new Uo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),_4(e,t,s)});if(!d(r)||!r.hasSubtree())return Promise.reject(new me(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!d(c))return a[o]=c,c.then(function(){return s=new Uo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),_4(e,t,s)}).finally(function(){delete a[o]})}wd.prototype.getTileInformation=function(e,t,n){let i=wd.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};wd.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Vge(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var g4,x4;function rht(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!d(x4)){let n=$t("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;x4=Zg(n).then(function(){g4=window.cesiumGoogleEarthDbRootParser(nht),d(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return x4.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=g4.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return Cge.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=g4.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=g(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=g(i.terrainPresent,e.terrainPresent),d(i.endSnippet)&&d(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=g(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=g(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}d(i.databaseVersion)&&(e._quadPacketVersion=g(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=g(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],l=c.copyrightString;d(l)&&(o[c.providerId]=new St(l.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=oht})}var K0=wd;var fAi=T(S(),1);function xT(e){e=g(e,g.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=g(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=g(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(xT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Zge="createVerticesFromGoogleEarthEnterpriseBuffer",sht=new pi(Zge),aht=new pi(Zge,sh.maximumAsynchronousTasks),Lge=new de,T4=new de;xT.prototype.createMesh=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=g(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Lge),t.tileXYToRectangle(n,i,o,T4);let l=c.cartographicToCartesian(de.center(T4)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let y=(a?aht:sht).scheduleTask({buffer:this._buffer,nativeRectangle:Lge,rectangle:T4,relativeToCenter:l,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!d(y))return;let f=this;return y.then(function(x){return f._mesh=new Mu(l,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ce.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Wn.clone(x.orientedBoundingBox),sc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),f._minimumHeight=x.minimumHeight,f._maximumHeight=x.maximumHeight,f._buffer=void 0,f._mesh})};xT.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return d(this._mesh)?mht(this,i,o):pht(this,i,o,e)};var cht=new pi("upsampleQuantizedTerrainMesh",sh.maximumAsynchronousTasks);xT.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!d(this._mesh))return;let c=t*2!==o,l=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=cht.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:l,childRectangle:m,ellipsoid:u});if(!d(p))return;let y=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ue.createTypedArray(x.length/3,f.indices),C=y._skirtHeight;return new yT({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:ce.clone(f.boundingSphere),orientedBoundingBox:Wn.clone(f.orientedBoundingBox),horizonOcclusionPoint:h.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:y._credits})})};xT.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};xT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var lht=new D,dht=new D,uht=new D,Gge=new h;function mht(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let l=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,l,lht),y=r.decodeTextureCoordinates(o,u,dht),f=r.decodeTextureCoordinates(o,m,uht),x=Y0.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,f.x,f.y,Gge);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,l),C=r.decodeHeight(o,u),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}var hht=Uint16Array.BYTES_PER_ELEMENT,Rge=Uint32Array.BYTES_PER_ELEMENT,S4=Int32Array.BYTES_PER_ELEMENT,fht=Float32Array.BYTES_PER_ELEMENT,C4=Float64Array.BYTES_PER_ELEMENT;function pht(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),l=0;for(let G=0;G<r;++G)l+=c.getUint32(l,!0),l+=Rge;l+=Rge,l+=2*C4;let u=W.toRadians(c.getFloat64(l,!0)*180);l+=C4;let m=W.toRadians(c.getFloat64(l,!0)*180);l+=C4;let p=i.width/u/2,y=i.height/m/2,f=c.getInt32(l,!0);l+=S4;let x=c.getInt32(l,!0)*3;l+=S4,l+=S4;let _=new Array(f),C=new Array(f),V=new Array(f),L;for(L=0;L<f;++L)_[L]=s+c.getUint8(l++)*p,C[L]=a+c.getUint8(l++)*y,V[L]=c.getFloat32(l,!0)*6371010,l+=fht;let Z=new Array(x);for(L=0;L<x;++L)Z[L]=c.getUint16(l,!0),l+=hht;for(L=0;L<x;L+=3){let G=Z[L],X=Z[L+1],P=Z[L+2],v=_[G],A=_[X],M=_[P],b=C[G],R=C[X],E=C[P],I=Y0.computeBarycentricCoordinates(t,n,v,b,A,R,M,E,Gge);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*V[G]+I.y*V[X]+I.z*V[P]}}var CV=xT;var WAi=T(S(),1);var Hu={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},Kk=new te;function Hk(){this._terrainCache={},this._lastTidy=te.now()}Hk.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:te.now()}};Hk.prototype.get=function(e){let n=this._terrainCache[e];if(d(n))return delete this._terrainCache[e],n.buffer};Hk.prototype.tidy=function(){if(te.now(Kk),te.secondsDifference(Kk,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];te.secondsDifference(Kk,r.timestamp)>10&&delete e[o]}te.clone(Kk,this._lastTidy)}};function ig(e){e=g(e,g.EMPTY_OBJECT),this._tilingScheme=new Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new Hk,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ye}Object.defineProperties(ig.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});ig.fromMetadata=function(e,t){if(!e.terrainPresent)throw new me(`The server ${e.url} doesn't have terrain`);let n=new ig(t);return n._metadata=e,n};var bht=new pi("decodeGoogleEarthEnterprisePacket");function Ege(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Hu.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());d(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}ig.prototype.requestTileGeometry=function(e,t,n,i){let o=K0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!d(a))return Promise.reject(new me("Terrain tile doesn't exist"));let c=a.terrainState;d(c)||(c=a.terrainState=Hu.UNKNOWN);let l=r.get(o);if(d(l)){let C=s.providers[a.terrainProvider];return Promise.resolve(new CV({buffer:l,childTileMask:Ege(o,a,s),credits:d(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Hu.NONE)return Promise.reject(new me("Terrain tile doesn't exist"))}else return Promise.resolve(new Sa({buffer:new Uint8Array(16*16),width:16,height:16}));let u,m=o,p=-1;switch(c){case Hu.SELF:p=a.terrainVersion;break;case Hu.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case Hu.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),d(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new me("Terrain tile doesn't exist"));let y=this._terrainPromises,f=this._terrainRequests,x,_;if(d(y[m]))x=y[m],_=f[m];else{_=i;let C=yht(this,m,p,_).fetchArrayBuffer();if(!d(C))return;x=C.then(function(V){return d(V)?bht.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let Z=s.getTileInformationFromQuadKey(m);Z.terrainState=Hu.SELF,r.add(m,L[0]);let G=Z.terrainProvider,X=L.length-1;for(let P=0;P<X;++P){let v=m+P.toString(),A=s.getTileInformationFromQuadKey(v);d(A)&&(r.add(v,L[P+1]),A.terrainState=Hu.PARENT,A.terrainProvider===0&&(A.terrainProvider=G))}}):Promise.reject(new me("Failed to load terrain."))}),y[m]=x,f[m]=_,x=x.finally(function(){delete y[m],delete f[m]})}return x.then(function(){let C=r.get(o);if(d(C)){let V=s.providers[a.terrainProvider];return new CV({buffer:C,childTileMask:Ege(o,a,s),credits:d(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new me("Failed to load terrain."))}).catch(function(C){return _.state===$n.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=Hu.NONE,Promise.reject(C))})};ig.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ig.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=K0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(d(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Hu.NONE)return!1;if((!d(s)||s===Hu.UNKNOWN)&&(r.terrainState=Hu.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!d(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Uo({throttle:!1,throttleByServer:!0,type:Jr.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};ig.prototype.loadTileDataAvailability=function(e,t,n){};function yht(e,t,n,i){return n=d(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var V4=ig;var FAi=T(S(),1);var zk={};zk.defaultApiKey=void 0;zk.mapTilesApiEndpoint=new Ee({url:"https://tile.googleapis.com/v1/"});zk.getDefaultCredit=function(){return new St('<img src="https://assets.ion-development.cesium.com/google-credit.png" alt="Google">',!0)};var _T=zk;var NAi=T(S(),1);var lF={};lF.type=void 0;lF.getRequiredDataPoints=fe.throwInstantiationError;lF.interpolateOrderZero=fe.throwInstantiationError;lF.interpolate=fe.throwInstantiationError;var L4=lF;var e9i=T(S(),1);var KAi=T(S(),1);function R4(e){this._url=Ee.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(R4.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});R4.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===ng.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(d(s))r=de.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var dF=R4;function Z4(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.accessToken,bm.defaultAccessToken),n=Ee.createIfNeeded(g(e.server,bm.defaultServer));n.appendForwardSlash();let i=bm.getDefaultTokenCredit(t);d(i)&&e.scene.frameState.creditDisplay.addStaticCredit(St.clone(i));let o=n.getDerivedResource({url:"v1/geocode"});d(t)&&o.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new dF(o)}Object.defineProperties(Z4.prototype,{credit:{get:function(){}}});Z4.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var uF=Z4;var i9i=T(S(),1);function Jk(){fe.throwInstantiationError()}Object.defineProperties(Jk.prototype,{ellipsoid:{get:fe.throwInstantiationError}});Jk.prototype.project=fe.throwInstantiationError;Jk.prototype.unproject=fe.throwInstantiationError;var G4=Jk;var c9i=T(S(),1);function VV(e){e=g(e,g.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(VV.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});VV.prototype.findTimeInterval=ro.prototype.findTimeInterval;VV.prototype.wrapTime=ro.prototype.wrapTime;VV.prototype.clampTime=ro.prototype.clampTime;VV.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);d(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var E4=VV;var y9i=T(S(),1);function X4(e,t,n){e=Ee.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=g(n,{}),this._credit=new St('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(X4.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});X4.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(d(r))o=de.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var I4=X4;var _9i=T(S(),1);var ght={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},W4=ght;var C9i=T(S(),1);var xht={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},P4=xht;var R9i=T(S(),1);function Xge(){fe.throwInstantiationError()}Xge.prototype.getURL=fe.throwInstantiationError;var v4=Xge;var B9i=T(S(),1);function _ht(e,t,n,i,o,r,s){let a=Xi.numberOfPoints(e,t,o),c,l=n.red,u=n.green,m=n.blue,p=n.alpha,y=i.red,f=i.green,x=i.blue,_=i.alpha;if(B.equals(n,i)){for(c=0;c<a;c++)r[s++]=B.floatToByte(l),r[s++]=B.floatToByte(u),r[s++]=B.floatToByte(m),r[s++]=B.floatToByte(p);return s}let C=(y-l)/a,V=(f-u)/a,L=(x-m)/a,Z=(_-p)/a,G=s;for(c=0;c<a;c++)r[G++]=B.floatToByte(l+c*C),r[G++]=B.floatToByte(u+c*V),r[G++]=B.floatToByte(m+c*L),r[G++]=B.floatToByte(p+c*Z);return G}function mF(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=g(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=g(e.arcType,Jt.GEODESIC),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=g(e.ellipsoid,re.WGS84),this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=d(n)?1+n.length*B.packedLength:1,this.packedLength=o+re.packedLength+3}mF.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=d(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};mF.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=re.unpack(e,t);t+=re.packedLength;let c=e[t++]===1,l=e[t++],u=e[t];return d(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=l,n._granularity=u,n):new mF({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:l,granularity:u})};var Qk=new Array(2),jk=new Array(2),Tht={positions:Qk,height:jk,ellipsoid:void 0,minDistance:void 0,granularity:void 0};mF.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=d(n)&&!i,l,u=t.length,m,p,y,f,x=0;if(o===Jt.GEODESIC||o===Jt.RHUMB){let Z,G,X;o===Jt.GEODESIC?(Z=W.chordLength(r,s.maximumRadius),G=Xi.numberOfPoints,X=Xi.generateArc):(Z=r,G=Xi.numberOfPointsRhumbLine,X=Xi.generateRhumbArc);let P=Xi.extractHeights(t,s),v=Tht;if(o===Jt.GEODESIC?v.minDistance=a:v.granularity=r,v.ellipsoid=s,c){let A=0;for(l=0;l<u-1;l++)A+=G(t[l],t[l+1],Z)+1;m=new Float64Array(A*3),y=new Uint8Array(A*4),v.positions=Qk,v.height=jk;let M=0;for(l=0;l<u-1;++l){Qk[0]=t[l],Qk[1]=t[l+1],jk[0]=P[l],jk[1]=P[l+1];let b=X(v);if(d(n)){let R=b.length/3;f=n[l];for(let E=0;E<R;++E)y[M++]=B.floatToByte(f.red),y[M++]=B.floatToByte(f.green),y[M++]=B.floatToByte(f.blue),y[M++]=B.floatToByte(f.alpha)}m.set(b,x),x+=b.length}}else if(v.positions=t,v.height=P,m=new Float64Array(X(v)),d(n)){for(y=new Uint8Array(m.length/3*4),l=0;l<u-1;++l){let M=t[l],b=t[l+1],R=n[l],E=n[l+1];x=_ht(M,b,R,E,a,y,x)}let A=n[u-1];y[x++]=B.floatToByte(A.red),y[x++]=B.floatToByte(A.green),y[x++]=B.floatToByte(A.blue),y[x++]=B.floatToByte(A.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),y=d(n)?new Uint8Array(p*4):void 0;let Z=0,G=0;for(l=0;l<u;++l){let X=t[l];if(c&&l>0&&(h.pack(X,m,Z),Z+=3,f=n[l-1],y[G++]=B.floatToByte(f.red),y[G++]=B.floatToByte(f.green),y[G++]=B.floatToByte(f.blue),y[G++]=B.floatToByte(f.alpha)),c&&l===u-1)break;h.pack(X,m,Z),Z+=3,d(n)&&(f=n[l],y[G++]=B.floatToByte(f.red),y[G++]=B.floatToByte(f.green),y[G++]=B.floatToByte(f.blue),y[G++]=B.floatToByte(f.alpha))}}let _=new hn;_.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),d(n)&&(_.color=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0})),p=m.length/3;let C=(p-1)*2,V=Ue.createTypedArray(p,C),L=0;for(l=0;l<p-1;++l)V[L++]=l,V[L++]=l+1;return new dt({attributes:_,indices:V,primitiveType:Fe.LINES,boundingSphere:ce.fromPoints(t)})};var w4=mF;var Q9i=T(S(),1);function LV(e){let t=g(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Is(i),this._workerName="createSphereGeometry"}LV.packedLength=Is.packedLength;LV.pack=function(e,t,n){return Is.pack(e._ellipsoidGeometry,t,n)};var Sht=new Is,og={radius:void 0,radii:new h,vertexFormat:new We,stackPartitions:void 0,slicePartitions:void 0};LV.unpack=function(e,t,n){let i=Is.unpack(e,t,Sht);return og.vertexFormat=We.clone(i._vertexFormat,og.vertexFormat),og.stackPartitions=i._stackPartitions,og.slicePartitions=i._slicePartitions,d(n)?(h.clone(i._radii,og.radii),n._ellipsoidGeometry=new Is(og),n):(og.radius=i._radii.x,new LV(og))};LV.createGeometry=function(e){return Is.createGeometry(e._ellipsoidGeometry)};var F4=LV;var $9i=T(S(),1);function rg(e){}Object.defineProperties(rg.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});rg.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;rg.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;rg.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;rg.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;rg.prototype.tileXYToRectangle=fe.throwInstantiationError;rg.prototype.positionToTileXY=fe.throwInstantiationError;var A4=rg;var pMi=T(S(),1);function Cht(e,t){this.rectangle=e,this.maxLevel=t}function Ige(e){this.ellipsoid=g(e.ellipsoid,re.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Ige.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function Vht(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Di({ellipsoid:e.ellipsoid});else throw new me(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Ur.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),l=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),m=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Cht(new de(a,c,l,u),m))}}function Lht(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw d(t)&&d(t.message)&&(i=`${i}: ${t.message}`),Vo.reportError(void 0,n,d(n)?n._errorEvent:void 0,i),new me(i)}async function Rht(e,t,n){try{let i=await t.fetchXML();Vht(e,i)}catch(i){Lht(t,i,n)}}function sg(e){e=g(e,g.EMPTY_OBJECT),this._errorEvent=new ye,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(sg.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});sg.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=new Ige(t),i=Ee.createIfNeeded(e);await Rht(n,i);let o=new sg(t);return n.build(o),o._resource=i,o};sg.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!d(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Sa({buffer:nm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Zht(a,e,t,n),structure:a._terrainDataStructure})})};sg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Wge=new de;function Zht(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let l=r[c];if(l.maxLevel<=i)continue;let u=l.rectangle,m=de.intersection(u,s,Wge);d(m)&&(qk(o,u,t*2,n*2,i+1)&&(a|=4),qk(o,u,t*2+1,n*2,i+1)&&(a|=8),qk(o,u,t*2,n*2+1,i+1)&&(a|=1),qk(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function qk(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return d(de.intersection(r,t,Wge))}sg.prototype.getTileDataAvailable=function(e,t,n){};sg.prototype.loadTileDataAvailability=function(e,t,n){};var M4=sg;var SMi=T(S(),1);function TT(e){e=g(e,g.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=g(e.epoch,Ye.MINIMUM_VALUE),this.tolerance=g(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(TT.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(d(t)&&(this._clockSubscription(),this._clockSubscription=void 0),d(e)&&(this._clockSubscription=e.onTick.addEventListener(TT.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(d(t)&&t.removeEventListener("seeked",this._seekFunction,!1),d(e)&&(this._seeking=!1,this._seekFunction=Ght(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});TT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};TT.prototype.isDestroyed=function(){return!1};TT.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};TT.prototype._onTick=function(e){let t=this._element;if(!d(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=g(this.epoch,Ye.MINIMUM_VALUE),s=te.secondsDifference(o,r),a=t.duration,c,l=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?g(this.tolerance,1):.001;Math.abs(c-l)>u&&(this._seeking=!0,t.currentTime=c)};function Ght(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var N4=TT;var VMi=T(S(),1),Eht={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},U4=Object.freeze(Eht);var GMi=T(S(),1);function Xht(e){return e=g(e,g.EMPTY_OBJECT),sF.fromIonAssetId(1,{requestVertexNormals:g(e.requestVertexNormals,!1),requestWaterMask:g(e.requestWaterMask,!1)})}var ST=Xht;var IMi=T(S(),1);var Iht=1953029805,Wht=2917034100;function k4(e,t){if(k4.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new me("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===Iht||o===Wht)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,l=n,u,m=8;for(;s<c;)for(m=(m+8)%24,u=m;s<c&&u<l;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=l&&(m=(m+8)%24,u=m);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}k4.passThroughDataForTesting=!1;var hF=k4;var PMi=T(S(),1);function Pht(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var fF=Pht;var MMi=T(S(),1);var vht=new h;function wht(e,t,n,i){let o=Yg(e,t,n,i,vht);return d(o)?o.x>0&&o.y>0&&o.z>0:!1}var D4=wht;var kMi=T(S(),1);function Fht(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var B4=Fht;var BMi=T(S(),1);function Aht(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var pF=Aht;var zMi=T(S(),1);var Mht=new h(1,1,1);function Y4(e){e=g(e,Mht),this._dimensions=h.clone(e)}Object.defineProperties(Y4.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var Nht=new h;Y4.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,Nht),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var O4=Y4;var jMi=T(S(),1);function H0(){this.featurePropertiesDirty=!1}Object.defineProperties(H0.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});H0.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};H0.prototype.getFeature=function(e){fe.throwInstantiationError()};H0.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};H0.prototype.applyStyle=function(e){fe.throwInstantiationError()};H0.prototype.update=function(e,t){fe.throwInstantiationError()};H0.prototype.isDestroyed=function(){fe.throwInstantiationError()};H0.prototype.destroy=function(){fe.throwInstantiationError()};var K4=H0;var d5i=T(S(),1);var n5i=T(S(),1);function RV(e,t){this._conditionsExpression=Oe(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,kht(this,t)}Object.defineProperties(RV.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Uht(e,t){this.condition=e,this.expression=t}function kht(e,t){let n=[],i=e._conditions;if(!d(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new Uht(new nu(a,t),new nu(c,t)))}e._runtimeConditions=n}RV.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!d(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};RV.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!d(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};RV.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!d(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],l=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=`    ${a===0?"if":"else if"} (${l})
    {
        return ${u};
    }
`}return r=`${i} ${e}
{
${r}    return ${i}(1.0);
}
`,r};RV.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!d(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var bF=RV;function ag(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,Dht(this,e)}function Dht(e,t){t=g(Oe(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(d(t.meta)){let i=t.defines,o=g(t.meta,g.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new nu(o[r],i))}e._meta=n,e._ready=!0}function qo(e,t){let n=g(e._style,g.EMPTY_OBJECT).defines;if(d(t)){if(typeof t=="boolean"||typeof t=="number")return new nu(String(t));if(typeof t=="string")return new nu(t,n);if(d(t.conditions))return new bF(t,n)}else return;return t}function $o(e){if(d(e)){if(d(e.expression))return e.expression;if(d(e.conditionsExpression))return Oe(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(ag.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=qo(this,e),this._style.show=$o(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=qo(this,e),this._style.color=$o(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=qo(this,e),this._style.pointSize=$o(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=qo(this,e),this._style.pointOutlineColor=$o(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=qo(this,e),this._style.pointOutlineWidth=$o(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=qo(this,e),this._style.labelColor=$o(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=qo(this,e),this._style.labelOutlineColor=$o(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=qo(this,e),this._style.labelOutlineWidth=$o(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=qo(this,e),this._style.font=$o(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=qo(this,e),this._style.labelStyle=$o(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=qo(this,e),this._style.labelText=$o(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=qo(this,e),this._style.backgroundColor=$o(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=qo(this,e),this._style.backgroundPadding=$o(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=qo(this,e),this._style.backgroundEnabled=$o(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=qo(this,e),this._style.scaleByDistance=$o(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=qo(this,e),this._style.translucencyByDistance=$o(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=qo(this,e),this._style.distanceDisplayCondition=$o(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=qo(this,e),this._style.heightOffset=$o(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=qo(this,e),this._style.anchorLineEnabled=$o(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=qo(this,e),this._style.anchorLineColor=$o(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=qo(this,e),this._style.image=$o(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=qo(this,e),this._style.disableDepthTestDistance=$o(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=qo(this,e),this._style.horizontalOrigin=$o(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=qo(this,e),this._style.verticalOrigin=$o(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=qo(this,e),this._style.labelHorizontalOrigin=$o(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=qo(this,e),this._style.labelVerticalOrigin=$o(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});ag.fromUrl=function(e){return Ee.createIfNeeded(e).fetchJson(e).then(function(n){return new ag(n)})};ag.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,d(this.color)&&d(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};ag.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,d(this.show)&&d(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};ag.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,d(this.pointSize)&&d(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};ag.prototype.getVariables=function(){let e=[];return d(this.color)&&d(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),d(this.show)&&d(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),d(this.pointSize)&&d(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var CT=ag;var RNi=T(S(),1);var f5i=T(S(),1);function yF(e){e=g(e,g.EMPTY_OBJECT),this._maximumSubtreeCount=g(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new gT({comparator:yF.comparator})}yF.prototype.addSubtree=function(e){let t=new Bht(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};yF.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};yF.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function Bht(e,t){this.subtree=e,this.stamp=t}var gF=yF;var C5i=T(S(),1);function Ml(){this.orientedBoundingBox=new Wn,this.boundingSphere=new ce,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=h.clone(Ml.DefaultMinBounds,new h),this._maxBounds=h.clone(Ml.DefaultMaxBounds,new h),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Yht=new h,H4=new h,Oht=new $,Kht=new h,Hht=new h,zht=new h,Jht=new h,Pge=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F);Ml.prototype.update=function(e,t,n,i,o){i=g(i,Ml.DefaultMinBounds),o=g(o,Ml.DefaultMaxBounds);let r=Ml.DefaultMinBounds,s=Ml.DefaultMaxBounds;t=this._minBounds=h.clamp(t,r,s,this._minBounds),n=this._maxBounds=h.clamp(n,r,s,this._maxBounds),i=h.clamp(i,r,s,Kht),o=h.clamp(o,r,s,Hht);let a=h.clamp(t,i,o,zht),c=h.clamp(n,i,o,Jht),l=F.getScale(e,H4);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||l.x===0||l.y===0||l.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=vge(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:m}=this;for(let f in m)m.hasOwnProperty(f)&&(m[f]=void 0);let p=!h.equals(t,r)||!h.equals(n,s),y=0;if(m.BOX_INTERSECTION_INDEX=y,y+=1,u.renderMinBounds=F.multiplyByPoint(Pge,a,u.renderMinBounds),u.renderMaxBounds=F.multiplyByPoint(Pge,c,u.renderMaxBounds),p){m.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,x=n;u.boxUvToShapeUvScale=h.fromElements(2/(f.x===x.x?1:x.x-f.x),2/(f.y===x.y?1:x.y-f.y),2/(f.z===x.z?1:x.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=h.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=y,!0};var Qht=new h,jht=new h;Ml.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),Qht),l=h.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),jht);return vge(c,l,this.shapeTransform,o)};Ml.prototype.computeApproximateStepSize=function(e){return 1/h.maximumComponent(e)};Ml.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Ml.DefaultMaxBounds=Object.freeze(new h(1,1,1));function vge(e,t,n,i){let o=Ml.DefaultMinBounds,r=Ml.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,H4),c=h.midpoint(e,t,Yht);i.center=F.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),H4);let l=F.getRotation(n,Oht);i.halfAxes=$.setScale(l,a,i.halfAxes)}return i}var Af=Ml;var G5i=T(S(),1);function $k(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties($k.prototype,{metadataTable:{get:function(){return this._metadataTable}}});$k.fromJson=async function(e,t,n,i){let o;d(t)?o={json:t,binary:void 0}:o=$ht(n);let r=await qht(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let m=0;m<a;++m){let p=o.json.bufferViews[m],y=p.byteOffset,f=y+p.byteLength,_=r[p.buffer].subarray(y,f);s[m]=_}let c=o.json.voxelTable,l=o.json.propertyTables[c],u=new $k(e);return u._metadataTable=new bl({count:l.count,properties:l.properties,class:i.classes[l.class],bufferViews:s}),u};function qht(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(d(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(l){return new Uint8Array(l)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function $ht(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Go(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var xF=$k;var N5i=T(S(),1);function Dr(){this.orientedBoundingBox=new Wn,this.boundingSphere=new ce,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=Dr.DefaultMinBounds.x,this._maximumRadius=Dr.DefaultMaxBounds.x,this._minimumHeight=Dr.DefaultMinBounds.y,this._maximumHeight=Dr.DefaultMaxBounds.y,this._minimumAngle=Dr.DefaultMinBounds.z,this._maximumAngle=Dr.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new h,cylinderUvToRenderBoundsTranslate:new h,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvHeight:new D,cylinderUvToShapeUvAngle:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var Fge=new h,eft=new h,tft=new h,nft=new $,ift=new F,oft=new F,rft=F.fromRotationTranslation($.fromUniformScale(2,new $),new h(-1,-1,-1),new F);Dr.prototype.update=function(e,t,n,i,o){i=g(i,Dr.DefaultMinBounds),o=g(o,Dr.DefaultMaxBounds);let r=Dr.DefaultMinBounds.x,s=Dr.DefaultMaxBounds.x,a=Dr.DefaultMinBounds.y,c=Dr.DefaultMaxBounds.y,l=Dr.DefaultMinBounds.z,u=Dr.DefaultMaxBounds.z,m=u-l,p=.5*m,y=W.EPSILON10,f=W.EPSILON3,x=W.EPSILON10,_=W.clamp(t.x,r,s),C=W.clamp(n.x,r,s),V=W.clamp(i.x,r,s),L=W.clamp(o.x,r,s),Z=Math.max(_,V),G=Math.min(C,L),X=W.clamp(t.y,a,c),P=W.clamp(n.y,a,c),v=W.clamp(i.y,a,c),A=W.clamp(o.y,a,c),M=Math.max(X,v),b=Math.min(P,A),R=W.negativePiToPi(t.z),E=W.negativePiToPi(n.z),I=W.negativePiToPi(i.z),w=W.negativePiToPi(o.z),N=Math.max(R,I),Y=Math.min(E,w),k=F.getScale(e,Fge);if(G===0||Z>G||M>b||W.equalsEpsilon(k.x,0,void 0,y)||W.equalsEpsilon(k.y,0,void 0,y)||W.equalsEpsilon(k.z,0,void 0,y))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=X,this._maximumHeight=P,this._minimumAngle=R,this._maximumAngle=E,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=J4(Z,G,M,b,N,Y,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let J=_===r&&C===s,z=X===a&&P===c,ee=E<R,K=E-R+ee*m,j=K>p+x&&K<m-x,q=K>x&&K<p-x,be=K>=p-x&&K<=p+x,Te=K<=x,ae=j||q||be||Te,xe=W.equalsEpsilon(R,l,void 0,f),_e=W.equalsEpsilon(E,u,void 0,f),Ve=G===s,Ie=Z===r,Me=M===a&&b===c,ve=Y<N,ke=Y-N+ve*m,ct=ke>p+x&&ke<m-x,yt=ke>x&&ke<p-x,ot=ke>=p-x&&ke<=p+x,ln=ke<=x,vn=ct||yt||ot||ln,Dt=this.shaderUniforms,Nt=this.shaderDefines;for(let Ce in Nt)Nt.hasOwnProperty(Ce)&&(Nt[Ce]=void 0);let pe=0;if(Nt.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=pe,pe+=1,Ie||(Nt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Nt.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=pe,pe+=1,Dt.cylinderUvToRenderRadiusMin=G/Z),Ve||(Nt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),Z===G&&(Nt.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Me||(Nt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),M===b&&(Nt.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),X===P&&(Nt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),_===C&&(Nt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!J){Nt.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Ce=1/(C-_),Ht=_/(_-C);Dt.cylinderUvToShapeUvRadius=D.fromElements(Ce,Ht,Dt.cylinderUvToShapeUvRadius)}if(!z){Nt.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Ce=2/(P-X),Ht=(X+1)/(X-P);Dt.cylinderUvToShapeUvHeight=D.fromElements(Ce,Ht,Dt.cylinderUvToShapeUvHeight)}if(!Ve||!Me){let Ce=.5*(b-M),Ht=h.fromElements(1/G,1/G,1/(Ce===0?1:Ce),tft),ut=h.fromElements(0,0,-Ht.z*.5*(M+b),eft),hi=F.fromRotationTranslation($.fromScale(Ht,nft),ut,ift),ji=F.multiplyTransformation(hi,rft,oft);Dt.cylinderUvToRenderBoundsScale=F.getScale(ji,Dt.cylinderUvToRenderBoundsScale),Dt.cylinderUvToRenderBoundsTranslate=F.getTranslation(ji,Dt.cylinderUvToRenderBoundsTranslate)}if(ee&&(Nt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),vn&&(Nt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Nt.CYLINDER_INTERSECTION_INDEX_ANGLE=pe,ct?(Nt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,pe+=1):yt?(Nt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,pe+=2):ot?(Nt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,pe+=1):ln&&(Nt.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,pe+=2),Dt.cylinderRenderAngleMinMax=D.fromElements(N,Y,Dt.cylinderAngleMinMax)),ae){Nt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,Te&&(Nt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),xe&&(Nt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),_e&&(Nt.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Ce=(R-l)/m,Ht=(E-l)/m,ut=1-K/m;Dt.cylinderShapeUvAngleMinMax=D.fromElements(Ce,Ht,Dt.cylinderShapeUvAngleMinMax),Dt.cylinderShapeUvAngleRangeZeroMid=(Ht+.5*ut)%1;let hi=m/K,ji=-(R-l)/K;Dt.cylinderUvToShapeUvAngle=D.fromElements(hi,ji,Dt.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=pe,!0};Dr.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,l=this._minimumAngle,u=this._maximumAngle,m=1/Math.pow(2,e),p=W.lerp(r,s,t*m),y=W.lerp(r,s,(t+1)*m),f=W.lerp(a,c,n*m),x=W.lerp(a,c,(n+1)*m),_=W.lerp(l,u,i*m),C=W.lerp(l,u,(i+1)*m);return J4(p,y,f,x,_,C,this.shapeTransform,o)};var sft=new Wn,aft=new h,cft=new h,lft=new h;Dr.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,o=this._minimumHeight,r=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,l=1-1/e.y,u=1-1/e.z,m=W.lerp(n,i,c),p=W.lerp(o,r,l),y=W.lerp(s,a,u),C=J4(m,i,p,r,y,a,t,sft),V=$.getScale(C.halfAxes,aft),L=F.getScale(t,cft),Z=h.divideComponents(V,L,lft);return h.minimumComponent(Z)};Dr.DefaultMinBounds=Object.freeze(new h(0,-1,-W.PI));Dr.DefaultMaxBounds=Object.freeze(new h(1,1,+W.PI));var dft=5,uft=new Array(dft),mft=new h,hft=new $,fft=new F,pft=new F,bft=new F,z4=new F,yft=new h,gft=new h,xft=new h,Age=new Array(8);for(let e=0;e<8;e++)Age[e]=new h;function wge(e,t,n){return Math.abs(se.dot(e,t))<n}function _ft(e){let t=F.getColumn(e,0,yft),n=F.getColumn(e,1,gft),i=F.getColumn(e,2,xft),o=W.EPSILON4;return wge(t,n,o)&&wge(n,i,o)}function Tft(e,t){let n=Age;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return Wn.fromPoints(n,t)}function J4(e,t,n,i,o,r,s,a){let c=Dr.DefaultMinBounds,l=Dr.DefaultMaxBounds,u=c.x,m=l.x,p=c.y,y=l.y,f=c.z,x=l.z;if(e===u&&t===m&&n===p&&i===y&&o===f&&r===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;r<o&&(r+=W.TWO_PI);let C=r-o,V=o+C*.5,L=uft,Z=0;L[Z++]=o,L[Z++]=r,L[Z++]=V,C>W.PI&&(L[Z++]=V-W.PI_OVER_TWO,L[Z++]=V+W.PI_OVER_TWO);let G=1,X=1,P=-1,v=-1;for(let ee=0;ee<Z;++ee){let K=L[ee]-V,j=Math.cos(K),q=Math.sin(K),be=j*e,Te=q*e,ae=j*t,xe=q*t;G=Math.min(G,be),X=Math.min(X,Te),G=Math.min(G,ae),X=Math.min(X,xe),P=Math.max(P,be),v=Math.max(v,Te),P=Math.max(P,ae),v=Math.max(v,xe)}let A=P-G,M=v-X,b=i-n,R=(G+P)*.5,E=(X+v)*.5,I=(n+i)*.5,w=h.fromElements(R,E,I,mft),N=$.fromRotationZ(V,hft),Y=h.fromElements(A,M,b,Fge),k=F.fromScale(Y,bft),O=F.fromRotation(N,pft),U=F.fromTranslation(w,fft),J=F.multiplyTransformation(O,F.multiplyTransformation(U,k,z4),z4),z=F.multiplyTransformation(s,J,z4);return _ft(z)?Wn.fromTransformation(z,a):Tft(z,a)}var Mf=Dr;var nNi=T(S(),1);var j5i=T(S(),1);function Nl(){this.orientedBoundingBox=new Wn,this.boundingSphere=new ce,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new de,this._minimumHeight=Nl.DefaultMinBounds.z,this._maximumHeight=Nl.DefaultMaxBounds.z,this._ellipsoid=new re,this._translation=new h,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new h,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeCosSqrHalfMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new D,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var Sft=new h,Cft=new $,Mge=new h,Nge=new h,Uge=new h,kge=new h,Vft=new de;Nl.prototype.update=function(e,t,n,i,o){i=g(i,Nl.DefaultMinBounds),o=g(o,Nl.DefaultMaxBounds);let r=Nl.DefaultMinBounds.x,s=Nl.DefaultMaxBounds.x,a=s-r,c=.5*a,l=Nl.DefaultMinBounds.y,u=Nl.DefaultMaxBounds.y,m=u-l,p=W.EPSILON10,y=W.EPSILON3,f=W.EPSILON10,x=W.EPSILON10,_=W.EPSILON3,C=W.clamp(t.x,r,s),V=W.clamp(n.x,r,s),L=W.clamp(i.x,r,s),Z=W.clamp(o.x,r,s),G=Math.max(C,L),X=Math.min(V,Z),P=W.clamp(t.y,l,u),v=W.clamp(n.y,l,u),A=W.clamp(i.y,l,u),M=W.clamp(o.y,l,u),b=Math.max(P,A),R=Math.min(v,M),E=F.getScale(e,Sft),I=E.x===E.y&&E.y===E.z,w=h.minimumComponent(E),N=Math.max(t.z,-w),Y=Math.max(n.z,-w),k=Math.max(i.z,-w),O=Math.max(o.z,-w),U=Math.max(N,k),J=Math.min(Y,O),z=h.add(E,h.fromElements(N,N,N,Nge),Nge),ee=h.add(E,h.fromElements(Y,Y,Y,Mge),Mge),K=h.maximumComponent(ee),j=h.add(E,h.fromElements(U,U,U,kge),kge),q=h.add(E,h.fromElements(J,J,J,Uge),Uge);if(b>R||b===u||R===l||U>J||W.equalsEpsilon(q,h.ZERO,void 0,p))return!1;this._rectangle=de.fromRadians(C,P,V,v),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(E,this._ellipsoid),this._minimumHeight=N,this._maximumHeight=Y;let be=de.fromRadians(G,b,X,R,Vft);this.orientedBoundingBox=Dge(be,U,J,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,ee,Cft),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let Te=X<G,ae=X-G+Te*a,xe=ae<=f,_e=ae>c+f&&ae<a-f,Ve=ae>=c-f&&ae<=c+f,Ie=ae>f&&ae<c-f,Me=xe||_e||Ve||Ie,ve=V<C,ke=V-C+ve*a,ct=ke<=f,yt=ke>c+f&&ke<a-f,ot=ke>=c-f&&ke<=c+f,ln=ke>f&&ke<c-f,vn=ct||yt||ot||ln,Dt=R<-_,Nt=R>=-_&&R<=+_,pe=R>+_&&R<u-x,Ce=Dt||Nt||pe,Ht=b>l+x&&b<-_,ut=b>=-_&&b<=+_,hi=b>+_,ji=Ht||ut||hi,pc=Ce||ji,bs=v-P,ys=v<-_,$r=v>=-_&&v<=+_,we=v>+_&&v<u-x,je=ys||$r||we,qe=P>l+x&&P<-_,Qe=P>=-_&&P<=+_,pt=P>+_,Vn=je||(qe||Qe||pt),di=!h.equals(j,h.ZERO),bo=!h.equals(q,h.ZERO),es=di||bo,ts=J-U,Mo=!h.equals(z,h.ZERO),Ki=!h.equals(ee,h.ZERO),ns=Mo||Ki,zn=this.shaderUniforms,wn=this.shaderDefines;for(let _i in wn)wn.hasOwnProperty(_i)&&(wn[_i]=void 0);zn.ellipsoidRadiiUv=h.divideByScalar(ee,K,zn.ellipsoidRadiiUv),zn.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(zn.ellipsoidRadiiUv,zn.ellipsoidRadiiUv,zn.ellipsoidInverseRadiiSquaredUv),zn.ellipsoidInverseRadiiSquaredUv);let mn=0;if(wn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=mn,mn+=1,es&&(ts===0&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),di&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,wn.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=mn,mn+=1,zn.ellipsoidInverseInnerScaleUv=K/(K-(Y-U))),bo&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,zn.ellipsoidInverseOuterScaleUv=K/(K-(Y-J)))),ns){if(Mo){wn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let _i=(Y-N)/K;zn.ellipsoidInverseHeightDifferenceUv=1/_i,zn.ellipseInnerRadiiUv=D.fromElements(zn.ellipsoidRadiiUv.x*(1-_i),zn.ellipsoidRadiiUv.z*(1-_i),zn.ellipseInnerRadiiUv)}N===Y&&(wn.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(Me&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,wn.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=mn,_e?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,mn+=1):Ie?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,mn+=2):Ve?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,mn+=1):xe&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,mn+=2),zn.ellipsoidRenderLongitudeMinMax=D.fromElements(G,X,zn.ellipsoidRenderLongitudeMinMax)),vn){wn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,V<C&&(wn.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let ui=a/ke,As=-(C-r)/ke;zn.ellipsoidUvToShapeUvLongitude=D.fromElements(ui,As,zn.ellipsoidUvToShapeUvLongitude)}if(Me){let _i=W.equalsEpsilon(G,r,void 0,y),ui=W.equalsEpsilon(X,s,void 0,y);_i&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),ui&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let As=(C-r)/a,fi=(V-r)/a,vr=(X-r)/a,Sh=1-ae/a,cr=(vr+.5*Sh)%1;zn.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(As,fi,cr,zn.ellipsoidShapeUvLongitudeMinMaxMid)}if(pc){wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,ji&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,wn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=mn,Ht?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,mn+=1):ut?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,mn+=1):hi&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,mn+=2)),Ce&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,wn.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=mn,Dt?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,mn+=2):Nt?(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,mn+=1):pe&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,mn+=1)),b===R&&(wn.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let _i=Math.pow(Math.cos(W.PI_OVER_TWO-Math.abs(b)),2),ui=Math.pow(Math.cos(W.PI_OVER_TWO-Math.abs(R)),2);zn.ellipsoidRenderLatitudeCosSqrHalfMinMax=D.fromElements(_i,ui,zn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(Vn){wn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,P===v&&(wn.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let _i=m/bs,ui=(l-P)/bs;zn.ellipsoidUvToShapeUvLatitude=D.fromElements(_i,ui,zn.ellipsoidUvToShapeUvLatitude)}return I&&(wn.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=mn,!0};var Lft=new de;Nl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,l=(n+1)*r,u=i*r,m=(i+1)*r,p=de.subsection(this._rectangle,s,c,a,l,Lft),y=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return Dge(p,y,f,this._ellipsoid,this._translation,this._rotation,o)};Nl.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,o=this._maximumHeight;return .5*((o-i)/(n+o))/e.z};function Dge(e,t,n,i,o,r,s){return s=Wn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}Nl.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-Number.MAX_VALUE));Nl.DefaultMaxBounds=Object.freeze(new h(+W.PI,+W.PI_OVER_TWO,+Number.MAX_VALUE));var VT=Nl;var Fd={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Fd.getMinBounds=function(e){switch(e){case Fd.BOX:return Af.DefaultMinBounds;case Fd.ELLIPSOID:return VT.DefaultMinBounds;case Fd.CYLINDER:return Mf.DefaultMinBounds}};Fd.getMaxBounds=function(e){switch(e){case Fd.BOX:return Af.DefaultMaxBounds;case Fd.ELLIPSOID:return VT.DefaultMaxBounds;case Fd.CYLINDER:return Mf.DefaultMaxBounds}};Fd.getShapeConstructor=function(e){switch(e){case Fd.BOX:return Af;case Fd.ELLIPSOID:return VT;case Fd.CYLINDER:return Mf}};var Oi=Object.freeze(Fd);function eD(e){e=g(e,g.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new gF}eD.fromUrl=async function(e){let t=Ee.createIfNeeded(e),n=await t.fetchJson();Zft(n);let i=Wft(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,l=new c_({metadataJson:a,schema:c}),u=new eD;Pft(u,l,s);let m=new d_(t,o,c),{shape:p,minBounds:y,maxBounds:f,shapeTransform:x,globalTransform:_}=Gft(o);u.shape=p,u.minBounds=y,u.maxBounds=f,u.dimensions=h.unpack(r.dimensions),u.shapeTransform=x,u.globalTransform=_,u.maximumTileCount=Rft(l);let C,V;return d(r.padding)&&(C=h.unpack(r.padding.before),V=h.unpack(r.padding.after)),u.paddingBefore=C,u.paddingAfter=V,u._implicitTileset=m,Bi.unload(i),u};function Rft(e){if(d(e.tileset))return e.tileset.getPropertyBySemantic(Wx.TILESET_TILE_COUNT)}function Zft(e){let t=e.root;if(!d(t.content))throw new me("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new me("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!d(t.implicitTiling))throw new me("Root tile must have implicit tiling");if(!d(e.schema)&&!d(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new me("Tileset must have a metadata schema")}function Gft(e){let t=e.boundingVolume,n;if(d(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),d(t.box))return Xft(t.box,n);if(d(t.region))return Eft(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return Ift(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new me("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Eft(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(re.WGS84.radii),c=t,l=i,u=n,m=o,p=r,y=s,f=new h(c,u,p),x=new h(l,m,y);return{shape:Oi.ELLIPSOID,minBounds:f,maxBounds:x,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function Xft(e,t){let n=Wn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Oi.BOX,minBounds:h.clone(Af.DefaultMinBounds),maxBounds:h.clone(Af.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Ift(e,t){let n=Wn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Oi.CYLINDER,minBounds:h.clone(Mf.DefaultMinBounds),maxBounds:h.clone(Mf.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Wft(e,t){let{schemaUri:n,schema:i}=e;return d(n)?Bi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Bi.getSchemaLoader({schema:i})}function Pft(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([m,p])=>{let{type:y,componentType:f}=p,x=r?.properties[m].min,_=r?.properties[m].max,C=Ot.getComponentCount(y),V=Bge(x,C),L=Bge(_,C);return{id:m,type:y,componentType:f,minValue:V,maxValue:L}});e.names=a.map(m=>m.id),e.types=a.map(m=>m.type),e.componentTypes=a.map(m=>m.componentType);let c=a.map(m=>m.minValue),l=a.map(m=>m.maxValue),u=c.some(d);e.minimumValues=u?c:void 0,e.maximumValues=u?l:void 0}function Bge(e,t){if(!d(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function vft(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=tf(o);return await xF.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function wft(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(d(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),d(o))return o;let c=tf(a);return o=await Ix.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}eD.prototype.requestData=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.tileLevel,0),n=g(e.tileX,0),i=g(e.tileY,0),o=g(e.tileZ,0);if(g(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new u_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=c.isSubtreeRoot()&&c.level>0,u=l?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return wft(this,u).then(function(p){return(l?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?vft(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(y){return p.metadataTable.getPropertyTypedArray(y)})})};var Q4=eD;var INi=T(S(),1);function j4(e){e=g(e,1),this._radius=g(e,1)}Object.defineProperties(j4.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});j4.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var _F=j4;var TUi=T(S(),1);var PNi=T(S(),1),q4={CUMULUS:0};q4.validate=function(e){return e===q4.CUMULUS};var ZV=Object.freeze(q4);var UNi=T(S(),1);function gh(e,t){if(e=g(e,g.EMPTY_OBJECT),this._show=g(e.show,!0),this._position=h.clone(g(e.position,h.ZERO)),!d(e.scale)&&d(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(g(e.scale,new D(20,12)));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(g(e.maximumSize,n))}this._slice=g(e.slice,-1),this._color=B.clone(g(e.color,B.WHITE)),this._brightness=g(e.brightness,1),this._cloudCollection=t,this._index=-1}var Fft=gh.SHOW_INDEX=0,Aft=gh.POSITION_INDEX=1,Mft=gh.SCALE_INDEX=2,Nft=gh.MAXIMUM_SIZE_INDEX=3,Uft=gh.SLICE_INDEX=4,kft=gh.BRIGHTNESS_INDEX=5,Dft=gh.COLOR_INDEX=6;gh.NUMBER_OF_PROPERTIES=7;function LT(e,t){let n=e._cloudCollection;d(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(gh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,LT(this,Fft))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),LT(this,Aft))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;D.equals(t,e)||(D.clone(e,t),LT(this,Mft))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),LT(this,Nft))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),LT(this,Dft))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,LT(this,Uft))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,LT(this,kft))}}});gh.prototype._destroy=function(){this._cloudCollection=void 0};var Ad=gh;var Md,tD=new h,Bft={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},Yft={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},Oft=Ad.SHOW_INDEX,Kft=Ad.POSITION_INDEX,Hft=Ad.SCALE_INDEX,zft=Ad.MAXIMUM_SIZE_INDEX,Jft=Ad.SLICE_INDEX,Qft=Ad.BRIGHTNESS_INDEX,jft=Ad.NUMBER_OF_PROPERTIES,qft=Ad.COLOR_INDEX;function xh(e){e=g(e,g.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(jft),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=g(e.noiseDetail,16),this.noiseOffset=h.clone(g(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:Yge(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=g(e.show,!0),this._colorCommands=[],this.debugBillboards=g(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=g(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function Yge(e){return function(){return tD.x=e._textureSliceWidth,tD.y=e._noiseTextureRows,tD.z=1/e._noiseTextureRows,tD}}Object.defineProperties(xh.prototype,{length:{get:function(){return ej(this),this._clouds.length}}});function Oge(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}xh.prototype.add=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.cloudType,ZV.CUMULUS),n;return t===ZV.CUMULUS&&(n=new Ad(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};xh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};xh.prototype.removeAll=function(){Oge(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function ej(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];d(s)&&(n._index=r++,t.push(s))}e._clouds=t}}xh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};xh.prototype.contains=function(e){return d(e)&&e._cloudCollection===this};xh.prototype.get=function(e){return ej(this),this._clouds[e]};var $ft=new Float32Array([-1,-1,1,-1,1,1,-1,1]),ept=new Uint16Array([0,1,2,0,2,3]);function tpt(e){let t=mt.createVertexBuffer({context:e,typedArray:$ft,usage:Ne.STATIC_DRAW}),n=mt.createIndexBuffer({context:e,typedArray:ept,usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var tj;function npt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(d(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=mt.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function ipt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return d(t)||(t=mt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function opt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return d(t)||(t=mt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function rpt(e,t,n){let i=[{index:Md.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ne.STATIC_DRAW},{index:Md.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ne.STATIC_DRAW},{index:Md.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ne.STATIC_DRAW},{index:Md.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ne.STATIC_DRAW},{index:Md.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:Md.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:opt(e)});let o=n?t:4*t;return new ip(e,i,o,n)}var $4=new On;function Kge(e,t,n,i){let o,r=n[Md.positionHighAndScaleX],s=n[Md.positionLowAndScaleY],a=i.position;On.fromCartesian(a,$4);let c=i.scale,l=$4.high,u=$4.low;e._instanced?(o=i._index,r(o,l.x,l.y,l.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,l.x,l.y,l.z,c.x),r(o+1,l.x,l.y,l.z,c.x),r(o+2,l.x,l.y,l.z,c.x),r(o+3,l.x,l.y,l.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function Hge(e,t,n,i){let o,r=n[Md.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function zge(e,t,n,i){let o,r=n[Md.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function Jge(e,t,n,i){let o,r=n[Md.color],s=i.color,a=B.floatToByte(s.red),c=B.floatToByte(s.green),l=B.floatToByte(s.blue),u=B.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,l,u)):(o=i._index*4,r(o+0,a,c,l,u),r(o+1,a,c,l,u),r(o+2,a,c,l,u),r(o+3,a,c,l,u))}function spt(e,t,n,i){Kge(e,t,n,i),Hge(e,t,n,i),zge(e,t,n,i),Jge(e,t,n,i)}function apt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=tpt(a),o._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,l=o.noiseOffset;o._noiseTexture=new Wt({context:a,width:r*r/s,height:r*s,pixelDatatype:Je.UNSIGNED_BYTE,pixelFormat:st.RGBA,sampler:new dn({wrapS:Gn.REPEAT,wrapT:Gn.REPEAT,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})});let u=new Kd({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:Yge(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return l}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function cpt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=rpt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];spt(e,t,s,c)}n._vaf.commit(tj(i))}}var lpt=[];function dpt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,l=lpt;l.length=0,(c[Kft]||c[Hft])&&l.push(Kge),(c[Oft]||c[Qft])&&l.push(Hge),(c[zft]||c[Jft])&&l.push(zge),c[qft]&&l.push(Jge);let u=l.length,m=i._vaf.writers,p,y,f;if(a/r>.1){for(p=0;p<a;++p)for(y=s[p],y._dirty=!1,f=0;f<u;++f)l[f](e,t,m,y);i._vaf.commit(tj(n))}else{for(p=0;p<a;++p){for(y=s[p],y._dirty=!1,f=0;f<u;++f)l[f](e,t,m,y);i._instanced?i._vaf.subCommit(y._index,1):i._vaf.subCommit(y._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function upt(e,t,n,i){let o=t.context,r=e,s=new Be({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Be({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Qt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Md}),r._rs=De.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function mpt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let l=0;l<c;l++){let u=s[l];d(u)||(u=s[l]=new nt),u.pass=Re.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[l].indicesCount,u.vertexArray=a[l].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}xh.prototype.update=function(e){if(ej(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:d(this._noiseTexture),!this._ready&&!this._loading&&!t&&apt(this,e,nF,tF),this._instanced=e.context.instancedArrays,Md=this._instanced?Yft:Bft,tj=this._instanced?ipt:npt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?cpt(this,e):r>0&&dpt(this,e),r>i*1.5&&(o.length=i),!(!d(this._vaf)||!d(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&upt(this,e,eF,$w),mpt(this,e))};xh.prototype.isDestroyed=function(){return!1};xh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Oge(this._clouds),ue(this)};var nj=xh;var RUi=T(S(),1);var hpt=W.toRadians(30);function ij(e){this._angle=g(e,hpt)}Object.defineProperties(ij.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});ij.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var oj=ij;var IUi=T(S(),1);function TF(e){e=g(e,g.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;d(n)||(n=!1);let i=g(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
`;break}let s=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
${n?"":`in ${i} ${t};
`}out ${i} ${o};
void main()
{
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
${n?`${o} = czm_batchTable_${t}(batchId);
`:`${o} = ${t};
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
}`,a=`in ${i} ${o};
${r}
void main()
{
out_FragColor = getColor();
}`;this.material=void 0,this.translucent=g(e.translucent,!1),this._vertexShaderSource=g(e.vertexShaderSource,s),this._fragmentShaderSource=g(e.fragmentShaderSource,a),this._renderState=to.getDefaultRenderState(!1,!1,e.renderState),this._closed=g(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(TF.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});TF.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;TF.prototype.isTranslucent=to.prototype.isTranslucent;TF.prototype.getRenderState=to.prototype.getRenderState;var rj=TF;var YUi=T(S(),1);function nD(e){e=g(e,g.EMPTY_OBJECT),this.length=g(e.length,1e7),this._length=void 0,this.width=g(e.width,2),this._width=void 0,this.show=g(e.show,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}nD.prototype.update=function(e){if(this.show){if(!d(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,d(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new _t({geometry:new C0({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Fr.VERTEX_FORMAT,colors:[B.RED,B.RED],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new _t({geometry:new C0({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Fr.VERTEX_FORMAT,colors:[B.GREEN,B.GREEN],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new _t({geometry:new C0({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Fr.VERTEX_FORMAT,colors:[B.BLUE,B.BLUE],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new Zn({geometryInstances:[t,n,i],appearance:new Fr,asynchronous:!1})}this._primitive.update(e)}};nD.prototype.isDestroyed=function(){return!1};nD.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var SF=nD;var JUi=T(S(),1);function fpt(e){this.direction=h.clone(e.direction),this.color=B.clone(g(e.color,B.WHITE)),this.intensity=g(e.intensity,1)}var sj=fpt;var cki=T(S(),1);var jUi=T(S(),1),CF=`in vec3 v_positionMC;
in vec3 v_positionEC;
in vec2 v_st;

void main()
{
    czm_materialInput materialInput;

    vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
#ifdef FACE_FORWARD
    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif

    materialInput.s = v_st.s;
    materialInput.st = v_st;
    materialInput.str = vec3(v_st, 0.0);

    // Convert tangent space material normal to eye space
    materialInput.normalEC = normalEC;
    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);

    // Convert view vector to world space
    vec3 positionToEyeEC = -v_positionEC;
    materialInput.positionToEyeEC = positionToEyeEC;

    czm_material material = czm_getMaterial(materialInput);

#ifdef FLAT
    out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
    out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var $Ui=T(S(),1),VF=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec2 st;
in float batchId;

out vec3 v_positionMC;
out vec3 v_positionEC;
out vec2 v_st;

void main()
{
    vec4 p = czm_computePosition();

    v_positionMC = position3DHigh + position3DLow;           // position in model coordinates
    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;     // position in eye coordinates
    v_st = st;

    gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function RT(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=g(e.aboveGround,!1);this.material=d(e.material)?e.material:ki.fromType(ki.ColorType),this.translucent=g(e.translucent,!0),this._vertexShaderSource=g(e.vertexShaderSource,VF),this._fragmentShaderSource=g(e.fragmentShaderSource,CF),this._renderState=to.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=g(e.flat,!1),this._faceForward=g(e.faceForward,n),this._aboveGround=n}Object.defineProperties(RT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return RT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});RT.VERTEX_FORMAT=We.POSITION_AND_ST;RT.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;RT.prototype.isTranslucent=to.prototype.isTranslucent;RT.prototype.getRenderState=to.prototype.getRenderState;var aj=RT;var bki=T(S(),1);function Ul(e){this._scene=e.scene,this.samplingWindow=g(e.samplingWindow,Ul.defaultSettings.samplingWindow),this.quietPeriod=g(e.quietPeriod,Ul.defaultSettings.quietPeriod),this.warmupPeriod=g(e.warmupPeriod,Ul.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=g(e.minimumFrameRateDuringWarmup,Ul.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=g(e.minimumFrameRateAfterWarmup,Ul.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new ye,this._nominalFrameRate=new ye,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){ppt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){bpt(t)}this._visibilityChangeRemoveListener=void 0,d(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Ul.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Ul.fromScene=function(e){return(!d(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Ul({scene:e})),e._frameRateMonitor};Object.defineProperties(Ul.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Ul.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Ul.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Ul.prototype.isDestroyed=function(){return!1};Ul.prototype.destroy=function(){return this._preUpdateRemoveListener(),d(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function ppt(e,t){if(e._pauseCount>0)return;let n=gi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function bpt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var LF=Ul;var Xki=T(S(),1);var Qge=T(y4(),1);function cj(){this._image=new Image}cj.prototype.isReady=function(){return!0};cj.prototype.shouldDiscardImage=function(e){return e===this._image};function ZT(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,d(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new cj),this._errorEvent=new ye}Object.defineProperties(ZT.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});ZT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new me(`The server ${e.url} doesn't have imagery`);let n=new ZT(t);return n._metadata=e,n};ZT.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(d(o)){let r=i.providers[o.imageryProvider];if(d(r))return[r]}};ZT.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=K0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!d(a)){if(r.isValid(s)){let l=new Uo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,l);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=ypt(this,a,e,t,n,i).fetchArrayBuffer();if(d(c))return c.then(function(l){hF(r.key,l);let u=new Uint8Array(l),m,p=r.protoImagery;if((!d(p)||!p)&&(m=gpt(u)),!d(m)&&(!d(p)||p)){let y=xpt(u);m=y.imageType,u=y.imageData}return!d(m)||!d(u)?o:Vx({uint8Array:u,format:m,flipY:!0})})};ZT.prototype.pickFeatures=function(e,t,n,i,o){};function ypt(e,t,n,i,o,r){let s=K0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=d(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function gpt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function xpt(e){let t=Qge.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,d(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(d(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new me("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return d(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var lj=ZT;var Aki=T(S(),1);var _pt=new B(1,1,1,.4),Tpt=new B(0,1,0,.05),Spt=new B(0,.5,0,.2);function GT(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=d(e.tilingScheme)?e.tilingScheme:new Di({ellipsoid:e.ellipsoid}),this._cells=g(e.cells,8),this._color=g(e.color,_pt),this._glowColor=g(e.glowColor,Tpt),this._glowWidth=g(e.glowWidth,6),this._backgroundColor=g(e.backgroundColor,Spt),this._errorEvent=new ye,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._canvasSize=g(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(GT.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});GT.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};GT.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};GT.prototype.getTileCredits=function(e,t,n){};GT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};GT.prototype.pickFeatures=function(e,t,n,i,o){};var dj=GT;var KDi=T(S(),1);var IDi=T(S(),1);var CDi=T(S(),1);var Hki=T(S(),1);function _h(){}_h._maxDecodingConcurrency=Math.max(Mt.hardwareConcurrency-1,1);_h._decodeTaskProcessor=new pi("decodeI3S",_h._maxDecodingConcurrency);_h._promise=void 0;async function Cpt(){if(await _h._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return _h._decodeTaskProcessor;throw new me("I3S decoder could not be initialized.")}_h.decode=async function(e,t,n,i){return d(_h._promise)||(_h._promise=Cpt()),_h._promise.then(function(o){let r=n._parent._data,s=n._parent._inverseRotationMatrix,a=0,c=0,l=0;d(r.obb)?(a=r.obb.center[0],c=r.obb.center[1],l=r.obb.center[2]):d(r.mbs)&&(a=r.mbs[0],c=r.mbs[1],l=r.mbs[2]);let u=$.fromRotationX(-W.PI_OVER_TWO),m=new $;$.multiply(u,s,m);let p=he.fromDegrees(a,c,l),y=re.WGS84.cartographicToCartesian(p),f={binaryData:n._data,featureData:d(i)&&d(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:p,cartesianCenter:y,parentRotation:m};return o.scheduleTask(f)})};var RF=_h;var jki=T(S(),1);function uj(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,d(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(uj.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});uj.prototype.load=async function(){return this._data=await ET.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var ZF=uj;var eDi=T(S(),1);function GV(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;d(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(GV.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return d(this._values)&&d(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function Vpt(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}GV.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let o=e._parseHeader(n),r=Vpt(e._storageInfo.attributeValues.valueType);r>0&&(o=Math.ceil(o/r)*r),e._parseBody(n,o)}})};GV.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};GV.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};GV.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=this._storageInfo[i];if(d(o)){this._values[i]=[];for(let r=0;r<this._header.count;++r)if(o.valueType!=="String"){let s=this._parseValue(e,o.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[r],a="";for(let c=0;c<s;++c){let l=this._parseValue(e,o.valueType,t);l.value.charCodeAt(0)!==0&&(a+=l.value),t=l.offset}this._values[i].push(a)}}}};var GF=GV;var rDi=T(S(),1);function EF(e,t){let n=e._dataProvider,i=e._layer,o;d(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(EF.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});EF.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Lpt=new h,Rpt=new h,Zpt=new h,Gpt=new h,Ept=new h;function mj(e,t,n,i){let o=h.subtract(i,n,Lpt),r=h.cross(o,h.subtract(e,n,Rpt),Gpt),s=h.cross(o,h.subtract(t,n,Zpt),Ept);return h.dot(r,s)>=0}var Xpt=new h,Ipt=new h,Wpt=new h,Ppt=new h,vpt=new h,wpt=new h,Fpt=new h,Apt=new h,Mpt=new h,Npt=new h;EF.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(d(this._customAttributes)&&d(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,l=this._customAttributes.positions,u=this._customAttributes.indices,m;d(u)?m=u.length:m=l.length/3;for(let p=0;p<m;p++){let y,f,x;d(u)?(y=u[p],f=u[p+1],x=u[p+2]):(y=p*3,f=p*3+1,x=p*3+2);let _=h.fromElements(l[y*3],l[y*3+1],l[y*3+2],Xpt),C=h.fromElements(l[f*3],l[f*3+1],l[f*3+2],Ipt),V=new h(l[x*3],l[x*3+1],l[x*3+2],Wpt);if(!mj(i,_,C,V)||!mj(i,C,_,V)||!mj(i,V,_,C))continue;let L=h.subtract(C,_,Ppt),Z=h.subtract(V,_,vpt),G=h.cross(L,Z,wpt);if(h.magnitude(G)===0)continue;let X=h.normalize(G,Fpt),P=h.subtract(i,_,Apt),v=Math.abs(h.dot(P,X));if(v<o){o=v,r=p;let A=h.magnitudeSquared(h.subtract(i,_,P)),M=h.magnitudeSquared(h.subtract(i,C,Mpt)),b=h.magnitudeSquared(h.subtract(i,V,Npt));A<M&&A<b?(a=y,c=_,s=A):M<b?(a=f,c=C,s=M):(a=x,c=V,s=b)}}if(d(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};EF.prototype._generateGltf=function(e,t,n,i,o,r){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,l="";if(d(this._parent._data.mesh)&&d(this._layer._data.materialDefinitions)){let x=this._parent._data.mesh.material.definition;if(x>=0&&x<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[x],s=c,d(s.pbrMetallicRoughness)&&d(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let _="0";if(d(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let V=this._layer._data.textureSetDefinitions[C];for(let L=0;L<V.formats.length;L++){let Z=V.formats[L];if(Z.format==="jpg"){_=Z.name;break}}}d(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(l=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${_}`}).url)}}else d(this._parent._data.textureData)&&(a=!0,l=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let u=[],m=[],p=[];return a&&(u=[{sampler:0,source:0}],m=[{uri:l}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:[s],textures:u,images:m,samplers:p,asset:{version:"2.0"}}};var EV=EF;function Nd(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(Nd.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Nd.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new xu(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!d(this._nodeIndex)){let o=await ET.loadJson(this._resource,this._dataProvider._traceFetches);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":d(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),d(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};Nd.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(o,r){let s=new GF(t,o[r]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(d(e))for(let o=0;o<e.length;o++)i.push(n(e,o));return Promise.all(i)};Nd.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!d(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Nd.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Nd.prototype._loadChildren=function(){let e=this;if(d(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(d(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Nd(e,g(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Nd.prototype._loadGeometryData=function(){let e=[];if(d(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new EV(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(d(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new EV(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Nd.prototype._loadFeatureData=function(){let e=[];if(d(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new ZF(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Nd.prototype._clearGeometryData=function(){this._geometryData=[]};Nd.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!d(e)&&!d(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(d(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),d(this._dataProvider._geoidDataList)&&d(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=kpt(L.x,L.y,V);break}}let i={},o,r=0;d(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=re.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(d(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(d(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Aa(0,0,0),l=vt.headingPitchRollQuaternion(o,c);d(this._data.obb)&&(l=new Ae(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(l),m=$.inverse(u,new $),p=new F(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),y=F.inverse(p,new F),f=F.clone(p);d(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=y,this._inverseRotationMatrix=m;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:d(this._resource)?this._resource.url:void 0},geometricError:a}};Nd.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),d(this._geometryData)&&this._geometryData.length>0){let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await RF.decode(o,r,s,this._featureData[0]);if(!d(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};xu.prototype._hookedRequestContent=xu.prototype.requestContent;xu.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!d(e)){this._isLoading=!1;return}return this._contentResource=new Ee({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function Upt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function iD(e,t,n,i){let o=e+t*n;return i[o]}function kpt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,l=a<n.height?a+1:a;a=n.height-1-a,l=n.height-1-l;let u=iD(s,a,n.width,n.buffer),m=iD(c,a,n.width,n.buffer),p=iD(s,l,n.width,n.buffer),y=iD(c,l,n.width,n.buffer),f=Upt(o,r,u,m,p,y);return f=f*n.scale+n.offset,f}Object.defineProperties(xu.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var XV=Nd;function zu(e,t,n){this._dataProvider=e,!d(t.href)&&d(n)&&(t.href=`layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ee({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(zu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(d(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});zu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new me(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};zu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],d(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(d(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let l=0;l<c.length;l++)s.push(c[l])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};zu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(d(n))for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}return 0};zu.prototype._loadRootNode=function(e){if(d(this._data.nodePages)){let t=0;d(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new XV(this,t,!0)}else this._rootNode=new XV(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};zu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};zu._fetchJson=function(e){return e.fetchJson()};zu.prototype._loadNodePage=function(e){let t=this;if(!d(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=zu._fetchJson(n).then(function(o){return d(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};zu.prototype._computeExtent=function(){d(this._data.fullExtent)?this._extent=de.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):d(this._data.store.extent)&&(this._extent=de.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};zu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tileset=await zs.fromUrl(i,e),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){d(o._i3sNode)&&o._i3sNode._loadChildren()})};var IV=zu;var qge=T(jge(),1);function sa(e){e=g(e,g.EMPTY_OBJECT),this._name=e.name,this._show=g(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=g(e.traceFetches,!1),this._cesium3dTilesetOptions=g(e.cesium3dTilesetOptions,g.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0}Object.defineProperties(sa.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)d(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}}});sa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)d(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};sa.prototype.isDestroyed=function(){return!1};sa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)d(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};sa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)d(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};sa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)d(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};sa.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)d(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};sa.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i=await sa.loadJson(n),o=new sa(t);if(o._resource=n,o._data=i,d(i.layers))for(let s=0;s<i.layers.length;s++){let a=new IV(o,i.layers[s],s);o._layers.push(a)}else{let s=new IV(o,i,i.id);o._layers.push(s)}o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};sa._fetchJson=function(e){return e.fetchJson()};sa.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await sa._fetchJson(e);if(d(n.error)){if(console.error("Failed to fetch I3S ",e.url),d(n.error.message)&&console.error(n.error.message),d(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new me(n.error)}return n};sa.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};sa.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]="g".charCodeAt(),o.magic[1]="l".charCodeAt(),o.magic[2]="T".charCodeAt(),o.magic[3]="F".charCodeAt(),o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var Dpt=new D;function Bpt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),l=n.positionToTileXY(a,r);for(let m=c.x;m<=l.x;m++)for(let p=c.y;p<=l.y;p++){let y=D.fromElements(m,p,Dpt),f=y.toString();if(!o.hasOwnProperty(f)){let x={x:y.x,y:y.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=x,i.push(x)}}let u=[];for(let m=0;m<i.length;++m){let p=i[m],y=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(y)}return Promise.all(u).then(function(m){let p=[];for(let y=0;y<m.length;y++){let f={tilingScheme:n,x:i[y].x,y:i[y].y,level:i[y].level},x=m[y],_="Geographic";n._projection instanceof Ei&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===Fu.LERC){let V=qge.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function Ypt(e){let t=e._geoidTiledTerrainProvider;if(!d(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await Bpt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}sa.prototype.loadGeoidData=async function(){return d(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Ypt(this),this._geoidDataPromise)};sa.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(d(this._layers[t]._extent)){let n=this._layers[t]._extent;d(e)?de.union(e,n,e):e=de.clone(n)}this._extent=e};var ET=sa;var zDi=T(S(),1),$ge=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function rD(e,t){this.spatialNode=e,this.keyframe=t,this.state=$ge.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}rD.priorityComparator=function(e,t){return e.priority-t.priority};rD.searchComparator=function(e,t){return e.keyframe-t.keyframe};rD.LoadState=$ge;var Qi=rD;var jDi=T(S(),1);function exe(){}Object.defineProperties(exe.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var hj=exe;var oBi=T(S(),1);var Opt=/\/$/,txe=new St('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function WV(e){e=g(e,g.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ee.createIfNeeded(g(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=g(e.tilesize,512);this._tilesize=o;let r=g(e.username,"mapbox");this._username=r;let s=d(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();Opt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;d(e.credit)?(c=e.credit,typeof c=="string"&&(c=new St(c))):c=txe,this._resource=i,this._imageryProvider=new Ca({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(WV.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});WV.prototype.getTileCredits=function(e,t,n){};WV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};WV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};WV._defaultCredit=txe;var fj=WV;var VBi=T(S(),1);function cg(e,t,n,i,o){i===tn.UNSIGNED_SHORT&&(i=tn.FLOAT32);let r=e.floatingPointTexture;if(i===tn.FLOAT32&&!r)throw new me("Floating point texture not supported");let s;i===tn.FLOAT32||i===tn.FLOAT64?s=Je.FLOAT:i===tn.UINT8&&(s=Je.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?st.RED:st.LUMINANCE:n===2?a=e.webgl2?st.RG:st.LUMINANCE_ALPHA:n===3?a=st.RGB:n===4&&(a=st.RGBA);let c=512*1024*1024,l=128*1024*1024;o=Math.min(g(o,l),c);let u=kt.maximumTextureSize,m=tn.getSizeInBytes(i),p=Math.floor(o/(n*m)),y=Math.min(u,W.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),f=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/f),_=f*t.x,C=x*t.y,V=Math.floor(y/_),L=Math.floor(y/C);if(V===0||L===0)throw new me("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=V*L,this.regionCountPerMegatexture=new D(V,L),this.voxelCountPerRegion=new D(_,C),this.sliceCountPerRegion=new D(f,x),this.voxelSizeUv=new D(1/y,1/y),this.sliceSizeUv=new D(t.x/y,t.y/y),this.regionSizeUv=new D(_/y,C/y),this.texture=new Wt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:y,height:y,sampler:new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR})});let Z=tn.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(Z,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let G=0;G<this.maximumTileCount;G++)this.nodes[G]=new Kpt(G);for(let G=0;G<this.maximumTileCount;G++){let X=this.nodes[G];X.previousNode=G>0?this.nodes[G-1]:void 0,X.nextNode=G<this.maximumTileCount-1?this.nodes[G+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Kpt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}cg.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,d(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,d(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};cg.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];d(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),d(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,d(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};cg.prototype.isFull=function(){return this.emptyList===void 0};cg.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===tn.UNSIGNED_SHORT&&(i=tn.FLOAT32);let o=tn.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.z)),a=Math.ceil(t.z/s),c=s*t.x,l=a*t.y,u=W.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),y=Math.floor(u/l);if(p*y>=e)break;u*=2}return u*u*n*o};cg.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let _=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let V=0;V<i.y;V++)for(let L=0;L<i.x;L++){let Z=x*i.y*i.x+V*i.x+L,G=(C+V)*r.x+(_+L);for(let X=0;X<s;X++)a[G*s+X]=n[Z*s+X]}}let c=this.regionCountPerMegatexture,l=r.x,u=r.y,m=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,f={source:{arrayBufferView:a,width:l,height:u},xOffset:m,yOffset:p};this.texture.copyFrom(f)};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var PV=cg;var RBi=T(S(),1);function pj(e){}pj.prototype.isReady=function(){return!0};pj.prototype.shouldDiscardImage=function(e){return!1};var bj=pj;var wBi=T(S(),1);var Hpt=new St("MapQuest, Open Street Map and contributors, CC-BY-SA");function sD(e){e=g(e,g.EMPTY_OBJECT);let t=Ee.createIfNeeded(g(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${g(e.fileExtension,"png")}`;let n=new kr({ellipsoid:e.ellipsoid}),i=256,o=256,r=g(e.minimumLevel,0),s=e.maximumLevel,a=g(e.rectangle,n.rectangle),c=n.positionToTileXY(de.southwest(a),r),l=n.positionToTileXY(de.northeast(a),r),u=(Math.abs(l.x-c.x)+1)*(Math.abs(l.y-c.y)+1),m=g(e.credit,Hpt);typeof m=="string"&&(m=new St(m)),Ca.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}d(Object.create)&&(sD.prototype=Object.create(Ca.prototype),sD.prototype.constructor=sD);var z0=sD;var DBi=T(S(),1);var zpt=new D(1,1);function yj(e){e=g(e,g.EMPTY_OBJECT),this.mass=g(e.mass,1),this.position=h.clone(g(e.position,h.ZERO)),this.velocity=h.clone(g(e.velocity,h.ZERO)),this.life=g(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=B.clone(g(e.startColor,B.WHITE)),this.endColor=B.clone(g(e.endColor,B.WHITE)),this.startScale=g(e.startScale,1),this.endScale=g(e.endScale,1),this.imageSize=D.clone(g(e.imageSize,zpt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(yj.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var nxe=new h;yj.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,nxe),h.add(this.position,nxe,this.position),d(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var vV=yj;var OBi=T(S(),1);function ixe(e){e=g(e,g.EMPTY_OBJECT),this.time=g(e.time,0),this.minimum=g(e.minimum,0),this.maximum=g(e.maximum,50),this._complete=!1}Object.defineProperties(ixe.prototype,{complete:{get:function(){return this._complete}}});var gj=ixe;var zBi=T(S(),1);function oxe(e){}oxe.prototype.emit=function(e){fe.throwInstantiationError()};var xj=oxe;var l3i=T(S(),1);var rxe=new D(1,1);function XF(e){e=g(e,g.EMPTY_OBJECT),this.show=g(e.show,!0),this.updateCallback=e.updateCallback,this.loop=g(e.loop,!0),this.image=g(e.image,void 0);let t=e.emitter;d(t)||(t=new _F(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(g(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=B.clone(g(e.color,g(e.startColor,B.WHITE))),this._endColor=B.clone(g(e.color,g(e.endColor,B.WHITE))),this._startScale=g(e.scale,g(e.startScale,1)),this._endScale=g(e.scale,g(e.endScale,1)),this._emissionRate=g(e.emissionRate,5),this._minimumSpeed=g(e.speed,g(e.minimumSpeed,1)),this._maximumSpeed=g(e.speed,g(e.maximumSpeed,1)),this._minimumParticleLife=g(e.particleLife,g(e.minimumParticleLife,5)),this._maximumParticleLife=g(e.particleLife,g(e.maximumParticleLife,5)),this._minimumMass=g(e.mass,g(e.minimumMass,1)),this._maximumMass=g(e.mass,g(e.maximumMass,1)),this._minimumImageSize=D.clone(g(e.imageSize,g(e.minimumImageSize,rxe))),this._maximumImageSize=D.clone(g(e.imageSize,g(e.maximumImageSize,rxe))),this._sizeInMeters=g(e.sizeInMeters,!1),this._lifetime=g(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new ye,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(XF.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){B.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){B.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function Jpt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(d(o)){let m=o.length;for(let p=0;p<m;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,l=e._particlePool,u=Math.max(a-c.length-l.length,0);for(let m=0;m<u;++m){let p=new vV;p._billboard=r.add({image:s,show:!1}),l.push(p)}e._particleEstimate=a}function Qpt(e){let t=e._particlePool.pop();return d(t)||(t=new vV),t}function jpt(e,t){e._particlePool.push(t)}function qpt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let l=n[c];i.remove(l._billboard)}n.length=a}function $pt(e){d(e._billboard)&&(e._billboard.show=!1)}function sxe(e,t){let n=t._billboard;d(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new B(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function e0t(e,t){t.startColor=B.clone(e._startColor,t.startColor),t.endColor=B.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function t0t(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),d(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;d(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var aD=new h;XF.prototype.update=function(e){if(!this.show)return;d(this._billboardCollection)||(this._billboardCollection=new od),this._updateParticlePool&&(Jpt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=te.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?sxe(this,s):($pt(s),jpt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=t0t(this,t);if(c>0&&d(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let l=this._combinedMatrix;for(r=0;r<c;r++)s=Qpt(this),this._emitter.emit(s),h.add(s.position,s.velocity,aD),F.multiplyByPoint(l,aD,aD),s.position=F.multiplyByPoint(l,s.position,s.position),h.subtract(aD,s.position,s.velocity),h.normalize(s.velocity,s.velocity),e0t(this,s),sxe(this,s)}if(this._billboardCollection.update(e),this._previousTime=te.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let l=this.bursts.length;for(r=0;r<l;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&qpt(this)};XF.prototype.isDestroyed=function(){return!1};XF.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var _j=XF;var j3i=T(S(),1);var lxe=T(o9(),1);var u3i=T(S(),1);function n0t(e,t,n){return`    float clipDistance = clip(gl_FragCoord, ${e}, ${t}); 
    vec4 clippingPlanesEdgeColor = vec4(1.0); 
    clippingPlanesEdgeColor.rgb = ${n}.rgb; 
    float clippingPlanesEdgeWidth = ${n}.a; 
    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) 
    { 
        out_FragColor = clippingPlanesEdgeColor;
    } 
`}var IF=n0t;var f3i=T(S(),1);var i0t={modifyFragmentShader:function(t){return t=Be.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; 
void main() 
{ 
#ifndef SHADOW_MAP
    if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; 
    if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; 
#endif
    czm_splitter_main(); 
} 
`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},wV=i0t;var XT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function WF(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=B.clone(B.DARKGRAY),this._highlightColor=B.clone(B.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=XT.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=g(e.opaquePass,Re.OPAQUE),this._cull=g(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=xn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=g(e.splitDirection,vc.NONE),this._splittingEnabled=!1,this._error=void 0,o0t(this,e)}Object.defineProperties(WF.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return B.clone(this._highlightColor)},set:function(e){this._highlightColor=B.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(d(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ce.clone(e,this._boundingSphere)}}});function o0t(e,t){let n=Yx.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&d(n.batchTableBinary)&&(n.styleableProperties=gp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),d(n.draco)){let a=n.draco;e._decodingState=XT.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;d(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;d(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;d(r)&&(d(r.constantColor)&&(e._constantColor=B.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;d(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var r0t=new h,s0t=new h,a0t=new h,axe,cD;function c0t(e){if(!d(cD)){axe=new lxe.default(0),cD=new Array(e);for(let t=0;t<e;++t)cD[t]=axe.random()}return cD}function l0t(e){let n=e.length/3,i=Math.min(n,20),o=c0t(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,r0t),c=h.fromElements(s,s,s,s0t);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,a0t);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let l=ce.fromCornerPoints(a,c);return l.radius+=W.EPSILON2,l}function cxe(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(It("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var d0t=new se,u0t=new se,m0t=new B,dxe=0,lD=1,Lj=2,uxe=3,h0t=4,Tj=new F,f0t=new F;function p0t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,l=i.styleableProperties,u=d(l),m=e._isQuantized,p=e._isQuantizedDraco,y=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,Z=e._hasNormals,G=e._hasBatchIds,X,P,v=[],A={};if(e._styleableShaderAttributes=A,u){let k=h0t;for(let O in l)if(l.hasOwnProperty(O)){let U=l[O],J=cxe(U.typedArray,O);X=U.componentCount,P=Q.fromTypedArray(J);let z=mt.createVertexBuffer({context:n,typedArray:J,usage:Ne.STATIC_DRAW});e._geometryByteLength+=z.sizeInBytes;let ee={index:k,vertexBuffer:z,componentsPerAttribute:X,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0};v.push(ee),A[O]={location:k,componentCount:X},++k}}let M=mt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=M.sizeInBytes;let b;L&&(b=mt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;Z&&(R=mt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let E;G&&(c.typedArray=cxe(c.typedArray,"batchIds"),E=mt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let I=[];if(m?P=Q.UNSIGNED_SHORT:p?P=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:P=Q.FLOAT,I.push({index:dxe,vertexBuffer:M,componentsPerAttribute:3,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=ce.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=l0t(r.typedArray)),L)if(C)I.push({index:lD,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=V?4:3;I.push({index:lD,vertexBuffer:b,componentsPerAttribute:k,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}Z&&(y?(X=2,P=Q.UNSIGNED_BYTE):f?(X=2,P=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(X=3,P=Q.FLOAT),I.push({index:Lj,vertexBuffer:R,componentsPerAttribute:X,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&I.push({index:uxe,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(I=I.concat(v));let w=new ni({context:n,attributes:I}),N={depthTest:{enabled:!0}},Y={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Re.CESIUM_3D_TILE&&(N.stencilTest=Ft.setCesium3DTileBit(),N.stencilMask=Ft.CESIUM_3D_TILE_MASK,Y.stencilTest=Ft.setCesium3DTileBit(),Y.stencilMask=Ft.CESIUM_3D_TILE_MASK),e._opaqueRenderState=De.fromCache(N),e._translucentRenderState=De.fromCache(Y),e._drawCommand=new nt({boundingVolume:new ce,cull:e._cull,modelMatrix:new F,primitiveType:Fe.POINTS,vertexArray:w,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Re.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function b0t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=d0t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,l;t.mode===ie.SCENE2D||c instanceof en?l=Number.POSITIVE_INFINITY:l=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=l}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!d(a))return B.TRANSPARENT;let c=B.clone(a.edgeColor,m0t);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!d(a))return F.IDENTITY;let c=g(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,Tj);let l=F.multiply(Tj,a.modelMatrix,Tj);return F.inverseTranspose(l,f0t)}};wV.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=u0t;if(d(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),d(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Sj(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function Cj(e,t){e=e.slice(e.indexOf(`
`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function Vj(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var y0t={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function g0t(e,t,n){let i,o,r,s=t.context,a=d(n),c=e._isQuantized,l=e._isQuantizedDraco,u=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,y=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,Z=e.clippingPlanes,G=e._attenuation,X,P,v,A=y,M=Oe(y0t),b={},R=e._styleableShaderAttributes;for(o in R)R.hasOwnProperty(o)&&(r=R[o],M[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let ae={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";X=n.getColorShaderFunction(`getColorFromStyle${xe}`,M,ae),P=n.getShowShaderFunction(`getShowFromStyle${xe}`,M,ae),v=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,M,ae),d(X)&&ae.translucent&&(A=!0)}e._styleTranslucent=A;let E=d(X),I=d(P),w=d(v),N=e.isClipped,Y=[],k=[];E&&(Sj(X,Y),Cj(X,k)),I&&(Sj(P,Y),Cj(P,k)),w&&(Sj(v,Y),Cj(v,k));let O=k.indexOf("COLOR")>=0,U=k.indexOf("NORMAL")>=0;if(U&&!x)throw new me("Style references the NORMAL semantic but the point cloud does not have normals");for(o in R)if(R.hasOwnProperty(o)){r=R[o];let ae=Y.indexOf(r.location)>=0,xe=Vj(L,r.location);xe.enabled=ae}let J=f&&(!E||O);if(f){let ae=Vj(L,lD);ae.enabled=J}let z=x&&(V||C||U);if(x){let ae=Vj(L,Lj);ae.enabled=z}let ee={a_position:dxe};J&&(ee.a_color=lD),z&&(ee.a_normal=Lj),_&&(ee.a_batchId=uxe);let K="",j=Y.length;for(i=0;i<j;++i){let ae=Y[i];r=b[ae];let xe=r.componentCount,_e=`czm_3dtiles_property_${ae}`,Ve;xe===1?Ve="float":Ve=`vec${xe}`,K+=`in ${Ve} ${_e}; 
`,ee[_e]=r.location}b0t(e,t);let q=`in vec3 a_position; 
out vec4 v_color; 
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; 
uniform vec4 u_constantColor; 
uniform vec4 u_highlightColor; 
`;q+=`float u_pointSize; 
float tiles3d_tileset_time; 
`,G&&(q+=`float u_geometricError; 
float u_depthMultiplier; 
`),q+=K,J&&(y?q+=`in vec4 a_color; 
`:p?q+=`in float a_color; 
const float SHIFT_RIGHT_11 = 1.0 / 2048.0; 
const float SHIFT_RIGHT_5 = 1.0 / 32.0; 
const float SHIFT_LEFT_11 = 2048.0; 
const float SHIFT_LEFT_5 = 32.0; 
const float NORMALIZE_6 = 1.0 / 64.0; 
const float NORMALIZE_5 = 1.0 / 32.0; 
`:q+=`in vec3 a_color; 
`),z&&(u||m?q+=`in vec2 a_normal; 
`:q+=`in vec3 a_normal; 
`),_&&(q+=`in float a_batchId; 
`),(c||l||m)&&(q+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; 
`),E&&(q+=X),I&&(q+=P),w&&(q+=v),q+=`void main() 
{ 
    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; 
    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; 
`,G&&(q+=`    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; 
    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; 
`),J?y?q+=`    vec4 color = a_color; 
`:p?q+=`    float compressed = a_color; 
    float r = floor(compressed * SHIFT_RIGHT_11); 
    compressed -= r * SHIFT_LEFT_11; 
    float g = floor(compressed * SHIFT_RIGHT_5); 
    compressed -= g * SHIFT_LEFT_5; 
    float b = compressed; 
    vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); 
    vec4 color = vec4(rgb, 1.0); 
`:q+=`    vec4 color = vec4(a_color, 1.0); 
`:q+=`    vec4 color = u_constantColor; 
`,c||l?q+=`    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; 
`:q+=`    vec3 position = a_position; 
`,q+=`    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); 
`,z?(u?q+=`    vec3 normal = czm_octDecode(a_normal); 
`:m?q+=`    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; 
`:q+=`    vec3 normal = a_normal; 
`,q+=`    vec3 normalEC = czm_normal * normal; 
`):q+=`    vec3 normal = vec3(1.0); 
`,E&&(q+=`    color = getColorFromStyle(position, position_absolute, color, normal); 
`),I&&(q+=`    float show = float(getShowFromStyle(position, position_absolute, color, normal)); 
`),w?q+=`    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; 
`:G?q+=`    vec4 positionEC = czm_modelView * vec4(position, 1.0); 
    float depth = -positionEC.z; 
    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); 
`:q+=`    gl_PointSize = u_pointSize; 
`,q+=`    color = color * u_highlightColor; 
`,z&&V&&(q+=`    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); 
    diffuseStrength = max(diffuseStrength, 0.4); 
    color.xyz *= diffuseStrength * czm_lightColor; 
`),q+=`    v_color = color; 
    gl_Position = czm_modelViewProjection * vec4(position, 1.0); 
`,z&&C&&(q+=`    float visible = step(-normalEC.z, 0.0); 
    gl_Position *= visible; 
    gl_PointSize *= visible; 
`),I&&(q+=`    gl_Position.w *= float(show); 
    gl_PointSize *= float(show); 
`),q+=`} 
`;let be=`in vec4 v_color; 
`;N&&(be+=`uniform highp sampler2D u_clippingPlanes; 
uniform mat4 u_clippingPlanesMatrix; 
uniform vec4 u_clippingPlanesEdgeStyle; 
`,be+=`
`,be+=E0(Z,s),be+=`
`),be+=`void main() 
{ 
    out_FragColor = czm_gammaCorrect(v_color); 
`,N&&(be+=IF("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),be+=`} 
`,e.splitDirection!==vc.NONE&&(be=wV.modifyFragmentShader(be)),d(e._vertexShaderLoaded)&&(q=e._vertexShaderLoaded(q)),d(e._fragmentShaderLoaded)&&(be=e._fragmentShaderLoaded(be));let Te=e._drawCommand;d(Te.shaderProgram)&&Te.shaderProgram.destroy(),Te.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:q,fragmentShaderSource:be,attributeLocations:ee});try{Te.shaderProgram._bind()}catch{throw new me("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function x0t(e,t){if(e._decodingState===XT.READY)return!1;if(e._decodingState===XT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Rp.decodePointCloud(i,t);d(o)&&(e._decodingState=XT.DECODING,o.then(function(r){e._decodingState=XT.READY;let s=d(r.POSITION)?r.POSITION.array:void 0,a=d(r.RGB)?r.RGB.array:void 0,c=d(r.RGBA)?r.RGBA.array:void 0,l=d(r.NORMAL)?r.NORMAL.array:void 0,u=d(r.BATCH_ID)?r.BATCH_ID.array:void 0,m=d(s)&&d(r.POSITION.data.quantization),p=d(l)&&d(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=h.fromElements(C,C,C),e._quantizedVolumeOffset=h.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let y=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];d(y)||(y={}),y[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}d(s)&&(n.positions={typedArray:s});let x=g(c,a);d(x)&&(n.colors={typedArray:x}),d(l)&&(n.normals={typedArray:l}),d(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=y}).catch(function(r){e._decodingState=XT.FAILED,e._error=r}))}return!0}var _0t=new se,T0t=new h;WF.prototype.update=function(e){let t=e.context;if(d(this._error)){let l=this._error;throw this._error=void 0,l}if(x0t(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),d(this._drawCommand)||(p0t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let l=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,l),d(this._rtcCenter)&&F.multiplyByTranslation(l,this._rtcCenter,l),d(this._quantizedVolumeOffset)&&F.multiplyByTranslation(l,this._quantizedVolumeOffset,l),e.mode!==ie.SCENE3D){let m=e.mapProjection,p=F.getColumn(l,3,_0t);se.equals(p,se.UNIT_W)||vt.basisTo2D(m,l,l)}let u=this._drawCommand.boundingVolume;if(ce.clone(this._boundingSphere,u),this._cull){let m=u.center;F.multiplyByPoint(l,m,m);let p=F.getScale(l,T0t);u.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==vc.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&g0t(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Re.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};WF.prototype.isDestroyed=function(){return!1};WF.prototype.destroy=function(){let e=this._drawCommand;return d(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var PF=WF;var eYi=T(S(),1);function Ud(){fe.throwInstantiationError()}Ud.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Ud.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Ud.prototype.update=fe.throwInstantiationError;Ud.prototype.beginUpdate=fe.throwInstantiationError;Ud.prototype.endUpdate=fe.throwInstantiationError;Ud.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Ud.prototype.loadTile=fe.throwInstantiationError;Ud.prototype.computeTileVisibility=fe.throwInstantiationError;Ud.prototype.showTileThisFrame=fe.throwInstantiationError;Ud.prototype.computeDistanceToTile=fe.throwInstantiationError;Ud.prototype.isDestroyed=fe.throwInstantiationError;Ud.prototype.destroy=fe.throwInstantiationError;var Rj=Ud;var dYi=T(S(),1);function Ju(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Wn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r,s)}var S0t=new h;Ju.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=$.getScale(this.orientedBoundingBox.halfAxes,S0t),i=2*h.maximumComponent(n);this.approximateVoxelSize=i/h.minimumComponent(t)};Ju.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:o,z:r}=this,s=i*2,a=o*2,c=r*2,l=a+1,u=s+1,m=c+1,p=n+1,y=[[p,s,a,c],[p,u,a,c],[p,s,l,c],[p,u,l,c],[p,s,a,m],[p,u,a,m],[p,s,l,m],[p,u,l,m]];this.children=y.map(([f,x,_,C])=>new Ju(f,x,_,C,this,e,t))};Ju.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Ju.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var mxe={keyframe:0};function vF(e,t){return mxe.keyframe=e,Lo(t,mxe,Qi.searchComparator)}Ju.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;d(t);){let{renderableKeyframeNodes:m}=t;if(m.length>=1){let p=C0t(i,m),y=m[p],f=o===i||i<y.keyframe?p:Math.min(p+1,m.length-1),x=m[f],_=i-y.keyframe,C=hxe(n-t.level,_);C<a&&(a=C,r=y);let V=x.keyframe-o,L=hxe(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!d(r)||!d(s))return;let l=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=l===u?0:W.clamp((e-l)/(u-l),0,1)};function C0t(e,t){let n=vF(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function hxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Ju.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Ju.prototype.createKeyframeNode=function(e){let t=vF(e,this.keyframeNodes);if(t<0){t=~t;let n=new Qi(this,e);this.keyframeNodes.splice(t,0,n)}};Ju.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=vF(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=vF(n,this.renderableKeyframeNodes);if(o<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=Qi.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Ju.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==Qi.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadatas[o]),e.metadatas[o]=void 0}e.state=Qi.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=vF(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};Ju.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return d(t)&&d(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var wF=Ju;var pYi=T(S(),1);function Zj(e){e=g(e,1),this._radius=g(e,1)}Object.defineProperties(Zj.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Zj.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Gj=Zj;var gYi=T(S(),1);function FF(){}FF.prototype.evaluate=function(e,t){fe.throwInstantiationError()};FF.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};FF.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};FF.prototype.getVariables=function(){fe.throwInstantiationError()};var Ej=FF;var SYi=T(S(),1);function dD(e){this._ready=!1,this._provider=void 0,this._errorEvent=new ye,this._readyEvent=new ye,L0t(this,e)}Object.defineProperties(dD.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});dD.fromWorldTerrain=function(e){return new dD(ST(e))};function V0t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function L0t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){V0t(e._errorEvent,i)}}var AF=dD;var LYi=T(S(),1);function FV(){}FV.prototype.boundingVolume=void 0;FV.prototype.boundingSphere=void 0;FV.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};FV.prototype.intersectPlane=function(e){fe.throwInstantiationError()};FV.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var Xj=FV;var WYi=T(S(),1);function MF(e){e=g(e,g.EMPTY_OBJECT),this._tilingScheme=d(e.tilingScheme)?e.tilingScheme:new Di({ellipsoid:e.ellipsoid}),this._color=g(e.color,B.YELLOW),this._errorEvent=new ye,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(MF.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});MF.prototype.getTileCredits=function(e,t,n){};MF.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};MF.prototype.pickFeatures=function(e,t,n,i,o){};var NF=MF;var wYi=T(S(),1);function Ij(e){fe.throwInstantiationError()}Ij.prototype.isReady=fe.throwInstantiationError;Ij.prototype.shouldDiscardImage=fe.throwInstantiationError;var Wj=Ij;var AYi=T(S(),1),R0t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Pj=Object.freeze(R0t);var tOi=T(S(),1);function WT(e){e=g(e,g.EMPTY_OBJECT),this.show=g(e.show,!0),this.modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this.shadows=g(e.shadows,xn.ENABLED),this.maximumMemoryUsage=g(e.maximumMemoryUsage,256),this.shading=new Kh(e.shading),this.style=e.style,this.frameFailed=new ye,this.frameChanged=new ye,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Wp,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(WT.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(d(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function Z0t(e){return`uniform vec4 czm_pickColor;
${e}`}function G0t(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function E0t(){return"czm_pickColor"}WT.prototype.makeStyleDirty=function(){this._styleDirty=!0};WT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var X0t=new te;function wj(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function IT(e,t){return e._intervals.indexOf(t.start)}function I0t(e,t){let n=e._intervals,i=e._clock,o=wj(e);if(o===0)return;let r=e._getAverageLoadTime(),s=te.addSeconds(i.currentTime,r*o,X0t),a=n.indexOf(s),c=IT(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function W0t(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function P0t(e,t,n){let i=wj(e),o=IT(e,t),r=IT(e,n);return i>=0?o>=r:o<=r}function pxe(e,t){return function(n){let i=d(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function v0t(e,t,n){let i=IT(e,t),o=e._frames,r=o[i];if(!d(r)){let s=t.data.transform,a=d(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:gi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ee.fetchArrayBuffer({url:c}).then(function(l){r.pointCloud=new PF({arrayBuffer:l,cull:!0,fragmentShaderLoaded:Z0t,uniformMapLoaded:G0t(e),pickIdLoaded:E0t})}).catch(pxe(e,c))}return r}function w0t(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function F0t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(d(o)&&!t.ready){let r=i.commandList,s=r.length;if(bxe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(gi()-t.timestamp)/1e3;w0t(e,a)}}t.touchedFrameNumber=i.frameNumber}var A0t=new F;function M0t(e,t){let n=e.shading;return d(n)&&d(n.baseResolution)?n.baseResolution:d(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function N0t(e){let t=e.shading;return d(t)&&d(t.maximumAttenuation)?t.maximumAttenuation:10}var U0t=new Kh;function bxe(e,t,n,i){let o=g(e.shading,U0t),r=t.pointCloud,s=g(t.transform,F.IDENTITY);r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,A0t),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=M0t(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=N0t(e);try{r.update(i)}catch(a){pxe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function vj(e,t,n,i){let o=v0t(e,t,i);F0t(e,o,n,i)}function k0t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function yxe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(d(r)&&(!d(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),d(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function D0t(e,t){let n=IT(e,t),i=e._frames[n];if(d(i)&&i.ready)return i}function fxe(e,t,n,i,o){return d(n)?n.ready?!0:(vj(e,t,i,o),n.ready):!1}function B0t(e,t,n,i,o){let r,s,a,c=e._intervals,l=e._frames,u=IT(e,n),m=IT(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=l[r],fxe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=l[r],fxe(e,s,a,i,o))return s;return t}function Y0t(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];d(s)&&d(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var AV={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};WT.prototype.update=function(e){if(e.mode===ie.MORPHING||!this.show)return;d(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),d(this._loadTimestamp)||(this._loadTimestamp=te.clone(e.time));let t=Math.max(te.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=d(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Y0t(this,o,s),AV.timeSinceLoad=t,AV.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,l=e.commandList,u=l.length,m=this._previousInterval,p=this._nextInterval,y=W0t(this);if(!d(y))return;let f=!1,x=wj(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!d(m)||_)&&(m=y),(!d(p)||f||P0t(this,y,p))&&(p=I0t(this,y)),m=B0t(this,m,y,AV,e);let C=D0t(this,m);d(C)||(vj(this,m,AV,e),C=this._lastRenderedFrame),d(C)&&bxe(this,C,AV,e),d(p)&&vj(this,p,AV,e);let V=this;d(C)&&!d(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),d(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,Z=this.maximumMemoryUsage*1024*1024;L>Z&&yxe(this,k0t(e));let X=l.length-u;d(a)&&a.attenuation&&a.eyeDomeLighting&&X>0&&c.update(e,u,a,this.boundingSphere)};WT.prototype.isDestroyed=function(){return!1};WT.prototype.destroy=function(){return yxe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var MV=WT;var hOi=T(S(),1);function uD(e,t){this.show=!0,d(e)||(e=new He),this.rectangle=He.clone(e),d(t)||(t=ki.fromType(ki.ColorType,{color:new B(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}uD.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!d(t)||!He.equals(t.viewport,this.rectangle))&&(this._rs=De.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!d(this._overlayCommand)){this._material=this.material,d(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Be({sources:[this._material.shaderSource,iF]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Re.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};uD.prototype.isDestroyed=function(){return!1};uD.prototype.destroy=function(){return d(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var Fj=uD;var MHi=T(S(),1);var RKi=T(S(),1);var cKi=T(S(),1);var pOi=T(S(),1),UF=`// See Intersection.glsl for the definition of intersectScene
// See IntersectionUtils.glsl for the definition of nextIntersection
// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl
// for the definition of convertUvToShapeUvSpace. The appropriate function is 
// selected based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See Octree.glsl for the definitions of TraversalData, SampleData,
// traverseOctreeFromBeginning, and traverseOctreeFromExisting
// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture

#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0

uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionUv;
uniform float u_stepSize;

#if defined(PICKING)
    uniform vec4 u_pickColor;
#endif

#if defined(JITTER)
float hash(vec2 p)
{
    vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale
    p3 += dot(p3, p3.yzx + 19.19);
    return fract((p3.x + p3.y) * p3.z);
}
#endif

vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) {
#if defined(SHAPE_BOX)
    Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv);
    RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox);
    vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry;
    float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w);
    float dt = (exit - entry.w) * RAY_SCALE;
    return vec4(normalize(entry.xyz), dt);
#else
    float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w));
    return vec4(viewRay.dir, u_stepSize / dimAtLevel);
#endif
}

void main()
{
    vec4 fragCoord = gl_FragCoord;
    vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
    vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
    vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case
    vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case
    vec3 viewPosUv = u_cameraPositionUv;
    #if defined(SHAPE_BOX)
        vec3 dInv = 1.0 / viewDirUv;
        Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv);
    #else
        Ray viewRayUv = Ray(viewPosUv, viewDirUv);
    #endif

    Intersections ix;
    RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);

    // Exit early if the scene was completely missed.
    if (shapeIntersection.entry.w == NO_HIT) {
        discard;
    }

    float currT = shapeIntersection.entry.w * RAY_SCALE;
    float endT = shapeIntersection.exit.w;
    vec3 positionUv = viewPosUv + currT * viewDirUv;
    vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv);

    // Traverse the tree from the start position
    TraversalData traversalData;
    SampleData sampleDatas[SAMPLE_COUNT];
    traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas);
    vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection);

    #if defined(JITTER)
        float noise = hash(screenCoord); // [0,1]
        currT += noise * step.w;
        positionUv += noise * step.w * viewDirUv;
    #endif

    FragmentInput fragmentInput;
    #if defined(STATISTICS)
        setStatistics(fragmentInput.metadata.statistics);
    #endif

    vec4 colorAccum =vec4(0.0);

    for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
        // Read properties from the megatexture based on the traversal state
        Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);

        // Prepare the custom shader inputs
        copyPropertiesToMetadata(properties, fragmentInput.metadata);
        fragmentInput.voxel.positionUv = positionUv;
        fragmentInput.voxel.positionShapeUv = positionUvShapeSpace;
        fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
        fragmentInput.voxel.viewDirUv = viewDirUv;
        fragmentInput.voxel.viewDirWorld = viewDirWorld;
        fragmentInput.voxel.surfaceNormal = step.xyz;
        fragmentInput.voxel.travelDistance = step.w;

        // Run the custom shader
        czm_modelMaterial materialOutput;
        fragmentMain(fragmentInput, materialOutput);

        // Sanitize the custom shader output
        vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
        color.rgb = max(color.rgb, vec3(0.0));
        color.a = clamp(color.a, 0.0, 1.0);

        // Pre-multiplied alpha blend
        colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);

        // Stop traversing if the alpha has been fully saturated
        if (colorAccum.a > ALPHA_ACCUM_MAX) {
            colorAccum.a = ALPHA_ACCUM_MAX;
            break;
        }

        if (step.w == 0.0) {
            // Shape is infinitely thin. The ray may have hit the edge of a
            // foreground voxel. Step ahead slightly to check for more voxels
            step.w == 0.00001;
        }

        // Keep raymarching
        currT += step.w;
        positionUv += step.w * viewDirUv;

        // Check if there's more intersections.
        if (currT > endT) {
            #if (INTERSECTION_COUNT == 1)
                break;
            #else
                shapeIntersection = nextIntersection(ix);
                if (shapeIntersection.entry.w == NO_HIT) {
                    break;
                } else {
                    // Found another intersection. Resume raymarching there
                    currT = shapeIntersection.entry.w * RAY_SCALE;
                    endT = shapeIntersection.exit.w;
                    positionUv = viewPosUv + currT * viewDirUv;
                }
            #endif
        }

        // Traverse the tree from the current ray position.
        // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
        positionUvShapeSpace = convertUvToShapeUvSpace(positionUv);
        traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas);
        step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection);
    }

    // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
    colorAccum.a /= ALPHA_ACCUM_MAX;

    #if defined(PICKING)
        // If alpha is 0.0 there is nothing to pick
        if (colorAccum.a == 0.0) {
            discard;
        }
        out_FragColor = u_pickColor;
    #else
        out_FragColor = colorAccum;
    #endif
}
`;var yOi=T(S(),1),kF=`in vec2 position;

uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;

void main() {
    vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
    vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
    vec2 translation = 0.5 * (aabbMax + aabbMin);
    vec2 scale = 0.5 * (aabbMax - aabbMin);
    gl_Position = vec4(position * scale + translation, 0.0, 1.0);
}
`;var xOi=T(S(),1),DF=`/* Intersection defines
#define INTERSECTION_COUNT ###
*/

#define NO_HIT (-czm_infinity)
#define INF_HIT (czm_infinity * 0.5)
#define RAY_SHIFT (0.000003163)
#define RAY_SCALE (1.003163)

struct Ray {
    vec3 pos;
    vec3 dir;
#if defined(SHAPE_BOX)
    vec3 dInv;
#endif
};

struct RayShapeIntersection {
    vec4 entry;
    vec4 exit;
};

struct Intersections {
    // Don't access these member variables directly - call the functions instead.

    // Store an array of ray-surface intersections. Each intersection is composed of:
    //  .xyz for the surface normal at the intersection point
    //  .w for the T value
    // The scale of the normal encodes the shape intersection type:
    //  length(intersection.xyz) = 1: positive shape entry
    //  length(intersection.xyz) = 2: positive shape exit
    //  length(intersection.xyz) = 3: negative shape entry
    //  length(intersection.xyz) = 4: negative shape exit
    // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
    // so we need twice as many to track ray-*surface* intersections
    vec4 intersections[INTERSECTION_COUNT * 2];

    #if (INTERSECTION_COUNT > 1)
        // Maintain state for future nextIntersection calls
        int index;
        int surroundCount;
        bool surroundIsPositive;
    #endif
};

RayShapeIntersection getFirstIntersection(in Intersections ix) 
{
    return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
}

vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
{
    float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
    return vec4(intersection.xyz * scale, intersection.w);
}

// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection;
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)

#if (INTERSECTION_COUNT > 1)
void initializeIntersections(inout Intersections ix) {
    // Sort the intersections from min T to max T with bubble sort.
    // Note: If this sorting function changes, some of the intersection test may
    // need to be updated. Search for "bubble sort" to find those areas.
    const int sortPasses = INTERSECTION_COUNT * 2 - 1;
    for (int n = sortPasses; n > 0; --n) {
        for (int i = 0; i < sortPasses; ++i) {
            // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
            // loop with non-constant condition, so it has to break early instead
            if (i >= n) { break; }

            vec4 intersect0 = ix.intersections[i + 0];
            vec4 intersect1 = ix.intersections[i + 1];

            bool inOrder = intersect0.w <= intersect1.w;

            ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
            ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
        }
    }

    // Prepare initial state for nextIntersection
    ix.index = 0;
    ix.surroundCount = 0;
    ix.surroundIsPositive = false;
}
#endif

#if (INTERSECTION_COUNT > 1)
RayShapeIntersection nextIntersection(inout Intersections ix) {
    vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
    RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);

    const int passCount = INTERSECTION_COUNT * 2;

    if (ix.index == passCount) {
        return shapeIntersection;
    }

    for (int i = 0; i < passCount; ++i) {
        // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
        // loop with non-constant condition, so it has to continue instead.
        if (i < ix.index) {
            continue;
        }

        ix.index = i + 1;

        surfaceIntersection = ix.intersections[i];
        int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
        bool currShapeIsPositive = intersectionType < 2;
        bool enter = intMod(intersectionType, 2) == 0;

        ix.surroundCount += enter ? +1 : -1;
        ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;

        // entering positive or exiting negative
        if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
            shapeIntersection.entry = surfaceIntersection;
        }

        // exiting positive or entering negative after being inside positive
        bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
        bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
        if (exitPositive || enterNegativeFromPositive) {
            shapeIntersection.exit = surfaceIntersection;

            // entry and exit have been found, so the loop can stop
            if (exitPositive) {
                // After exiting positive shape there is nothing left to intersect, so jump to the end index.
                ix.index = passCount;
            }
            break;
        }
    }

    return shapeIntersection;
}
#endif

// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
`;var TOi=T(S(),1),BF=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
// setIntersectionPair, INF_HIT, NO_HIT

/* intersectDepth defines (set in Scene/VoxelRenderResources.js)
#define DEPTH_INTERSECTION_INDEX ###
*/

uniform mat4 u_transformPositionViewToUv;

void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
    float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
    if (logDepthOrDepth != 0.0) {
        // Calculate how far the ray must travel before it hits the depth buffer.
        vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
        eyeCoordinateDepth /= eyeCoordinateDepth.w;
        vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
        float t = dot(depthPositionUv - ray.pos, ray.dir);
        setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
    } else {
        // There's no depth at this location.
        setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
    }
}
`;var COi=T(S(),1),YF=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
// NO_HIT, setIntersectionPair

/* Clipping plane defines (set in Scene/VoxelRenderResources.js)
#define CLIPPING_PLANES_UNION
#define CLIPPING_PLANES_COUNT
#define CLIPPING_PLANES_INTERSECTION_INDEX
*/

uniform sampler2D u_clippingPlanesTexture;
uniform mat4 u_clippingPlanesMatrix;

// Plane is in Hessian Normal Form
vec4 intersectPlane(in Ray ray, in vec4 plane) {
    vec3 n = plane.xyz; // normal
    float w = plane.w; // -dot(pointOnPlane, normal)

    float a = dot(ray.pos, n);
    float b = dot(ray.dir, n);
    float t = -(w + a) / b;

    return vec4(n, t);
}

void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
    vec4 backSide = vec4(-ray.dir, -INF_HIT);
    vec4 farSide = vec4(ray.dir, +INF_HIT);
    RayShapeIntersection clippingVolume;

    #if (CLIPPING_PLANES_COUNT == 1)
        // Union and intersection are the same when there's one clipping plane, and the code
        // is more simplified.
        vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);
        vec4 intersection = intersectPlane(ray, planeUv);
        bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
        clippingVolume.entry = reflects ? backSide : intersection;
        clippingVolume.exit = reflects ? intersection : farSide;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
    #elif defined(CLIPPING_PLANES_UNION)
        vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
        vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
            vec4 intersection = intersectPlane(ray, planeUv);
            if (dot(ray.dir, planeUv.xyz) > 0.0) {
                firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
            } else {
                lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
            }
        }
        clippingVolume.entry = backSide;
        clippingVolume.exit = lastReflection;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
        clippingVolume.entry = firstTransmission;
        clippingVolume.exit = farSide;
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
    #else // intersection
        vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
        vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
        for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
            vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
            vec4 intersection = intersectPlane(ray, planeUv);
            if (dot(ray.dir, planeUv.xyz) > 0.0) {
                lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
            } else {
                firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
            }
        }
        if (lastTransmission.w < firstReflection.w) {
            clippingVolume.entry = lastTransmission;
            clippingVolume.exit = firstReflection;
        } else {
            clippingVolume.entry = vec4(-ray.dir, NO_HIT);
            clippingVolume.exit = vec4(ray.dir, NO_HIT);
        }
        setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
    #endif
}
`;var LOi=T(S(),1),OF=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT
// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace

/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_INTERSECTION_INDEX ### // always 0
*/

uniform vec3 u_renderMinBounds;
uniform vec3 u_renderMaxBounds;

struct Box {
    vec3 p0;
    vec3 p1;
};

Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv)
{
    // Find the min/max cornerpoints of the voxel in tile coordinates
    vec3 tileOrigin = vec3(octreeCoords.xyz);
    vec3 numSamples = vec3(u_dimensions);
    vec3 voxelSize = 1.0 / numSamples;
    vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin;
    vec3 coordP1 = coordP0 + voxelSize;

    // Transform to the UV coordinates of the scaled tileset
    float tileSize = 1.0 / pow(2.0, float(octreeCoords.w));
    vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize);
    vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize);

    return Box(p0, p1);
}

vec3 getBoxNormal(in Box box, in Ray ray, in float t)
{
    vec3 hitPoint = ray.pos + t * ray.dir;
    vec3 lower = step(hitPoint, box.p0);
    vec3 upper = step(box.p1, hitPoint);
    return normalize(upper - lower);
}

// Find the distances along a ray at which the ray intersects an axis-aligned box
// See https://tavianator.com/2011/ray_box.html
RayShapeIntersection intersectBox(in Ray ray, in Box box)
{
    // Consider the box as the intersection of the space between 3 pairs of parallel planes
    // Compute the distance along the ray to each plane
    vec3 t0 = (box.p0 - ray.pos) * ray.dInv;
    vec3 t1 = (box.p1 - ray.pos) * ray.dInv;

    // Identify candidate entries/exits based on distance from ray.pos
    vec3 entries = min(t0, t1);
    vec3 exits = max(t0, t1);

    // The actual box intersection points are the furthest entry and the closest exit
    float entryT = max(max(entries.x, entries.y), entries.z);
    float exitT = min(min(exits.x, exits.y), exits.z);

    vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT);
    vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT);

    if (entryT > exitT) {
        entryT = NO_HIT;
        exitT = NO_HIT;
    }

    return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT));
}

void intersectShape(in Ray ray, inout Intersections ix)
{
    RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds));
    setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var ZOi=T(S(),1),KF=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection,
// setIntersectionPair

/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT
#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO

#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED

#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
#define CYLINDER_INTERSECTION_INDEX_ANGLE
*/

// Cylinder uniforms
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT)
    uniform vec3 u_cylinderUvToRenderBoundsScale;
    uniform vec3 u_cylinderUvToRenderBoundsTranslate;
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
    uniform float u_cylinderUvToRenderRadiusMin;
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
    uniform vec2 u_cylinderRenderAngleMinMax;
#endif

vec4 intersectHalfPlane(Ray ray, float angle) {
    vec2 o = ray.pos.xy;
    vec2 d = ray.dir.xy;
    vec2 planeDirection = vec2(cos(angle), sin(angle));
    vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);

    float a = dot(o, planeNormal);
    float b = dot(d, planeNormal);
    float t = -a / b;

    vec2 p = o + t * d;
    bool outside = dot(p, planeDirection) < 0.0;
    if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);

    return vec4(-INF_HIT, t, t, +INF_HIT);
}

#define POSITIVE_HIT vec2(t, +INF_HIT);
#define NEGATIVE_HIT vec2(-INF_HIT, t);

vec2 intersectHalfSpace(Ray ray, float angle)
{
    vec2 o = ray.pos.xy;
    vec2 d = ray.dir.xy;
    vec2 n = vec2(sin(angle), -cos(angle));

    float a = dot(o, n);
    float b = dot(d, n);
    float t = -a / b;
    float s = sign(a);

    // Half space cuts right through the camera, pick the side to intersect
    if (a == 0.0) {
        if (b >= 0.0) {
            return POSITIVE_HIT;
        } else {
            return NEGATIVE_HIT;
        }
    }

    if (t >= 0.0 != s >= 0.0) {
        return POSITIVE_HIT;
    } else {
        return NEGATIVE_HIT;
    }
}

vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle)
{
    vec2 o = ray.pos.xy;
    vec2 d = ray.dir.xy;
    vec2 n1 = vec2(sin(minAngle), -cos(minAngle));
    vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle));

    float a1 = dot(o, n1);
    float a2 = dot(o, n2);
    float b1 = dot(d, n1);
    float b2 = dot(d, n2);

    float t1 = -a1 / b1;
    float t2 = -a2 / b2;
    float s1 = sign(a1);
    float s2 = sign(a2);

    float tmin = min(t1, t2);
    float tmax = max(t1, t2);
    float smin = tmin == t1 ? s1 : s2;
    float smax = tmin == t1 ? s2 : s1;

    bool e = tmin >= 0.0;
    bool f = tmax >= 0.0;
    bool g = smin >= 0.0;
    bool h = smax >= 0.0;

    if (e != g && f == h) return vec2(tmin, tmax);
    else if (e == g && f == h) return vec2(-INF_HIT, tmin);
    else if (e != g && f != h) return vec2(tmax, +INF_HIT);
    else return vec2(NO_HIT);
}

vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle)
{
    vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle);
    vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi);
    return vec4(planeIntersectMin, planeIntersectMax);
}

vec2 intersectUnitCylinder(Ray ray)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;

    float a = dot(d.xy, d.xy);
    float b = dot(o.xy, d.xy);
    float c = dot(o.xy, o.xy) - 1.0;
    float det = b * b - a * c;

    if (det < 0.0) {
        return vec2(NO_HIT);
    }

    det = sqrt(det);
    float ta = (-b - det) / a;
    float tb = (-b + det) / a;
    float t1 = min(ta, tb);
    float t2 = max(ta, tb);

    float z1 = o.z + t1 * d.z;
    float z2 = o.z + t2 * d.z;

    if (abs(z1) >= 1.0)
    {
        float tCap = (sign(z1) - o.z) / d.z;
        t1 = abs(b + a * tCap) < det ? tCap : NO_HIT;
    }

    if (abs(z2) >= 1.0)
    {
        float tCap = (sign(z2) - o.z) / d.z;
        t2 = abs(b + a * tCap) < det ? tCap : NO_HIT;
    }

    return vec2(t1, t2);
}

vec2 intersectUnitCircle(Ray ray) {
    vec3 o = ray.pos;
    vec3 d = ray.dir;

    float t = -o.z / d.z;
    vec2 zPlanePos = o.xy + d.xy * t;
    float distSqr = dot(zPlanePos, zPlanePos);

    if (distSqr > 1.0) {
        return vec2(NO_HIT);
    }

    return vec2(t, t);
}

vec2 intersectInfiniteUnitCylinder(Ray ray)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;

    float a = dot(d.xy, d.xy);
    float b = dot(o.xy, d.xy);
    float c = dot(o.xy, o.xy) - 1.0;
    float det = b * b - a * c;

    if (det < 0.0) {
        return vec2(NO_HIT);
    }

    det = sqrt(det);
    float t1 = (-b - det) / a;
    float t2 = (-b + det) / a;
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);

    return vec2(tmin, tmax);
}

void intersectShape(Ray ray, inout Intersections ix)
{
    #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT)
        ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate;
        ray.dir *= u_cylinderUvToRenderBoundsScale;
    #else
        // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
        // Direction is scaled as well to be in sync with position.
        ray.pos = ray.pos * 2.0 - 1.0;
        ray.dir *= 2.0;
    #endif

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT)
        vec2 outerIntersect = intersectUnitCircle(ray);
    #else
        vec2 outerIntersect = intersectUnitCylinder(ray);
    #endif

    setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);

    if (outerIntersect.x == NO_HIT) {
        return;
    }

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
        // When the cylinder is perfectly thin it's necessary to sandwich the
        // inner cylinder intersection inside the outer cylinder intersection.

        // Without this special case,
        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
        // [outerMin, innerMin, outerMax, innerMax] which will cause the back
        // side of the cylinder to be invisible because it will think the ray
        // is still inside the inner (negative) cylinder after exiting the
        // outer (positive) cylinder.

        // With this special case,
        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.

        // Note: If initializeIntersections() changes its sorting function
        // from bubble sort to something else, this code may need to change.
        vec2 innerIntersect = intersectInfiniteUnitCylinder(ray);
        setIntersection(ix, 0, outerIntersect.x, true, true);   // positive, enter
        setIntersection(ix, 1, innerIntersect.x, false, true);  // negative, enter
        setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit
        setIntersection(ix, 3, outerIntersect.y, true, false);  // positive, exit
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
        Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin);
        vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
    #endif

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
        vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
        vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF)
        vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
        vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy);
        setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw);
    #endif
}
`;var EOi=T(S(),1),HF=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
// setIntersection, setIntersectionPair, INF_HIT, NO_HIT

/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
*/

#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
    uniform vec2 u_ellipsoidRenderLongitudeMinMax;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
    uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)
    uniform float u_ellipsoidInverseOuterScaleUv;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)
    uniform float u_ellipsoidInverseInnerScaleUv;
#endif

vec2 intersectZPlane(Ray ray)
{
    float o = ray.pos.z;
    float d = ray.dir.z;
    float t = -o / d;
    float s = sign(o);

    if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);
    else return vec2(-INF_HIT, t);
}

vec4 intersectHalfPlane(Ray ray, float angle) {
    vec2 o = ray.pos.xy;
    vec2 d = ray.dir.xy;
    vec2 planeDirection = vec2(cos(angle), sin(angle));
    vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);

    float a = dot(o, planeNormal);
    float b = dot(d, planeNormal);
    float t = -a / b;

    vec2 p = o + t * d;
    bool outside = dot(p, planeDirection) < 0.0;
    if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);

    return vec4(-INF_HIT, t, t, +INF_HIT);
}

vec2 intersectHalfSpace(Ray ray, float angle)
{
    vec2 o = ray.pos.xy;
    vec2 d = ray.dir.xy;
    vec2 n = vec2(sin(angle), -cos(angle));

    float a = dot(o, n);
    float b = dot(d, n);
    float t = -a / b;
    float s = sign(a);

    if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);
    else return vec2(-INF_HIT, t);
}

vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle)
{
    vec2 o = ray.pos.xy;
    vec2 d = ray.dir.xy;
    vec2 n1 = vec2(sin(minAngle), -cos(minAngle));
    vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle));

    float a1 = dot(o, n1);
    float a2 = dot(o, n2);
    float b1 = dot(d, n1);
    float b2 = dot(d, n2);

    float t1 = -a1 / b1;
    float t2 = -a2 / b2;
    float s1 = sign(a1);
    float s2 = sign(a2);

    float tmin = min(t1, t2);
    float tmax = max(t1, t2);
    float smin = tmin == t1 ? s1 : s2;
    float smax = tmin == t1 ? s2 : s1;

    bool e = tmin >= 0.0;
    bool f = tmax >= 0.0;
    bool g = smin >= 0.0;
    bool h = smax >= 0.0;

    if (e != g && f == h) return vec2(tmin, tmax);
    else if (e == g && f == h) return vec2(-INF_HIT, tmin);
    else if (e != g && f != h) return vec2(tmax, +INF_HIT);
    else return vec2(NO_HIT);
}

vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle)
{
    vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle);
    vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi);
    return vec4(planeIntersectMin, planeIntersectMax);
}

vec2 intersectUnitSphere(Ray ray)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;

    float b = dot(d, o);
    float c = dot(o, o) - 1.0;
    float det = b * b - c;

    if (det < 0.0) {
        return vec2(NO_HIT);
    }

    det = sqrt(det);
    float t1 = -b - det;
    float t2 = -b + det;
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);

    return vec2(tmin, tmax);
}

vec2 intersectUnitSphereUnnormalizedDirection(Ray ray)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;

    float a = dot(d, d);
    float b = dot(d, o);
    float c = dot(o, o) - 1.0;
    float det = b * b - a * c;

    if (det < 0.0) {
        return vec2(NO_HIT);
    }

    det = sqrt(det);
    float t1 = (-b - det) / a;
    float t2 = (-b + det) / a;
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);

    return vec2(tmin, tmax);
}

vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;
    float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle;
    float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle;
    float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle;
    float det = b * b - a * c;

    if (det < 0.0) {
        return vec2(NO_HIT);
    }

    det = sqrt(det);
    float t1 = (-b - det) / a;
    float t2 = (-b + det) / a;
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);
    return vec2(tmin, tmax);
}

vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) {
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    if (intersect.x == NO_HIT) {
        return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
    }

    vec3 o = ray.pos;
    vec3 d = ray.dir;
    float tmin = intersect.x;
    float tmax = intersect.y;
    float zmin = o.z + tmin * d.z;
    float zmax = o.z + tmax * d.z;

    // One interval
    if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
    else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT);
    else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT);
    // Two intervals
    else return vec4(-INF_HIT, tmin, tmax, +INF_HIT);
}

vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) {
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    if (intersect.x == NO_HIT) {
        return vec2(NO_HIT);
    }

    vec3 o = ray.pos;
    vec3 d = ray.dir;
    float tmin = intersect.x;
    float tmax = intersect.y;
    float zmin = o.z + tmin * d.z;
    float zmax = o.z + tmax * d.z;

    if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT);
    else if (zmin < 0.0) return vec2(tmax, +INF_HIT);
    else if (zmax < 0.0) return vec2(-INF_HIT, tmin);
    else return vec2(tmin, tmax);
}

void intersectShape(in Ray ray, inout Intersections ix) {
    // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
    // Direction is scaled as well to be in sync with position.
    ray.pos = ray.pos * 2.0 - 1.0;
    ray.dir *= 2.0;

    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)
        Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv);
    #else
        Ray outerRay = ray;
    #endif

    // Outer ellipsoid
    vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay);
    setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);

    // Exit early if the outer ellipsoid was missed.
    if (outerIntersect.x == NO_HIT) {
        return;
    }

    // Inner ellipsoid
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT)
        // When the ellipsoid is perfectly thin it's necessary to sandwich the
        // inner ellipsoid intersection inside the outer ellipsoid intersection.

        // Without this special case,
        // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
        // [outerMin, innerMin, outerMax, innerMax] which will cause the back
        // side of the ellipsoid to be invisible because it will think the ray
        // is still inside the inner (negative) ellipsoid after exiting the
        // outer (positive) ellipsoid.

        // With this special case,
        // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
        // [outerMin, innerMin, innerMax, outerMax] which will work correctly.

        // Note: If initializeIntersections() changes its sorting function
        // from bubble sort to something else, this code may need to change.
        setIntersection(ix, 0, outerIntersect.x, true, true);   // positive, enter
        setIntersection(ix, 1, outerIntersect.x, false, true);  // negative, enter
        setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit
        setIntersection(ix, 3, outerIntersect.y, true, false);  // positive, exit
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)
        Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv);
        vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay);

        if (innerIntersect == vec2(NO_HIT)) {
            setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
        } else {
            // When the ellipsoid is very large and thin it's possible for floating
            // point math to cause the ray to intersect the inner ellipsoid before
            // the outer ellipsoid. To prevent this from happening, clamp innerIntersect
            // to outerIntersect and sandwhich the intersections like described above.
            //
            // In theory a similar fix is needed for cylinders, however it's more
            // complicated to implement because the inner shape is allowed to be
            // intersected first.
            innerIntersect.x = max(innerIntersect.x, outerIntersect.x);
            innerIntersect.y = min(innerIntersect.y, outerIntersect.y);
            setIntersection(ix, 0, outerIntersect.x, true, true);   // positive, enter
            setIntersection(ix, 1, innerIntersect.x, false, true);  // negative, enter
            setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit
            setIntersection(ix, 3, outerIntersect.y, true, false);  // positive, exit
        }
    #endif

    // Flip the ray because the intersection function expects a cone growing towards +Z.
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
        Ray flippedRay = outerRay;
        flippedRay.dir.z *= -1.0;
        flippedRay.pos.z *= -1.0;
    #endif

    // Bottom cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
        vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
        vec2 bottomConeIntersection = intersectZPlane(flippedRay);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
        vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw);
    #endif

    // Top cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
        vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
        vec2 topConeIntersection = intersectZPlane(ray);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
        vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #endif

    // Wedge
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
        vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
        vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF)
        vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
        vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy);
        setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw);
    #endif
}
`;var IOi=T(S(),1),PT=`// Main intersection function for Voxel scenes.
// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
// for the definition of intersectShape. The appropriate function is selected
// based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
// getFirstIntersection, initializeIntersections, nextIntersection.

/* Intersection defines (set in Scene/VoxelRenderResources.js)
#define INTERSECTION_COUNT ###
*/

RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {
    // Do a ray-shape intersection to find the exact starting and ending points.
    intersectShape(ray, ix);

    // Exit early if the positive shape was completely missed or behind the ray.
    RayShapeIntersection intersection = getFirstIntersection(ix);
    if (intersection.entry.w == NO_HIT) {
        // Positive shape was completely missed - so exit early.
        return intersection;
    }

    // Clipping planes
    #if defined(CLIPPING_PLANES)
        intersectClippingPlanes(ray, ix);
    #endif

    // Depth
    #if defined(DEPTH_TEST)
        intersectDepth(screenCoord, ray, ix);
    #endif

    // Find the first intersection that's in front of the ray
    #if (INTERSECTION_COUNT > 1)
        initializeIntersections(ix);
        for (int i = 0; i < INTERSECTION_COUNT; ++i) {
            intersection = nextIntersection(ix);
            if (intersection.exit.w > 0.0) {
                // Set start to 0.0 when ray is inside the shape.
                intersection.entry.w = max(intersection.entry.w, 0.0);
                break;
            }
        }
    #else
        // Set start to 0.0 when ray is inside the shape.
        intersection.entry.w = max(intersection.entry.w, 0.0);
    #endif

    return intersection;
}
`;var POi=T(S(),1),zF=`/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_HAS_SHAPE_BOUNDS
*/

#if defined(BOX_HAS_SHAPE_BOUNDS)
    uniform vec3 u_boxUvToShapeUvScale;
    uniform vec3 u_boxUvToShapeUvTranslate;
#endif

vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
#else
    return positionUv;
#endif
}

vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
#else
    return shapeUv;
#endif
}
`;var wOi=T(S(),1),JF=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED
*/

#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
    uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
    uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
    uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
    uniform vec2 u_cylinderShapeUvAngleMinMax;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
    uniform float u_cylinderShapeUvAngleRangeZeroMid;
#endif

vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
    vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1]

    // Compute radius
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT)
        float radius = 1.0;
    #else
        float radius = length(positionLocal.xy); // [0,1]
        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
            radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset
        #endif
    #endif

    // Compute height
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
        float height = 1.0;
    #else
        float height = positionUv.z; // [0,1]
        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
            height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset
        #endif
    #endif

    // Compute angle
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
        float angle = 1.0;
    #else
        float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1]
        #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
            #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
                // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.
                angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
            #endif

            // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
            #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
                angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
            #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
                angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
            #endif

            angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset
        #endif
    #endif

    return vec3(radius, height, angle);
}
`;var AOi=T(S(),1),QF=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN
#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
#define ELLIPSOID_IS_SPHERE
*/

uniform vec3 u_ellipsoidRadiiUv; // [0,1]
#if !defined(ELLIPSOID_IS_SPHERE)
    uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
    uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
    uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
    uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
    uniform float u_ellipsoidInverseHeightDifferenceUv;
    uniform vec2 u_ellipseInnerRadiiUv; // [0,1]
#endif

// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
// Pro: Good when radii.x ~= radii.y
// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse
// Con: Inaccurate with exterior points and thin ellipses
float ellipseDistanceIterative (vec2 pos, vec2 radii) {
    vec2 p = abs(pos);
    vec2 invRadii = 1.0 / radii;
    vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii;
    vec2 t = vec2(0.70710678118); // sqrt(2) / 2
    vec2 v = radii * t;

    const int iterations = 3;
    for (int i = 0; i < iterations; ++i) {
        vec2 e = a * pow(t, vec2(3.0));
        vec2 q = normalize(p - e) * length(v - e);
        t = normalize((q + e) * invRadii);
        v = radii * t;
    }
    return length(v * sign(pos) - pos) * sign(p.y - v.y);
}

vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
    // Compute position and normal.
    // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height).
    // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller.
    vec3 positionLocal = positionUv * 2.0 - 1.0;
    #if defined(ELLIPSOID_IS_SPHERE)
        vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x;
        vec3 normal = normalize(posEllipsoid);
    #else
        vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv;
        vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal
    #endif

    // Compute longitude
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
        float longitude = 1.0;
    #else
        float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;

        // Correct the angle when max < min
        // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
        #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
            longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
        #endif

        // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
        #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
            longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
        #endif
        #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
            longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
        #endif

        #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
            longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
        #endif
    #endif

    // Compute latitude
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO)
        float latitude = 1.0;
    #else
        float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;
        #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
            latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
        #endif
    #endif

    // Compute height
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
        // TODO: This breaks down when minBounds == maxBounds. To fix it, this
        // function would have to know if ray is intersecting the front or back of the shape
        // and set the shape space position to 1 (front) or 0 (back) accordingly.
        float height = 1.0;
    #else
        #if defined(ELLIPSOID_IS_SPHERE)
            #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)
                float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;
            #else
                float height = length(posEllipsoid);
            #endif
        #else
            #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)
                // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).
                // This is an optimization so that math can be done with ellipses instead of ellipsoids.
                vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);
                float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;
            #else
                // TODO: this is probably not correct
                float height = length(posEllipsoid);
            #endif
        #endif
    #endif

    return vec3(longitude, latitude, height);
}
`;var NOi=T(S(),1),jF=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
#define OCTREE_FLAG_INTERNAL 0
#define OCTREE_FLAG_LEAF 1
#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2

#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops

uniform sampler2D u_octreeInternalNodeTexture;
uniform vec2 u_octreeInternalNodeTexelSizeUv;
uniform int u_octreeInternalNodeTilesPerRow;
#if (SAMPLE_COUNT > 1)
uniform sampler2D u_octreeLeafNodeTexture;
uniform vec2 u_octreeLeafNodeTexelSizeUv;
uniform int u_octreeLeafNodeTilesPerRow;
#endif

struct OctreeNodeData {
    int data;
    int flag;
};

struct TraversalData {
    ivec4 octreeCoords;
    int parentOctreeIndex;
};

struct SampleData {
    int megatextureIndex;
    ivec4 tileCoords;
    vec3 tileUv;
    #if (SAMPLE_COUNT > 1)
        float weight;
    #endif
};

// Integer mod: For WebGL1 only
int intMod(in int a, in int b) {
    return a - (b * (a / b));
}
int normU8_toInt(in float value) {
    return int(value * 255.0);
}
int normU8x2_toInt(in vec2 value) {
    return int(value.x * 255.0) + 256 * int(value.y * 255.0);
}
float normU8x2_toFloat(in vec2 value) {
    return float(normU8x2_toInt(value)) / 65535.0;
}

OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
    vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);

    OctreeNodeData data;
    data.data = normU8x2_toInt(texData.xy);
    data.flag = normU8x2_toInt(texData.zw);
    return data;
}

OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
    int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
    int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
    int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
    return getOctreeNodeData(octreeUv);
}

int getOctreeParentIndex(in int octreeIndex) {
    int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;
    int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
    vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
    vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
    int parentOctreeIndex = normU8x2_toInt(parentData.xy);
    return parentOctreeIndex;
}

/**
* Convert a position in the uv-space of the tileset bounding shape
* into the uv-space of a tile within the tileset
*/
vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
	// PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)
    float dimAtLevel = pow(2.0, float(octreeCoords.w));
    return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
}

void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
    sampleData.megatextureIndex = data.data;
    sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;
}

#if (SAMPLE_COUNT > 1)
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
    int leafIndex = data.data;
    int leafNodeTexelCount = 2;
    // Adding 0.5 moves to the center of the texel
    float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
    float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;

    // Get an interpolation weight and a flag to determine whether to read the parent texture
    vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
    vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
    float lerp = normU8x2_toFloat(leafData0.xy);
    sampleDatas[0].weight = 1.0 - lerp;
    sampleDatas[1].weight = lerp;
    // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
    sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;
    sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
        ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
        : octreeCoords;

    // Get megatexture indices for both samples
    vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
    vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
    sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
    sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
}
#endif

OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {
    float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w));
    vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
    vec3 end = start + vec3(sizeAtLevel);
    OctreeNodeData childData;

    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
        // Find out which octree child contains the position
        // 0 if before center, 1 if after
        vec3 center = 0.5 * (start + end);
        vec3 childCoord = step(center, shapePosition);

        // Get octree coords for the next level down
        ivec4 octreeCoords = traversalData.octreeCoords;
        traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);

        childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));

        if (childData.flag != OCTREE_FLAG_INTERNAL) {
            // leaf tile - stop traversing
            break;
        }

        // interior tile - keep going deeper
        start = mix(start, center, childCoord);
        end = mix(center, end, childCoord);
        traversalData.parentOctreeIndex = childData.data;
    }

    return childData;
}

/**
* Transform a given position to an octree tile coordinate and a position within that tile,
* and find the corresponding megatexture index and texture coordinates
*/
void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
    traversalData.octreeCoords = ivec4(0);
    traversalData.parentOctreeIndex = 0;

    OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
    if (nodeData.flag != OCTREE_FLAG_LEAF) {
        nodeData = traverseOctreeDownwards(shapePosition, traversalData);
    }

    #if (SAMPLE_COUNT == 1)
        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
        sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords);
    #endif
}

bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
    return clamp(v, minVal, maxVal) == v;
}

bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
    vec3 tileUv = getTileUv(shapePosition, octreeCoords);
	bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
	// Assume (!) the position is always inside the root tile.
	return inside || octreeCoords.w == 0;
}

void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
    if (insideTile(shapePosition, traversalData.octreeCoords)) {
        for (int i = 0; i < SAMPLE_COUNT; i++) {
            sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
        }
        return;
    }

    // Go up tree until we find a parent tile containing shapePosition
    for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
        traversalData.octreeCoords.xyz /= 2;
        traversalData.octreeCoords.w -= 1;

        if (insideTile(shapePosition, traversalData.octreeCoords)) {
            break;
        }

        traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
    }

    // Go down tree
    OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);

    #if (SAMPLE_COUNT == 1)
        getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
        sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords);
    #endif
}
`;var kOi=T(S(),1),qF=`// See Octree.glsl for the definitions of SampleData and intMod

/* Megatexture defines (set in Scene/VoxelRenderResources.js)
#define SAMPLE_COUNT ###
#define NEAREST_SAMPLING
#define PADDING
*/

uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions
uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions
uniform vec2 u_megatextureVoxelSizeUv;
uniform vec2 u_megatextureSliceSizeUv;
uniform vec2 u_megatextureTileSizeUv;

uniform ivec3 u_dimensions; // does not include padding
#if defined(PADDING)
    uniform ivec3 u_paddingBefore;
    uniform ivec3 u_paddingAfter;
#endif

// Integer min, max, clamp: For WebGL1 only
int intMin(int a, int b) {
    return a <= b ? a : b;
}
int intMax(int a, int b) {
    return a >= b ? a : b;
}
int intClamp(int v, int minVal, int maxVal) {
    return intMin(intMax(v, minVal), maxVal);
}

vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
{
    int indexX = intMod(index, dimensions.x);
    int indexY = index / dimensions.x;
    return vec2(indexX, indexY) * uvScale;
}

/*
    How is 3D data stored in a 2D megatexture?

    In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).
    The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and
    the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).
    Note that there could be empty space in the megatexture because it's a power of two.

      0   1   2   3
    +---+---+---+---+
    |   |   |   |   | 3
    +---+---+---+---+
    |   |   |   |   | 2
    +-------+-------+
    |010|110|011|111| 1
    |--- ---|--- ---|
    |000|100|001|101| 0
    +-------+-------+

    When doing linear interpolation the megatexture needs to be sampled twice: once for
    the Z slice above the voxel coordinate and once for the slice below. The two slices
    are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is
    halfway between two Z slices so the interpolation factor is 0.5. Below is a side view
    of the 3D voxel grid with voxel coordinates on the left side.

    2 +---+
      |001|
    1 +-z-+
      |000|
    0 +---+

    When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.
*/

Properties getPropertiesFromMegatexture(in SampleData sampleData) {
    vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary?
    int tileIndex = sampleData.megatextureIndex;
    vec3 voxelCoord = tileUv * vec3(u_dimensions);
    ivec3 voxelDimensions = u_dimensions;

    #if defined(PADDING)
        voxelDimensions += u_paddingBefore + u_paddingAfter;
        voxelCoord += vec3(u_paddingBefore);
    #endif

    #if defined(NEAREST_SAMPLING)
        // Round to the center of the nearest voxel
        voxelCoord = floor(voxelCoord) + vec3(0.5);
    #endif

    // Tile location
    vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);

    // Slice location
    float slice = voxelCoord.z - 0.5;
    int sliceIndex = int(floor(slice));
    int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1);
    vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);

    // Voxel location
    vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;

    // Final location in the megatexture
    vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;

    #if defined(NEAREST_SAMPLING)
        return getPropertiesFromMegatextureAtUv(uv0);
    #else
        float sliceLerp = fract(slice);
        int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1);
        vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
        vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
        Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
        Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
        return mixProperties(properties0, properties1, sliceLerp);
    #endif
}

// Convert an array of sample datas to a final weighted properties.
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
    #if (SAMPLE_COUNT == 1)
        return getPropertiesFromMegatexture(sampleDatas[0]);
    #else
        // When more than one sample is taken the accumulator needs to start at 0
        Properties properties = clearProperties();
        for (int i = 0; i < SAMPLE_COUNT; ++i) {
            float weight = sampleDatas[i].weight;

            // Avoid reading the megatexture when the weight is 0 as it can be costly.
            if (weight > 0.0) {
                Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
                tempProperties = scaleProperties(tempProperties, weight);
                properties = sumProperties(properties, tempProperties);
            }
        }
        return properties;
    #endif
}
`;function O0t(e){let t=new Ag;this.shaderBuilder=t;let n=e._customShader,i=xt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let y=o[p];t.addUniform(y.type,p,Le.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",Le.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=d(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([kF]),t.addFragmentLines([n.fragmentShaderText,"#line 0",jF,DF,qF]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,Le.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,Le.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,Le.FRAGMENT),t.addFragmentLines([YF])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,Le.FRAGMENT),t.addFragmentLines([BF]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,Le.FRAGMENT),t.addFragmentLines([zF,OF,PT])):a==="CYLINDER"?t.addFragmentLines([KF,PT,JF]):a==="ELLIPSOID"&&t.addFragmentLines([HF,PT,QF]),t.addFragmentLines([UF]);let c=e._shape,l=c.shaderDefines;for(let p in l)if(l.hasOwnProperty(p)){let y=l[p];d(y)&&(y=y===!0?void 0:y,t.addDefine(p,y,Le.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,Le.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,Le.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,Le.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,Le.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,Le.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,Le.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,Le.FRAGMENT);let m=e._traversal;t.addDefine("SAMPLE_COUNT",`${m._sampleCount}`,Le.FRAGMENT)}var $F=O0t;var hKi=T(S(),1);function K0t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,l=d(s)&&d(a);n.addDefine("METADATA_COUNT",c,Le.FRAGMENT),l&&n.addDefine("STATISTICS",void 0,Le.FRAGMENT);for(let v=0;v<c;v++){let A=i[v],M=o[v],b=`PropertyStatistics_${A}`,R=`PropertyStatistics_${A}`;n.addStruct(b,R,Le.FRAGMENT);let E=mD(M);n.addStructField(b,E,"min"),n.addStructField(b,E,"max")}let u="Statistics",m="Statistics",p="statistics";n.addStruct(u,m,Le.FRAGMENT);for(let v=0;v<c;v++){let A=i[v],M=`PropertyStatistics_${A}`,b=A;n.addStructField(u,M,b)}let y="Metadata",f="Metadata",x="metadata";n.addStruct(y,f,Le.FRAGMENT),n.addStructField(y,m,p);for(let v=0;v<c;v++){let A=i[v],M=o[v],b=mD(M);n.addStructField(y,b,A)}for(let v=0;v<c;v++){let A=i[v],M=o[v],b=z0t(M),R=`VoxelProperty_${A}`,E=`VoxelProperty_${A}`;n.addStruct(R,E,Le.FRAGMENT),n.addStructField(R,b,"partialDerivativeLocal"),n.addStructField(R,b,"partialDerivativeWorld"),n.addStructField(R,b,"partialDerivativeView"),n.addStructField(R,b,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,Le.FRAGMENT);for(let v=0;v<c;v++){let A=i[v],M=`VoxelProperty_${A}`;n.addStructField(_,M,A)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance");let L="FragmentInput",Z="FragmentInput";n.addStruct(L,Z,Le.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let G="Properties",X="Properties",P="properties";n.addStruct(G,X,Le.FRAGMENT);for(let v=0;v<c;v++){let A=i[v],M=o[v],b=mD(M);n.addStructField(G,b,A)}{let v="clearProperties";n.addFunction(v,`${X} clearProperties()`,Le.FRAGMENT),n.addFunctionLines(v,[`${X} ${P};`]);for(let A=0;A<c;A++){let M=i[A],b=o[A],R=r[A],E=mD(b,R);n.addFunctionLines(v,[`${P}.${M} = ${E}(0.0);`])}n.addFunctionLines(v,[`return ${P};`])}{let v="sumProperties";n.addFunction(v,`${X} sumProperties(${X} propertiesA, ${X} propertiesB)`,Le.FRAGMENT),n.addFunctionLines(v,[`${X} ${P};`]);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(v,[`${P}.${M} = propertiesA.${M} + propertiesB.${M};`])}n.addFunctionLines(v,[`return ${P};`])}{let v="scaleProperties";n.addFunction(v,`${X} scaleProperties(${X} ${P}, float scale)`,Le.FRAGMENT),n.addFunctionLines(v,[`${X} scaledProperties = ${P};`]);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(v,[`scaledProperties.${M} *= scale;`])}n.addFunctionLines(v,["return scaledProperties;"])}{let v="mixProperties";n.addFunction(v,`${X} mixProperties(${X} propertiesA, ${X} propertiesB, float mixFactor)`,Le.FRAGMENT),n.addFunctionLines(v,[`${X} ${P};`]);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(v,[`${P}.${M} = mix(propertiesA.${M}, propertiesB.${M}, mixFactor);`])}n.addFunctionLines(v,[`return ${P};`])}{let v="copyPropertiesToMetadata";n.addFunction(v,`void copyPropertiesToMetadata(in ${X} ${P}, inout ${f} ${x})`,Le.FRAGMENT);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(v,[`${x}.${M} = ${P}.${M};`])}}if(l){let v="setStatistics";n.addFunction(v,`void setStatistics(inout ${m} ${p})`,Le.FRAGMENT);for(let A=0;A<c;A++){let M=i[A],b=o[A],R=Ot.getComponentCount(b);for(let E=0;E<R;E++){let I=J0t(b,E),w=s[A][E],N=a[A][E];n.addFunctionLines(v,[`${p}.${M}.min${I} = ${gxe(w)};`,`${p}.${M}.max${I} = ${gxe(N)};`])}}}{let v="getPropertiesFromMegatextureAtUv";n.addFunction(v,`${X} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,Le.FRAGMENT),n.addFunctionLines(v,[`${X} ${P};`]);for(let A=0;A<c;A++){let M=i[A],b=o[A],R=r[A],E=H0t(b,R);n.addFunctionLines(v,[`properties.${M} = texture(u_megatextureTextures[${A}], texcoord)${E};`])}n.addFunctionLines(v,[`return ${P};`])}}function mD(e){if(e===Ot.SCALAR)return"float";if(e===Ot.VEC2)return"vec2";if(e===Ot.VEC3)return"vec3";if(e===Ot.VEC4)return"vec4"}function H0t(e){if(e===Ot.SCALAR)return".r";if(e===Ot.VEC2)return".ra";if(e===Ot.VEC3)return".rgb";if(e===Ot.VEC4)return""}function z0t(e){if(e===Ot.SCALAR)return"vec3";if(e===Ot.VEC2)return"mat2";if(e===Ot.VEC3)return"mat3";if(e===Ot.VEC4)return"mat4"}function gxe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function J0t(e,t){return e===Ot.SCALAR?"":`[${t}]`}var eA=K0t;function Q0t(e,t){let n=new $F(e);eA(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let f="getClippingPlane",x=E0(o,t),_=0,C=x.indexOf(")")+1,V=x.indexOf("{",C)+1,L=x.indexOf("}",V),Z=x.slice(_,C),G=x.slice(V,L);i.addFunction(f,Z,Le.FRAGMENT),i.addFunctionLines(f,[G])}let s=i.clone();s.addDefine("PICKING",void 0,Le.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),l=De.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),u=t.getViewportQuadVertexArray(),m=e._depthTest,p=new nt({vertexArray:u,primitiveType:Fe.TRIANGLES,renderState:l,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Re.VOXELS,executeInClosestFrustum:!0,owner:this,cull:m,occlude:m}),y=nt.shallowClone(p,new nt);if(y.shaderProgram=c,y.pickOnly=!0,d(e._drawCommand)){let f=e._drawCommand;f.shaderProgram=f.shaderProgram&&f.shaderProgram.destroy()}if(d(e._drawCommandPick)){let f=e._drawCommandPick;f.shaderProgram=f.shaderProgram&&f.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=y}var tA=Q0t;var OKi=T(S(),1);function lg(e,t,n,i,o,r,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let x=0;x<a;x++){let _=i[x],C=Ot.getComponentCount(_),V=o[x];this.megatextures[x]=new PV(t,n,C,V,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let l=e._shape;this.rootNode=new wF(0,0,0,0,void 0,l,n),this._priorityQueue=new gT({maximumLength:c,comparator:Qi.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,Aj(u,1,r-2,0);let m=9,p=2048,y=Math.floor(p/m),f=Math.ceil(c/y);this.internalNodeTexture=new Wt({context:t,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,flipY:!1,width:p,height:f,sampler:new dn({minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new D(1/p,1/f),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}function Aj(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,Aj(e,t,o-1,i+1),Aj(e,o+1,n,i+1)}lg.simultaneousRequestCountMaximum=50;lg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,l=c>0,u=a>1,m=(l?2:1)*(u?2:1);this._sampleCount=m;let p=m>=2;if(p&&!d(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new Wt({context:r,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new dn({minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/L,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=V}else!p&&d(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&xxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let y=gi();$0t(this,e);let f=gi();tbt(this,m,c);let x=gi();if(this._debugPrint){let _=f-y,C=x-f,V=x-y;ebt(this,_,C,V)}};lg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};lg.prototype.isDestroyed=function(){return!1};lg.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function xxe(e,t){let n=e._primitive,i=n._shape,o=n._provider.dimensions;if(t.computeBoundingVolumes(i,o),d(t.children))for(let r=0;r<8;r++){let s=t.children[r];xxe(e,s)}}function j0t(e,t){if(e._simultaneousRequestCount>=lg.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function o(l){e._simultaneousRequestCount--;let u=n._provider.types.length;if(!d(l))t.state=Qi.LoadState.UNAVAILABLE;else if(l===Qi.LoadState.FAILED)t.state=Qi.LoadState.FAILED;else if(!Array.isArray(l)||l.length!==u)t.state=Qi.LoadState.FAILED;else{let m=e.megatextures;for(let p=0;p<u;p++){let{voxelCountPerTile:y,channelCount:f}=m[p],{x,y:_,z:C}=y,V=x*_*C,L=l[p],Z=V*f;if(L.length===Z)t.metadatas[p]=L,t.state=Qi.LoadState.RECEIVED;else{t.state=Qi.LoadState.FAILED;break}}}}function r(){e._simultaneousRequestCount--,t.state=Qi.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});d(c)?(e._simultaneousRequestCount++,t.state=Qi.LoadState.RECEIVING,c.then(o).catch(r)):t.state=Qi.LoadState.FAILED}function q0t(e){return e/(1+e)}function $0t(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,{dimensions:r}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,l=e._keyframeCount,u=e.rootNode,{camera:m,context:p,pixelRatio:y}=t,{positionWC:f,frustum:x}=m,C=p.drawingBufferHeight/y/x.sseDenominator;function V(R,E,I){let w=Math.min(Math.abs(E-R),Math.abs(E-I)),N=Math.max(R,l-I-1,1),Y=Math.pow(1-w/N,4),k=Math.exp(-e._binaryTreeKeyframeWeighting[E]);return W.lerp(k,Y,.15+.85*Y)}function L(R,E){if(R.computeScreenSpaceError(f,C),E=R.visibility(t,E),E===Qr.MASK_OUTSIDE)return;R.visitedFrameNumber=n;let I=W.clamp(Math.floor(c),0,l-2),w=I+1;if(l===1)R.createKeyframeNode(0);else if(R.keyframeNodes.length!==l)for(let U=0;U<l;U++)R.createKeyframeNode(U);let N=q0t(R.screenSpaceError),Y=!1,k=R.keyframeNodes;for(let U=0;U<k.length;U++){let J=k[U];J.priority=10*N+V(I,J.keyframe,w),J.state!==Qi.LoadState.UNAVAILABLE&&J.state!==Qi.LoadState.FAILED&&J.priority!==-Number.MAX_VALUE&&a.insert(J),J.state===Qi.LoadState.LOADED&&(Y=!0)}if(R.screenSpaceError<s||!Y){R.children=void 0;return}d(R.children)||R.constructChildNodes(o,r);for(let U=0;U<8;U++){let J=R.children[U];L(J,E)}}a.reset(),L(u,Qr.MASK_INDETERMINATE);let Z=e._highPriorityKeyframeNodes,G=0,X;for(;a.length>0;)X=a.removeMaximum(),X.highPriorityFrameNumber=n,Z[G]=X,G++;let P=e._keyframeNodesInMegatexture,v=e.megatextures[0],A=v.occupiedCount;P.length=A,P.sort(function(R,E){return R.highPriorityFrameNumber===E.highPriorityFrameNumber?E.priority-R.priority:E.highPriorityFrameNumber-R.highPriorityFrameNumber});let M=0,b=0;for(let R=0;R<G;R++)if(X=Z[R],!(X.state===Qi.LoadState.LOADED||X.spatialNode===void 0)&&(X.state===Qi.LoadState.UNLOADED&&j0t(e,X),X.state===Qi.LoadState.RECEIVED)){let E=0;if(v.isFull()){E=A-1-M,M++;let I=P[E];I.spatialNode.destroyKeyframeNode(I,e.megatextures)}else E=A+b,b++;X.spatialNode.addKeyframeNodeToMegatextures(X,e.megatextures),P[E]=X}}function ebt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(Qi.LoadState).length,a=new Array(s),c=new Array(s),l=0;for(let C=0;C<s;C++){let V=new Array(o);a[C]=V;for(let L=0;L<o;L++)V[L]=0;c[C]=0}function u(C){let V=C.keyframeNodes;for(let L=0;L<V.length;L++){let Z=V[L],G=Z.keyframe,X=Z.state;a[X][G]+=1,c[X]+=1,l++}if(d(C.children))for(let L=0;L<8;L++){let Z=C.children[L];u(Z)}}u(r);let m=`KEYFRAMES: ${a[Qi.LoadState.LOADED]}`,p=`UNLOADED: ${c[Qi.LoadState.UNLOADED]} | RECEIVING: ${c[Qi.LoadState.RECEIVING]} | RECEIVED: ${c[Qi.LoadState.RECEIVED]} | LOADED: ${c[Qi.LoadState.LOADED]} | FAILED: ${c[Qi.LoadState.FAILED]} | UNAVAILABLE: ${c[Qi.LoadState.UNAVAILABLE]} | TOTAL: ${l}`,y=Math.round(t*100)/100,f=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${y} | OCT: ${f} | ALL: ${x}`;console.log(`${m} || ${p} || ${_}`)}var hD={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function tbt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,l=[],u=[];function m(y,f,x,_,C){let V=!1;if(d(y.children))for(let L=0;L<8;L++){let Z=y.children[L];Z.computeSurroundingRenderableKeyframeNodes(o),Z.isRenderable(r)&&(V=!0)}if(V){l[C]=hD.INTERNAL<<16|f,l[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let Z=y.children[L];f=a,x=f*9+0,m(Z,f,x,_,C+L)}}else{if(s){let L=c*5,Z=y.renderableKeyframeNodePrevious,G=y.level-Z.spatialNode.level,X=Z.spatialNode.parent,P=d(X)?X.renderableKeyframeNodePrevious:Z,v=nbt(y,i,n),A=G,M=1,b=Z.megatextureIndex,R=P.megatextureIndex;u[L+0]=v,u[L+1]=A,u[L+2]=M,u[L+3]=b,u[L+4]=R,l[C]=hD.LEAF<<16|c}else{let L=y.renderableKeyframeNodePrevious,G=y.level-L.spatialNode.level===0?hD.LEAF:hD.PACKED_LEAF_FROM_PARENT;l[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),ibt(l,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&obt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function nbt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function ibt(e,t,n,i){let o=st.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let m=0;m<e.length;m++){let p=e[m],y=m*o;for(let f=0;f<o;f++)c[y+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function obt(e,t,n,i){let o=st.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),l=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let y=e[p*r+0],f=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=W.clamp(Math.floor(65536*y),0,65535);l[p*8+0]=V>>>0&255,l[p*8+1]=V>>>8&255,l[p*8+2]=f&255,l[p*8+3]=x&255,l[p*8+4]=_>>>0&255,l[p*8+5]=_>>>8&255,l[p*8+6]=C>>>0&255,l[p*8+7]=C>>>8&255}let m={source:{arrayBufferView:l,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}lg.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],l=Ot.getComponentCount(a);o+=PV.getApproximateTextureMemoryByteLength(e,t,l,c)}return o};var NV=lg;var fHi=T(S(),1);var HKi=T(S(),1),rbt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},UV=Object.freeze(rbt);var oHi=T(S(),1);function kV(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}kV.prototype.getTexture=function(e){return this._textures[e]};function sbt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];d(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}kV.prototype.loadTexture2D=function(e,t){d(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):sbt(this,e,t)};function abt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?fD(o,r,n):cbt(o,r,n),a=e._textures[i];d(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function fD(e,t,n){let{typedArray:i,sampler:o}=e,r=d(i)?Txe(e,n):new Wt({context:n,source:t,sampler:o});return _xe(o)&&r.generateMipmap(),r}function cbt(e,t,n){let{typedArray:i,sampler:o}=e,r=_xe(o),s=o.wrapS===Gn.REPEAT||o.wrapS===Gn.MIRRORED_REPEAT||o.wrapT===Gn.REPEAT||o.wrapT===Gn.MIRRORED_REPEAT,{width:a,height:c}=d(i)?e:t,l=[a,c].every(W.isPowerOfTwo);if((r||s)&&!l)if(d(i)){if(e.pixelDatatype===Je.UNSIGNED_BYTE){let m=fF(i,a,c),p=Wb(m);return fD({sampler:o},p,n)}}else{let m=Wb(t);return fD(e,m,n)}else return fD(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),Txe(e,n)}function _xe(e){return[cn.NEAREST_MIPMAP_NEAREST,cn.NEAREST_MIPMAP_LINEAR,cn.LINEAR_MIPMAP_NEAREST,cn.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function Txe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Wt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}kV.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];abt(this,o,t)}n.length=0};kV.prototype.isDestroyed=function(){return!1};kV.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var nA=kV;function iA(e){e=g(e,g.EMPTY_OBJECT),this.mode=g(e.mode,Up.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=g(e.uniforms,g.EMPTY_OBJECT),this.varyings=g(e.varyings,g.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=g(e.translucencyMode,Yb.INHERIT),this._textureManager=new nA,this._defaultTexture=void 0,this.uniformMap=lbt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},mbt(this),hbt(this)}function lbt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===UV.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=dbt(e,i)):n[i]=ubt(e,i)}return n}function dbt(e,t){return function(){return g(e._textureManager.getTexture(t),e._defaultTexture)}}function ubt(e,t){return function(){return e.uniforms[t].value}}function vT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function mbt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;d(r)&&(o=e.usedVariablesVertex.attributeSet,vT(r,t,o),o=e.usedVariablesVertex.featureIdSet,vT(r,n,o),o=e.usedVariablesVertex.metadataSet,vT(r,i,o));let s=e.fragmentShaderText;if(d(s)){o=e.usedVariablesFragment.attributeSet,vT(s,t,o),o=e.usedVariablesFragment.featureIdSet,vT(s,n,o),o=e.usedVariablesFragment.metadataSet,vT(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;vT(s,a,c)}}function Sxe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function fc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${Sxe(t)} is not available in the ${i} shader. Did you mean ${Sxe(n)} instead?`;throw new fe(o)}}function hbt(e){let t=e.usedVariablesVertex.attributeSet;fc(t,"position","positionMC","vertex"),fc(t,"normal","normalMC","vertex"),fc(t,"tangent","tangentMC","vertex"),fc(t,"bitangent","bitangentMC","vertex"),fc(t,"positionWC","positionMC","vertex"),fc(t,"positionEC","positionMC","vertex"),fc(t,"normalEC","normalMC","vertex"),fc(t,"tangentEC","tangentMC","vertex"),fc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;fc(n,"position","positionEC","fragment"),fc(n,"normal","normalEC","fragment"),fc(n,"tangent","tangentEC","fragment"),fc(n,"bitangent","bitangentEC","fragment"),fc(n,"normalMC","normalEC","fragment"),fc(n,"tangentMC","tangentEC","fragment"),fc(n,"bitangentMC","bitangentEC","fragment")}iA.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===UV.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):d(t.clone)?n.value=t.clone(n.value):n.value=t};iA.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var wT=iA;function Nf(e){e=g(e,g.EMPTY_OBJECT),this._ready=!1,this._provider=g(e.provider,Nf.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(g(e.modelMatrix,F.IDENTITY)),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=g(e.customShader,Nf.DefaultCustomShader),this._customShaderCompilationEvent=new ye,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Pm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new B},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;fbt(this,i)}function fbt(e,t){let{shape:n,minBounds:i=Oi.getMinBounds(n),maxBounds:o=Oi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Oi.getMinBounds(n),e.maxClippingBounds=Oi.getMaxBounds(n),Vxe(e,t);let r=Oi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=Lxe(e,e._shape,t)}Object.defineProperties(Nf.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ss.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];d(e)?this._customShader=e:this._customShader=Nf.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var pbt=new h,bbt=new se,ybt=new se,gbt=new h,xbt=new h,_bt=new $,Tbt=new $,Sbt=new F,Cbt=new F,Vbt=new F,Lbt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F),Rbt=F.fromRotationTranslation($.fromUniformScale(2,new $),new h(-1,-1,-1),new F);Nf.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Zbt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}let i=Vxe(this,t),o=this._shape;if(i&&(this._shapeVisible=Lxe(this,o,t),Xbt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Ibt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Nbt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Wbt(this,e)&&(this._shaderDirty=!0);let l=s.leafNodeTexture,u=this._uniforms;d(l)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(tA(this,n),this._shaderDirty=!1);let m=n.uniformState.viewProjection,p=o.orientedBoundingBox,y=wbt(p,m,ybt);if(y.x===1||y.y===1||y.z===-1||y.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(y,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=F.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};function Zbt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=B.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Oe(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=h.clone(t.dimensions,i.dimensions),e._paddingBefore=h.clone(g(t.paddingBefore,h.ZERO),e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(g(t.paddingAfter,h.ZERO),e._paddingBefore),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._traversal=Gbt(e,t,n),Ebt(e._traversal,i)}function Vxe(e,t){let n=g(t.shapeTransform,F.IDENTITY),i=g(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),oA(e,"_compoundModelMatrix","_compoundModelMatrixOld")+oA(e,"_minBounds","_minBoundsOld")+oA(e,"_maxBounds","_maxBoundsOld")+oA(e,"_minClippingBounds","_minClippingBoundsOld")+oA(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function oA(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function Lxe(e,t,n){if(!t.update(e._compoundModelMatrix,e.minBounds,e.maxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,Sbt),s=F.getRotation(o,_bt),a=F.getScale(o,gbt),c=h.maximumComponent(a),l=h.divideByScalar(a,c,xbt),u=$.multiplyByScale(s,l,Tbt),m=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(m),e._transformPositionWorldToUv=F.multiplyTransformation(Lbt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,Rbt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function Gbt(e,t,n){let i=h.clone(t.dimensions,pbt);h.add(i,e._paddingBefore,i),h.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=d(o)?NV.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=g(t.keyframeCount,1);return new NV(e,n,i,t.types,t.componentTypes,s,r)}function Ebt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Xbt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Oe(n,!0)),i}function Ibt(e,t){if(!d(e)||!d(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=te.secondsDifference(i.stop,i.start),a=te.secondsDifference(n,i.start)/r;return o+a}function Wbt(e,t){let n=e.clippingPlanes;if(!d(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}Nf.prototype.isDestroyed=function(){return!1};Nf.prototype.destroy=function(){let e=this._drawCommand;d(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return d(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var Cxe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),Pbt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),vbt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function wbt(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,Cbt),o=F.multiply(t,i,Vbt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,l,u=vbt,m=Cxe.length;for(l=0;l<m;l++)F.multiplyByVector(o,Cxe[l],u[l]);for(l=0;l<m;l++){let p=u[l];if(p.z>=-p.w){let y=p.x/p.w,f=p.y/p.w;r=Math.min(r,y),s=Math.max(s,y),a=Math.min(a,f),c=Math.max(c,f)}else for(let y=0;y<3;y++){let f=Pbt[l*3+y],x=u[f];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=se.lerp(p,x,V,bbt),Z=L.x/L.w,G=L.y/L.w;r=Math.min(r,Z),s=Math.max(s,Z),a=Math.min(a,G),c=Math.max(c,G)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var Mj=3e7,Fbt=new h(Mj,0,0),Abt=new h(0,Mj,0),Mbt=new h(0,0,Mj);function Nbt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,l,u,m){i.add({positions:[c,l],width:m,material:ki.fromType("Color",{color:u})})}function r(c,l,u){let m=c.computeCorners();o(m[0],m[1],l,u),o(m[2],m[3],l,u),o(m[4],m[5],l,u),o(m[6],m[7],l,u),o(m[0],m[2],l,u),o(m[4],m[6],l,u),o(m[1],m[3],l,u),o(m[5],m[7],l,u),o(m[0],m[4],l,u),o(m[2],m[6],l,u),o(m[1],m[5],l,u),o(m[3],m[7],l,u)}function s(c){if(!n.isRenderable(c))return;let l=c.level,m=Math.max(1,5/Math.pow(2,l)),y=[B.RED,B.LIME,B.BLUE][l%3];if(r(c.orientedBoundingBox,y,m),d(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,B.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,Fbt,B.RED,a),o(h.ZERO,Abt,B.LIME,a),o(h.ZERO,Mbt,B.BLUE,a),i.update(t)}Nf.DefaultCustomShader=new wT({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
    material.diffuse = vec3(1.0);
    material.alpha = 1.0;
}`});function Rxe(){this.ready=!0,this.shape=Oi.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[Ot.SCALAR],this.componentTypes=[tn.FLOAT32],this.maximumTileCount=1}Rxe.prototype.requestData=function(e){if(!((d(e)?g(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Nf.DefaultProvider=new Rxe;var DV=Nf;var kHi=T(S(),1);function Nj(){fe.throwInstantiationError()}Object.defineProperties(Nj.prototype,{globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});Nj.prototype.requestData=fe.throwInstantiationError;var Uj=Nj;var YHi=T(S(),1);function FT(){fe.throwInstantiationError()}Object.defineProperties(FT.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});FT.prototype.update=fe.throwInstantiationError;FT.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;FT.prototype.computeApproximateStepSize=fe.throwInstantiationError;FT.DefaultMinBounds=fe.throwInstantiationError;FT.DefaultMaxBounds=fe.throwInstantiationError;var kj=FT;var QHi=T(S(),1);async function Dj(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ie.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!d(n))return r;let a=n.availability;if(!d(a)||t.mode===ie.SCENE2D)return r;let c=[de.center(e),de.southeast(e),de.southwest(e),de.northeast(e),de.northwest(e)],l=await Dj._sampleTerrainMostDetailed(n,c),u=!1,m=l.reduce(function(y,f){return d(f.height)?(u=!0,Math.max(f.height,y)):y},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}Dj._sampleTerrainMostDetailed=S0;var AT=Dj;var mzi=T(S(),1);var Ubt=new B,kbt=new B,Dbt=new B,Bbt=new B,Zxe=new se,rA=new Uint8Array(4);function Gxe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return B.lerp(t.color,n.color,o,i)}function pD(e,t){return{height:e,color:B.clone(t)}}function Exe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?B.equals(t.color,i[n-1].color):!1,a=r?B.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?B.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function Ybt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let y=s[n],f=W.clamp(y.height,kl._minimumHeight,kl._maximumHeight),x=B.clone(y.color,Ubt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(pD(f,x))}let l=!0,u=!0;for(n=0;n<a-1;n++){let y=c[n+0],f=c[n+1];l=l&&y.height<=f.height,u=u&&y.height>=f.height}u?c=c.reverse():l||w0(c,function(y,f){return W.sign(y.height-f.height)});let m=g(r.extendDownwards,!1),p=g(r.extendUpwards,!1);c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,pD(kl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,pD(kl._maximumHeight,c[c.length-1].color)),c=Exe(c),i.push(c)}return i}function Obt(e){let t=Ybt(e),n=[],i=[],o;function r(l,u){n.push(pD(l,u))}function s(l,u,m){let p=B.multiplyByScalar(m,1-u.alpha,Bbt);p=B.add(p,u,p),r(l,p)}let a=t.length;for(o=0;o<a;o++){let l=t[o],u=0,m=0;i=n,n=[];let p=l.length,y=i.length;for(;u<p||m<y;){let f=u<p?l[u]:void 0,x=u>0?l[u-1]:void 0,_=u<p-1?l[u+1]:void 0,C=m<y?i[m]:void 0,V=m>0?i[m-1]:void 0,L=m<y-1?i[m+1]:void 0;if(d(f)&&d(C)&&f.height===C.height){let Z=d(L)&&C.height===L.height,G=!d(V),X=!d(L),P=d(_)&&f.height===_.height,v=!d(x),A=!d(_);Z?P?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):v?(r(f.height,C.color),s(f.height,f.color,L.color)):A?(s(f.height,f.color,C.color),r(f.height,L.color)):(s(f.height,f.color,C.color),s(f.height,f.color,L.color)):G?P?(r(f.height,f.color),s(f.height,_.color,C.color)):A?(r(f.height,f.color),r(f.height,C.color)):(v||r(f.height,f.color),s(f.height,f.color,C.color)):X?P?(s(f.height,f.color,C.color),r(f.height,_.color)):v?(r(f.height,C.color),r(f.height,f.color)):A?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):P?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):v?(r(f.height,C.color),s(f.height,f.color,C.color)):A?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=P?2:1,m+=Z?2:1}else if(d(f)&&d(C)&&d(V)&&f.height<C.height){let Z=Gxe(f.height,V,C,Dbt);d(x)?d(_)?s(f.height,f.color,Z):(s(f.height,f.color,Z),r(f.height,Z)):(r(f.height,Z),s(f.height,f.color,Z)),u++}else if(d(C)&&d(f)&&d(x)&&C.height<f.height){let Z=Gxe(C.height,x,f,kbt);d(V)?d(L)?s(C.height,Z,C.color):(s(C.height,Z,C.color),r(C.height,Z)):(r(C.height,Z),s(C.height,Z,C.color)),m++}else d(f)&&(!d(C)||f.height<C.height)?(d(C)&&!d(V)&&!d(_)?(r(f.height,f.color),r(f.height,kl._emptyColor),r(C.height,kl._emptyColor)):(!d(C)&&d(V)&&!d(x)&&(r(V.height,kl._emptyColor),r(f.height,kl._emptyColor)),r(f.height,f.color)),u++):d(C)&&(!d(f)||C.height<f.height)&&(r(C.height,C.color),m++)}}return Exe(n)}function kl(e){let{scene:t,layers:n}=g(e,g.EMPTY_OBJECT),{context:i}=t,o=Obt(n),r=o.length,s,a,c;if(!kl._useFloatTexture(i)){a=Je.UNSIGNED_BYTE,c=st.RGBA,s=new Uint8Array(r*4);for(let y=0;y<r;y++)se.packFloat(o[y].height,Zxe),se.pack(Zxe,s,y*4)}else{a=Je.FLOAT,c=i.webgl2?st.RED:st.LUMINANCE,s=new Float32Array(r);for(let y=0;y<r;y++)s[y]=o[y].height}let u=Wt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.NEAREST,magnificationFilter:Ti.NEAREST})}),m=new Uint8Array(r*4);for(let y=0;y<r;y++)o[y].color.toBytes(rA),m[y*4+0]=rA[0],m[y*4+1]=rA[1],m[y*4+2]=rA[2],m[y*4+3]=rA[3];let p=Wt.create({context:i,pixelFormat:st.RGBA,pixelDatatype:Je.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new dn({wrapS:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,minificationFilter:cn.LINEAR,magnificationFilter:Ti.LINEAR})});return ki.fromType("ElevationBand",{heights:u,colors:p})}kl._useFloatTexture=function(e){return e.floatingPointTexture};kl._maximumHeight=5906376425472;kl._minimumHeight=-5906376425472;kl._emptyColor=new B(0,0,0,0);var Bj=kl;var _zi=T(S(),1);async function Kbt(e,t){if(t=g(t,{}),t.showCreditsOnScreen=!0,t.cacheBytes=g(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=g(t.maximumCacheOverflowBytes,1024*1024*1024),e=g(e,_T.defaultApiKey),!d(e))return Hbt(t);let n,i=_T.getDefaultCredit();d(i)&&(n=[i]);let o=new Ee({url:`${_T.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return zs.fromUrl(o,t)}var Xxe={};async function Hbt(e){let i=Xxe[2275207];d(i)||(i=$l.fromAssetId(2275207),Xxe[2275207]=i);let o=await i;return zs.fromUrl(o,e)}var Yj=Kbt;var Zzi=T(S(),1);async function zbt(e){let t=await zs.fromIonAssetId(96188,e);e=g(e,g.EMPTY_OBJECT);let n=e.style;if(!d(n)){let i=g(e.defaultColor,B.WHITE).toCssColorString();n=new CT({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Oj=zbt;var Azi=T(S(),1);function Jbt(e){e=g(e,g.EMPTY_OBJECT);let t=[],n=e.geometry;(!d(n.attributes)||!d(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(g(e.modelMatrix,F.IDENTITY)),r=g(e.length,1e4);if(d(i.normal)&&t.push(new _t({geometry:An.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Ut(1,0,0,1)},modelMatrix:o})),d(i.tangent)&&t.push(new _t({geometry:An.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Ut(0,1,0,1)},modelMatrix:o})),d(i.bitangent)&&t.push(new _t({geometry:An.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Ut(0,0,1,1)},modelMatrix:o})),t.length>0)return new Zn({asynchronous:!1,geometryInstances:t,appearance:new sn({flat:!0,translucent:!1})})}var Kj=Jbt;var Nzi=T(S(),1),Hj=`uniform sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
    z_window = czm_reverseLogDepth(z_window);
    float n_range = czm_depthRange.near;
    float f_range = czm_depthRange.far;
    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
    out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
}
`;var Hzi=T(S(),1);function Qbt(e){e=g(e,g.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=g(e.pixelFormat,st.RGBA),this.pixelDatatype=g(e.pixelDatatype,Je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ee.createIfNeeded(t)),this.resource=t;let i=g(e.repeat,!0)?Gn.REPEAT:Gn.CLAMP_TO_EDGE;this.sampler=new dn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var zj=Qbt;var Jzi=T(S(),1),jbt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},Jj=Object.freeze(jbt);var qzi=T(S(),1);function qbt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Tf(s)}
  with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var Qj=qbt;globalThis.CESIUM_VERSION="1.110.1";var _bo=T(S(),1);var smo=T(S(),1);var nmo=T(S(),1);var Huo=T(S(),1),sA;typeof ko<"u"&&(sA=ko);(function(){/*!
 * Knockout JavaScript library v3.5.1
 * (c) The Knockout.js team - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,R){return b===null||typeof b in x?b===R:!1}function l(b,R){var E;return function(){E||(E=f.a.setTimeout(function(){E=e,b()},R))}}function u(b,R){var E;return function(){clearTimeout(E),E=f.a.setTimeout(b,R)}}function m(b,R){R&&R!=="change"?R==="beforeChange"?this.pc(b):this.gb(b,R):this.qc(b)}function p(b,R){R!==null&&R.s&&R.s()}function y(b,R){var E=this.qd,I=E[Z];I.ra||(this.Qb&&this.mb[R]?(E.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):I.I[R]||E.uc(R,b,I.J?{da:b}:E.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var E=b.split("."),I=f,w=0;w<E.length-1;w++)I=I[E[w]];I[E[E.length-1]]=R},f.L=function(b,R,E){b[R]=E},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(K,j){for(var q in K)w.call(K,q)&&j(q,K[q])}function R(K,j){if(j)for(var q in j)w.call(j,q)&&(K[q]=j[q]);return K}function E(K,j){return K.__proto__=j,K}function I(K,j,q,be){var Te=K[j].match(z)||[];f.a.D(q.match(z),function(ae){f.a.Na(Te,ae,be)}),K[j]=Te.join(" ")}var w=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,Y=typeof Symbol=="function",k={},O={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(k,function(K,j){if(j.length)for(var q=0,be=j.length;q<be;q++)O[j[q]]=K});var U={propertychange:!0},J=n&&function(){for(var K=3,j=n.createElement("div"),q=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++K+"]><i></i><![endif]-->",q[0];);return 4<K?K:e}(),z=/\S+/g,ee;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(K,j,q){for(var be=0,Te=K.length;be<Te;be++)j.call(q,K[be],be,K)},A:typeof Array.prototype.indexOf=="function"?function(K,j){return Array.prototype.indexOf.call(K,j)}:function(K,j){for(var q=0,be=K.length;q<be;q++)if(K[q]===j)return q;return-1},Lb:function(K,j,q){for(var be=0,Te=K.length;be<Te;be++)if(j.call(q,K[be],be,K))return K[be];return e},Pa:function(K,j){var q=f.a.A(K,j);0<q?K.splice(q,1):q===0&&K.shift()},wc:function(K){var j=[];return K&&f.a.D(K,function(q){0>f.a.A(j,q)&&j.push(q)}),j},Mb:function(K,j,q){var be=[];if(K)for(var Te=0,ae=K.length;Te<ae;Te++)be.push(j.call(q,K[Te],Te));return be},jb:function(K,j,q){var be=[];if(K)for(var Te=0,ae=K.length;Te<ae;Te++)j.call(q,K[Te],Te)&&be.push(K[Te]);return be},Nb:function(K,j){if(j instanceof Array)K.push.apply(K,j);else for(var q=0,be=j.length;q<be;q++)K.push(j[q]);return K},Na:function(K,j,q){var be=f.a.A(f.a.bc(K),j);0>be?q&&K.push(j):q||K.splice(be,1)},Ba:N,extend:R,setPrototypeOf:E,Ab:N?E:R,P:b,Ga:function(K,j,q){if(!K)return K;var be={},Te;for(Te in K)w.call(K,Te)&&(be[Te]=j.call(q,K[Te],Te,K));return be},Tb:function(K){for(;K.firstChild;)f.removeNode(K.firstChild)},Yb:function(K){K=f.a.la(K);for(var j=(K[0]&&K[0].ownerDocument||n).createElement("div"),q=0,be=K.length;q<be;q++)j.appendChild(f.oa(K[q]));return j},Ca:function(K,j){for(var q=0,be=K.length,Te=[];q<be;q++){var ae=K[q].cloneNode(!0);Te.push(j?f.oa(ae):ae)}return Te},va:function(K,j){if(f.a.Tb(K),j)for(var q=0,be=j.length;q<be;q++)K.appendChild(j[q])},Xc:function(K,j){var q=K.nodeType?[K]:K;if(0<q.length){for(var be=q[0],Te=be.parentNode,ae=0,xe=j.length;ae<xe;ae++)Te.insertBefore(j[ae],be);for(ae=0,xe=q.length;ae<xe;ae++)f.removeNode(q[ae])}},Ua:function(K,j){if(K.length){for(j=j.nodeType===8&&j.parentNode||j;K.length&&K[0].parentNode!==j;)K.splice(0,1);for(;1<K.length&&K[K.length-1].parentNode!==j;)K.length--;if(1<K.length){var q=K[0],be=K[K.length-1];for(K.length=0;q!==be;)K.push(q),q=q.nextSibling;K.push(be)}}return K},Zc:function(K,j){7>J?K.setAttribute("selected",j):K.selected=j},Db:function(K){return K===null||K===e?"":K.trim?K.trim():K.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(K,j){return K=K||"",j.length>K.length?!1:K.substring(0,j.length)===j},vd:function(K,j){if(K===j)return!0;if(K.nodeType===11)return!1;if(j.contains)return j.contains(K.nodeType!==1?K.parentNode:K);if(j.compareDocumentPosition)return(j.compareDocumentPosition(K)&16)==16;for(;K&&K!=j;)K=K.parentNode;return!!K},Sb:function(K){return f.a.vd(K,K.ownerDocument.documentElement)},kd:function(K){return!!f.a.Lb(K,f.a.Sb)},R:function(K){return K&&K.tagName&&K.tagName.toLowerCase()},Ac:function(K){return f.onError?function(){try{return K.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:K},setTimeout:function(K,j){return setTimeout(f.a.Ac(K),j)},Gc:function(K){setTimeout(function(){throw f.onError&&f.onError(K),K},0)},B:function(K,j,q){var be=f.a.Ac(q);if(q=U[j],f.options.useOnlyNativeEvents||q||!o)if(q||typeof K.addEventListener!="function")if(typeof K.attachEvent<"u"){var Te=function(xe){be.call(K,xe)},ae="on"+j;K.attachEvent(ae,Te),f.a.K.za(K,function(){K.detachEvent(ae,Te)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else K.addEventListener(j,be,!1);else ee||(ee=typeof o(K).on=="function"?"on":"bind"),o(K)[ee](j,be)},Fb:function(K,j){if(!K||!K.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var q;if(f.a.R(K)==="input"&&K.type&&j.toLowerCase()=="click"?(q=K.type,q=q=="checkbox"||q=="radio"):q=!1,f.options.useOnlyNativeEvents||!o||q)if(typeof n.createEvent=="function")if(typeof K.dispatchEvent=="function")q=n.createEvent(O[j]||"HTMLEvents"),q.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,K),K.dispatchEvent(q);else throw Error("The supplied element doesn't support dispatchEvent");else if(q&&K.click)K.click();else if(typeof K.fireEvent<"u")K.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(K).trigger(j)},f:function(K){return f.O(K)?K():K},bc:function(K){return f.O(K)?K.v():K},Eb:function(K,j,q){var be;j&&(typeof K.classList=="object"?(be=K.classList[q?"add":"remove"],f.a.D(j.match(z),function(Te){be.call(K.classList,Te)})):typeof K.className.baseVal=="string"?I(K.className,"baseVal",j,q):I(K,"className",j,q))},Bb:function(K,j){var q=f.a.f(j);(q===null||q===e)&&(q="");var be=f.h.firstChild(K);!be||be.nodeType!=3||f.h.nextSibling(be)?f.h.va(K,[K.ownerDocument.createTextNode(q)]):be.data=q,f.a.Ad(K)},Yc:function(K,j){if(K.name=j,7>=J)try{var q=K.name.replace(/[&<>'"]/g,function(be){return"&#"+be.charCodeAt(0)+";"});K.mergeAttributes(n.createElement("<input name='"+q+"'/>"),!1)}catch{}},Ad:function(K){9<=J&&(K=K.nodeType==1?K:K.parentNode,K.style&&(K.style.zoom=K.style.zoom))},wd:function(K){if(J){var j=K.style.width;K.style.width=0,K.style.width=j}},Pd:function(K,j){K=f.a.f(K),j=f.a.f(j);for(var q=[],be=K;be<=j;be++)q.push(be);return q},la:function(K){for(var j=[],q=0,be=K.length;q<be;q++)j.push(K[q]);return j},Da:function(K){return Y?Symbol(K):K},Zd:J===6,$d:J===7,W:J,Lc:function(K,j){for(var q=f.a.la(K.getElementsByTagName("input")).concat(f.a.la(K.getElementsByTagName("textarea"))),be=typeof j=="string"?function(xe){return xe.name===j}:function(xe){return j.test(xe.name)},Te=[],ae=q.length-1;0<=ae;ae--)be(q[ae])&&Te.push(q[ae]);return Te},Nd:function(K){return typeof K=="string"&&(K=f.a.Db(K))?r&&r.parse?r.parse(K):new Function("return "+K)():null},hc:function(K,j,q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(K),j,q)},Od:function(K,j,q){q=q||{};var be=q.params||{},Te=q.includeFields||this.Jc,ae=K;if(typeof K=="object"&&f.a.R(K)==="form")for(var ae=K.action,xe=Te.length-1;0<=xe;xe--)for(var _e=f.a.Lc(K,Te[xe]),Ve=_e.length-1;0<=Ve;Ve--)be[_e[Ve].name]=_e[Ve].value;j=f.a.f(j);var Ie=n.createElement("form");Ie.style.display="none",Ie.action=ae,Ie.method="post";for(var Me in j)K=n.createElement("input"),K.type="hidden",K.name=Me,K.value=f.a.hc(f.a.f(j[Me])),Ie.appendChild(K);b(be,function(ve,ke){var ct=n.createElement("input");ct.type="hidden",ct.name=ve,ct.value=ke,Ie.appendChild(ct)}),n.body.appendChild(Ie),q.submitter?q.submitter(Ie):Ie.submit(),setTimeout(function(){Ie.parentNode.removeChild(Ie)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var R=this;if(arguments.length===1)return function(){return R.apply(b,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var I=E.slice(0);return I.push.apply(I,arguments),R.apply(b,I)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),E={},I,w;return f.a.W?(I=function(N,Y){var k=N[R];if(!k||k==="null"||!E[k]){if(!Y)return e;k=N[R]="ko"+b++,E[k]={}}return E[k]},w=function(N){var Y=N[R];return Y?(delete E[Y],N[R]=null,!0):!1}):(I=function(N,Y){var k=N[R];return!k&&Y&&(k=N[R]={}),k},w=function(N){return N[R]?(delete N[R],!0):!1}),{get:function(N,Y){var k=I(N,!1);return k&&k[Y]},set:function(N,Y,k){(N=I(N,k!==e))&&(N[Y]=k)},Ub:function(N,Y,k){return N=I(N,!0),N[Y]||(N[Y]=k)},clear:w,Z:function(){return b+++R}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(Y,k){var O=f.a.g.get(Y,I);return O===e&&k&&(O=[],f.a.g.set(Y,I,O)),O}function R(Y){var k=b(Y,!1);if(k)for(var k=k.slice(0),O=0;O<k.length;O++)k[O](Y);f.a.g.clear(Y),f.a.K.cleanExternalData(Y),N[Y.nodeType]&&E(Y.childNodes,!0)}function E(Y,k){for(var O=[],U,J=0;J<Y.length;J++)if((!k||Y[J].nodeType===8)&&(R(O[O.length]=U=Y[J]),Y[J]!==U))for(;J--&&f.a.A(O,Y[J])==-1;);}var I=f.a.g.Z(),w={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(Y,k){if(typeof k!="function")throw Error("Callback must be a function");b(Y,!0).push(k)},yb:function(Y,k){var O=b(Y,!1);O&&(f.a.Pa(O,k),O.length==0&&f.a.g.set(Y,I,e))},oa:function(Y){return f.u.G(function(){w[Y.nodeType]&&(R(Y),N[Y.nodeType]&&E(Y.getElementsByTagName("*")))}),Y},removeNode:function(Y){f.oa(Y),Y.parentNode&&Y.parentNode.removeChild(Y)},cleanExternalData:function(Y){o&&typeof o.cleanData=="function"&&o.cleanData([Y])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],R=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],w={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:I,optgroup:I},N=8>=f.a.W;f.a.ua=function(Y,k){var O;if(o){if(o.parseHTML)O=o.parseHTML(Y,k)||[];else if((O=o.clean([Y],k))&&O[0]){for(var U=O[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(O=k)||(O=n);var U=O.parentWindow||O.defaultView||t,J=f.a.Db(Y).toLowerCase(),z=O.createElement("div"),ee;for(ee=(J=J.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&w[J[1]]||b,J=ee[0],ee="ignored<div>"+ee[1]+Y+ee[2]+"</div>",typeof U.innerShiv=="function"?z.appendChild(U.innerShiv(ee)):(N&&O.body.appendChild(z),z.innerHTML=ee,N&&z.parentNode.removeChild(z));J--;)z=z.lastChild;O=f.a.la(z.lastChild.childNodes)}return O},f.a.Md=function(Y,k){var O=f.a.ua(Y,k);return O.length&&O[0].parentElement||f.a.Yb(O)},f.a.fc=function(Y,k){if(f.a.Tb(Y),k=f.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(Y).html(k);else for(var O=f.a.ua(k,Y.ownerDocument),U=0;U<O.length;U++)Y.appendChild(O[U])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(E,I){if(E){if(E.nodeType==8){var w=f.aa.Uc(E.nodeValue);w!=null&&I.push({ud:E,Kd:w})}else if(E.nodeType==1)for(var w=0,N=E.childNodes,Y=N.length;w<Y;w++)b(N[w],I)}}var R={};return{Xb:function(E){if(typeof E!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[I]=E,"<!--[ko_memo:"+I+"]-->"},bd:function(E,I){var w=R[E];if(w===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return w.apply(null,I||[]),!0}finally{delete R[E]}},cd:function(E,I){var w=[];b(E,w);for(var N=0,Y=w.length;N<Y;N++){var k=w[N].ud,O=[k];I&&f.a.Nb(O,I),f.aa.bd(w[N].Kd,O),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(w){for(var k=w,O=0,U;Y<w;)if(U=I[Y++]){if(Y>k){if(5e3<=++O){Y=w,f.a.Gc(Error("'Too much recursion' after processing "+O+" task groups."));break}k=w}try{U()}catch(J){f.a.Gc(J)}}}}function R(){b(),Y=w=I.length=0}var E,I=[],w=0,N=1,Y=0;return t.MutationObserver?E=function(k){var O=n.createElement("div");return new MutationObserver(k).observe(O,{attributes:!0}),function(){O.classList.toggle("foo")}}(R):E=n&&"onreadystatechange"in n.createElement("script")?function(k){var O=n.createElement("script");O.onreadystatechange=function(){O.onreadystatechange=null,n.documentElement.removeChild(O),O=null,k()},n.documentElement.appendChild(O)}:function(k){setTimeout(k,0)},{scheduler:E,zb:function(k){return w||f.na.scheduler(R),I[w++]=k,N++},cancel:function(k){k=k-(N-w),k>=Y&&k<w&&(I[k]=null)},resetForTesting:function(){var k=w-Y;return Y=w=I.length=0,k},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,R){b.throttleEvaluation=R;var E=null;return f.$({read:b,write:function(I){clearTimeout(E),E=f.a.setTimeout(function(){b(I)},R)}})},rateLimit:function(b,R){var E,I,w;typeof R=="number"?E=R:(E=R.timeout,I=R.method),b.Hb=!1,w=typeof I=="function"?I:I=="notifyWhenChangesStop"?u:l,b.ub(function(N){return w(N,E,R)})},deferred:function(b,R){if(R!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(E){var I,w=!1;return function(){if(!w){f.na.cancel(I),I=f.na.zb(E);try{w=!0,b.notifySubscribers(e,"dirty")}finally{w=!1}}}}))},notify:function(b,R){b.equalityComparer=R=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,R,E){this.da=b,this.lc=R,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,R,E){var I=this;E=E||"change";var w=new f.ic(I,R?b.bind(R):b,function(){f.a.Pa(I.U[E],w),I.hb&&I.hb(E)});return I.Qa&&I.Qa(E),I.U[E]||(I.U[E]=[]),I.U[E].push(w),w},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var E=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var I=0,w;w=E[I];++I)w.Ib||w.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var R=this,E=f.O(R),I,w,N,Y,k;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=m);var O=b(function(){R.Ja=!1,E&&Y===R&&(Y=R.nc?R.nc():R());var U=w||k&&R.sb(N,Y);k=w=I=!1,U&&R.gb(N=Y)});R.qc=function(U,J){J&&R.Ja||(k=!J),R.ed=R.U.change.slice(0),R.Ja=I=!0,Y=U,O()},R.pc=function(U){I||(N=U,R.gb(U,"beforeChange"))},R.rc=function(){k=!0},R.gd=function(){R.sb(N,R.v(!0))&&(w=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var R=0;return f.a.P(this.U,function(E,I){E!=="dirty"&&(R+=I.length)}),R},sb:function(b,R){return!this.equalityComparer||!this.equalityComparer(b,R)},toString:function(){return"[object Object]"},extend:function(b){var R=this;return b&&f.a.P(b,function(E,I){var w=f.Ta[E];typeof w=="function"&&(R=w(R,I)||R)}),R}};f.L(_,"init",_.qb),f.L(_,"subscribe",_.subscribe),f.L(_,"extend",_.extend),f.L(_,"getSubscriptionsCount",_.Bd),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.T.fn=_,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(N){E.push(I),I=N}function R(){I=E.pop()}var E=[],I,w=0;return{xc:b,end:R,cc:function(N){if(I){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,N,N.fd||(N.fd=++w))}},G:function(N,Y,k){try{return b(),N.apply(Y,k||[])}finally{R()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var C=f.a.Da("_latestValue");f.ta=function(b){function R(){return 0<arguments.length?(R.sb(R[C],arguments[0])&&(R.ya(),R[C]=arguments[0],R.xa()),this):(f.u.cc(R),R[C])}return R[C]=b,f.a.Ba||f.a.extend(R,f.T.fn),f.T.fn.qb(R),f.a.Ab(R,V),f.options.deferUpdates&&f.Ta.deferred(R,!0),R};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(V,f.T.fn);var L=f.ta.Ma="__ko_proto__";V[L]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[L])&&b!==V[L]&&b!==f.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[L]===V[L]||b[L]===f.o.fn[L]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",V),f.L(V,"peek",V.v),f.L(V,"valueHasMutated",V.xa),f.L(V,"valueWillMutate",V.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var R=this.v(),E=[],I=typeof b!="function"||f.O(b)?function(Y){return Y===b}:b,w=0;w<R.length;w++){var N=R[w];if(I(N)){if(E.length===0&&this.ya(),R[w]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),R.splice(w,1),w--}}return E.length&&this.xa(),E},removeAll:function(b){if(b===e){var R=this.v(),E=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),E}return b?this.remove(function(I){return 0<=f.a.A(b,I)}):[]},destroy:function(b){var R=this.v(),E=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var I=R.length-1;0<=I;I--){var w=R[I];E(w)&&(w._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(R){return 0<=f.a.A(b,R)}):[]},indexOf:function(b){var R=this();return f.a.A(R,b)},replace:function(b,R){var E=this.indexOf(b);0<=E&&(this.ya(),this.v()[E]=R,this.xa())},sorted:function(b){var R=this().slice(0);return b?R.sort(b):R.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var R=this.v();this.ya(),this.zc(R,b,arguments);var E=R[b].apply(R,arguments);return this.xa(),E===R?this:E}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var R=this();return R[b].apply(R,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,R){function E(){function z(){if(k){var ee=[].concat(b.v()||[]),K;b.Wa("arrayChange")&&((!w||1<k)&&(w=f.a.Pb(O,ee,b.Ob)),K=w),O=ee,w=null,k=0,K&&K.length&&b.notifySubscribers(K,"arrayChange")}}I?z():(I=!0,Y=b.subscribe(function(){++k},null,"spectate"),O=[].concat(b.v()||[]),w=null,N=b.subscribe(z))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var I=!1,w=null,N,Y,k=0,O,U=b.Qa,J=b.hb;b.Qa=function(z){U&&U.call(b,z),z==="arrayChange"&&E()},b.hb=function(z){J&&J.call(b,z),z!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),Y&&Y.s(),Y=N=null,I=!1,O=e)},b.zc=function(z,ee,K){function j(Ie,Me,ve){return q[q.length]={status:Ie,value:Me,index:ve}}if(I&&!k){var q=[],be=z.length,Te=K.length,ae=0;switch(ee){case"push":ae=be;case"unshift":for(ee=0;ee<Te;ee++)j("added",K[ee],ae+ee);break;case"pop":ae=be-1;case"shift":be&&j("deleted",z[ae],ae);break;case"splice":ee=Math.min(Math.max(0,0>K[0]?be+K[0]:K[0]),be);for(var be=Te===1?be:Math.min(ee+(K[1]||0),be),Te=ee+Te-2,ae=Math.max(be,Te),xe=[],_e=[],Ve=2;ee<ae;++ee,++Ve)ee<be&&_e.push(j("deleted",z[ee],ee)),ee<Te&&xe.push(j("added",K[Ve],ee));f.a.Kc(_e,xe);break;default:return}w=q}}}};var Z=f.a.Da("_state");f.o=f.$=function(b,R,E){function I(){if(0<arguments.length){if(typeof w=="function")w.apply(N.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return N.ra||f.u.cc(I),(N.ka||N.J&&I.Xa())&&I.ha(),N.X}if(typeof b=="object"?E=b:(E=E||{},b&&(E.read=b)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var w=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:R||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return I[Z]=N,I.Nc=typeof w=="function",f.a.Ba||f.a.extend(I,f.T.fn),f.T.fn.qb(I),f.a.Ab(I,G),E.pure?(N.wb=!0,N.J=!0,f.a.extend(I,X)):E.deferEvaluation&&f.a.extend(I,P),f.options.deferUpdates&&f.Ta.deferred(I,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||I.ha(),N.l&&I.ja()&&f.a.K.za(N.l,N.Rb=function(){I.s()}),I};var G={equalityComparer:c,qa:function(){return this[Z].V},Va:function(){var b=[];return f.a.P(this[Z].I,function(R,E){b[E.Ka]=E.da}),b},Vb:function(b){if(!this[Z].V)return!1;var R=this.Va();return f.a.A(R,b)!==-1?!0:!!f.a.Lb(R,function(E){return E.Vb&&E.Vb(b)})},uc:function(b,R,E){if(this[Z].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[Z].I[b]=E,E.Ka=this[Z].V++,E.La=R.ob()},Xa:function(){var b,R,E=this[Z].I;for(b in E)if(Object.prototype.hasOwnProperty.call(E,b)&&(R=E[b],this.Ia&&R.da.Ja||R.da.Dd(R.La)))return!0},Jd:function(){this.Ia&&!this[Z].rb&&this.Ia(!1)},ja:function(){var b=this[Z];return b.ka||0<b.V},Rd:function(){this.Ja?this[Z].ka&&(this[Z].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var R=b.subscribe(this.Jd,this,"dirty"),E=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),E.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,R=b.throttleEvaluation;R&&0<=R?(clearTimeout(this[Z].Ic),this[Z].Ic=f.a.setTimeout(function(){b.ha(!0)},R)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var R=this[Z],E=R.Sa,I=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||E&&E()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{I=this.zd(b)}finally{R.rb=!1}return I}},zd:function(b){var R=this[Z],I=!1,E=R.wb?e:!R.V,I={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:I,od:y,o:this,Ya:E}),R.I={},R.V=0;var w=this.yd(R,I);return R.V?I=this.sb(R.X,w):(this.s(),I=!0),I&&(R.J?this.Gb():this.notifySubscribers(R.X,"beforeChange"),R.X=w,this.notifySubscribers(R.X,"spectate"),!R.J&&b&&this.notifySubscribers(R.X),this.rc&&this.rc()),E&&this.notifySubscribers(R.X,"awake"),I},yd:function(b,R){try{var E=b.Wc;return b.nb?E.call(b.nb):E()}finally{f.u.end(),R.Qb&&!b.J&&f.a.P(R.mb,p),b.sa=b.ka=!1}},v:function(b){var R=this[Z];return(R.ka&&(b||!R.V)||R.J&&this.Xa())&&this.ha(),R.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[Z].J||(this[Z].sa?this.ha():this[Z].ka=!1),this[Z].X},this.Ia=function(R){this.pc(this[Z].X),this[Z].ka=!0,R&&(this[Z].sa=!0),this.qc(this,!R)}},s:function(){var b=this[Z];!b.J&&b.I&&f.a.P(b.I,function(R,E){E.s&&E.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},X={Qa:function(b){var R=this,E=R[Z];if(!E.ra&&E.J&&b=="change"){if(E.J=!1,E.sa||R.Xa())E.I=null,E.V=0,R.ha()&&R.Gb();else{var I=[];f.a.P(E.I,function(w,N){I[N.Ka]=w}),f.a.D(I,function(w,N){var Y=E.I[w],k=R.$c(Y.da);k.Ka=N,k.La=Y.La,E.I[w]=k}),R.Xa()&&R.ha()&&R.Gb()}E.ra||R.notifySubscribers(E.X,"awake")}},hb:function(b){var R=this[Z];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(E,I){I.s&&(R.I[E]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),R.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[Z];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},P={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(G,f.T.fn);var v=f.ta.Ma;G[v]=f.o,f.Oc=function(b){return typeof b=="function"&&b[v]===G[v]},f.Fd=function(b){return f.Oc(b)&&b[Z]&&b[Z].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",G),f.L(G,"peek",G.v),f.L(G,"dispose",G.s),f.L(G,"isActive",G.ja),f.L(G,"getDependenciesCount",G.qa),f.L(G,"getDependencies",G.Va),f.xb=function(b,R){return typeof b=="function"?f.o(b,R,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,R))},f.b("pureComputed",f.xb),function(){function b(I,w,N){if(N=N||new E,I=w(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var Y=I instanceof Array?[]:{};return N.save(I,Y),R(I,function(k){var O=w(I[k]);switch(typeof O){case"boolean":case"number":case"string":case"function":Y[k]=O;break;case"object":case"undefined":var U=N.get(O);Y[k]=U!==e?U:b(O,w,N)}}),Y}function R(I,w){if(I instanceof Array){for(var N=0;N<I.length;N++)w(N);typeof I.toJSON=="function"&&w("toJSON")}else for(N in I)w(N)}function E(){this.keys=[],this.values=[]}f.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(I,function(w){for(var N=0;f.O(w)&&10>N;N++)w=w();return w})},f.toJSON=function(I,w,N){return I=f.ad(I),f.a.hc(I,w,N)},E.prototype={constructor:E,save:function(I,w){var N=f.a.A(this.keys,I);0<=N?this.values[N]=w:(this.keys.push(I),this.values.push(w))},get:function(I){return I=f.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,E){function I(w){var N=f.xb(b,E).extend({ma:"always"}),Y=N.subscribe(function(k){k&&(Y.s(),w(k))});return N.notifySubscribers(N.v()),Y}return typeof Promise!="function"||R?I(R.bind(E)):new Promise(I)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,R,E){switch(f.a.R(b)){case"option":typeof R=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=R):(f.a.g.set(b,f.c.options.$b,R),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof R=="number"?R:"");break;case"select":(R===""||R===null)&&(R=e);for(var I=-1,w=0,N=b.options.length,Y;w<N;++w)if(Y=f.w.M(b.options[w]),Y==R||Y===""&&R===e){I=w;break}(E||0<=I||R===e&&1<b.size)&&(b.selectedIndex=I,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=I},0));break;default:(R===null||R===e)&&(R=""),b.value=R}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(k){k=f.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
,`;var O=[],U=k.match(I),J,z=[],ee=0;if(1<U.length){for(var K=0,j;j=U[K];++K){var q=j.charCodeAt(0);if(q===44){if(0>=ee){O.push(J&&z.length?{key:J,value:z.join("")}:{unknown:J||z.join("")}),J=ee=0,z=[];continue}}else if(q===58){if(!ee&&!J&&z.length===1){J=z.pop();continue}}else{if(q===47&&1<j.length&&(j.charCodeAt(1)===47||j.charCodeAt(1)===42))continue;q===47&&K&&1<j.length?(q=U[K-1].match(w))&&!N[q[0]]&&(k=k.substr(k.indexOf(j)+1),U=k.match(I),K=-1,j="/"):q===40||q===123||q===91?++ee:q===41||q===125||q===93?--ee:J||z.length||q!==34&&q!==39||(j=j.slice(1,-1))}z.push(j)}if(0<ee)throw Error("Unbalanced parentheses, braces, or brackets")}return O}var R=["true","false","null","undefined"],E=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),w=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},Y={};return{Ra:[],wa:Y,ac:b,vb:function(k,O){function U(q,be){var Te;if(!K){var ae=f.getBindingHandler(q);if(ae&&ae.preprocess&&!(be=ae.preprocess(be,q,U)))return;(ae=Y[q])&&(Te=be,0<=f.a.A(R,Te)?Te=!1:(ae=Te.match(E),Te=ae===null?!1:ae[1]?"Object("+ae[1]+")"+ae[2]:Te),ae=Te),ae&&z.push("'"+(typeof Y[q]=="string"?Y[q]:q)+"':function(_z){"+Te+"=_z}")}ee&&(be="function(){return "+be+" }"),J.push("'"+q+"':"+be)}O=O||{};var J=[],z=[],ee=O.valueAccessors,K=O.bindingParams,j=typeof k=="string"?b(k):k;return f.a.D(j,function(q){U(q.key||q.unknown,q.value)}),z.length&&U("_ko_property_writers","{"+z.join(",")+" }"),J.join(",")},Id:function(k,O){for(var U=0;U<k.length;U++)if(k[U].key==O)return!0;return!1},eb:function(k,O,U,J,z){k&&f.O(k)?!f.Za(k)||z&&k.v()===J||k(J):(k=O.get("_ko_property_writers"))&&k[U]&&k[U](J)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(U){return U.nodeType==8&&N.test(w?U.text:U.nodeValue)}function R(U){return U.nodeType==8&&Y.test(w?U.text:U.nodeValue)}function E(U,J){for(var z=U,ee=1,K=[];z=z.nextSibling;){if(R(z)&&(f.a.g.set(z,O,!0),ee--,ee===0))return K;K.push(z),b(z)&&ee++}if(!J)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,J){var z=E(U,J);return z?0<z.length?z[z.length-1].nextSibling:U.nextSibling:null}var w=n&&n.createComment("test").text==="<!--test-->",N=w?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,Y=w?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},O="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(U){return b(U)?E(U):U.childNodes},Ea:function(U){if(b(U)){U=f.h.childNodes(U);for(var J=0,z=U.length;J<z;J++)f.removeNode(U[J])}else f.a.Tb(U)},va:function(U,J){if(b(U)){f.h.Ea(U);for(var z=U.nextSibling,ee=0,K=J.length;ee<K;ee++)z.parentNode.insertBefore(J[ee],z)}else f.a.va(U,J)},Vc:function(U,J){var z;b(U)?(z=U.nextSibling,U=U.parentNode):z=U.firstChild,z?J!==z&&U.insertBefore(J,z):U.appendChild(J)},Wb:function(U,J,z){z?(z=z.nextSibling,b(U)&&(U=U.parentNode),z?J!==z&&U.insertBefore(J,z):U.appendChild(J)):f.h.Vc(U,J)},firstChild:function(U){if(b(U))return!U.nextSibling||R(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&R(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(b(U)&&(U=I(U)),U.nextSibling&&R(U.nextSibling)){var J=U.nextSibling;if(R(J)&&!f.a.g.get(J,O))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:b,Vd:function(U){return(U=(w?U.text:U.nodeValue).match(N))?U[1]:null},Sc:function(U){if(k[f.a.R(U)]){var J=U.firstChild;if(J)do if(J.nodeType===1){var z;z=J.firstChild;var ee=null;if(z)do if(ee)ee.push(z);else if(b(z)){var K=I(z,!0);K?z=K:ee=[z]}else R(z)&&(ee=[z]);while(z=z.nextSibling);if(z=ee)for(ee=J.nextSibling,K=0;K<z.length;K++)ee?U.insertBefore(z[K],ee):U.appendChild(z[K])}while(J=J.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b):null;return f.j.tc(E,b,R,!1)},getBindingAccessors:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b,{valueAccessors:!0}):null;return f.j.tc(E,b,R,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,R,E,I){try{var w=this.nd,N=b+(I&&I.valueAccessors||""),Y;if(!(Y=w[N])){var k,O="with($context){with($data||{}){return{"+f.m.vb(b,I)+"}}}";k=new Function("$context","$element",O),Y=w[N]=k}return Y(R,E)}catch(U){throw U.message=`Unable to parse bindings.
Bindings value: `+b+`
Message: `+U.message,U}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(ae){var xe=(ae=f.a.g.get(ae,Te))&&ae.N;xe&&(ae.N=null,xe.Tc())}function R(ae,xe,_e){this.node=ae,this.yc=xe,this.kb=[],this.H=!1,xe.N||f.a.K.za(ae,b),_e&&_e.N&&(_e.N.kb.push(ae),this.Kb=_e)}function E(ae){return function(){return ae}}function I(ae){return ae()}function w(ae){return f.a.Ga(f.u.G(ae),function(xe,_e){return function(){return ae()[_e]}})}function N(ae,xe,_e){return typeof ae=="function"?w(ae.bind(null,xe,_e)):f.a.Ga(ae,E)}function Y(ae,xe){return w(this.getBindings.bind(this,ae,xe))}function k(ae,xe){var _e=f.h.firstChild(xe);if(_e){var Ve,Ie=f.ga.instance,Me=Ie.preprocessNode;if(Me){for(;Ve=_e;)_e=f.h.nextSibling(Ve),Me.call(Ie,Ve);_e=f.h.firstChild(xe)}for(;Ve=_e;)_e=f.h.nextSibling(Ve),O(ae,Ve)}f.i.ma(xe,f.i.H)}function O(ae,xe){var _e=ae,Ve=xe.nodeType===1;Ve&&f.h.Sc(xe),(Ve||f.ga.instance.nodeHasBindings(xe))&&(_e=J(xe,null,ae).bindingContextForDescendants),_e&&!q[f.a.R(xe)]&&k(_e,xe)}function U(ae){var xe=[],_e={},Ve=[];return f.a.P(ae,function Ie(Me){if(!_e[Me]){var ve=f.getBindingHandler(Me);ve&&(ve.after&&(Ve.push(Me),f.a.D(ve.after,function(ke){if(ae[ke]){if(f.a.A(Ve,ke)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ve.join(", "));Ie(ke)}}),Ve.length--),xe.push({key:Me,Mc:ve})),_e[Me]=!0}}),xe}function J(ae,xe,_e){var Ve=f.a.g.Ub(ae,Te,{}),Ie=Ve.hd;if(!xe){if(Ie)throw Error("You cannot apply bindings multiple times to the same element.");Ve.hd=!0}Ie||(Ve.context=_e),Ve.Zb||(Ve.Zb={});var Me;if(xe&&typeof xe!="function")Me=xe;else{var ve=f.ga.instance,ke=ve.getBindingAccessors||Y,ct=f.$(function(){return(Me=xe?xe(_e,ae):ke.call(ve,ae,_e))&&(_e[ee]&&_e[ee](),_e[j]&&_e[j]()),Me},null,{l:ae});Me&&ct.ja()||(ct=null)}var yt=_e,ot;if(Me){var ln=function(){return f.a.Ga(ct?ct():Me,I)},vn=ct?function(Dt){return function(){return I(ct()[Dt])}}:function(Dt){return Me[Dt]};ln.get=function(Dt){return Me[Dt]&&I(vn(Dt))},ln.has=function(Dt){return Dt in Me},f.i.H in Me&&f.i.subscribe(ae,f.i.H,function(){var Dt=(0,Me[f.i.H])();if(Dt){var Nt=f.h.childNodes(ae);Nt.length&&Dt(Nt,f.Ec(Nt[0]))}}),f.i.pa in Me&&(yt=f.i.Cb(ae,_e),f.i.subscribe(ae,f.i.pa,function(){var Dt=(0,Me[f.i.pa])();Dt&&f.h.firstChild(ae)&&Dt(ae)})),Ve=U(Me),f.a.D(Ve,function(Dt){var Nt=Dt.Mc.init,pe=Dt.Mc.update,Ce=Dt.key;if(ae.nodeType===8&&!f.h.ea[Ce])throw Error("The binding '"+Ce+"' cannot be used with virtual elements");try{typeof Nt=="function"&&f.u.G(function(){var Ht=Nt(ae,vn(Ce),ln,yt.$data,yt);if(Ht&&Ht.controlsDescendantBindings){if(ot!==e)throw Error("Multiple bindings ("+ot+" and "+Ce+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");ot=Ce}}),typeof pe=="function"&&f.$(function(){pe(ae,vn(Ce),ln,yt.$data,yt)},null,{l:ae})}catch(Ht){throw Ht.message='Unable to process binding "'+Ce+": "+Me[Ce]+`"
Message: `+Ht.message,Ht}})}return Ve=ot===e,{shouldBindDescendants:Ve,bindingContextForDescendants:Ve&&yt}}function z(ae,xe){return ae&&ae instanceof f.fa?ae:new f.fa(ae,e,e,xe)}var ee=f.a.Da("_subscribable"),K=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var q={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(ae){return f.c[ae]};var be={};f.fa=function(ae,xe,_e,Ve,Ie){function Me(){var vn=yt?ct():ct,Dt=f.a.f(vn);return xe?(f.a.extend(ve,xe),K in xe&&(ve[K]=xe[K])):(ve.$parents=[],ve.$root=Dt,ve.ko=f),ve[ee]=ot,ke?Dt=ve.$data:(ve.$rawData=vn,ve.$data=Dt),_e&&(ve[_e]=Dt),Ve&&Ve(ve,xe,Dt),xe&&xe[ee]&&!f.S.o().Vb(xe[ee])&&xe[ee](),ln&&(ve[j]=ln),ve.$data}var ve=this,ke=ae===be,ct=ke?e:ae,yt=typeof ct=="function"&&!f.O(ct),ot,ln=Ie&&Ie.dataDependency;Ie&&Ie.exportDependencies?Me():(ot=f.xb(Me),ot.v(),ot.ja()?ot.equalityComparer=null:ve[ee]=e)},f.fa.prototype.createChildContext=function(ae,xe,_e,Ve){if(!Ve&&xe&&typeof xe=="object"&&(Ve=xe,xe=Ve.as,_e=Ve.extend),xe&&Ve&&Ve.noChildContext){var Ie=typeof ae=="function"&&!f.O(ae);return new f.fa(be,this,null,function(Me){_e&&_e(Me),Me[xe]=Ie?ae():ae},Ve)}return new f.fa(ae,this,xe,function(Me,ve){Me.$parentContext=ve,Me.$parent=ve.$data,Me.$parents=(ve.$parents||[]).slice(0),Me.$parents.unshift(Me.$parent),_e&&_e(Me)},Ve)},f.fa.prototype.extend=function(ae,xe){return new f.fa(be,this,null,function(_e){f.a.extend(_e,typeof ae=="function"?ae(_e):ae)},xe)};var Te=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(ae){f.a.Pa(this.kb,ae),!this.kb.length&&this.H&&this.Cc()},R.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ae,xe,_e,Ve,Ie){var Me=f.a.g.Ub(ae,Te,{});return Me.Fa||(Me.Fa=new f.T),Ie&&Ie.notifyImmediately&&Me.Zb[xe]&&f.u.G(_e,Ve,[ae]),Me.Fa.subscribe(_e,Ve,xe)},ma:function(ae,xe){var _e=f.a.g.get(ae,Te);if(_e&&(_e.Zb[xe]=!0,_e.Fa&&_e.Fa.notifySubscribers(ae,xe),xe==f.i.H)){if(_e.N)_e.N.Cc();else if(_e.N===e&&_e.Fa&&_e.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ae,xe){var _e=f.a.g.Ub(ae,Te,{});return _e.N||(_e.N=new R(ae,_e,xe[K])),xe[K]==_e?xe:xe.extend(function(Ve){Ve[K]=_e})}},f.Td=function(ae){return(ae=f.a.g.get(ae,Te))&&ae.context},f.ib=function(ae,xe,_e){return ae.nodeType===1&&f.h.Sc(ae),J(ae,xe,z(_e))},f.ld=function(ae,xe,_e){return _e=z(_e),f.ib(ae,N(xe,_e,ae),_e)},f.Oa=function(ae,xe){xe.nodeType!==1&&xe.nodeType!==8||k(z(ae),xe)},f.vc=function(ae,xe,_e){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");O(z(ae,_e),xe)},f.Dc=function(ae){return!ae||ae.nodeType!==1&&ae.nodeType!==8?e:f.Td(ae)},f.Ec=function(ae){return(ae=f.Dc(ae))?ae.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function R(Y,k){var O=Object.prototype.hasOwnProperty.call(w,Y)?w[Y]:b,U;O?O.subscribe(k):(O=w[Y]=new f.T,O.subscribe(k),E(Y,function(J,z){var ee=!(!z||!z.synchronous);N[Y]={definition:J,Gd:ee},delete w[Y],U||ee?O.notifySubscribers(J):f.na.zb(function(){O.notifySubscribers(J)})}),U=!0)}function E(Y,k){I("getConfig",[Y],function(O){O?I("loadComponent",[Y,O],function(U){k(U,O)}):k(null,null)})}function I(Y,k,O,U){U||(U=f.j.loaders.slice(0));var J=U.shift();if(J){var z=J[Y];if(z){var ee=!1;if(z.apply(J,k.concat(function(K){ee?O(null):K!==null?O(K):I(Y,k,O,U)}))!==b&&(ee=!0,!J.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(Y,k,O,U)}else O(null)}var w={},N={};f.j={get:function(Y,k){var O=Object.prototype.hasOwnProperty.call(N,Y)?N[Y]:b;O?O.Gd?f.u.G(function(){k(O.definition)}):f.na.zb(function(){k(O.definition)}):R(Y,k)},Bc:function(Y){delete N[Y]},oc:I},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(O,U,J,z){function ee(){--j===0&&z(K)}var K={},j=2,q=J.template;J=J.viewModel,q?w(U,q,function(be){f.j.oc("loadTemplate",[O,be],function(Te){K.template=Te,ee()})}):ee(),J?w(U,J,function(be){f.j.oc("loadViewModel",[O,be],function(Te){K[k]=Te,ee()})}):ee()}function R(O,U,J){if(typeof U=="function")J(function(ee){return new U(ee)});else if(typeof U[k]=="function")J(U[k]);else if("instance"in U){var z=U.instance;J(function(){return z})}else"viewModel"in U?R(O,U.viewModel,J):O("Unknown viewModel value: "+U)}function E(O){switch(f.a.R(O)){case"script":return f.a.ua(O.text);case"textarea":return f.a.ua(O.value);case"template":if(I(O.content))return f.a.Ca(O.content.childNodes)}return f.a.Ca(O.childNodes)}function I(O){return t.DocumentFragment?O instanceof DocumentFragment:O&&O.nodeType===11}function w(O,U,J){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(z){z&&typeof z=="object"&&z.Xd&&z.default&&(z=z.default),J(z)}):O("Uses require, but no AMD loader is present"):J(U)}function N(O){return function(U){throw Error("Component '"+O+"': "+U)}}var Y={};f.j.register=function(O,U){if(!U)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");Y[O]=U},f.j.tb=function(O){return Object.prototype.hasOwnProperty.call(Y,O)},f.j.unregister=function(O){delete Y[O],f.j.Bc(O)},f.j.Fc={getConfig:function(O,U){U(f.j.tb(O)?Y[O]:null)},loadComponent:function(O,U,J){var z=N(O);w(z,U,function(ee){b(O,z,ee,J)})},loadTemplate:function(O,U,J){if(O=N(O),typeof U=="string")J(f.a.ua(U));else if(U instanceof Array)J(U);else if(I(U))J(f.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)J(E(U));else if(typeof U=="string"){var z=n.getElementById(U);z?J(E(z)):O("Cannot find element with ID "+U)}else O("Unknown element type: "+U);else O("Unknown template value: "+U)},loadViewModel:function(O,U,J){R(N(O),U,J)}};var k="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=Y}(),function(){function b(E,I){var w=E.getAttribute("params");if(w){var w=R.parseBindingsString(w,I,E,{valueAccessors:!0,bindingParams:!0}),w=f.a.Ga(w,function(k){return f.o(k,null,{l:E})}),N=f.a.Ga(w,function(k){var O=k.v();return k.ja()?f.o({read:function(){return f.a.f(k())},write:f.Za(O)&&function(U){k()(U)},l:E}):O});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=w),N}return{$raw:{}}}f.j.getComponentNameForNode=function(E){var I=f.a.R(E);if(f.j.tb(I)&&(I.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=f.a.W&&E.tagName===I))return I},f.j.tc=function(E,I,w,N){if(I.nodeType===1){var Y=f.j.getComponentNameForNode(I);if(Y){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:Y,params:b(I,w)};E.component=N?function(){return k}:k}}return E};var R=new f.ga;9>f.a.W&&(f.j.register=function(E){return function(I){return E.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(E){return function(){var I=E(),w=f.j.dd,N;for(N in w);return I}}(n.createDocumentFragment))}(),function(){function b(I,w,N){if(w=w.template,!w)throw Error("Component '"+I+"' has no template");I=f.a.Ca(w),f.h.va(N,I)}function R(I,w,N){var Y=I.createViewModel;return Y?Y.call(I,w,N):w}var E=0;f.c.component={init:function(I,w,N,Y,k){function O(){var K=U&&U.dispose;typeof K=="function"&&K.call(U),z&&z.s(),J=U=z=null}var U,J,z,ee=f.a.la(f.h.childNodes(I));return f.h.Ea(I),f.a.K.za(I,O),f.o(function(){var K=f.a.f(w()),j,q;if(typeof K=="string"?j=K:(j=f.a.f(K.name),q=f.a.f(K.params)),!j)throw Error("No component name specified");var be=f.i.Cb(I,k),Te=J=++E;f.j.get(j,function(ae){if(J===Te){if(O(),!ae)throw Error("Unknown component '"+j+"'");b(j,ae,I);var xe=R(ae,q,{element:I,templateNodes:ee});ae=be.createChildContext(xe,{extend:function(_e){_e.$component=xe,_e.$componentTemplateNodes=ee}}),xe&&xe.koDescendantsComplete&&(z=f.i.subscribe(I,f.i.pa,xe.koDescendantsComplete,xe)),U=xe,f.Oa(ae,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var A={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var E=f.a.f(R())||{};f.a.P(E,function(I,w){w=f.a.f(w);var N=I.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(I.substr(0,N)),Y=w===!1||w===null||w===e;Y?N?b.removeAttributeNS(N,I):b.removeAttribute(I):w=w.toString(),8>=f.a.W&&I in A?(I=A[I],Y?b.removeAttribute(I):b[I]=w):Y||(N?b.setAttributeNS(N,I,w):b.setAttribute(I,w)),I==="name"&&f.a.Yc(b,Y?"":w)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,E){function I(){var K=b.checked,j=N();if(!f.S.Ya()&&(K||!k&&!f.S.qa())){var q=f.u.G(R);if(U){var be=J?q.v():q,Te=ee;ee=j,Te!==j?K&&(f.a.Na(be,j,!0),f.a.Na(be,Te,!1)):f.a.Na(be,j,K),J&&f.Za(q)&&q(be)}else Y&&(j===e?j=K:K||(j=e)),f.m.eb(q,E,"checked",j,!0)}}function w(){var K=f.a.f(R()),j=N();U?(b.checked=0<=f.a.A(K,j),ee=j):b.checked=Y&&j===e?!!K:N()===K}var N=f.xb(function(){if(E.has("checkedValue"))return f.a.f(E.get("checkedValue"));if(z)return E.has("value")?f.a.f(E.get("value")):b.value}),Y=b.type=="checkbox",k=b.type=="radio";if(Y||k){var O=R(),U=Y&&f.a.f(O)instanceof Array,J=!(U&&O.push&&O.splice),z=k||U,ee=U?N():e;k&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(I,null,{l:b}),f.a.B(b,"click",I),f.o(w,null,{l:b}),O=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,R){b.value=f.a.f(R())}}}(),f.c.class={update:function(b,R){var E=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=E,f.a.Eb(b,E,!0)}},f.c.css={update:function(b,R){var E=f.a.f(R());E!==null&&typeof E=="object"?f.a.P(E,function(I,w){w=f.a.f(w),f.a.Eb(b,I,w)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var E=f.a.f(R());E&&b.disabled?b.removeAttribute("disabled"):E||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,R){f.c.enable.update(b,function(){return!f.a.f(R())})}},f.c.event={init:function(b,R,E,I,w){var N=R()||{};f.a.P(N,function(Y){typeof Y=="string"&&f.a.B(b,Y,function(k){var O,U=R()[Y];if(U){try{var J=f.a.la(arguments);I=w.$data,J.unshift(I),O=U.apply(I,J)}finally{O!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}E.get(Y+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),E=f.a.bc(R);return!E||typeof E.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,E,I,w){return f.c.template.update(b,f.c.foreach.Rc(R),E,I,w)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,E){function I(Y){b.__ko_hasfocusUpdating=!0;var k=b.ownerDocument;if("activeElement"in k){var O;try{O=k.activeElement}catch{O=k.body}Y=O===b}k=R(),f.m.eb(k,E,"hasfocus",Y,!0),b.__ko_hasfocusLastValue=Y,b.__ko_hasfocusUpdating=!1}var w=I.bind(null,!0),N=I.bind(null,!1);f.a.B(b,"focus",w),f.a.B(b,"focusin",w),f.a.B(b,"blur",N),f.a.B(b,"focusout",N),b.__ko_hasfocusLastValue=!1},update:function(b,R){var E=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===E||(E?b.focus():b.blur(),!E&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,E?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.fc(b,R())}},function(){function b(R,E,I){f.c[R]={init:function(w,N,Y,k,O){var U,J,z={},ee,K,j;if(E){k=Y.get("as");var q=Y.get("noChildContext");j=!(k&&q),z={as:k,noChildContext:q,exportDependencies:j}}return K=(ee=Y.get("completeOn")=="render")||Y.has(f.i.pa),f.o(function(){var be=f.a.f(N()),Te=!I!=!be,ae=!J,xe;(j||Te!==U)&&(K&&(O=f.i.Cb(w,O)),Te&&((!E||j)&&(z.dataDependency=f.S.o()),xe=E?O.createChildContext(typeof be=="function"?be:N,z):f.S.qa()?O.extend(null,z):O),ae&&f.S.qa()&&(J=f.a.Ca(f.h.childNodes(w),!0)),Te?(ae||f.h.va(w,f.a.Ca(J)),f.Oa(xe,w)):(f.h.Ea(w),ee||f.i.ma(w,f.i.H)),U=Te)},null,{l:w}),{controlsDescendantBindings:!0}}},f.m.Ra[R]=!1,f.h.ea[R]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,R,E,I,w){return R=w.extend(R),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var M={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,R,E){function I(){return f.a.jb(b.options,function(q){return q.selected})}function w(q,be,Te){var ae=typeof be;return ae=="function"?be(q):ae=="string"?q[be]:Te}function N(q,be){if(K&&U)f.i.ma(b,f.i.H);else if(ee.length){var Te=0<=f.a.A(ee,f.w.M(be[0]));f.a.Zc(be[0],Te),K&&!Te&&f.u.G(f.a.Fb,null,[b,"change"])}}var Y=b.multiple,k=b.length!=0&&Y?b.scrollTop:null,O=f.a.f(R()),U=E.get("valueAllowUnset")&&E.has("value"),J=E.get("optionsIncludeDestroyed");R={};var z,ee=[];U||(Y?ee=f.a.Mb(I(),f.w.M):0<=b.selectedIndex&&ee.push(f.w.M(b.options[b.selectedIndex]))),O&&(typeof O.length>"u"&&(O=[O]),z=f.a.jb(O,function(q){return J||q===e||q===null||!f.a.f(q._destroy)}),E.has("optionsCaption")&&(O=f.a.f(E.get("optionsCaption")),O!==null&&O!==e&&z.unshift(M)));var K=!1;if(R.beforeRemove=function(q){b.removeChild(q)},O=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(O=function(q,be){N(0,be),f.u.G(E.get("optionsAfterRender"),null,[be[0],q!==M?q:e])}),f.a.ec(b,z,function(q,be,Te){return Te.length&&(ee=!U&&Te[0].selected?[f.w.M(Te[0])]:[],K=!0),be=b.ownerDocument.createElement("option"),q===M?(f.a.Bb(be,E.get("optionsCaption")),f.w.cb(be,e)):(Te=w(q,E.get("optionsValue"),q),f.w.cb(be,f.a.f(Te)),q=w(q,E.get("optionsText"),Te),f.a.Bb(be,q)),[be]},R,O),!U){var j;Y?j=ee.length&&I().length<ee.length:j=ee.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==ee[0]:ee.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(U||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,E){function I(){var Y=R(),k=[];f.a.D(b.getElementsByTagName("option"),function(O){O.selected&&k.push(f.w.M(O))}),f.m.eb(Y,E,"selectedOptions",k)}function w(){var Y=f.a.f(R()),k=b.scrollTop;Y&&typeof Y.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(O){var U=0<=f.a.A(Y,f.w.M(O));O.selected!=U&&f.a.Zc(O,U)}),b.scrollTop=k}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;f.i.subscribe(b,f.i.H,function(){N?I():(f.a.B(b,"change",I),N=f.o(w,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,R){var E=f.a.f(R()||{});f.a.P(E,function(I,w){if(w=f.a.f(w),(w===null||w===e||w===!1)&&(w=""),o)o(b).css(I,w);else if(/^--/.test(I))b.style.setProperty(I,w);else{I=I.replace(/-(\w)/g,function(Y,k){return k.toUpperCase()});var N=b.style[I];b.style[I]=w,w===N||b.style[I]!=N||isNaN(w)||(b.style[I]=w+"px")}})}},f.c.submit={init:function(b,R,E,I,w){if(typeof R()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(N){var Y,k=R();try{Y=k.call(w.$data,b)}finally{Y!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.Bb(b,R())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(z){if(z)return parseFloat(z[1])},R=t.navigator.userAgent,E,I,w,N,Y;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(Y=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(I=b(R.match(/Version\/([^ ]+) Safari/)))||(w=b(R.match(/Firefox\/([^ ]+)/)))||(N=f.a.W||b(R.match(/MSIE ([^ ]+)/)))||(N=b(R.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var k=f.a.g.Z(),O=f.a.g.Z(),U=function(z){var ee=this.activeElement;(ee=ee&&f.a.g.get(ee,O))&&ee(z)},J=function(z,ee){var K=z.ownerDocument;f.a.g.get(K,k)||(f.a.g.set(K,k,!0),f.a.B(K,"selectionchange",U)),f.a.g.set(z,O,ee)};f.c.textInput={init:function(z,ee,K){function j(Me,ve){f.a.B(z,Me,ve)}function q(){var Me=f.a.f(ee());(Me===null||Me===e)&&(Me=""),_e!==e&&Me===_e?f.a.setTimeout(q,4):z.value!==Me&&(Ie=!0,z.value=Me,Ie=!1,ae=z.value)}function be(){xe||(_e=z.value,xe=f.a.setTimeout(Te,4))}function Te(){clearTimeout(xe),_e=xe=e;var Me=z.value;ae!==Me&&(ae=Me,f.m.eb(ee(),K,"textInput",Me))}var ae=z.value,xe,_e,Ve=f.a.W==9?be:Te,Ie=!1;N&&j("keypress",Te),11>N&&j("propertychange",function(Me){Ie||Me.propertyName!=="value"||Ve(Me)}),N==8&&(j("keyup",Te),j("keydown",Te)),J&&(J(z,Ve),j("dragend",be)),(!N||9<=N)&&j("input",Ve),5>I&&f.a.R(z)==="textarea"?(j("keydown",be),j("paste",be),j("cut",be)):11>E?j("keydown",be):4>w?(j("DOMAutoComplete",Te),j("dragdrop",Te),j("drop",Te)):Y&&z.type==="number"&&j("keydown",be),j("change",Te),j("blur",Te),f.o(q,null,{l:z})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(z,ee,K){K("textInput",z)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var E="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,E)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,E,I,w){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),R=w.createChildContext(R,N),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,R,E){var I=f.a.R(b),w=I=="input";if(!w||b.type!="checkbox"&&b.type!="radio"){var N=[],Y=E.get("valueUpdate"),k=!1,O=null;Y&&(typeof Y=="string"?N=[Y]:N=f.a.wc(Y),f.a.Pa(N,"change"));var U=function(){O=null,k=!1;var ee=R(),K=f.w.M(b);f.m.eb(ee,E,"value",K)};!f.a.W||!w||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(N,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){k=!0}),f.a.B(b,"focus",function(){k=!1}),f.a.B(b,"blur",function(){k&&U()})),f.a.D(N,function(ee){var K=U;f.a.Ud(ee,"after")&&(K=function(){O=f.w.M(b),f.a.setTimeout(U,0)},ee=ee.substring(5)),f.a.B(b,ee,K)});var J;if(J=w&&b.type=="file"?function(){var ee=f.a.f(R());ee===null||ee===e||ee===""?b.value="":f.u.G(U)}:function(){var ee=f.a.f(R()),K=f.w.M(b);O!==null&&ee===O?f.a.setTimeout(J,0):(ee!==K||K===e)&&(I==="select"?(K=E.get("valueAllowUnset"),f.w.cb(b,ee,K),K||ee===f.w.M(b)||f.u.G(U)):f.w.cb(b,ee))},I==="select"){var z;f.i.subscribe(b,f.i.H,function(){z?E.get("valueAllowUnset")?J():U():(f.a.B(b,"change",U),z=f.o(J,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",U),f.o(J,null,{l:b})}else f.ib(b,{checkedValue:R})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,R){var E=f.a.f(R()),I=b.style.display!="none";E&&!I?b.style.display="":!E&&I&&(b.style.display="none")}},f.c.hidden={update:function(b,R){f.c.visible.update(b,function(){return!f.a.f(R())})}},function(b){f.c[b]={init:function(R,E,I,w,N){return f.c.event.init.call(this,R,function(){var Y={};return Y[b]=E(),Y},I,w,N)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(b,R){if(typeof b=="string"){R=R||n;var E=R.getElementById(b);if(!E)throw Error("Cannot find template with ID "+b);return new f.C.F(E)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,R,E,I){return b=this.makeTemplateSource(b,I),this.renderTemplateSource(b,R,E,I)},f.ca.prototype.isTemplateRewritten=function(b,R){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,R).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,R,E){b=this.makeTemplateSource(b,E),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(I,w,N,Y){I=f.m.ac(I);for(var k=f.m.Ra,O=0;O<I.length;O++){var U=I[O].key;if(Object.prototype.hasOwnProperty.call(k,U)){var J=k[U];if(typeof J=="function"){if(U=J(I[O].value))throw Error(U)}else if(!J)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(I,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",Y.createJavaScriptEvaluatorBlock(N)+w}var R=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,w,N){w.isTemplateRewritten(I,N)||w.rewriteTemplate(I,function(Y){return f.kc.Ld(Y,w)},N)},Ld:function(I,w){return I.replace(R,function(N,Y,k,O,U){return b(U,Y,k,w)}).replace(E,function(N,Y){return b(Y,"<!-- ko -->","#comment",w)})},md:function(I,w){return f.aa.Xb(function(N,Y){var k=N.nextSibling;k&&k.nodeName.toLowerCase()===w&&f.ib(k,I,Y)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(E){if(this.F=E){var I=f.a.R(E);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&E.content&&E.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var I=arguments[0];E==="innerHTML"?f.a.fc(this.F,I):this.F[E]=I};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(E){if(arguments.length===1)return f.a.g.get(this.F,b+E);f.a.g.set(this.F,b+E,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var I=f.a.g.get(E,R)||{},w=I.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!w||I.jd){var N=this.text();N&&N!==I.bb&&(w=f.a.Md(N,E.ownerDocument),f.a.g.set(E,R,{lb:w,bb:N,jd:!0}))}return w}I=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(E,R,{lb:I})},f.C.ia=function(E){this.F=E},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var E=f.a.g.get(this.F,R)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}f.a.g.set(this.F,R,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(O,U,J){var z;for(U=f.h.nextSibling(U);O&&(z=O)!==U;)O=f.h.nextSibling(z),J(z,O)}function R(O,U){if(O.length){var J=O[0],z=O[O.length-1],ee=J.parentNode,K=f.ga.instance,j=K.preprocessNode;if(j){if(b(J,z,function(q,be){var Te=q.previousSibling,ae=j.call(K,q);ae&&(q===J&&(J=ae[0]||be),q===z&&(z=ae[ae.length-1]||Te))}),O.length=0,!J)return;J===z?O.push(J):(O.push(J,z),f.a.Ua(O,ee))}b(J,z,function(q){q.nodeType!==1&&q.nodeType!==8||f.vc(U,q)}),b(J,z,function(q){q.nodeType!==1&&q.nodeType!==8||f.aa.cd(q,[U])}),f.a.Ua(O,ee)}}function E(O){return O.nodeType?O:0<O.length?O[0]:null}function I(O,U,J,z,ee){ee=ee||{};var K=(O&&E(O)||J||{}).ownerDocument,j=ee.templateEngine||N;if(f.kc.xd(J,j,K),J=j.renderTemplate(J,z,ee,K),typeof J.length!="number"||0<J.length&&typeof J[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(K=!1,U){case"replaceChildren":f.h.va(O,J),K=!0;break;case"replaceNode":f.a.Xc(O,J),K=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return K&&(R(J,z),ee.afterRender&&f.u.G(ee.afterRender,null,[J,z[ee.as||"$data"]]),U=="replaceChildren"&&f.i.ma(O,f.i.H)),J}function w(O,U,J){return f.O(O)?O():typeof O=="function"?O(U,J):O}var N;f.gc=function(O){if(O!=e&&!(O instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=O},f.dc=function(O,U,J,z,ee){if(J=J||{},(J.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(ee=ee||"replaceChildren",z){var K=E(z);return f.$(function(){var q=U&&U instanceof f.fa?U:new f.fa(U,null,null,null,{exportDependencies:!0}),j=w(O,q.$data,q),q=I(z,ee,j,q,J);ee=="replaceNode"&&(z=q,K=E(z))},null,{Sa:function(){return!K||!f.a.Sb(K)},l:K&&ee=="replaceNode"?K.parentNode:K})}return f.aa.Xb(function(j){f.dc(O,U,J,j,"replaceNode")})},f.Qd=function(O,U,J,z,ee){function K(_e,Ve){f.u.G(f.a.ec,null,[z,_e,q,J,j,Ve]),f.i.ma(z,f.i.H)}function j(_e,Ve){R(Ve,be),J.afterRender&&J.afterRender(Ve,_e),be=null}function q(_e,Ve){be=ee.createChildContext(_e,{as:Te,noChildContext:J.noChildContext,extend:function(Me){Me.$index=Ve,Te&&(Me[Te+"Index"]=Ve)}});var Ie=w(O,_e,be);return I(z,"ignoreTargetNode",Ie,be,J)}var be,Te=J.as,ae=J.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!J.includeDestroyed;if(ae||J.beforeRemove||!f.Pc(U))return f.$(function(){var _e=f.a.f(U)||[];typeof _e.length>"u"&&(_e=[_e]),ae&&(_e=f.a.jb(_e,function(Ve){return Ve===e||Ve===null||!f.a.f(Ve._destroy)})),K(_e)},null,{l:z});K(U.v());var xe=U.subscribe(function(_e){K(U(),_e)},null,"arrayChange");return xe.l(z),xe};var Y=f.a.g.Z(),k=f.a.g.Z();f.c.template={init:function(O,U){var J=f.a.f(U());if(typeof J=="string"||"name"in J)f.h.Ea(O);else if("nodes"in J){if(J=J.nodes||[],f.O(J))throw Error('The "nodes" option must be a plain, non-observable array.');var z=J[0]&&J[0].parentNode;z&&f.a.g.get(z,k)||(z=f.a.Yb(J),f.a.g.set(z,k,!0)),new f.C.ia(O).nodes(z)}else if(J=f.h.childNodes(O),0<J.length)z=f.a.Yb(J),new f.C.ia(O).nodes(z);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(O,U,J,z,ee){var K=U();U=f.a.f(K),J=!0,z=null,typeof U=="string"?U={}:(K="name"in U?U.name:O,"if"in U&&(J=f.a.f(U.if)),J&&"ifnot"in U&&(J=!f.a.f(U.ifnot)),J&&!K&&(J=!1)),"foreach"in U?z=f.Qd(K,J&&U.foreach||[],U,O,ee):J?(J=ee,"data"in U&&(J=ee.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),z=f.dc(K,J,U,O)):f.h.Ea(O),ee=z,(U=f.a.g.get(O,Y))&&typeof U.s=="function"&&U.s(),f.a.g.set(O,Y,!ee||ee.ja&&!ee.ja()?e:ee)}},f.m.Ra.template=function(O){return O=f.m.ac(O),O.length==1&&O[0].unknown||f.m.Id(O,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,R,E){if(b.length&&R.length){var I,w,N,Y,k;for(I=w=0;(!E||I<E)&&(Y=b[w]);++w){for(N=0;k=R[N];++N)if(Y.value===k.value){Y.moved=k.index,k.moved=Y.index,R.splice(N,1),I=N=0;break}I+=N}}},f.a.Pb=function(){function b(R,E,I,w,N){var Y=Math.min,k=Math.max,O=[],U,J=R.length,z,ee=E.length,K=ee-J||1,j=J+ee+1,q,be,Te;for(U=0;U<=J;U++)for(be=q,O.push(q=[]),Te=Y(ee,U+K),z=k(0,U-1);z<=Te;z++)q[z]=z?U?R[U-1]===E[z-1]?be[z-1]:Y(be[z]||j,q[z-1]||j)+1:z+1:U+1;for(Y=[],k=[],K=[],U=J,z=ee;U||z;)ee=O[U][z]-1,z&&ee===O[U][z-1]?k.push(Y[Y.length]={status:I,value:E[--z],index:z}):U&&ee===O[U-1][z]?K.push(Y[Y.length]={status:w,value:R[--U],index:U}):(--z,--U,N.sparse||Y.push({status:"retained",value:E[z]}));return f.a.Kc(K,k,!N.dontLimitMoves&&10*J),Y.reverse()}return function(R,E,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},R=R||[],E=E||[],R.length<E.length?b(R,E,"added","deleted",I):b(E,R,"deleted","added",I)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(I,w,N,Y,k){var O=[],U=f.$(function(){var J=w(N,k,f.a.Ua(O,I))||[];0<O.length&&(f.a.Xc(O,J),Y&&f.u.G(Y,null,[N,J,k])),O.length=0,f.a.Nb(O,J)},null,{l:I,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:U.ja()?U:e}}var R=f.a.g.Z(),E=f.a.g.Z();f.a.ec=function(I,w,N,Y,k,O){function U(Dt){Ie={Aa:Dt,pb:f.ta(be++)},j.push(Ie),K||Ve.push(Ie)}function J(Dt){Ie=ee[Dt],be!==Ie.pb.v()&&_e.push(Ie),Ie.pb(be++),f.a.Ua(Ie.Y,I),j.push(Ie)}function z(Dt,Nt){if(Dt)for(var pe=0,Ce=Nt.length;pe<Ce;pe++)f.a.D(Nt[pe].Y,function(Ht){Dt(Ht,pe,Nt[pe].Aa)})}w=w||[],typeof w.length>"u"&&(w=[w]),Y=Y||{};var ee=f.a.g.get(I,R),K=!ee,j=[],q=0,be=0,Te=[],ae=[],xe=[],_e=[],Ve=[],Ie,Me=0;if(K)f.a.D(w,U);else{if(!O||ee&&ee._countWaitingForRemove){var ve=f.a.Mb(ee,function(Dt){return Dt.Aa});O=f.a.Pb(ve,w,{dontLimitMoves:Y.dontLimitMoves,sparse:!0})}for(var ve=0,ke,ct,yt;ke=O[ve];ve++)switch(ct=ke.moved,yt=ke.index,ke.status){case"deleted":for(;q<yt;)J(q++);ct===e&&(Ie=ee[q],Ie.$&&(Ie.$.s(),Ie.$=e),f.a.Ua(Ie.Y,I).length&&(Y.beforeRemove&&(j.push(Ie),Me++,Ie.Aa===E?Ie=null:xe.push(Ie)),Ie&&Te.push.apply(Te,Ie.Y))),q++;break;case"added":for(;be<yt;)J(q++);ct!==e?(ae.push(j.length),J(ct)):U(ke.value)}for(;be<w.length;)J(q++);j._countWaitingForRemove=Me}f.a.g.set(I,R,j),z(Y.beforeMove,_e),f.a.D(Te,Y.beforeRemove?f.oa:f.removeNode);var ot,ln,vn;try{vn=I.ownerDocument.activeElement}catch{}if(ae.length)for(;(ve=ae.shift())!=e;){for(Ie=j[ve],ot=e;ve;)if((ln=j[--ve].Y)&&ln.length){ot=ln[ln.length-1];break}for(w=0;q=Ie.Y[w];ot=q,w++)f.h.Wb(I,q,ot)}for(ve=0;Ie=j[ve];ve++){for(Ie.Y||f.a.extend(Ie,b(I,N,Ie.Aa,k,Ie.pb)),w=0;q=Ie.Y[w];ot=q,w++)f.h.Wb(I,q,ot);!Ie.Ed&&k&&(k(Ie.Aa,Ie.Y,Ie.pb),Ie.Ed=!0,ot=Ie.Y[Ie.Y.length-1])}for(vn&&I.ownerDocument.activeElement!=vn&&vn.focus(),z(Y.beforeRemove,xe),ve=0;ve<xe.length;++ve)xe[ve].Aa=E;z(Y.afterMove,_e),z(Y.afterAdd,Ve)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,R,E,I){return(R=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(R.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,I))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var R=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(E,I,w,N){if(N=N||n,w=w||{},2>R)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var Y=E.data("precompiled");return Y||(Y=E.text()||"",Y=o.template(null,"{{ko_with $item.koBindingContext}}"+Y+"{{/ko_with}}"),E.data("precompiled",Y)),E=[I.$data],I=o.extend({koBindingContext:I},w.templateOptions),I=o.tmpl(Y,E,I),I.appendTo(N.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,I){n.write("<script type='text/html' id='"+E+"'>"+I+"<\/script>")},0<R&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var $bt=ko;typeof window<"u"?(ko=window.ko,typeof sA<"u"?window.ko=sA:delete window.ko):(ko=global.ko,typeof sA<"u"?global.ko=sA:delete global.ko);var MT=$bt;var Juo=T(S(),1);/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * MIT license
 */var jj="__knockoutObservables",qj="__knockoutSubscribable";function Ixe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Wxe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===jj||o===qj)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&tyt(n,a)}}),e}function Wxe(e,t){var n=e[jj];return!n&&t&&(n={},Object.defineProperty(e,jj,{value:n})),n}function eyt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),Ixe.call(i,e,[t]),e}function tyt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=nyt(e,t,i))})}function nyt(e,t,n){var i=iyt(e,n);return i.subscribe(t)}function iyt(e,t){var n=t[qj];if(!n){n=new e.subscribable,Object.defineProperty(t,qj,{value:n});var i={};oyt(t,n,i),ryt(e,t,n,i)}return n}function oyt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function ryt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function Pxe(e,t){if(!e)return null;var n=Wxe(e,!1);return n&&n[t]||null}function syt(e,t){var n=Pxe(e,t);n&&n.valueHasMutated()}function ayt(e){e.track=Ixe,e.getObservable=Pxe,e.valueHasMutated=syt,e.defineProperty=eyt}var aA={attachToKo:ayt};var juo=T(S(),1),vxe="http://www.w3.org/2000/svg",wxe="cesium-svgPath-svg",cyt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(vxe,"svg:svg");i.setAttribute("class",wxe);let o=document.createElementNS(vxe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${wxe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},cA=cyt;aA.attachToKo(MT);cA.register(MT);var Se=MT;function lA(e){d(e)||(e=new Dm),this._clock=e,this._eventHelper=new Lr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(te.now()),this.systemTime.equalityComparer=te.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=te.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=te.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=te.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(lA.prototype,{clock:{get:function(){return this._clock}}});lA.prototype.synchronize=function(){let e=this._clock;this.systemTime=te.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};lA.prototype.isDestroyed=function(){return!1};lA.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var dA=lA;var lmo=T(S(),1);function lyt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var $j=lyt;var hmo=T(S(),1);var uA={};uA.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return d(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};uA.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};uA.createRangeInput=function(e,t,n,i,o,r){r=g(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=g(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let l=document.createElement("div");return l.className="cesium-cesiumInspector-slider",l.appendChild(document.createTextNode(e)),l.appendChild(s),l.appendChild(c),l};uA.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return d(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Za=uA;var xmo=T(S(),1);function Fxe(e,t){this._command=e,t=g(t,g.EMPTY_OBJECT),this.toggled=g(t.toggled,!1),this.tooltip=g(t.tooltip,""),Se.track(this,["toggled","tooltip"])}Object.defineProperties(Fxe.prototype,{command:{get:function(){return this._command}}});var dg=Fxe;var Lmo=T(S(),1);function dyt(e,t){t=g(t,!0);let n=new ye,i=new ye;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Se.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Cn=dyt;var Gmo=T(S(),1);function uyt(e,t,n,i,o){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,o)}var aa=uyt;var Pmo=T(S(),1);var NT="http://www.w3.org/2000/svg",Nxe="http://www.w3.org/1999/xlink",bD,mA=B.fromCssColorString("rgba(247,250,255,0.384)"),yD=B.fromCssColorString("rgba(143,191,255,0.216)"),e8=B.fromCssColorString("rgba(153,197,255,0.098)"),gD=B.fromCssColorString("rgba(255,255,255,0.086)"),myt=B.fromCssColorString("rgba(255,255,255,0.267)"),hyt=B.fromCssColorString("rgba(255,255,255,0)"),Axe=B.fromCssColorString("rgba(66,67,68,0.3)"),Mxe=B.fromCssColorString("rgba(0,0,0,0.5)");function ug(e){return B.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var hA={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Th(e){let t=document.createElementNS(NT,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(Th(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Nxe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function t8(e,t,n){let i=document.createElementNS(NT,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(NT,"tspan");return o.textContent=n,i.appendChild(o),i}function fyt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var xD=new B;function Br(e,t){let n=t.alpha,i=1-n;return xD.red=e.red*i+t.red*n,xD.green=e.green*i+t.green*n,xD.blue=e.blue*i+t.blue*n,xD.toCssColorString()}function n8(e,t,n){let i=hA[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Th(o)}function pyt(e,t,n){let i=hA[n],o=hA.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Th(r)}function byt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&bD!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,l;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,l=t.touches[0].clientY):(c=t.clientX,l=t.clientY),!i&&(c>a.right||c<a.left||l<a.top||l>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),m=c-o-a.left,p=l-r-a.top,y=Math.atan2(p,m)*180/Math.PI+90;y>180&&(y-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&l>u.top&&l<u.bottom?(bD=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=y):y<f?n.slower():y>f&&n.faster(),t.preventDefault()}else e===bD&&(bD=void 0),n.shuttleRingDragging=!1}function J0(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[aa(t,"toggled",this.setToggled,this),aa(t,"tooltip",this.setTooltip,this),aa(t.command,"canExecute",this.setEnabled,this)]}J0.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};J0.prototype.isDestroyed=function(){return!1};J0.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};J0.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};J0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function BV(e,t){e=En(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(NT,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Nxe);let s=document.createElementNS(NT,"g");this._topG=s,this._realtimeSVG=new J0(pyt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new J0(n8(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new J0(n8(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new J0(n8(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(NT,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Th({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let l=hA.animation_pathSwooshFX,u=hA.animation_pathPointer,m=Th({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:l.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:l.d},{tagName:l.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:l.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=m,this._shuttleRingPointer=Th({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=Th({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Th({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let y=61,f=Th({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:y});this._knobDate=t8(0,-24,""),this._knobTime=t8(0,-7,""),this._knobStatus=t8(0,-41,"");let x=Th({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:y}),_=document.createElementNS(NT,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(m),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(P){byt(C,P)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),m.addEventListener("mousedown",V,!0),m.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],Z=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],X;this._subscriptions=[aa(t.pauseViewModel,"toggled",function(P){X!==P&&(X=P,X?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),aa(t,"shuttleRingAngle",function(P){fyt(C._shuttleRingPointer,C._knobOuter,P)}),aa(t,"dateLabel",function(P){Z.textContent!==P&&(Z.textContent=P)}),aa(t,"timeLabel",function(P){L.textContent!==P&&(L.textContent=P)}),aa(t,"multiplierLabel",function(P){G.textContent!==P&&(G.textContent=P)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(BV.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BV.prototype.isDestroyed=function(){return!1};BV.prototype.destroy=function(){d(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};BV.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};BV.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(d(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=ug(this._themeNormal),n=ug(this._themeHover),i=ug(this._themeSelect),o=ug(this._themeDisabled),r=ug(this._themeKnob),s=ug(this._themePointer),a=ug(this._themeSwoosh),c=ug(this._themeSwooshHover),l=Th({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Br(t,mA)},{tagName:"stop",offset:"12%","stop-color":Br(t,yD)},{tagName:"stop",offset:"46%","stop-color":Br(t,e8)},{tagName:"stop",offset:"81%","stop-color":Br(t,gD)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Br(n,mA)},{tagName:"stop",offset:"12%","stop-color":Br(n,yD)},{tagName:"stop",offset:"46%","stop-color":Br(n,e8)},{tagName:"stop",offset:"81%","stop-color":Br(n,gD)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Br(i,mA)},{tagName:"stop",offset:"12%","stop-color":Br(i,yD)},{tagName:"stop",offset:"46%","stop-color":Br(i,e8)},{tagName:"stop",offset:"81%","stop-color":Br(i,gD)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Br(o,myt)},{tagName:"stop",offset:"75%","stop-color":Br(o,hyt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Br(s,Mxe)},{tagName:"stop",offset:"100%","stop-color":Br(s,Mxe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Br(r,mA)},{tagName:"stop",offset:"60%","stop-color":Br(r,Axe)},{tagName:"stop",offset:"85%","stop-color":Br(r,yD)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Br(r,Axe)},{tagName:"stop",offset:"60%","stop-color":Br(r,mA)},{tagName:"stop",offset:"85%","stop-color":Br(r,gD)}]}]});d(this._defsElement)?this._svgNode.replaceChild(l,this._defsElement):this._svgNode.appendChild(l),this._defsElement=l};var fA=BV;var kmo=T(S(),1);var yyt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mg=15,YV=105;function Uxe(e,t){return e-t}function i8(e,t){let n=Lo(t,e,Uxe);return n<0?~n:n}function gyt(e,t){if(Math.abs(e)<=mg)return e/mg;let n=mg,i=YV,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function xyt(e,t,n){if(n.clockStep===mo.SYSTEM_CLOCK)return mg;if(Math.abs(e)<=1)return e*mg;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=mg,r=YV,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function Qu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Qu.defaultDateFormatter,this._timeFormatter=Qu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Qu.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===mo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return xyt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,YV),-YV);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===YV){c.multiplier=s>0?a[a.length-1]:a[0];return}let l=gyt(s,a);if(t.snapToTicks)l=a[i8(l,a)];else if(l!==0){let u=Math.abs(l);if(u>100){let m=u.toFixed(0).length-2,p=Math.pow(10,m);l=Math.round(l/p)*p|0}else u>mg?l=Math.round(l):u>1?l=+l.toFixed(1):u>0&&(l=+l.toFixed(2))}c.multiplier=l}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Xr.UNBOUNDED)return!0;let c=s.multiplier,l=s.currentTime,u=s.startTime,m=!1;if(a===Xr.LOOP_STOP)m=te.greaterThan(l,u)||l.equals(u)&&c>0;else{let p=s.stopTime;m=te.greaterThan(l,u)&&te.lessThan(l,p)||l.equals(u)&&c>0||l.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Xr.UNBOUNDED)return!0;let c=s.systemTime;return te.greaterThanOrEquals(c,s.startTime)&&te.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Cn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new dg(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Cn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new dg(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Cn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new dg(o,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==mo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Cn(function(){t._clockViewModel.clockStep=mo.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new dg(r,{toggled:Se.computed(function(){return e.clockStep===mo.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Cn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,l=i8(c,a)-1;l>=0&&(s.multiplier=a[l])}),this._faster=Cn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,l=i8(c,a)+1;l<a.length&&(s.multiplier=a[l])})}Qu.defaultDateFormatter=function(e,t){let n=te.toGregorianDate(e);return`${yyt[n.month-1]} ${n.day} ${n.year}`};Qu.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Qu.defaultTimeFormatter=function(e,t){let n=te.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Qu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Qu.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(Uxe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Qu.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Qu._maxShuttleRingAngle=YV;Qu._realtimeShuttleRingAngle=mg;var pA=Qu;var eho=T(S(),1);var Hmo=T(S(),1);function kxe(e){e=g(e,g.EMPTY_OBJECT);let t=e.globe,n=g(e.imageryProviderViewModels,[]),i=g(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Se.getObservable(this,"imageryProviderViewModels"),r=Se.pureComputed(function(){let m=o(),p={},y;for(y=0;y<m.length;y++){let _=m[y],C=_.category;d(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(y=0;y<f.length;y++){let _=f[y];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let m=s(),p={},y;for(y=0;y<m.length;y++){let _=m[y],C=_.category;d(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(y=0;y<f.length;y++){let _=f[y];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,y=d(m)?m.name:void 0,f=d(p)?p.name:void 0;return d(y)&&d(f)?`${y}
${f}`:d(y)?y:f}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(d(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,y=this._currentImageryLayers,f=y.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===y[p]){x.remove(L),_=!0;break}}}if(d(m)){let C=m.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=na.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=na.fromProviderAsync(C);if(V.name=m.name,_)x.add(V,0);else{let L=x.get(0);d(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let l=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return l()},set:function(m){if(l()===m){this.dropDownVisible=!1;return}let p;if(d(m)&&(p=m.creationCommand()),d(p)&&!d(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Cf),this._globe.terrainProvider=p;else if(d(p)){let y=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{y=!0,f()}),_=new AF(p).readyEvent.addEventListener(C=>{y||(this._globe.depthTestAgainstTerrain=!(C instanceof Cf),this._globe.terrainProvider=C,_())})}l(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Cn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=g(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=g(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(kxe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var bA=kxe;function _D(e,t){e=En(e);let n=new bA(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let l=document.createElement("div");l.className="cesium-baseLayerPicker-categoryTitle",l.setAttribute("data-bind","text: name"),c.appendChild(l);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),m.appendChild(y);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let Z=document.createElement("img");Z.className="cesium-baseLayerPicker-itemIcon",Z.setAttribute("data-bind","attr: { src: iconUrl }"),Z.setAttribute("draggable","false"),L.appendChild(Z);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Se.applyBindings(n,i),Se.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(X){i.contains(X.target)||r.contains(X.target)||(n.dropDownVisible=!1)},Mt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(_D.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_D.prototype.isDestroyed=function(){return!1};_D.prototype.destroy=function(){return Mt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var yA=_D;var sho=T(S(),1);function Dxe(e){let t=e.creationFunction;d(t.canExecute)||(t=Cn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=g(e.category,""),Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(Dxe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var Yr=Dxe;var dho=T(S(),1);function _yt(){let e=[],t=devicePixelRatio>=2;return e.push(new Yr({name:"Bing Maps Aerial",iconUrl:$t("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return P0({style:W0.AERIAL})}})),e.push(new Yr({name:"Bing Maps Aerial with Labels",iconUrl:$t("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return P0({style:W0.AERIAL_WITH_LABELS})}})),e.push(new Yr({name:"Bing Maps Roads",iconUrl:$t("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return P0({style:W0.ROAD})}})),e.push(new Yr({name:"ArcGIS World Imagery",iconUrl:$t("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return X0.fromBasemapType(ch.SATELLITE,{enablePickFeatures:!1})}})),e.push(new Yr({name:"ArcGIS World Hillshade",iconUrl:$t("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return X0.fromBasemapType(ch.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new Yr({name:"Esri World Ocean",iconUrl:$t("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data.  The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at 
https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return X0.fromBasemapType(ch.OCEANS,{enablePickFeatures:!1})}})),e.push(new Yr({name:"Open\xADStreet\xADMap",iconUrl:$t("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new z0({url:"https://tile.openstreetmap.org/"})}})),e.push(new Yr({name:"Stadia x Stamen Watercolor",iconUrl:$t("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new z0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
           &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
           &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
           &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new Yr({name:"Stadia x Stamen Toner",iconUrl:$t("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new z0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
            &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new Yr({name:"Stadia Alidade Smooth",iconUrl:$t("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new z0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new Yr({name:"Stadia Alidade Smooth Dark",iconUrl:$t("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new z0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
            &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
            &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new Yr({name:"Sentinel-2",iconUrl:$t("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return I0.fromAssetId(3954)}})),e.push(new Yr({name:"Blue Marble",iconUrl:$t("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return I0.fromAssetId(3845)}})),e.push(new Yr({name:"Earth at night",iconUrl:$t("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return I0.fromAssetId(3812)}})),e.push(new Yr({name:"Natural Earth\xA0II",iconUrl:$t("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return ky.fromUrl($t("Assets/Textures/NaturalEarthII"))}})),e}var gA=_yt;var fho=T(S(),1);function Tyt(){let e=[];return e.push(new Yr({name:"WGS84 Ellipsoid",iconUrl:$t("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Cf}})),e.push(new Yr({name:"Cesium World Terrain",iconUrl:$t("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return ST({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var xA=Tyt;var Rho=T(S(),1);var xho=T(S(),1);function Syt(e){return function(t){let n=e._scene.pick(t.position);d(n)&&n.primitive instanceof zs&&(e.tileset=n.primitive),e.pickActive=!1}}function Yxe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);d(i)&&i.primitive instanceof zs&&(e.tileset=i.primitive)},_n.MOUSE_MOVE):(e._eventHandler.removeInputAction(_n.MOUSE_MOVE),e.picking=e.picking)}var Cyt={maximumFractionDigits:3};function _A(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Cyt):Math.round(t).toLocaleString()}function TA(e,t){if(!d(e))return"";let n=t?e._statisticsPerPass[Xo.PICK]:e._statisticsPerPass[Xo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${_A(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${_A(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${_A(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function Oxe(){let e=Bi.statistics;return`
  <ul class="cesium-cesiumInspector-statistics">
    <li><strong>Geometry Memory (MB): </strong>${_A(e.geometryByteLength)}</li>
    <li><strong>Texture Memory (MB): </strong>${_A(e.texturesByteLength)}</li>
  </ul>
  `}var Vyt=[{text:"Highlight",value:fl.HIGHLIGHT},{text:"Replace",value:fl.REPLACE},{text:"Mix",value:fl.MIX}],Bxe=new B(1,1,0,.4),Lyt=new B,TD=new B;function ca(e,t){let n=this,i=e.canvas;this._eventHandler=new Id(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new A0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Se.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let U=[],J=n._properties();for(let z in J)J.hasOwnProperty(z)&&U.push(z);return U});let o=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),d(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),d(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=fl.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(J){let z=e.pick(J.endPosition);if(z instanceof Ss?(n.feature=z,n.tile=z.content.tile):d(z)&&d(z.content)?(n.feature=void 0,n.tile=z.content.tile):(n.feature=void 0,n.tile=void 0),!!d(n._tileset)){if(s&&d(z)&&d(z.content)){let ee;e.pickPositionSupported&&(ee=e.pickPosition(J.endPosition),d(ee)&&(n._tileset.debugPickPosition=ee)),n._tileset.debugPickedTile=z.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},_n.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(_n.MOUSE_MOVE))}}),this.picking=!0;let c=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return c()},set:function(U){c(U),d(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let l=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return l()},set:function(U){l(U),d(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let u=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(U){u(U),d(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(U){m(U),d(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),d(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let y=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return y()},set:function(U){y(U),d(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),d(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(U){f(U),d(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(U){x(U),d(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(U){_(U),d(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return C()},set:function(U){C(U),d(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let V=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(U){U=Number(U),isNaN(U)||(V(U),d(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let L=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),d(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(U){L(Math.pow(U,6))}});let Z=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return Z()},set:function(U){U=Number(U),isNaN(U)||(Z(U),d(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=4;let G=Syt(this),X=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return X()},set:function(U){X(U),U?n._eventHandler.setInputAction(G,_n.LEFT_CLICK):n._eventHandler.removeInputAction(_n.LEFT_CLICK)}});let P=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return P()},set:function(U){P(U),d(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let v=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return v()},set:function(U){U=Number(U),isNaN(U)||(v(U),d(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let A=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),d(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let M=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return M()},set:function(U){U=Number(U),isNaN(U)||(M(U),d(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let b=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(U){b(U),d(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let R=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),d(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let E=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),d(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),d(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let w=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return w()},set:function(U){U=Number(U),isNaN(U)||(w(U),d(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let N=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),d(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let Y=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return Y()},set:function(U){U=Number(U),isNaN(U)||(Y(U),d(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let k=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(U){k(U),d(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(U){O(U),d(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),d(this._tileset)||Yxe(this,!0)}Object.defineProperties(ca.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return Vyt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,d(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=TA(e,!1),this._pickStatisticsText=TA(e,!0),this._resourceCacheStatisticsText=Oxe(),Yxe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;d(t)&&!t.content.isDestroyed()&&(!this.colorize&&d(this._style)?t.color=d(this._style.color)?this._style.color.evaluateColor(t,Lyt):B.WHITE:t.color=TD,this._scene.requestRender()),d(e)&&(B.clone(e.color,TD),e.color=Bxe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;d(t)&&!t.isDestroyed()&&!o8(t.content)&&(t.color=TD,this._scene.requestRender()),d(e)&&!o8(e.content)&&(B.clone(e.color,TD),e.color=Bxe,this._scene.requestRender()),this._tile=e}}});function o8(e){if(!d(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(d(t)){let n=t.length;for(let i=0;i<n;++i)if(!o8(t[i]))return!1;return!0}return!1}ca.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ca.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ca.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ca.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ca.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ca.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ca.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ca.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ca.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ca.prototype.trimTilesCache=function(){d(this._tileset)&&this._tileset.trimLoadedTiles()};ca.prototype.compileStyle=function(){let e=this._tileset;if(!(!d(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new CT(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ca.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,l;if(t.shiftKey)for(l=0;l<c;++l)a[l][0]===" "&&(a[l][1]===" "?(a[l]=a[l].substr(2),r-=2):(a[l]=a[l].substr(1),r-=1));else for(l=0;l<c;++l)a[l]=`  ${a[l]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ca.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),d(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null,"  ")))}this.showStatistics&&(this._statisticsText=TA(e,!1),this._pickStatisticsText=TA(e,!0),this._resourceCacheStatisticsText=Oxe())};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),ue(this)};ca.getStatistics=TA;var SA=ca;function SD(e,t){e=En(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new SA(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Za.createSection,c=Za.createCheckbox,l=Za.createRangeInput,u=Za.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),y=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let Z=document.createElement("div");Z.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(Z),m.appendChild(V),m.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(u("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),X=document.createElement("p");X.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),X.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),X.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(X),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let P=document.createElement("div");P.setAttribute("data-bind","visible: pointCloudShading"),P.appendChild(l("Geometric Error Scale","geometricErrorScale",0,2,.01)),P.appendChild(l("Maximum Attenuation","maximumAttenuation",0,32,1)),P.appendChild(l("Base Resolution","baseResolution",0,1,.01)),P.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(P);let v=document.createElement("div");v.setAttribute("data-bind","visible: eyeDomeLighting"),v.appendChild(l("EDL Strength","eyeDomeLightingStrength",0,2,.1)),v.appendChild(l("EDL Radius","eyeDomeLightingRadius",0,4,.1)),P.appendChild(v),y.appendChild(c("Freeze Frame","freezeFrame")),y.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let A=document.createElement("div");A.appendChild(l("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),y.appendChild(A);let M=document.createElement("div");M.setAttribute("data-bind","visible: dynamicScreenSpaceError"),M.appendChild(l("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),M.appendChild(l("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,10,.1)),y.appendChild(M),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let R=document.createElement("div");R.className="cesium-3dTilesInspector-statistics",R.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(R),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(E);let I=document.createElement("div");_.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let w=document.createElement("select");w.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(w);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(N);let Y=u("Compile (Ctrl+Enter)","compileStyle");I.appendChild(Y);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),I.appendChild(k),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let O=document.createElement("div");O.appendChild(l("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(O);let U=document.createElement("div");U.appendChild(l("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(U);let J=document.createElement("div");J.appendChild(l("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(J),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(o,n)}Object.defineProperties(SD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SD.prototype.isDestroyed=function(){return!1};SD.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var CA=SD;var Uho=T(S(),1);var Who=T(S(),1);function Ryt(e){let t;if(d(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function r8(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var Zyt=new Sn,Gyt=new h;function VA(e,t){let n=this,i=e.canvas,o=new Id(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Se.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Cn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Cn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Cn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Cn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(l){n._scene.debugShowFrustums=l,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(l){n._scene.debugShowFrustumPlanes=l,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(l){l?n._performanceDisplay=new A0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Cn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Cn(function(){if(n.primitiveReferenceFrame){let l=n._primitive.modelMatrix;n._modelMatrixPrimitive=new SF({modelMatrix:l}),n._scene.primitives.add(n._modelMatrixPrimitive)}else d(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Cn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(l){return d(n._modelMatrixPrimitive)&&l.owner===n._modelMatrixPrimitive._primitive?!0:d(n._primitive)?l.owner===n._primitive||l.owner===n._primitive._billboardCollection||l.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(l){r._surface.tileProvider._debug.wireframe=l,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(l){n._scene.debugShowDepthFrustum=l,n._scene.requestRender()}),this._incrementDepthFrustum=Cn(function(){let l=n.depthFrustum+1;return n.depthFrustum=r8(1,n._numberOfFrustums,l),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Cn(function(){let l=n.depthFrustum-1;return n.depthFrustum=r8(1,n._numberOfFrustums,l),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(l){r._surface._debug.suspendLodUpdate=l,l||(n.filterTile=!1)});let s;this._showTileCoordinates=Cn(function(){return n.tileCoordinates&&!d(s)?s=e.imageryLayers.addImageryProvider(new NF({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&d(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Cn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Cn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],d(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(l){let u=n._scene.pick({x:l.position.x,y:l.position.y});d(u)&&(n.primitive=d(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Cn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(l){l?o.setInputAction(a,_n.LEFT_CLICK):o.removeInputAction(_n.LEFT_CLICK)});function c(l){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(l.position,Zyt),y=r.pick(p,n._scene,Gyt);if(d(y)){let f=m.cartesianToCartographic(y),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<x.length;++_){let C=x[_];if(d(C))for(let V=0;!u&&V<C.length;++V){let L=C[V];de.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Cn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(l){l?o.setInputAction(c,_n.LEFT_CLICK):o.removeInputAction(_n.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(VA.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Cn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Cn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Cn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Cn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Cn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,d(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,d(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(d(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;d(n)&&d(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});VA.prototype._update=function(){this.frustums&&(this.frustumStatisticText=Ryt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=r8(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};VA.prototype.isDestroyed=function(){return!1};VA.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var LA=VA;function CD(e,t){e=En(e);let n=document.createElement("div"),i=new LA(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Za.createSection,c=Za.createCheckbox,l=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(m),l.appendChild(u),l.appendChild(c("Show Frustum Planes","frustumPlanes")),l.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",l.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),l.appendChild(p);let y=document.createElement("div");l.appendChild(y);let f=document.createElement("span");f.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),y.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),y.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),y.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),y.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let Z=document.createElement("input");Z.type="button",Z.value="Pick a primitive",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(Z),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let X=a(s,"Terrain","terrainVisible","toggleTerrain"),P=document.createElement("div");P.className="cesium-cesiumInspector-pickSection",X.appendChild(P);let v=document.createElement("input");v.type="button",v.value="Pick a tile",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(v),G.className="cesium-cesiumInspector-center",P.appendChild(G);let A=document.createElement("div");P.appendChild(A);let M=document.createElement("input");M.type="button",M.value="Parent",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let w=document.createElement("div");w.className="cesium-cesiumInspector-tileText",A.className="cesium-cesiumInspector-frustumStatistics",A.appendChild(w),A.setAttribute("data-bind","visible: hasPickedTile"),w.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",A.appendChild(N);let Y=document.createElement("table"),k=document.createElement("tr"),O=document.createElement("tr"),U=document.createElement("td");U.appendChild(M);let J=document.createElement("td");J.appendChild(b);let z=document.createElement("td");z.appendChild(R),k.appendChild(U),k.appendChild(J),k.appendChild(z);let ee=document.createElement("td"),K=document.createElement("td");K.appendChild(E);let j=document.createElement("td");j.appendChild(I),O.appendChild(ee),O.appendChild(K),O.appendChild(j),Y.appendChild(k),Y.appendChild(O),A.appendChild(Y),P.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),P.appendChild(c("Show only selected","filterTile","hasPickedTile")),X.appendChild(c("Wireframe","wireframe")),X.appendChild(c("Suspend LOD update","suspendUpdates")),X.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(CD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});CD.prototype.isDestroyed=function(){return!1};CD.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var RA=CD;var $ho=T(S(),1);var Kho=T(S(),1);function VD(e,t){d(t)||(t=document.body),t=En(t);let n=this,i=Se.observable(lr.fullscreen),o=Se.observable(lr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&lr.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Cn(function(){lr.fullscreen?lr.exitFullscreen():lr.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=g(En(e),r.body),this._callback=function(){i(lr.fullscreen)},r.addEventListener(lr.changeEventName,this._callback)}Object.defineProperties(VD.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});VD.prototype.isDestroyed=function(){return!1};VD.prototype.destroy=function(){document.removeEventListener(lr.changeEventName,this._callback),ue(this)};var ZA=VD;var Eyt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",Xyt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function LD(e,t){e=En(e);let n=new ZA(t,e);n._exitFullScreenPath=Xyt,n._enterFullScreenPath=Eyt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(LD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});LD.prototype.isDestroyed=function(){return!1};LD.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var GA=LD;var dfo=T(S(),1);var ifo=T(S(),1);function Kxe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Cn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(Kxe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var EA=Kxe;function RD(e,t,n){e=En(e);let i=new EA(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(RD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});RD.prototype.isDestroyed=function(){return!1};RD.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var XA=RD;var Cfo=T(S(),1);var bfo=T(S(),1);var Hxe=1e3;function ju(e){d(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new uF({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new ye,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=Jxe,this._handleArrowUp=zxe;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let o=Se.getObservable(t,"_suggestions")().length>0,r=Se.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Cn(function(i){if(i=g(i,ng.SEARCH),t._focusTextbox=!1,d(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Fyt(t);else return vyt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?zxe(t):r?Jxe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;qxe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=g(e.autocomplete,!0),this.destinationFound=g(e.destinationFound,ju.flyToDestination),this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){ju._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(ju.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});ju.prototype.destroy=function(){this._suggestionSubscription.dispose()};function zxe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],ju._adjustSuggestionsScroll(e,n)}function Jxe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],ju._adjustSuggestionsScroll(e,i)}function Iyt(e,t){let n=d(t)?t.availability:void 0;return d(n)?S0(t,[e]).then(function(i){return e=i[0],e.height+=Hxe,e}):(e.height+=Hxe,Promise.resolve(e))}function Wyt(e,t){let n=e._scene,o=n.mapProjection.ellipsoid,r=n.camera,s=n.terrainProvider,a=t,c;return t instanceof de?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=de.center(t):c=AT(t,n):t=o.cartesianToCartographic(t),d(c)||(c=Iyt(t,s)),c.then(function(l){a=o.cartographicToCartesian(l)}).finally(function(){r.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function Pyt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function vyt(e,t,n){let i=e._searchText;if(jxe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await Pyt(t[o],i,n),d(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,a8(e);let s=r.value;if(r.state==="fulfilled"&&d(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=Qxe(e,SV.getCreditsFromResult(s[0]));d(a)||s8(e,t[o].credit);return}e._searchText=`${i} (not found)`}function s8(e,t){d(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function Qxe(e,t){return d(t)&&t.forEach(n=>s8(e,n)),t}function a8(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function wyt(e,t){let n=En(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function Fyt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function jxe(e){return/^\s*$/.test(e)}function qxe(e){Se.getObservable(e,"_suggestions").removeAll()}async function Ayt(e){if(!e.autoComplete)return;let t=e._searchText;if(qxe(e),a8(e),!jxe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,ng.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=SV.getCreditsFromResult(r);o=o&&!d(s),Qxe(e,s)}),o&&s8(e,n.credit)}if(e._suggestions.length>=5)return}}ju.flyToDestination=Wyt;ju._updateSearchSuggestions=Ayt;ju._adjustSuggestionsScroll=wyt;ju.prototype.isDestroyed=function(){return!1};ju.prototype.destroy=function(){return a8(this),ue(this)};var IA=ju;var Myt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",Nyt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function ZD(e){let t=En(e.container),n=new IA(e);n._startSearchPath=Myt,n._stopSearchPath=Nyt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(l){let u=l.target;typeof l.composedPath=="function"&&(u=l.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(l){n._focusTextbox=!0,n.showSuggestions()},Mt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(ZD.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});ZD.prototype.isDestroyed=function(){return!1};ZD.prototype.destroy=function(){let e=this._container;return Mt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var WA=ZD;var vfo=T(S(),1);var Zfo=T(S(),1);var Uyt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",kyt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function c8(){this._cameraClicked=new ye,this._closeClicked=new ye,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?kyt:Uyt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!d(this.description)||this.description.length===0}})}c8.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(c8.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var PA=c8;function GD(e){e=En(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="&times;",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new PA;Se.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,l=c.createElement("link");l.href=$t("Widgets/InfoBox/InfoBoxDescription.css"),l.rel="stylesheet",l.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(l),c.body.appendChild(u),a._descriptionSubscription=aa(s,"description",function(m){r.style.height="5px",u.innerHTML=m;let p=null,y=u.firstElementChild;if(y!==null&&u.childNodes.length===1){let x=window.getComputedStyle(y);if(x!==null){let _=x["background-color"],C=B.fromCssColorString(_);d(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(GD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});GD.prototype.isDestroyed=function(){return!1};GD.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),d(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var vA=GD;var Ofo=T(S(),1);var Mfo=T(S(),1);function $xe(){this.showInstructions=!1;let e=this;this._command=Cn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Cn(function(){e._touch=!1}),this._showTouch=Cn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties($xe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var wA=$xe;function ED(e){let t=En(e.container),n=new wA,i=g(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=$t("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let l=document.createElement("button");l.type="button",l.className="cesium-navigation-button cesium-navigation-button-right",l.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=$t("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",l.appendChild(u),l.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(l);let m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=`            <table>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">Left click + drag</div>                    </td>                </tr>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Right click + drag, or</div>                        <div class="cesium-navigation-help-details">Mouse wheel scroll</div>                    </td>                </tr>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Rotate view</div>                        <div class="cesium-navigation-help-details">Middle click + drag, or</div>                        <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div>                    </td>                </tr>            </table>`,s.appendChild(m);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=`            <table>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">One finger drag</div>                    </td>                </tr>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Two finger pinch</div>                    </td>                </tr>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Tilt view</div>                        <div class="cesium-navigation-help-details">Two finger drag, same direction</div>                    </td>                </tr>                <tr>                    <td><img src="${$t("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">Rotate view</div>                        <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div>                    </td>                </tr>            </table>`,s.appendChild(p),Se.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(y){o.contains(y.target)||(n.showInstructions=!1)},Mt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(ED.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ED.prototype.isDestroyed=function(){return!1};ED.prototype.destroy=function(){return Mt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var FA=ED;var rpo=T(S(),1);var qfo=T(S(),1);function l8(e){this._scene=e.scene,this.lowFrameRateMessage=g(e.lowFrameRateMessage,"This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Cn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=LF.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(l8.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});l8.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var AA=l8;function XD(e){let t=En(e.container),n=new AA(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="&times;",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(XD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XD.prototype.isDestroyed=function(){return!1};XD.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var MA=XD;var gpo=T(S(),1);var upo=T(S(),1);function ID(e){this._scene=e,this._orthographic=e.camera.frustum instanceof en,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Cn(function(){t.sceneMode===ie.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Lr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ie.SCENE2D||t._scene.camera.frustum instanceof en}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=d(e.camera._currentFlight)}),this._switchToPerspective=Cn(function(){t.sceneMode!==ie.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Cn(function(){t.sceneMode!==ie.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ie}Object.defineProperties(ID.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});ID.prototype.isDestroyed=function(){return!1};ID.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var NA=ID;var Dyt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",Byt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function WD(e,t){e=En(e);let n=new NA(t);n._perspectivePath=Dyt,n._orthographicPath=Byt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic,       "cesium-projectionPicker-buttonOrthographic": _orthographic,       "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress,        "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),       "cesium-projectionPicker-none" : !_orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),       "cesium-projectionPicker-none" : _orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Mt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(WD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WD.prototype.isDestroyed=function(){return!1};WD.prototype.destroy=function(){return this._viewModel.destroy(),Mt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var UA=WD;var Wpo=T(S(),1);var Lpo=T(S(),1);function PD(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Lr,this._eventHelper.add(e.morphStart,i),this._duration=g(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ie.SCENE2D?n.tooltip2D:o===ie.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Cn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Cn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Cn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Cn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ie}Object.defineProperties(PD.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});PD.prototype.isDestroyed=function(){return!1};PD.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var kA=PD;var Yyt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878         -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132         -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285         11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z         M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201         5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461         -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",Oyt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Kyt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function vD(e,t,n){e=En(e);let i=new kA(t,n);i._globePath=Yyt,i._flatMapPath=Oyt,i._columbusViewPath=Kyt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Se.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(l){o.contains(l.target)||(i.dropDownVisible=!1)},Mt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(vD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vD.prototype.isDestroyed=function(){return!1};vD.prototype.destroy=function(){return this._viewModel.destroy(),Mt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var DA=vD;var Ypo=T(S(),1);var Apo=T(S(),1);var Hyt=new D,wD="-1000px";function BA(e,t,n){this._scene=e,this._screenPositionX=wD,this._screenPositionY=wD,this._tweens=e.tweens,this._container=g(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&d(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Ji.wgs84ToWindowCoordinates(e,i,o)}}BA.prototype.update=function(){if(this.showSelection&&d(this.position)){let e=this.computeScreenSpacePosition(this.position,Hyt);if(!d(e))this._screenPositionX=wD,this._screenPositionY=wD;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};BA.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Wr.EXPONENTIAL_OUT})};BA.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Wr.EXPONENTIAL_OUT})};Object.defineProperties(BA.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var YA=BA;function FD(e,t){e=En(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new YA(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(FD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FD.prototype.isDestroyed=function(){return!1};FD.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),ue(this)};var OA=FD;var n0o=T(S(),1);var Hpo=T(S(),1);function UT(e,t,n){this._color=e,this._height=t,this._base=g(n,0)}UT.prototype.getHeight=function(){return this._height};UT.prototype.getBase=function(){return this._base};UT.prototype.getStartTime=function(){return this._start};UT.prototype.getStopTime=function(){return this._stop};UT.prototype.setRange=function(e,t){this._start=e,this._stop=t};UT.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=te.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=te.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var KA=UT;var Qpo=T(S(),1);function e_e(e,t,n,i){this.interval=e,this.height=t,this.color=n||new B(.5,.5,.5,1),this.backgroundColor=i||new B(0,0,0,0)}e_e.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=te.addSeconds(t.startJulian,t.duration,new te);if(te.lessThan(n,o)&&te.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(te.lessThanOrEquals(n,r)&&te.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let l=te.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new te);!d(a)&&te.greaterThanOrEquals(l,n)?a=s:!d(c)&&te.greaterThanOrEquals(l,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),d(a)&&(d(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var HA=e_e;var d8=1e12,qu={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Qc={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},hg=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],zyt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function jc(e,t){e=En(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=qu.none,this._touchMode=Qc.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=Jyt(this),this._onMouseUp=Qyt(this),this._onMouseMove=jyt(this),this._onMouseWheel=qyt(this),this._onTouchStart=$yt(this),this._onTouchMove=tgt(this),this._onTouchEnd=egt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}jc.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};jc.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};jc.prototype.isDestroyed=function(){return!1};jc.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};jc.prototype.addHighlightRange=function(e,t,n){let i=new KA(e,t,n);return this._highlightRanges.push(i),this.resize(),i};jc.prototype.addTrack=function(e,t,n,i){let o=new HA(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};jc.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=te.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Xr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=te.secondsDifference(o,i),s=te.secondsDifference(i,this._startJulian),a=te.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=te.addSeconds(this._endJulian,s,new te),this._startJulian=i,this._timeBarSecondsSpan=te.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=te.addSeconds(this._startJulian,a,new te),this._endJulian=o,this._timeBarSecondsSpan=te.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};jc.prototype.zoomFrom=function(e){let t=te.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(te.addSeconds(this._startJulian,t-t*e,new te),te.addSeconds(this._endJulian,n*e-n,new te))};function u8(e){return e<10?`0${e.toString()}`:e.toString()}jc.prototype.makeLabel=function(e){let t=te.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${zyt[t.month-1]} ${t.day} ${t.year} ${u8(t.hour)}:${u8(t.minute)}:${u8(t.second)}${i}`};jc.prototype.smallestTicInPixels=7;jc.prototype._makeTics=function(){let e=this._timeBarEle,t=te.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,l=1e-10,u=0,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=te.addSeconds(this._startJulian,a,new te)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=te.addSeconds(this._startJulian,c,new te));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let y=this._startJulian,f=Math.min(m/p*1e-5,.4),x,_=te.toGregorianDate(y);m>31536e4?x=te.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?x=te.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?x=te.fromDate(new Date(Date.UTC(_.year,0))):x=te.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=te.secondsDifference(this._startJulian,te.addSeconds(x,f,new te)),V=C+m;this._epochJulian=x;function L(U){return Math.floor(C/U)*U}function Z(U,J){return Math.ceil(U/J+.5)*J}function G(U){return(U-C)/m}function X(U,J){return U-J*Math.round(U/J)}this._rulerEle.innerHTML=this.makeLabel(te.addSeconds(this._endJulian,-a,new te));let P=this._rulerEle.offsetWidth+20;P<30&&(P=180);let v=u;u-=l;let A={startTime:C,startJulian:y,epochJulian:x,duration:m,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(U){s+=U.render(A)});let M=0,b=0,R=0,E=P/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let I=-1,w=-1,N=hg.length,Y;for(Y=0;Y<N;++Y){let U=hg[Y];if(++I,M=U,U>E&&U>u)break;w<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(w=I)}if(I>0){for(;I>0;)if(--I,Math.abs(X(M,hg[I]))<1e-5){hg[I]>=u&&(b=hg[I]);break}if(w>=0)for(;w<I;){if(Math.abs(X(b,hg[w]))<1e-5&&hg[w]>=u){R=hg[w];break}++w}}u=v,u>l&&R<1e-5&&Math.abs(u-M)>l&&(R=u,u<=M+l&&(b=0));let k=-999999,O;if(p*(R/this._timeBarSecondsSpan)>=3)for(o=L(R);o<=V;o=Z(o,R))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=L(b);o<=V;o=Z(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(M/this._timeBarSecondsSpan)>=2){this._mainTicSpan=M,V+=M,o=L(M);let U=te.computeTaiMinusUtc(x);for(;o<=V;){let J=te.addSeconds(y,o-C,new te);if(M>2.1){let j=te.computeTaiMinusUtc(J);Math.abs(j-U)>.1&&(o+=j-U,J=te.addSeconds(y,o-C,new te))}let z=Math.round(p*G(o)),ee=this.makeLabel(J);this._rulerEle.innerHTML=ee,O=this._rulerEle.offsetWidth,O<10&&(O=P);let K=z-(O/2-1);K>k?(k=K+O+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${z.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${K.toString()}px;">${ee}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${z.toString()}px;"></span>`,o=Z(o,M)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(U){U.render(r._context,A),A.y+=U.height})};jc.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(d(this._scrubElement)){let t=te.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}d(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(te.addSeconds(this._startJulian,this._timelineDrag,new te),te.addSeconds(this._endJulian,this._timelineDrag,new te)))};jc.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=te.addSeconds(this._startJulian,t,new te),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function Jyt(e){return function(t){e._mouseMode!==qu.touchOnly&&(t.button===0?(e._mouseMode=qu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=qu.zoom:e._mouseMode=qu.slide)),t.preventDefault()}}function Qyt(e){return function(t){e._mouseMode=qu.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function jyt(e){return function(t){let n;if(e._mouseMode===qu.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===qu.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(te.addSeconds(e._startJulian,i,new te),te.addSeconds(e._endJulian,i,new te))}}else e._mouseMode===qu.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function qyt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;d8=Math.max(Math.min(Math.abs(n),d8),1),n/=d8,e.zoomFrom(Math.pow(1.05,-n))}}function $yt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=qu.touchOnly,n===1?(i=te.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=Qc.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Qc.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Qc.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Qc.ignore}}function egt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Qc.singleTap?(e._touchMode=Qc.scrub,e._onTouchMove(t)):e._touchMode===Qc.scrub&&e._onTouchMove(t),e._mouseMode=qu.touchOnly,n!==1?e._touchMode=n>0?Qc.ignore:Qc.none:e._touchMode===Qc.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function tgt(e){return function(t){let n,i,o,r,s,a,c=1,l=e._topDiv.getBoundingClientRect().left;e._touchMode===Qc.singleTap&&(e._touchMode=Qc.slideZoom),e._mouseMode=qu.touchOnly,e._touchMode===Qc.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-l,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Qc.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-l,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-l,s=0),d(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=te.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new te)):(n=e._touchState.centerX-r,a=te.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new te)),e.zoomTo(a,te.addSeconds(a,e._timeBarSecondsSpan*c,new te)),e._touchState.centerX=r,e._touchState.spanX=s))}}jc.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var zA=jc;var x0o=T(S(),1);var m0o=T(S(),1);var r_e=T(o_e(),1);function ogt(e){let t=!1,n=window.screen;return d(n)&&(d(n.lockOrientation)?t=n.lockOrientation(e):d(n.mozLockOrientation)?t=n.mozLockOrientation(e):d(n.msLockOrientation)?t=n.msLockOrientation(e):d(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function s_e(){let e=window.screen;d(e)&&(d(e.unlockOrientation)?e.unlockOrientation():d(e.mozUnlockOrientation)?e.mozUnlockOrientation():d(e.msUnlockOrientation)?e.msUnlockOrientation():d(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function rgt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(s_e(),e._locked=!1),e._noSleep.disable(),lr.exitFullscreen(),n(!1)):(lr.fullscreen||lr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=ogt("landscape")),t.useWebVR=!0,n(!0)))}function AD(e,t){let n=this,i=Se.observable(lr.enabled),o=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&lr.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Lr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof en)}),this._locked=!1,this._noSleep=new r_e.default,this._command=Cn(function(){rgt(n,e,o,r)},Se.getObservable(this,"isVREnabled")),this._vrElement=g(En(t),document.body),this._callback=function(){!lr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(s_e(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(lr.changeEventName,this._callback)}Object.defineProperties(AD.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});AD.prototype.isDestroyed=function(){return!1};AD.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(lr.changeEventName,this._callback),ue(this)};var JA=AD;var sgt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",agt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function MD(e,t,n){e=En(e);let i=new JA(t,n);i._exitVRPath=agt,i._enterVRPath=sgt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(MD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MD.prototype.isDestroyed=function(){return!1};MD.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var QA=MD;var k0o=T(S(),1);var fg=new ce;function l_e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function cgt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);d(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function lgt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(d(r)&&r!=="")return r}return"Unnamed Feature"}function a_e(e,t){let n=e.scene.pick(t.position);if(d(n)){let i=g(n.id,n.primitive.id);if(i instanceof Oo)return i;if(n instanceof Ss)return new Oo({name:lgt(n),description:cgt(n),feature:n})}if(d(e.scene.globe))return mgt(e,t.position)}var dgt=new te;function d_e(e,t,n){if(d(n)){let i=n.clock;if(d(i)&&(i.getValue(t),d(e))){let o=i.startTime,r=i.stopTime;te.equals(o,r)&&(r=te.addSeconds(o,W.EPSILON2,dgt)),e.updateFromClock(),e.zoomTo(o,r)}}}var ugt=new h;function mgt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!d(o))return;let r=new Oo({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!d(s)||s.length===0){e.selectedEntity=c_e();return}let a=s[0],c=new Oo({id:a.name,description:a.description});if(d(a.position)){let l=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,ugt);c.position=new Gc(l)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=c_e())}),r}function c_e(){return new Oo({id:"None",description:"No features found."})}function hgt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,l=e._fullscreenButton,u=e._infoBox,m=e._selectionIndicator,p=t?"hidden":"visible";if(d(n)&&(n.container.style.visibility=p),d(i)&&(i.container.style.visibility=p),d(o)&&(o.container.style.visibility=p),d(r)&&(r.container.style.visibility=p),d(s)&&(s.container.style.visibility=p),d(a)&&(a.container.style.visibility=p),d(c)&&(c.container.style.visibility=p),d(l)&&l.viewModel.isFullscreenEnabled&&(l.container.style.visibility=p),d(u)&&(u.container.style.visibility=p),d(m)&&(m.container.style.visibility=p),e._container){let y=t||!d(l)?0:l.container.clientWidth;e._vrButton.container.style.right=`${y}px`,e.forceResize()}}function wi(e,t){e=En(e),t=g(t,g.EMPTY_OBJECT);let n=(!d(t.globe)||t.globe!==!1)&&(!d(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=g(t.scene3DOnly,!1),c,l,u=!1;d(t.clockViewModel)?(l=t.clockViewModel,c=l.clock):(c=new Dm,l=new dA(c),u=!0),d(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let m=new qw(r,{baseLayer:n||d(t.baseLayer)||d(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:d(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,y=!1;d(p)||(p=new C2,y=!0);let f=m.scene,x=new lP({scene:f,dataSourceCollection:p}),_=new Lr;_.add(c.onTick,wi.prototype._onTick,this),_.add(f.morphStart,wi.prototype._clearTrackedObject,this);let C;if(!d(t.selectionIndicator)||t.selectionIndicator!==!1){let z=document.createElement("div");z.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(z),C=new OA(z,f)}let V;if(!d(t.infoBox)||t.infoBox!==!1){let z=document.createElement("div");z.className="cesium-viewer-infoBoxContainer",o.appendChild(z),V=new vA(z);let ee=V.viewModel;_.add(ee.cameraClicked,wi.prototype._onInfoBoxCameraClicked,this),_.add(ee.closeClicked,wi.prototype._onInfoBoxClockClicked,this)}let L=document.createElement("div");L.className="cesium-viewer-toolbar",o.appendChild(L);let Z;if(!d(t.geocoder)||t.geocoder!==!1){let z=document.createElement("div");z.className="cesium-viewer-geocoderContainer",L.appendChild(z);let ee;d(t.geocoder)&&typeof t.geocoder!="boolean"&&(ee=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),Z=new WA({container:z,geocoderServices:ee,scene:f}),_.add(Z.viewModel.search.beforeExecute,wi.prototype._clearObjects,this)}let G;(!d(t.homeButton)||t.homeButton!==!1)&&(G=new XA(L,f),d(Z)&&_.add(G.viewModel.command.afterExecute,function(){let z=Z.viewModel;z.searchText="",z.isSearchInProgress&&z.search()}),_.add(G.viewModel.command.beforeExecute,wi.prototype._clearTrackedObject,this));let X;!a&&(!d(t.sceneModePicker)||t.sceneModePicker!==!1)&&(X=new DA(L,f));let P;t.projectionPicker&&(P=new UA(L,f));let v,A;if(n){let z=g(t.imageryProviderViewModels,gA()),ee=g(t.terrainProviderViewModels,xA());v=new yA(L,{globe:f.globe,imageryProviderViewModels:z,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:ee,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),A=L.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}d(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),f.imageryLayers.removeAll(),f.imageryLayers.add(t.baseLayer)),d(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),f.terrainProvider=t.terrainProvider),d(t.terrain)&&(n&&(v.viewModel.selectedTerrain=void 0,f.globe.depthTestAgainstTerrain=!0),f.setTerrain(t.terrain));let M;if(!d(t.navigationHelpButton)||t.navigationHelpButton!==!1){let z=!0;try{if(d(window.localStorage)){let ee=window.localStorage.getItem("cesium-hasSeenNavHelp");d(ee)&&ee?z=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new FA({container:L,instructionsInitiallyVisible:g(t.navigationInstructionsInitiallyVisible,z)})}let b;if(!d(t.animation)||t.animation!==!1){let z=document.createElement("div");z.className="cesium-viewer-animationContainer",o.appendChild(z),b=new fA(z,new pA(l))}let R;if(!d(t.timeline)||t.timeline!==!1){let z=document.createElement("div");z.className="cesium-viewer-timelineContainer",o.appendChild(z),R=new zA(z,c),R.addEventListener("settime",l_e,!1),R.zoomTo(c.startTime,c.stopTime)}let E,I,w;(!d(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),E=new GA(w,t.fullscreenElement),I=aa(E.viewModel,"isFullscreenEnabled",function(z){w.style.display=z?"block":"none",d(R)&&(R.container.style.right=`${w.clientWidth}px`,R.resize())}));let N,Y,k;if(t.vrButton){let z=document.createElement("div");z.className="cesium-viewer-vrContainer",o.appendChild(z),N=new QA(z,f,t.fullScreenElement),Y=aa(N.viewModel,"isVREnabled",function(ee){z.style.display=ee?"block":"none",d(E)&&(z.style.right=`${w.clientWidth}px`),d(R)&&(R.container.style.right=`${z.clientWidth}px`,R.resize())}),k=aa(N.viewModel,"isVRMode",function(ee){hgt(i,ee)})}this._baseLayerPickerDropDown=A,this._fullscreenSubscription=I,this._vrSubscription=Y,this._vrModeSubscription=k,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=g(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=C,this._infoBox=V,this._dataSourceCollection=p,this._destroyDataSourceCollection=y,this._dataSourceDisplay=x,this._clockViewModel=l,this._destroyClockViewModel=u,this._toolbar=L,this._homeButton=G,this._sceneModePicker=X,this._projectionPicker=P,this._baseLayerPicker=v,this._navigationHelpButton=M,this._animation=b,this._timeline=R,this._fullscreenButton=E,this._vrButton=N,this._geocoder=Z,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=d(V)||d(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new ye,this._trackedEntityChanged=new ye,Se.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),_.add(p.dataSourceAdded,wi.prototype._onDataSourceAdded,this),_.add(p.dataSourceRemoved,wi.prototype._onDataSourceRemoved,this),_.add(f.postUpdate,wi.prototype.resize,this),_.add(f.postRender,wi.prototype._postRender,this);let O=p.length;for(let z=0;z<O;z++)this._dataSourceAdded(p,p.get(z));this._dataSourceAdded(void 0,x.defaultDataSource),_.add(p.dataSourceAdded,wi.prototype._dataSourceAdded,this),_.add(p.dataSourceRemoved,wi.prototype._dataSourceRemoved,this);function U(z){let ee=a_e(i,z);d(ee)?H.getValueOrUndefined(ee.position,i.clock.currentTime)?i.trackedEntity=ee:i.zoomTo(ee):d(i.trackedEntity)&&(i.trackedEntity=void 0)}function J(z){i.selectedEntity=a_e(i,z)}m.screenSpaceEventHandler.setInputAction(J,_n.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(U,_n.LEFT_DOUBLE_CLICK)}Object.defineProperties(wi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,p8(this);let t=this.scene,n=t.mode;!d(e)||!d(e.position)?(this._needTrackedEntityUpdate=!1,(n===ie.COLUMBUS_VIEW||n===ie.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ie.COLUMBUS_VIEW||n===ie.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=d(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;d(e)?d(t)&&t.animateAppear():d(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,d_e(this._timeline,this.clock,e))}}});wi.prototype.extend=function(e,t){e(this,t)};wi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=d(this._animation),r=d(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(d(a)&&(a.style.maxHeight=`${s}px`),d(this._geocoder)){let y=this._geocoder.searchSuggestionsContainer;y.style.maxHeight=`${s}px`}d(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,l,u=0,m=0,p=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let y=this._lastWidth;l=this._animation.container,n>900?(u=169,y<=900&&(l.style.width="169px",l.style.height="112px",this._animation.resize())):n>=600?(u=136,(y<600||y>900)&&(l.style.width="136px",l.style.height="90px",this._animation.resize())):(u=106,(y>600||y===0)&&(l.style.width="106px",l.style.height="70px",this._animation.resize())),m=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let y=this._fullscreenButton,f=this._vrButton,x=c.container,_=x.style;p=x.clientHeight+3,_.left=`${u}px`;let C=0;d(y)&&(C+=y.container.clientWidth),d(f)&&(C+=f.container.clientWidth),_.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};wi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};wi.prototype.render=function(){this._cesiumWidget.render()};wi.prototype.isDestroyed=function(){return!1};wi.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(_n.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(_n.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),d(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),d(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),d(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),d(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),d(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),d(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),d(this._timeline)&&(this._timeline.removeEventListener("settime",l_e,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),d(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),d(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),d(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),d(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};wi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(wi.prototype._onEntityCollectionChanged,this)};wi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(wi.prototype._onEntityCollectionChanged,this),d(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),d(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};wi.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(d(i)){let u=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(u,!1,fg)===lt.DONE&&i.update(t,fg)}let o,r=!1,s=this.selectedEntity,a=d(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,fg)!==lt.FAILED?o=fg.center:d(s.position)&&(o=s.position.getValue(t,o)),r=d(o));let c=d(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;d(c)&&(c.position=h.clone(o,c.position),c.showSelection=a&&r,c.update());let l=d(this._infoBox)?this._infoBox.viewModel:void 0;d(l)&&(l.showInfo=a,l.enableCamera=r,l.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(l.titleText=g(s.name,s.id),l.description=H.getValueOrDefault(s.description,t,"")):(l.titleText="",l.description=""))};wi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0),this.selectedEntity===r&&(this.selectedEntity=void 0)}};wi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;d(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};wi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};wi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};wi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};wi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&d_e(this.timeline,this.clock,e)};wi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,wi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};wi.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};wi.prototype.zoomTo=function(e,t){return u_e(this,e,{offset:t},!1)};wi.prototype.flyTo=function(e,t){return u_e(this,e,t,!0)};function u_e(e,t,n,i){p8(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof na){let s;d(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return AT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof zs||r instanceof MV||r instanceof DV){e._zoomTarget=r;return}if(r.isLoading&&d(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=g(r.values,r),d(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function jA(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function p8(e){let t=e._zoomPromise;d(t)&&(jA(e),e._completeZoom(!1))}wi.prototype._postRender=function(){fgt(this),pgt(this)};function fgt(e){let t=e._zoomTarget;if(!d(t)||e.scene.mode===ie.MORPHING)return;let n=e.scene,i=n.camera,o=g(e._zoomOptions,{}),r;function s(u){d(o.offset)||(o.offset=new Pu(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),jA(e)}if(t instanceof MV){if(d(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof zs||t instanceof DV){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),jA(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,fg);if(p===lt.PENDING)return;p!==lt.FAILED&&c.push(ce.clone(fg))}if(c.length===0){p8(e);return}e.trackedEntity=void 0;let l=ce.fromBoundingSpheres(c);e._zoomIsFlight?(jA(e),i.flyToBoundingSphere(l,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(l,o.offset),i.lookAtTransform(F.IDENTITY),jA(e),e._completeZoom(!0))}function pgt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=H.getValueOrUndefined(t.position,n);if(!d(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,fg);if(r===lt.PENDING)return;let s=o.mode;(s===ie.COLUMBUS_VIEW||s===ie.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ie.COLUMBUS_VIEW||s===ie.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==lt.FAILED?fg:void 0;e._entityView=new uP(t,o,o.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var b8=wi;var Y0o=T(S(),1);function bgt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new CA(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var y8=bgt;var H0o=T(S(),1);function ygt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new RA(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var g8=ygt;var j0o=T(S(),1);function ggt(e,t){t=g(t,g.EMPTY_OBJECT);let n=!0,i=g(t.flyToOnDrop,!0),o=new ye,r=g(t.clearOnDrop,!0),s=g(t.dropTarget,e.container),a=g(t.clampToGround,!0),c=t.proxy;s=En(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){m_e(s,l),s=u,x8(s,l)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?x8(s,l):m_e(s,l),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function l(u){kT(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let y=0;y<p;y++){let f=m[y],x=new FileReader;x.onload=xgt(e,f,c,a),x.onerror=_gt(e,f),x.readAsText(f)}}x8(s,l),e.destroy=pF(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=l}function kT(e){e.stopPropagation(),e.preventDefault()}function m_e(e,t){let n=e;d(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",kT,!1),n.removeEventListener("dragover",kT,!1),n.removeEventListener("dragexit",kT,!1))}function x8(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",kT,!1),e.addEventListener("dragover",kT,!1),e.addEventListener("dragexit",kT,!1)}function xgt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=S2.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=fP.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=wP.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=gP.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}d(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function _gt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var _8=ggt;var ibo=T(S(),1);function Tgt(e,t){t=g(t,g.EMPTY_OBJECT);let n=new MA({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var T8=Tgt;var gbo=T(S(),1);var pbo=T(S(),1);var cbo=T(S(),1);function h_e(e){let t=e.split(`
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c}
`}return i}function $u(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),d(c)&&t._getPrimitiveFunctions.push(c);let l=Se.observable();return Se.defineProperty(t,r,{get:function(){return l()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),l(u),d(a)&&d(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,l}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=h_e(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Oi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Oi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Oi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Uf(t)}})}var Sgt=new h,Cgt=new h,Vgt=new Aa,Lgt=new $;function Uf(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,Sgt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,Cgt),i=Vgt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,Lgt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties($u.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(d(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),d(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=h_e(i),d(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Uf(t)}}}});$u.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};$u.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};$u.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};$u.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};$u.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};$u.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};$u.prototype.compileShader=function(){d(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new wT({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};$u.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,l;if(t.shiftKey)for(l=0;l<c;++l)a[l][0]===" "&&(a[l][1]===" "?(a[l]=a[l].substr(2),r-=2):(a[l]=a[l].substr(1),r-=1));else for(l=0;l<c;++l)a[l]=`  ${a[l]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};$u.prototype.isDestroyed=function(){return!1};$u.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),ue(this)};var qA=$u;function ND(e,t){e=En(e);let n=document.createElement("div"),i=new qA(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Za.createSection,a=Za.createCheckbox,c=Za.createRangeInput,l=Za.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),y=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=W.PI;m.appendChild(c("Translation X","translationX",-x,+x)),m.appendChild(c("Translation Y","translationY",-x,+x)),m.appendChild(c("Translation Z","translationZ",-x,+x)),m.appendChild(c("Scale X","scaleX",0,+_)),m.appendChild(c("Scale Y","scaleY",0,+_)),m.appendChild(c("Scale Z","scaleZ",0,+_)),m.appendChild(c("Heading","angleX",-C,+C)),m.appendChild(c("Pitch","angleY",-C,+C)),m.appendChild(c("Roll","angleZ",-C,+C));let V=Oi.getMinBounds(Oi.BOX),L=Oi.getMaxBounds(Oi.BOX),Z=h.fromElements(Oi.getMinBounds(Oi.ELLIPSOID).x,Oi.getMinBounds(Oi.ELLIPSOID).y,-re.WGS84.maximumRadius,new h),G=h.fromElements(Oi.getMaxBounds(Oi.ELLIPSOID).x,Oi.getMaxBounds(Oi.ELLIPSOID).y,1e7,new h),X=Oi.getMinBounds(Oi.CYLINDER),P=Oi.getMaxBounds(Oi.CYLINDER);OV("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),OV("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",p),OV("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",X,P,"shapeIsCylinder",p),OV("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",y),OV("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",y),OV("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",X,P,"shapeIsCylinder",y);let v=document.createElement("div");f.appendChild(v);let A=document.createElement("textarea");A.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),v.className="cesium-cesiumInspector-styleEditor",v.appendChild(A);let M=l("Compile (Ctrl+Enter)","compileShader");v.appendChild(M);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),v.appendChild(b),Se.applyBindings(i,n)}Object.defineProperties(ND.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ND.prototype.isDestroyed=function(){return!1};ND.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function OV(e,t,n,i,o,r,s,a,c,l,u,m,p,y,f,x){let _=Za.createRangeInput,C=p,V=y,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${f}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,l,C.y,V.y)),L.appendChild(_(o,u,C.z,V.z)),L.appendChild(_(r,m,C.z,V.z))}var $A=ND;function Rgt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new $A(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var S8=Rgt;globalThis.CESIUM_VERSION="1.110.1";var Zgt="1.110.1";return E_e(Ggt);})();