2 var __create = Object.create;
3 var __defProp = Object.defineProperty;
4 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5 var __getOwnPropNames = Object.getOwnPropertyNames;
6 var __getProtoOf = Object.getPrototypeOf;
7 var __hasOwnProp = Object.prototype.hasOwnProperty;
8 var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
9 get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
10 }) : x2)(function(x2) {
11 if (typeof require !== "undefined")
12 return require.apply(this, arguments);
13 throw Error('Dynamic require of "' + x2 + '" is not supported');
15 var __commonJS = (cb, mod) => function __require2() {
16 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18 var __export = (target, all) => {
20 __defProp(target, name, { get: all[name], enumerable: true });
22 var __copyProps = (to, from, except, desc) => {
23 if (from && typeof from === "object" || typeof from === "function") {
24 for (let key of __getOwnPropNames(from))
25 if (!__hasOwnProp.call(to, key) && key !== except)
26 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
30 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31 // If the importer is in node compatibility mode or this is not an ESM
32 // file that has been converted to a CommonJS file using a Babel-
33 // compatible transform (i.e. "__esModule" has not been set), then set
34 // "default" to the CommonJS "module.exports" for node compatibility.
35 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
39 // node_modules/diacritics/index.js
40 var require_diacritics = __commonJS({
41 "node_modules/diacritics/index.js"(exports2) {
42 exports2.remove = removeDiacritics2;
43 var replacementList = [
54 chars: "\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
62 chars: "\xC6\u01FC\u01E2"
82 chars: "\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"
86 chars: "\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"
90 chars: "\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"
102 chars: "\u01F2\u01C5"
106 chars: "\u025B\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E\u1D07"
110 chars: "\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"
114 chars: "\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"
118 chars: "\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
122 chars: "\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
126 chars: "\u24BF\uFF2A\u0134\u0248\u0237"
130 chars: "\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
134 chars: "\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
146 chars: "\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"
150 chars: "\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"
162 chars: "\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
182 chars: "\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
186 chars: "\u24C6\uFF31\uA756\uA758\u024A"
190 chars: "\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
194 chars: "\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
198 chars: "\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
210 chars: "\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
214 chars: "\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
222 chars: "\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
226 chars: "\u24CD\uFF38\u1E8A\u1E8C"
230 chars: "\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
234 chars: "\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
238 chars: "\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0251"
246 chars: "\xE6\u01FD\u01E3"
258 chars: "\uA739\uA73B"
266 chars: "\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"
270 chars: "\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
274 chars: "\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"
282 chars: "\u01F3\u01C6"
286 chars: "\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u01DD"
290 chars: "\u24D5\uFF46\u1E1F\u0192"
314 chars: "\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"
318 chars: "\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
326 chars: "\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
330 chars: "\u24D9\uFF4A\u0135\u01F0\u0249"
334 chars: "\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
338 chars: "\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"
346 chars: "\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
350 chars: "\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"
358 chars: "\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11"
378 chars: "\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"
382 chars: "\u24E0\uFF51\u024B\uA757\uA759"
386 chars: "\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
390 chars: "\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"
398 chars: "\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
410 chars: "\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
414 chars: "\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
422 chars: "\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
426 chars: "\u24E7\uFF58\u1E8B\u1E8D"
430 chars: "\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
434 chars: "\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
437 var diacriticsMap = {};
438 for (i3 = 0; i3 < replacementList.length; i3 += 1) {
439 chars = replacementList[i3].chars;
440 for (j3 = 0; j3 < chars.length; j3 += 1) {
441 diacriticsMap[chars[j3]] = replacementList[i3].base;
447 function removeDiacritics2(str2) {
448 return str2.replace(/[^\u0000-\u007e]/g, function(c2) {
449 return diacriticsMap[c2] || c2;
452 exports2.replacementList = replacementList;
453 exports2.diacriticsMap = diacriticsMap;
457 // node_modules/alif-toolkit/lib/isArabic.js
458 var require_isArabic = __commonJS({
459 "node_modules/alif-toolkit/lib/isArabic.js"(exports2) {
461 Object.defineProperty(exports2, "__esModule", { value: true });
471 // Mathematical Alphabetic symbols https://www.unicode.org/charts/PDF/U1EE00.pdf
473 function isArabic(char) {
474 if (char.length > 1) {
475 throw new Error("isArabic works on only one-character strings");
477 let code = char.charCodeAt(0);
478 for (let i3 = 0; i3 < arabicBlocks.length; i3++) {
479 let block2 = arabicBlocks[i3];
480 if (code >= block2[0] && code <= block2[1]) {
486 exports2.isArabic = isArabic;
487 function isMath(char) {
488 if (char.length > 2) {
489 throw new Error("isMath works on only one-character strings");
491 let code = char.charCodeAt(0);
492 return code >= 1632 && code <= 1644 || code >= 1776 && code <= 1785;
494 exports2.isMath = isMath;
498 // node_modules/alif-toolkit/lib/unicode-arabic.js
499 var require_unicode_arabic = __commonJS({
500 "node_modules/alif-toolkit/lib/unicode-arabic.js"(exports2) {
502 Object.defineProperty(exports2, "__esModule", { value: true });
503 var arabicReference = {
513 "isolated": "\uFE81",
521 "isolated": "\uFE83",
529 "isolated": "\uFE87",
534 "isolated": "\uFB50",
537 "wavy_hamza_above": [
540 "wavy_hamza_below": [
551 "indic_three_above": [
561 "isolated": "\uFE8D",
571 "three_dots_horizontally_below": [
574 "dot_below_three_dots_above": [
577 "three_dots_pointing_upwards_below": [
580 "three_dots_pointing_upwards_below_two_dots_above": [
583 "two_dots_below_dot_above": [
586 "inverted_small_v_below": [
598 "small_meem_above": [
601 "isolated": "\uFE8F",
610 "isolated": "\uFE93",
620 "three_dots_above_downwards": [
626 "isolated": "\uFE95",
635 "isolated": "\uFE99",
647 "isolated": "\uFE9D",
659 "two_dots_vertical_above": [
662 "three_dots_above": [
668 "three_dots_pointing_upwards_below": [
674 "small_tah_two_dots": [
680 "indic_four_below": [
683 "isolated": "\uFEA1",
692 "isolated": "\uFEA5",
707 "dot_below_small_tah": [
710 "three_dots_above_downwards": [
719 "two_dots_vertically_below_small_tah": [
722 "inverted_small_v_below": [
725 "three_dots_below": [
728 "isolated": "\uFEA9",
735 "isolated": "\uFEAB",
754 "dot_below_dot_above": [
769 "two_dots_vertically_above": [
775 "small_tah_two_dots": [
781 "small_noon_above": [
784 "isolated": "\uFEAD",
791 "inverted_v_above": [
794 "isolated": "\uFEAF",
801 "dot_below_dot_above": [
804 "three_dots_below": [
807 "three_dots_below_three_dots_above": [
813 "two_dots_vertically_above": [
816 "small_tah_two_dots": [
819 "indic_four_above": [
825 "isolated": "\uFEB1",
837 "isolated": "\uFEB5",
849 "three_dots_above": [
852 "three_dots_below": [
855 "isolated": "\uFEB9",
867 "isolated": "\uFEBD",
876 "three_dots_above": [
882 "isolated": "\uFEC1",
891 "isolated": "\uFEC5",
900 "three_dots_above": [
906 "three_dots_pointing_downwards_above": [
909 "two_dots_vertically_above": [
912 "three_dots_below": [
915 "isolated": "\uFEC9",
927 "isolated": "\uFECD",
945 "three_dots_below": [
951 "three_dots_pointing_upwards_below": [
954 "dot_below_three_dots_above": [
957 "isolated": "\uFED1",
972 "three_dots_above": [
978 "isolated": "\uFED5",
996 "three_dots_below": [
1005 "isolated": "\uFED9",
1007 "initial": "\uFEDB",
1020 "three_dots_above": [
1023 "three_dots_below": [
1032 "isolated": "\uFEDD",
1034 "initial": "\uFEDF",
1047 "three_dots_above": [
1050 "isolated": "\uFEE1",
1052 "initial": "\uFEE3",
1065 "three_dots_above": [
1077 "isolated": "\uFEE5",
1079 "initial": "\uFEE7",
1086 "isolated": "\uFEE9",
1088 "initial": "\uFEEB",
1100 "isolated": "\uFE85",
1116 "indic_two_above": [
1119 "indic_three_above": [
1125 "isolated": "\uFEED",
1136 "initial": "\uFBE8",
1138 "isolated": "\uFEEF",
1150 "isolated": "\uFE89",
1152 "initial": "\uFE8B",
1155 "two_dots_below_hamza_above": [
1168 "three_dots_below": [
1171 "two_dots_below_dot_above": [
1174 "two_dots_below_small_noon_above": [
1177 "isolated": "\uFEF1",
1179 "initial": "\uFEF3",
1186 "isolated": "\uFB66",
1188 "initial": "\uFB68",
1195 "isolated": "\uFB5E",
1197 "initial": "\uFB60",
1204 "isolated": "\uFB52",
1206 "initial": "\uFB54",
1213 "small_meem_above": [
1216 "isolated": "\uFB56",
1218 "initial": "\uFB58",
1225 "isolated": "\uFB62",
1227 "initial": "\uFB64",
1234 "isolated": "\uFB5A",
1236 "initial": "\uFB5C",
1243 "isolated": "\uFB76",
1245 "initial": "\uFB78",
1252 "isolated": "\uFB72",
1254 "initial": "\uFB74",
1264 "isolated": "\uFB7A",
1266 "initial": "\uFB7C",
1273 "isolated": "\uFB7E",
1275 "initial": "\uFB80",
1282 "isolated": "\uFB88",
1289 "isolated": "\uFB84",
1296 "isolated": "\uFB82",
1304 "isolated": "\uFB86",
1311 "isolated": "\uFB8C",
1318 "isolated": "\uFB8A",
1325 "isolated": "\uFB6A",
1327 "initial": "\uFB6C",
1334 "isolated": "\uFB6E",
1336 "initial": "\uFB70",
1346 "three_dots_above": [
1349 "three_dots_pointing_upwards_below": [
1352 "isolated": "\uFB8E",
1354 "initial": "\uFB90",
1361 "isolated": "\uFBD3",
1363 "initial": "\uFBD5",
1376 "three_dots_above": [
1379 "inverted_stroke": [
1382 "isolated": "\uFB92",
1384 "initial": "\uFB94",
1391 "isolated": "\uFB9A",
1393 "initial": "\uFB9C",
1400 "isolated": "\uFB96",
1402 "initial": "\uFB98",
1409 "isolated": "\uFB9E",
1416 "isolated": "\uFBA0",
1418 "initial": "\uFBA2",
1421 "heh doachashmee": {
1425 "isolated": "\uFBAA",
1427 "initial": "\uFBAC",
1438 "isolated": "\uFBA6",
1440 "initial": "\uFBA8",
1443 "teh marbuta goal": {
1452 "isolated": "\uFBE0",
1459 "isolated": "\uFBD9",
1471 "isolated": "\uFBDD"
1473 "isolated": "\uFBD7",
1480 "isolated": "\uFBDB",
1487 "isolated": "\uFBE2",
1494 "isolated": "\uFBDE",
1501 "indic_two_above": [
1504 "indic_three_above": [
1507 "indic_four_above": [
1510 "isolated": "\uFBFC",
1512 "initial": "\uFBFE",
1519 "isolated": "\uFBE4",
1521 "initial": "\uFBE6",
1533 "isolated": "\uFBB0",
1536 "indic_two_above": [
1539 "indic_three_above": [
1542 "isolated": "\uFBAE",
1549 "isolated": "\u06D5",
1556 "isolated": "\uFBA4",
1591 exports2.default = arabicReference;
1595 // node_modules/alif-toolkit/lib/unicode-ligatures.js
1596 var require_unicode_ligatures = __commonJS({
1597 "node_modules/alif-toolkit/lib/unicode-ligatures.js"(exports2) {
1599 Object.defineProperty(exports2, "__esModule", { value: true });
1600 var ligatureReference = {
1602 "isolated": "\uFBEA",
1606 "isolated": "\uFBEC",
1610 "isolated": "\uFBEE",
1614 "isolated": "\uFBF0",
1618 "isolated": "\uFBF2",
1622 "isolated": "\uFBF4",
1626 "isolated": "\uFBF6",
1632 "isolated": "\uFBF9",
1636 "isolated": "\uFC03",
1640 "isolated": "\uFC00",
1644 "isolated": "\uFC01",
1648 "isolated": "\uFC02",
1650 "initial": "\uFC9A",
1654 "isolated": "\uFC04",
1658 "isolated": "\uFC05",
1662 "isolated": "\uFC06",
1666 "isolated": "\uFC07",
1670 "isolated": "\uFC08",
1672 "initial": "\uFC9F",
1676 "isolated": "\uFC09",
1680 "isolated": "\uFC0A",
1684 "isolated": "\uFC0B",
1688 "isolated": "\uFC0C",
1692 "isolated": "\uFC0D",
1696 "isolated": "\uFC0E",
1698 "initial": "\uFCA4",
1702 "isolated": "\uFC0F",
1706 "isolated": "\uFC10",
1710 "isolated": "\uFC11"
1713 "isolated": "\uFC12",
1715 "initial": "\uFCA6",
1719 "isolated": "\uFC13",
1723 "isolated": "\uFC14"
1726 "isolated": "\uFC15",
1730 "isolated": "\uFC16",
1734 "isolated": "\uFC17",
1738 "isolated": "\uFC18",
1742 "isolated": "\uFC19",
1746 "isolated": "\uFC1A"
1749 "isolated": "\uFC1B",
1753 "isolated": "\uFC1C",
1754 "initial": "\uFCAD",
1758 "isolated": "\uFC1D",
1759 "initial": "\uFCAE",
1763 "isolated": "\uFC1E",
1764 "initial": "\uFCAF",
1768 "isolated": "\uFC1F",
1769 "initial": "\uFCB0",
1773 "isolated": "\uFC20",
1777 "isolated": "\uFC21",
1781 "isolated": "\uFC22",
1785 "isolated": "\uFC23",
1789 "isolated": "\uFC24",
1793 "isolated": "\uFC25",
1797 "isolated": "\uFC26",
1801 "isolated": "\uFC27",
1802 "initial": "\uFD33",
1806 "isolated": "\uFC28",
1807 "initial": "\uFCB9",
1811 "isolated": "\uFC29",
1815 "isolated": "\uFC2A",
1819 "isolated": "\uFC2B",
1823 "isolated": "\uFC2C",
1827 "isolated": "\uFC2D",
1831 "isolated": "\uFC2E",
1835 "isolated": "\uFC2F",
1839 "isolated": "\uFC30",
1843 "isolated": "\uFC31",
1847 "isolated": "\uFC32",
1851 "isolated": "\uFC33",
1855 "isolated": "\uFC34",
1859 "isolated": "\uFC35",
1863 "isolated": "\uFC36",
1867 "isolated": "\uFC37",
1871 "isolated": "\uFC38",
1875 "isolated": "\uFC39",
1879 "isolated": "\uFC3A",
1883 "isolated": "\uFC3B",
1885 "initial": "\uFCC7",
1889 "isolated": "\uFC3C",
1891 "initial": "\uFCC8",
1895 "isolated": "\uFC3D",
1899 "isolated": "\uFC3E",
1903 "isolated": "\uFC3F",
1907 "isolated": "\uFC40",
1911 "isolated": "\uFC41",
1915 "isolated": "\uFC42",
1917 "initial": "\uFCCC",
1921 "isolated": "\uFC43",
1925 "isolated": "\uFC44",
1929 "isolated": "\uFC45",
1933 "isolated": "\uFC46",
1937 "isolated": "\uFC47",
1941 "isolated": "\uFC48",
1946 "isolated": "\uFC49"
1949 "isolated": "\uFC4A"
1952 "isolated": "\uFC4B",
1956 "isolated": "\uFC4C",
1960 "isolated": "\uFC4D",
1964 "isolated": "\uFC4E",
1966 "initial": "\uFCD5",
1970 "isolated": "\uFC4F",
1974 "isolated": "\uFC50",
1978 "isolated": "\uFC51",
1982 "isolated": "\uFC52",
1986 "isolated": "\uFC53"
1989 "isolated": "\uFC54"
1992 "isolated": "\uFC55",
1996 "isolated": "\uFC56",
2000 "isolated": "\uFC57",
2004 "isolated": "\uFC58",
2006 "initial": "\uFCDD",
2010 "isolated": "\uFC59",
2014 "isolated": "\uFC5A",
2018 "isolated": "\uFC5B"
2021 "isolated": "\uFC5C"
2024 "isolated": "\uFC5D",
2028 "isolated": "\uFC5E"
2031 "isolated": "\uFC5F"
2034 "isolated": "\uFC60"
2037 "isolated": "\uFC61"
2040 "isolated": "\uFC62"
2043 "isolated": "\uFC63"
2109 "initial": "\uFC9B",
2113 "initial": "\uFCA0",
2117 "initial": "\uFCA5",
2127 "initial": "\uFCD6",
2134 "initial": "\uFCDE",
2146 "isolated": "\uFD0C",
2154 "\u0640\u064E\u0651": {
2157 "\u0640\u064F\u0651": {
2160 "\u0640\u0650\u0651": {
2164 "isolated": "\uFCF5",
2168 "isolated": "\uFCF6",
2172 "isolated": "\uFCF7",
2176 "isolated": "\uFCF8",
2180 "isolated": "\uFCF9",
2184 "isolated": "\uFCFA",
2188 "isolated": "\uFCFB"
2191 "isolated": "\uFCFC",
2195 "isolated": "\uFCFD",
2199 "isolated": "\uFCFE",
2203 "isolated": "\uFCFF",
2207 "isolated": "\uFD00",
2211 "isolated": "\uFD01",
2215 "isolated": "\uFD02",
2219 "isolated": "\uFD03",
2223 "isolated": "\uFD04",
2227 "isolated": "\uFD05",
2231 "isolated": "\uFD06",
2235 "isolated": "\uFD07",
2239 "isolated": "\uFD08",
2243 "isolated": "\uFD09",
2245 "initial": "\uFD2D",
2249 "isolated": "\uFD0A",
2251 "initial": "\uFD2E",
2255 "isolated": "\uFD0B",
2257 "initial": "\uFD2F",
2261 "isolated": "\uFD0D",
2265 "isolated": "\uFD0E",
2269 "isolated": "\uFD0F",
2273 "isolated": "\uFD10",
2279 "\u062A\u062C\u0645": {
2282 "\u062A\u062D\u062C": {
2286 "\u062A\u062D\u0645": {
2289 "\u062A\u062E\u0645": {
2292 "\u062A\u0645\u062C": {
2295 "\u062A\u0645\u062D": {
2298 "\u062A\u0645\u062E": {
2301 "\u062C\u0645\u062D": {
2305 "\u062D\u0645\u064A": {
2308 "\u062D\u0645\u0649": {
2311 "\u0633\u062D\u062C": {
2314 "\u0633\u062C\u062D": {
2317 "\u0633\u062C\u0649": {
2320 "\u0633\u0645\u062D": {
2324 "\u0633\u0645\u062C": {
2327 "\u0633\u0645\u0645": {
2331 "\u0635\u062D\u062D": {
2335 "\u0635\u0645\u0645": {
2339 "\u0634\u062D\u0645": {
2343 "\u0634\u062C\u064A": {
2346 "\u0634\u0645\u062E": {
2350 "\u0634\u0645\u0645": {
2354 "\u0636\u062D\u0649": {
2357 "\u0636\u062E\u0645": {
2361 "\u0636\u0645\u062D": {
2364 "\u0637\u0645\u062D": {
2367 "\u0637\u0645\u0645": {
2370 "\u0637\u0645\u064A": {
2373 "\u0639\u062C\u0645": {
2377 "\u0639\u0645\u0645": {
2381 "\u0639\u0645\u0649": {
2384 "\u063A\u0645\u0645": {
2387 "\u063A\u0645\u064A": {
2390 "\u063A\u0645\u0649": {
2393 "\u0641\u062E\u0645": {
2397 "\u0642\u0645\u062D": {
2401 "\u0642\u0645\u0645": {
2404 "\u0644\u062D\u0645": {
2408 "\u0644\u062D\u064A": {
2411 "\u0644\u062D\u0649": {
2414 "\u0644\u062C\u062C": {
2415 "initial": "\uFD83",
2418 "\u0644\u062E\u0645": {
2422 "\u0644\u0645\u062D": {
2426 "\u0645\u062D\u062C": {
2429 "\u0645\u062D\u0645": {
2432 "\u0645\u062D\u064A": {
2435 "\u0645\u062C\u062D": {
2438 "\u0645\u062C\u0645": {
2441 "\u0645\u062E\u062C": {
2444 "\u0645\u062E\u0645": {
2447 "\u0645\u062C\u062E": {
2450 "\u0647\u0645\u062C": {
2453 "\u0647\u0645\u0645": {
2456 "\u0646\u062D\u0645": {
2459 "\u0646\u062D\u0649": {
2462 "\u0646\u062C\u0645": {
2466 "\u0646\u062C\u0649": {
2469 "\u0646\u0645\u064A": {
2472 "\u0646\u0645\u0649": {
2475 "\u064A\u0645\u0645": {
2479 "\u0628\u062E\u064A": {
2482 "\u062A\u062C\u064A": {
2485 "\u062A\u062C\u0649": {
2488 "\u062A\u062E\u064A": {
2491 "\u062A\u062E\u0649": {
2494 "\u062A\u0645\u064A": {
2497 "\u062A\u0645\u0649": {
2500 "\u062C\u0645\u064A": {
2503 "\u062C\u062D\u0649": {
2506 "\u062C\u0645\u0649": {
2509 "\u0633\u062E\u0649": {
2512 "\u0635\u062D\u064A": {
2515 "\u0634\u062D\u064A": {
2518 "\u0636\u062D\u064A": {
2521 "\u0644\u062C\u064A": {
2524 "\u0644\u0645\u064A": {
2527 "\u064A\u062D\u064A": {
2530 "\u064A\u062C\u064A": {
2533 "\u064A\u0645\u064A": {
2536 "\u0645\u0645\u064A": {
2539 "\u0642\u0645\u064A": {
2542 "\u0646\u062D\u064A": {
2545 "\u0639\u0645\u064A": {
2548 "\u0643\u0645\u064A": {
2551 "\u0646\u062C\u062D": {
2552 "initial": "\uFDB8",
2555 "\u0645\u062E\u064A": {
2558 "\u0644\u062C\u0645": {
2559 "initial": "\uFDBA",
2562 "\u0643\u0645\u0645": {
2566 "\u062C\u062D\u064A": {
2569 "\u062D\u062C\u064A": {
2572 "\u0645\u062C\u064A": {
2575 "\u0641\u0645\u064A": {
2578 "\u0628\u062D\u064A": {
2581 "\u0633\u062E\u064A": {
2584 "\u0646\u062C\u064A": {
2588 "isolated": "\uFEF5",
2592 "isolated": "\uFEF7",
2596 "isolated": "\uFEF9",
2600 "isolated": "\uFEFB",
2604 "\u0635\u0644\u06D2": "\uFDF0",
2605 "\u0642\u0644\u06D2": "\uFDF1",
2606 "\u0627\u0644\u0644\u0647": "\uFDF2",
2607 "\u0627\u0643\u0628\u0631": "\uFDF3",
2608 "\u0645\u062D\u0645\u062F": "\uFDF4",
2609 "\u0635\u0644\u0639\u0645": "\uFDF5",
2610 "\u0631\u0633\u0648\u0644": "\uFDF6",
2611 "\u0639\u0644\u064A\u0647": "\uFDF7",
2612 "\u0648\u0633\u0644\u0645": "\uFDF8",
2613 "\u0635\u0644\u0649": "\uFDF9",
2614 "\u0635\u0644\u0649\u0627\u0644\u0644\u0647\u0639\u0644\u064A\u0647\u0648\u0633\u0644\u0645": "\uFDFA",
2615 "\u062C\u0644\u062C\u0644\u0627\u0644\u0647": "\uFDFB",
2616 "\u0631\u06CC\u0627\u0644": "\uFDFC"
2619 exports2.default = ligatureReference;
2623 // node_modules/alif-toolkit/lib/reference.js
2624 var require_reference = __commonJS({
2625 "node_modules/alif-toolkit/lib/reference.js"(exports2) {
2627 Object.defineProperty(exports2, "__esModule", { value: true });
2628 var unicode_arabic_1 = require_unicode_arabic();
2629 var unicode_ligatures_1 = require_unicode_ligatures();
2630 var letterList = Object.keys(unicode_arabic_1.default);
2631 exports2.letterList = letterList;
2632 var ligatureList = Object.keys(unicode_ligatures_1.default);
2633 exports2.ligatureList = ligatureList;
2634 var ligatureWordList = Object.keys(unicode_ligatures_1.default.words);
2635 exports2.ligatureWordList = ligatureWordList;
2636 var lams = "\u0644\u06B5\u06B6\u06B7\u06B8";
2637 exports2.lams = lams;
2638 var alefs = "\u0627\u0622\u0623\u0625\u0671\u0672\u0673\u0675\u0773\u0774";
2639 exports2.alefs = alefs;
2640 var tashkeel = "\u0605\u0640\u0670\u0674\u06DF\u06E7\u06E8";
2641 exports2.tashkeel = tashkeel;
2642 function addToTashkeel(start2, finish) {
2643 for (var i3 = start2; i3 <= finish; i3++) {
2644 exports2.tashkeel = tashkeel += String.fromCharCode(i3);
2647 addToTashkeel(1552, 1562);
2648 addToTashkeel(1611, 1631);
2649 addToTashkeel(1750, 1756);
2650 addToTashkeel(1760, 1764);
2651 addToTashkeel(1770, 1773);
2652 addToTashkeel(2259, 2273);
2653 addToTashkeel(2275, 2303);
2654 addToTashkeel(65136, 65151);
2655 var lineBreakers = "\u0627\u0629\u0648\u06C0\u06CF\u06FD\u06FE\u076B\u076C\u0771\u0773\u0774\u0778\u0779\u08E2\u08B1\u08B2\u08B9";
2656 exports2.lineBreakers = lineBreakers;
2657 function addToLineBreakers(start2, finish) {
2658 for (var i3 = start2; i3 <= finish; i3++) {
2659 exports2.lineBreakers = lineBreakers += String.fromCharCode(i3);
2662 addToLineBreakers(1536, 1567);
2663 addToLineBreakers(1569, 1573);
2664 addToLineBreakers(1583, 1586);
2665 addToLineBreakers(1632, 1645);
2666 addToLineBreakers(1649, 1655);
2667 addToLineBreakers(1672, 1689);
2668 addToLineBreakers(1731, 1739);
2669 addToLineBreakers(1746, 1785);
2670 addToLineBreakers(1881, 1883);
2671 addToLineBreakers(2218, 2222);
2672 addToLineBreakers(64336, 65021);
2673 addToLineBreakers(65152, 65276);
2674 addToLineBreakers(69216, 69247);
2675 addToLineBreakers(126064, 126143);
2676 addToLineBreakers(126464, 126719);
2680 // node_modules/alif-toolkit/lib/GlyphSplitter.js
2681 var require_GlyphSplitter = __commonJS({
2682 "node_modules/alif-toolkit/lib/GlyphSplitter.js"(exports2) {
2684 Object.defineProperty(exports2, "__esModule", { value: true });
2685 var isArabic_1 = require_isArabic();
2686 var reference_1 = require_reference();
2687 function GlyphSplitter(word) {
2689 let lastLetter = "";
2690 word.split("").forEach((letter) => {
2691 if (isArabic_1.isArabic(letter)) {
2692 if (reference_1.tashkeel.indexOf(letter) > -1) {
2693 letters[letters.length - 1] += letter;
2694 } else if (lastLetter.length && (reference_1.lams.indexOf(lastLetter) === 0 && reference_1.alefs.indexOf(letter) > -1 || reference_1.lams.indexOf(lastLetter) > 0 && reference_1.alefs.indexOf(letter) === 0)) {
2695 letters[letters.length - 1] += letter;
2697 letters.push(letter);
2700 letters.push(letter);
2702 if (reference_1.tashkeel.indexOf(letter) === -1) {
2703 lastLetter = letter;
2708 exports2.GlyphSplitter = GlyphSplitter;
2712 // node_modules/alif-toolkit/lib/BaselineSplitter.js
2713 var require_BaselineSplitter = __commonJS({
2714 "node_modules/alif-toolkit/lib/BaselineSplitter.js"(exports2) {
2716 Object.defineProperty(exports2, "__esModule", { value: true });
2717 var isArabic_1 = require_isArabic();
2718 var reference_1 = require_reference();
2719 function BaselineSplitter(word) {
2721 let lastLetter = "";
2722 word.split("").forEach((letter) => {
2723 if (isArabic_1.isArabic(letter) && isArabic_1.isArabic(lastLetter)) {
2724 if (lastLetter.length && reference_1.tashkeel.indexOf(letter) > -1) {
2725 letters[letters.length - 1] += letter;
2726 } else if (reference_1.lineBreakers.indexOf(lastLetter) > -1) {
2727 letters.push(letter);
2729 letters[letters.length - 1] += letter;
2732 letters.push(letter);
2734 if (reference_1.tashkeel.indexOf(letter) === -1) {
2735 lastLetter = letter;
2740 exports2.BaselineSplitter = BaselineSplitter;
2744 // node_modules/alif-toolkit/lib/Normalization.js
2745 var require_Normalization = __commonJS({
2746 "node_modules/alif-toolkit/lib/Normalization.js"(exports2) {
2748 Object.defineProperty(exports2, "__esModule", { value: true });
2749 var unicode_arabic_1 = require_unicode_arabic();
2750 var unicode_ligatures_1 = require_unicode_ligatures();
2751 var isArabic_1 = require_isArabic();
2752 var reference_1 = require_reference();
2753 function Normal(word, breakPresentationForm) {
2754 if (typeof breakPresentationForm === "undefined") {
2755 breakPresentationForm = true;
2757 let returnable = "";
2758 word.split("").forEach((letter) => {
2759 if (!isArabic_1.isArabic(letter)) {
2760 returnable += letter;
2763 for (let w2 = 0; w2 < reference_1.letterList.length; w2++) {
2764 let letterForms = unicode_arabic_1.default[reference_1.letterList[w2]];
2765 let versions = Object.keys(letterForms);
2766 for (let v2 = 0; v2 < versions.length; v2++) {
2767 let localVersion = letterForms[versions[v2]];
2768 if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
2769 let embeddedForms = Object.keys(localVersion);
2770 for (let ef = 0; ef < embeddedForms.length; ef++) {
2771 let form = localVersion[embeddedForms[ef]];
2772 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
2773 if (form === letter) {
2774 if (breakPresentationForm && localVersion["normal"] && ["isolated", "initial", "medial", "final"].indexOf(embeddedForms[ef]) > -1) {
2775 if (typeof localVersion["normal"] === "object") {
2776 returnable += localVersion["normal"][0];
2778 returnable += localVersion["normal"];
2782 returnable += letter;
2784 } else if (typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
2785 returnable += form[0];
2790 } else if (localVersion === letter) {
2791 if (breakPresentationForm && letterForms["normal"] && ["isolated", "initial", "medial", "final"].indexOf(versions[v2]) > -1) {
2792 if (typeof letterForms["normal"] === "object") {
2793 returnable += letterForms["normal"][0];
2795 returnable += letterForms["normal"];
2799 returnable += letter;
2801 } else if (typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
2802 returnable += localVersion[0];
2807 for (let v2 = 0; v2 < reference_1.ligatureList.length; v2++) {
2808 let normalForm = reference_1.ligatureList[v2];
2809 if (normalForm !== "words") {
2810 let ligForms = Object.keys(unicode_ligatures_1.default[normalForm]);
2811 for (let f3 = 0; f3 < ligForms.length; f3++) {
2812 if (unicode_ligatures_1.default[normalForm][ligForms[f3]] === letter) {
2813 returnable += normalForm;
2819 for (let v3 = 0; v3 < reference_1.ligatureWordList.length; v3++) {
2820 let normalForm = reference_1.ligatureWordList[v3];
2821 if (unicode_ligatures_1.default.words[normalForm] === letter) {
2822 returnable += normalForm;
2826 returnable += letter;
2830 exports2.Normal = Normal;
2834 // node_modules/alif-toolkit/lib/CharShaper.js
2835 var require_CharShaper = __commonJS({
2836 "node_modules/alif-toolkit/lib/CharShaper.js"(exports2) {
2838 Object.defineProperty(exports2, "__esModule", { value: true });
2839 var unicode_arabic_1 = require_unicode_arabic();
2840 var isArabic_1 = require_isArabic();
2841 var reference_1 = require_reference();
2842 function CharShaper(letter, form) {
2843 if (!isArabic_1.isArabic(letter)) {
2844 throw new Error("Not Arabic");
2846 if (letter === "\u0621") {
2849 for (let w2 = 0; w2 < reference_1.letterList.length; w2++) {
2850 let letterForms = unicode_arabic_1.default[reference_1.letterList[w2]];
2851 let versions = Object.keys(letterForms);
2852 for (let v2 = 0; v2 < versions.length; v2++) {
2853 let localVersion = letterForms[versions[v2]];
2854 if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
2855 if (versions.indexOf(form) > -1) {
2856 return letterForms[form];
2858 } else if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
2859 let embeddedVersions = Object.keys(localVersion);
2860 for (let ev = 0; ev < embeddedVersions.length; ev++) {
2861 if (localVersion[embeddedVersions[ev]] === letter || typeof localVersion[embeddedVersions[ev]] === "object" && localVersion[embeddedVersions[ev]].indexOf && localVersion[embeddedVersions[ev]].indexOf(letter) > -1) {
2862 if (embeddedVersions.indexOf(form) > -1) {
2863 return localVersion[form];
2871 exports2.CharShaper = CharShaper;
2875 // node_modules/alif-toolkit/lib/WordShaper.js
2876 var require_WordShaper = __commonJS({
2877 "node_modules/alif-toolkit/lib/WordShaper.js"(exports2) {
2879 Object.defineProperty(exports2, "__esModule", { value: true });
2880 var isArabic_1 = require_isArabic();
2881 var reference_1 = require_reference();
2882 var CharShaper_1 = require_CharShaper();
2883 var unicode_ligatures_1 = require_unicode_ligatures();
2884 function WordShaper2(word) {
2885 let state = "initial";
2887 for (let w2 = 0; w2 < word.length; w2++) {
2888 let nextLetter = " ";
2889 for (let nxw = w2 + 1; nxw < word.length; nxw++) {
2890 if (!isArabic_1.isArabic(word[nxw])) {
2893 if (reference_1.tashkeel.indexOf(word[nxw]) === -1) {
2894 nextLetter = word[nxw];
2898 if (!isArabic_1.isArabic(word[w2]) || isArabic_1.isMath(word[w2])) {
2901 } else if (reference_1.tashkeel.indexOf(word[w2]) > -1) {
2903 } else if (nextLetter === " " || reference_1.lineBreakers.indexOf(word[w2]) > -1) {
2904 output += CharShaper_1.CharShaper(word[w2], state === "initial" ? "isolated" : "final");
2906 } else if (reference_1.lams.indexOf(word[w2]) > -1 && reference_1.alefs.indexOf(nextLetter) > -1) {
2907 output += unicode_ligatures_1.default[word[w2] + nextLetter][state === "initial" ? "isolated" : "final"];
2908 while (word[w2] !== nextLetter) {
2913 output += CharShaper_1.CharShaper(word[w2], state);
2919 exports2.WordShaper = WordShaper2;
2923 // node_modules/alif-toolkit/lib/ParentLetter.js
2924 var require_ParentLetter = __commonJS({
2925 "node_modules/alif-toolkit/lib/ParentLetter.js"(exports2) {
2927 Object.defineProperty(exports2, "__esModule", { value: true });
2928 var unicode_arabic_1 = require_unicode_arabic();
2929 var isArabic_1 = require_isArabic();
2930 var reference_1 = require_reference();
2931 function ParentLetter(letter) {
2932 if (!isArabic_1.isArabic(letter)) {
2933 throw new Error("Not an Arabic letter");
2935 for (let w2 = 0; w2 < reference_1.letterList.length; w2++) {
2936 let letterForms = unicode_arabic_1.default[reference_1.letterList[w2]];
2937 let versions = Object.keys(letterForms);
2938 for (let v2 = 0; v2 < versions.length; v2++) {
2939 let localVersion = letterForms[versions[v2]];
2940 if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
2941 let embeddedForms = Object.keys(localVersion);
2942 for (let ef = 0; ef < embeddedForms.length; ef++) {
2943 let form = localVersion[embeddedForms[ef]];
2944 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
2945 return localVersion;
2948 } else if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
2955 exports2.ParentLetter = ParentLetter;
2956 function GrandparentLetter(letter) {
2957 if (!isArabic_1.isArabic(letter)) {
2958 throw new Error("Not an Arabic letter");
2960 for (let w2 = 0; w2 < reference_1.letterList.length; w2++) {
2961 let letterForms = unicode_arabic_1.default[reference_1.letterList[w2]];
2962 let versions = Object.keys(letterForms);
2963 for (let v2 = 0; v2 < versions.length; v2++) {
2964 let localVersion = letterForms[versions[v2]];
2965 if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
2966 let embeddedForms = Object.keys(localVersion);
2967 for (let ef = 0; ef < embeddedForms.length; ef++) {
2968 let form = localVersion[embeddedForms[ef]];
2969 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
2973 } else if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
2980 exports2.GrandparentLetter = GrandparentLetter;
2984 // node_modules/alif-toolkit/lib/index.js
2985 var require_lib = __commonJS({
2986 "node_modules/alif-toolkit/lib/index.js"(exports2) {
2988 Object.defineProperty(exports2, "__esModule", { value: true });
2989 var isArabic_1 = require_isArabic();
2990 exports2.isArabic = isArabic_1.isArabic;
2991 var GlyphSplitter_1 = require_GlyphSplitter();
2992 exports2.GlyphSplitter = GlyphSplitter_1.GlyphSplitter;
2993 var BaselineSplitter_1 = require_BaselineSplitter();
2994 exports2.BaselineSplitter = BaselineSplitter_1.BaselineSplitter;
2995 var Normalization_1 = require_Normalization();
2996 exports2.Normal = Normalization_1.Normal;
2997 var CharShaper_1 = require_CharShaper();
2998 exports2.CharShaper = CharShaper_1.CharShaper;
2999 var WordShaper_1 = require_WordShaper();
3000 exports2.WordShaper = WordShaper_1.WordShaper;
3001 var ParentLetter_1 = require_ParentLetter();
3002 exports2.ParentLetter = ParentLetter_1.ParentLetter;
3003 exports2.GrandparentLetter = ParentLetter_1.GrandparentLetter;
3007 // node_modules/vparse/index.js
3008 var require_vparse = __commonJS({
3009 "node_modules/vparse/index.js"(exports2, module2) {
3010 (function(window2) {
3012 function parseVersion3(v2) {
3013 var m2 = v2.replace(/[^0-9.]/g, "").match(/[0-9]*\.|[0-9]+/g) || [];
3020 v2.isEmpty = !v2.major && !v2.minor && !v2.patch && !v2.build;
3021 v2.parsed = [v2.major, v2.minor, v2.patch, v2.build];
3022 v2.text = v2.parsed.join(".");
3023 v2.compare = compare;
3026 function compare(v2) {
3027 if (typeof v2 === "string") {
3028 v2 = parseVersion3(v2);
3030 for (var i3 = 0; i3 < 4; i3++) {
3031 if (this.parsed[i3] !== v2.parsed[i3]) {
3032 return this.parsed[i3] > v2.parsed[i3] ? 1 : -1;
3037 if (typeof module2 === "object" && module2 && typeof module2.exports === "object") {
3038 module2.exports = parseVersion3;
3040 window2.parseVersion = parseVersion3;
3046 // node_modules/which-polygon/node_modules/quickselect/quickselect.js
3047 var require_quickselect = __commonJS({
3048 "node_modules/which-polygon/node_modules/quickselect/quickselect.js"(exports2, module2) {
3049 (function(global2, factory) {
3050 typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.quickselect = factory();
3051 })(exports2, function() {
3053 function quickselect2(arr, k2, left, right, compare) {
3054 quickselectStep(arr, k2, left || 0, right || arr.length - 1, compare || defaultCompare);
3056 function quickselectStep(arr, k2, left, right, compare) {
3057 while (right > left) {
3058 if (right - left > 600) {
3059 var n3 = right - left + 1;
3060 var m2 = k2 - left + 1;
3061 var z2 = Math.log(n3);
3062 var s2 = 0.5 * Math.exp(2 * z2 / 3);
3063 var sd = 0.5 * Math.sqrt(z2 * s2 * (n3 - s2) / n3) * (m2 - n3 / 2 < 0 ? -1 : 1);
3064 var newLeft = Math.max(left, Math.floor(k2 - m2 * s2 / n3 + sd));
3065 var newRight = Math.min(right, Math.floor(k2 + (n3 - m2) * s2 / n3 + sd));
3066 quickselectStep(arr, k2, newLeft, newRight, compare);
3071 swap2(arr, left, k2);
3072 if (compare(arr[right], t2) > 0)
3073 swap2(arr, left, right);
3078 while (compare(arr[i3], t2) < 0)
3080 while (compare(arr[j3], t2) > 0)
3083 if (compare(arr[left], t2) === 0)
3084 swap2(arr, left, j3);
3087 swap2(arr, j3, right);
3095 function swap2(arr, i3, j3) {
3100 function defaultCompare(a2, b2) {
3101 return a2 < b2 ? -1 : a2 > b2 ? 1 : 0;
3103 return quickselect2;
3108 // node_modules/which-polygon/node_modules/rbush/index.js
3109 var require_rbush = __commonJS({
3110 "node_modules/which-polygon/node_modules/rbush/index.js"(exports2, module2) {
3112 module2.exports = rbush;
3113 module2.exports.default = rbush;
3114 var quickselect2 = require_quickselect();
3115 function rbush(maxEntries, format2) {
3116 if (!(this instanceof rbush))
3117 return new rbush(maxEntries, format2);
3118 this._maxEntries = Math.max(4, maxEntries || 9);
3119 this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
3121 this._initFormat(format2);
3127 return this._all(this.data, []);
3129 search: function(bbox2) {
3130 var node = this.data, result = [], toBBox = this.toBBox;
3131 if (!intersects(bbox2, node))
3133 var nodesToSearch = [], i3, len, child, childBBox;
3135 for (i3 = 0, len = node.children.length; i3 < len; i3++) {
3136 child = node.children[i3];
3137 childBBox = node.leaf ? toBBox(child) : child;
3138 if (intersects(bbox2, childBBox)) {
3141 else if (contains(bbox2, childBBox))
3142 this._all(child, result);
3144 nodesToSearch.push(child);
3147 node = nodesToSearch.pop();
3151 collides: function(bbox2) {
3152 var node = this.data, toBBox = this.toBBox;
3153 if (!intersects(bbox2, node))
3155 var nodesToSearch = [], i3, len, child, childBBox;
3157 for (i3 = 0, len = node.children.length; i3 < len; i3++) {
3158 child = node.children[i3];
3159 childBBox = node.leaf ? toBBox(child) : child;
3160 if (intersects(bbox2, childBBox)) {
3161 if (node.leaf || contains(bbox2, childBBox))
3163 nodesToSearch.push(child);
3166 node = nodesToSearch.pop();
3170 load: function(data) {
3171 if (!(data && data.length))
3173 if (data.length < this._minEntries) {
3174 for (var i3 = 0, len = data.length; i3 < len; i3++) {
3175 this.insert(data[i3]);
3179 var node = this._build(data.slice(), 0, data.length - 1, 0);
3180 if (!this.data.children.length) {
3182 } else if (this.data.height === node.height) {
3183 this._splitRoot(this.data, node);
3185 if (this.data.height < node.height) {
3186 var tmpNode = this.data;
3190 this._insert(node, this.data.height - node.height - 1, true);
3194 insert: function(item) {
3196 this._insert(item, this.data.height - 1);
3200 this.data = createNode([]);
3203 remove: function(item, equalsFn) {
3206 var node = this.data, bbox2 = this.toBBox(item), path = [], indexes = [], i3, parent, index, goingUp;
3207 while (node || path.length) {
3210 parent = path[path.length - 1];
3215 index = findItem(item, node.children, equalsFn);
3217 node.children.splice(index, 1);
3219 this._condense(path);
3223 if (!goingUp && !node.leaf && contains(node, bbox2)) {
3228 node = node.children[0];
3229 } else if (parent) {
3231 node = parent.children[i3];
3238 toBBox: function(item) {
3241 compareMinX: compareNodeMinX,
3242 compareMinY: compareNodeMinY,
3243 toJSON: function() {
3246 fromJSON: function(data) {
3250 _all: function(node, result) {
3251 var nodesToSearch = [];
3254 result.push.apply(result, node.children);
3256 nodesToSearch.push.apply(nodesToSearch, node.children);
3257 node = nodesToSearch.pop();
3261 _build: function(items, left, right, height) {
3262 var N2 = right - left + 1, M2 = this._maxEntries, node;
3264 node = createNode(items.slice(left, right + 1));
3265 calcBBox(node, this.toBBox);
3269 height = Math.ceil(Math.log(N2) / Math.log(M2));
3270 M2 = Math.ceil(N2 / Math.pow(M2, height - 1));
3272 node = createNode([]);
3274 node.height = height;
3275 var N22 = Math.ceil(N2 / M2), N1 = N22 * Math.ceil(Math.sqrt(M2)), i3, j3, right2, right3;
3276 multiSelect(items, left, right, N1, this.compareMinX);
3277 for (i3 = left; i3 <= right; i3 += N1) {
3278 right2 = Math.min(i3 + N1 - 1, right);
3279 multiSelect(items, i3, right2, N22, this.compareMinY);
3280 for (j3 = i3; j3 <= right2; j3 += N22) {
3281 right3 = Math.min(j3 + N22 - 1, right2);
3282 node.children.push(this._build(items, j3, right3, height - 1));
3285 calcBBox(node, this.toBBox);
3288 _chooseSubtree: function(bbox2, node, level, path) {
3289 var i3, len, child, targetNode, area, enlargement, minArea, minEnlargement;
3292 if (node.leaf || path.length - 1 === level)
3294 minArea = minEnlargement = Infinity;
3295 for (i3 = 0, len = node.children.length; i3 < len; i3++) {
3296 child = node.children[i3];
3297 area = bboxArea(child);
3298 enlargement = enlargedArea(bbox2, child) - area;
3299 if (enlargement < minEnlargement) {
3300 minEnlargement = enlargement;
3301 minArea = area < minArea ? area : minArea;
3303 } else if (enlargement === minEnlargement) {
3304 if (area < minArea) {
3310 node = targetNode || node.children[0];
3314 _insert: function(item, level, isNode) {
3315 var toBBox = this.toBBox, bbox2 = isNode ? item : toBBox(item), insertPath = [];
3316 var node = this._chooseSubtree(bbox2, this.data, level, insertPath);
3317 node.children.push(item);
3318 extend2(node, bbox2);
3319 while (level >= 0) {
3320 if (insertPath[level].children.length > this._maxEntries) {
3321 this._split(insertPath, level);
3326 this._adjustParentBBoxes(bbox2, insertPath, level);
3328 // split overflowed node into two
3329 _split: function(insertPath, level) {
3330 var node = insertPath[level], M2 = node.children.length, m2 = this._minEntries;
3331 this._chooseSplitAxis(node, m2, M2);
3332 var splitIndex = this._chooseSplitIndex(node, m2, M2);
3333 var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));
3334 newNode.height = node.height;
3335 newNode.leaf = node.leaf;
3336 calcBBox(node, this.toBBox);
3337 calcBBox(newNode, this.toBBox);
3339 insertPath[level - 1].children.push(newNode);
3341 this._splitRoot(node, newNode);
3343 _splitRoot: function(node, newNode) {
3344 this.data = createNode([node, newNode]);
3345 this.data.height = node.height + 1;
3346 this.data.leaf = false;
3347 calcBBox(this.data, this.toBBox);
3349 _chooseSplitIndex: function(node, m2, M2) {
3350 var i3, bbox1, bbox2, overlap, area, minOverlap, minArea, index;
3351 minOverlap = minArea = Infinity;
3352 for (i3 = m2; i3 <= M2 - m2; i3++) {
3353 bbox1 = distBBox(node, 0, i3, this.toBBox);
3354 bbox2 = distBBox(node, i3, M2, this.toBBox);
3355 overlap = intersectionArea(bbox1, bbox2);
3356 area = bboxArea(bbox1) + bboxArea(bbox2);
3357 if (overlap < minOverlap) {
3358 minOverlap = overlap;
3360 minArea = area < minArea ? area : minArea;
3361 } else if (overlap === minOverlap) {
3362 if (area < minArea) {
3370 // sorts node children by the best axis for split
3371 _chooseSplitAxis: function(node, m2, M2) {
3372 var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX, compareMinY = node.leaf ? this.compareMinY : compareNodeMinY, xMargin = this._allDistMargin(node, m2, M2, compareMinX), yMargin = this._allDistMargin(node, m2, M2, compareMinY);
3373 if (xMargin < yMargin)
3374 node.children.sort(compareMinX);
3376 // total margin of all possible split distributions where each node is at least m full
3377 _allDistMargin: function(node, m2, M2, compare) {
3378 node.children.sort(compare);
3379 var toBBox = this.toBBox, leftBBox = distBBox(node, 0, m2, toBBox), rightBBox = distBBox(node, M2 - m2, M2, toBBox), margin = bboxMargin(leftBBox) + bboxMargin(rightBBox), i3, child;
3380 for (i3 = m2; i3 < M2 - m2; i3++) {
3381 child = node.children[i3];
3382 extend2(leftBBox, node.leaf ? toBBox(child) : child);
3383 margin += bboxMargin(leftBBox);
3385 for (i3 = M2 - m2 - 1; i3 >= m2; i3--) {
3386 child = node.children[i3];
3387 extend2(rightBBox, node.leaf ? toBBox(child) : child);
3388 margin += bboxMargin(rightBBox);
3392 _adjustParentBBoxes: function(bbox2, path, level) {
3393 for (var i3 = level; i3 >= 0; i3--) {
3394 extend2(path[i3], bbox2);
3397 _condense: function(path) {
3398 for (var i3 = path.length - 1, siblings; i3 >= 0; i3--) {
3399 if (path[i3].children.length === 0) {
3401 siblings = path[i3 - 1].children;
3402 siblings.splice(siblings.indexOf(path[i3]), 1);
3406 calcBBox(path[i3], this.toBBox);
3409 _initFormat: function(format2) {
3410 var compareArr = ["return a", " - b", ";"];
3411 this.compareMinX = new Function("a", "b", compareArr.join(format2[0]));
3412 this.compareMinY = new Function("a", "b", compareArr.join(format2[1]));
3413 this.toBBox = new Function(
3415 "return {minX: a" + format2[0] + ", minY: a" + format2[1] + ", maxX: a" + format2[2] + ", maxY: a" + format2[3] + "};"
3419 function findItem(item, items, equalsFn) {
3421 return items.indexOf(item);
3422 for (var i3 = 0; i3 < items.length; i3++) {
3423 if (equalsFn(item, items[i3]))
3428 function calcBBox(node, toBBox) {
3429 distBBox(node, 0, node.children.length, toBBox, node);
3431 function distBBox(node, k2, p2, toBBox, destNode) {
3433 destNode = createNode(null);
3434 destNode.minX = Infinity;
3435 destNode.minY = Infinity;
3436 destNode.maxX = -Infinity;
3437 destNode.maxY = -Infinity;
3438 for (var i3 = k2, child; i3 < p2; i3++) {
3439 child = node.children[i3];
3440 extend2(destNode, node.leaf ? toBBox(child) : child);
3444 function extend2(a2, b2) {
3445 a2.minX = Math.min(a2.minX, b2.minX);
3446 a2.minY = Math.min(a2.minY, b2.minY);
3447 a2.maxX = Math.max(a2.maxX, b2.maxX);
3448 a2.maxY = Math.max(a2.maxY, b2.maxY);
3451 function compareNodeMinX(a2, b2) {
3452 return a2.minX - b2.minX;
3454 function compareNodeMinY(a2, b2) {
3455 return a2.minY - b2.minY;
3457 function bboxArea(a2) {
3458 return (a2.maxX - a2.minX) * (a2.maxY - a2.minY);
3460 function bboxMargin(a2) {
3461 return a2.maxX - a2.minX + (a2.maxY - a2.minY);
3463 function enlargedArea(a2, b2) {
3464 return (Math.max(b2.maxX, a2.maxX) - Math.min(b2.minX, a2.minX)) * (Math.max(b2.maxY, a2.maxY) - Math.min(b2.minY, a2.minY));
3466 function intersectionArea(a2, b2) {
3467 var minX = Math.max(a2.minX, b2.minX), minY = Math.max(a2.minY, b2.minY), maxX = Math.min(a2.maxX, b2.maxX), maxY = Math.min(a2.maxY, b2.maxY);
3468 return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
3470 function contains(a2, b2) {
3471 return a2.minX <= b2.minX && a2.minY <= b2.minY && b2.maxX <= a2.maxX && b2.maxY <= a2.maxY;
3473 function intersects(a2, b2) {
3474 return b2.minX <= a2.maxX && b2.minY <= a2.maxY && b2.maxX >= a2.minX && b2.maxY >= a2.minY;
3476 function createNode(children2) {
3478 children: children2,
3487 function multiSelect(arr, left, right, n3, compare) {
3488 var stack = [left, right], mid;
3489 while (stack.length) {
3490 right = stack.pop();
3492 if (right - left <= n3)
3494 mid = left + Math.ceil((right - left) / n3 / 2) * n3;
3495 quickselect2(arr, mid, left, right, compare);
3496 stack.push(left, mid, mid, right);
3502 // node_modules/lineclip/index.js
3503 var require_lineclip = __commonJS({
3504 "node_modules/lineclip/index.js"(exports2, module2) {
3506 module2.exports = lineclip2;
3507 lineclip2.polyline = lineclip2;
3508 lineclip2.polygon = polygonclip2;
3509 function lineclip2(points, bbox2, result) {
3510 var len = points.length, codeA = bitCode2(points[0], bbox2), part = [], i3, a2, b2, codeB, lastCode;
3513 for (i3 = 1; i3 < len; i3++) {
3514 a2 = points[i3 - 1];
3516 codeB = lastCode = bitCode2(b2, bbox2);
3518 if (!(codeA | codeB)) {
3520 if (codeB !== lastCode) {
3526 } else if (i3 === len - 1) {
3530 } else if (codeA & codeB) {
3533 a2 = intersect2(a2, b2, codeA, bbox2);
3534 codeA = bitCode2(a2, bbox2);
3536 b2 = intersect2(a2, b2, codeB, bbox2);
3537 codeB = bitCode2(b2, bbox2);
3546 function polygonclip2(points, bbox2) {
3547 var result, edge, prev, prevInside, i3, p2, inside;
3548 for (edge = 1; edge <= 8; edge *= 2) {
3550 prev = points[points.length - 1];
3551 prevInside = !(bitCode2(prev, bbox2) & edge);
3552 for (i3 = 0; i3 < points.length; i3++) {
3554 inside = !(bitCode2(p2, bbox2) & edge);
3555 if (inside !== prevInside)
3556 result.push(intersect2(prev, p2, edge, bbox2));
3560 prevInside = inside;
3568 function intersect2(a2, b2, edge, bbox2) {
3569 return edge & 8 ? [a2[0] + (b2[0] - a2[0]) * (bbox2[3] - a2[1]) / (b2[1] - a2[1]), bbox2[3]] : (
3571 edge & 4 ? [a2[0] + (b2[0] - a2[0]) * (bbox2[1] - a2[1]) / (b2[1] - a2[1]), bbox2[1]] : (
3573 edge & 2 ? [bbox2[2], a2[1] + (b2[1] - a2[1]) * (bbox2[2] - a2[0]) / (b2[0] - a2[0])] : (
3575 edge & 1 ? [bbox2[0], a2[1] + (b2[1] - a2[1]) * (bbox2[0] - a2[0]) / (b2[0] - a2[0])] : (
3583 function bitCode2(p2, bbox2) {
3585 if (p2[0] < bbox2[0])
3587 else if (p2[0] > bbox2[2])
3589 if (p2[1] < bbox2[1])
3591 else if (p2[1] > bbox2[3])
3598 // node_modules/which-polygon/index.js
3599 var require_which_polygon = __commonJS({
3600 "node_modules/which-polygon/index.js"(exports2, module2) {
3602 var rbush = require_rbush();
3603 var lineclip2 = require_lineclip();
3604 module2.exports = whichPolygon5;
3605 function whichPolygon5(data) {
3607 for (var i3 = 0; i3 < data.features.length; i3++) {
3608 var feature3 = data.features[i3];
3609 if (!feature3.geometry)
3611 var coords = feature3.geometry.coordinates;
3612 if (feature3.geometry.type === "Polygon") {
3613 bboxes.push(treeItem(coords, feature3.properties));
3614 } else if (feature3.geometry.type === "MultiPolygon") {
3615 for (var j3 = 0; j3 < coords.length; j3++) {
3616 bboxes.push(treeItem(coords[j3], feature3.properties));
3620 var tree = rbush().load(bboxes);
3621 function query(p2, multi) {
3622 var output = [], result = tree.search({
3628 for (var i4 = 0; i4 < result.length; i4++) {
3629 if (insidePolygon(result[i4].coords, p2)) {
3631 output.push(result[i4].props);
3633 return result[i4].props;
3636 return multi && output.length ? output : null;
3639 query.bbox = function queryBBox(bbox2) {
3641 var result = tree.search({
3647 for (var i4 = 0; i4 < result.length; i4++) {
3648 if (polygonIntersectsBBox(result[i4].coords, bbox2)) {
3649 output.push(result[i4].props);
3656 function polygonIntersectsBBox(polygon2, bbox2) {
3658 (bbox2[0] + bbox2[2]) / 2,
3659 (bbox2[1] + bbox2[3]) / 2
3661 if (insidePolygon(polygon2, bboxCenter))
3663 for (var i3 = 0; i3 < polygon2.length; i3++) {
3664 if (lineclip2(polygon2[i3], bbox2).length > 0)
3669 function insidePolygon(rings, p2) {
3671 for (var i3 = 0, len = rings.length; i3 < len; i3++) {
3672 var ring = rings[i3];
3673 for (var j3 = 0, len2 = ring.length, k2 = len2 - 1; j3 < len2; k2 = j3++) {
3674 if (rayIntersect(p2, ring[j3], ring[k2]))
3680 function rayIntersect(p2, p1, p22) {
3681 return p1[1] > p2[1] !== p22[1] > p2[1] && p2[0] < (p22[0] - p1[0]) * (p2[1] - p1[1]) / (p22[1] - p1[1]) + p1[0];
3683 function treeItem(coords, props) {
3692 for (var i3 = 0; i3 < coords[0].length; i3++) {
3693 var p2 = coords[0][i3];
3694 item.minX = Math.min(item.minX, p2[0]);
3695 item.minY = Math.min(item.minY, p2[1]);
3696 item.maxX = Math.max(item.maxX, p2[0]);
3697 item.maxY = Math.max(item.maxY, p2[1]);
3704 // node_modules/wgs84/index.js
3705 var require_wgs84 = __commonJS({
3706 "node_modules/wgs84/index.js"(exports2, module2) {
3707 module2.exports.RADIUS = 6378137;
3708 module2.exports.FLATTENING = 1 / 298.257223563;
3709 module2.exports.POLAR_RADIUS = 63567523142e-4;
3713 // node_modules/@mapbox/geojson-area/index.js
3714 var require_geojson_area = __commonJS({
3715 "node_modules/@mapbox/geojson-area/index.js"(exports2, module2) {
3716 var wgs84 = require_wgs84();
3717 module2.exports.geometry = geometry;
3718 module2.exports.ring = ringArea;
3719 function geometry(_2) {
3723 return polygonArea(_2.coordinates);
3724 case "MultiPolygon":
3725 for (i3 = 0; i3 < _2.coordinates.length; i3++) {
3726 area += polygonArea(_2.coordinates[i3]);
3732 case "MultiLineString":
3734 case "GeometryCollection":
3735 for (i3 = 0; i3 < _2.geometries.length; i3++) {
3736 area += geometry(_2.geometries[i3]);
3741 function polygonArea(coords) {
3743 if (coords && coords.length > 0) {
3744 area += Math.abs(ringArea(coords[0]));
3745 for (var i3 = 1; i3 < coords.length; i3++) {
3746 area -= Math.abs(ringArea(coords[i3]));
3751 function ringArea(coords) {
3752 var p1, p2, p3, lowerIndex, middleIndex, upperIndex, i3, area = 0, coordsLength = coords.length;
3753 if (coordsLength > 2) {
3754 for (i3 = 0; i3 < coordsLength; i3++) {
3755 if (i3 === coordsLength - 2) {
3756 lowerIndex = coordsLength - 2;
3757 middleIndex = coordsLength - 1;
3759 } else if (i3 === coordsLength - 1) {
3760 lowerIndex = coordsLength - 1;
3765 middleIndex = i3 + 1;
3766 upperIndex = i3 + 2;
3768 p1 = coords[lowerIndex];
3769 p2 = coords[middleIndex];
3770 p3 = coords[upperIndex];
3771 area += (rad(p3[0]) - rad(p1[0])) * Math.sin(rad(p2[1]));
3773 area = area * wgs84.RADIUS * wgs84.RADIUS / 2;
3778 return _2 * Math.PI / 180;
3783 // node_modules/circle-to-polygon/input-validation/validateCenter.js
3784 var require_validateCenter = __commonJS({
3785 "node_modules/circle-to-polygon/input-validation/validateCenter.js"(exports2) {
3786 exports2.validateCenter = function validateCenter(center) {
3787 var validCenterLengths = [2, 3];
3788 if (!Array.isArray(center) || !validCenterLengths.includes(center.length)) {
3789 throw new Error("ERROR! Center has to be an array of length two or three");
3791 var [lng, lat] = center;
3792 if (typeof lng !== "number" || typeof lat !== "number") {
3794 `ERROR! Longitude and Latitude has to be numbers but where ${typeof lng} and ${typeof lat}`
3797 if (lng > 180 || lng < -180) {
3798 throw new Error(`ERROR! Longitude has to be between -180 and 180 but was ${lng}`);
3800 if (lat > 90 || lat < -90) {
3801 throw new Error(`ERROR! Latitude has to be between -90 and 90 but was ${lat}`);
3807 // node_modules/circle-to-polygon/input-validation/validateRadius.js
3808 var require_validateRadius = __commonJS({
3809 "node_modules/circle-to-polygon/input-validation/validateRadius.js"(exports2) {
3810 exports2.validateRadius = function validateRadius(radius) {
3811 if (typeof radius !== "number") {
3812 throw new Error(`ERROR! Radius has to be a positive number but was: ${typeof radius}`);
3815 throw new Error(`ERROR! Radius has to be a positive number but was: ${radius}`);
3821 // node_modules/circle-to-polygon/input-validation/validateNumberOfEdges.js
3822 var require_validateNumberOfEdges = __commonJS({
3823 "node_modules/circle-to-polygon/input-validation/validateNumberOfEdges.js"(exports2) {
3824 exports2.validateNumberOfEdges = function validateNumberOfEdges(numberOfEdges) {
3825 if (typeof numberOfEdges !== "number") {
3826 const ARGUMENT_TYPE = Array.isArray(numberOfEdges) ? "array" : typeof numberOfEdges;
3827 throw new Error(`ERROR! Number of edges has to be a number but was: ${ARGUMENT_TYPE}`);
3829 if (numberOfEdges < 3) {
3830 throw new Error(`ERROR! Number of edges has to be at least 3 but was: ${numberOfEdges}`);
3836 // node_modules/circle-to-polygon/input-validation/validateEarthRadius.js
3837 var require_validateEarthRadius = __commonJS({
3838 "node_modules/circle-to-polygon/input-validation/validateEarthRadius.js"(exports2) {
3839 exports2.validateEarthRadius = function validateEarthRadius(earthRadius2) {
3840 if (typeof earthRadius2 !== "number") {
3841 const ARGUMENT_TYPE = Array.isArray(earthRadius2) ? "array" : typeof earthRadius2;
3842 throw new Error(`ERROR! Earth radius has to be a number but was: ${ARGUMENT_TYPE}`);
3844 if (earthRadius2 <= 0) {
3845 throw new Error(`ERROR! Earth radius has to be a positive number but was: ${earthRadius2}`);
3851 // node_modules/circle-to-polygon/input-validation/validateBearing.js
3852 var require_validateBearing = __commonJS({
3853 "node_modules/circle-to-polygon/input-validation/validateBearing.js"(exports2) {
3854 exports2.validateBearing = function validateBearing(bearing) {
3855 if (typeof bearing !== "number") {
3856 const ARGUMENT_TYPE = Array.isArray(bearing) ? "array" : typeof bearing;
3857 throw new Error(`ERROR! Bearing has to be a number but was: ${ARGUMENT_TYPE}`);
3863 // node_modules/circle-to-polygon/input-validation/index.js
3864 var require_input_validation = __commonJS({
3865 "node_modules/circle-to-polygon/input-validation/index.js"(exports2) {
3866 var validateCenter = require_validateCenter().validateCenter;
3867 var validateRadius = require_validateRadius().validateRadius;
3868 var validateNumberOfEdges = require_validateNumberOfEdges().validateNumberOfEdges;
3869 var validateEarthRadius = require_validateEarthRadius().validateEarthRadius;
3870 var validateBearing = require_validateBearing().validateBearing;
3871 function validateInput({ center, radius, numberOfEdges, earthRadius: earthRadius2, bearing }) {
3872 validateCenter(center);
3873 validateRadius(radius);
3874 validateNumberOfEdges(numberOfEdges);
3875 validateEarthRadius(earthRadius2);
3876 validateBearing(bearing);
3878 exports2.validateCenter = validateCenter;
3879 exports2.validateRadius = validateRadius;
3880 exports2.validateNumberOfEdges = validateNumberOfEdges;
3881 exports2.validateEarthRadius = validateEarthRadius;
3882 exports2.validateBearing = validateBearing;
3883 exports2.validateInput = validateInput;
3887 // node_modules/circle-to-polygon/index.js
3888 var require_circle_to_polygon = __commonJS({
3889 "node_modules/circle-to-polygon/index.js"(exports2, module2) {
3891 var { validateInput } = require_input_validation();
3892 var defaultEarthRadius = 6378137;
3893 function toRadians(angleInDegrees) {
3894 return angleInDegrees * Math.PI / 180;
3896 function toDegrees(angleInRadians) {
3897 return angleInRadians * 180 / Math.PI;
3899 function offset(c1, distance, earthRadius2, bearing) {
3900 var lat1 = toRadians(c1[1]);
3901 var lon1 = toRadians(c1[0]);
3902 var dByR = distance / earthRadius2;
3903 var lat = Math.asin(
3904 Math.sin(lat1) * Math.cos(dByR) + Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing)
3906 var lon = lon1 + Math.atan2(
3907 Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1),
3908 Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat)
3910 return [toDegrees(lon), toDegrees(lat)];
3912 module2.exports = function circleToPolygon2(center, radius, options2) {
3913 var n3 = getNumberOfEdges(options2);
3914 var earthRadius2 = getEarthRadius(options2);
3915 var bearing = getBearing(options2);
3916 var direction = getDirection(options2);
3917 validateInput({ center, radius, numberOfEdges: n3, earthRadius: earthRadius2, bearing });
3918 var start2 = toRadians(bearing);
3919 var coordinates = [];
3920 for (var i3 = 0; i3 < n3; ++i3) {
3926 start2 + direction * 2 * Math.PI * -i3 / n3
3930 coordinates.push(coordinates[0]);
3933 coordinates: [coordinates]
3936 function getNumberOfEdges(options2) {
3937 if (isUndefinedOrNull(options2)) {
3939 } else if (isObjectNotArray(options2)) {
3940 var numberOfEdges = options2.numberOfEdges;
3941 return numberOfEdges === void 0 ? 32 : numberOfEdges;
3945 function getEarthRadius(options2) {
3946 if (isUndefinedOrNull(options2)) {
3947 return defaultEarthRadius;
3948 } else if (isObjectNotArray(options2)) {
3949 var earthRadius2 = options2.earthRadius;
3950 return earthRadius2 === void 0 ? defaultEarthRadius : earthRadius2;
3952 return defaultEarthRadius;
3954 function getDirection(options2) {
3955 if (isObjectNotArray(options2) && options2.rightHandRule) {
3960 function getBearing(options2) {
3961 if (isUndefinedOrNull(options2)) {
3963 } else if (isObjectNotArray(options2)) {
3964 var bearing = options2.bearing;
3965 return bearing === void 0 ? 0 : bearing;
3969 function isObjectNotArray(argument) {
3970 return argument !== null && typeof argument === "object" && !Array.isArray(argument);
3972 function isUndefinedOrNull(argument) {
3973 return argument === null || argument === void 0;
3978 // node_modules/polygon-clipping/dist/polygon-clipping.umd.js
3979 var require_polygon_clipping_umd = __commonJS({
3980 "node_modules/polygon-clipping/dist/polygon-clipping.umd.js"(exports2, module2) {
3981 (function(global2, factory) {
3982 typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.polygonClipping = factory());
3983 })(exports2, function() {
3985 function _classCallCheck(instance, Constructor) {
3986 if (!(instance instanceof Constructor)) {
3987 throw new TypeError("Cannot call a class as a function");
3990 function _defineProperties(target, props) {
3991 for (var i3 = 0; i3 < props.length; i3++) {
3992 var descriptor = props[i3];
3993 descriptor.enumerable = descriptor.enumerable || false;
3994 descriptor.configurable = true;
3995 if ("value" in descriptor)
3996 descriptor.writable = true;
3997 Object.defineProperty(target, descriptor.key, descriptor);
4000 function _createClass(Constructor, protoProps, staticProps) {
4002 _defineProperties(Constructor.prototype, protoProps);
4004 _defineProperties(Constructor, staticProps);
4010 function Node2(key, data) {
4020 function DEFAULT_COMPARE(a2, b2) {
4021 return a2 > b2 ? 1 : a2 < b2 ? -1 : 0;
4023 function splay(i3, t2, comparator) {
4024 var N2 = new Node(null, null);
4028 var cmp2 = comparator(i3, t2.key);
4030 if (t2.left === null)
4032 if (comparator(i3, t2.left.key) < 0) {
4037 if (t2.left === null)
4043 } else if (cmp2 > 0) {
4044 if (t2.right === null)
4046 if (comparator(i3, t2.right.key) > 0) {
4051 if (t2.right === null)
4066 function insert(i3, data, t2, comparator) {
4067 var node = new Node(i3, data);
4069 node.left = node.right = null;
4072 t2 = splay(i3, t2, comparator);
4073 var cmp2 = comparator(i3, t2.key);
4075 node.left = t2.left;
4078 } else if (cmp2 >= 0) {
4079 node.right = t2.right;
4085 function split(key, v2, comparator) {
4089 v2 = splay(key, v2, comparator);
4090 var cmp2 = comparator(v2.key, key);
4094 } else if (cmp2 < 0) {
4109 function merge2(left, right, comparator) {
4114 right = splay(left.key, right, comparator);
4118 function printRow(root3, prefix, isTail, out, printNode) {
4120 out("" + prefix + (isTail ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ") + printNode(root3) + "\n");
4121 var indent2 = prefix + (isTail ? " " : "\u2502 ");
4123 printRow(root3.left, indent2, false, out, printNode);
4125 printRow(root3.right, indent2, true, out, printNode);
4131 function Tree2(comparator) {
4132 if (comparator === void 0) {
4133 comparator = DEFAULT_COMPARE;
4137 this._comparator = comparator;
4139 Tree2.prototype.insert = function(key, data) {
4141 return this._root = insert(key, data, this._root, this._comparator);
4143 Tree2.prototype.add = function(key, data) {
4144 var node = new Node(key, data);
4145 if (this._root === null) {
4146 node.left = node.right = null;
4150 var comparator = this._comparator;
4151 var t2 = splay(key, this._root, comparator);
4152 var cmp2 = comparator(key, t2.key);
4157 node.left = t2.left;
4160 } else if (cmp2 > 0) {
4161 node.right = t2.right;
4170 Tree2.prototype.remove = function(key) {
4171 this._root = this._remove(key, this._root, this._comparator);
4173 Tree2.prototype._remove = function(i3, t2, comparator) {
4177 t2 = splay(i3, t2, comparator);
4178 var cmp2 = comparator(i3, t2.key);
4180 if (t2.left === null) {
4183 x2 = splay(i3, t2.left, comparator);
4184 x2.right = t2.right;
4191 Tree2.prototype.pop = function() {
4192 var node = this._root;
4197 this._root = splay(node.key, this._root, this._comparator);
4198 this._root = this._remove(node.key, this._root, this._comparator);
4206 Tree2.prototype.findStatic = function(key) {
4207 var current = this._root;
4208 var compare = this._comparator;
4210 var cmp2 = compare(key, current.key);
4214 current = current.left;
4216 current = current.right;
4220 Tree2.prototype.find = function(key) {
4222 this._root = splay(key, this._root, this._comparator);
4223 if (this._comparator(key, this._root.key) !== 0)
4228 Tree2.prototype.contains = function(key) {
4229 var current = this._root;
4230 var compare = this._comparator;
4232 var cmp2 = compare(key, current.key);
4236 current = current.left;
4238 current = current.right;
4242 Tree2.prototype.forEach = function(visitor, ctx) {
4243 var current = this._root;
4247 if (current !== null) {
4249 current = current.left;
4251 if (Q2.length !== 0) {
4253 visitor.call(ctx, current);
4254 current = current.right;
4261 Tree2.prototype.range = function(low, high, fn, ctx) {
4263 var compare = this._comparator;
4264 var node = this._root;
4266 while (Q2.length !== 0 || node) {
4272 cmp2 = compare(node.key, high);
4275 } else if (compare(node.key, low) >= 0) {
4276 if (fn.call(ctx, node))
4284 Tree2.prototype.keys = function() {
4286 this.forEach(function(_a) {
4288 return keys2.push(key);
4292 Tree2.prototype.values = function() {
4294 this.forEach(function(_a) {
4296 return values.push(data);
4300 Tree2.prototype.min = function() {
4302 return this.minNode(this._root).key;
4305 Tree2.prototype.max = function() {
4307 return this.maxNode(this._root).key;
4310 Tree2.prototype.minNode = function(t2) {
4311 if (t2 === void 0) {
4320 Tree2.prototype.maxNode = function(t2) {
4321 if (t2 === void 0) {
4330 Tree2.prototype.at = function(index2) {
4331 var current = this._root;
4338 current = current.left;
4340 if (Q2.length > 0) {
4345 current = current.right;
4352 Tree2.prototype.next = function(d2) {
4353 var root3 = this._root;
4354 var successor = null;
4356 successor = d2.right;
4357 while (successor.left) {
4358 successor = successor.left;
4362 var comparator = this._comparator;
4364 var cmp2 = comparator(d2.key, root3.key);
4367 else if (cmp2 < 0) {
4371 root3 = root3.right;
4375 Tree2.prototype.prev = function(d2) {
4376 var root3 = this._root;
4377 var predecessor = null;
4378 if (d2.left !== null) {
4379 predecessor = d2.left;
4380 while (predecessor.right) {
4381 predecessor = predecessor.right;
4385 var comparator = this._comparator;
4387 var cmp2 = comparator(d2.key, root3.key);
4393 predecessor = root3;
4394 root3 = root3.right;
4399 Tree2.prototype.clear = function() {
4404 Tree2.prototype.toList = function() {
4405 return toList(this._root);
4407 Tree2.prototype.load = function(keys2, values, presort) {
4408 if (values === void 0) {
4411 if (presort === void 0) {
4414 var size = keys2.length;
4415 var comparator = this._comparator;
4417 sort(keys2, values, 0, size - 1, comparator);
4418 if (this._root === null) {
4419 this._root = loadRecursive(keys2, values, 0, size);
4422 var mergedList = mergeLists(this.toList(), createList(keys2, values), comparator);
4423 size = this._size + size;
4424 this._root = sortedListToBST({
4430 Tree2.prototype.isEmpty = function() {
4431 return this._root === null;
4433 Object.defineProperty(Tree2.prototype, "size", {
4434 get: function get4() {
4440 Object.defineProperty(Tree2.prototype, "root", {
4441 get: function get4() {
4447 Tree2.prototype.toString = function(printNode) {
4448 if (printNode === void 0) {
4449 printNode = function printNode2(n3) {
4450 return String(n3.key);
4454 printRow(this._root, "", true, function(v2) {
4455 return out.push(v2);
4457 return out.join("");
4459 Tree2.prototype.update = function(key, newKey, newData) {
4460 var comparator = this._comparator;
4461 var _a = split(key, this._root, comparator), left = _a.left, right = _a.right;
4462 if (comparator(key, newKey) < 0) {
4463 right = insert(newKey, newData, right, comparator);
4465 left = insert(newKey, newData, left, comparator);
4467 this._root = merge2(left, right, comparator);
4469 Tree2.prototype.split = function(key) {
4470 return split(key, this._root, this._comparator);
4475 function loadRecursive(keys2, values, start2, end) {
4476 var size = end - start2;
4478 var middle = start2 + Math.floor(size / 2);
4479 var key = keys2[middle];
4480 var data = values[middle];
4481 var node = new Node(key, data);
4482 node.left = loadRecursive(keys2, values, start2, middle);
4483 node.right = loadRecursive(keys2, values, middle + 1, end);
4488 function createList(keys2, values) {
4489 var head = new Node(null, null);
4491 for (var i3 = 0; i3 < keys2.length; i3++) {
4492 p2 = p2.next = new Node(keys2[i3], values[i3]);
4497 function toList(root3) {
4498 var current = root3;
4501 var head = new Node(null, null);
4506 current = current.left;
4508 if (Q2.length > 0) {
4509 current = p2 = p2.next = Q2.pop();
4510 current = current.right;
4518 function sortedListToBST(list, start2, end) {
4519 var size = end - start2;
4521 var middle = start2 + Math.floor(size / 2);
4522 var left = sortedListToBST(list, start2, middle);
4523 var root3 = list.head;
4525 list.head = list.head.next;
4526 root3.right = sortedListToBST(list, middle + 1, end);
4531 function mergeLists(l1, l2, compare) {
4532 var head = new Node(null, null);
4536 while (p1 !== null && p22 !== null) {
4537 if (compare(p1.key, p22.key) < 0) {
4548 } else if (p22 !== null) {
4553 function sort(keys2, values, left, right, compare) {
4556 var pivot = keys2[left + right >> 1];
4562 } while (compare(keys2[i3], pivot) < 0);
4565 } while (compare(keys2[j3], pivot) > 0);
4568 var tmp = keys2[i3];
4569 keys2[i3] = keys2[j3];
4572 values[i3] = values[j3];
4575 sort(keys2, values, left, j3, compare);
4576 sort(keys2, values, j3 + 1, right, compare);
4578 var isInBbox = function isInBbox2(bbox2, point2) {
4579 return bbox2.ll.x <= point2.x && point2.x <= bbox2.ur.x && bbox2.ll.y <= point2.y && point2.y <= bbox2.ur.y;
4581 var getBboxOverlap = function getBboxOverlap2(b1, b2) {
4582 if (b2.ur.x < b1.ll.x || b1.ur.x < b2.ll.x || b2.ur.y < b1.ll.y || b1.ur.y < b2.ll.y)
4584 var lowerX = b1.ll.x < b2.ll.x ? b2.ll.x : b1.ll.x;
4585 var upperX = b1.ur.x < b2.ur.x ? b1.ur.x : b2.ur.x;
4586 var lowerY = b1.ll.y < b2.ll.y ? b2.ll.y : b1.ll.y;
4587 var upperY = b1.ur.y < b2.ur.y ? b1.ur.y : b2.ur.y;
4599 var epsilon3 = Number.EPSILON;
4600 if (epsilon3 === void 0)
4601 epsilon3 = Math.pow(2, -52);
4602 var EPSILON_SQ = epsilon3 * epsilon3;
4603 var cmp = function cmp2(a2, b2) {
4604 if (-epsilon3 < a2 && a2 < epsilon3) {
4605 if (-epsilon3 < b2 && b2 < epsilon3) {
4610 if (ab * ab < EPSILON_SQ * a2 * b2) {
4613 return a2 < b2 ? -1 : 1;
4615 var PtRounder = /* @__PURE__ */ function() {
4616 function PtRounder2() {
4617 _classCallCheck(this, PtRounder2);
4620 _createClass(PtRounder2, [{
4622 value: function reset() {
4623 this.xRounder = new CoordRounder();
4624 this.yRounder = new CoordRounder();
4628 value: function round(x2, y2) {
4630 x: this.xRounder.round(x2),
4631 y: this.yRounder.round(y2)
4637 var CoordRounder = /* @__PURE__ */ function() {
4638 function CoordRounder2() {
4639 _classCallCheck(this, CoordRounder2);
4640 this.tree = new Tree();
4643 _createClass(CoordRounder2, [{
4645 value: function round(coord2) {
4646 var node = this.tree.add(coord2);
4647 var prevNode = this.tree.prev(node);
4648 if (prevNode !== null && cmp(node.key, prevNode.key) === 0) {
4649 this.tree.remove(coord2);
4650 return prevNode.key;
4652 var nextNode = this.tree.next(node);
4653 if (nextNode !== null && cmp(node.key, nextNode.key) === 0) {
4654 this.tree.remove(coord2);
4655 return nextNode.key;
4660 return CoordRounder2;
4662 var rounder = new PtRounder();
4663 var crossProduct = function crossProduct2(a2, b2) {
4664 return a2.x * b2.y - a2.y * b2.x;
4666 var dotProduct = function dotProduct2(a2, b2) {
4667 return a2.x * b2.x + a2.y * b2.y;
4669 var compareVectorAngles = function compareVectorAngles2(basePt, endPt1, endPt2) {
4671 x: endPt1.x - basePt.x,
4672 y: endPt1.y - basePt.y
4675 x: endPt2.x - basePt.x,
4676 y: endPt2.y - basePt.y
4678 var kross = crossProduct(v1, v2);
4679 return cmp(kross, 0);
4681 var length = function length2(v2) {
4682 return Math.sqrt(dotProduct(v2, v2));
4684 var sineOfAngle = function sineOfAngle2(pShared, pBase, pAngle) {
4686 x: pBase.x - pShared.x,
4687 y: pBase.y - pShared.y
4690 x: pAngle.x - pShared.x,
4691 y: pAngle.y - pShared.y
4693 return crossProduct(vAngle, vBase) / length(vAngle) / length(vBase);
4695 var cosineOfAngle = function cosineOfAngle2(pShared, pBase, pAngle) {
4697 x: pBase.x - pShared.x,
4698 y: pBase.y - pShared.y
4701 x: pAngle.x - pShared.x,
4702 y: pAngle.y - pShared.y
4704 return dotProduct(vAngle, vBase) / length(vAngle) / length(vBase);
4706 var horizontalIntersection = function horizontalIntersection2(pt2, v2, y2) {
4710 x: pt2.x + v2.x / v2.y * (y2 - pt2.y),
4714 var verticalIntersection = function verticalIntersection2(pt2, v2, x2) {
4719 y: pt2.y + v2.y / v2.x * (x2 - pt2.x)
4722 var intersection = function intersection2(pt1, v1, pt2, v2) {
4724 return verticalIntersection(pt2, v2, pt1.x);
4726 return verticalIntersection(pt1, v1, pt2.x);
4728 return horizontalIntersection(pt2, v2, pt1.y);
4730 return horizontalIntersection(pt1, v1, pt2.y);
4731 var kross = crossProduct(v1, v2);
4738 var d1 = crossProduct(ve2, v1) / kross;
4739 var d2 = crossProduct(ve2, v2) / kross;
4740 var x12 = pt1.x + d2 * v1.x, x2 = pt2.x + d1 * v2.x;
4741 var y12 = pt1.y + d2 * v1.y, y2 = pt2.y + d1 * v2.y;
4742 var x3 = (x12 + x2) / 2;
4743 var y3 = (y12 + y2) / 2;
4749 var SweepEvent = /* @__PURE__ */ function() {
4750 _createClass(SweepEvent2, null, [{
4752 // for ordering sweep events in the sweep event queue
4753 value: function compare(a2, b2) {
4754 var ptCmp = SweepEvent2.comparePoints(a2.point, b2.point);
4757 if (a2.point !== b2.point)
4759 if (a2.isLeft !== b2.isLeft)
4760 return a2.isLeft ? 1 : -1;
4761 return Segment.compare(a2.segment, b2.segment);
4763 // for ordering points in sweep line order
4765 key: "comparePoints",
4766 value: function comparePoints(aPt, bPt) {
4777 // Warning: 'point' input will be modified and re-used (for performance)
4779 function SweepEvent2(point2, isLeft) {
4780 _classCallCheck(this, SweepEvent2);
4781 if (point2.events === void 0)
4782 point2.events = [this];
4784 point2.events.push(this);
4785 this.point = point2;
4786 this.isLeft = isLeft;
4788 _createClass(SweepEvent2, [{
4790 value: function link2(other) {
4791 if (other.point === this.point) {
4792 throw new Error("Tried to link already linked events");
4794 var otherEvents = other.point.events;
4795 for (var i3 = 0, iMax = otherEvents.length; i3 < iMax; i3++) {
4796 var evt = otherEvents[i3];
4797 this.point.events.push(evt);
4798 evt.point = this.point;
4800 this.checkForConsuming();
4802 /* Do a pass over our linked events and check to see if any pair
4803 * of segments match, and should be consumed. */
4805 key: "checkForConsuming",
4806 value: function checkForConsuming() {
4807 var numEvents = this.point.events.length;
4808 for (var i3 = 0; i3 < numEvents; i3++) {
4809 var evt1 = this.point.events[i3];
4810 if (evt1.segment.consumedBy !== void 0)
4812 for (var j3 = i3 + 1; j3 < numEvents; j3++) {
4813 var evt2 = this.point.events[j3];
4814 if (evt2.consumedBy !== void 0)
4816 if (evt1.otherSE.point.events !== evt2.otherSE.point.events)
4818 evt1.segment.consume(evt2.segment);
4823 key: "getAvailableLinkedEvents",
4824 value: function getAvailableLinkedEvents() {
4826 for (var i3 = 0, iMax = this.point.events.length; i3 < iMax; i3++) {
4827 var evt = this.point.events[i3];
4828 if (evt !== this && !evt.segment.ringOut && evt.segment.isInResult()) {
4835 * Returns a comparator function for sorting linked events that will
4836 * favor the event that will give us the smallest left-side angle.
4837 * All ring construction starts as low as possible heading to the right,
4838 * so by always turning left as sharp as possible we'll get polygons
4839 * without uncessary loops & holes.
4841 * The comparator function has a compute cache such that it avoids
4842 * re-computing already-computed values.
4845 key: "getLeftmostComparator",
4846 value: function getLeftmostComparator(baseEvent) {
4848 var cache = /* @__PURE__ */ new Map();
4849 var fillCache = function fillCache2(linkedEvent) {
4850 var nextEvent = linkedEvent.otherSE;
4851 cache.set(linkedEvent, {
4852 sine: sineOfAngle(_this.point, baseEvent.point, nextEvent.point),
4853 cosine: cosineOfAngle(_this.point, baseEvent.point, nextEvent.point)
4856 return function(a2, b2) {
4861 var _cache$get = cache.get(a2), asine = _cache$get.sine, acosine = _cache$get.cosine;
4862 var _cache$get2 = cache.get(b2), bsine = _cache$get2.sine, bcosine = _cache$get2.cosine;
4863 if (asine >= 0 && bsine >= 0) {
4864 if (acosine < bcosine)
4866 if (acosine > bcosine)
4870 if (asine < 0 && bsine < 0) {
4871 if (acosine < bcosine)
4873 if (acosine > bcosine)
4888 var Segment = /* @__PURE__ */ function() {
4889 _createClass(Segment2, null, [{
4891 /* This compare() function is for ordering segments in the sweep
4892 * line tree, and does so according to the following criteria:
4894 * Consider the vertical line that lies an infinestimal step to the
4895 * right of the right-more of the two left endpoints of the input
4896 * segments. Imagine slowly moving a point up from negative infinity
4897 * in the increasing y direction. Which of the two segments will that
4898 * point intersect first? That segment comes 'before' the other one.
4900 * If neither segment would be intersected by such a line, (if one
4901 * or more of the segments are vertical) then the line to be considered
4902 * is directly on the right-more of the two left inputs.
4904 value: function compare(a2, b2) {
4905 var alx = a2.leftSE.point.x;
4906 var blx = b2.leftSE.point.x;
4907 var arx = a2.rightSE.point.x;
4908 var brx = b2.rightSE.point.x;
4913 var aly = a2.leftSE.point.y;
4914 var bly = b2.leftSE.point.y;
4915 var ary = a2.rightSE.point.y;
4916 var bry = b2.rightSE.point.y;
4918 if (bly < aly && bly < ary)
4920 if (bly > aly && bly > ary)
4922 var aCmpBLeft = a2.comparePoint(b2.leftSE.point);
4927 var bCmpARight = b2.comparePoint(a2.rightSE.point);
4928 if (bCmpARight !== 0)
4933 if (aly < bly && aly < bry)
4935 if (aly > bly && aly > bry)
4937 var bCmpALeft = b2.comparePoint(a2.leftSE.point);
4938 if (bCmpALeft !== 0)
4940 var aCmpBRight = a2.comparePoint(b2.rightSE.point);
4952 var _bCmpARight = b2.comparePoint(a2.rightSE.point);
4953 if (_bCmpARight !== 0)
4957 var _aCmpBRight = a2.comparePoint(b2.rightSE.point);
4958 if (_aCmpBRight < 0)
4960 if (_aCmpBRight > 0)
4968 if (ay > ax && by < bx)
4970 if (ay < ax && by > bx)
4987 /* Warning: a reference to ringWindings input will be stored,
4988 * and possibly will be later modified */
4990 function Segment2(leftSE, rightSE, rings, windings) {
4991 _classCallCheck(this, Segment2);
4992 this.id = ++segmentId;
4993 this.leftSE = leftSE;
4994 leftSE.segment = this;
4995 leftSE.otherSE = rightSE;
4996 this.rightSE = rightSE;
4997 rightSE.segment = this;
4998 rightSE.otherSE = leftSE;
5000 this.windings = windings;
5002 _createClass(Segment2, [{
5003 key: "replaceRightSE",
5004 /* When a segment is split, the rightSE is replaced with a new sweep event */
5005 value: function replaceRightSE(newRightSE) {
5006 this.rightSE = newRightSE;
5007 this.rightSE.segment = this;
5008 this.rightSE.otherSE = this.leftSE;
5009 this.leftSE.otherSE = this.rightSE;
5013 value: function bbox2() {
5014 var y12 = this.leftSE.point.y;
5015 var y2 = this.rightSE.point.y;
5018 x: this.leftSE.point.x,
5019 y: y12 < y2 ? y12 : y2
5022 x: this.rightSE.point.x,
5023 y: y12 > y2 ? y12 : y2
5027 /* A vector from the left point to the right */
5030 value: function vector() {
5032 x: this.rightSE.point.x - this.leftSE.point.x,
5033 y: this.rightSE.point.y - this.leftSE.point.y
5037 key: "isAnEndpoint",
5038 value: function isAnEndpoint(pt2) {
5039 return pt2.x === this.leftSE.point.x && pt2.y === this.leftSE.point.y || pt2.x === this.rightSE.point.x && pt2.y === this.rightSE.point.y;
5041 /* Compare this segment with a point.
5043 * A point P is considered to be colinear to a segment if there
5044 * exists a distance D such that if we travel along the segment
5045 * from one * endpoint towards the other a distance D, we find
5046 * ourselves at point P.
5048 * Return value indicates:
5050 * 1: point lies above the segment (to the left of vertical)
5051 * 0: point is colinear to segment
5052 * -1: point lies below the segment (to the right of vertical)
5055 key: "comparePoint",
5056 value: function comparePoint(point2) {
5057 if (this.isAnEndpoint(point2))
5059 var lPt = this.leftSE.point;
5060 var rPt = this.rightSE.point;
5061 var v2 = this.vector();
5062 if (lPt.x === rPt.x) {
5063 if (point2.x === lPt.x)
5065 return point2.x < lPt.x ? 1 : -1;
5067 var yDist = (point2.y - lPt.y) / v2.y;
5068 var xFromYDist = lPt.x + yDist * v2.x;
5069 if (point2.x === xFromYDist)
5071 var xDist = (point2.x - lPt.x) / v2.x;
5072 var yFromXDist = lPt.y + xDist * v2.y;
5073 if (point2.y === yFromXDist)
5075 return point2.y < yFromXDist ? -1 : 1;
5078 * Given another segment, returns the first non-trivial intersection
5079 * between the two segments (in terms of sweep line ordering), if it exists.
5081 * A 'non-trivial' intersection is one that will cause one or both of the
5082 * segments to be split(). As such, 'trivial' vs. 'non-trivial' intersection:
5084 * * endpoint of segA with endpoint of segB --> trivial
5085 * * endpoint of segA with point along segB --> non-trivial
5086 * * endpoint of segB with point along segA --> non-trivial
5087 * * point along segA with point along segB --> non-trivial
5089 * If no non-trivial intersection exists, return null
5090 * Else, return null.
5093 key: "getIntersection",
5094 value: function getIntersection(other) {
5095 var tBbox = this.bbox();
5096 var oBbox = other.bbox();
5097 var bboxOverlap = getBboxOverlap(tBbox, oBbox);
5098 if (bboxOverlap === null)
5100 var tlp = this.leftSE.point;
5101 var trp = this.rightSE.point;
5102 var olp = other.leftSE.point;
5103 var orp = other.rightSE.point;
5104 var touchesOtherLSE = isInBbox(tBbox, olp) && this.comparePoint(olp) === 0;
5105 var touchesThisLSE = isInBbox(oBbox, tlp) && other.comparePoint(tlp) === 0;
5106 var touchesOtherRSE = isInBbox(tBbox, orp) && this.comparePoint(orp) === 0;
5107 var touchesThisRSE = isInBbox(oBbox, trp) && other.comparePoint(trp) === 0;
5108 if (touchesThisLSE && touchesOtherLSE) {
5109 if (touchesThisRSE && !touchesOtherRSE)
5111 if (!touchesThisRSE && touchesOtherRSE)
5115 if (touchesThisLSE) {
5116 if (touchesOtherRSE) {
5117 if (tlp.x === orp.x && tlp.y === orp.y)
5122 if (touchesOtherLSE) {
5123 if (touchesThisRSE) {
5124 if (trp.x === olp.x && trp.y === olp.y)
5129 if (touchesThisRSE && touchesOtherRSE)
5133 if (touchesOtherRSE)
5135 var pt2 = intersection(tlp, this.vector(), olp, other.vector());
5138 if (!isInBbox(bboxOverlap, pt2))
5140 return rounder.round(pt2.x, pt2.y);
5143 * Split the given segment into multiple segments on the given points.
5144 * * Each existing segment will retain its leftSE and a new rightSE will be
5146 * * A new segment will be generated which will adopt the original segment's
5147 * rightSE, and a new leftSE will be generated for it.
5148 * * If there are more than two points given to split on, new segments
5149 * in the middle will be generated with new leftSE and rightSE's.
5150 * * An array of the newly generated SweepEvents will be returned.
5152 * Warning: input array of points is modified
5156 value: function split2(point2) {
5158 var alreadyLinked = point2.events !== void 0;
5159 var newLeftSE = new SweepEvent(point2, true);
5160 var newRightSE = new SweepEvent(point2, false);
5161 var oldRightSE = this.rightSE;
5162 this.replaceRightSE(newRightSE);
5163 newEvents.push(newRightSE);
5164 newEvents.push(newLeftSE);
5165 var newSeg = new Segment2(newLeftSE, oldRightSE, this.rings.slice(), this.windings.slice());
5166 if (SweepEvent.comparePoints(newSeg.leftSE.point, newSeg.rightSE.point) > 0) {
5167 newSeg.swapEvents();
5169 if (SweepEvent.comparePoints(this.leftSE.point, this.rightSE.point) > 0) {
5172 if (alreadyLinked) {
5173 newLeftSE.checkForConsuming();
5174 newRightSE.checkForConsuming();
5178 /* Swap which event is left and right */
5181 value: function swapEvents() {
5182 var tmpEvt = this.rightSE;
5183 this.rightSE = this.leftSE;
5184 this.leftSE = tmpEvt;
5185 this.leftSE.isLeft = true;
5186 this.rightSE.isLeft = false;
5187 for (var i3 = 0, iMax = this.windings.length; i3 < iMax; i3++) {
5188 this.windings[i3] *= -1;
5191 /* Consume another segment. We take their rings under our wing
5192 * and mark them as consumed. Use for perfectly overlapping segments */
5195 value: function consume(other) {
5196 var consumer = this;
5197 var consumee = other;
5198 while (consumer.consumedBy) {
5199 consumer = consumer.consumedBy;
5201 while (consumee.consumedBy) {
5202 consumee = consumee.consumedBy;
5204 var cmp2 = Segment2.compare(consumer, consumee);
5209 consumer = consumee;
5212 if (consumer.prev === consumee) {
5213 var _tmp = consumer;
5214 consumer = consumee;
5217 for (var i3 = 0, iMax = consumee.rings.length; i3 < iMax; i3++) {
5218 var ring = consumee.rings[i3];
5219 var winding = consumee.windings[i3];
5220 var index2 = consumer.rings.indexOf(ring);
5221 if (index2 === -1) {
5222 consumer.rings.push(ring);
5223 consumer.windings.push(winding);
5225 consumer.windings[index2] += winding;
5227 consumee.rings = null;
5228 consumee.windings = null;
5229 consumee.consumedBy = consumer;
5230 consumee.leftSE.consumedBy = consumer.leftSE;
5231 consumee.rightSE.consumedBy = consumer.rightSE;
5233 /* The first segment previous segment chain that is in the result */
5235 key: "prevInResult",
5236 value: function prevInResult() {
5237 if (this._prevInResult !== void 0)
5238 return this._prevInResult;
5240 this._prevInResult = null;
5241 else if (this.prev.isInResult())
5242 this._prevInResult = this.prev;
5244 this._prevInResult = this.prev.prevInResult();
5245 return this._prevInResult;
5249 value: function beforeState() {
5250 if (this._beforeState !== void 0)
5251 return this._beforeState;
5253 this._beforeState = {
5259 var seg = this.prev.consumedBy || this.prev;
5260 this._beforeState = seg.afterState();
5262 return this._beforeState;
5266 value: function afterState() {
5267 if (this._afterState !== void 0)
5268 return this._afterState;
5269 var beforeState = this.beforeState();
5270 this._afterState = {
5271 rings: beforeState.rings.slice(0),
5272 windings: beforeState.windings.slice(0),
5275 var ringsAfter = this._afterState.rings;
5276 var windingsAfter = this._afterState.windings;
5277 var mpsAfter = this._afterState.multiPolys;
5278 for (var i3 = 0, iMax = this.rings.length; i3 < iMax; i3++) {
5279 var ring = this.rings[i3];
5280 var winding = this.windings[i3];
5281 var index2 = ringsAfter.indexOf(ring);
5282 if (index2 === -1) {
5283 ringsAfter.push(ring);
5284 windingsAfter.push(winding);
5286 windingsAfter[index2] += winding;
5288 var polysAfter = [];
5289 var polysExclude = [];
5290 for (var _i = 0, _iMax = ringsAfter.length; _i < _iMax; _i++) {
5291 if (windingsAfter[_i] === 0)
5293 var _ring = ringsAfter[_i];
5294 var poly = _ring.poly;
5295 if (polysExclude.indexOf(poly) !== -1)
5297 if (_ring.isExterior)
5298 polysAfter.push(poly);
5300 if (polysExclude.indexOf(poly) === -1)
5301 polysExclude.push(poly);
5302 var _index = polysAfter.indexOf(_ring.poly);
5304 polysAfter.splice(_index, 1);
5307 for (var _i2 = 0, _iMax2 = polysAfter.length; _i2 < _iMax2; _i2++) {
5308 var mp = polysAfter[_i2].multiPoly;
5309 if (mpsAfter.indexOf(mp) === -1)
5312 return this._afterState;
5314 /* Is this segment part of the final result? */
5317 value: function isInResult() {
5318 if (this.consumedBy)
5320 if (this._isInResult !== void 0)
5321 return this._isInResult;
5322 var mpsBefore = this.beforeState().multiPolys;
5323 var mpsAfter = this.afterState().multiPolys;
5324 switch (operation.type) {
5326 var noBefores = mpsBefore.length === 0;
5327 var noAfters = mpsAfter.length === 0;
5328 this._isInResult = noBefores !== noAfters;
5331 case "intersection": {
5334 if (mpsBefore.length < mpsAfter.length) {
5335 least = mpsBefore.length;
5336 most = mpsAfter.length;
5338 least = mpsAfter.length;
5339 most = mpsBefore.length;
5341 this._isInResult = most === operation.numMultiPolys && least < most;
5345 var diff = Math.abs(mpsBefore.length - mpsAfter.length);
5346 this._isInResult = diff % 2 === 1;
5349 case "difference": {
5350 var isJustSubject = function isJustSubject2(mps) {
5351 return mps.length === 1 && mps[0].isSubject;
5353 this._isInResult = isJustSubject(mpsBefore) !== isJustSubject(mpsAfter);
5357 throw new Error("Unrecognized operation type found ".concat(operation.type));
5359 return this._isInResult;
5363 value: function fromRing(pt1, pt2, ring) {
5364 var leftPt, rightPt, winding;
5365 var cmpPts = SweepEvent.comparePoints(pt1, pt2);
5370 } else if (cmpPts > 0) {
5375 throw new Error("Tried to create degenerate segment at [".concat(pt1.x, ", ").concat(pt1.y, "]"));
5376 var leftSE = new SweepEvent(leftPt, true);
5377 var rightSE = new SweepEvent(rightPt, false);
5378 return new Segment2(leftSE, rightSE, [ring], [winding]);
5383 var RingIn = /* @__PURE__ */ function() {
5384 function RingIn2(geomRing, poly, isExterior) {
5385 _classCallCheck(this, RingIn2);
5386 if (!Array.isArray(geomRing) || geomRing.length === 0) {
5387 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
5390 this.isExterior = isExterior;
5392 if (typeof geomRing[0][0] !== "number" || typeof geomRing[0][1] !== "number") {
5393 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
5395 var firstPoint = rounder.round(geomRing[0][0], geomRing[0][1]);
5406 var prevPoint = firstPoint;
5407 for (var i3 = 1, iMax = geomRing.length; i3 < iMax; i3++) {
5408 if (typeof geomRing[i3][0] !== "number" || typeof geomRing[i3][1] !== "number") {
5409 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
5411 var point2 = rounder.round(geomRing[i3][0], geomRing[i3][1]);
5412 if (point2.x === prevPoint.x && point2.y === prevPoint.y)
5414 this.segments.push(Segment.fromRing(prevPoint, point2, this));
5415 if (point2.x < this.bbox.ll.x)
5416 this.bbox.ll.x = point2.x;
5417 if (point2.y < this.bbox.ll.y)
5418 this.bbox.ll.y = point2.y;
5419 if (point2.x > this.bbox.ur.x)
5420 this.bbox.ur.x = point2.x;
5421 if (point2.y > this.bbox.ur.y)
5422 this.bbox.ur.y = point2.y;
5425 if (firstPoint.x !== prevPoint.x || firstPoint.y !== prevPoint.y) {
5426 this.segments.push(Segment.fromRing(prevPoint, firstPoint, this));
5429 _createClass(RingIn2, [{
5430 key: "getSweepEvents",
5431 value: function getSweepEvents() {
5432 var sweepEvents = [];
5433 for (var i3 = 0, iMax = this.segments.length; i3 < iMax; i3++) {
5434 var segment = this.segments[i3];
5435 sweepEvents.push(segment.leftSE);
5436 sweepEvents.push(segment.rightSE);
5443 var PolyIn = /* @__PURE__ */ function() {
5444 function PolyIn2(geomPoly, multiPoly) {
5445 _classCallCheck(this, PolyIn2);
5446 if (!Array.isArray(geomPoly)) {
5447 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
5449 this.exteriorRing = new RingIn(geomPoly[0], this, true);
5452 x: this.exteriorRing.bbox.ll.x,
5453 y: this.exteriorRing.bbox.ll.y
5456 x: this.exteriorRing.bbox.ur.x,
5457 y: this.exteriorRing.bbox.ur.y
5460 this.interiorRings = [];
5461 for (var i3 = 1, iMax = geomPoly.length; i3 < iMax; i3++) {
5462 var ring = new RingIn(geomPoly[i3], this, false);
5463 if (ring.bbox.ll.x < this.bbox.ll.x)
5464 this.bbox.ll.x = ring.bbox.ll.x;
5465 if (ring.bbox.ll.y < this.bbox.ll.y)
5466 this.bbox.ll.y = ring.bbox.ll.y;
5467 if (ring.bbox.ur.x > this.bbox.ur.x)
5468 this.bbox.ur.x = ring.bbox.ur.x;
5469 if (ring.bbox.ur.y > this.bbox.ur.y)
5470 this.bbox.ur.y = ring.bbox.ur.y;
5471 this.interiorRings.push(ring);
5473 this.multiPoly = multiPoly;
5475 _createClass(PolyIn2, [{
5476 key: "getSweepEvents",
5477 value: function getSweepEvents() {
5478 var sweepEvents = this.exteriorRing.getSweepEvents();
5479 for (var i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
5480 var ringSweepEvents = this.interiorRings[i3].getSweepEvents();
5481 for (var j3 = 0, jMax = ringSweepEvents.length; j3 < jMax; j3++) {
5482 sweepEvents.push(ringSweepEvents[j3]);
5490 var MultiPolyIn = /* @__PURE__ */ function() {
5491 function MultiPolyIn2(geom, isSubject) {
5492 _classCallCheck(this, MultiPolyIn2);
5493 if (!Array.isArray(geom)) {
5494 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
5497 if (typeof geom[0][0][0] === "number")
5504 x: Number.POSITIVE_INFINITY,
5505 y: Number.POSITIVE_INFINITY
5508 x: Number.NEGATIVE_INFINITY,
5509 y: Number.NEGATIVE_INFINITY
5512 for (var i3 = 0, iMax = geom.length; i3 < iMax; i3++) {
5513 var poly = new PolyIn(geom[i3], this);
5514 if (poly.bbox.ll.x < this.bbox.ll.x)
5515 this.bbox.ll.x = poly.bbox.ll.x;
5516 if (poly.bbox.ll.y < this.bbox.ll.y)
5517 this.bbox.ll.y = poly.bbox.ll.y;
5518 if (poly.bbox.ur.x > this.bbox.ur.x)
5519 this.bbox.ur.x = poly.bbox.ur.x;
5520 if (poly.bbox.ur.y > this.bbox.ur.y)
5521 this.bbox.ur.y = poly.bbox.ur.y;
5522 this.polys.push(poly);
5524 this.isSubject = isSubject;
5526 _createClass(MultiPolyIn2, [{
5527 key: "getSweepEvents",
5528 value: function getSweepEvents() {
5529 var sweepEvents = [];
5530 for (var i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
5531 var polySweepEvents = this.polys[i3].getSweepEvents();
5532 for (var j3 = 0, jMax = polySweepEvents.length; j3 < jMax; j3++) {
5533 sweepEvents.push(polySweepEvents[j3]);
5539 return MultiPolyIn2;
5541 var RingOut = /* @__PURE__ */ function() {
5542 _createClass(RingOut2, null, [{
5544 /* Given the segments from the sweep line pass, compute & return a series
5545 * of closed rings from all the segments marked to be part of the result */
5546 value: function factory(allSegments) {
5548 for (var i3 = 0, iMax = allSegments.length; i3 < iMax; i3++) {
5549 var segment = allSegments[i3];
5550 if (!segment.isInResult() || segment.ringOut)
5552 var prevEvent = null;
5553 var event = segment.leftSE;
5554 var nextEvent = segment.rightSE;
5555 var events = [event];
5556 var startingPoint = event.point;
5557 var intersectionLEs = [];
5562 if (event.point === startingPoint)
5565 var availableLEs = event.getAvailableLinkedEvents();
5566 if (availableLEs.length === 0) {
5567 var firstPt = events[0].point;
5568 var lastPt = events[events.length - 1].point;
5569 throw new Error("Unable to complete output ring starting at [".concat(firstPt.x, ",") + " ".concat(firstPt.y, "]. Last matching segment found ends at") + " [".concat(lastPt.x, ", ").concat(lastPt.y, "]."));
5571 if (availableLEs.length === 1) {
5572 nextEvent = availableLEs[0].otherSE;
5576 for (var j3 = 0, jMax = intersectionLEs.length; j3 < jMax; j3++) {
5577 if (intersectionLEs[j3].point === event.point) {
5582 if (indexLE !== null) {
5583 var intersectionLE = intersectionLEs.splice(indexLE)[0];
5584 var ringEvents = events.splice(intersectionLE.index);
5585 ringEvents.unshift(ringEvents[0].otherSE);
5586 ringsOut.push(new RingOut2(ringEvents.reverse()));
5589 intersectionLEs.push({
5590 index: events.length,
5593 var comparator = event.getLeftmostComparator(prevEvent);
5594 nextEvent = availableLEs.sort(comparator)[0].otherSE;
5598 ringsOut.push(new RingOut2(events));
5603 function RingOut2(events) {
5604 _classCallCheck(this, RingOut2);
5605 this.events = events;
5606 for (var i3 = 0, iMax = events.length; i3 < iMax; i3++) {
5607 events[i3].segment.ringOut = this;
5611 _createClass(RingOut2, [{
5613 value: function getGeom2() {
5614 var prevPt = this.events[0].point;
5615 var points = [prevPt];
5616 for (var i3 = 1, iMax = this.events.length - 1; i3 < iMax; i3++) {
5617 var _pt = this.events[i3].point;
5618 var _nextPt = this.events[i3 + 1].point;
5619 if (compareVectorAngles(_pt, prevPt, _nextPt) === 0)
5624 if (points.length === 1)
5626 var pt2 = points[0];
5627 var nextPt = points[1];
5628 if (compareVectorAngles(pt2, prevPt, nextPt) === 0)
5630 points.push(points[0]);
5631 var step = this.isExteriorRing() ? 1 : -1;
5632 var iStart = this.isExteriorRing() ? 0 : points.length - 1;
5633 var iEnd = this.isExteriorRing() ? points.length : -1;
5634 var orderedPoints = [];
5635 for (var _i = iStart; _i != iEnd; _i += step) {
5636 orderedPoints.push([points[_i].x, points[_i].y]);
5638 return orderedPoints;
5641 key: "isExteriorRing",
5642 value: function isExteriorRing() {
5643 if (this._isExteriorRing === void 0) {
5644 var enclosing = this.enclosingRing();
5645 this._isExteriorRing = enclosing ? !enclosing.isExteriorRing() : true;
5647 return this._isExteriorRing;
5650 key: "enclosingRing",
5651 value: function enclosingRing() {
5652 if (this._enclosingRing === void 0) {
5653 this._enclosingRing = this._calcEnclosingRing();
5655 return this._enclosingRing;
5657 /* Returns the ring that encloses this one, if any */
5659 key: "_calcEnclosingRing",
5660 value: function _calcEnclosingRing() {
5661 var leftMostEvt = this.events[0];
5662 for (var i3 = 1, iMax = this.events.length; i3 < iMax; i3++) {
5663 var evt = this.events[i3];
5664 if (SweepEvent.compare(leftMostEvt, evt) > 0)
5667 var prevSeg = leftMostEvt.segment.prevInResult();
5668 var prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
5673 return prevSeg.ringOut;
5674 if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
5675 if (prevPrevSeg.ringOut.enclosingRing() !== prevSeg.ringOut) {
5676 return prevSeg.ringOut;
5678 return prevSeg.ringOut.enclosingRing();
5680 prevSeg = prevPrevSeg.prevInResult();
5681 prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
5687 var PolyOut = /* @__PURE__ */ function() {
5688 function PolyOut2(exteriorRing) {
5689 _classCallCheck(this, PolyOut2);
5690 this.exteriorRing = exteriorRing;
5691 exteriorRing.poly = this;
5692 this.interiorRings = [];
5694 _createClass(PolyOut2, [{
5696 value: function addInterior(ring) {
5697 this.interiorRings.push(ring);
5702 value: function getGeom2() {
5703 var geom = [this.exteriorRing.getGeom()];
5704 if (geom[0] === null)
5706 for (var i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
5707 var ringGeom = this.interiorRings[i3].getGeom();
5708 if (ringGeom === null)
5710 geom.push(ringGeom);
5717 var MultiPolyOut = /* @__PURE__ */ function() {
5718 function MultiPolyOut2(rings) {
5719 _classCallCheck(this, MultiPolyOut2);
5721 this.polys = this._composePolys(rings);
5723 _createClass(MultiPolyOut2, [{
5725 value: function getGeom2() {
5727 for (var i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
5728 var polyGeom = this.polys[i3].getGeom();
5729 if (polyGeom === null)
5731 geom.push(polyGeom);
5736 key: "_composePolys",
5737 value: function _composePolys(rings) {
5739 for (var i3 = 0, iMax = rings.length; i3 < iMax; i3++) {
5740 var ring = rings[i3];
5743 if (ring.isExteriorRing())
5744 polys.push(new PolyOut(ring));
5746 var enclosingRing = ring.enclosingRing();
5747 if (!enclosingRing.poly)
5748 polys.push(new PolyOut(enclosingRing));
5749 enclosingRing.poly.addInterior(ring);
5755 return MultiPolyOut2;
5757 var SweepLine = /* @__PURE__ */ function() {
5758 function SweepLine2(queue) {
5759 var comparator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Segment.compare;
5760 _classCallCheck(this, SweepLine2);
5762 this.tree = new Tree(comparator);
5765 _createClass(SweepLine2, [{
5767 value: function process2(event) {
5768 var segment = event.segment;
5770 if (event.consumedBy) {
5772 this.queue.remove(event.otherSE);
5774 this.tree.remove(segment);
5777 var node = event.isLeft ? this.tree.insert(segment) : this.tree.find(segment);
5779 throw new Error("Unable to find segment #".concat(segment.id, " ") + "[".concat(segment.leftSE.point.x, ", ").concat(segment.leftSE.point.y, "] -> ") + "[".concat(segment.rightSE.point.x, ", ").concat(segment.rightSE.point.y, "] ") + "in SweepLine tree. Please submit a bug report.");
5780 var prevNode = node;
5781 var nextNode = node;
5782 var prevSeg = void 0;
5783 var nextSeg = void 0;
5784 while (prevSeg === void 0) {
5785 prevNode = this.tree.prev(prevNode);
5786 if (prevNode === null)
5788 else if (prevNode.key.consumedBy === void 0)
5789 prevSeg = prevNode.key;
5791 while (nextSeg === void 0) {
5792 nextNode = this.tree.next(nextNode);
5793 if (nextNode === null)
5795 else if (nextNode.key.consumedBy === void 0)
5796 nextSeg = nextNode.key;
5799 var prevMySplitter = null;
5801 var prevInter = prevSeg.getIntersection(segment);
5802 if (prevInter !== null) {
5803 if (!segment.isAnEndpoint(prevInter))
5804 prevMySplitter = prevInter;
5805 if (!prevSeg.isAnEndpoint(prevInter)) {
5806 var newEventsFromSplit = this._splitSafely(prevSeg, prevInter);
5807 for (var i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
5808 newEvents.push(newEventsFromSplit[i3]);
5813 var nextMySplitter = null;
5815 var nextInter = nextSeg.getIntersection(segment);
5816 if (nextInter !== null) {
5817 if (!segment.isAnEndpoint(nextInter))
5818 nextMySplitter = nextInter;
5819 if (!nextSeg.isAnEndpoint(nextInter)) {
5820 var _newEventsFromSplit = this._splitSafely(nextSeg, nextInter);
5821 for (var _i = 0, _iMax = _newEventsFromSplit.length; _i < _iMax; _i++) {
5822 newEvents.push(_newEventsFromSplit[_i]);
5827 if (prevMySplitter !== null || nextMySplitter !== null) {
5828 var mySplitter = null;
5829 if (prevMySplitter === null)
5830 mySplitter = nextMySplitter;
5831 else if (nextMySplitter === null)
5832 mySplitter = prevMySplitter;
5834 var cmpSplitters = SweepEvent.comparePoints(prevMySplitter, nextMySplitter);
5835 mySplitter = cmpSplitters <= 0 ? prevMySplitter : nextMySplitter;
5837 this.queue.remove(segment.rightSE);
5838 newEvents.push(segment.rightSE);
5839 var _newEventsFromSplit2 = segment.split(mySplitter);
5840 for (var _i2 = 0, _iMax2 = _newEventsFromSplit2.length; _i2 < _iMax2; _i2++) {
5841 newEvents.push(_newEventsFromSplit2[_i2]);
5844 if (newEvents.length > 0) {
5845 this.tree.remove(segment);
5846 newEvents.push(event);
5848 this.segments.push(segment);
5849 segment.prev = prevSeg;
5852 if (prevSeg && nextSeg) {
5853 var inter = prevSeg.getIntersection(nextSeg);
5854 if (inter !== null) {
5855 if (!prevSeg.isAnEndpoint(inter)) {
5856 var _newEventsFromSplit3 = this._splitSafely(prevSeg, inter);
5857 for (var _i3 = 0, _iMax3 = _newEventsFromSplit3.length; _i3 < _iMax3; _i3++) {
5858 newEvents.push(_newEventsFromSplit3[_i3]);
5861 if (!nextSeg.isAnEndpoint(inter)) {
5862 var _newEventsFromSplit4 = this._splitSafely(nextSeg, inter);
5863 for (var _i4 = 0, _iMax4 = _newEventsFromSplit4.length; _i4 < _iMax4; _i4++) {
5864 newEvents.push(_newEventsFromSplit4[_i4]);
5869 this.tree.remove(segment);
5873 /* Safely split a segment that is currently in the datastructures
5874 * IE - a segment other than the one that is currently being processed. */
5876 key: "_splitSafely",
5877 value: function _splitSafely(seg, pt2) {
5878 this.tree.remove(seg);
5879 var rightSE = seg.rightSE;
5880 this.queue.remove(rightSE);
5881 var newEvents = seg.split(pt2);
5882 newEvents.push(rightSE);
5883 if (seg.consumedBy === void 0)
5884 this.tree.insert(seg);
5890 var POLYGON_CLIPPING_MAX_QUEUE_SIZE = typeof process !== "undefined" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6;
5891 var POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS = typeof process !== "undefined" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
5892 var Operation = /* @__PURE__ */ function() {
5893 function Operation2() {
5894 _classCallCheck(this, Operation2);
5896 _createClass(Operation2, [{
5898 value: function run(type2, geom, moreGeoms) {
5899 operation.type = type2;
5901 var multipolys = [new MultiPolyIn(geom, true)];
5902 for (var i3 = 0, iMax = moreGeoms.length; i3 < iMax; i3++) {
5903 multipolys.push(new MultiPolyIn(moreGeoms[i3], false));
5905 operation.numMultiPolys = multipolys.length;
5906 if (operation.type === "difference") {
5907 var subject = multipolys[0];
5909 while (_i < multipolys.length) {
5910 if (getBboxOverlap(multipolys[_i].bbox, subject.bbox) !== null)
5913 multipolys.splice(_i, 1);
5916 if (operation.type === "intersection") {
5917 for (var _i2 = 0, _iMax = multipolys.length; _i2 < _iMax; _i2++) {
5918 var mpA = multipolys[_i2];
5919 for (var j3 = _i2 + 1, jMax = multipolys.length; j3 < jMax; j3++) {
5920 if (getBboxOverlap(mpA.bbox, multipolys[j3].bbox) === null)
5925 var queue = new Tree(SweepEvent.compare);
5926 for (var _i3 = 0, _iMax2 = multipolys.length; _i3 < _iMax2; _i3++) {
5927 var sweepEvents = multipolys[_i3].getSweepEvents();
5928 for (var _j = 0, _jMax = sweepEvents.length; _j < _jMax; _j++) {
5929 queue.insert(sweepEvents[_j]);
5930 if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
5931 throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");
5935 var sweepLine = new SweepLine(queue);
5936 var prevQueueSize = queue.size;
5937 var node = queue.pop();
5940 if (queue.size === prevQueueSize) {
5941 var seg = evt.segment;
5942 throw new Error("Unable to pop() ".concat(evt.isLeft ? "left" : "right", " SweepEvent ") + "[".concat(evt.point.x, ", ").concat(evt.point.y, "] from segment #").concat(seg.id, " ") + "[".concat(seg.leftSE.point.x, ", ").concat(seg.leftSE.point.y, "] -> ") + "[".concat(seg.rightSE.point.x, ", ").concat(seg.rightSE.point.y, "] from queue. ") + "Please file a bug report.");
5944 if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
5945 throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");
5947 if (sweepLine.segments.length > POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS) {
5948 throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");
5950 var newEvents = sweepLine.process(evt);
5951 for (var _i4 = 0, _iMax3 = newEvents.length; _i4 < _iMax3; _i4++) {
5952 var _evt = newEvents[_i4];
5953 if (_evt.consumedBy === void 0)
5956 prevQueueSize = queue.size;
5960 var ringsOut = RingOut.factory(sweepLine.segments);
5961 var result = new MultiPolyOut(ringsOut);
5962 return result.getGeom();
5967 var operation = new Operation();
5968 var union = function union2(geom) {
5969 for (var _len = arguments.length, moreGeoms = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5970 moreGeoms[_key - 1] = arguments[_key];
5972 return operation.run("union", geom, moreGeoms);
5974 var intersection$1 = function intersection2(geom) {
5975 for (var _len2 = arguments.length, moreGeoms = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
5976 moreGeoms[_key2 - 1] = arguments[_key2];
5978 return operation.run("intersection", geom, moreGeoms);
5980 var xor = function xor2(geom) {
5981 for (var _len3 = arguments.length, moreGeoms = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
5982 moreGeoms[_key3 - 1] = arguments[_key3];
5984 return operation.run("xor", geom, moreGeoms);
5986 var difference = function difference2(subjectGeom) {
5987 for (var _len4 = arguments.length, clippingGeoms = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
5988 clippingGeoms[_key4 - 1] = arguments[_key4];
5990 return operation.run("difference", subjectGeom, clippingGeoms);
5994 intersection: intersection$1,
6003 // node_modules/geojson-precision/index.js
6004 var require_geojson_precision = __commonJS({
6005 "node_modules/geojson-precision/index.js"(exports2, module2) {
6007 function parse(t2, coordinatePrecision, extrasPrecision) {
6008 function point2(p2) {
6009 return p2.map(function(e3, index) {
6011 return 1 * e3.toFixed(coordinatePrecision);
6013 return 1 * e3.toFixed(extrasPrecision);
6017 function multi(l2) {
6018 return l2.map(point2);
6021 return p2.map(multi);
6023 function multiPoly(m2) {
6024 return m2.map(poly);
6026 function geometry(obj) {
6032 obj.coordinates = point2(obj.coordinates);
6036 obj.coordinates = multi(obj.coordinates);
6039 case "MultiLineString":
6040 obj.coordinates = poly(obj.coordinates);
6042 case "MultiPolygon":
6043 obj.coordinates = multiPoly(obj.coordinates);
6045 case "GeometryCollection":
6046 obj.geometries = obj.geometries.map(geometry);
6052 function feature3(obj) {
6053 obj.geometry = geometry(obj.geometry);
6056 function featureCollection(f3) {
6057 f3.features = f3.features.map(feature3);
6060 function geometryCollection(g3) {
6061 g3.geometries = g3.geometries.map(geometry);
6069 return feature3(t2);
6070 case "GeometryCollection":
6071 return geometryCollection(t2);
6072 case "FeatureCollection":
6073 return featureCollection(t2);
6078 case "MultiPolygon":
6079 case "MultiLineString":
6080 return geometry(t2);
6085 module2.exports = parse;
6086 module2.exports.parse = parse;
6091 // node_modules/@aitodotai/json-stringify-pretty-compact/index.js
6092 var require_json_stringify_pretty_compact = __commonJS({
6093 "node_modules/@aitodotai/json-stringify-pretty-compact/index.js"(exports2, module2) {
6094 function isObject3(obj) {
6095 return typeof obj === "object" && obj !== null;
6097 function forEach(obj, cb) {
6098 if (Array.isArray(obj)) {
6100 } else if (isObject3(obj)) {
6101 Object.keys(obj).forEach(function(key) {
6107 function getTreeDepth(obj) {
6109 if (Array.isArray(obj) || isObject3(obj)) {
6110 forEach(obj, function(val) {
6111 if (Array.isArray(val) || isObject3(val)) {
6112 var tmpDepth = getTreeDepth(val);
6113 if (tmpDepth > depth) {
6122 function stringify3(obj, options2) {
6123 options2 = options2 || {};
6124 var indent2 = JSON.stringify([1], null, get4(options2, "indent", 2)).slice(2, -3);
6125 var addMargin = get4(options2, "margins", false);
6126 var addArrayMargin = get4(options2, "arrayMargins", false);
6127 var addObjectMargin = get4(options2, "objectMargins", false);
6128 var maxLength = indent2 === "" ? Infinity : get4(options2, "maxLength", 80);
6129 var maxNesting = get4(options2, "maxNesting", Infinity);
6130 return function _stringify(obj2, currentIndent, reserved) {
6131 if (obj2 && typeof obj2.toJSON === "function") {
6132 obj2 = obj2.toJSON();
6134 var string = JSON.stringify(obj2);
6135 if (string === void 0) {
6138 var length = maxLength - currentIndent.length - reserved;
6139 var treeDepth = getTreeDepth(obj2);
6140 if (treeDepth <= maxNesting && string.length <= length) {
6141 var prettified = prettify(string, {
6146 if (prettified.length <= length) {
6150 if (isObject3(obj2)) {
6151 var nextIndent = currentIndent + indent2;
6154 var comma = function(array2, index2) {
6155 return index2 === array2.length - 1 ? 0 : 1;
6157 if (Array.isArray(obj2)) {
6158 for (var index = 0; index < obj2.length; index++) {
6160 _stringify(obj2[index], nextIndent, comma(obj2, index)) || "null"
6165 Object.keys(obj2).forEach(function(key, index2, array2) {
6166 var keyPart = JSON.stringify(key) + ": ";
6167 var value = _stringify(
6170 keyPart.length + comma(array2, index2)
6172 if (value !== void 0) {
6173 items.push(keyPart + value);
6178 if (items.length > 0) {
6181 indent2 + items.join(",\n" + nextIndent),
6183 ].join("\n" + currentIndent);
6189 var stringOrChar = /("(?:[^\\"]|\\.)*")|[:,\][}{]/g;
6190 function prettify(string, options2) {
6191 options2 = options2 || {};
6200 if (options2.addMargin || options2.addObjectMargin) {
6204 if (options2.addMargin || options2.addArrayMargin) {
6208 return string.replace(stringOrChar, function(match, string2) {
6209 return string2 ? match : tokens[match];
6212 function get4(options2, name, defaultValue) {
6213 return name in options2 ? options2[name] : defaultValue;
6215 module2.exports = stringify3;
6219 // node_modules/aes-js/index.js
6220 var require_aes_js = __commonJS({
6221 "node_modules/aes-js/index.js"(exports2, module2) {
6224 function checkInt(value) {
6225 return parseInt(value) === value;
6227 function checkInts(arrayish) {
6228 if (!checkInt(arrayish.length)) {
6231 for (var i3 = 0; i3 < arrayish.length; i3++) {
6232 if (!checkInt(arrayish[i3]) || arrayish[i3] < 0 || arrayish[i3] > 255) {
6238 function coerceArray(arg, copy2) {
6239 if (arg.buffer && arg.name === "Uint8Array") {
6244 arg = Array.prototype.slice.call(arg);
6249 if (Array.isArray(arg)) {
6250 if (!checkInts(arg)) {
6251 throw new Error("Array contains invalid value: " + arg);
6253 return new Uint8Array(arg);
6255 if (checkInt(arg.length) && checkInts(arg)) {
6256 return new Uint8Array(arg);
6258 throw new Error("unsupported array-like object");
6260 function createArray(length) {
6261 return new Uint8Array(length);
6263 function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {
6264 if (sourceStart != null || sourceEnd != null) {
6265 if (sourceArray.slice) {
6266 sourceArray = sourceArray.slice(sourceStart, sourceEnd);
6268 sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);
6271 targetArray.set(sourceArray, targetStart);
6273 var convertUtf8 = function() {
6274 function toBytes(text2) {
6275 var result = [], i3 = 0;
6276 text2 = encodeURI(text2);
6277 while (i3 < text2.length) {
6278 var c2 = text2.charCodeAt(i3++);
6280 result.push(parseInt(text2.substr(i3, 2), 16));
6286 return coerceArray(result);
6288 function fromBytes(bytes) {
6289 var result = [], i3 = 0;
6290 while (i3 < bytes.length) {
6293 result.push(String.fromCharCode(c2));
6295 } else if (c2 > 191 && c2 < 224) {
6296 result.push(String.fromCharCode((c2 & 31) << 6 | bytes[i3 + 1] & 63));
6299 result.push(String.fromCharCode((c2 & 15) << 12 | (bytes[i3 + 1] & 63) << 6 | bytes[i3 + 2] & 63));
6303 return result.join("");
6310 var convertHex = function() {
6311 function toBytes(text2) {
6313 for (var i3 = 0; i3 < text2.length; i3 += 2) {
6314 result.push(parseInt(text2.substr(i3, 2), 16));
6318 var Hex = "0123456789abcdef";
6319 function fromBytes(bytes) {
6321 for (var i3 = 0; i3 < bytes.length; i3++) {
6323 result.push(Hex[(v2 & 240) >> 4] + Hex[v2 & 15]);
6325 return result.join("");
6332 var numberOfRounds = { 16: 10, 24: 12, 32: 14 };
6333 var rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145];
6334 var S2 = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22];
6335 var Si = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125];
6336 var T1 = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986];
6337 var T2 = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766];
6338 var T3 = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126];
6339 var T4 = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436];
6340 var T5 = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890];
6341 var T6 = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935];
6342 var T7 = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600];
6343 var T8 = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480];
6344 var U1 = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795];
6345 var U2 = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855];
6346 var U3 = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150];
6347 var U4 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
6348 function convertToInt32(bytes) {
6350 for (var i3 = 0; i3 < bytes.length; i3 += 4) {
6352 bytes[i3] << 24 | bytes[i3 + 1] << 16 | bytes[i3 + 2] << 8 | bytes[i3 + 3]
6357 var AES = function(key) {
6358 if (!(this instanceof AES)) {
6359 throw Error("AES must be instanitated with `new`");
6361 Object.defineProperty(this, "key", {
6362 value: coerceArray(key, true)
6366 AES.prototype._prepare = function() {
6367 var rounds = numberOfRounds[this.key.length];
6368 if (rounds == null) {
6369 throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
6373 for (var i3 = 0; i3 <= rounds; i3++) {
6374 this._Ke.push([0, 0, 0, 0]);
6375 this._Kd.push([0, 0, 0, 0]);
6377 var roundKeyCount = (rounds + 1) * 4;
6378 var KC = this.key.length / 4;
6379 var tk = convertToInt32(this.key);
6381 for (var i3 = 0; i3 < KC; i3++) {
6383 this._Ke[index][i3 % 4] = tk[i3];
6384 this._Kd[rounds - index][i3 % 4] = tk[i3];
6386 var rconpointer = 0;
6388 while (t2 < roundKeyCount) {
6390 tk[0] ^= S2[tt2 >> 16 & 255] << 24 ^ S2[tt2 >> 8 & 255] << 16 ^ S2[tt2 & 255] << 8 ^ S2[tt2 >> 24 & 255] ^ rcon[rconpointer] << 24;
6393 for (var i3 = 1; i3 < KC; i3++) {
6394 tk[i3] ^= tk[i3 - 1];
6397 for (var i3 = 1; i3 < KC / 2; i3++) {
6398 tk[i3] ^= tk[i3 - 1];
6400 tt2 = tk[KC / 2 - 1];
6401 tk[KC / 2] ^= S2[tt2 & 255] ^ S2[tt2 >> 8 & 255] << 8 ^ S2[tt2 >> 16 & 255] << 16 ^ S2[tt2 >> 24 & 255] << 24;
6402 for (var i3 = KC / 2 + 1; i3 < KC; i3++) {
6403 tk[i3] ^= tk[i3 - 1];
6407 while (i3 < KC && t2 < roundKeyCount) {
6410 this._Ke[r2][c2] = tk[i3];
6411 this._Kd[rounds - r2][c2] = tk[i3++];
6415 for (var r2 = 1; r2 < rounds; r2++) {
6416 for (var c2 = 0; c2 < 4; c2++) {
6417 tt2 = this._Kd[r2][c2];
6418 this._Kd[r2][c2] = U1[tt2 >> 24 & 255] ^ U2[tt2 >> 16 & 255] ^ U3[tt2 >> 8 & 255] ^ U4[tt2 & 255];
6422 AES.prototype.encrypt = function(plaintext) {
6423 if (plaintext.length != 16) {
6424 throw new Error("invalid plaintext size (must be 16 bytes)");
6426 var rounds = this._Ke.length - 1;
6427 var a2 = [0, 0, 0, 0];
6428 var t2 = convertToInt32(plaintext);
6429 for (var i3 = 0; i3 < 4; i3++) {
6430 t2[i3] ^= this._Ke[0][i3];
6432 for (var r2 = 1; r2 < rounds; r2++) {
6433 for (var i3 = 0; i3 < 4; i3++) {
6434 a2[i3] = T1[t2[i3] >> 24 & 255] ^ T2[t2[(i3 + 1) % 4] >> 16 & 255] ^ T3[t2[(i3 + 2) % 4] >> 8 & 255] ^ T4[t2[(i3 + 3) % 4] & 255] ^ this._Ke[r2][i3];
6438 var result = createArray(16), tt2;
6439 for (var i3 = 0; i3 < 4; i3++) {
6440 tt2 = this._Ke[rounds][i3];
6441 result[4 * i3] = (S2[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255;
6442 result[4 * i3 + 1] = (S2[t2[(i3 + 1) % 4] >> 16 & 255] ^ tt2 >> 16) & 255;
6443 result[4 * i3 + 2] = (S2[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255;
6444 result[4 * i3 + 3] = (S2[t2[(i3 + 3) % 4] & 255] ^ tt2) & 255;
6448 AES.prototype.decrypt = function(ciphertext) {
6449 if (ciphertext.length != 16) {
6450 throw new Error("invalid ciphertext size (must be 16 bytes)");
6452 var rounds = this._Kd.length - 1;
6453 var a2 = [0, 0, 0, 0];
6454 var t2 = convertToInt32(ciphertext);
6455 for (var i3 = 0; i3 < 4; i3++) {
6456 t2[i3] ^= this._Kd[0][i3];
6458 for (var r2 = 1; r2 < rounds; r2++) {
6459 for (var i3 = 0; i3 < 4; i3++) {
6460 a2[i3] = T5[t2[i3] >> 24 & 255] ^ T6[t2[(i3 + 3) % 4] >> 16 & 255] ^ T7[t2[(i3 + 2) % 4] >> 8 & 255] ^ T8[t2[(i3 + 1) % 4] & 255] ^ this._Kd[r2][i3];
6464 var result = createArray(16), tt2;
6465 for (var i3 = 0; i3 < 4; i3++) {
6466 tt2 = this._Kd[rounds][i3];
6467 result[4 * i3] = (Si[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255;
6468 result[4 * i3 + 1] = (Si[t2[(i3 + 3) % 4] >> 16 & 255] ^ tt2 >> 16) & 255;
6469 result[4 * i3 + 2] = (Si[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255;
6470 result[4 * i3 + 3] = (Si[t2[(i3 + 1) % 4] & 255] ^ tt2) & 255;
6474 var ModeOfOperationECB = function(key) {
6475 if (!(this instanceof ModeOfOperationECB)) {
6476 throw Error("AES must be instanitated with `new`");
6478 this.description = "Electronic Code Block";
6480 this._aes = new AES(key);
6482 ModeOfOperationECB.prototype.encrypt = function(plaintext) {
6483 plaintext = coerceArray(plaintext);
6484 if (plaintext.length % 16 !== 0) {
6485 throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
6487 var ciphertext = createArray(plaintext.length);
6488 var block2 = createArray(16);
6489 for (var i3 = 0; i3 < plaintext.length; i3 += 16) {
6490 copyArray(plaintext, block2, 0, i3, i3 + 16);
6491 block2 = this._aes.encrypt(block2);
6492 copyArray(block2, ciphertext, i3);
6496 ModeOfOperationECB.prototype.decrypt = function(ciphertext) {
6497 ciphertext = coerceArray(ciphertext);
6498 if (ciphertext.length % 16 !== 0) {
6499 throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
6501 var plaintext = createArray(ciphertext.length);
6502 var block2 = createArray(16);
6503 for (var i3 = 0; i3 < ciphertext.length; i3 += 16) {
6504 copyArray(ciphertext, block2, 0, i3, i3 + 16);
6505 block2 = this._aes.decrypt(block2);
6506 copyArray(block2, plaintext, i3);
6510 var ModeOfOperationCBC = function(key, iv) {
6511 if (!(this instanceof ModeOfOperationCBC)) {
6512 throw Error("AES must be instanitated with `new`");
6514 this.description = "Cipher Block Chaining";
6517 iv = createArray(16);
6518 } else if (iv.length != 16) {
6519 throw new Error("invalid initialation vector size (must be 16 bytes)");
6521 this._lastCipherblock = coerceArray(iv, true);
6522 this._aes = new AES(key);
6524 ModeOfOperationCBC.prototype.encrypt = function(plaintext) {
6525 plaintext = coerceArray(plaintext);
6526 if (plaintext.length % 16 !== 0) {
6527 throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
6529 var ciphertext = createArray(plaintext.length);
6530 var block2 = createArray(16);
6531 for (var i3 = 0; i3 < plaintext.length; i3 += 16) {
6532 copyArray(plaintext, block2, 0, i3, i3 + 16);
6533 for (var j3 = 0; j3 < 16; j3++) {
6534 block2[j3] ^= this._lastCipherblock[j3];
6536 this._lastCipherblock = this._aes.encrypt(block2);
6537 copyArray(this._lastCipherblock, ciphertext, i3);
6541 ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {
6542 ciphertext = coerceArray(ciphertext);
6543 if (ciphertext.length % 16 !== 0) {
6544 throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
6546 var plaintext = createArray(ciphertext.length);
6547 var block2 = createArray(16);
6548 for (var i3 = 0; i3 < ciphertext.length; i3 += 16) {
6549 copyArray(ciphertext, block2, 0, i3, i3 + 16);
6550 block2 = this._aes.decrypt(block2);
6551 for (var j3 = 0; j3 < 16; j3++) {
6552 plaintext[i3 + j3] = block2[j3] ^ this._lastCipherblock[j3];
6554 copyArray(ciphertext, this._lastCipherblock, 0, i3, i3 + 16);
6558 var ModeOfOperationCFB = function(key, iv, segmentSize) {
6559 if (!(this instanceof ModeOfOperationCFB)) {
6560 throw Error("AES must be instanitated with `new`");
6562 this.description = "Cipher Feedback";
6565 iv = createArray(16);
6566 } else if (iv.length != 16) {
6567 throw new Error("invalid initialation vector size (must be 16 size)");
6572 this.segmentSize = segmentSize;
6573 this._shiftRegister = coerceArray(iv, true);
6574 this._aes = new AES(key);
6576 ModeOfOperationCFB.prototype.encrypt = function(plaintext) {
6577 if (plaintext.length % this.segmentSize != 0) {
6578 throw new Error("invalid plaintext size (must be segmentSize bytes)");
6580 var encrypted = coerceArray(plaintext, true);
6582 for (var i3 = 0; i3 < encrypted.length; i3 += this.segmentSize) {
6583 xorSegment = this._aes.encrypt(this._shiftRegister);
6584 for (var j3 = 0; j3 < this.segmentSize; j3++) {
6585 encrypted[i3 + j3] ^= xorSegment[j3];
6587 copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
6588 copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i3, i3 + this.segmentSize);
6592 ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {
6593 if (ciphertext.length % this.segmentSize != 0) {
6594 throw new Error("invalid ciphertext size (must be segmentSize bytes)");
6596 var plaintext = coerceArray(ciphertext, true);
6598 for (var i3 = 0; i3 < plaintext.length; i3 += this.segmentSize) {
6599 xorSegment = this._aes.encrypt(this._shiftRegister);
6600 for (var j3 = 0; j3 < this.segmentSize; j3++) {
6601 plaintext[i3 + j3] ^= xorSegment[j3];
6603 copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
6604 copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i3, i3 + this.segmentSize);
6608 var ModeOfOperationOFB = function(key, iv) {
6609 if (!(this instanceof ModeOfOperationOFB)) {
6610 throw Error("AES must be instanitated with `new`");
6612 this.description = "Output Feedback";
6615 iv = createArray(16);
6616 } else if (iv.length != 16) {
6617 throw new Error("invalid initialation vector size (must be 16 bytes)");
6619 this._lastPrecipher = coerceArray(iv, true);
6620 this._lastPrecipherIndex = 16;
6621 this._aes = new AES(key);
6623 ModeOfOperationOFB.prototype.encrypt = function(plaintext) {
6624 var encrypted = coerceArray(plaintext, true);
6625 for (var i3 = 0; i3 < encrypted.length; i3++) {
6626 if (this._lastPrecipherIndex === 16) {
6627 this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);
6628 this._lastPrecipherIndex = 0;
6630 encrypted[i3] ^= this._lastPrecipher[this._lastPrecipherIndex++];
6634 ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;
6635 var Counter = function(initialValue) {
6636 if (!(this instanceof Counter)) {
6637 throw Error("Counter must be instanitated with `new`");
6639 if (initialValue !== 0 && !initialValue) {
6642 if (typeof initialValue === "number") {
6643 this._counter = createArray(16);
6644 this.setValue(initialValue);
6646 this.setBytes(initialValue);
6649 Counter.prototype.setValue = function(value) {
6650 if (typeof value !== "number" || parseInt(value) != value) {
6651 throw new Error("invalid counter value (must be an integer)");
6653 if (value > Number.MAX_SAFE_INTEGER) {
6654 throw new Error("integer value out of safe range");
6656 for (var index = 15; index >= 0; --index) {
6657 this._counter[index] = value % 256;
6658 value = parseInt(value / 256);
6661 Counter.prototype.setBytes = function(bytes) {
6662 bytes = coerceArray(bytes, true);
6663 if (bytes.length != 16) {
6664 throw new Error("invalid counter bytes size (must be 16 bytes)");
6666 this._counter = bytes;
6668 Counter.prototype.increment = function() {
6669 for (var i3 = 15; i3 >= 0; i3--) {
6670 if (this._counter[i3] === 255) {
6671 this._counter[i3] = 0;
6673 this._counter[i3]++;
6678 var ModeOfOperationCTR = function(key, counter) {
6679 if (!(this instanceof ModeOfOperationCTR)) {
6680 throw Error("AES must be instanitated with `new`");
6682 this.description = "Counter";
6684 if (!(counter instanceof Counter)) {
6685 counter = new Counter(counter);
6687 this._counter = counter;
6688 this._remainingCounter = null;
6689 this._remainingCounterIndex = 16;
6690 this._aes = new AES(key);
6692 ModeOfOperationCTR.prototype.encrypt = function(plaintext) {
6693 var encrypted = coerceArray(plaintext, true);
6694 for (var i3 = 0; i3 < encrypted.length; i3++) {
6695 if (this._remainingCounterIndex === 16) {
6696 this._remainingCounter = this._aes.encrypt(this._counter._counter);
6697 this._remainingCounterIndex = 0;
6698 this._counter.increment();
6700 encrypted[i3] ^= this._remainingCounter[this._remainingCounterIndex++];
6704 ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;
6705 function pkcs7pad(data) {
6706 data = coerceArray(data, true);
6707 var padder = 16 - data.length % 16;
6708 var result = createArray(data.length + padder);
6709 copyArray(data, result);
6710 for (var i3 = data.length; i3 < result.length; i3++) {
6711 result[i3] = padder;
6715 function pkcs7strip(data) {
6716 data = coerceArray(data, true);
6717 if (data.length < 16) {
6718 throw new Error("PKCS#7 invalid length");
6720 var padder = data[data.length - 1];
6722 throw new Error("PKCS#7 padding byte out of range");
6724 var length = data.length - padder;
6725 for (var i3 = 0; i3 < padder; i3++) {
6726 if (data[length + i3] !== padder) {
6727 throw new Error("PKCS#7 invalid padding byte");
6730 var result = createArray(length);
6731 copyArray(data, result, 0, 0, length);
6738 ecb: ModeOfOperationECB,
6739 cbc: ModeOfOperationCBC,
6740 cfb: ModeOfOperationCFB,
6741 ofb: ModeOfOperationOFB,
6742 ctr: ModeOfOperationCTR
6760 if (typeof exports2 !== "undefined") {
6761 module2.exports = aesjs2;
6762 } else if (typeof define === "function" && define.amd) {
6763 define([], function() {
6768 aesjs2._aesjs = root3.aesjs;
6770 root3.aesjs = aesjs2;
6776 // node_modules/lodash/lodash.js
6777 var require_lodash = __commonJS({
6778 "node_modules/lodash/lodash.js"(exports2, module2) {
6781 var VERSION = "4.17.21";
6782 var LARGE_ARRAY_SIZE2 = 200;
6783 var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT3 = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
6784 var HASH_UNDEFINED4 = "__lodash_hash_undefined__";
6785 var MAX_MEMOIZE_SIZE = 500;
6786 var PLACEHOLDER = "__lodash_placeholder__";
6787 var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
6788 var COMPARE_PARTIAL_FLAG5 = 1, COMPARE_UNORDERED_FLAG3 = 2;
6789 var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
6790 var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
6791 var HOT_COUNT = 800, HOT_SPAN = 16;
6792 var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
6793 var INFINITY2 = 1 / 0, MAX_SAFE_INTEGER3 = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN2 = 0 / 0;
6794 var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
6796 ["ary", WRAP_ARY_FLAG],
6797 ["bind", WRAP_BIND_FLAG],
6798 ["bindKey", WRAP_BIND_KEY_FLAG],
6799 ["curry", WRAP_CURRY_FLAG],
6800 ["curryRight", WRAP_CURRY_RIGHT_FLAG],
6801 ["flip", WRAP_FLIP_FLAG],
6802 ["partial", WRAP_PARTIAL_FLAG],
6803 ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
6804 ["rearg", WRAP_REARG_FLAG]
6806 var argsTag4 = "[object Arguments]", arrayTag3 = "[object Array]", asyncTag2 = "[object AsyncFunction]", boolTag3 = "[object Boolean]", dateTag3 = "[object Date]", domExcTag = "[object DOMException]", errorTag3 = "[object Error]", funcTag3 = "[object Function]", genTag2 = "[object GeneratorFunction]", mapTag4 = "[object Map]", numberTag4 = "[object Number]", nullTag2 = "[object Null]", objectTag4 = "[object Object]", promiseTag2 = "[object Promise]", proxyTag2 = "[object Proxy]", regexpTag3 = "[object RegExp]", setTag4 = "[object Set]", stringTag3 = "[object String]", symbolTag3 = "[object Symbol]", undefinedTag2 = "[object Undefined]", weakMapTag3 = "[object WeakMap]", weakSetTag = "[object WeakSet]";
6807 var arrayBufferTag3 = "[object ArrayBuffer]", dataViewTag4 = "[object DataView]", float32Tag2 = "[object Float32Array]", float64Tag2 = "[object Float64Array]", int8Tag2 = "[object Int8Array]", int16Tag2 = "[object Int16Array]", int32Tag2 = "[object Int32Array]", uint8Tag2 = "[object Uint8Array]", uint8ClampedTag2 = "[object Uint8ClampedArray]", uint16Tag2 = "[object Uint16Array]", uint32Tag2 = "[object Uint32Array]";
6808 var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
6809 var reEscapedHtml2 = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml2 = /[&<>"']/g, reHasEscapedHtml2 = RegExp(reEscapedHtml2.source), reHasUnescapedHtml2 = RegExp(reUnescapedHtml2.source);
6810 var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
6811 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
6812 var reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar2.source);
6813 var reTrimStart2 = /^\s+/;
6814 var reWhitespace2 = /\s/;
6815 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
6816 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
6817 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
6818 var reEscapeChar = /\\(\\)?/g;
6819 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
6820 var reFlags = /\w*$/;
6821 var reIsBadHex2 = /^[-+]0x[0-9a-f]+$/i;
6822 var reIsBinary2 = /^0b[01]+$/i;
6823 var reIsHostCtor2 = /^\[object .+?Constructor\]$/;
6824 var reIsOctal2 = /^0o[0-7]+$/i;
6825 var reIsUint2 = /^(?:0|[1-9]\d*)$/;
6826 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
6827 var reNoMatch = /($^)/;
6828 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
6829 var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
6830 var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
6831 var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
6832 var reApos = RegExp(rsApos, "g");
6833 var reComboMark = RegExp(rsCombo, "g");
6834 var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
6835 var reUnicodeWord = RegExp([
6836 rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
6837 rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
6838 rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
6839 rsUpper + "+" + rsOptContrUpper,
6845 var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
6846 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
6847 var contextProps = [
6869 "Uint8ClampedArray",
6879 var templateCounter = -1;
6880 var typedArrayTags2 = {};
6881 typedArrayTags2[float32Tag2] = typedArrayTags2[float64Tag2] = typedArrayTags2[int8Tag2] = typedArrayTags2[int16Tag2] = typedArrayTags2[int32Tag2] = typedArrayTags2[uint8Tag2] = typedArrayTags2[uint8ClampedTag2] = typedArrayTags2[uint16Tag2] = typedArrayTags2[uint32Tag2] = true;
6882 typedArrayTags2[argsTag4] = typedArrayTags2[arrayTag3] = typedArrayTags2[arrayBufferTag3] = typedArrayTags2[boolTag3] = typedArrayTags2[dataViewTag4] = typedArrayTags2[dateTag3] = typedArrayTags2[errorTag3] = typedArrayTags2[funcTag3] = typedArrayTags2[mapTag4] = typedArrayTags2[numberTag4] = typedArrayTags2[objectTag4] = typedArrayTags2[regexpTag3] = typedArrayTags2[setTag4] = typedArrayTags2[stringTag3] = typedArrayTags2[weakMapTag3] = false;
6883 var cloneableTags = {};
6884 cloneableTags[argsTag4] = cloneableTags[arrayTag3] = cloneableTags[arrayBufferTag3] = cloneableTags[dataViewTag4] = cloneableTags[boolTag3] = cloneableTags[dateTag3] = cloneableTags[float32Tag2] = cloneableTags[float64Tag2] = cloneableTags[int8Tag2] = cloneableTags[int16Tag2] = cloneableTags[int32Tag2] = cloneableTags[mapTag4] = cloneableTags[numberTag4] = cloneableTags[objectTag4] = cloneableTags[regexpTag3] = cloneableTags[setTag4] = cloneableTags[stringTag3] = cloneableTags[symbolTag3] = cloneableTags[uint8Tag2] = cloneableTags[uint8ClampedTag2] = cloneableTags[uint16Tag2] = cloneableTags[uint32Tag2] = true;
6885 cloneableTags[errorTag3] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false;
6886 var deburredLetters = {
6887 // Latin-1 Supplement block.
6950 // Latin Extended-A block.
7080 var htmlEscapes2 = {
7087 var htmlUnescapes2 = {
7094 var stringEscapes = {
7102 var freeParseFloat = parseFloat, freeParseInt2 = parseInt;
7103 var freeGlobal2 = typeof global == "object" && global && global.Object === Object && global;
7104 var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
7105 var root3 = freeGlobal2 || freeSelf2 || Function("return this")();
7106 var freeExports3 = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
7107 var freeModule3 = freeExports3 && typeof module2 == "object" && module2 && !module2.nodeType && module2;
7108 var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
7109 var freeProcess2 = moduleExports3 && freeGlobal2.process;
7110 var nodeUtil2 = function() {
7112 var types = freeModule3 && freeModule3.require && freeModule3.require("util").types;
7116 return freeProcess2 && freeProcess2.binding && freeProcess2.binding("util");
7120 var nodeIsArrayBuffer = nodeUtil2 && nodeUtil2.isArrayBuffer, nodeIsDate = nodeUtil2 && nodeUtil2.isDate, nodeIsMap = nodeUtil2 && nodeUtil2.isMap, nodeIsRegExp = nodeUtil2 && nodeUtil2.isRegExp, nodeIsSet = nodeUtil2 && nodeUtil2.isSet, nodeIsTypedArray2 = nodeUtil2 && nodeUtil2.isTypedArray;
7121 function apply(func, thisArg, args) {
7122 switch (args.length) {
7124 return func.call(thisArg);
7126 return func.call(thisArg, args[0]);
7128 return func.call(thisArg, args[0], args[1]);
7130 return func.call(thisArg, args[0], args[1], args[2]);
7132 return func.apply(thisArg, args);
7134 function arrayAggregator(array2, setter, iteratee, accumulator) {
7135 var index = -1, length = array2 == null ? 0 : array2.length;
7136 while (++index < length) {
7137 var value = array2[index];
7138 setter(accumulator, value, iteratee(value), array2);
7142 function arrayEach(array2, iteratee) {
7143 var index = -1, length = array2 == null ? 0 : array2.length;
7144 while (++index < length) {
7145 if (iteratee(array2[index], index, array2) === false) {
7151 function arrayEachRight(array2, iteratee) {
7152 var length = array2 == null ? 0 : array2.length;
7154 if (iteratee(array2[length], length, array2) === false) {
7160 function arrayEvery(array2, predicate) {
7161 var index = -1, length = array2 == null ? 0 : array2.length;
7162 while (++index < length) {
7163 if (!predicate(array2[index], index, array2)) {
7169 function arrayFilter2(array2, predicate) {
7170 var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
7171 while (++index < length) {
7172 var value = array2[index];
7173 if (predicate(value, index, array2)) {
7174 result[resIndex++] = value;
7179 function arrayIncludes(array2, value) {
7180 var length = array2 == null ? 0 : array2.length;
7181 return !!length && baseIndexOf(array2, value, 0) > -1;
7183 function arrayIncludesWith(array2, value, comparator) {
7184 var index = -1, length = array2 == null ? 0 : array2.length;
7185 while (++index < length) {
7186 if (comparator(value, array2[index])) {
7192 function arrayMap2(array2, iteratee) {
7193 var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
7194 while (++index < length) {
7195 result[index] = iteratee(array2[index], index, array2);
7199 function arrayPush2(array2, values) {
7200 var index = -1, length = values.length, offset = array2.length;
7201 while (++index < length) {
7202 array2[offset + index] = values[index];
7206 function arrayReduce(array2, iteratee, accumulator, initAccum) {
7207 var index = -1, length = array2 == null ? 0 : array2.length;
7208 if (initAccum && length) {
7209 accumulator = array2[++index];
7211 while (++index < length) {
7212 accumulator = iteratee(accumulator, array2[index], index, array2);
7216 function arrayReduceRight(array2, iteratee, accumulator, initAccum) {
7217 var length = array2 == null ? 0 : array2.length;
7218 if (initAccum && length) {
7219 accumulator = array2[--length];
7222 accumulator = iteratee(accumulator, array2[length], length, array2);
7226 function arraySome2(array2, predicate) {
7227 var index = -1, length = array2 == null ? 0 : array2.length;
7228 while (++index < length) {
7229 if (predicate(array2[index], index, array2)) {
7235 var asciiSize = baseProperty("length");
7236 function asciiToArray(string) {
7237 return string.split("");
7239 function asciiWords(string) {
7240 return string.match(reAsciiWord) || [];
7242 function baseFindKey(collection, predicate, eachFunc) {
7244 eachFunc(collection, function(value, key, collection2) {
7245 if (predicate(value, key, collection2)) {
7252 function baseFindIndex(array2, predicate, fromIndex, fromRight) {
7253 var length = array2.length, index = fromIndex + (fromRight ? 1 : -1);
7254 while (fromRight ? index-- : ++index < length) {
7255 if (predicate(array2[index], index, array2)) {
7261 function baseIndexOf(array2, value, fromIndex) {
7262 return value === value ? strictIndexOf(array2, value, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex);
7264 function baseIndexOfWith(array2, value, fromIndex, comparator) {
7265 var index = fromIndex - 1, length = array2.length;
7266 while (++index < length) {
7267 if (comparator(array2[index], value)) {
7273 function baseIsNaN(value) {
7274 return value !== value;
7276 function baseMean(array2, iteratee) {
7277 var length = array2 == null ? 0 : array2.length;
7278 return length ? baseSum(array2, iteratee) / length : NAN2;
7280 function baseProperty(key) {
7281 return function(object) {
7282 return object == null ? undefined2 : object[key];
7285 function basePropertyOf2(object) {
7286 return function(key) {
7287 return object == null ? undefined2 : object[key];
7290 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
7291 eachFunc(collection, function(value, index, collection2) {
7292 accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
7296 function baseSortBy(array2, comparer) {
7297 var length = array2.length;
7298 array2.sort(comparer);
7300 array2[length] = array2[length].value;
7304 function baseSum(array2, iteratee) {
7305 var result, index = -1, length = array2.length;
7306 while (++index < length) {
7307 var current = iteratee(array2[index]);
7308 if (current !== undefined2) {
7309 result = result === undefined2 ? current : result + current;
7314 function baseTimes2(n3, iteratee) {
7315 var index = -1, result = Array(n3);
7316 while (++index < n3) {
7317 result[index] = iteratee(index);
7321 function baseToPairs(object, props) {
7322 return arrayMap2(props, function(key) {
7323 return [key, object[key]];
7326 function baseTrim2(string) {
7327 return string ? string.slice(0, trimmedEndIndex2(string) + 1).replace(reTrimStart2, "") : string;
7329 function baseUnary2(func) {
7330 return function(value) {
7334 function baseValues(object, props) {
7335 return arrayMap2(props, function(key) {
7339 function cacheHas2(cache, key) {
7340 return cache.has(key);
7342 function charsStartIndex(strSymbols, chrSymbols) {
7343 var index = -1, length = strSymbols.length;
7344 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
7348 function charsEndIndex(strSymbols, chrSymbols) {
7349 var index = strSymbols.length;
7350 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
7354 function countHolders(array2, placeholder) {
7355 var length = array2.length, result = 0;
7357 if (array2[length] === placeholder) {
7363 var deburrLetter = basePropertyOf2(deburredLetters);
7364 var escapeHtmlChar2 = basePropertyOf2(htmlEscapes2);
7365 function escapeStringChar(chr) {
7366 return "\\" + stringEscapes[chr];
7368 function getValue2(object, key) {
7369 return object == null ? undefined2 : object[key];
7371 function hasUnicode(string) {
7372 return reHasUnicode.test(string);
7374 function hasUnicodeWord(string) {
7375 return reHasUnicodeWord.test(string);
7377 function iteratorToArray(iterator) {
7378 var data, result = [];
7379 while (!(data = iterator.next()).done) {
7380 result.push(data.value);
7384 function mapToArray2(map2) {
7385 var index = -1, result = Array(map2.size);
7386 map2.forEach(function(value, key) {
7387 result[++index] = [key, value];
7391 function overArg2(func, transform2) {
7392 return function(arg) {
7393 return func(transform2(arg));
7396 function replaceHolders(array2, placeholder) {
7397 var index = -1, length = array2.length, resIndex = 0, result = [];
7398 while (++index < length) {
7399 var value = array2[index];
7400 if (value === placeholder || value === PLACEHOLDER) {
7401 array2[index] = PLACEHOLDER;
7402 result[resIndex++] = index;
7407 function setToArray2(set3) {
7408 var index = -1, result = Array(set3.size);
7409 set3.forEach(function(value) {
7410 result[++index] = value;
7414 function setToPairs(set3) {
7415 var index = -1, result = Array(set3.size);
7416 set3.forEach(function(value) {
7417 result[++index] = [value, value];
7421 function strictIndexOf(array2, value, fromIndex) {
7422 var index = fromIndex - 1, length = array2.length;
7423 while (++index < length) {
7424 if (array2[index] === value) {
7430 function strictLastIndexOf(array2, value, fromIndex) {
7431 var index = fromIndex + 1;
7433 if (array2[index] === value) {
7439 function stringSize(string) {
7440 return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
7442 function stringToArray(string) {
7443 return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
7445 function trimmedEndIndex2(string) {
7446 var index = string.length;
7447 while (index-- && reWhitespace2.test(string.charAt(index))) {
7451 var unescapeHtmlChar2 = basePropertyOf2(htmlUnescapes2);
7452 function unicodeSize(string) {
7453 var result = reUnicode.lastIndex = 0;
7454 while (reUnicode.test(string)) {
7459 function unicodeToArray(string) {
7460 return string.match(reUnicode) || [];
7462 function unicodeWords(string) {
7463 return string.match(reUnicodeWord) || [];
7465 var runInContext = function runInContext2(context) {
7466 context = context == null ? root3 : _2.defaults(root3.Object(), context, _2.pick(root3, contextProps));
7467 var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
7468 var arrayProto2 = Array2.prototype, funcProto3 = Function2.prototype, objectProto13 = Object2.prototype;
7469 var coreJsData2 = context["__core-js_shared__"];
7470 var funcToString3 = funcProto3.toString;
7471 var hasOwnProperty10 = objectProto13.hasOwnProperty;
7473 var maskSrcKey2 = function() {
7474 var uid = /[^.]+$/.exec(coreJsData2 && coreJsData2.keys && coreJsData2.keys.IE_PROTO || "");
7475 return uid ? "Symbol(src)_1." + uid : "";
7477 var nativeObjectToString3 = objectProto13.toString;
7478 var objectCtorString = funcToString3.call(Object2);
7479 var oldDash = root3._;
7480 var reIsNative2 = RegExp2(
7481 "^" + funcToString3.call(hasOwnProperty10).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
7483 var Buffer3 = moduleExports3 ? context.Buffer : undefined2, Symbol3 = context.Symbol, Uint8Array3 = context.Uint8Array, allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : undefined2, getPrototype = overArg2(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable3 = objectProto13.propertyIsEnumerable, splice2 = arrayProto2.splice, spreadableSymbol = Symbol3 ? Symbol3.isConcatSpreadable : undefined2, symIterator = Symbol3 ? Symbol3.iterator : undefined2, symToStringTag3 = Symbol3 ? Symbol3.toStringTag : undefined2;
7484 var defineProperty = function() {
7486 var func = getNative2(Object2, "defineProperty");
7492 var ctxClearTimeout = context.clearTimeout !== root3.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root3.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root3.setTimeout && context.setTimeout;
7493 var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols2 = Object2.getOwnPropertySymbols, nativeIsBuffer2 = Buffer3 ? Buffer3.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto2.join, nativeKeys2 = overArg2(Object2.keys, Object2), nativeMax2 = Math2.max, nativeMin2 = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto2.reverse;
7494 var DataView3 = getNative2(context, "DataView"), Map3 = getNative2(context, "Map"), Promise3 = getNative2(context, "Promise"), Set3 = getNative2(context, "Set"), WeakMap2 = getNative2(context, "WeakMap"), nativeCreate2 = getNative2(Object2, "create");
7495 var metaMap = WeakMap2 && new WeakMap2();
7497 var dataViewCtorString2 = toSource2(DataView3), mapCtorString2 = toSource2(Map3), promiseCtorString2 = toSource2(Promise3), setCtorString2 = toSource2(Set3), weakMapCtorString2 = toSource2(WeakMap2);
7498 var symbolProto3 = Symbol3 ? Symbol3.prototype : undefined2, symbolValueOf2 = symbolProto3 ? symbolProto3.valueOf : undefined2, symbolToString2 = symbolProto3 ? symbolProto3.toString : undefined2;
7499 function lodash(value) {
7500 if (isObjectLike2(value) && !isArray2(value) && !(value instanceof LazyWrapper)) {
7501 if (value instanceof LodashWrapper) {
7504 if (hasOwnProperty10.call(value, "__wrapped__")) {
7505 return wrapperClone(value);
7508 return new LodashWrapper(value);
7510 var baseCreate = function() {
7513 return function(proto) {
7514 if (!isObject3(proto)) {
7518 return objectCreate(proto);
7520 object.prototype = proto;
7521 var result2 = new object();
7522 object.prototype = undefined2;
7526 function baseLodash() {
7528 function LodashWrapper(value, chainAll) {
7529 this.__wrapped__ = value;
7530 this.__actions__ = [];
7531 this.__chain__ = !!chainAll;
7533 this.__values__ = undefined2;
7535 lodash.templateSettings = {
7537 * Used to detect `data` property values to be HTML-escaped.
7539 * @memberOf _.templateSettings
7544 * Used to detect code to be evaluated.
7546 * @memberOf _.templateSettings
7549 "evaluate": reEvaluate,
7551 * Used to detect `data` property values to inject.
7553 * @memberOf _.templateSettings
7556 "interpolate": reInterpolate,
7558 * Used to reference the data object in the template text.
7560 * @memberOf _.templateSettings
7565 * Used to import variables into the compiled template.
7567 * @memberOf _.templateSettings
7572 * A reference to the `lodash` function.
7574 * @memberOf _.templateSettings.imports
7580 lodash.prototype = baseLodash.prototype;
7581 lodash.prototype.constructor = lodash;
7582 LodashWrapper.prototype = baseCreate(baseLodash.prototype);
7583 LodashWrapper.prototype.constructor = LodashWrapper;
7584 function LazyWrapper(value) {
7585 this.__wrapped__ = value;
7586 this.__actions__ = [];
7588 this.__filtered__ = false;
7589 this.__iteratees__ = [];
7590 this.__takeCount__ = MAX_ARRAY_LENGTH;
7591 this.__views__ = [];
7593 function lazyClone() {
7594 var result2 = new LazyWrapper(this.__wrapped__);
7595 result2.__actions__ = copyArray(this.__actions__);
7596 result2.__dir__ = this.__dir__;
7597 result2.__filtered__ = this.__filtered__;
7598 result2.__iteratees__ = copyArray(this.__iteratees__);
7599 result2.__takeCount__ = this.__takeCount__;
7600 result2.__views__ = copyArray(this.__views__);
7603 function lazyReverse() {
7604 if (this.__filtered__) {
7605 var result2 = new LazyWrapper(this);
7606 result2.__dir__ = -1;
7607 result2.__filtered__ = true;
7609 result2 = this.clone();
7610 result2.__dir__ *= -1;
7614 function lazyValue() {
7615 var array2 = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array2), isRight = dir < 0, arrLength = isArr ? array2.length : 0, view = getView(0, arrLength, this.__views__), start2 = view.start, end = view.end, length = end - start2, index = isRight ? end : start2 - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin2(length, this.__takeCount__);
7616 if (!isArr || !isRight && arrLength == length && takeCount == length) {
7617 return baseWrapperValue(array2, this.__actions__);
7621 while (length-- && resIndex < takeCount) {
7623 var iterIndex = -1, value = array2[index];
7624 while (++iterIndex < iterLength) {
7625 var data = iteratees[iterIndex], iteratee2 = data.iteratee, type2 = data.type, computed = iteratee2(value);
7626 if (type2 == LAZY_MAP_FLAG) {
7628 } else if (!computed) {
7629 if (type2 == LAZY_FILTER_FLAG) {
7636 result2[resIndex++] = value;
7640 LazyWrapper.prototype = baseCreate(baseLodash.prototype);
7641 LazyWrapper.prototype.constructor = LazyWrapper;
7642 function Hash2(entries) {
7643 var index = -1, length = entries == null ? 0 : entries.length;
7645 while (++index < length) {
7646 var entry = entries[index];
7647 this.set(entry[0], entry[1]);
7650 function hashClear2() {
7651 this.__data__ = nativeCreate2 ? nativeCreate2(null) : {};
7654 function hashDelete2(key) {
7655 var result2 = this.has(key) && delete this.__data__[key];
7656 this.size -= result2 ? 1 : 0;
7659 function hashGet2(key) {
7660 var data = this.__data__;
7661 if (nativeCreate2) {
7662 var result2 = data[key];
7663 return result2 === HASH_UNDEFINED4 ? undefined2 : result2;
7665 return hasOwnProperty10.call(data, key) ? data[key] : undefined2;
7667 function hashHas2(key) {
7668 var data = this.__data__;
7669 return nativeCreate2 ? data[key] !== undefined2 : hasOwnProperty10.call(data, key);
7671 function hashSet2(key, value) {
7672 var data = this.__data__;
7673 this.size += this.has(key) ? 0 : 1;
7674 data[key] = nativeCreate2 && value === undefined2 ? HASH_UNDEFINED4 : value;
7677 Hash2.prototype.clear = hashClear2;
7678 Hash2.prototype["delete"] = hashDelete2;
7679 Hash2.prototype.get = hashGet2;
7680 Hash2.prototype.has = hashHas2;
7681 Hash2.prototype.set = hashSet2;
7682 function ListCache2(entries) {
7683 var index = -1, length = entries == null ? 0 : entries.length;
7685 while (++index < length) {
7686 var entry = entries[index];
7687 this.set(entry[0], entry[1]);
7690 function listCacheClear2() {
7694 function listCacheDelete2(key) {
7695 var data = this.__data__, index = assocIndexOf2(data, key);
7699 var lastIndex = data.length - 1;
7700 if (index == lastIndex) {
7703 splice2.call(data, index, 1);
7708 function listCacheGet2(key) {
7709 var data = this.__data__, index = assocIndexOf2(data, key);
7710 return index < 0 ? undefined2 : data[index][1];
7712 function listCacheHas2(key) {
7713 return assocIndexOf2(this.__data__, key) > -1;
7715 function listCacheSet2(key, value) {
7716 var data = this.__data__, index = assocIndexOf2(data, key);
7719 data.push([key, value]);
7721 data[index][1] = value;
7725 ListCache2.prototype.clear = listCacheClear2;
7726 ListCache2.prototype["delete"] = listCacheDelete2;
7727 ListCache2.prototype.get = listCacheGet2;
7728 ListCache2.prototype.has = listCacheHas2;
7729 ListCache2.prototype.set = listCacheSet2;
7730 function MapCache2(entries) {
7731 var index = -1, length = entries == null ? 0 : entries.length;
7733 while (++index < length) {
7734 var entry = entries[index];
7735 this.set(entry[0], entry[1]);
7738 function mapCacheClear2() {
7741 "hash": new Hash2(),
7742 "map": new (Map3 || ListCache2)(),
7743 "string": new Hash2()
7746 function mapCacheDelete2(key) {
7747 var result2 = getMapData2(this, key)["delete"](key);
7748 this.size -= result2 ? 1 : 0;
7751 function mapCacheGet2(key) {
7752 return getMapData2(this, key).get(key);
7754 function mapCacheHas2(key) {
7755 return getMapData2(this, key).has(key);
7757 function mapCacheSet2(key, value) {
7758 var data = getMapData2(this, key), size2 = data.size;
7759 data.set(key, value);
7760 this.size += data.size == size2 ? 0 : 1;
7763 MapCache2.prototype.clear = mapCacheClear2;
7764 MapCache2.prototype["delete"] = mapCacheDelete2;
7765 MapCache2.prototype.get = mapCacheGet2;
7766 MapCache2.prototype.has = mapCacheHas2;
7767 MapCache2.prototype.set = mapCacheSet2;
7768 function SetCache2(values2) {
7769 var index = -1, length = values2 == null ? 0 : values2.length;
7770 this.__data__ = new MapCache2();
7771 while (++index < length) {
7772 this.add(values2[index]);
7775 function setCacheAdd2(value) {
7776 this.__data__.set(value, HASH_UNDEFINED4);
7779 function setCacheHas2(value) {
7780 return this.__data__.has(value);
7782 SetCache2.prototype.add = SetCache2.prototype.push = setCacheAdd2;
7783 SetCache2.prototype.has = setCacheHas2;
7784 function Stack2(entries) {
7785 var data = this.__data__ = new ListCache2(entries);
7786 this.size = data.size;
7788 function stackClear2() {
7789 this.__data__ = new ListCache2();
7792 function stackDelete2(key) {
7793 var data = this.__data__, result2 = data["delete"](key);
7794 this.size = data.size;
7797 function stackGet2(key) {
7798 return this.__data__.get(key);
7800 function stackHas2(key) {
7801 return this.__data__.has(key);
7803 function stackSet2(key, value) {
7804 var data = this.__data__;
7805 if (data instanceof ListCache2) {
7806 var pairs2 = data.__data__;
7807 if (!Map3 || pairs2.length < LARGE_ARRAY_SIZE2 - 1) {
7808 pairs2.push([key, value]);
7809 this.size = ++data.size;
7812 data = this.__data__ = new MapCache2(pairs2);
7814 data.set(key, value);
7815 this.size = data.size;
7818 Stack2.prototype.clear = stackClear2;
7819 Stack2.prototype["delete"] = stackDelete2;
7820 Stack2.prototype.get = stackGet2;
7821 Stack2.prototype.has = stackHas2;
7822 Stack2.prototype.set = stackSet2;
7823 function arrayLikeKeys2(value, inherited) {
7824 var isArr = isArray2(value), isArg = !isArr && isArguments2(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray2(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes2(value.length, String2) : [], length = result2.length;
7825 for (var key in value) {
7826 if ((inherited || hasOwnProperty10.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
7827 (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
7828 isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
7829 isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
7830 isIndex2(key, length)))) {
7836 function arraySample(array2) {
7837 var length = array2.length;
7838 return length ? array2[baseRandom(0, length - 1)] : undefined2;
7840 function arraySampleSize(array2, n3) {
7841 return shuffleSelf(copyArray(array2), baseClamp(n3, 0, array2.length));
7843 function arrayShuffle(array2) {
7844 return shuffleSelf(copyArray(array2));
7846 function assignMergeValue(object, key, value) {
7847 if (value !== undefined2 && !eq2(object[key], value) || value === undefined2 && !(key in object)) {
7848 baseAssignValue(object, key, value);
7851 function assignValue(object, key, value) {
7852 var objValue = object[key];
7853 if (!(hasOwnProperty10.call(object, key) && eq2(objValue, value)) || value === undefined2 && !(key in object)) {
7854 baseAssignValue(object, key, value);
7857 function assocIndexOf2(array2, key) {
7858 var length = array2.length;
7860 if (eq2(array2[length][0], key)) {
7866 function baseAggregator(collection, setter, iteratee2, accumulator) {
7867 baseEach(collection, function(value, key, collection2) {
7868 setter(accumulator, value, iteratee2(value), collection2);
7872 function baseAssign(object, source) {
7873 return object && copyObject(source, keys2(source), object);
7875 function baseAssignIn(object, source) {
7876 return object && copyObject(source, keysIn(source), object);
7878 function baseAssignValue(object, key, value) {
7879 if (key == "__proto__" && defineProperty) {
7880 defineProperty(object, key, {
7881 "configurable": true,
7887 object[key] = value;
7890 function baseAt(object, paths) {
7891 var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
7892 while (++index < length) {
7893 result2[index] = skip ? undefined2 : get4(object, paths[index]);
7897 function baseClamp(number3, lower2, upper) {
7898 if (number3 === number3) {
7899 if (upper !== undefined2) {
7900 number3 = number3 <= upper ? number3 : upper;
7902 if (lower2 !== undefined2) {
7903 number3 = number3 >= lower2 ? number3 : lower2;
7908 function baseClone(value, bitmask, customizer, key, object, stack) {
7909 var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
7911 result2 = object ? customizer(value, key, object, stack) : customizer(value);
7913 if (result2 !== undefined2) {
7916 if (!isObject3(value)) {
7919 var isArr = isArray2(value);
7921 result2 = initCloneArray(value);
7923 return copyArray(value, result2);
7926 var tag = getTag2(value), isFunc = tag == funcTag3 || tag == genTag2;
7927 if (isBuffer2(value)) {
7928 return cloneBuffer(value, isDeep);
7930 if (tag == objectTag4 || tag == argsTag4 || isFunc && !object) {
7931 result2 = isFlat || isFunc ? {} : initCloneObject(value);
7933 return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
7936 if (!cloneableTags[tag]) {
7937 return object ? value : {};
7939 result2 = initCloneByTag(value, tag, isDeep);
7942 stack || (stack = new Stack2());
7943 var stacked = stack.get(value);
7947 stack.set(value, result2);
7949 value.forEach(function(subValue) {
7950 result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
7952 } else if (isMap(value)) {
7953 value.forEach(function(subValue, key2) {
7954 result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
7957 var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys2 : isFlat ? keysIn : keys2;
7958 var props = isArr ? undefined2 : keysFunc(value);
7959 arrayEach(props || value, function(subValue, key2) {
7962 subValue = value[key2];
7964 assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
7968 function baseConforms(source) {
7969 var props = keys2(source);
7970 return function(object) {
7971 return baseConformsTo(object, source, props);
7974 function baseConformsTo(object, source, props) {
7975 var length = props.length;
7976 if (object == null) {
7979 object = Object2(object);
7981 var key = props[length], predicate = source[key], value = object[key];
7982 if (value === undefined2 && !(key in object) || !predicate(value)) {
7988 function baseDelay(func, wait, args) {
7989 if (typeof func != "function") {
7990 throw new TypeError2(FUNC_ERROR_TEXT3);
7992 return setTimeout2(function() {
7993 func.apply(undefined2, args);
7996 function baseDifference(array2, values2, iteratee2, comparator) {
7997 var index = -1, includes2 = arrayIncludes, isCommon = true, length = array2.length, result2 = [], valuesLength = values2.length;
8002 values2 = arrayMap2(values2, baseUnary2(iteratee2));
8005 includes2 = arrayIncludesWith;
8007 } else if (values2.length >= LARGE_ARRAY_SIZE2) {
8008 includes2 = cacheHas2;
8010 values2 = new SetCache2(values2);
8013 while (++index < length) {
8014 var value = array2[index], computed = iteratee2 == null ? value : iteratee2(value);
8015 value = comparator || value !== 0 ? value : 0;
8016 if (isCommon && computed === computed) {
8017 var valuesIndex = valuesLength;
8018 while (valuesIndex--) {
8019 if (values2[valuesIndex] === computed) {
8023 result2.push(value);
8024 } else if (!includes2(values2, computed, comparator)) {
8025 result2.push(value);
8030 var baseEach = createBaseEach(baseForOwn);
8031 var baseEachRight = createBaseEach(baseForOwnRight, true);
8032 function baseEvery(collection, predicate) {
8034 baseEach(collection, function(value, index, collection2) {
8035 result2 = !!predicate(value, index, collection2);
8040 function baseExtremum(array2, iteratee2, comparator) {
8041 var index = -1, length = array2.length;
8042 while (++index < length) {
8043 var value = array2[index], current = iteratee2(value);
8044 if (current != null && (computed === undefined2 ? current === current && !isSymbol2(current) : comparator(current, computed))) {
8045 var computed = current, result2 = value;
8050 function baseFill(array2, value, start2, end) {
8051 var length = array2.length;
8052 start2 = toInteger(start2);
8054 start2 = -start2 > length ? 0 : length + start2;
8056 end = end === undefined2 || end > length ? length : toInteger(end);
8060 end = start2 > end ? 0 : toLength(end);
8061 while (start2 < end) {
8062 array2[start2++] = value;
8066 function baseFilter(collection, predicate) {
8068 baseEach(collection, function(value, index, collection2) {
8069 if (predicate(value, index, collection2)) {
8070 result2.push(value);
8075 function baseFlatten(array2, depth, predicate, isStrict, result2) {
8076 var index = -1, length = array2.length;
8077 predicate || (predicate = isFlattenable);
8078 result2 || (result2 = []);
8079 while (++index < length) {
8080 var value = array2[index];
8081 if (depth > 0 && predicate(value)) {
8083 baseFlatten(value, depth - 1, predicate, isStrict, result2);
8085 arrayPush2(result2, value);
8087 } else if (!isStrict) {
8088 result2[result2.length] = value;
8093 var baseFor = createBaseFor();
8094 var baseForRight = createBaseFor(true);
8095 function baseForOwn(object, iteratee2) {
8096 return object && baseFor(object, iteratee2, keys2);
8098 function baseForOwnRight(object, iteratee2) {
8099 return object && baseForRight(object, iteratee2, keys2);
8101 function baseFunctions(object, props) {
8102 return arrayFilter2(props, function(key) {
8103 return isFunction2(object[key]);
8106 function baseGet(object, path) {
8107 path = castPath(path, object);
8108 var index = 0, length = path.length;
8109 while (object != null && index < length) {
8110 object = object[toKey(path[index++])];
8112 return index && index == length ? object : undefined2;
8114 function baseGetAllKeys2(object, keysFunc, symbolsFunc) {
8115 var result2 = keysFunc(object);
8116 return isArray2(object) ? result2 : arrayPush2(result2, symbolsFunc(object));
8118 function baseGetTag2(value) {
8119 if (value == null) {
8120 return value === undefined2 ? undefinedTag2 : nullTag2;
8122 return symToStringTag3 && symToStringTag3 in Object2(value) ? getRawTag2(value) : objectToString2(value);
8124 function baseGt(value, other) {
8125 return value > other;
8127 function baseHas(object, key) {
8128 return object != null && hasOwnProperty10.call(object, key);
8130 function baseHasIn(object, key) {
8131 return object != null && key in Object2(object);
8133 function baseInRange(number3, start2, end) {
8134 return number3 >= nativeMin2(start2, end) && number3 < nativeMax2(start2, end);
8136 function baseIntersection(arrays, iteratee2, comparator) {
8137 var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
8138 while (othIndex--) {
8139 var array2 = arrays[othIndex];
8140 if (othIndex && iteratee2) {
8141 array2 = arrayMap2(array2, baseUnary2(iteratee2));
8143 maxLength = nativeMin2(array2.length, maxLength);
8144 caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array2.length >= 120) ? new SetCache2(othIndex && array2) : undefined2;
8147 var index = -1, seen = caches[0];
8149 while (++index < length && result2.length < maxLength) {
8150 var value = array2[index], computed = iteratee2 ? iteratee2(value) : value;
8151 value = comparator || value !== 0 ? value : 0;
8152 if (!(seen ? cacheHas2(seen, computed) : includes2(result2, computed, comparator))) {
8153 othIndex = othLength;
8154 while (--othIndex) {
8155 var cache = caches[othIndex];
8156 if (!(cache ? cacheHas2(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
8161 seen.push(computed);
8163 result2.push(value);
8168 function baseInverter(object, setter, iteratee2, accumulator) {
8169 baseForOwn(object, function(value, key, object2) {
8170 setter(accumulator, iteratee2(value), key, object2);
8174 function baseInvoke(object, path, args) {
8175 path = castPath(path, object);
8176 object = parent(object, path);
8177 var func = object == null ? object : object[toKey(last(path))];
8178 return func == null ? undefined2 : apply(func, object, args);
8180 function baseIsArguments2(value) {
8181 return isObjectLike2(value) && baseGetTag2(value) == argsTag4;
8183 function baseIsArrayBuffer(value) {
8184 return isObjectLike2(value) && baseGetTag2(value) == arrayBufferTag3;
8186 function baseIsDate(value) {
8187 return isObjectLike2(value) && baseGetTag2(value) == dateTag3;
8189 function baseIsEqual2(value, other, bitmask, customizer, stack) {
8190 if (value === other) {
8193 if (value == null || other == null || !isObjectLike2(value) && !isObjectLike2(other)) {
8194 return value !== value && other !== other;
8196 return baseIsEqualDeep2(value, other, bitmask, customizer, baseIsEqual2, stack);
8198 function baseIsEqualDeep2(object, other, bitmask, customizer, equalFunc, stack) {
8199 var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag3 : getTag2(object), othTag = othIsArr ? arrayTag3 : getTag2(other);
8200 objTag = objTag == argsTag4 ? objectTag4 : objTag;
8201 othTag = othTag == argsTag4 ? objectTag4 : othTag;
8202 var objIsObj = objTag == objectTag4, othIsObj = othTag == objectTag4, isSameTag = objTag == othTag;
8203 if (isSameTag && isBuffer2(object)) {
8204 if (!isBuffer2(other)) {
8210 if (isSameTag && !objIsObj) {
8211 stack || (stack = new Stack2());
8212 return objIsArr || isTypedArray2(object) ? equalArrays2(object, other, bitmask, customizer, equalFunc, stack) : equalByTag2(object, other, objTag, bitmask, customizer, equalFunc, stack);
8214 if (!(bitmask & COMPARE_PARTIAL_FLAG5)) {
8215 var objIsWrapped = objIsObj && hasOwnProperty10.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty10.call(other, "__wrapped__");
8216 if (objIsWrapped || othIsWrapped) {
8217 var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
8218 stack || (stack = new Stack2());
8219 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
8225 stack || (stack = new Stack2());
8226 return equalObjects2(object, other, bitmask, customizer, equalFunc, stack);
8228 function baseIsMap(value) {
8229 return isObjectLike2(value) && getTag2(value) == mapTag4;
8231 function baseIsMatch(object, source, matchData, customizer) {
8232 var index = matchData.length, length = index, noCustomizer = !customizer;
8233 if (object == null) {
8236 object = Object2(object);
8238 var data = matchData[index];
8239 if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
8243 while (++index < length) {
8244 data = matchData[index];
8245 var key = data[0], objValue = object[key], srcValue = data[1];
8246 if (noCustomizer && data[2]) {
8247 if (objValue === undefined2 && !(key in object)) {
8251 var stack = new Stack2();
8253 var result2 = customizer(objValue, srcValue, key, object, source, stack);
8255 if (!(result2 === undefined2 ? baseIsEqual2(srcValue, objValue, COMPARE_PARTIAL_FLAG5 | COMPARE_UNORDERED_FLAG3, customizer, stack) : result2)) {
8262 function baseIsNative2(value) {
8263 if (!isObject3(value) || isMasked2(value)) {
8266 var pattern = isFunction2(value) ? reIsNative2 : reIsHostCtor2;
8267 return pattern.test(toSource2(value));
8269 function baseIsRegExp(value) {
8270 return isObjectLike2(value) && baseGetTag2(value) == regexpTag3;
8272 function baseIsSet(value) {
8273 return isObjectLike2(value) && getTag2(value) == setTag4;
8275 function baseIsTypedArray2(value) {
8276 return isObjectLike2(value) && isLength2(value.length) && !!typedArrayTags2[baseGetTag2(value)];
8278 function baseIteratee(value) {
8279 if (typeof value == "function") {
8282 if (value == null) {
8285 if (typeof value == "object") {
8286 return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
8288 return property(value);
8290 function baseKeys2(object) {
8291 if (!isPrototype2(object)) {
8292 return nativeKeys2(object);
8295 for (var key in Object2(object)) {
8296 if (hasOwnProperty10.call(object, key) && key != "constructor") {
8302 function baseKeysIn(object) {
8303 if (!isObject3(object)) {
8304 return nativeKeysIn(object);
8306 var isProto = isPrototype2(object), result2 = [];
8307 for (var key in object) {
8308 if (!(key == "constructor" && (isProto || !hasOwnProperty10.call(object, key)))) {
8314 function baseLt(value, other) {
8315 return value < other;
8317 function baseMap(collection, iteratee2) {
8318 var index = -1, result2 = isArrayLike2(collection) ? Array2(collection.length) : [];
8319 baseEach(collection, function(value, key, collection2) {
8320 result2[++index] = iteratee2(value, key, collection2);
8324 function baseMatches(source) {
8325 var matchData = getMatchData(source);
8326 if (matchData.length == 1 && matchData[0][2]) {
8327 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
8329 return function(object) {
8330 return object === source || baseIsMatch(object, source, matchData);
8333 function baseMatchesProperty(path, srcValue) {
8334 if (isKey(path) && isStrictComparable(srcValue)) {
8335 return matchesStrictComparable(toKey(path), srcValue);
8337 return function(object) {
8338 var objValue = get4(object, path);
8339 return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual2(srcValue, objValue, COMPARE_PARTIAL_FLAG5 | COMPARE_UNORDERED_FLAG3);
8342 function baseMerge(object, source, srcIndex, customizer, stack) {
8343 if (object === source) {
8346 baseFor(source, function(srcValue, key) {
8347 stack || (stack = new Stack2());
8348 if (isObject3(srcValue)) {
8349 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
8351 var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
8352 if (newValue === undefined2) {
8353 newValue = srcValue;
8355 assignMergeValue(object, key, newValue);
8359 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
8360 var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
8362 assignMergeValue(object, key, stacked);
8365 var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2;
8366 var isCommon = newValue === undefined2;
8368 var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer2(srcValue), isTyped = !isArr && !isBuff && isTypedArray2(srcValue);
8369 newValue = srcValue;
8370 if (isArr || isBuff || isTyped) {
8371 if (isArray2(objValue)) {
8372 newValue = objValue;
8373 } else if (isArrayLikeObject(objValue)) {
8374 newValue = copyArray(objValue);
8375 } else if (isBuff) {
8377 newValue = cloneBuffer(srcValue, true);
8378 } else if (isTyped) {
8380 newValue = cloneTypedArray(srcValue, true);
8384 } else if (isPlainObject(srcValue) || isArguments2(srcValue)) {
8385 newValue = objValue;
8386 if (isArguments2(objValue)) {
8387 newValue = toPlainObject(objValue);
8388 } else if (!isObject3(objValue) || isFunction2(objValue)) {
8389 newValue = initCloneObject(srcValue);
8396 stack.set(srcValue, newValue);
8397 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
8398 stack["delete"](srcValue);
8400 assignMergeValue(object, key, newValue);
8402 function baseNth(array2, n3) {
8403 var length = array2.length;
8407 n3 += n3 < 0 ? length : 0;
8408 return isIndex2(n3, length) ? array2[n3] : undefined2;
8410 function baseOrderBy(collection, iteratees, orders) {
8411 if (iteratees.length) {
8412 iteratees = arrayMap2(iteratees, function(iteratee2) {
8413 if (isArray2(iteratee2)) {
8414 return function(value) {
8415 return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
8421 iteratees = [identity4];
8424 iteratees = arrayMap2(iteratees, baseUnary2(getIteratee()));
8425 var result2 = baseMap(collection, function(value, key, collection2) {
8426 var criteria = arrayMap2(iteratees, function(iteratee2) {
8427 return iteratee2(value);
8429 return { "criteria": criteria, "index": ++index, "value": value };
8431 return baseSortBy(result2, function(object, other) {
8432 return compareMultiple(object, other, orders);
8435 function basePick(object, paths) {
8436 return basePickBy(object, paths, function(value, path) {
8437 return hasIn(object, path);
8440 function basePickBy(object, paths, predicate) {
8441 var index = -1, length = paths.length, result2 = {};
8442 while (++index < length) {
8443 var path = paths[index], value = baseGet(object, path);
8444 if (predicate(value, path)) {
8445 baseSet(result2, castPath(path, object), value);
8450 function basePropertyDeep(path) {
8451 return function(object) {
8452 return baseGet(object, path);
8455 function basePullAll(array2, values2, iteratee2, comparator) {
8456 var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array2;
8457 if (array2 === values2) {
8458 values2 = copyArray(values2);
8461 seen = arrayMap2(array2, baseUnary2(iteratee2));
8463 while (++index < length) {
8464 var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
8465 while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
8466 if (seen !== array2) {
8467 splice2.call(seen, fromIndex, 1);
8469 splice2.call(array2, fromIndex, 1);
8474 function basePullAt(array2, indexes) {
8475 var length = array2 ? indexes.length : 0, lastIndex = length - 1;
8477 var index = indexes[length];
8478 if (length == lastIndex || index !== previous) {
8479 var previous = index;
8480 if (isIndex2(index)) {
8481 splice2.call(array2, index, 1);
8483 baseUnset(array2, index);
8489 function baseRandom(lower2, upper) {
8490 return lower2 + nativeFloor(nativeRandom() * (upper - lower2 + 1));
8492 function baseRange(start2, end, step, fromRight) {
8493 var index = -1, length = nativeMax2(nativeCeil((end - start2) / (step || 1)), 0), result2 = Array2(length);
8495 result2[fromRight ? length : ++index] = start2;
8500 function baseRepeat(string, n3) {
8502 if (!string || n3 < 1 || n3 > MAX_SAFE_INTEGER3) {
8509 n3 = nativeFloor(n3 / 2);
8516 function baseRest(func, start2) {
8517 return setToString(overRest(func, start2, identity4), func + "");
8519 function baseSample(collection) {
8520 return arraySample(values(collection));
8522 function baseSampleSize(collection, n3) {
8523 var array2 = values(collection);
8524 return shuffleSelf(array2, baseClamp(n3, 0, array2.length));
8526 function baseSet(object, path, value, customizer) {
8527 if (!isObject3(object)) {
8530 path = castPath(path, object);
8531 var index = -1, length = path.length, lastIndex = length - 1, nested = object;
8532 while (nested != null && ++index < length) {
8533 var key = toKey(path[index]), newValue = value;
8534 if (key === "__proto__" || key === "constructor" || key === "prototype") {
8537 if (index != lastIndex) {
8538 var objValue = nested[key];
8539 newValue = customizer ? customizer(objValue, key, nested) : undefined2;
8540 if (newValue === undefined2) {
8541 newValue = isObject3(objValue) ? objValue : isIndex2(path[index + 1]) ? [] : {};
8544 assignValue(nested, key, newValue);
8545 nested = nested[key];
8549 var baseSetData = !metaMap ? identity4 : function(func, data) {
8550 metaMap.set(func, data);
8553 var baseSetToString = !defineProperty ? identity4 : function(func, string) {
8554 return defineProperty(func, "toString", {
8555 "configurable": true,
8556 "enumerable": false,
8557 "value": constant(string),
8561 function baseShuffle(collection) {
8562 return shuffleSelf(values(collection));
8564 function baseSlice(array2, start2, end) {
8565 var index = -1, length = array2.length;
8567 start2 = -start2 > length ? 0 : length + start2;
8569 end = end > length ? length : end;
8573 length = start2 > end ? 0 : end - start2 >>> 0;
8575 var result2 = Array2(length);
8576 while (++index < length) {
8577 result2[index] = array2[index + start2];
8581 function baseSome(collection, predicate) {
8583 baseEach(collection, function(value, index, collection2) {
8584 result2 = predicate(value, index, collection2);
8589 function baseSortedIndex(array2, value, retHighest) {
8590 var low = 0, high = array2 == null ? low : array2.length;
8591 if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
8592 while (low < high) {
8593 var mid = low + high >>> 1, computed = array2[mid];
8594 if (computed !== null && !isSymbol2(computed) && (retHighest ? computed <= value : computed < value)) {
8602 return baseSortedIndexBy(array2, value, identity4, retHighest);
8604 function baseSortedIndexBy(array2, value, iteratee2, retHighest) {
8605 var low = 0, high = array2 == null ? 0 : array2.length;
8609 value = iteratee2(value);
8610 var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol2(value), valIsUndefined = value === undefined2;
8611 while (low < high) {
8612 var mid = nativeFloor((low + high) / 2), computed = iteratee2(array2[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol2(computed);
8614 var setLow = retHighest || othIsReflexive;
8615 } else if (valIsUndefined) {
8616 setLow = othIsReflexive && (retHighest || othIsDefined);
8617 } else if (valIsNull) {
8618 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
8619 } else if (valIsSymbol) {
8620 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
8621 } else if (othIsNull || othIsSymbol) {
8624 setLow = retHighest ? computed <= value : computed < value;
8632 return nativeMin2(high, MAX_ARRAY_INDEX);
8634 function baseSortedUniq(array2, iteratee2) {
8635 var index = -1, length = array2.length, resIndex = 0, result2 = [];
8636 while (++index < length) {
8637 var value = array2[index], computed = iteratee2 ? iteratee2(value) : value;
8638 if (!index || !eq2(computed, seen)) {
8639 var seen = computed;
8640 result2[resIndex++] = value === 0 ? 0 : value;
8645 function baseToNumber(value) {
8646 if (typeof value == "number") {
8649 if (isSymbol2(value)) {
8654 function baseToString2(value) {
8655 if (typeof value == "string") {
8658 if (isArray2(value)) {
8659 return arrayMap2(value, baseToString2) + "";
8661 if (isSymbol2(value)) {
8662 return symbolToString2 ? symbolToString2.call(value) : "";
8664 var result2 = value + "";
8665 return result2 == "0" && 1 / value == -INFINITY2 ? "-0" : result2;
8667 function baseUniq(array2, iteratee2, comparator) {
8668 var index = -1, includes2 = arrayIncludes, length = array2.length, isCommon = true, result2 = [], seen = result2;
8671 includes2 = arrayIncludesWith;
8672 } else if (length >= LARGE_ARRAY_SIZE2) {
8673 var set4 = iteratee2 ? null : createSet(array2);
8675 return setToArray2(set4);
8678 includes2 = cacheHas2;
8679 seen = new SetCache2();
8681 seen = iteratee2 ? [] : result2;
8684 while (++index < length) {
8685 var value = array2[index], computed = iteratee2 ? iteratee2(value) : value;
8686 value = comparator || value !== 0 ? value : 0;
8687 if (isCommon && computed === computed) {
8688 var seenIndex = seen.length;
8689 while (seenIndex--) {
8690 if (seen[seenIndex] === computed) {
8695 seen.push(computed);
8697 result2.push(value);
8698 } else if (!includes2(seen, computed, comparator)) {
8699 if (seen !== result2) {
8700 seen.push(computed);
8702 result2.push(value);
8707 function baseUnset(object, path) {
8708 path = castPath(path, object);
8709 object = parent(object, path);
8710 return object == null || delete object[toKey(last(path))];
8712 function baseUpdate(object, path, updater, customizer) {
8713 return baseSet(object, path, updater(baseGet(object, path)), customizer);
8715 function baseWhile(array2, predicate, isDrop, fromRight) {
8716 var length = array2.length, index = fromRight ? length : -1;
8717 while ((fromRight ? index-- : ++index < length) && predicate(array2[index], index, array2)) {
8719 return isDrop ? baseSlice(array2, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array2, fromRight ? index + 1 : 0, fromRight ? length : index);
8721 function baseWrapperValue(value, actions) {
8722 var result2 = value;
8723 if (result2 instanceof LazyWrapper) {
8724 result2 = result2.value();
8726 return arrayReduce(actions, function(result3, action) {
8727 return action.func.apply(action.thisArg, arrayPush2([result3], action.args));
8730 function baseXor(arrays, iteratee2, comparator) {
8731 var length = arrays.length;
8733 return length ? baseUniq(arrays[0]) : [];
8735 var index = -1, result2 = Array2(length);
8736 while (++index < length) {
8737 var array2 = arrays[index], othIndex = -1;
8738 while (++othIndex < length) {
8739 if (othIndex != index) {
8740 result2[index] = baseDifference(result2[index] || array2, arrays[othIndex], iteratee2, comparator);
8744 return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
8746 function baseZipObject(props, values2, assignFunc) {
8747 var index = -1, length = props.length, valsLength = values2.length, result2 = {};
8748 while (++index < length) {
8749 var value = index < valsLength ? values2[index] : undefined2;
8750 assignFunc(result2, props[index], value);
8754 function castArrayLikeObject(value) {
8755 return isArrayLikeObject(value) ? value : [];
8757 function castFunction(value) {
8758 return typeof value == "function" ? value : identity4;
8760 function castPath(value, object) {
8761 if (isArray2(value)) {
8764 return isKey(value, object) ? [value] : stringToPath(toString2(value));
8766 var castRest = baseRest;
8767 function castSlice(array2, start2, end) {
8768 var length = array2.length;
8769 end = end === undefined2 ? length : end;
8770 return !start2 && end >= length ? array2 : baseSlice(array2, start2, end);
8772 var clearTimeout2 = ctxClearTimeout || function(id2) {
8773 return root3.clearTimeout(id2);
8775 function cloneBuffer(buffer, isDeep) {
8777 return buffer.slice();
8779 var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
8780 buffer.copy(result2);
8783 function cloneArrayBuffer(arrayBuffer) {
8784 var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
8785 new Uint8Array3(result2).set(new Uint8Array3(arrayBuffer));
8788 function cloneDataView(dataView, isDeep) {
8789 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
8790 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
8792 function cloneRegExp(regexp) {
8793 var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
8794 result2.lastIndex = regexp.lastIndex;
8797 function cloneSymbol(symbol) {
8798 return symbolValueOf2 ? Object2(symbolValueOf2.call(symbol)) : {};
8800 function cloneTypedArray(typedArray, isDeep) {
8801 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
8802 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
8804 function compareAscending(value, other) {
8805 if (value !== other) {
8806 var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol2(value);
8807 var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol2(other);
8808 if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
8811 if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
8817 function compareMultiple(object, other, orders) {
8818 var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
8819 while (++index < length) {
8820 var result2 = compareAscending(objCriteria[index], othCriteria[index]);
8822 if (index >= ordersLength) {
8825 var order = orders[index];
8826 return result2 * (order == "desc" ? -1 : 1);
8829 return object.index - other.index;
8831 function composeArgs(args, partials, holders, isCurried) {
8832 var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax2(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
8833 while (++leftIndex < leftLength) {
8834 result2[leftIndex] = partials[leftIndex];
8836 while (++argsIndex < holdersLength) {
8837 if (isUncurried || argsIndex < argsLength) {
8838 result2[holders[argsIndex]] = args[argsIndex];
8841 while (rangeLength--) {
8842 result2[leftIndex++] = args[argsIndex++];
8846 function composeArgsRight(args, partials, holders, isCurried) {
8847 var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax2(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
8848 while (++argsIndex < rangeLength) {
8849 result2[argsIndex] = args[argsIndex];
8851 var offset = argsIndex;
8852 while (++rightIndex < rightLength) {
8853 result2[offset + rightIndex] = partials[rightIndex];
8855 while (++holdersIndex < holdersLength) {
8856 if (isUncurried || argsIndex < argsLength) {
8857 result2[offset + holders[holdersIndex]] = args[argsIndex++];
8862 function copyArray(source, array2) {
8863 var index = -1, length = source.length;
8864 array2 || (array2 = Array2(length));
8865 while (++index < length) {
8866 array2[index] = source[index];
8870 function copyObject(source, props, object, customizer) {
8871 var isNew = !object;
8872 object || (object = {});
8873 var index = -1, length = props.length;
8874 while (++index < length) {
8875 var key = props[index];
8876 var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2;
8877 if (newValue === undefined2) {
8878 newValue = source[key];
8881 baseAssignValue(object, key, newValue);
8883 assignValue(object, key, newValue);
8888 function copySymbols(source, object) {
8889 return copyObject(source, getSymbols2(source), object);
8891 function copySymbolsIn(source, object) {
8892 return copyObject(source, getSymbolsIn(source), object);
8894 function createAggregator(setter, initializer) {
8895 return function(collection, iteratee2) {
8896 var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
8897 return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
8900 function createAssigner(assigner) {
8901 return baseRest(function(object, sources) {
8902 var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2;
8903 customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2;
8904 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
8905 customizer = length < 3 ? undefined2 : customizer;
8908 object = Object2(object);
8909 while (++index < length) {
8910 var source = sources[index];
8912 assigner(object, source, index, customizer);
8918 function createBaseEach(eachFunc, fromRight) {
8919 return function(collection, iteratee2) {
8920 if (collection == null) {
8923 if (!isArrayLike2(collection)) {
8924 return eachFunc(collection, iteratee2);
8926 var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
8927 while (fromRight ? index-- : ++index < length) {
8928 if (iteratee2(iterable[index], index, iterable) === false) {
8935 function createBaseFor(fromRight) {
8936 return function(object, iteratee2, keysFunc) {
8937 var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
8939 var key = props[fromRight ? length : ++index];
8940 if (iteratee2(iterable[key], key, iterable) === false) {
8947 function createBind(func, bitmask, thisArg) {
8948 var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
8949 function wrapper() {
8950 var fn = this && this !== root3 && this instanceof wrapper ? Ctor : func;
8951 return fn.apply(isBind ? thisArg : this, arguments);
8955 function createCaseFirst(methodName) {
8956 return function(string) {
8957 string = toString2(string);
8958 var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2;
8959 var chr = strSymbols ? strSymbols[0] : string.charAt(0);
8960 var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
8961 return chr[methodName]() + trailing;
8964 function createCompounder(callback) {
8965 return function(string) {
8966 return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
8969 function createCtor(Ctor) {
8971 var args = arguments;
8972 switch (args.length) {
8976 return new Ctor(args[0]);
8978 return new Ctor(args[0], args[1]);
8980 return new Ctor(args[0], args[1], args[2]);
8982 return new Ctor(args[0], args[1], args[2], args[3]);
8984 return new Ctor(args[0], args[1], args[2], args[3], args[4]);
8986 return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
8988 return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
8990 var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
8991 return isObject3(result2) ? result2 : thisBinding;
8994 function createCurry(func, bitmask, arity) {
8995 var Ctor = createCtor(func);
8996 function wrapper() {
8997 var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
8999 args[index] = arguments[index];
9001 var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
9002 length -= holders.length;
9003 if (length < arity) {
9004 return createRecurry(
9008 wrapper.placeholder,
9017 var fn = this && this !== root3 && this instanceof wrapper ? Ctor : func;
9018 return apply(fn, this, args);
9022 function createFind(findIndexFunc) {
9023 return function(collection, predicate, fromIndex) {
9024 var iterable = Object2(collection);
9025 if (!isArrayLike2(collection)) {
9026 var iteratee2 = getIteratee(predicate, 3);
9027 collection = keys2(collection);
9028 predicate = function(key) {
9029 return iteratee2(iterable[key], key, iterable);
9032 var index = findIndexFunc(collection, predicate, fromIndex);
9033 return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2;
9036 function createFlow(fromRight) {
9037 return flatRest(function(funcs) {
9038 var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
9043 var func = funcs[index];
9044 if (typeof func != "function") {
9045 throw new TypeError2(FUNC_ERROR_TEXT3);
9047 if (prereq && !wrapper && getFuncName(func) == "wrapper") {
9048 var wrapper = new LodashWrapper([], true);
9051 index = wrapper ? index : length;
9052 while (++index < length) {
9053 func = funcs[index];
9054 var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2;
9055 if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
9056 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
9058 wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
9062 var args = arguments, value = args[0];
9063 if (wrapper && args.length == 1 && isArray2(value)) {
9064 return wrapper.plant(value).value();
9066 var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
9067 while (++index2 < length) {
9068 result2 = funcs[index2].call(this, result2);
9074 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
9075 var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func);
9076 function wrapper() {
9077 var length = arguments.length, args = Array2(length), index = length;
9079 args[index] = arguments[index];
9082 var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
9085 args = composeArgs(args, partials, holders, isCurried);
9087 if (partialsRight) {
9088 args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
9090 length -= holdersCount;
9091 if (isCurried && length < arity) {
9092 var newHolders = replaceHolders(args, placeholder);
9093 return createRecurry(
9097 wrapper.placeholder,
9106 var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
9107 length = args.length;
9109 args = reorder(args, argPos);
9110 } else if (isFlip && length > 1) {
9113 if (isAry && ary2 < length) {
9116 if (this && this !== root3 && this instanceof wrapper) {
9117 fn = Ctor || createCtor(fn);
9119 return fn.apply(thisBinding, args);
9123 function createInverter(setter, toIteratee) {
9124 return function(object, iteratee2) {
9125 return baseInverter(object, setter, toIteratee(iteratee2), {});
9128 function createMathOperation(operator, defaultValue) {
9129 return function(value, other) {
9131 if (value === undefined2 && other === undefined2) {
9132 return defaultValue;
9134 if (value !== undefined2) {
9137 if (other !== undefined2) {
9138 if (result2 === undefined2) {
9141 if (typeof value == "string" || typeof other == "string") {
9142 value = baseToString2(value);
9143 other = baseToString2(other);
9145 value = baseToNumber(value);
9146 other = baseToNumber(other);
9148 result2 = operator(value, other);
9153 function createOver(arrayFunc) {
9154 return flatRest(function(iteratees) {
9155 iteratees = arrayMap2(iteratees, baseUnary2(getIteratee()));
9156 return baseRest(function(args) {
9158 return arrayFunc(iteratees, function(iteratee2) {
9159 return apply(iteratee2, thisArg, args);
9164 function createPadding(length, chars) {
9165 chars = chars === undefined2 ? " " : baseToString2(chars);
9166 var charsLength = chars.length;
9167 if (charsLength < 2) {
9168 return charsLength ? baseRepeat(chars, length) : chars;
9170 var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
9171 return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
9173 function createPartial(func, bitmask, thisArg, partials) {
9174 var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
9175 function wrapper() {
9176 var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root3 && this instanceof wrapper ? Ctor : func;
9177 while (++leftIndex < leftLength) {
9178 args[leftIndex] = partials[leftIndex];
9180 while (argsLength--) {
9181 args[leftIndex++] = arguments[++argsIndex];
9183 return apply(fn, isBind ? thisArg : this, args);
9187 function createRange(fromRight) {
9188 return function(start2, end, step) {
9189 if (step && typeof step != "number" && isIterateeCall(start2, end, step)) {
9190 end = step = undefined2;
9192 start2 = toFinite(start2);
9193 if (end === undefined2) {
9197 end = toFinite(end);
9199 step = step === undefined2 ? start2 < end ? 1 : -1 : toFinite(step);
9200 return baseRange(start2, end, step, fromRight);
9203 function createRelationalOperation(operator) {
9204 return function(value, other) {
9205 if (!(typeof value == "string" && typeof other == "string")) {
9206 value = toNumber3(value);
9207 other = toNumber3(other);
9209 return operator(value, other);
9212 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
9213 var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials;
9214 bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
9215 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
9216 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
9217 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
9231 var result2 = wrapFunc.apply(undefined2, newData);
9232 if (isLaziable(func)) {
9233 setData(result2, newData);
9235 result2.placeholder = placeholder;
9236 return setWrapToString(result2, func, bitmask);
9238 function createRound(methodName) {
9239 var func = Math2[methodName];
9240 return function(number3, precision2) {
9241 number3 = toNumber3(number3);
9242 precision2 = precision2 == null ? 0 : nativeMin2(toInteger(precision2), 292);
9243 if (precision2 && nativeIsFinite(number3)) {
9244 var pair3 = (toString2(number3) + "e").split("e"), value = func(pair3[0] + "e" + (+pair3[1] + precision2));
9245 pair3 = (toString2(value) + "e").split("e");
9246 return +(pair3[0] + "e" + (+pair3[1] - precision2));
9248 return func(number3);
9251 var createSet = !(Set3 && 1 / setToArray2(new Set3([, -0]))[1] == INFINITY2) ? noop3 : function(values2) {
9252 return new Set3(values2);
9254 function createToPairs(keysFunc) {
9255 return function(object) {
9256 var tag = getTag2(object);
9257 if (tag == mapTag4) {
9258 return mapToArray2(object);
9260 if (tag == setTag4) {
9261 return setToPairs(object);
9263 return baseToPairs(object, keysFunc(object));
9266 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
9267 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
9268 if (!isBindKey && typeof func != "function") {
9269 throw new TypeError2(FUNC_ERROR_TEXT3);
9271 var length = partials ? partials.length : 0;
9273 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
9274 partials = holders = undefined2;
9276 ary2 = ary2 === undefined2 ? ary2 : nativeMax2(toInteger(ary2), 0);
9277 arity = arity === undefined2 ? arity : toInteger(arity);
9278 length -= holders ? holders.length : 0;
9279 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
9280 var partialsRight = partials, holdersRight = holders;
9281 partials = holders = undefined2;
9283 var data = isBindKey ? undefined2 : getData(func);
9297 mergeData(newData, data);
9300 bitmask = newData[1];
9301 thisArg = newData[2];
9302 partials = newData[3];
9303 holders = newData[4];
9304 arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax2(newData[9] - length, 0);
9305 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
9306 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
9308 if (!bitmask || bitmask == WRAP_BIND_FLAG) {
9309 var result2 = createBind(func, bitmask, thisArg);
9310 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
9311 result2 = createCurry(func, bitmask, arity);
9312 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
9313 result2 = createPartial(func, bitmask, thisArg, partials);
9315 result2 = createHybrid.apply(undefined2, newData);
9317 var setter = data ? baseSetData : setData;
9318 return setWrapToString(setter(result2, newData), func, bitmask);
9320 function customDefaultsAssignIn(objValue, srcValue, key, object) {
9321 if (objValue === undefined2 || eq2(objValue, objectProto13[key]) && !hasOwnProperty10.call(object, key)) {
9326 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
9327 if (isObject3(objValue) && isObject3(srcValue)) {
9328 stack.set(srcValue, objValue);
9329 baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
9330 stack["delete"](srcValue);
9334 function customOmitClone(value) {
9335 return isPlainObject(value) ? undefined2 : value;
9337 function equalArrays2(array2, other, bitmask, customizer, equalFunc, stack) {
9338 var isPartial = bitmask & COMPARE_PARTIAL_FLAG5, arrLength = array2.length, othLength = other.length;
9339 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
9342 var arrStacked = stack.get(array2);
9343 var othStacked = stack.get(other);
9344 if (arrStacked && othStacked) {
9345 return arrStacked == other && othStacked == array2;
9347 var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG3 ? new SetCache2() : undefined2;
9348 stack.set(array2, other);
9349 stack.set(other, array2);
9350 while (++index < arrLength) {
9351 var arrValue = array2[index], othValue = other[index];
9353 var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, array2, other, stack);
9355 if (compared !== undefined2) {
9363 if (!arraySome2(other, function(othValue2, othIndex) {
9364 if (!cacheHas2(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
9365 return seen.push(othIndex);
9371 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
9376 stack["delete"](array2);
9377 stack["delete"](other);
9380 function equalByTag2(object, other, tag, bitmask, customizer, equalFunc, stack) {
9383 if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
9386 object = object.buffer;
9387 other = other.buffer;
9388 case arrayBufferTag3:
9389 if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array3(object), new Uint8Array3(other))) {
9396 return eq2(+object, +other);
9398 return object.name == other.name && object.message == other.message;
9401 return object == other + "";
9403 var convert = mapToArray2;
9405 var isPartial = bitmask & COMPARE_PARTIAL_FLAG5;
9406 convert || (convert = setToArray2);
9407 if (object.size != other.size && !isPartial) {
9410 var stacked = stack.get(object);
9412 return stacked == other;
9414 bitmask |= COMPARE_UNORDERED_FLAG3;
9415 stack.set(object, other);
9416 var result2 = equalArrays2(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
9417 stack["delete"](object);
9420 if (symbolValueOf2) {
9421 return symbolValueOf2.call(object) == symbolValueOf2.call(other);
9426 function equalObjects2(object, other, bitmask, customizer, equalFunc, stack) {
9427 var isPartial = bitmask & COMPARE_PARTIAL_FLAG5, objProps = getAllKeys2(object), objLength = objProps.length, othProps = getAllKeys2(other), othLength = othProps.length;
9428 if (objLength != othLength && !isPartial) {
9431 var index = objLength;
9433 var key = objProps[index];
9434 if (!(isPartial ? key in other : hasOwnProperty10.call(other, key))) {
9438 var objStacked = stack.get(object);
9439 var othStacked = stack.get(other);
9440 if (objStacked && othStacked) {
9441 return objStacked == other && othStacked == object;
9444 stack.set(object, other);
9445 stack.set(other, object);
9446 var skipCtor = isPartial;
9447 while (++index < objLength) {
9448 key = objProps[index];
9449 var objValue = object[key], othValue = other[key];
9451 var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
9453 if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
9457 skipCtor || (skipCtor = key == "constructor");
9459 if (result2 && !skipCtor) {
9460 var objCtor = object.constructor, othCtor = other.constructor;
9461 if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
9465 stack["delete"](object);
9466 stack["delete"](other);
9469 function flatRest(func) {
9470 return setToString(overRest(func, undefined2, flatten2), func + "");
9472 function getAllKeys2(object) {
9473 return baseGetAllKeys2(object, keys2, getSymbols2);
9475 function getAllKeysIn(object) {
9476 return baseGetAllKeys2(object, keysIn, getSymbolsIn);
9478 var getData = !metaMap ? noop3 : function(func) {
9479 return metaMap.get(func);
9481 function getFuncName(func) {
9482 var result2 = func.name + "", array2 = realNames[result2], length = hasOwnProperty10.call(realNames, result2) ? array2.length : 0;
9484 var data = array2[length], otherFunc = data.func;
9485 if (otherFunc == null || otherFunc == func) {
9491 function getHolder(func) {
9492 var object = hasOwnProperty10.call(lodash, "placeholder") ? lodash : func;
9493 return object.placeholder;
9495 function getIteratee() {
9496 var result2 = lodash.iteratee || iteratee;
9497 result2 = result2 === iteratee ? baseIteratee : result2;
9498 return arguments.length ? result2(arguments[0], arguments[1]) : result2;
9500 function getMapData2(map3, key) {
9501 var data = map3.__data__;
9502 return isKeyable2(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
9504 function getMatchData(object) {
9505 var result2 = keys2(object), length = result2.length;
9507 var key = result2[length], value = object[key];
9508 result2[length] = [key, value, isStrictComparable(value)];
9512 function getNative2(object, key) {
9513 var value = getValue2(object, key);
9514 return baseIsNative2(value) ? value : undefined2;
9516 function getRawTag2(value) {
9517 var isOwn = hasOwnProperty10.call(value, symToStringTag3), tag = value[symToStringTag3];
9519 value[symToStringTag3] = undefined2;
9520 var unmasked = true;
9523 var result2 = nativeObjectToString3.call(value);
9526 value[symToStringTag3] = tag;
9528 delete value[symToStringTag3];
9533 var getSymbols2 = !nativeGetSymbols2 ? stubArray2 : function(object) {
9534 if (object == null) {
9537 object = Object2(object);
9538 return arrayFilter2(nativeGetSymbols2(object), function(symbol) {
9539 return propertyIsEnumerable3.call(object, symbol);
9542 var getSymbolsIn = !nativeGetSymbols2 ? stubArray2 : function(object) {
9545 arrayPush2(result2, getSymbols2(object));
9546 object = getPrototype(object);
9550 var getTag2 = baseGetTag2;
9551 if (DataView3 && getTag2(new DataView3(new ArrayBuffer(1))) != dataViewTag4 || Map3 && getTag2(new Map3()) != mapTag4 || Promise3 && getTag2(Promise3.resolve()) != promiseTag2 || Set3 && getTag2(new Set3()) != setTag4 || WeakMap2 && getTag2(new WeakMap2()) != weakMapTag3) {
9552 getTag2 = function(value) {
9553 var result2 = baseGetTag2(value), Ctor = result2 == objectTag4 ? value.constructor : undefined2, ctorString = Ctor ? toSource2(Ctor) : "";
9555 switch (ctorString) {
9556 case dataViewCtorString2:
9557 return dataViewTag4;
9558 case mapCtorString2:
9560 case promiseCtorString2:
9562 case setCtorString2:
9564 case weakMapCtorString2:
9571 function getView(start2, end, transforms) {
9572 var index = -1, length = transforms.length;
9573 while (++index < length) {
9574 var data = transforms[index], size2 = data.size;
9575 switch (data.type) {
9583 end = nativeMin2(end, start2 + size2);
9586 start2 = nativeMax2(start2, end - size2);
9590 return { "start": start2, "end": end };
9592 function getWrapDetails(source) {
9593 var match = source.match(reWrapDetails);
9594 return match ? match[1].split(reSplitDetails) : [];
9596 function hasPath(object, path, hasFunc) {
9597 path = castPath(path, object);
9598 var index = -1, length = path.length, result2 = false;
9599 while (++index < length) {
9600 var key = toKey(path[index]);
9601 if (!(result2 = object != null && hasFunc(object, key))) {
9604 object = object[key];
9606 if (result2 || ++index != length) {
9609 length = object == null ? 0 : object.length;
9610 return !!length && isLength2(length) && isIndex2(key, length) && (isArray2(object) || isArguments2(object));
9612 function initCloneArray(array2) {
9613 var length = array2.length, result2 = new array2.constructor(length);
9614 if (length && typeof array2[0] == "string" && hasOwnProperty10.call(array2, "index")) {
9615 result2.index = array2.index;
9616 result2.input = array2.input;
9620 function initCloneObject(object) {
9621 return typeof object.constructor == "function" && !isPrototype2(object) ? baseCreate(getPrototype(object)) : {};
9623 function initCloneByTag(object, tag, isDeep) {
9624 var Ctor = object.constructor;
9626 case arrayBufferTag3:
9627 return cloneArrayBuffer(object);
9630 return new Ctor(+object);
9632 return cloneDataView(object, isDeep);
9639 case uint8ClampedTag2:
9642 return cloneTypedArray(object, isDeep);
9647 return new Ctor(object);
9649 return cloneRegExp(object);
9653 return cloneSymbol(object);
9656 function insertWrapDetails(source, details) {
9657 var length = details.length;
9661 var lastIndex = length - 1;
9662 details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
9663 details = details.join(length > 2 ? ", " : " ");
9664 return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
9666 function isFlattenable(value) {
9667 return isArray2(value) || isArguments2(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
9669 function isIndex2(value, length) {
9670 var type2 = typeof value;
9671 length = length == null ? MAX_SAFE_INTEGER3 : length;
9672 return !!length && (type2 == "number" || type2 != "symbol" && reIsUint2.test(value)) && (value > -1 && value % 1 == 0 && value < length);
9674 function isIterateeCall(value, index, object) {
9675 if (!isObject3(object)) {
9678 var type2 = typeof index;
9679 if (type2 == "number" ? isArrayLike2(object) && isIndex2(index, object.length) : type2 == "string" && index in object) {
9680 return eq2(object[index], value);
9684 function isKey(value, object) {
9685 if (isArray2(value)) {
9688 var type2 = typeof value;
9689 if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol2(value)) {
9692 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
9694 function isKeyable2(value) {
9695 var type2 = typeof value;
9696 return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
9698 function isLaziable(func) {
9699 var funcName = getFuncName(func), other = lodash[funcName];
9700 if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
9703 if (func === other) {
9706 var data = getData(other);
9707 return !!data && func === data[0];
9709 function isMasked2(func) {
9710 return !!maskSrcKey2 && maskSrcKey2 in func;
9712 var isMaskable = coreJsData2 ? isFunction2 : stubFalse2;
9713 function isPrototype2(value) {
9714 var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto13;
9715 return value === proto;
9717 function isStrictComparable(value) {
9718 return value === value && !isObject3(value);
9720 function matchesStrictComparable(key, srcValue) {
9721 return function(object) {
9722 if (object == null) {
9725 return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object));
9728 function memoizeCapped(func) {
9729 var result2 = memoize(func, function(key) {
9730 if (cache.size === MAX_MEMOIZE_SIZE) {
9735 var cache = result2.cache;
9738 function mergeData(data, source) {
9739 var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
9740 var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
9741 if (!(isCommon || isCombo)) {
9744 if (srcBitmask & WRAP_BIND_FLAG) {
9745 data[2] = source[2];
9746 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
9748 var value = source[3];
9750 var partials = data[3];
9751 data[3] = partials ? composeArgs(partials, value, source[4]) : value;
9752 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
9757 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
9758 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
9764 if (srcBitmask & WRAP_ARY_FLAG) {
9765 data[8] = data[8] == null ? source[8] : nativeMin2(data[8], source[8]);
9767 if (data[9] == null) {
9768 data[9] = source[9];
9770 data[0] = source[0];
9771 data[1] = newBitmask;
9774 function nativeKeysIn(object) {
9776 if (object != null) {
9777 for (var key in Object2(object)) {
9783 function objectToString2(value) {
9784 return nativeObjectToString3.call(value);
9786 function overRest(func, start2, transform3) {
9787 start2 = nativeMax2(start2 === undefined2 ? func.length - 1 : start2, 0);
9789 var args = arguments, index = -1, length = nativeMax2(args.length - start2, 0), array2 = Array2(length);
9790 while (++index < length) {
9791 array2[index] = args[start2 + index];
9794 var otherArgs = Array2(start2 + 1);
9795 while (++index < start2) {
9796 otherArgs[index] = args[index];
9798 otherArgs[start2] = transform3(array2);
9799 return apply(func, this, otherArgs);
9802 function parent(object, path) {
9803 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
9805 function reorder(array2, indexes) {
9806 var arrLength = array2.length, length = nativeMin2(indexes.length, arrLength), oldArray = copyArray(array2);
9808 var index = indexes[length];
9809 array2[length] = isIndex2(index, arrLength) ? oldArray[index] : undefined2;
9813 function safeGet(object, key) {
9814 if (key === "constructor" && typeof object[key] === "function") {
9817 if (key == "__proto__") {
9822 var setData = shortOut(baseSetData);
9823 var setTimeout2 = ctxSetTimeout || function(func, wait) {
9824 return root3.setTimeout(func, wait);
9826 var setToString = shortOut(baseSetToString);
9827 function setWrapToString(wrapper, reference, bitmask) {
9828 var source = reference + "";
9829 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
9831 function shortOut(func) {
9832 var count = 0, lastCalled = 0;
9834 var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
9836 if (remaining > 0) {
9837 if (++count >= HOT_COUNT) {
9838 return arguments[0];
9843 return func.apply(undefined2, arguments);
9846 function shuffleSelf(array2, size2) {
9847 var index = -1, length = array2.length, lastIndex = length - 1;
9848 size2 = size2 === undefined2 ? length : size2;
9849 while (++index < size2) {
9850 var rand = baseRandom(index, lastIndex), value = array2[rand];
9851 array2[rand] = array2[index];
9852 array2[index] = value;
9854 array2.length = size2;
9857 var stringToPath = memoizeCapped(function(string) {
9859 if (string.charCodeAt(0) === 46) {
9862 string.replace(rePropName, function(match, number3, quote2, subString) {
9863 result2.push(quote2 ? subString.replace(reEscapeChar, "$1") : number3 || match);
9867 function toKey(value) {
9868 if (typeof value == "string" || isSymbol2(value)) {
9871 var result2 = value + "";
9872 return result2 == "0" && 1 / value == -INFINITY2 ? "-0" : result2;
9874 function toSource2(func) {
9877 return funcToString3.call(func);
9887 function updateWrapDetails(details, bitmask) {
9888 arrayEach(wrapFlags, function(pair3) {
9889 var value = "_." + pair3[0];
9890 if (bitmask & pair3[1] && !arrayIncludes(details, value)) {
9891 details.push(value);
9894 return details.sort();
9896 function wrapperClone(wrapper) {
9897 if (wrapper instanceof LazyWrapper) {
9898 return wrapper.clone();
9900 var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
9901 result2.__actions__ = copyArray(wrapper.__actions__);
9902 result2.__index__ = wrapper.__index__;
9903 result2.__values__ = wrapper.__values__;
9906 function chunk(array2, size2, guard) {
9907 if (guard ? isIterateeCall(array2, size2, guard) : size2 === undefined2) {
9910 size2 = nativeMax2(toInteger(size2), 0);
9912 var length = array2 == null ? 0 : array2.length;
9913 if (!length || size2 < 1) {
9916 var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
9917 while (index < length) {
9918 result2[resIndex++] = baseSlice(array2, index, index += size2);
9922 function compact(array2) {
9923 var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result2 = [];
9924 while (++index < length) {
9925 var value = array2[index];
9927 result2[resIndex++] = value;
9933 var length = arguments.length;
9937 var args = Array2(length - 1), array2 = arguments[0], index = length;
9939 args[index - 1] = arguments[index];
9941 return arrayPush2(isArray2(array2) ? copyArray(array2) : [array2], baseFlatten(args, 1));
9943 var difference = baseRest(function(array2, values2) {
9944 return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
9946 var differenceBy = baseRest(function(array2, values2) {
9947 var iteratee2 = last(values2);
9948 if (isArrayLikeObject(iteratee2)) {
9949 iteratee2 = undefined2;
9951 return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
9953 var differenceWith = baseRest(function(array2, values2) {
9954 var comparator = last(values2);
9955 if (isArrayLikeObject(comparator)) {
9956 comparator = undefined2;
9958 return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : [];
9960 function drop(array2, n3, guard) {
9961 var length = array2 == null ? 0 : array2.length;
9965 n3 = guard || n3 === undefined2 ? 1 : toInteger(n3);
9966 return baseSlice(array2, n3 < 0 ? 0 : n3, length);
9968 function dropRight(array2, n3, guard) {
9969 var length = array2 == null ? 0 : array2.length;
9973 n3 = guard || n3 === undefined2 ? 1 : toInteger(n3);
9975 return baseSlice(array2, 0, n3 < 0 ? 0 : n3);
9977 function dropRightWhile(array2, predicate) {
9978 return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), true, true) : [];
9980 function dropWhile(array2, predicate) {
9981 return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), true) : [];
9983 function fill(array2, value, start2, end) {
9984 var length = array2 == null ? 0 : array2.length;
9988 if (start2 && typeof start2 != "number" && isIterateeCall(array2, value, start2)) {
9992 return baseFill(array2, value, start2, end);
9994 function findIndex(array2, predicate, fromIndex) {
9995 var length = array2 == null ? 0 : array2.length;
9999 var index = fromIndex == null ? 0 : toInteger(fromIndex);
10001 index = nativeMax2(length + index, 0);
10003 return baseFindIndex(array2, getIteratee(predicate, 3), index);
10005 function findLastIndex(array2, predicate, fromIndex) {
10006 var length = array2 == null ? 0 : array2.length;
10010 var index = length - 1;
10011 if (fromIndex !== undefined2) {
10012 index = toInteger(fromIndex);
10013 index = fromIndex < 0 ? nativeMax2(length + index, 0) : nativeMin2(index, length - 1);
10015 return baseFindIndex(array2, getIteratee(predicate, 3), index, true);
10017 function flatten2(array2) {
10018 var length = array2 == null ? 0 : array2.length;
10019 return length ? baseFlatten(array2, 1) : [];
10021 function flattenDeep(array2) {
10022 var length = array2 == null ? 0 : array2.length;
10023 return length ? baseFlatten(array2, INFINITY2) : [];
10025 function flattenDepth(array2, depth) {
10026 var length = array2 == null ? 0 : array2.length;
10030 depth = depth === undefined2 ? 1 : toInteger(depth);
10031 return baseFlatten(array2, depth);
10033 function fromPairs(pairs2) {
10034 var index = -1, length = pairs2 == null ? 0 : pairs2.length, result2 = {};
10035 while (++index < length) {
10036 var pair3 = pairs2[index];
10037 result2[pair3[0]] = pair3[1];
10041 function head(array2) {
10042 return array2 && array2.length ? array2[0] : undefined2;
10044 function indexOf(array2, value, fromIndex) {
10045 var length = array2 == null ? 0 : array2.length;
10049 var index = fromIndex == null ? 0 : toInteger(fromIndex);
10051 index = nativeMax2(length + index, 0);
10053 return baseIndexOf(array2, value, index);
10055 function initial(array2) {
10056 var length = array2 == null ? 0 : array2.length;
10057 return length ? baseSlice(array2, 0, -1) : [];
10059 var intersection = baseRest(function(arrays) {
10060 var mapped = arrayMap2(arrays, castArrayLikeObject);
10061 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
10063 var intersectionBy = baseRest(function(arrays) {
10064 var iteratee2 = last(arrays), mapped = arrayMap2(arrays, castArrayLikeObject);
10065 if (iteratee2 === last(mapped)) {
10066 iteratee2 = undefined2;
10070 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
10072 var intersectionWith = baseRest(function(arrays) {
10073 var comparator = last(arrays), mapped = arrayMap2(arrays, castArrayLikeObject);
10074 comparator = typeof comparator == "function" ? comparator : undefined2;
10078 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
10080 function join(array2, separator) {
10081 return array2 == null ? "" : nativeJoin.call(array2, separator);
10083 function last(array2) {
10084 var length = array2 == null ? 0 : array2.length;
10085 return length ? array2[length - 1] : undefined2;
10087 function lastIndexOf(array2, value, fromIndex) {
10088 var length = array2 == null ? 0 : array2.length;
10092 var index = length;
10093 if (fromIndex !== undefined2) {
10094 index = toInteger(fromIndex);
10095 index = index < 0 ? nativeMax2(length + index, 0) : nativeMin2(index, length - 1);
10097 return value === value ? strictLastIndexOf(array2, value, index) : baseFindIndex(array2, baseIsNaN, index, true);
10099 function nth(array2, n3) {
10100 return array2 && array2.length ? baseNth(array2, toInteger(n3)) : undefined2;
10102 var pull = baseRest(pullAll);
10103 function pullAll(array2, values2) {
10104 return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
10106 function pullAllBy(array2, values2, iteratee2) {
10107 return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2, getIteratee(iteratee2, 2)) : array2;
10109 function pullAllWith(array2, values2, comparator) {
10110 return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2, undefined2, comparator) : array2;
10112 var pullAt = flatRest(function(array2, indexes) {
10113 var length = array2 == null ? 0 : array2.length, result2 = baseAt(array2, indexes);
10114 basePullAt(array2, arrayMap2(indexes, function(index) {
10115 return isIndex2(index, length) ? +index : index;
10116 }).sort(compareAscending));
10119 function remove2(array2, predicate) {
10121 if (!(array2 && array2.length)) {
10124 var index = -1, indexes = [], length = array2.length;
10125 predicate = getIteratee(predicate, 3);
10126 while (++index < length) {
10127 var value = array2[index];
10128 if (predicate(value, index, array2)) {
10129 result2.push(value);
10130 indexes.push(index);
10133 basePullAt(array2, indexes);
10136 function reverse(array2) {
10137 return array2 == null ? array2 : nativeReverse.call(array2);
10139 function slice(array2, start2, end) {
10140 var length = array2 == null ? 0 : array2.length;
10144 if (end && typeof end != "number" && isIterateeCall(array2, start2, end)) {
10148 start2 = start2 == null ? 0 : toInteger(start2);
10149 end = end === undefined2 ? length : toInteger(end);
10151 return baseSlice(array2, start2, end);
10153 function sortedIndex(array2, value) {
10154 return baseSortedIndex(array2, value);
10156 function sortedIndexBy(array2, value, iteratee2) {
10157 return baseSortedIndexBy(array2, value, getIteratee(iteratee2, 2));
10159 function sortedIndexOf(array2, value) {
10160 var length = array2 == null ? 0 : array2.length;
10162 var index = baseSortedIndex(array2, value);
10163 if (index < length && eq2(array2[index], value)) {
10169 function sortedLastIndex(array2, value) {
10170 return baseSortedIndex(array2, value, true);
10172 function sortedLastIndexBy(array2, value, iteratee2) {
10173 return baseSortedIndexBy(array2, value, getIteratee(iteratee2, 2), true);
10175 function sortedLastIndexOf(array2, value) {
10176 var length = array2 == null ? 0 : array2.length;
10178 var index = baseSortedIndex(array2, value, true) - 1;
10179 if (eq2(array2[index], value)) {
10185 function sortedUniq(array2) {
10186 return array2 && array2.length ? baseSortedUniq(array2) : [];
10188 function sortedUniqBy(array2, iteratee2) {
10189 return array2 && array2.length ? baseSortedUniq(array2, getIteratee(iteratee2, 2)) : [];
10191 function tail(array2) {
10192 var length = array2 == null ? 0 : array2.length;
10193 return length ? baseSlice(array2, 1, length) : [];
10195 function take(array2, n3, guard) {
10196 if (!(array2 && array2.length)) {
10199 n3 = guard || n3 === undefined2 ? 1 : toInteger(n3);
10200 return baseSlice(array2, 0, n3 < 0 ? 0 : n3);
10202 function takeRight(array2, n3, guard) {
10203 var length = array2 == null ? 0 : array2.length;
10207 n3 = guard || n3 === undefined2 ? 1 : toInteger(n3);
10209 return baseSlice(array2, n3 < 0 ? 0 : n3, length);
10211 function takeRightWhile(array2, predicate) {
10212 return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), false, true) : [];
10214 function takeWhile(array2, predicate) {
10215 return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3)) : [];
10217 var union = baseRest(function(arrays) {
10218 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
10220 var unionBy = baseRest(function(arrays) {
10221 var iteratee2 = last(arrays);
10222 if (isArrayLikeObject(iteratee2)) {
10223 iteratee2 = undefined2;
10225 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
10227 var unionWith = baseRest(function(arrays) {
10228 var comparator = last(arrays);
10229 comparator = typeof comparator == "function" ? comparator : undefined2;
10230 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator);
10232 function uniq(array2) {
10233 return array2 && array2.length ? baseUniq(array2) : [];
10235 function uniqBy(array2, iteratee2) {
10236 return array2 && array2.length ? baseUniq(array2, getIteratee(iteratee2, 2)) : [];
10238 function uniqWith(array2, comparator) {
10239 comparator = typeof comparator == "function" ? comparator : undefined2;
10240 return array2 && array2.length ? baseUniq(array2, undefined2, comparator) : [];
10242 function unzip(array2) {
10243 if (!(array2 && array2.length)) {
10247 array2 = arrayFilter2(array2, function(group) {
10248 if (isArrayLikeObject(group)) {
10249 length = nativeMax2(group.length, length);
10253 return baseTimes2(length, function(index) {
10254 return arrayMap2(array2, baseProperty(index));
10257 function unzipWith(array2, iteratee2) {
10258 if (!(array2 && array2.length)) {
10261 var result2 = unzip(array2);
10262 if (iteratee2 == null) {
10265 return arrayMap2(result2, function(group) {
10266 return apply(iteratee2, undefined2, group);
10269 var without = baseRest(function(array2, values2) {
10270 return isArrayLikeObject(array2) ? baseDifference(array2, values2) : [];
10272 var xor = baseRest(function(arrays) {
10273 return baseXor(arrayFilter2(arrays, isArrayLikeObject));
10275 var xorBy = baseRest(function(arrays) {
10276 var iteratee2 = last(arrays);
10277 if (isArrayLikeObject(iteratee2)) {
10278 iteratee2 = undefined2;
10280 return baseXor(arrayFilter2(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
10282 var xorWith = baseRest(function(arrays) {
10283 var comparator = last(arrays);
10284 comparator = typeof comparator == "function" ? comparator : undefined2;
10285 return baseXor(arrayFilter2(arrays, isArrayLikeObject), undefined2, comparator);
10287 var zip = baseRest(unzip);
10288 function zipObject(props, values2) {
10289 return baseZipObject(props || [], values2 || [], assignValue);
10291 function zipObjectDeep(props, values2) {
10292 return baseZipObject(props || [], values2 || [], baseSet);
10294 var zipWith = baseRest(function(arrays) {
10295 var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2;
10296 iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2;
10297 return unzipWith(arrays, iteratee2);
10299 function chain(value) {
10300 var result2 = lodash(value);
10301 result2.__chain__ = true;
10304 function tap(value, interceptor) {
10305 interceptor(value);
10308 function thru(value, interceptor) {
10309 return interceptor(value);
10311 var wrapperAt = flatRest(function(paths) {
10312 var length = paths.length, start2 = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
10313 return baseAt(object, paths);
10315 if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex2(start2)) {
10316 return this.thru(interceptor);
10318 value = value.slice(start2, +start2 + (length ? 1 : 0));
10319 value.__actions__.push({
10321 "args": [interceptor],
10322 "thisArg": undefined2
10324 return new LodashWrapper(value, this.__chain__).thru(function(array2) {
10325 if (length && !array2.length) {
10326 array2.push(undefined2);
10331 function wrapperChain() {
10332 return chain(this);
10334 function wrapperCommit() {
10335 return new LodashWrapper(this.value(), this.__chain__);
10337 function wrapperNext() {
10338 if (this.__values__ === undefined2) {
10339 this.__values__ = toArray(this.value());
10341 var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++];
10342 return { "done": done, "value": value };
10344 function wrapperToIterator() {
10347 function wrapperPlant(value) {
10348 var result2, parent2 = this;
10349 while (parent2 instanceof baseLodash) {
10350 var clone2 = wrapperClone(parent2);
10351 clone2.__index__ = 0;
10352 clone2.__values__ = undefined2;
10354 previous.__wrapped__ = clone2;
10358 var previous = clone2;
10359 parent2 = parent2.__wrapped__;
10361 previous.__wrapped__ = value;
10364 function wrapperReverse() {
10365 var value = this.__wrapped__;
10366 if (value instanceof LazyWrapper) {
10367 var wrapped = value;
10368 if (this.__actions__.length) {
10369 wrapped = new LazyWrapper(this);
10371 wrapped = wrapped.reverse();
10372 wrapped.__actions__.push({
10375 "thisArg": undefined2
10377 return new LodashWrapper(wrapped, this.__chain__);
10379 return this.thru(reverse);
10381 function wrapperValue() {
10382 return baseWrapperValue(this.__wrapped__, this.__actions__);
10384 var countBy = createAggregator(function(result2, value, key) {
10385 if (hasOwnProperty10.call(result2, key)) {
10388 baseAssignValue(result2, key, 1);
10391 function every(collection, predicate, guard) {
10392 var func = isArray2(collection) ? arrayEvery : baseEvery;
10393 if (guard && isIterateeCall(collection, predicate, guard)) {
10394 predicate = undefined2;
10396 return func(collection, getIteratee(predicate, 3));
10398 function filter2(collection, predicate) {
10399 var func = isArray2(collection) ? arrayFilter2 : baseFilter;
10400 return func(collection, getIteratee(predicate, 3));
10402 var find2 = createFind(findIndex);
10403 var findLast = createFind(findLastIndex);
10404 function flatMap(collection, iteratee2) {
10405 return baseFlatten(map2(collection, iteratee2), 1);
10407 function flatMapDeep(collection, iteratee2) {
10408 return baseFlatten(map2(collection, iteratee2), INFINITY2);
10410 function flatMapDepth(collection, iteratee2, depth) {
10411 depth = depth === undefined2 ? 1 : toInteger(depth);
10412 return baseFlatten(map2(collection, iteratee2), depth);
10414 function forEach(collection, iteratee2) {
10415 var func = isArray2(collection) ? arrayEach : baseEach;
10416 return func(collection, getIteratee(iteratee2, 3));
10418 function forEachRight(collection, iteratee2) {
10419 var func = isArray2(collection) ? arrayEachRight : baseEachRight;
10420 return func(collection, getIteratee(iteratee2, 3));
10422 var groupBy = createAggregator(function(result2, value, key) {
10423 if (hasOwnProperty10.call(result2, key)) {
10424 result2[key].push(value);
10426 baseAssignValue(result2, key, [value]);
10429 function includes(collection, value, fromIndex, guard) {
10430 collection = isArrayLike2(collection) ? collection : values(collection);
10431 fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
10432 var length = collection.length;
10433 if (fromIndex < 0) {
10434 fromIndex = nativeMax2(length + fromIndex, 0);
10436 return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
10438 var invokeMap = baseRest(function(collection, path, args) {
10439 var index = -1, isFunc = typeof path == "function", result2 = isArrayLike2(collection) ? Array2(collection.length) : [];
10440 baseEach(collection, function(value) {
10441 result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
10445 var keyBy = createAggregator(function(result2, value, key) {
10446 baseAssignValue(result2, key, value);
10448 function map2(collection, iteratee2) {
10449 var func = isArray2(collection) ? arrayMap2 : baseMap;
10450 return func(collection, getIteratee(iteratee2, 3));
10452 function orderBy(collection, iteratees, orders, guard) {
10453 if (collection == null) {
10456 if (!isArray2(iteratees)) {
10457 iteratees = iteratees == null ? [] : [iteratees];
10459 orders = guard ? undefined2 : orders;
10460 if (!isArray2(orders)) {
10461 orders = orders == null ? [] : [orders];
10463 return baseOrderBy(collection, iteratees, orders);
10465 var partition = createAggregator(function(result2, value, key) {
10466 result2[key ? 0 : 1].push(value);
10470 function reduce(collection, iteratee2, accumulator) {
10471 var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
10472 return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
10474 function reduceRight(collection, iteratee2, accumulator) {
10475 var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
10476 return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
10478 function reject(collection, predicate) {
10479 var func = isArray2(collection) ? arrayFilter2 : baseFilter;
10480 return func(collection, negate(getIteratee(predicate, 3)));
10482 function sample(collection) {
10483 var func = isArray2(collection) ? arraySample : baseSample;
10484 return func(collection);
10486 function sampleSize(collection, n3, guard) {
10487 if (guard ? isIterateeCall(collection, n3, guard) : n3 === undefined2) {
10490 n3 = toInteger(n3);
10492 var func = isArray2(collection) ? arraySampleSize : baseSampleSize;
10493 return func(collection, n3);
10495 function shuffle(collection) {
10496 var func = isArray2(collection) ? arrayShuffle : baseShuffle;
10497 return func(collection);
10499 function size(collection) {
10500 if (collection == null) {
10503 if (isArrayLike2(collection)) {
10504 return isString(collection) ? stringSize(collection) : collection.length;
10506 var tag = getTag2(collection);
10507 if (tag == mapTag4 || tag == setTag4) {
10508 return collection.size;
10510 return baseKeys2(collection).length;
10512 function some(collection, predicate, guard) {
10513 var func = isArray2(collection) ? arraySome2 : baseSome;
10514 if (guard && isIterateeCall(collection, predicate, guard)) {
10515 predicate = undefined2;
10517 return func(collection, getIteratee(predicate, 3));
10519 var sortBy = baseRest(function(collection, iteratees) {
10520 if (collection == null) {
10523 var length = iteratees.length;
10524 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
10526 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
10527 iteratees = [iteratees[0]];
10529 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
10531 var now3 = ctxNow || function() {
10532 return root3.Date.now();
10534 function after(n3, func) {
10535 if (typeof func != "function") {
10536 throw new TypeError2(FUNC_ERROR_TEXT3);
10538 n3 = toInteger(n3);
10539 return function() {
10541 return func.apply(this, arguments);
10545 function ary(func, n3, guard) {
10546 n3 = guard ? undefined2 : n3;
10547 n3 = func && n3 == null ? func.length : n3;
10548 return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n3);
10550 function before(n3, func) {
10552 if (typeof func != "function") {
10553 throw new TypeError2(FUNC_ERROR_TEXT3);
10555 n3 = toInteger(n3);
10556 return function() {
10558 result2 = func.apply(this, arguments);
10566 var bind = baseRest(function(func, thisArg, partials) {
10567 var bitmask = WRAP_BIND_FLAG;
10568 if (partials.length) {
10569 var holders = replaceHolders(partials, getHolder(bind));
10570 bitmask |= WRAP_PARTIAL_FLAG;
10572 return createWrap(func, bitmask, thisArg, partials, holders);
10574 var bindKey2 = baseRest(function(object, key, partials) {
10575 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
10576 if (partials.length) {
10577 var holders = replaceHolders(partials, getHolder(bindKey2));
10578 bitmask |= WRAP_PARTIAL_FLAG;
10580 return createWrap(key, bitmask, object, partials, holders);
10582 function curry(func, arity, guard) {
10583 arity = guard ? undefined2 : arity;
10584 var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
10585 result2.placeholder = curry.placeholder;
10588 function curryRight(func, arity, guard) {
10589 arity = guard ? undefined2 : arity;
10590 var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
10591 result2.placeholder = curryRight.placeholder;
10594 function debounce2(func, wait, options2) {
10595 var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
10596 if (typeof func != "function") {
10597 throw new TypeError2(FUNC_ERROR_TEXT3);
10599 wait = toNumber3(wait) || 0;
10600 if (isObject3(options2)) {
10601 leading = !!options2.leading;
10602 maxing = "maxWait" in options2;
10603 maxWait = maxing ? nativeMax2(toNumber3(options2.maxWait) || 0, wait) : maxWait;
10604 trailing = "trailing" in options2 ? !!options2.trailing : trailing;
10606 function invokeFunc(time) {
10607 var args = lastArgs, thisArg = lastThis;
10608 lastArgs = lastThis = undefined2;
10609 lastInvokeTime = time;
10610 result2 = func.apply(thisArg, args);
10613 function leadingEdge(time) {
10614 lastInvokeTime = time;
10615 timerId = setTimeout2(timerExpired, wait);
10616 return leading ? invokeFunc(time) : result2;
10618 function remainingWait(time) {
10619 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
10620 return maxing ? nativeMin2(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
10622 function shouldInvoke(time) {
10623 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
10624 return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
10626 function timerExpired() {
10628 if (shouldInvoke(time)) {
10629 return trailingEdge(time);
10631 timerId = setTimeout2(timerExpired, remainingWait(time));
10633 function trailingEdge(time) {
10634 timerId = undefined2;
10635 if (trailing && lastArgs) {
10636 return invokeFunc(time);
10638 lastArgs = lastThis = undefined2;
10641 function cancel() {
10642 if (timerId !== undefined2) {
10643 clearTimeout2(timerId);
10645 lastInvokeTime = 0;
10646 lastArgs = lastCallTime = lastThis = timerId = undefined2;
10649 return timerId === undefined2 ? result2 : trailingEdge(now3());
10651 function debounced() {
10652 var time = now3(), isInvoking = shouldInvoke(time);
10653 lastArgs = arguments;
10655 lastCallTime = time;
10657 if (timerId === undefined2) {
10658 return leadingEdge(lastCallTime);
10661 clearTimeout2(timerId);
10662 timerId = setTimeout2(timerExpired, wait);
10663 return invokeFunc(lastCallTime);
10666 if (timerId === undefined2) {
10667 timerId = setTimeout2(timerExpired, wait);
10671 debounced.cancel = cancel;
10672 debounced.flush = flush;
10675 var defer = baseRest(function(func, args) {
10676 return baseDelay(func, 1, args);
10678 var delay = baseRest(function(func, wait, args) {
10679 return baseDelay(func, toNumber3(wait) || 0, args);
10681 function flip(func) {
10682 return createWrap(func, WRAP_FLIP_FLAG);
10684 function memoize(func, resolver) {
10685 if (typeof func != "function" || resolver != null && typeof resolver != "function") {
10686 throw new TypeError2(FUNC_ERROR_TEXT3);
10688 var memoized = function() {
10689 var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
10690 if (cache.has(key)) {
10691 return cache.get(key);
10693 var result2 = func.apply(this, args);
10694 memoized.cache = cache.set(key, result2) || cache;
10697 memoized.cache = new (memoize.Cache || MapCache2)();
10700 memoize.Cache = MapCache2;
10701 function negate(predicate) {
10702 if (typeof predicate != "function") {
10703 throw new TypeError2(FUNC_ERROR_TEXT3);
10705 return function() {
10706 var args = arguments;
10707 switch (args.length) {
10709 return !predicate.call(this);
10711 return !predicate.call(this, args[0]);
10713 return !predicate.call(this, args[0], args[1]);
10715 return !predicate.call(this, args[0], args[1], args[2]);
10717 return !predicate.apply(this, args);
10720 function once(func) {
10721 return before(2, func);
10723 var overArgs = castRest(function(func, transforms) {
10724 transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap2(transforms[0], baseUnary2(getIteratee())) : arrayMap2(baseFlatten(transforms, 1), baseUnary2(getIteratee()));
10725 var funcsLength = transforms.length;
10726 return baseRest(function(args) {
10727 var index = -1, length = nativeMin2(args.length, funcsLength);
10728 while (++index < length) {
10729 args[index] = transforms[index].call(this, args[index]);
10731 return apply(func, this, args);
10734 var partial = baseRest(function(func, partials) {
10735 var holders = replaceHolders(partials, getHolder(partial));
10736 return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders);
10738 var partialRight = baseRest(function(func, partials) {
10739 var holders = replaceHolders(partials, getHolder(partialRight));
10740 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders);
10742 var rearg = flatRest(function(func, indexes) {
10743 return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes);
10745 function rest(func, start2) {
10746 if (typeof func != "function") {
10747 throw new TypeError2(FUNC_ERROR_TEXT3);
10749 start2 = start2 === undefined2 ? start2 : toInteger(start2);
10750 return baseRest(func, start2);
10752 function spread(func, start2) {
10753 if (typeof func != "function") {
10754 throw new TypeError2(FUNC_ERROR_TEXT3);
10756 start2 = start2 == null ? 0 : nativeMax2(toInteger(start2), 0);
10757 return baseRest(function(args) {
10758 var array2 = args[start2], otherArgs = castSlice(args, 0, start2);
10760 arrayPush2(otherArgs, array2);
10762 return apply(func, this, otherArgs);
10765 function throttle2(func, wait, options2) {
10766 var leading = true, trailing = true;
10767 if (typeof func != "function") {
10768 throw new TypeError2(FUNC_ERROR_TEXT3);
10770 if (isObject3(options2)) {
10771 leading = "leading" in options2 ? !!options2.leading : leading;
10772 trailing = "trailing" in options2 ? !!options2.trailing : trailing;
10774 return debounce2(func, wait, {
10775 "leading": leading,
10777 "trailing": trailing
10780 function unary(func) {
10781 return ary(func, 1);
10783 function wrap2(value, wrapper) {
10784 return partial(castFunction(wrapper), value);
10786 function castArray() {
10787 if (!arguments.length) {
10790 var value = arguments[0];
10791 return isArray2(value) ? value : [value];
10793 function clone(value) {
10794 return baseClone(value, CLONE_SYMBOLS_FLAG);
10796 function cloneWith(value, customizer) {
10797 customizer = typeof customizer == "function" ? customizer : undefined2;
10798 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
10800 function cloneDeep(value) {
10801 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
10803 function cloneDeepWith(value, customizer) {
10804 customizer = typeof customizer == "function" ? customizer : undefined2;
10805 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
10807 function conformsTo(object, source) {
10808 return source == null || baseConformsTo(object, source, keys2(source));
10810 function eq2(value, other) {
10811 return value === other || value !== value && other !== other;
10813 var gt2 = createRelationalOperation(baseGt);
10814 var gte = createRelationalOperation(function(value, other) {
10815 return value >= other;
10817 var isArguments2 = baseIsArguments2(function() {
10819 }()) ? baseIsArguments2 : function(value) {
10820 return isObjectLike2(value) && hasOwnProperty10.call(value, "callee") && !propertyIsEnumerable3.call(value, "callee");
10822 var isArray2 = Array2.isArray;
10823 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary2(nodeIsArrayBuffer) : baseIsArrayBuffer;
10824 function isArrayLike2(value) {
10825 return value != null && isLength2(value.length) && !isFunction2(value);
10827 function isArrayLikeObject(value) {
10828 return isObjectLike2(value) && isArrayLike2(value);
10830 function isBoolean(value) {
10831 return value === true || value === false || isObjectLike2(value) && baseGetTag2(value) == boolTag3;
10833 var isBuffer2 = nativeIsBuffer2 || stubFalse2;
10834 var isDate = nodeIsDate ? baseUnary2(nodeIsDate) : baseIsDate;
10835 function isElement2(value) {
10836 return isObjectLike2(value) && value.nodeType === 1 && !isPlainObject(value);
10838 function isEmpty(value) {
10839 if (value == null) {
10842 if (isArrayLike2(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer2(value) || isTypedArray2(value) || isArguments2(value))) {
10843 return !value.length;
10845 var tag = getTag2(value);
10846 if (tag == mapTag4 || tag == setTag4) {
10847 return !value.size;
10849 if (isPrototype2(value)) {
10850 return !baseKeys2(value).length;
10852 for (var key in value) {
10853 if (hasOwnProperty10.call(value, key)) {
10859 function isEqual4(value, other) {
10860 return baseIsEqual2(value, other);
10862 function isEqualWith(value, other, customizer) {
10863 customizer = typeof customizer == "function" ? customizer : undefined2;
10864 var result2 = customizer ? customizer(value, other) : undefined2;
10865 return result2 === undefined2 ? baseIsEqual2(value, other, undefined2, customizer) : !!result2;
10867 function isError(value) {
10868 if (!isObjectLike2(value)) {
10871 var tag = baseGetTag2(value);
10872 return tag == errorTag3 || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
10874 function isFinite2(value) {
10875 return typeof value == "number" && nativeIsFinite(value);
10877 function isFunction2(value) {
10878 if (!isObject3(value)) {
10881 var tag = baseGetTag2(value);
10882 return tag == funcTag3 || tag == genTag2 || tag == asyncTag2 || tag == proxyTag2;
10884 function isInteger(value) {
10885 return typeof value == "number" && value == toInteger(value);
10887 function isLength2(value) {
10888 return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER3;
10890 function isObject3(value) {
10891 var type2 = typeof value;
10892 return value != null && (type2 == "object" || type2 == "function");
10894 function isObjectLike2(value) {
10895 return value != null && typeof value == "object";
10897 var isMap = nodeIsMap ? baseUnary2(nodeIsMap) : baseIsMap;
10898 function isMatch(object, source) {
10899 return object === source || baseIsMatch(object, source, getMatchData(source));
10901 function isMatchWith(object, source, customizer) {
10902 customizer = typeof customizer == "function" ? customizer : undefined2;
10903 return baseIsMatch(object, source, getMatchData(source), customizer);
10905 function isNaN2(value) {
10906 return isNumber3(value) && value != +value;
10908 function isNative(value) {
10909 if (isMaskable(value)) {
10910 throw new Error2(CORE_ERROR_TEXT);
10912 return baseIsNative2(value);
10914 function isNull(value) {
10915 return value === null;
10917 function isNil(value) {
10918 return value == null;
10920 function isNumber3(value) {
10921 return typeof value == "number" || isObjectLike2(value) && baseGetTag2(value) == numberTag4;
10923 function isPlainObject(value) {
10924 if (!isObjectLike2(value) || baseGetTag2(value) != objectTag4) {
10927 var proto = getPrototype(value);
10928 if (proto === null) {
10931 var Ctor = hasOwnProperty10.call(proto, "constructor") && proto.constructor;
10932 return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
10934 var isRegExp = nodeIsRegExp ? baseUnary2(nodeIsRegExp) : baseIsRegExp;
10935 function isSafeInteger(value) {
10936 return isInteger(value) && value >= -MAX_SAFE_INTEGER3 && value <= MAX_SAFE_INTEGER3;
10938 var isSet = nodeIsSet ? baseUnary2(nodeIsSet) : baseIsSet;
10939 function isString(value) {
10940 return typeof value == "string" || !isArray2(value) && isObjectLike2(value) && baseGetTag2(value) == stringTag3;
10942 function isSymbol2(value) {
10943 return typeof value == "symbol" || isObjectLike2(value) && baseGetTag2(value) == symbolTag3;
10945 var isTypedArray2 = nodeIsTypedArray2 ? baseUnary2(nodeIsTypedArray2) : baseIsTypedArray2;
10946 function isUndefined(value) {
10947 return value === undefined2;
10949 function isWeakMap(value) {
10950 return isObjectLike2(value) && getTag2(value) == weakMapTag3;
10952 function isWeakSet(value) {
10953 return isObjectLike2(value) && baseGetTag2(value) == weakSetTag;
10955 var lt2 = createRelationalOperation(baseLt);
10956 var lte = createRelationalOperation(function(value, other) {
10957 return value <= other;
10959 function toArray(value) {
10963 if (isArrayLike2(value)) {
10964 return isString(value) ? stringToArray(value) : copyArray(value);
10966 if (symIterator && value[symIterator]) {
10967 return iteratorToArray(value[symIterator]());
10969 var tag = getTag2(value), func = tag == mapTag4 ? mapToArray2 : tag == setTag4 ? setToArray2 : values;
10970 return func(value);
10972 function toFinite(value) {
10974 return value === 0 ? value : 0;
10976 value = toNumber3(value);
10977 if (value === INFINITY2 || value === -INFINITY2) {
10978 var sign2 = value < 0 ? -1 : 1;
10979 return sign2 * MAX_INTEGER;
10981 return value === value ? value : 0;
10983 function toInteger(value) {
10984 var result2 = toFinite(value), remainder = result2 % 1;
10985 return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
10987 function toLength(value) {
10988 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
10990 function toNumber3(value) {
10991 if (typeof value == "number") {
10994 if (isSymbol2(value)) {
10997 if (isObject3(value)) {
10998 var other = typeof value.valueOf == "function" ? value.valueOf() : value;
10999 value = isObject3(other) ? other + "" : other;
11001 if (typeof value != "string") {
11002 return value === 0 ? value : +value;
11004 value = baseTrim2(value);
11005 var isBinary = reIsBinary2.test(value);
11006 return isBinary || reIsOctal2.test(value) ? freeParseInt2(value.slice(2), isBinary ? 2 : 8) : reIsBadHex2.test(value) ? NAN2 : +value;
11008 function toPlainObject(value) {
11009 return copyObject(value, keysIn(value));
11011 function toSafeInteger(value) {
11012 return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER3, MAX_SAFE_INTEGER3) : value === 0 ? value : 0;
11014 function toString2(value) {
11015 return value == null ? "" : baseToString2(value);
11017 var assign = createAssigner(function(object, source) {
11018 if (isPrototype2(source) || isArrayLike2(source)) {
11019 copyObject(source, keys2(source), object);
11022 for (var key in source) {
11023 if (hasOwnProperty10.call(source, key)) {
11024 assignValue(object, key, source[key]);
11028 var assignIn = createAssigner(function(object, source) {
11029 copyObject(source, keysIn(source), object);
11031 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
11032 copyObject(source, keysIn(source), object, customizer);
11034 var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
11035 copyObject(source, keys2(source), object, customizer);
11037 var at2 = flatRest(baseAt);
11038 function create2(prototype, properties) {
11039 var result2 = baseCreate(prototype);
11040 return properties == null ? result2 : baseAssign(result2, properties);
11042 var defaults = baseRest(function(object, sources) {
11043 object = Object2(object);
11045 var length = sources.length;
11046 var guard = length > 2 ? sources[2] : undefined2;
11047 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
11050 while (++index < length) {
11051 var source = sources[index];
11052 var props = keysIn(source);
11053 var propsIndex = -1;
11054 var propsLength = props.length;
11055 while (++propsIndex < propsLength) {
11056 var key = props[propsIndex];
11057 var value = object[key];
11058 if (value === undefined2 || eq2(value, objectProto13[key]) && !hasOwnProperty10.call(object, key)) {
11059 object[key] = source[key];
11065 var defaultsDeep = baseRest(function(args) {
11066 args.push(undefined2, customDefaultsMerge);
11067 return apply(mergeWith, undefined2, args);
11069 function findKey(object, predicate) {
11070 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
11072 function findLastKey(object, predicate) {
11073 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
11075 function forIn(object, iteratee2) {
11076 return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
11078 function forInRight(object, iteratee2) {
11079 return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
11081 function forOwn(object, iteratee2) {
11082 return object && baseForOwn(object, getIteratee(iteratee2, 3));
11084 function forOwnRight(object, iteratee2) {
11085 return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
11087 function functions(object) {
11088 return object == null ? [] : baseFunctions(object, keys2(object));
11090 function functionsIn(object) {
11091 return object == null ? [] : baseFunctions(object, keysIn(object));
11093 function get4(object, path, defaultValue) {
11094 var result2 = object == null ? undefined2 : baseGet(object, path);
11095 return result2 === undefined2 ? defaultValue : result2;
11097 function has(object, path) {
11098 return object != null && hasPath(object, path, baseHas);
11100 function hasIn(object, path) {
11101 return object != null && hasPath(object, path, baseHasIn);
11103 var invert = createInverter(function(result2, value, key) {
11104 if (value != null && typeof value.toString != "function") {
11105 value = nativeObjectToString3.call(value);
11107 result2[value] = key;
11108 }, constant(identity4));
11109 var invertBy = createInverter(function(result2, value, key) {
11110 if (value != null && typeof value.toString != "function") {
11111 value = nativeObjectToString3.call(value);
11113 if (hasOwnProperty10.call(result2, value)) {
11114 result2[value].push(key);
11116 result2[value] = [key];
11119 var invoke = baseRest(baseInvoke);
11120 function keys2(object) {
11121 return isArrayLike2(object) ? arrayLikeKeys2(object) : baseKeys2(object);
11123 function keysIn(object) {
11124 return isArrayLike2(object) ? arrayLikeKeys2(object, true) : baseKeysIn(object);
11126 function mapKeys(object, iteratee2) {
11128 iteratee2 = getIteratee(iteratee2, 3);
11129 baseForOwn(object, function(value, key, object2) {
11130 baseAssignValue(result2, iteratee2(value, key, object2), value);
11134 function mapValues(object, iteratee2) {
11136 iteratee2 = getIteratee(iteratee2, 3);
11137 baseForOwn(object, function(value, key, object2) {
11138 baseAssignValue(result2, key, iteratee2(value, key, object2));
11142 var merge2 = createAssigner(function(object, source, srcIndex) {
11143 baseMerge(object, source, srcIndex);
11145 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
11146 baseMerge(object, source, srcIndex, customizer);
11148 var omit = flatRest(function(object, paths) {
11150 if (object == null) {
11153 var isDeep = false;
11154 paths = arrayMap2(paths, function(path) {
11155 path = castPath(path, object);
11156 isDeep || (isDeep = path.length > 1);
11159 copyObject(object, getAllKeysIn(object), result2);
11161 result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
11163 var length = paths.length;
11165 baseUnset(result2, paths[length]);
11169 function omitBy(object, predicate) {
11170 return pickBy(object, negate(getIteratee(predicate)));
11172 var pick = flatRest(function(object, paths) {
11173 return object == null ? {} : basePick(object, paths);
11175 function pickBy(object, predicate) {
11176 if (object == null) {
11179 var props = arrayMap2(getAllKeysIn(object), function(prop) {
11182 predicate = getIteratee(predicate);
11183 return basePickBy(object, props, function(value, path) {
11184 return predicate(value, path[0]);
11187 function result(object, path, defaultValue) {
11188 path = castPath(path, object);
11189 var index = -1, length = path.length;
11192 object = undefined2;
11194 while (++index < length) {
11195 var value = object == null ? undefined2 : object[toKey(path[index])];
11196 if (value === undefined2) {
11198 value = defaultValue;
11200 object = isFunction2(value) ? value.call(object) : value;
11204 function set3(object, path, value) {
11205 return object == null ? object : baseSet(object, path, value);
11207 function setWith(object, path, value, customizer) {
11208 customizer = typeof customizer == "function" ? customizer : undefined2;
11209 return object == null ? object : baseSet(object, path, value, customizer);
11211 var toPairs = createToPairs(keys2);
11212 var toPairsIn = createToPairs(keysIn);
11213 function transform2(object, iteratee2, accumulator) {
11214 var isArr = isArray2(object), isArrLike = isArr || isBuffer2(object) || isTypedArray2(object);
11215 iteratee2 = getIteratee(iteratee2, 4);
11216 if (accumulator == null) {
11217 var Ctor = object && object.constructor;
11219 accumulator = isArr ? new Ctor() : [];
11220 } else if (isObject3(object)) {
11221 accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {};
11226 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
11227 return iteratee2(accumulator, value, index, object2);
11229 return accumulator;
11231 function unset(object, path) {
11232 return object == null ? true : baseUnset(object, path);
11234 function update(object, path, updater) {
11235 return object == null ? object : baseUpdate(object, path, castFunction(updater));
11237 function updateWith(object, path, updater, customizer) {
11238 customizer = typeof customizer == "function" ? customizer : undefined2;
11239 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
11241 function values(object) {
11242 return object == null ? [] : baseValues(object, keys2(object));
11244 function valuesIn(object) {
11245 return object == null ? [] : baseValues(object, keysIn(object));
11247 function clamp3(number3, lower2, upper) {
11248 if (upper === undefined2) {
11250 lower2 = undefined2;
11252 if (upper !== undefined2) {
11253 upper = toNumber3(upper);
11254 upper = upper === upper ? upper : 0;
11256 if (lower2 !== undefined2) {
11257 lower2 = toNumber3(lower2);
11258 lower2 = lower2 === lower2 ? lower2 : 0;
11260 return baseClamp(toNumber3(number3), lower2, upper);
11262 function inRange(number3, start2, end) {
11263 start2 = toFinite(start2);
11264 if (end === undefined2) {
11268 end = toFinite(end);
11270 number3 = toNumber3(number3);
11271 return baseInRange(number3, start2, end);
11273 function random(lower2, upper, floating) {
11274 if (floating && typeof floating != "boolean" && isIterateeCall(lower2, upper, floating)) {
11275 upper = floating = undefined2;
11277 if (floating === undefined2) {
11278 if (typeof upper == "boolean") {
11280 upper = undefined2;
11281 } else if (typeof lower2 == "boolean") {
11283 lower2 = undefined2;
11286 if (lower2 === undefined2 && upper === undefined2) {
11290 lower2 = toFinite(lower2);
11291 if (upper === undefined2) {
11295 upper = toFinite(upper);
11298 if (lower2 > upper) {
11303 if (floating || lower2 % 1 || upper % 1) {
11304 var rand = nativeRandom();
11305 return nativeMin2(lower2 + rand * (upper - lower2 + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
11307 return baseRandom(lower2, upper);
11309 var camelCase = createCompounder(function(result2, word, index) {
11310 word = word.toLowerCase();
11311 return result2 + (index ? capitalize(word) : word);
11313 function capitalize(string) {
11314 return upperFirst(toString2(string).toLowerCase());
11316 function deburr(string) {
11317 string = toString2(string);
11318 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
11320 function endsWith(string, target, position) {
11321 string = toString2(string);
11322 target = baseToString2(target);
11323 var length = string.length;
11324 position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length);
11325 var end = position;
11326 position -= target.length;
11327 return position >= 0 && string.slice(position, end) == target;
11329 function escape6(string) {
11330 string = toString2(string);
11331 return string && reHasUnescapedHtml2.test(string) ? string.replace(reUnescapedHtml2, escapeHtmlChar2) : string;
11333 function escapeRegExp(string) {
11334 string = toString2(string);
11335 return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar2, "\\$&") : string;
11337 var kebabCase = createCompounder(function(result2, word, index) {
11338 return result2 + (index ? "-" : "") + word.toLowerCase();
11340 var lowerCase = createCompounder(function(result2, word, index) {
11341 return result2 + (index ? " " : "") + word.toLowerCase();
11343 var lowerFirst = createCaseFirst("toLowerCase");
11344 function pad2(string, length, chars) {
11345 string = toString2(string);
11346 length = toInteger(length);
11347 var strLength = length ? stringSize(string) : 0;
11348 if (!length || strLength >= length) {
11351 var mid = (length - strLength) / 2;
11352 return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
11354 function padEnd(string, length, chars) {
11355 string = toString2(string);
11356 length = toInteger(length);
11357 var strLength = length ? stringSize(string) : 0;
11358 return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
11360 function padStart(string, length, chars) {
11361 string = toString2(string);
11362 length = toInteger(length);
11363 var strLength = length ? stringSize(string) : 0;
11364 return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
11366 function parseInt2(string, radix, guard) {
11367 if (guard || radix == null) {
11369 } else if (radix) {
11372 return nativeParseInt(toString2(string).replace(reTrimStart2, ""), radix || 0);
11374 function repeat(string, n3, guard) {
11375 if (guard ? isIterateeCall(string, n3, guard) : n3 === undefined2) {
11378 n3 = toInteger(n3);
11380 return baseRepeat(toString2(string), n3);
11382 function replace() {
11383 var args = arguments, string = toString2(args[0]);
11384 return args.length < 3 ? string : string.replace(args[1], args[2]);
11386 var snakeCase = createCompounder(function(result2, word, index) {
11387 return result2 + (index ? "_" : "") + word.toLowerCase();
11389 function split(string, separator, limit) {
11390 if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
11391 separator = limit = undefined2;
11393 limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0;
11397 string = toString2(string);
11398 if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
11399 separator = baseToString2(separator);
11400 if (!separator && hasUnicode(string)) {
11401 return castSlice(stringToArray(string), 0, limit);
11404 return string.split(separator, limit);
11406 var startCase = createCompounder(function(result2, word, index) {
11407 return result2 + (index ? " " : "") + upperFirst(word);
11409 function startsWith(string, target, position) {
11410 string = toString2(string);
11411 position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
11412 target = baseToString2(target);
11413 return string.slice(position, position + target.length) == target;
11415 function template(string, options2, guard) {
11416 var settings = lodash.templateSettings;
11417 if (guard && isIterateeCall(string, options2, guard)) {
11418 options2 = undefined2;
11420 string = toString2(string);
11421 options2 = assignInWith({}, options2, settings, customDefaultsAssignIn);
11422 var imports = assignInWith({}, options2.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys2(imports), importsValues = baseValues(imports, importsKeys);
11423 var isEscaping, isEvaluating, index = 0, interpolate = options2.interpolate || reNoMatch, source = "__p += '";
11424 var reDelimiters = RegExp2(
11425 (options2.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options2.evaluate || reNoMatch).source + "|$",
11428 var sourceURL = "//# sourceURL=" + (hasOwnProperty10.call(options2, "sourceURL") ? (options2.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
11429 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
11430 interpolateValue || (interpolateValue = esTemplateValue);
11431 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
11434 source += "' +\n__e(" + escapeValue + ") +\n'";
11436 if (evaluateValue) {
11437 isEvaluating = true;
11438 source += "';\n" + evaluateValue + ";\n__p += '";
11440 if (interpolateValue) {
11441 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
11443 index = offset + match.length;
11447 var variable = hasOwnProperty10.call(options2, "variable") && options2.variable;
11449 source = "with (obj) {\n" + source + "\n}\n";
11450 } else if (reForbiddenIdentifierChars.test(variable)) {
11451 throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
11453 source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
11454 source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
11455 var result2 = attempt(function() {
11456 return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues);
11458 result2.source = source;
11459 if (isError(result2)) {
11464 function toLower(value) {
11465 return toString2(value).toLowerCase();
11467 function toUpper(value) {
11468 return toString2(value).toUpperCase();
11470 function trim(string, chars, guard) {
11471 string = toString2(string);
11472 if (string && (guard || chars === undefined2)) {
11473 return baseTrim2(string);
11475 if (!string || !(chars = baseToString2(chars))) {
11478 var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start2 = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
11479 return castSlice(strSymbols, start2, end).join("");
11481 function trimEnd(string, chars, guard) {
11482 string = toString2(string);
11483 if (string && (guard || chars === undefined2)) {
11484 return string.slice(0, trimmedEndIndex2(string) + 1);
11486 if (!string || !(chars = baseToString2(chars))) {
11489 var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
11490 return castSlice(strSymbols, 0, end).join("");
11492 function trimStart(string, chars, guard) {
11493 string = toString2(string);
11494 if (string && (guard || chars === undefined2)) {
11495 return string.replace(reTrimStart2, "");
11497 if (!string || !(chars = baseToString2(chars))) {
11500 var strSymbols = stringToArray(string), start2 = charsStartIndex(strSymbols, stringToArray(chars));
11501 return castSlice(strSymbols, start2).join("");
11503 function truncate(string, options2) {
11504 var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
11505 if (isObject3(options2)) {
11506 var separator = "separator" in options2 ? options2.separator : separator;
11507 length = "length" in options2 ? toInteger(options2.length) : length;
11508 omission = "omission" in options2 ? baseToString2(options2.omission) : omission;
11510 string = toString2(string);
11511 var strLength = string.length;
11512 if (hasUnicode(string)) {
11513 var strSymbols = stringToArray(string);
11514 strLength = strSymbols.length;
11516 if (length >= strLength) {
11519 var end = length - stringSize(omission);
11523 var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
11524 if (separator === undefined2) {
11525 return result2 + omission;
11528 end += result2.length - end;
11530 if (isRegExp(separator)) {
11531 if (string.slice(end).search(separator)) {
11532 var match, substring = result2;
11533 if (!separator.global) {
11534 separator = RegExp2(separator.source, toString2(reFlags.exec(separator)) + "g");
11536 separator.lastIndex = 0;
11537 while (match = separator.exec(substring)) {
11538 var newEnd = match.index;
11540 result2 = result2.slice(0, newEnd === undefined2 ? end : newEnd);
11542 } else if (string.indexOf(baseToString2(separator), end) != end) {
11543 var index = result2.lastIndexOf(separator);
11545 result2 = result2.slice(0, index);
11548 return result2 + omission;
11550 function unescape4(string) {
11551 string = toString2(string);
11552 return string && reHasEscapedHtml2.test(string) ? string.replace(reEscapedHtml2, unescapeHtmlChar2) : string;
11554 var upperCase = createCompounder(function(result2, word, index) {
11555 return result2 + (index ? " " : "") + word.toUpperCase();
11557 var upperFirst = createCaseFirst("toUpperCase");
11558 function words(string, pattern, guard) {
11559 string = toString2(string);
11560 pattern = guard ? undefined2 : pattern;
11561 if (pattern === undefined2) {
11562 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
11564 return string.match(pattern) || [];
11566 var attempt = baseRest(function(func, args) {
11568 return apply(func, undefined2, args);
11570 return isError(e3) ? e3 : new Error2(e3);
11573 var bindAll = flatRest(function(object, methodNames) {
11574 arrayEach(methodNames, function(key) {
11576 baseAssignValue(object, key, bind(object[key], object));
11580 function cond(pairs2) {
11581 var length = pairs2 == null ? 0 : pairs2.length, toIteratee = getIteratee();
11582 pairs2 = !length ? [] : arrayMap2(pairs2, function(pair3) {
11583 if (typeof pair3[1] != "function") {
11584 throw new TypeError2(FUNC_ERROR_TEXT3);
11586 return [toIteratee(pair3[0]), pair3[1]];
11588 return baseRest(function(args) {
11590 while (++index < length) {
11591 var pair3 = pairs2[index];
11592 if (apply(pair3[0], this, args)) {
11593 return apply(pair3[1], this, args);
11598 function conforms(source) {
11599 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
11601 function constant(value) {
11602 return function() {
11606 function defaultTo(value, defaultValue) {
11607 return value == null || value !== value ? defaultValue : value;
11609 var flow = createFlow();
11610 var flowRight = createFlow(true);
11611 function identity4(value) {
11614 function iteratee(func) {
11615 return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
11617 function matches(source) {
11618 return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
11620 function matchesProperty(path, srcValue) {
11621 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
11623 var method = baseRest(function(path, args) {
11624 return function(object) {
11625 return baseInvoke(object, path, args);
11628 var methodOf = baseRest(function(object, args) {
11629 return function(path) {
11630 return baseInvoke(object, path, args);
11633 function mixin(object, source, options2) {
11634 var props = keys2(source), methodNames = baseFunctions(source, props);
11635 if (options2 == null && !(isObject3(source) && (methodNames.length || !props.length))) {
11639 methodNames = baseFunctions(source, keys2(source));
11641 var chain2 = !(isObject3(options2) && "chain" in options2) || !!options2.chain, isFunc = isFunction2(object);
11642 arrayEach(methodNames, function(methodName) {
11643 var func = source[methodName];
11644 object[methodName] = func;
11646 object.prototype[methodName] = function() {
11647 var chainAll = this.__chain__;
11648 if (chain2 || chainAll) {
11649 var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
11650 actions.push({ "func": func, "args": arguments, "thisArg": object });
11651 result2.__chain__ = chainAll;
11654 return func.apply(object, arrayPush2([this.value()], arguments));
11660 function noConflict() {
11661 if (root3._ === this) {
11668 function nthArg(n3) {
11669 n3 = toInteger(n3);
11670 return baseRest(function(args) {
11671 return baseNth(args, n3);
11674 var over = createOver(arrayMap2);
11675 var overEvery = createOver(arrayEvery);
11676 var overSome = createOver(arraySome2);
11677 function property(path) {
11678 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
11680 function propertyOf(object) {
11681 return function(path) {
11682 return object == null ? undefined2 : baseGet(object, path);
11685 var range3 = createRange();
11686 var rangeRight = createRange(true);
11687 function stubArray2() {
11690 function stubFalse2() {
11693 function stubObject() {
11696 function stubString() {
11699 function stubTrue() {
11702 function times(n3, iteratee2) {
11703 n3 = toInteger(n3);
11704 if (n3 < 1 || n3 > MAX_SAFE_INTEGER3) {
11707 var index = MAX_ARRAY_LENGTH, length = nativeMin2(n3, MAX_ARRAY_LENGTH);
11708 iteratee2 = getIteratee(iteratee2);
11709 n3 -= MAX_ARRAY_LENGTH;
11710 var result2 = baseTimes2(length, iteratee2);
11711 while (++index < n3) {
11716 function toPath(value) {
11717 if (isArray2(value)) {
11718 return arrayMap2(value, toKey);
11720 return isSymbol2(value) ? [value] : copyArray(stringToPath(toString2(value)));
11722 function uniqueId(prefix) {
11723 var id2 = ++idCounter;
11724 return toString2(prefix) + id2;
11726 var add = createMathOperation(function(augend, addend) {
11727 return augend + addend;
11729 var ceil = createRound("ceil");
11730 var divide = createMathOperation(function(dividend, divisor) {
11731 return dividend / divisor;
11733 var floor = createRound("floor");
11734 function max3(array2) {
11735 return array2 && array2.length ? baseExtremum(array2, identity4, baseGt) : undefined2;
11737 function maxBy(array2, iteratee2) {
11738 return array2 && array2.length ? baseExtremum(array2, getIteratee(iteratee2, 2), baseGt) : undefined2;
11740 function mean(array2) {
11741 return baseMean(array2, identity4);
11743 function meanBy(array2, iteratee2) {
11744 return baseMean(array2, getIteratee(iteratee2, 2));
11746 function min3(array2) {
11747 return array2 && array2.length ? baseExtremum(array2, identity4, baseLt) : undefined2;
11749 function minBy(array2, iteratee2) {
11750 return array2 && array2.length ? baseExtremum(array2, getIteratee(iteratee2, 2), baseLt) : undefined2;
11752 var multiply = createMathOperation(function(multiplier, multiplicand) {
11753 return multiplier * multiplicand;
11755 var round = createRound("round");
11756 var subtract = createMathOperation(function(minuend, subtrahend) {
11757 return minuend - subtrahend;
11759 function sum(array2) {
11760 return array2 && array2.length ? baseSum(array2, identity4) : 0;
11762 function sumBy(array2, iteratee2) {
11763 return array2 && array2.length ? baseSum(array2, getIteratee(iteratee2, 2)) : 0;
11765 lodash.after = after;
11767 lodash.assign = assign;
11768 lodash.assignIn = assignIn;
11769 lodash.assignInWith = assignInWith;
11770 lodash.assignWith = assignWith;
11772 lodash.before = before;
11773 lodash.bind = bind;
11774 lodash.bindAll = bindAll;
11775 lodash.bindKey = bindKey2;
11776 lodash.castArray = castArray;
11777 lodash.chain = chain;
11778 lodash.chunk = chunk;
11779 lodash.compact = compact;
11780 lodash.concat = concat;
11781 lodash.cond = cond;
11782 lodash.conforms = conforms;
11783 lodash.constant = constant;
11784 lodash.countBy = countBy;
11785 lodash.create = create2;
11786 lodash.curry = curry;
11787 lodash.curryRight = curryRight;
11788 lodash.debounce = debounce2;
11789 lodash.defaults = defaults;
11790 lodash.defaultsDeep = defaultsDeep;
11791 lodash.defer = defer;
11792 lodash.delay = delay;
11793 lodash.difference = difference;
11794 lodash.differenceBy = differenceBy;
11795 lodash.differenceWith = differenceWith;
11796 lodash.drop = drop;
11797 lodash.dropRight = dropRight;
11798 lodash.dropRightWhile = dropRightWhile;
11799 lodash.dropWhile = dropWhile;
11800 lodash.fill = fill;
11801 lodash.filter = filter2;
11802 lodash.flatMap = flatMap;
11803 lodash.flatMapDeep = flatMapDeep;
11804 lodash.flatMapDepth = flatMapDepth;
11805 lodash.flatten = flatten2;
11806 lodash.flattenDeep = flattenDeep;
11807 lodash.flattenDepth = flattenDepth;
11808 lodash.flip = flip;
11809 lodash.flow = flow;
11810 lodash.flowRight = flowRight;
11811 lodash.fromPairs = fromPairs;
11812 lodash.functions = functions;
11813 lodash.functionsIn = functionsIn;
11814 lodash.groupBy = groupBy;
11815 lodash.initial = initial;
11816 lodash.intersection = intersection;
11817 lodash.intersectionBy = intersectionBy;
11818 lodash.intersectionWith = intersectionWith;
11819 lodash.invert = invert;
11820 lodash.invertBy = invertBy;
11821 lodash.invokeMap = invokeMap;
11822 lodash.iteratee = iteratee;
11823 lodash.keyBy = keyBy;
11824 lodash.keys = keys2;
11825 lodash.keysIn = keysIn;
11827 lodash.mapKeys = mapKeys;
11828 lodash.mapValues = mapValues;
11829 lodash.matches = matches;
11830 lodash.matchesProperty = matchesProperty;
11831 lodash.memoize = memoize;
11832 lodash.merge = merge2;
11833 lodash.mergeWith = mergeWith;
11834 lodash.method = method;
11835 lodash.methodOf = methodOf;
11836 lodash.mixin = mixin;
11837 lodash.negate = negate;
11838 lodash.nthArg = nthArg;
11839 lodash.omit = omit;
11840 lodash.omitBy = omitBy;
11841 lodash.once = once;
11842 lodash.orderBy = orderBy;
11843 lodash.over = over;
11844 lodash.overArgs = overArgs;
11845 lodash.overEvery = overEvery;
11846 lodash.overSome = overSome;
11847 lodash.partial = partial;
11848 lodash.partialRight = partialRight;
11849 lodash.partition = partition;
11850 lodash.pick = pick;
11851 lodash.pickBy = pickBy;
11852 lodash.property = property;
11853 lodash.propertyOf = propertyOf;
11854 lodash.pull = pull;
11855 lodash.pullAll = pullAll;
11856 lodash.pullAllBy = pullAllBy;
11857 lodash.pullAllWith = pullAllWith;
11858 lodash.pullAt = pullAt;
11859 lodash.range = range3;
11860 lodash.rangeRight = rangeRight;
11861 lodash.rearg = rearg;
11862 lodash.reject = reject;
11863 lodash.remove = remove2;
11864 lodash.rest = rest;
11865 lodash.reverse = reverse;
11866 lodash.sampleSize = sampleSize;
11868 lodash.setWith = setWith;
11869 lodash.shuffle = shuffle;
11870 lodash.slice = slice;
11871 lodash.sortBy = sortBy;
11872 lodash.sortedUniq = sortedUniq;
11873 lodash.sortedUniqBy = sortedUniqBy;
11874 lodash.split = split;
11875 lodash.spread = spread;
11876 lodash.tail = tail;
11877 lodash.take = take;
11878 lodash.takeRight = takeRight;
11879 lodash.takeRightWhile = takeRightWhile;
11880 lodash.takeWhile = takeWhile;
11882 lodash.throttle = throttle2;
11883 lodash.thru = thru;
11884 lodash.toArray = toArray;
11885 lodash.toPairs = toPairs;
11886 lodash.toPairsIn = toPairsIn;
11887 lodash.toPath = toPath;
11888 lodash.toPlainObject = toPlainObject;
11889 lodash.transform = transform2;
11890 lodash.unary = unary;
11891 lodash.union = union;
11892 lodash.unionBy = unionBy;
11893 lodash.unionWith = unionWith;
11894 lodash.uniq = uniq;
11895 lodash.uniqBy = uniqBy;
11896 lodash.uniqWith = uniqWith;
11897 lodash.unset = unset;
11898 lodash.unzip = unzip;
11899 lodash.unzipWith = unzipWith;
11900 lodash.update = update;
11901 lodash.updateWith = updateWith;
11902 lodash.values = values;
11903 lodash.valuesIn = valuesIn;
11904 lodash.without = without;
11905 lodash.words = words;
11906 lodash.wrap = wrap2;
11908 lodash.xorBy = xorBy;
11909 lodash.xorWith = xorWith;
11911 lodash.zipObject = zipObject;
11912 lodash.zipObjectDeep = zipObjectDeep;
11913 lodash.zipWith = zipWith;
11914 lodash.entries = toPairs;
11915 lodash.entriesIn = toPairsIn;
11916 lodash.extend = assignIn;
11917 lodash.extendWith = assignInWith;
11918 mixin(lodash, lodash);
11920 lodash.attempt = attempt;
11921 lodash.camelCase = camelCase;
11922 lodash.capitalize = capitalize;
11923 lodash.ceil = ceil;
11924 lodash.clamp = clamp3;
11925 lodash.clone = clone;
11926 lodash.cloneDeep = cloneDeep;
11927 lodash.cloneDeepWith = cloneDeepWith;
11928 lodash.cloneWith = cloneWith;
11929 lodash.conformsTo = conformsTo;
11930 lodash.deburr = deburr;
11931 lodash.defaultTo = defaultTo;
11932 lodash.divide = divide;
11933 lodash.endsWith = endsWith;
11935 lodash.escape = escape6;
11936 lodash.escapeRegExp = escapeRegExp;
11937 lodash.every = every;
11938 lodash.find = find2;
11939 lodash.findIndex = findIndex;
11940 lodash.findKey = findKey;
11941 lodash.findLast = findLast;
11942 lodash.findLastIndex = findLastIndex;
11943 lodash.findLastKey = findLastKey;
11944 lodash.floor = floor;
11945 lodash.forEach = forEach;
11946 lodash.forEachRight = forEachRight;
11947 lodash.forIn = forIn;
11948 lodash.forInRight = forInRight;
11949 lodash.forOwn = forOwn;
11950 lodash.forOwnRight = forOwnRight;
11955 lodash.hasIn = hasIn;
11956 lodash.head = head;
11957 lodash.identity = identity4;
11958 lodash.includes = includes;
11959 lodash.indexOf = indexOf;
11960 lodash.inRange = inRange;
11961 lodash.invoke = invoke;
11962 lodash.isArguments = isArguments2;
11963 lodash.isArray = isArray2;
11964 lodash.isArrayBuffer = isArrayBuffer;
11965 lodash.isArrayLike = isArrayLike2;
11966 lodash.isArrayLikeObject = isArrayLikeObject;
11967 lodash.isBoolean = isBoolean;
11968 lodash.isBuffer = isBuffer2;
11969 lodash.isDate = isDate;
11970 lodash.isElement = isElement2;
11971 lodash.isEmpty = isEmpty;
11972 lodash.isEqual = isEqual4;
11973 lodash.isEqualWith = isEqualWith;
11974 lodash.isError = isError;
11975 lodash.isFinite = isFinite2;
11976 lodash.isFunction = isFunction2;
11977 lodash.isInteger = isInteger;
11978 lodash.isLength = isLength2;
11979 lodash.isMap = isMap;
11980 lodash.isMatch = isMatch;
11981 lodash.isMatchWith = isMatchWith;
11982 lodash.isNaN = isNaN2;
11983 lodash.isNative = isNative;
11984 lodash.isNil = isNil;
11985 lodash.isNull = isNull;
11986 lodash.isNumber = isNumber3;
11987 lodash.isObject = isObject3;
11988 lodash.isObjectLike = isObjectLike2;
11989 lodash.isPlainObject = isPlainObject;
11990 lodash.isRegExp = isRegExp;
11991 lodash.isSafeInteger = isSafeInteger;
11992 lodash.isSet = isSet;
11993 lodash.isString = isString;
11994 lodash.isSymbol = isSymbol2;
11995 lodash.isTypedArray = isTypedArray2;
11996 lodash.isUndefined = isUndefined;
11997 lodash.isWeakMap = isWeakMap;
11998 lodash.isWeakSet = isWeakSet;
11999 lodash.join = join;
12000 lodash.kebabCase = kebabCase;
12001 lodash.last = last;
12002 lodash.lastIndexOf = lastIndexOf;
12003 lodash.lowerCase = lowerCase;
12004 lodash.lowerFirst = lowerFirst;
12008 lodash.maxBy = maxBy;
12009 lodash.mean = mean;
12010 lodash.meanBy = meanBy;
12012 lodash.minBy = minBy;
12013 lodash.stubArray = stubArray2;
12014 lodash.stubFalse = stubFalse2;
12015 lodash.stubObject = stubObject;
12016 lodash.stubString = stubString;
12017 lodash.stubTrue = stubTrue;
12018 lodash.multiply = multiply;
12020 lodash.noConflict = noConflict;
12021 lodash.noop = noop3;
12024 lodash.padEnd = padEnd;
12025 lodash.padStart = padStart;
12026 lodash.parseInt = parseInt2;
12027 lodash.random = random;
12028 lodash.reduce = reduce;
12029 lodash.reduceRight = reduceRight;
12030 lodash.repeat = repeat;
12031 lodash.replace = replace;
12032 lodash.result = result;
12033 lodash.round = round;
12034 lodash.runInContext = runInContext2;
12035 lodash.sample = sample;
12036 lodash.size = size;
12037 lodash.snakeCase = snakeCase;
12038 lodash.some = some;
12039 lodash.sortedIndex = sortedIndex;
12040 lodash.sortedIndexBy = sortedIndexBy;
12041 lodash.sortedIndexOf = sortedIndexOf;
12042 lodash.sortedLastIndex = sortedLastIndex;
12043 lodash.sortedLastIndexBy = sortedLastIndexBy;
12044 lodash.sortedLastIndexOf = sortedLastIndexOf;
12045 lodash.startCase = startCase;
12046 lodash.startsWith = startsWith;
12047 lodash.subtract = subtract;
12049 lodash.sumBy = sumBy;
12050 lodash.template = template;
12051 lodash.times = times;
12052 lodash.toFinite = toFinite;
12053 lodash.toInteger = toInteger;
12054 lodash.toLength = toLength;
12055 lodash.toLower = toLower;
12056 lodash.toNumber = toNumber3;
12057 lodash.toSafeInteger = toSafeInteger;
12058 lodash.toString = toString2;
12059 lodash.toUpper = toUpper;
12060 lodash.trim = trim;
12061 lodash.trimEnd = trimEnd;
12062 lodash.trimStart = trimStart;
12063 lodash.truncate = truncate;
12064 lodash.unescape = unescape4;
12065 lodash.uniqueId = uniqueId;
12066 lodash.upperCase = upperCase;
12067 lodash.upperFirst = upperFirst;
12068 lodash.each = forEach;
12069 lodash.eachRight = forEachRight;
12070 lodash.first = head;
12071 mixin(lodash, function() {
12073 baseForOwn(lodash, function(func, methodName) {
12074 if (!hasOwnProperty10.call(lodash.prototype, methodName)) {
12075 source[methodName] = func;
12079 }(), { "chain": false });
12080 lodash.VERSION = VERSION;
12081 arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
12082 lodash[methodName].placeholder = lodash;
12084 arrayEach(["drop", "take"], function(methodName, index) {
12085 LazyWrapper.prototype[methodName] = function(n3) {
12086 n3 = n3 === undefined2 ? 1 : nativeMax2(toInteger(n3), 0);
12087 var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
12088 if (result2.__filtered__) {
12089 result2.__takeCount__ = nativeMin2(n3, result2.__takeCount__);
12091 result2.__views__.push({
12092 "size": nativeMin2(n3, MAX_ARRAY_LENGTH),
12093 "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
12098 LazyWrapper.prototype[methodName + "Right"] = function(n3) {
12099 return this.reverse()[methodName](n3).reverse();
12102 arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
12103 var type2 = index + 1, isFilter = type2 == LAZY_FILTER_FLAG || type2 == LAZY_WHILE_FLAG;
12104 LazyWrapper.prototype[methodName] = function(iteratee2) {
12105 var result2 = this.clone();
12106 result2.__iteratees__.push({
12107 "iteratee": getIteratee(iteratee2, 3),
12110 result2.__filtered__ = result2.__filtered__ || isFilter;
12114 arrayEach(["head", "last"], function(methodName, index) {
12115 var takeName = "take" + (index ? "Right" : "");
12116 LazyWrapper.prototype[methodName] = function() {
12117 return this[takeName](1).value()[0];
12120 arrayEach(["initial", "tail"], function(methodName, index) {
12121 var dropName = "drop" + (index ? "" : "Right");
12122 LazyWrapper.prototype[methodName] = function() {
12123 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
12126 LazyWrapper.prototype.compact = function() {
12127 return this.filter(identity4);
12129 LazyWrapper.prototype.find = function(predicate) {
12130 return this.filter(predicate).head();
12132 LazyWrapper.prototype.findLast = function(predicate) {
12133 return this.reverse().find(predicate);
12135 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
12136 if (typeof path == "function") {
12137 return new LazyWrapper(this);
12139 return this.map(function(value) {
12140 return baseInvoke(value, path, args);
12143 LazyWrapper.prototype.reject = function(predicate) {
12144 return this.filter(negate(getIteratee(predicate)));
12146 LazyWrapper.prototype.slice = function(start2, end) {
12147 start2 = toInteger(start2);
12148 var result2 = this;
12149 if (result2.__filtered__ && (start2 > 0 || end < 0)) {
12150 return new LazyWrapper(result2);
12153 result2 = result2.takeRight(-start2);
12154 } else if (start2) {
12155 result2 = result2.drop(start2);
12157 if (end !== undefined2) {
12158 end = toInteger(end);
12159 result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start2);
12163 LazyWrapper.prototype.takeRightWhile = function(predicate) {
12164 return this.reverse().takeWhile(predicate).reverse();
12166 LazyWrapper.prototype.toArray = function() {
12167 return this.take(MAX_ARRAY_LENGTH);
12169 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
12170 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
12174 lodash.prototype[methodName] = function() {
12175 var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value);
12176 var interceptor = function(value2) {
12177 var result3 = lodashFunc.apply(lodash, arrayPush2([value2], args));
12178 return isTaker && chainAll ? result3[0] : result3;
12180 if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
12181 isLazy = useLazy = false;
12183 var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
12184 if (!retUnwrapped && useLazy) {
12185 value = onlyLazy ? value : new LazyWrapper(this);
12186 var result2 = func.apply(value, args);
12187 result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 });
12188 return new LodashWrapper(result2, chainAll);
12190 if (isUnwrapped && onlyLazy) {
12191 return func.apply(this, args);
12193 result2 = this.thru(interceptor);
12194 return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
12197 arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
12198 var func = arrayProto2[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
12199 lodash.prototype[methodName] = function() {
12200 var args = arguments;
12201 if (retUnwrapped && !this.__chain__) {
12202 var value = this.value();
12203 return func.apply(isArray2(value) ? value : [], args);
12205 return this[chainName](function(value2) {
12206 return func.apply(isArray2(value2) ? value2 : [], args);
12210 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
12211 var lodashFunc = lodash[methodName];
12213 var key = lodashFunc.name + "";
12214 if (!hasOwnProperty10.call(realNames, key)) {
12215 realNames[key] = [];
12217 realNames[key].push({ "name": methodName, "func": lodashFunc });
12220 realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{
12224 LazyWrapper.prototype.clone = lazyClone;
12225 LazyWrapper.prototype.reverse = lazyReverse;
12226 LazyWrapper.prototype.value = lazyValue;
12227 lodash.prototype.at = wrapperAt;
12228 lodash.prototype.chain = wrapperChain;
12229 lodash.prototype.commit = wrapperCommit;
12230 lodash.prototype.next = wrapperNext;
12231 lodash.prototype.plant = wrapperPlant;
12232 lodash.prototype.reverse = wrapperReverse;
12233 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
12234 lodash.prototype.first = lodash.prototype.head;
12236 lodash.prototype[symIterator] = wrapperToIterator;
12240 var _2 = runInContext();
12241 if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
12243 define(function() {
12246 } else if (freeModule3) {
12247 (freeModule3.exports = _2)._ = _2;
12248 freeExports3._ = _2;
12256 // node_modules/fast-deep-equal/index.js
12257 var require_fast_deep_equal = __commonJS({
12258 "node_modules/fast-deep-equal/index.js"(exports2, module2) {
12260 module2.exports = function equal(a2, b2) {
12263 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
12264 if (a2.constructor !== b2.constructor)
12266 var length, i3, keys2;
12267 if (Array.isArray(a2)) {
12268 length = a2.length;
12269 if (length != b2.length)
12271 for (i3 = length; i3-- !== 0; )
12272 if (!equal(a2[i3], b2[i3]))
12276 if (a2.constructor === RegExp)
12277 return a2.source === b2.source && a2.flags === b2.flags;
12278 if (a2.valueOf !== Object.prototype.valueOf)
12279 return a2.valueOf() === b2.valueOf();
12280 if (a2.toString !== Object.prototype.toString)
12281 return a2.toString() === b2.toString();
12282 keys2 = Object.keys(a2);
12283 length = keys2.length;
12284 if (length !== Object.keys(b2).length)
12286 for (i3 = length; i3-- !== 0; )
12287 if (!Object.prototype.hasOwnProperty.call(b2, keys2[i3]))
12289 for (i3 = length; i3-- !== 0; ) {
12290 var key = keys2[i3];
12291 if (!equal(a2[key], b2[key]))
12296 return a2 !== a2 && b2 !== b2;
12301 // node_modules/rbush/rbush.min.js
12302 var require_rbush_min = __commonJS({
12303 "node_modules/rbush/rbush.min.js"(exports2, module2) {
12304 !function(t2, i3) {
12305 "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = i3() : "function" == typeof define && define.amd ? define(i3) : (t2 = t2 || self).RBush = i3();
12306 }(exports2, function() {
12308 function t2(t3, r3, e4, a3, h3) {
12309 !function t4(n4, r4, e6, a4, h4) {
12310 for (; a4 > e6; ) {
12311 if (a4 - e6 > 600) {
12312 var o3 = a4 - e6 + 1, s3 = r4 - e6 + 1, l3 = Math.log(o3), f4 = 0.5 * Math.exp(2 * l3 / 3), u3 = 0.5 * Math.sqrt(l3 * f4 * (o3 - f4) / o3) * (s3 - o3 / 2 < 0 ? -1 : 1), m3 = Math.max(e6, Math.floor(r4 - s3 * f4 / o3 + u3)), c3 = Math.min(a4, Math.floor(r4 + (o3 - s3) * f4 / o3 + u3));
12313 t4(n4, r4, m3, c3, h4);
12315 var p3 = n4[r4], d4 = e6, x2 = a4;
12316 for (i3(n4, e6, r4), h4(n4[a4], p3) > 0 && i3(n4, e6, a4); d4 < x2; ) {
12317 for (i3(n4, d4, x2), d4++, x2--; h4(n4[d4], p3) < 0; )
12319 for (; h4(n4[x2], p3) > 0; )
12322 0 === h4(n4[e6], p3) ? i3(n4, e6, x2) : i3(n4, ++x2, a4), x2 <= r4 && (e6 = x2 + 1), r4 <= x2 && (a4 = x2 - 1);
12324 }(t3, r3, e4 || 0, a3 || t3.length - 1, h3 || n3);
12326 function i3(t3, i4, n4) {
12328 t3[i4] = t3[n4], t3[n4] = r3;
12330 function n3(t3, i4) {
12331 return t3 < i4 ? -1 : t3 > i4 ? 1 : 0;
12333 var r2 = function(t3) {
12334 void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
12336 function e3(t3, i4, n4) {
12338 return i4.indexOf(t3);
12339 for (var r3 = 0; r3 < i4.length; r3++)
12340 if (n4(t3, i4[r3]))
12344 function a2(t3, i4) {
12345 h2(t3, 0, t3.children.length, i4, t3);
12347 function h2(t3, i4, n4, r3, e4) {
12348 e4 || (e4 = p2(null)), e4.minX = 1 / 0, e4.minY = 1 / 0, e4.maxX = -1 / 0, e4.maxY = -1 / 0;
12349 for (var a3 = i4; a3 < n4; a3++) {
12350 var h3 = t3.children[a3];
12351 o2(e4, t3.leaf ? r3(h3) : h3);
12355 function o2(t3, i4) {
12356 return t3.minX = Math.min(t3.minX, i4.minX), t3.minY = Math.min(t3.minY, i4.minY), t3.maxX = Math.max(t3.maxX, i4.maxX), t3.maxY = Math.max(t3.maxY, i4.maxY), t3;
12358 function s2(t3, i4) {
12359 return t3.minX - i4.minX;
12361 function l2(t3, i4) {
12362 return t3.minY - i4.minY;
12365 return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
12368 return t3.maxX - t3.minX + (t3.maxY - t3.minY);
12370 function m2(t3, i4) {
12371 return t3.minX <= i4.minX && t3.minY <= i4.minY && i4.maxX <= t3.maxX && i4.maxY <= t3.maxY;
12373 function c2(t3, i4) {
12374 return i4.minX <= t3.maxX && i4.minY <= t3.maxY && i4.maxX >= t3.minX && i4.maxY >= t3.minY;
12377 return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
12379 function d2(i4, n4, r3, e4, a3) {
12380 for (var h3 = [n4, r3]; h3.length; )
12381 if (!((r3 = h3.pop()) - (n4 = h3.pop()) <= e4)) {
12382 var o3 = n4 + Math.ceil((r3 - n4) / e4 / 2) * e4;
12383 t2(i4, o3, n4, r3, a3), h3.push(n4, o3, o3, r3);
12386 return r2.prototype.all = function() {
12387 return this._all(this.data, []);
12388 }, r2.prototype.search = function(t3) {
12389 var i4 = this.data, n4 = [];
12392 for (var r3 = this.toBBox, e4 = []; i4; ) {
12393 for (var a3 = 0; a3 < i4.children.length; a3++) {
12394 var h3 = i4.children[a3], o3 = i4.leaf ? r3(h3) : h3;
12395 c2(t3, o3) && (i4.leaf ? n4.push(h3) : m2(t3, o3) ? this._all(h3, n4) : e4.push(h3));
12400 }, r2.prototype.collides = function(t3) {
12401 var i4 = this.data;
12404 for (var n4 = []; i4; ) {
12405 for (var r3 = 0; r3 < i4.children.length; r3++) {
12406 var e4 = i4.children[r3], a3 = i4.leaf ? this.toBBox(e4) : e4;
12408 if (i4.leaf || m2(t3, a3))
12416 }, r2.prototype.load = function(t3) {
12417 if (!t3 || !t3.length)
12419 if (t3.length < this._minEntries) {
12420 for (var i4 = 0; i4 < t3.length; i4++)
12421 this.insert(t3[i4]);
12424 var n4 = this._build(t3.slice(), 0, t3.length - 1, 0);
12425 if (this.data.children.length)
12426 if (this.data.height === n4.height)
12427 this._splitRoot(this.data, n4);
12429 if (this.data.height < n4.height) {
12430 var r3 = this.data;
12431 this.data = n4, n4 = r3;
12433 this._insert(n4, this.data.height - n4.height - 1, true);
12438 }, r2.prototype.insert = function(t3) {
12439 return t3 && this._insert(t3, this.data.height - 1), this;
12440 }, r2.prototype.clear = function() {
12441 return this.data = p2([]), this;
12442 }, r2.prototype.remove = function(t3, i4) {
12445 for (var n4, r3, a3, h3 = this.data, o3 = this.toBBox(t3), s3 = [], l3 = []; h3 || s3.length; ) {
12446 if (h3 || (h3 = s3.pop(), r3 = s3[s3.length - 1], n4 = l3.pop(), a3 = true), h3.leaf) {
12447 var f4 = e3(t3, h3.children, i4);
12449 return h3.children.splice(f4, 1), s3.push(h3), this._condense(s3), this;
12451 a3 || h3.leaf || !m2(h3, o3) ? r3 ? (n4++, h3 = r3.children[n4], a3 = false) : h3 = null : (s3.push(h3), l3.push(n4), n4 = 0, r3 = h3, h3 = h3.children[0]);
12454 }, r2.prototype.toBBox = function(t3) {
12456 }, r2.prototype.compareMinX = function(t3, i4) {
12457 return t3.minX - i4.minX;
12458 }, r2.prototype.compareMinY = function(t3, i4) {
12459 return t3.minY - i4.minY;
12460 }, r2.prototype.toJSON = function() {
12462 }, r2.prototype.fromJSON = function(t3) {
12463 return this.data = t3, this;
12464 }, r2.prototype._all = function(t3, i4) {
12465 for (var n4 = []; t3; )
12466 t3.leaf ? i4.push.apply(i4, t3.children) : n4.push.apply(n4, t3.children), t3 = n4.pop();
12468 }, r2.prototype._build = function(t3, i4, n4, r3) {
12469 var e4, h3 = n4 - i4 + 1, o3 = this._maxEntries;
12471 return a2(e4 = p2(t3.slice(i4, n4 + 1)), this.toBBox), e4;
12472 r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o3)), o3 = Math.ceil(h3 / Math.pow(o3, r3 - 1))), (e4 = p2([])).leaf = false, e4.height = r3;
12473 var s3 = Math.ceil(h3 / o3), l3 = s3 * Math.ceil(Math.sqrt(o3));
12474 d2(t3, i4, n4, l3, this.compareMinX);
12475 for (var f4 = i4; f4 <= n4; f4 += l3) {
12476 var u3 = Math.min(f4 + l3 - 1, n4);
12477 d2(t3, f4, u3, s3, this.compareMinY);
12478 for (var m3 = f4; m3 <= u3; m3 += s3) {
12479 var c3 = Math.min(m3 + s3 - 1, u3);
12480 e4.children.push(this._build(t3, m3, c3, r3 - 1));
12483 return a2(e4, this.toBBox), e4;
12484 }, r2.prototype._chooseSubtree = function(t3, i4, n4, r3) {
12485 for (; r3.push(i4), !i4.leaf && r3.length - 1 !== n4; ) {
12486 for (var e4 = 1 / 0, a3 = 1 / 0, h3 = void 0, o3 = 0; o3 < i4.children.length; o3++) {
12487 var s3 = i4.children[o3], l3 = f3(s3), u3 = (m3 = t3, c3 = s3, (Math.max(c3.maxX, m3.maxX) - Math.min(c3.minX, m3.minX)) * (Math.max(c3.maxY, m3.maxY) - Math.min(c3.minY, m3.minY)) - l3);
12488 u3 < a3 ? (a3 = u3, e4 = l3 < e4 ? l3 : e4, h3 = s3) : u3 === a3 && l3 < e4 && (e4 = l3, h3 = s3);
12490 i4 = h3 || i4.children[0];
12494 }, r2.prototype._insert = function(t3, i4, n4) {
12495 var r3 = n4 ? t3 : this.toBBox(t3), e4 = [], a3 = this._chooseSubtree(r3, this.data, i4, e4);
12496 for (a3.children.push(t3), o2(a3, r3); i4 >= 0 && e4[i4].children.length > this._maxEntries; )
12497 this._split(e4, i4), i4--;
12498 this._adjustParentBBoxes(r3, e4, i4);
12499 }, r2.prototype._split = function(t3, i4) {
12500 var n4 = t3[i4], r3 = n4.children.length, e4 = this._minEntries;
12501 this._chooseSplitAxis(n4, e4, r3);
12502 var h3 = this._chooseSplitIndex(n4, e4, r3), o3 = p2(n4.children.splice(h3, n4.children.length - h3));
12503 o3.height = n4.height, o3.leaf = n4.leaf, a2(n4, this.toBBox), a2(o3, this.toBBox), i4 ? t3[i4 - 1].children.push(o3) : this._splitRoot(n4, o3);
12504 }, r2.prototype._splitRoot = function(t3, i4) {
12505 this.data = p2([t3, i4]), this.data.height = t3.height + 1, this.data.leaf = false, a2(this.data, this.toBBox);
12506 }, r2.prototype._chooseSplitIndex = function(t3, i4, n4) {
12507 for (var r3, e4, a3, o3, s3, l3, u3, m3 = 1 / 0, c3 = 1 / 0, p3 = i4; p3 <= n4 - i4; p3++) {
12508 var d4 = h2(t3, 0, p3, this.toBBox), x2 = h2(t3, p3, n4, this.toBBox), v2 = (e4 = d4, a3 = x2, o3 = void 0, s3 = void 0, l3 = void 0, u3 = void 0, o3 = Math.max(e4.minX, a3.minX), s3 = Math.max(e4.minY, a3.minY), l3 = Math.min(e4.maxX, a3.maxX), u3 = Math.min(e4.maxY, a3.maxY), Math.max(0, l3 - o3) * Math.max(0, u3 - s3)), M2 = f3(d4) + f3(x2);
12509 v2 < m3 ? (m3 = v2, r3 = p3, c3 = M2 < c3 ? M2 : c3) : v2 === m3 && M2 < c3 && (c3 = M2, r3 = p3);
12511 return r3 || n4 - i4;
12512 }, r2.prototype._chooseSplitAxis = function(t3, i4, n4) {
12513 var r3 = t3.leaf ? this.compareMinX : s2, e4 = t3.leaf ? this.compareMinY : l2;
12514 this._allDistMargin(t3, i4, n4, r3) < this._allDistMargin(t3, i4, n4, e4) && t3.children.sort(r3);
12515 }, r2.prototype._allDistMargin = function(t3, i4, n4, r3) {
12516 t3.children.sort(r3);
12517 for (var e4 = this.toBBox, a3 = h2(t3, 0, i4, e4), s3 = h2(t3, n4 - i4, n4, e4), l3 = u2(a3) + u2(s3), f4 = i4; f4 < n4 - i4; f4++) {
12518 var m3 = t3.children[f4];
12519 o2(a3, t3.leaf ? e4(m3) : m3), l3 += u2(a3);
12521 for (var c3 = n4 - i4 - 1; c3 >= i4; c3--) {
12522 var p3 = t3.children[c3];
12523 o2(s3, t3.leaf ? e4(p3) : p3), l3 += u2(s3);
12526 }, r2.prototype._adjustParentBBoxes = function(t3, i4, n4) {
12527 for (var r3 = n4; r3 >= 0; r3--)
12529 }, r2.prototype._condense = function(t3) {
12530 for (var i4 = t3.length - 1, n4 = void 0; i4 >= 0; i4--)
12531 0 === t3[i4].children.length ? i4 > 0 ? (n4 = t3[i4 - 1].children).splice(n4.indexOf(t3[i4]), 1) : this.clear() : a2(t3[i4], this.toBBox);
12537 // node_modules/ieee754/index.js
12538 var require_ieee754 = __commonJS({
12539 "node_modules/ieee754/index.js"(exports2) {
12540 exports2.read = function(buffer, offset, isLE, mLen, nBytes) {
12542 var eLen = nBytes * 8 - mLen - 1;
12543 var eMax = (1 << eLen) - 1;
12544 var eBias = eMax >> 1;
12546 var i3 = isLE ? nBytes - 1 : 0;
12547 var d2 = isLE ? -1 : 1;
12548 var s2 = buffer[offset + i3];
12550 e3 = s2 & (1 << -nBits) - 1;
12553 for (; nBits > 0; e3 = e3 * 256 + buffer[offset + i3], i3 += d2, nBits -= 8) {
12555 m2 = e3 & (1 << -nBits) - 1;
12558 for (; nBits > 0; m2 = m2 * 256 + buffer[offset + i3], i3 += d2, nBits -= 8) {
12562 } else if (e3 === eMax) {
12563 return m2 ? NaN : (s2 ? -1 : 1) * Infinity;
12565 m2 = m2 + Math.pow(2, mLen);
12568 return (s2 ? -1 : 1) * m2 * Math.pow(2, e3 - mLen);
12570 exports2.write = function(buffer, value, offset, isLE, mLen, nBytes) {
12572 var eLen = nBytes * 8 - mLen - 1;
12573 var eMax = (1 << eLen) - 1;
12574 var eBias = eMax >> 1;
12575 var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
12576 var i3 = isLE ? 0 : nBytes - 1;
12577 var d2 = isLE ? 1 : -1;
12578 var s2 = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
12579 value = Math.abs(value);
12580 if (isNaN(value) || value === Infinity) {
12581 m2 = isNaN(value) ? 1 : 0;
12584 e3 = Math.floor(Math.log(value) / Math.LN2);
12585 if (value * (c2 = Math.pow(2, -e3)) < 1) {
12589 if (e3 + eBias >= 1) {
12592 value += rt * Math.pow(2, 1 - eBias);
12594 if (value * c2 >= 2) {
12598 if (e3 + eBias >= eMax) {
12601 } else if (e3 + eBias >= 1) {
12602 m2 = (value * c2 - 1) * Math.pow(2, mLen);
12605 m2 = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
12609 for (; mLen >= 8; buffer[offset + i3] = m2 & 255, i3 += d2, m2 /= 256, mLen -= 8) {
12611 e3 = e3 << mLen | m2;
12613 for (; eLen > 0; buffer[offset + i3] = e3 & 255, i3 += d2, e3 /= 256, eLen -= 8) {
12615 buffer[offset + i3 - d2] |= s2 * 128;
12620 // node_modules/pbf/index.js
12621 var require_pbf = __commonJS({
12622 "node_modules/pbf/index.js"(exports2, module2) {
12624 module2.exports = Pbf;
12625 var ieee754 = require_ieee754();
12626 function Pbf(buf) {
12627 this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);
12630 this.length = this.buf.length;
12636 var SHIFT_LEFT_32 = (1 << 16) * (1 << 16);
12637 var SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
12638 var TEXT_DECODER_MIN_LENGTH = 12;
12639 var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf8");
12641 destroy: function() {
12644 // === READING =================================================================
12645 readFields: function(readField, result, end) {
12646 end = end || this.length;
12647 while (this.pos < end) {
12648 var val = this.readVarint(), tag = val >> 3, startPos = this.pos;
12649 this.type = val & 7;
12650 readField(tag, result, this);
12651 if (this.pos === startPos)
12656 readMessage: function(readField, result) {
12657 return this.readFields(readField, result, this.readVarint() + this.pos);
12659 readFixed32: function() {
12660 var val = readUInt32(this.buf, this.pos);
12664 readSFixed32: function() {
12665 var val = readInt32(this.buf, this.pos);
12669 // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
12670 readFixed64: function() {
12671 var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
12675 readSFixed64: function() {
12676 var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
12680 readFloat: function() {
12681 var val = ieee754.read(this.buf, this.pos, true, 23, 4);
12685 readDouble: function() {
12686 var val = ieee754.read(this.buf, this.pos, true, 52, 8);
12690 readVarint: function(isSigned) {
12691 var buf = this.buf, val, b2;
12692 b2 = buf[this.pos++];
12696 b2 = buf[this.pos++];
12697 val |= (b2 & 127) << 7;
12700 b2 = buf[this.pos++];
12701 val |= (b2 & 127) << 14;
12704 b2 = buf[this.pos++];
12705 val |= (b2 & 127) << 21;
12708 b2 = buf[this.pos];
12709 val |= (b2 & 15) << 28;
12710 return readVarintRemainder(val, isSigned, this);
12712 readVarint64: function() {
12713 return this.readVarint(true);
12715 readSVarint: function() {
12716 var num = this.readVarint();
12717 return num % 2 === 1 ? (num + 1) / -2 : num / 2;
12719 readBoolean: function() {
12720 return Boolean(this.readVarint());
12722 readString: function() {
12723 var end = this.readVarint() + this.pos;
12724 var pos = this.pos;
12726 if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
12727 return readUtf8TextDecoder(this.buf, pos, end);
12729 return readUtf8(this.buf, pos, end);
12731 readBytes: function() {
12732 var end = this.readVarint() + this.pos, buffer = this.buf.subarray(this.pos, end);
12736 // verbose for performance reasons; doesn't affect gzipped size
12737 readPackedVarint: function(arr, isSigned) {
12738 if (this.type !== Pbf.Bytes)
12739 return arr.push(this.readVarint(isSigned));
12740 var end = readPackedEnd(this);
12742 while (this.pos < end)
12743 arr.push(this.readVarint(isSigned));
12746 readPackedSVarint: function(arr) {
12747 if (this.type !== Pbf.Bytes)
12748 return arr.push(this.readSVarint());
12749 var end = readPackedEnd(this);
12751 while (this.pos < end)
12752 arr.push(this.readSVarint());
12755 readPackedBoolean: function(arr) {
12756 if (this.type !== Pbf.Bytes)
12757 return arr.push(this.readBoolean());
12758 var end = readPackedEnd(this);
12760 while (this.pos < end)
12761 arr.push(this.readBoolean());
12764 readPackedFloat: function(arr) {
12765 if (this.type !== Pbf.Bytes)
12766 return arr.push(this.readFloat());
12767 var end = readPackedEnd(this);
12769 while (this.pos < end)
12770 arr.push(this.readFloat());
12773 readPackedDouble: function(arr) {
12774 if (this.type !== Pbf.Bytes)
12775 return arr.push(this.readDouble());
12776 var end = readPackedEnd(this);
12778 while (this.pos < end)
12779 arr.push(this.readDouble());
12782 readPackedFixed32: function(arr) {
12783 if (this.type !== Pbf.Bytes)
12784 return arr.push(this.readFixed32());
12785 var end = readPackedEnd(this);
12787 while (this.pos < end)
12788 arr.push(this.readFixed32());
12791 readPackedSFixed32: function(arr) {
12792 if (this.type !== Pbf.Bytes)
12793 return arr.push(this.readSFixed32());
12794 var end = readPackedEnd(this);
12796 while (this.pos < end)
12797 arr.push(this.readSFixed32());
12800 readPackedFixed64: function(arr) {
12801 if (this.type !== Pbf.Bytes)
12802 return arr.push(this.readFixed64());
12803 var end = readPackedEnd(this);
12805 while (this.pos < end)
12806 arr.push(this.readFixed64());
12809 readPackedSFixed64: function(arr) {
12810 if (this.type !== Pbf.Bytes)
12811 return arr.push(this.readSFixed64());
12812 var end = readPackedEnd(this);
12814 while (this.pos < end)
12815 arr.push(this.readSFixed64());
12818 skip: function(val) {
12819 var type2 = val & 7;
12820 if (type2 === Pbf.Varint)
12821 while (this.buf[this.pos++] > 127) {
12823 else if (type2 === Pbf.Bytes)
12824 this.pos = this.readVarint() + this.pos;
12825 else if (type2 === Pbf.Fixed32)
12827 else if (type2 === Pbf.Fixed64)
12830 throw new Error("Unimplemented type: " + type2);
12832 // === WRITING =================================================================
12833 writeTag: function(tag, type2) {
12834 this.writeVarint(tag << 3 | type2);
12836 realloc: function(min3) {
12837 var length = this.length || 16;
12838 while (length < this.pos + min3)
12840 if (length !== this.length) {
12841 var buf = new Uint8Array(length);
12844 this.length = length;
12847 finish: function() {
12848 this.length = this.pos;
12850 return this.buf.subarray(0, this.length);
12852 writeFixed32: function(val) {
12854 writeInt32(this.buf, val, this.pos);
12857 writeSFixed32: function(val) {
12859 writeInt32(this.buf, val, this.pos);
12862 writeFixed64: function(val) {
12864 writeInt32(this.buf, val & -1, this.pos);
12865 writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
12868 writeSFixed64: function(val) {
12870 writeInt32(this.buf, val & -1, this.pos);
12871 writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
12874 writeVarint: function(val) {
12876 if (val > 268435455 || val < 0) {
12877 writeBigVarint(val, this);
12881 this.buf[this.pos++] = val & 127 | (val > 127 ? 128 : 0);
12884 this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
12887 this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
12890 this.buf[this.pos++] = val >>> 7 & 127;
12892 writeSVarint: function(val) {
12893 this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
12895 writeBoolean: function(val) {
12896 this.writeVarint(Boolean(val));
12898 writeString: function(str2) {
12899 str2 = String(str2);
12900 this.realloc(str2.length * 4);
12902 var startPos = this.pos;
12903 this.pos = writeUtf8(this.buf, str2, this.pos);
12904 var len = this.pos - startPos;
12906 makeRoomForExtraLength(startPos, len, this);
12907 this.pos = startPos - 1;
12908 this.writeVarint(len);
12911 writeFloat: function(val) {
12913 ieee754.write(this.buf, val, this.pos, true, 23, 4);
12916 writeDouble: function(val) {
12918 ieee754.write(this.buf, val, this.pos, true, 52, 8);
12921 writeBytes: function(buffer) {
12922 var len = buffer.length;
12923 this.writeVarint(len);
12925 for (var i3 = 0; i3 < len; i3++)
12926 this.buf[this.pos++] = buffer[i3];
12928 writeRawMessage: function(fn, obj) {
12930 var startPos = this.pos;
12932 var len = this.pos - startPos;
12934 makeRoomForExtraLength(startPos, len, this);
12935 this.pos = startPos - 1;
12936 this.writeVarint(len);
12939 writeMessage: function(tag, fn, obj) {
12940 this.writeTag(tag, Pbf.Bytes);
12941 this.writeRawMessage(fn, obj);
12943 writePackedVarint: function(tag, arr) {
12945 this.writeMessage(tag, writePackedVarint, arr);
12947 writePackedSVarint: function(tag, arr) {
12949 this.writeMessage(tag, writePackedSVarint, arr);
12951 writePackedBoolean: function(tag, arr) {
12953 this.writeMessage(tag, writePackedBoolean, arr);
12955 writePackedFloat: function(tag, arr) {
12957 this.writeMessage(tag, writePackedFloat, arr);
12959 writePackedDouble: function(tag, arr) {
12961 this.writeMessage(tag, writePackedDouble, arr);
12963 writePackedFixed32: function(tag, arr) {
12965 this.writeMessage(tag, writePackedFixed32, arr);
12967 writePackedSFixed32: function(tag, arr) {
12969 this.writeMessage(tag, writePackedSFixed32, arr);
12971 writePackedFixed64: function(tag, arr) {
12973 this.writeMessage(tag, writePackedFixed64, arr);
12975 writePackedSFixed64: function(tag, arr) {
12977 this.writeMessage(tag, writePackedSFixed64, arr);
12979 writeBytesField: function(tag, buffer) {
12980 this.writeTag(tag, Pbf.Bytes);
12981 this.writeBytes(buffer);
12983 writeFixed32Field: function(tag, val) {
12984 this.writeTag(tag, Pbf.Fixed32);
12985 this.writeFixed32(val);
12987 writeSFixed32Field: function(tag, val) {
12988 this.writeTag(tag, Pbf.Fixed32);
12989 this.writeSFixed32(val);
12991 writeFixed64Field: function(tag, val) {
12992 this.writeTag(tag, Pbf.Fixed64);
12993 this.writeFixed64(val);
12995 writeSFixed64Field: function(tag, val) {
12996 this.writeTag(tag, Pbf.Fixed64);
12997 this.writeSFixed64(val);
12999 writeVarintField: function(tag, val) {
13000 this.writeTag(tag, Pbf.Varint);
13001 this.writeVarint(val);
13003 writeSVarintField: function(tag, val) {
13004 this.writeTag(tag, Pbf.Varint);
13005 this.writeSVarint(val);
13007 writeStringField: function(tag, str2) {
13008 this.writeTag(tag, Pbf.Bytes);
13009 this.writeString(str2);
13011 writeFloatField: function(tag, val) {
13012 this.writeTag(tag, Pbf.Fixed32);
13013 this.writeFloat(val);
13015 writeDoubleField: function(tag, val) {
13016 this.writeTag(tag, Pbf.Fixed64);
13017 this.writeDouble(val);
13019 writeBooleanField: function(tag, val) {
13020 this.writeVarintField(tag, Boolean(val));
13023 function readVarintRemainder(l2, s2, p2) {
13024 var buf = p2.buf, h2, b2;
13025 b2 = buf[p2.pos++];
13026 h2 = (b2 & 112) >> 4;
13028 return toNum(l2, h2, s2);
13029 b2 = buf[p2.pos++];
13030 h2 |= (b2 & 127) << 3;
13032 return toNum(l2, h2, s2);
13033 b2 = buf[p2.pos++];
13034 h2 |= (b2 & 127) << 10;
13036 return toNum(l2, h2, s2);
13037 b2 = buf[p2.pos++];
13038 h2 |= (b2 & 127) << 17;
13040 return toNum(l2, h2, s2);
13041 b2 = buf[p2.pos++];
13042 h2 |= (b2 & 127) << 24;
13044 return toNum(l2, h2, s2);
13045 b2 = buf[p2.pos++];
13046 h2 |= (b2 & 1) << 31;
13048 return toNum(l2, h2, s2);
13049 throw new Error("Expected varint not more than 10 bytes");
13051 function readPackedEnd(pbf) {
13052 return pbf.type === Pbf.Bytes ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
13054 function toNum(low, high, isSigned) {
13056 return high * 4294967296 + (low >>> 0);
13058 return (high >>> 0) * 4294967296 + (low >>> 0);
13060 function writeBigVarint(val, pbf) {
13063 low = val % 4294967296 | 0;
13064 high = val / 4294967296 | 0;
13066 low = ~(-val % 4294967296);
13067 high = ~(-val / 4294967296);
13068 if (low ^ 4294967295) {
13072 high = high + 1 | 0;
13075 if (val >= 18446744073709552e3 || val < -18446744073709552e3) {
13076 throw new Error("Given varint doesn't fit into 10 bytes");
13079 writeBigVarintLow(low, high, pbf);
13080 writeBigVarintHigh(high, pbf);
13082 function writeBigVarintLow(low, high, pbf) {
13083 pbf.buf[pbf.pos++] = low & 127 | 128;
13085 pbf.buf[pbf.pos++] = low & 127 | 128;
13087 pbf.buf[pbf.pos++] = low & 127 | 128;
13089 pbf.buf[pbf.pos++] = low & 127 | 128;
13091 pbf.buf[pbf.pos] = low & 127;
13093 function writeBigVarintHigh(high, pbf) {
13094 var lsb = (high & 7) << 4;
13095 pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 128 : 0);
13098 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
13101 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
13104 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
13107 pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
13110 pbf.buf[pbf.pos++] = high & 127;
13112 function makeRoomForExtraLength(startPos, len, pbf) {
13113 var extraLen = len <= 16383 ? 1 : len <= 2097151 ? 2 : len <= 268435455 ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
13114 pbf.realloc(extraLen);
13115 for (var i3 = pbf.pos - 1; i3 >= startPos; i3--)
13116 pbf.buf[i3 + extraLen] = pbf.buf[i3];
13118 function writePackedVarint(arr, pbf) {
13119 for (var i3 = 0; i3 < arr.length; i3++)
13120 pbf.writeVarint(arr[i3]);
13122 function writePackedSVarint(arr, pbf) {
13123 for (var i3 = 0; i3 < arr.length; i3++)
13124 pbf.writeSVarint(arr[i3]);
13126 function writePackedFloat(arr, pbf) {
13127 for (var i3 = 0; i3 < arr.length; i3++)
13128 pbf.writeFloat(arr[i3]);
13130 function writePackedDouble(arr, pbf) {
13131 for (var i3 = 0; i3 < arr.length; i3++)
13132 pbf.writeDouble(arr[i3]);
13134 function writePackedBoolean(arr, pbf) {
13135 for (var i3 = 0; i3 < arr.length; i3++)
13136 pbf.writeBoolean(arr[i3]);
13138 function writePackedFixed32(arr, pbf) {
13139 for (var i3 = 0; i3 < arr.length; i3++)
13140 pbf.writeFixed32(arr[i3]);
13142 function writePackedSFixed32(arr, pbf) {
13143 for (var i3 = 0; i3 < arr.length; i3++)
13144 pbf.writeSFixed32(arr[i3]);
13146 function writePackedFixed64(arr, pbf) {
13147 for (var i3 = 0; i3 < arr.length; i3++)
13148 pbf.writeFixed64(arr[i3]);
13150 function writePackedSFixed64(arr, pbf) {
13151 for (var i3 = 0; i3 < arr.length; i3++)
13152 pbf.writeSFixed64(arr[i3]);
13154 function readUInt32(buf, pos) {
13155 return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + buf[pos + 3] * 16777216;
13157 function writeInt32(buf, val, pos) {
13159 buf[pos + 1] = val >>> 8;
13160 buf[pos + 2] = val >>> 16;
13161 buf[pos + 3] = val >>> 24;
13163 function readInt32(buf, pos) {
13164 return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + (buf[pos + 3] << 24);
13166 function readUtf8(buf, pos, end) {
13172 var bytesPerSequence = b0 > 239 ? 4 : b0 > 223 ? 3 : b0 > 191 ? 2 : 1;
13173 if (i3 + bytesPerSequence > end)
13176 if (bytesPerSequence === 1) {
13180 } else if (bytesPerSequence === 2) {
13182 if ((b1 & 192) === 128) {
13183 c2 = (b0 & 31) << 6 | b1 & 63;
13188 } else if (bytesPerSequence === 3) {
13191 if ((b1 & 192) === 128 && (b2 & 192) === 128) {
13192 c2 = (b0 & 15) << 12 | (b1 & 63) << 6 | b2 & 63;
13193 if (c2 <= 2047 || c2 >= 55296 && c2 <= 57343) {
13197 } else if (bytesPerSequence === 4) {
13201 if ((b1 & 192) === 128 && (b2 & 192) === 128 && (b3 & 192) === 128) {
13202 c2 = (b0 & 15) << 18 | (b1 & 63) << 12 | (b2 & 63) << 6 | b3 & 63;
13203 if (c2 <= 65535 || c2 >= 1114112) {
13210 bytesPerSequence = 1;
13211 } else if (c2 > 65535) {
13213 str2 += String.fromCharCode(c2 >>> 10 & 1023 | 55296);
13214 c2 = 56320 | c2 & 1023;
13216 str2 += String.fromCharCode(c2);
13217 i3 += bytesPerSequence;
13221 function readUtf8TextDecoder(buf, pos, end) {
13222 return utf8TextDecoder.decode(buf.subarray(pos, end));
13224 function writeUtf8(buf, str2, pos) {
13225 for (var i3 = 0, c2, lead; i3 < str2.length; i3++) {
13226 c2 = str2.charCodeAt(i3);
13227 if (c2 > 55295 && c2 < 57344) {
13236 c2 = lead - 55296 << 10 | c2 - 56320 | 65536;
13240 if (c2 > 56319 || i3 + 1 === str2.length) {
13259 buf[pos++] = c2 >> 6 | 192;
13262 buf[pos++] = c2 >> 12 | 224;
13264 buf[pos++] = c2 >> 18 | 240;
13265 buf[pos++] = c2 >> 12 & 63 | 128;
13267 buf[pos++] = c2 >> 6 & 63 | 128;
13269 buf[pos++] = c2 & 63 | 128;
13277 // node_modules/@mapbox/point-geometry/index.js
13278 var require_point_geometry = __commonJS({
13279 "node_modules/@mapbox/point-geometry/index.js"(exports2, module2) {
13281 module2.exports = Point;
13282 function Point(x2, y2) {
13286 Point.prototype = {
13288 * Clone this point, returning a new point that can be modified
13289 * without affecting the old one.
13290 * @return {Point} the clone
13292 clone: function() {
13293 return new Point(this.x, this.y);
13296 * Add this point's x & y coordinates to another point,
13297 * yielding a new point.
13298 * @param {Point} p the other point
13299 * @return {Point} output point
13301 add: function(p2) {
13302 return this.clone()._add(p2);
13305 * Subtract this point's x & y coordinates to from point,
13306 * yielding a new point.
13307 * @param {Point} p the other point
13308 * @return {Point} output point
13310 sub: function(p2) {
13311 return this.clone()._sub(p2);
13314 * Multiply this point's x & y coordinates by point,
13315 * yielding a new point.
13316 * @param {Point} p the other point
13317 * @return {Point} output point
13319 multByPoint: function(p2) {
13320 return this.clone()._multByPoint(p2);
13323 * Divide this point's x & y coordinates by point,
13324 * yielding a new point.
13325 * @param {Point} p the other point
13326 * @return {Point} output point
13328 divByPoint: function(p2) {
13329 return this.clone()._divByPoint(p2);
13332 * Multiply this point's x & y coordinates by a factor,
13333 * yielding a new point.
13334 * @param {Point} k factor
13335 * @return {Point} output point
13337 mult: function(k2) {
13338 return this.clone()._mult(k2);
13341 * Divide this point's x & y coordinates by a factor,
13342 * yielding a new point.
13343 * @param {Point} k factor
13344 * @return {Point} output point
13346 div: function(k2) {
13347 return this.clone()._div(k2);
13350 * Rotate this point around the 0, 0 origin by an angle a,
13352 * @param {Number} a angle to rotate around, in radians
13353 * @return {Point} output point
13355 rotate: function(a2) {
13356 return this.clone()._rotate(a2);
13359 * Rotate this point around p point by an angle a,
13361 * @param {Number} a angle to rotate around, in radians
13362 * @param {Point} p Point to rotate around
13363 * @return {Point} output point
13365 rotateAround: function(a2, p2) {
13366 return this.clone()._rotateAround(a2, p2);
13369 * Multiply this point by a 4x1 transformation matrix
13370 * @param {Array<Number>} m transformation matrix
13371 * @return {Point} output point
13373 matMult: function(m2) {
13374 return this.clone()._matMult(m2);
13377 * Calculate this point but as a unit vector from 0, 0, meaning
13378 * that the distance from the resulting point to the 0, 0
13379 * coordinate will be equal to 1 and the angle from the resulting
13380 * point to the 0, 0 coordinate will be the same as before.
13381 * @return {Point} unit vector point
13384 return this.clone()._unit();
13387 * Compute a perpendicular point, where the new y coordinate
13388 * is the old x coordinate and the new x coordinate is the old y
13389 * coordinate multiplied by -1
13390 * @return {Point} perpendicular point
13393 return this.clone()._perp();
13396 * Return a version of this point with the x & y coordinates
13397 * rounded to integers.
13398 * @return {Point} rounded point
13400 round: function() {
13401 return this.clone()._round();
13404 * Return the magitude of this point: this is the Euclidean
13405 * distance from the 0, 0 coordinate to this point's x and y
13407 * @return {Number} magnitude
13410 return Math.sqrt(this.x * this.x + this.y * this.y);
13413 * Judge whether this point is equal to another point, returning
13415 * @param {Point} other the other point
13416 * @return {boolean} whether the points are equal
13418 equals: function(other) {
13419 return this.x === other.x && this.y === other.y;
13422 * Calculate the distance from this point to another point
13423 * @param {Point} p the other point
13424 * @return {Number} distance
13426 dist: function(p2) {
13427 return Math.sqrt(this.distSqr(p2));
13430 * Calculate the distance from this point to another point,
13431 * without the square root step. Useful if you're comparing
13432 * relative distances.
13433 * @param {Point} p the other point
13434 * @return {Number} distance
13436 distSqr: function(p2) {
13437 var dx = p2.x - this.x, dy = p2.y - this.y;
13438 return dx * dx + dy * dy;
13441 * Get the angle from the 0, 0 coordinate to this point, in radians
13443 * @return {Number} angle
13445 angle: function() {
13446 return Math.atan2(this.y, this.x);
13449 * Get the angle from this point to another point, in radians
13450 * @param {Point} b the other point
13451 * @return {Number} angle
13453 angleTo: function(b2) {
13454 return Math.atan2(this.y - b2.y, this.x - b2.x);
13457 * Get the angle between this point and another point, in radians
13458 * @param {Point} b the other point
13459 * @return {Number} angle
13461 angleWith: function(b2) {
13462 return this.angleWithSep(b2.x, b2.y);
13465 * Find the angle of the two vectors, solving the formula for
13466 * the cross product a x b = |a||b|sin(θ) for θ.
13467 * @param {Number} x the x-coordinate
13468 * @param {Number} y the y-coordinate
13469 * @return {Number} the angle in radians
13471 angleWithSep: function(x2, y2) {
13473 this.x * y2 - this.y * x2,
13474 this.x * x2 + this.y * y2
13477 _matMult: function(m2) {
13478 var x2 = m2[0] * this.x + m2[1] * this.y, y2 = m2[2] * this.x + m2[3] * this.y;
13483 _add: function(p2) {
13488 _sub: function(p2) {
13493 _mult: function(k2) {
13498 _div: function(k2) {
13503 _multByPoint: function(p2) {
13508 _divByPoint: function(p2) {
13513 _unit: function() {
13514 this._div(this.mag());
13517 _perp: function() {
13523 _rotate: function(angle2) {
13524 var cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), x2 = cos2 * this.x - sin2 * this.y, y2 = sin2 * this.x + cos2 * this.y;
13529 _rotateAround: function(angle2, p2) {
13530 var cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), x2 = p2.x + cos2 * (this.x - p2.x) - sin2 * (this.y - p2.y), y2 = p2.y + sin2 * (this.x - p2.x) + cos2 * (this.y - p2.y);
13535 _round: function() {
13536 this.x = Math.round(this.x);
13537 this.y = Math.round(this.y);
13541 Point.convert = function(a2) {
13542 if (a2 instanceof Point) {
13545 if (Array.isArray(a2)) {
13546 return new Point(a2[0], a2[1]);
13553 // node_modules/@mapbox/vector-tile/lib/vectortilefeature.js
13554 var require_vectortilefeature = __commonJS({
13555 "node_modules/@mapbox/vector-tile/lib/vectortilefeature.js"(exports2, module2) {
13557 var Point = require_point_geometry();
13558 module2.exports = VectorTileFeature;
13559 function VectorTileFeature(pbf, end, extent, keys2, values) {
13560 this.properties = {};
13561 this.extent = extent;
13564 this._geometry = -1;
13565 this._keys = keys2;
13566 this._values = values;
13567 pbf.readFields(readFeature, this, end);
13569 function readFeature(tag, feature3, pbf) {
13571 feature3.id = pbf.readVarint();
13573 readTag(pbf, feature3);
13575 feature3.type = pbf.readVarint();
13577 feature3._geometry = pbf.pos;
13579 function readTag(pbf, feature3) {
13580 var end = pbf.readVarint() + pbf.pos;
13581 while (pbf.pos < end) {
13582 var key = feature3._keys[pbf.readVarint()], value = feature3._values[pbf.readVarint()];
13583 feature3.properties[key] = value;
13586 VectorTileFeature.types = ["Unknown", "Point", "LineString", "Polygon"];
13587 VectorTileFeature.prototype.loadGeometry = function() {
13588 var pbf = this._pbf;
13589 pbf.pos = this._geometry;
13590 var end = pbf.readVarint() + pbf.pos, cmd = 1, length = 0, x2 = 0, y2 = 0, lines = [], line;
13591 while (pbf.pos < end) {
13593 var cmdLen = pbf.readVarint();
13595 length = cmdLen >> 3;
13598 if (cmd === 1 || cmd === 2) {
13599 x2 += pbf.readSVarint();
13600 y2 += pbf.readSVarint();
13606 line.push(new Point(x2, y2));
13607 } else if (cmd === 7) {
13609 line.push(line[0].clone());
13612 throw new Error("unknown command " + cmd);
13619 VectorTileFeature.prototype.bbox = function() {
13620 var pbf = this._pbf;
13621 pbf.pos = this._geometry;
13622 var end = pbf.readVarint() + pbf.pos, cmd = 1, length = 0, x2 = 0, y2 = 0, x12 = Infinity, x22 = -Infinity, y12 = Infinity, y22 = -Infinity;
13623 while (pbf.pos < end) {
13625 var cmdLen = pbf.readVarint();
13627 length = cmdLen >> 3;
13630 if (cmd === 1 || cmd === 2) {
13631 x2 += pbf.readSVarint();
13632 y2 += pbf.readSVarint();
13641 } else if (cmd !== 7) {
13642 throw new Error("unknown command " + cmd);
13645 return [x12, y12, x22, y22];
13647 VectorTileFeature.prototype.toGeoJSON = function(x2, y2, z2) {
13648 var size = this.extent * Math.pow(2, z2), x05 = this.extent * x2, y05 = this.extent * y2, coords = this.loadGeometry(), type2 = VectorTileFeature.types[this.type], i3, j3;
13649 function project(line) {
13650 for (var j4 = 0; j4 < line.length; j4++) {
13651 var p2 = line[j4], y22 = 180 - (p2.y + y05) * 360 / size;
13653 (p2.x + x05) * 360 / size - 180,
13654 360 / Math.PI * Math.atan(Math.exp(y22 * Math.PI / 180)) - 90
13658 switch (this.type) {
13661 for (i3 = 0; i3 < coords.length; i3++) {
13662 points[i3] = coords[i3][0];
13668 for (i3 = 0; i3 < coords.length; i3++) {
13669 project(coords[i3]);
13673 coords = classifyRings(coords);
13674 for (i3 = 0; i3 < coords.length; i3++) {
13675 for (j3 = 0; j3 < coords[i3].length; j3++) {
13676 project(coords[i3][j3]);
13681 if (coords.length === 1) {
13682 coords = coords[0];
13684 type2 = "Multi" + type2;
13690 coordinates: coords
13692 properties: this.properties
13694 if ("id" in this) {
13695 result.id = this.id;
13699 function classifyRings(rings) {
13700 var len = rings.length;
13703 var polygons = [], polygon2, ccw;
13704 for (var i3 = 0; i3 < len; i3++) {
13705 var area = signedArea(rings[i3]);
13708 if (ccw === void 0)
13710 if (ccw === area < 0) {
13712 polygons.push(polygon2);
13713 polygon2 = [rings[i3]];
13715 polygon2.push(rings[i3]);
13719 polygons.push(polygon2);
13722 function signedArea(ring) {
13724 for (var i3 = 0, len = ring.length, j3 = len - 1, p1, p2; i3 < len; j3 = i3++) {
13727 sum += (p2.x - p1.x) * (p1.y + p2.y);
13734 // node_modules/@mapbox/vector-tile/lib/vectortilelayer.js
13735 var require_vectortilelayer = __commonJS({
13736 "node_modules/@mapbox/vector-tile/lib/vectortilelayer.js"(exports2, module2) {
13738 var VectorTileFeature = require_vectortilefeature();
13739 module2.exports = VectorTileLayer;
13740 function VectorTileLayer(pbf, end) {
13743 this.extent = 4096;
13748 this._features = [];
13749 pbf.readFields(readLayer, this, end);
13750 this.length = this._features.length;
13752 function readLayer(tag, layer, pbf) {
13754 layer.version = pbf.readVarint();
13755 else if (tag === 1)
13756 layer.name = pbf.readString();
13757 else if (tag === 5)
13758 layer.extent = pbf.readVarint();
13759 else if (tag === 2)
13760 layer._features.push(pbf.pos);
13761 else if (tag === 3)
13762 layer._keys.push(pbf.readString());
13763 else if (tag === 4)
13764 layer._values.push(readValueMessage(pbf));
13766 function readValueMessage(pbf) {
13767 var value = null, end = pbf.readVarint() + pbf.pos;
13768 while (pbf.pos < end) {
13769 var tag = pbf.readVarint() >> 3;
13770 value = tag === 1 ? pbf.readString() : tag === 2 ? pbf.readFloat() : tag === 3 ? pbf.readDouble() : tag === 4 ? pbf.readVarint64() : tag === 5 ? pbf.readVarint() : tag === 6 ? pbf.readSVarint() : tag === 7 ? pbf.readBoolean() : null;
13774 VectorTileLayer.prototype.feature = function(i3) {
13775 if (i3 < 0 || i3 >= this._features.length)
13776 throw new Error("feature index out of bounds");
13777 this._pbf.pos = this._features[i3];
13778 var end = this._pbf.readVarint() + this._pbf.pos;
13779 return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);
13784 // node_modules/@mapbox/vector-tile/lib/vectortile.js
13785 var require_vectortile = __commonJS({
13786 "node_modules/@mapbox/vector-tile/lib/vectortile.js"(exports2, module2) {
13788 var VectorTileLayer = require_vectortilelayer();
13789 module2.exports = VectorTile3;
13790 function VectorTile3(pbf, end) {
13791 this.layers = pbf.readFields(readTile, {}, end);
13793 function readTile(tag, layers, pbf) {
13795 var layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
13797 layers[layer.name] = layer;
13803 // node_modules/@mapbox/vector-tile/index.js
13804 var require_vector_tile = __commonJS({
13805 "node_modules/@mapbox/vector-tile/index.js"(exports2, module2) {
13806 module2.exports.VectorTile = require_vectortile();
13807 module2.exports.VectorTileFeature = require_vectortilefeature();
13808 module2.exports.VectorTileLayer = require_vectortilelayer();
13812 // node_modules/fast-json-stable-stringify/index.js
13813 var require_fast_json_stable_stringify = __commonJS({
13814 "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
13816 module2.exports = function(data, opts) {
13819 if (typeof opts === "function")
13820 opts = { cmp: opts };
13821 var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
13822 var cmp = opts.cmp && function(f3) {
13823 return function(node) {
13824 return function(a2, b2) {
13825 var aobj = { key: a2, value: node[a2] };
13826 var bobj = { key: b2, value: node[b2] };
13827 return f3(aobj, bobj);
13832 return function stringify3(node) {
13833 if (node && node.toJSON && typeof node.toJSON === "function") {
13834 node = node.toJSON();
13836 if (node === void 0)
13838 if (typeof node == "number")
13839 return isFinite(node) ? "" + node : "null";
13840 if (typeof node !== "object")
13841 return JSON.stringify(node);
13843 if (Array.isArray(node)) {
13845 for (i3 = 0; i3 < node.length; i3++) {
13848 out += stringify3(node[i3]) || "null";
13854 if (seen.indexOf(node) !== -1) {
13856 return JSON.stringify("__cycle__");
13857 throw new TypeError("Converting circular structure to JSON");
13859 var seenIndex = seen.push(node) - 1;
13860 var keys2 = Object.keys(node).sort(cmp && cmp(node));
13862 for (i3 = 0; i3 < keys2.length; i3++) {
13863 var key = keys2[i3];
13864 var value = stringify3(node[key]);
13869 out += JSON.stringify(key) + ":" + value;
13871 seen.splice(seenIndex, 1);
13872 return "{" + out + "}";
13878 // node_modules/@mapbox/sexagesimal/index.js
13879 var require_sexagesimal = __commonJS({
13880 "node_modules/@mapbox/sexagesimal/index.js"(exports2, module2) {
13881 module2.exports = element;
13882 module2.exports.pair = pair3;
13883 module2.exports.format = format2;
13884 module2.exports.formatPair = formatPair;
13885 module2.exports.coordToDMS = coordToDMS;
13886 function element(input, dims) {
13887 var result = search(input, dims);
13888 return result === null ? null : result.val;
13890 function formatPair(input) {
13891 return format2(input.lat, "lat") + " " + format2(input.lon, "lon");
13893 function format2(input, dim) {
13894 var dms = coordToDMS(input, dim);
13895 return dms.whole + "\xB0 " + (dms.minutes ? dms.minutes + "' " : "") + (dms.seconds ? dms.seconds + '" ' : "") + dms.dir;
13897 function coordToDMS(input, dim) {
13898 var dirs = { lat: ["N", "S"], lon: ["E", "W"] }[dim] || "";
13899 var dir = dirs[input >= 0 ? 0 : 1];
13900 var abs3 = Math.abs(input);
13901 var whole = Math.floor(abs3);
13902 var fraction = abs3 - whole;
13903 var fractionMinutes = fraction * 60;
13904 var minutes = Math.floor(fractionMinutes);
13905 var seconds = Math.floor((fractionMinutes - minutes) * 60);
13913 function search(input, dims) {
13916 if (typeof input !== "string")
13918 input = input.toUpperCase();
13919 var regex = /^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/;
13920 var m2 = input.match(regex);
13923 var matched = m2[0];
13925 if (m2[1] && m2[5]) {
13927 matched = matched.slice(0, -1);
13929 dim = m2[1] || m2[5];
13931 if (dim && dims.indexOf(dim) === -1)
13933 var deg = m2[2] ? parseFloat(m2[2]) : 0;
13934 var min3 = m2[3] ? parseFloat(m2[3]) / 60 : 0;
13935 var sec = m2[4] ? parseFloat(m2[4]) / 3600 : 0;
13936 var sign2 = deg < 0 ? -1 : 1;
13937 if (dim === "S" || dim === "W")
13940 val: (Math.abs(deg) + min3 + sec) * sign2,
13943 remain: input.slice(matched.length)
13946 function pair3(input, dims) {
13947 input = input.trim();
13948 var one2 = search(input, dims);
13951 input = one2.remain.trim();
13952 var two = search(input, dims);
13953 if (!two || two.remain)
13956 return swapdim(one2.val, two.val, one2.dim);
13958 return [one2.val, two.val];
13961 function swapdim(a2, b2, dim) {
13962 if (dim === "N" || dim === "S")
13964 if (dim === "W" || dim === "E")
13970 // node_modules/store/src/util.js
13971 var require_util = __commonJS({
13972 "node_modules/store/src/util.js"(exports2, module2) {
13973 var assign = make_assign();
13974 var create2 = make_create();
13975 var trim = make_trim();
13976 var Global = typeof window !== "undefined" ? window : global;
13977 module2.exports = {
13987 isFunction: isFunction2,
13988 isObject: isObject3,
13991 function make_assign() {
13992 if (Object.assign) {
13993 return Object.assign;
13995 return function shimAssign(obj, props1, props2, etc) {
13996 for (var i3 = 1; i3 < arguments.length; i3++) {
13997 each(Object(arguments[i3]), function(val, key) {
14005 function make_create() {
14006 if (Object.create) {
14007 return function create3(obj, assignProps1, assignProps2, etc) {
14008 var assignArgsList = slice(arguments, 1);
14009 return assign.apply(this, [Object.create(obj)].concat(assignArgsList));
14012 let F3 = function() {
14015 return function create3(obj, assignProps1, assignProps2, etc) {
14016 var assignArgsList = slice(arguments, 1);
14017 F3.prototype = obj;
14018 return assign.apply(this, [new F3()].concat(assignArgsList));
14022 function make_trim() {
14023 if (String.prototype.trim) {
14024 return function trim2(str2) {
14025 return String.prototype.trim.call(str2);
14028 return function trim2(str2) {
14029 return str2.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
14033 function bind(obj, fn) {
14034 return function() {
14035 return fn.apply(obj, Array.prototype.slice.call(arguments, 0));
14038 function slice(arr, index) {
14039 return Array.prototype.slice.call(arr, index || 0);
14041 function each(obj, fn) {
14042 pluck(obj, function(val, key) {
14047 function map2(obj, fn) {
14048 var res = isList(obj) ? [] : {};
14049 pluck(obj, function(v2, k2) {
14050 res[k2] = fn(v2, k2);
14055 function pluck(obj, fn) {
14057 for (var i3 = 0; i3 < obj.length; i3++) {
14058 if (fn(obj[i3], i3)) {
14063 for (var key in obj) {
14064 if (obj.hasOwnProperty(key)) {
14065 if (fn(obj[key], key)) {
14072 function isList(val) {
14073 return val != null && typeof val != "function" && typeof val.length == "number";
14075 function isFunction2(val) {
14076 return val && {}.toString.call(val) === "[object Function]";
14078 function isObject3(val) {
14079 return val && {}.toString.call(val) === "[object Object]";
14084 // node_modules/store/src/store-engine.js
14085 var require_store_engine = __commonJS({
14086 "node_modules/store/src/store-engine.js"(exports2, module2) {
14087 var util = require_util();
14088 var slice = util.slice;
14089 var pluck = util.pluck;
14090 var each = util.each;
14091 var bind = util.bind;
14092 var create2 = util.create;
14093 var isList = util.isList;
14094 var isFunction2 = util.isFunction;
14095 var isObject3 = util.isObject;
14096 module2.exports = {
14102 // get returns the value of the given key. If that value
14103 // is undefined, it returns optionalDefaultValue instead.
14104 get: function(key, optionalDefaultValue) {
14105 var data = this.storage.read(this._namespacePrefix + key);
14106 return this._deserialize(data, optionalDefaultValue);
14108 // set will store the given value at key and returns value.
14109 // Calling set with value === undefined is equivalent to calling remove.
14110 set: function(key, value) {
14111 if (value === void 0) {
14112 return this.remove(key);
14114 this.storage.write(this._namespacePrefix + key, this._serialize(value));
14117 // remove deletes the key and value stored at the given key.
14118 remove: function(key) {
14119 this.storage.remove(this._namespacePrefix + key);
14121 // each will call the given callback once for each key-value pair
14123 each: function(callback) {
14125 this.storage.each(function(val, namespacedKey) {
14126 callback.call(self2, self2._deserialize(val), (namespacedKey || "").replace(self2._namespaceRegexp, ""));
14129 // clearAll will remove all the stored key-value pairs in this store.
14130 clearAll: function() {
14131 this.storage.clearAll();
14133 // additional functionality that can't live in plugins
14134 // ---------------------------------------------------
14135 // hasNamespace returns true if this store instance has the given namespace.
14136 hasNamespace: function(namespace) {
14137 return this._namespacePrefix == "__storejs_" + namespace + "_";
14139 // createStore creates a store.js instance with the first
14140 // functioning storage in the list of storage candidates,
14141 // and applies the the given mixins to the instance.
14142 createStore: function() {
14143 return createStore.apply(this, arguments);
14145 addPlugin: function(plugin) {
14146 this._addPlugin(plugin);
14148 namespace: function(namespace) {
14149 return createStore(this.storage, this.plugins, namespace);
14153 var _console = typeof console == "undefined" ? null : console;
14157 var fn = _console.warn ? _console.warn : _console.log;
14158 fn.apply(_console, arguments);
14160 function createStore(storages, plugins, namespace) {
14164 if (storages && !isList(storages)) {
14165 storages = [storages];
14167 if (plugins && !isList(plugins)) {
14168 plugins = [plugins];
14170 var namespacePrefix = namespace ? "__storejs_" + namespace + "_" : "";
14171 var namespaceRegexp = namespace ? new RegExp("^" + namespacePrefix) : null;
14172 var legalNamespaces = /^[a-zA-Z0-9_\-]*$/;
14173 if (!legalNamespaces.test(namespace)) {
14174 throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");
14176 var _privateStoreProps = {
14177 _namespacePrefix: namespacePrefix,
14178 _namespaceRegexp: namespaceRegexp,
14179 _testStorage: function(storage) {
14181 var testStr = "__storejs__test__";
14182 storage.write(testStr, testStr);
14183 var ok = storage.read(testStr) === testStr;
14184 storage.remove(testStr);
14190 _assignPluginFnProp: function(pluginFnProp, propName) {
14191 var oldFn = this[propName];
14192 this[propName] = function pluginFn() {
14193 var args = slice(arguments, 0);
14195 function super_fn() {
14199 each(arguments, function(arg, i3) {
14202 return oldFn.apply(self2, args);
14204 var newFnArgs = [super_fn].concat(args);
14205 return pluginFnProp.apply(self2, newFnArgs);
14208 _serialize: function(obj) {
14209 return JSON.stringify(obj);
14211 _deserialize: function(strVal, defaultVal) {
14217 val = JSON.parse(strVal);
14221 return val !== void 0 ? val : defaultVal;
14223 _addStorage: function(storage) {
14224 if (this.enabled) {
14227 if (this._testStorage(storage)) {
14228 this.storage = storage;
14229 this.enabled = true;
14232 _addPlugin: function(plugin) {
14234 if (isList(plugin)) {
14235 each(plugin, function(plugin2) {
14236 self2._addPlugin(plugin2);
14240 var seenPlugin = pluck(this.plugins, function(seenPlugin2) {
14241 return plugin === seenPlugin2;
14246 this.plugins.push(plugin);
14247 if (!isFunction2(plugin)) {
14248 throw new Error("Plugins must be function values that return objects");
14250 var pluginProperties = plugin.call(this);
14251 if (!isObject3(pluginProperties)) {
14252 throw new Error("Plugins must return an object of function properties");
14254 each(pluginProperties, function(pluginFnProp, propName) {
14255 if (!isFunction2(pluginFnProp)) {
14256 throw new Error("Bad plugin property: " + propName + " from plugin " + plugin.name + ". Plugins should only return functions.");
14258 self2._assignPluginFnProp(pluginFnProp, propName);
14261 // Put deprecated properties in the private API, so as to not expose it to accidential
14262 // discovery through inspection of the store object.
14263 // Deprecated: addStorage
14264 addStorage: function(storage) {
14265 _warn("store.addStorage(storage) is deprecated. Use createStore([storages])");
14266 this._addStorage(storage);
14269 var store2 = create2(_privateStoreProps, storeAPI, {
14273 each(store2, function(prop, propName) {
14274 if (isFunction2(prop)) {
14275 store2.raw[propName] = bind(store2, prop);
14278 each(storages, function(storage) {
14279 store2._addStorage(storage);
14281 each(plugins, function(plugin) {
14282 store2._addPlugin(plugin);
14289 // node_modules/store/storages/localStorage.js
14290 var require_localStorage = __commonJS({
14291 "node_modules/store/storages/localStorage.js"(exports2, module2) {
14292 var util = require_util();
14293 var Global = util.Global;
14294 module2.exports = {
14295 name: "localStorage",
14302 function localStorage2() {
14303 return Global.localStorage;
14305 function read(key) {
14306 return localStorage2().getItem(key);
14308 function write(key, data) {
14309 return localStorage2().setItem(key, data);
14311 function each(fn) {
14312 for (var i3 = localStorage2().length - 1; i3 >= 0; i3--) {
14313 var key = localStorage2().key(i3);
14314 fn(read(key), key);
14317 function remove2(key) {
14318 return localStorage2().removeItem(key);
14320 function clearAll() {
14321 return localStorage2().clear();
14326 // node_modules/store/storages/oldFF-globalStorage.js
14327 var require_oldFF_globalStorage = __commonJS({
14328 "node_modules/store/storages/oldFF-globalStorage.js"(exports2, module2) {
14329 var util = require_util();
14330 var Global = util.Global;
14331 module2.exports = {
14332 name: "oldFF-globalStorage",
14339 var globalStorage = Global.globalStorage;
14340 function read(key) {
14341 return globalStorage[key];
14343 function write(key, data) {
14344 globalStorage[key] = data;
14346 function each(fn) {
14347 for (var i3 = globalStorage.length - 1; i3 >= 0; i3--) {
14348 var key = globalStorage.key(i3);
14349 fn(globalStorage[key], key);
14352 function remove2(key) {
14353 return globalStorage.removeItem(key);
14355 function clearAll() {
14356 each(function(key, _2) {
14357 delete globalStorage[key];
14363 // node_modules/store/storages/oldIE-userDataStorage.js
14364 var require_oldIE_userDataStorage = __commonJS({
14365 "node_modules/store/storages/oldIE-userDataStorage.js"(exports2, module2) {
14366 var util = require_util();
14367 var Global = util.Global;
14368 module2.exports = {
14369 name: "oldIE-userDataStorage",
14376 var storageName = "storejs";
14377 var doc = Global.document;
14378 var _withStorageEl = _makeIEStorageElFunction();
14379 var disable = (Global.navigator ? Global.navigator.userAgent : "").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);
14380 function write(unfixedKey, data) {
14384 var fixedKey = fixKey(unfixedKey);
14385 _withStorageEl(function(storageEl) {
14386 storageEl.setAttribute(fixedKey, data);
14387 storageEl.save(storageName);
14390 function read(unfixedKey) {
14394 var fixedKey = fixKey(unfixedKey);
14396 _withStorageEl(function(storageEl) {
14397 res = storageEl.getAttribute(fixedKey);
14401 function each(callback) {
14402 _withStorageEl(function(storageEl) {
14403 var attributes = storageEl.XMLDocument.documentElement.attributes;
14404 for (var i3 = attributes.length - 1; i3 >= 0; i3--) {
14405 var attr = attributes[i3];
14406 callback(storageEl.getAttribute(attr.name), attr.name);
14410 function remove2(unfixedKey) {
14411 var fixedKey = fixKey(unfixedKey);
14412 _withStorageEl(function(storageEl) {
14413 storageEl.removeAttribute(fixedKey);
14414 storageEl.save(storageName);
14417 function clearAll() {
14418 _withStorageEl(function(storageEl) {
14419 var attributes = storageEl.XMLDocument.documentElement.attributes;
14420 storageEl.load(storageName);
14421 for (var i3 = attributes.length - 1; i3 >= 0; i3--) {
14422 storageEl.removeAttribute(attributes[i3].name);
14424 storageEl.save(storageName);
14427 var forbiddenCharsRegex = new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g");
14428 function fixKey(key) {
14429 return key.replace(/^\d/, "___$&").replace(forbiddenCharsRegex, "___");
14431 function _makeIEStorageElFunction() {
14432 if (!doc || !doc.documentElement || !doc.documentElement.addBehavior) {
14435 var scriptTag = "script", storageOwner, storageContainer, storageEl;
14437 storageContainer = new ActiveXObject("htmlfile");
14438 storageContainer.open();
14439 storageContainer.write("<" + scriptTag + ">document.w=window</" + scriptTag + '><iframe src="/favicon.ico"></iframe>');
14440 storageContainer.close();
14441 storageOwner = storageContainer.w.frames[0].document;
14442 storageEl = storageOwner.createElement("div");
14444 storageEl = doc.createElement("div");
14445 storageOwner = doc.body;
14447 return function(storeFunction) {
14448 var args = [].slice.call(arguments, 0);
14449 args.unshift(storageEl);
14450 storageOwner.appendChild(storageEl);
14451 storageEl.addBehavior("#default#userData");
14452 storageEl.load(storageName);
14453 storeFunction.apply(this, args);
14454 storageOwner.removeChild(storageEl);
14461 // node_modules/store/storages/cookieStorage.js
14462 var require_cookieStorage = __commonJS({
14463 "node_modules/store/storages/cookieStorage.js"(exports2, module2) {
14464 var util = require_util();
14465 var Global = util.Global;
14466 var trim = util.trim;
14467 module2.exports = {
14468 name: "cookieStorage",
14475 var doc = Global.document;
14476 function read(key) {
14477 if (!key || !_has(key)) {
14480 var regexpStr = "(?:^|.*;\\s*)" + escape(key).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";
14481 return unescape(doc.cookie.replace(new RegExp(regexpStr), "$1"));
14483 function each(callback) {
14484 var cookies = doc.cookie.split(/; ?/g);
14485 for (var i3 = cookies.length - 1; i3 >= 0; i3--) {
14486 if (!trim(cookies[i3])) {
14489 var kvp = cookies[i3].split("=");
14490 var key = unescape(kvp[0]);
14491 var val = unescape(kvp[1]);
14492 callback(val, key);
14495 function write(key, data) {
14499 doc.cookie = escape(key) + "=" + escape(data) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/";
14501 function remove2(key) {
14502 if (!key || !_has(key)) {
14505 doc.cookie = escape(key) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
14507 function clearAll() {
14508 each(function(_2, key) {
14512 function _has(key) {
14513 return new RegExp("(?:^|;\\s*)" + escape(key).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=").test(doc.cookie);
14518 // node_modules/store/storages/sessionStorage.js
14519 var require_sessionStorage = __commonJS({
14520 "node_modules/store/storages/sessionStorage.js"(exports2, module2) {
14521 var util = require_util();
14522 var Global = util.Global;
14523 module2.exports = {
14524 name: "sessionStorage",
14531 function sessionStorage() {
14532 return Global.sessionStorage;
14534 function read(key) {
14535 return sessionStorage().getItem(key);
14537 function write(key, data) {
14538 return sessionStorage().setItem(key, data);
14540 function each(fn) {
14541 for (var i3 = sessionStorage().length - 1; i3 >= 0; i3--) {
14542 var key = sessionStorage().key(i3);
14543 fn(read(key), key);
14546 function remove2(key) {
14547 return sessionStorage().removeItem(key);
14549 function clearAll() {
14550 return sessionStorage().clear();
14555 // node_modules/store/storages/memoryStorage.js
14556 var require_memoryStorage = __commonJS({
14557 "node_modules/store/storages/memoryStorage.js"(exports2, module2) {
14558 module2.exports = {
14559 name: "memoryStorage",
14566 var memoryStorage = {};
14567 function read(key) {
14568 return memoryStorage[key];
14570 function write(key, data) {
14571 memoryStorage[key] = data;
14573 function each(callback) {
14574 for (var key in memoryStorage) {
14575 if (memoryStorage.hasOwnProperty(key)) {
14576 callback(memoryStorage[key], key);
14580 function remove2(key) {
14581 delete memoryStorage[key];
14583 function clearAll(key) {
14584 memoryStorage = {};
14589 // node_modules/store/storages/all.js
14590 var require_all = __commonJS({
14591 "node_modules/store/storages/all.js"(exports2, module2) {
14592 module2.exports = [
14593 // Listed in order of usage preference
14594 require_localStorage(),
14595 require_oldFF_globalStorage(),
14596 require_oldIE_userDataStorage(),
14597 require_cookieStorage(),
14598 require_sessionStorage(),
14599 require_memoryStorage()
14604 // node_modules/store/plugins/lib/json2.js
14605 var require_json2 = __commonJS({
14606 "node_modules/store/plugins/lib/json2.js"(exports, module) {
14607 if (typeof JSON !== "object") {
14612 var rx_one = /^[\],:{}\s]*$/;
14613 var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
14614 var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
14615 var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
14616 var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
14617 var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
14619 return n3 < 10 ? "0" + n3 : n3;
14621 function this_value() {
14622 return this.valueOf();
14624 if (typeof Date.prototype.toJSON !== "function") {
14625 Date.prototype.toJSON = function() {
14626 return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null;
14628 Boolean.prototype.toJSON = this_value;
14629 Number.prototype.toJSON = this_value;
14630 String.prototype.toJSON = this_value;
14636 function quote(string) {
14637 rx_escapable.lastIndex = 0;
14638 return rx_escapable.test(string) ? '"' + string.replace(rx_escapable, function(a2) {
14640 return typeof c2 === "string" ? c2 : "\\u" + ("0000" + a2.charCodeAt(0).toString(16)).slice(-4);
14641 }) + '"' : '"' + string + '"';
14643 function str(key, holder) {
14650 var value = holder[key];
14651 if (value && typeof value === "object" && typeof value.toJSON === "function") {
14652 value = value.toJSON(key);
14654 if (typeof rep === "function") {
14655 value = rep.call(holder, key, value);
14657 switch (typeof value) {
14659 return quote(value);
14661 return isFinite(value) ? String(value) : "null";
14664 return String(value);
14671 if (Object.prototype.toString.apply(value) === "[object Array]") {
14672 length = value.length;
14673 for (i3 = 0; i3 < length; i3 += 1) {
14674 partial[i3] = str(i3, value) || "null";
14676 v2 = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]";
14680 if (rep && typeof rep === "object") {
14681 length = rep.length;
14682 for (i3 = 0; i3 < length; i3 += 1) {
14683 if (typeof rep[i3] === "string") {
14685 v2 = str(k2, value);
14687 partial.push(quote(k2) + (gap ? ": " : ":") + v2);
14692 for (k2 in value) {
14693 if (Object.prototype.hasOwnProperty.call(value, k2)) {
14694 v2 = str(k2, value);
14696 partial.push(quote(k2) + (gap ? ": " : ":") + v2);
14701 v2 = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}";
14706 if (typeof JSON.stringify !== "function") {
14708 // table of character substitutions
14717 JSON.stringify = function(value, replacer, space) {
14721 if (typeof space === "number") {
14722 for (i3 = 0; i3 < space; i3 += 1) {
14725 } else if (typeof space === "string") {
14729 if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
14730 throw new Error("JSON.stringify");
14732 return str("", { "": value });
14735 if (typeof JSON.parse !== "function") {
14736 JSON.parse = function(text, reviver) {
14738 function walk(holder, key) {
14741 var value = holder[key];
14742 if (value && typeof value === "object") {
14743 for (k2 in value) {
14744 if (Object.prototype.hasOwnProperty.call(value, k2)) {
14745 v2 = walk(value, k2);
14746 if (v2 !== void 0) {
14754 return reviver.call(holder, key, value);
14756 text = String(text);
14757 rx_dangerous.lastIndex = 0;
14758 if (rx_dangerous.test(text)) {
14759 text = text.replace(rx_dangerous, function(a2) {
14760 return "\\u" + ("0000" + a2.charCodeAt(0).toString(16)).slice(-4);
14764 text.replace(rx_two, "@").replace(rx_three, "]").replace(rx_four, "")
14766 j = eval("(" + text + ")");
14767 return typeof reviver === "function" ? walk({ "": j }, "") : j;
14769 throw new SyntaxError("JSON.parse");
14776 // node_modules/store/plugins/json2.js
14777 var require_json22 = __commonJS({
14778 "node_modules/store/plugins/json2.js"(exports2, module2) {
14779 module2.exports = json2Plugin;
14780 function json2Plugin() {
14787 // node_modules/store/dist/store.legacy.js
14788 var require_store_legacy = __commonJS({
14789 "node_modules/store/dist/store.legacy.js"(exports2, module2) {
14790 var engine = require_store_engine();
14791 var storages = require_all();
14792 var plugins = [require_json22()];
14793 module2.exports = engine.createStore(storages, plugins);
14797 // node_modules/whatwg-fetch/fetch.js
14798 var g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || // eslint-disable-next-line no-undef
14799 typeof global !== "undefined" && global || {};
14801 searchParams: "URLSearchParams" in g,
14802 iterable: "Symbol" in g && "iterator" in Symbol,
14803 blob: "FileReader" in g && "Blob" in g && function() {
14811 formData: "FormData" in g,
14812 arrayBuffer: "ArrayBuffer" in g
14814 function isDataView(obj) {
14815 return obj && DataView.prototype.isPrototypeOf(obj);
14817 if (support.arrayBuffer) {
14819 "[object Int8Array]",
14820 "[object Uint8Array]",
14821 "[object Uint8ClampedArray]",
14822 "[object Int16Array]",
14823 "[object Uint16Array]",
14824 "[object Int32Array]",
14825 "[object Uint32Array]",
14826 "[object Float32Array]",
14827 "[object Float64Array]"
14829 isArrayBufferView = ArrayBuffer.isView || function(obj) {
14830 return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
14834 var isArrayBufferView;
14835 function normalizeName(name) {
14836 if (typeof name !== "string") {
14837 name = String(name);
14839 if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") {
14840 throw new TypeError('Invalid character in header field name: "' + name + '"');
14842 return name.toLowerCase();
14844 function normalizeValue(value) {
14845 if (typeof value !== "string") {
14846 value = String(value);
14850 function iteratorFor(items) {
14853 var value = items.shift();
14854 return { done: value === void 0, value };
14857 if (support.iterable) {
14858 iterator[Symbol.iterator] = function() {
14864 function Headers(headers) {
14866 if (headers instanceof Headers) {
14867 headers.forEach(function(value, name) {
14868 this.append(name, value);
14870 } else if (Array.isArray(headers)) {
14871 headers.forEach(function(header) {
14872 if (header.length != 2) {
14873 throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + header.length);
14875 this.append(header[0], header[1]);
14877 } else if (headers) {
14878 Object.getOwnPropertyNames(headers).forEach(function(name) {
14879 this.append(name, headers[name]);
14883 Headers.prototype.append = function(name, value) {
14884 name = normalizeName(name);
14885 value = normalizeValue(value);
14886 var oldValue = this.map[name];
14887 this.map[name] = oldValue ? oldValue + ", " + value : value;
14889 Headers.prototype["delete"] = function(name) {
14890 delete this.map[normalizeName(name)];
14892 Headers.prototype.get = function(name) {
14893 name = normalizeName(name);
14894 return this.has(name) ? this.map[name] : null;
14896 Headers.prototype.has = function(name) {
14897 return this.map.hasOwnProperty(normalizeName(name));
14899 Headers.prototype.set = function(name, value) {
14900 this.map[normalizeName(name)] = normalizeValue(value);
14902 Headers.prototype.forEach = function(callback, thisArg) {
14903 for (var name in this.map) {
14904 if (this.map.hasOwnProperty(name)) {
14905 callback.call(thisArg, this.map[name], name, this);
14909 Headers.prototype.keys = function() {
14911 this.forEach(function(value, name) {
14914 return iteratorFor(items);
14916 Headers.prototype.values = function() {
14918 this.forEach(function(value) {
14921 return iteratorFor(items);
14923 Headers.prototype.entries = function() {
14925 this.forEach(function(value, name) {
14926 items.push([name, value]);
14928 return iteratorFor(items);
14930 if (support.iterable) {
14931 Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
14933 function consumed(body) {
14936 if (body.bodyUsed) {
14937 return Promise.reject(new TypeError("Already read"));
14939 body.bodyUsed = true;
14941 function fileReaderReady(reader) {
14942 return new Promise(function(resolve, reject) {
14943 reader.onload = function() {
14944 resolve(reader.result);
14946 reader.onerror = function() {
14947 reject(reader.error);
14951 function readBlobAsArrayBuffer(blob) {
14952 var reader = new FileReader();
14953 var promise = fileReaderReady(reader);
14954 reader.readAsArrayBuffer(blob);
14957 function readBlobAsText(blob) {
14958 var reader = new FileReader();
14959 var promise = fileReaderReady(reader);
14960 var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
14961 var encoding = match ? match[1] : "utf-8";
14962 reader.readAsText(blob, encoding);
14965 function readArrayBufferAsText(buf) {
14966 var view = new Uint8Array(buf);
14967 var chars = new Array(view.length);
14968 for (var i3 = 0; i3 < view.length; i3++) {
14969 chars[i3] = String.fromCharCode(view[i3]);
14971 return chars.join("");
14973 function bufferClone(buf) {
14975 return buf.slice(0);
14977 var view = new Uint8Array(buf.byteLength);
14978 view.set(new Uint8Array(buf));
14979 return view.buffer;
14983 this.bodyUsed = false;
14984 this._initBody = function(body) {
14985 this.bodyUsed = this.bodyUsed;
14986 this._bodyInit = body;
14988 this._noBody = true;
14989 this._bodyText = "";
14990 } else if (typeof body === "string") {
14991 this._bodyText = body;
14992 } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
14993 this._bodyBlob = body;
14994 } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
14995 this._bodyFormData = body;
14996 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
14997 this._bodyText = body.toString();
14998 } else if (support.arrayBuffer && support.blob && isDataView(body)) {
14999 this._bodyArrayBuffer = bufferClone(body.buffer);
15000 this._bodyInit = new Blob([this._bodyArrayBuffer]);
15001 } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
15002 this._bodyArrayBuffer = bufferClone(body);
15004 this._bodyText = body = Object.prototype.toString.call(body);
15006 if (!this.headers.get("content-type")) {
15007 if (typeof body === "string") {
15008 this.headers.set("content-type", "text/plain;charset=UTF-8");
15009 } else if (this._bodyBlob && this._bodyBlob.type) {
15010 this.headers.set("content-type", this._bodyBlob.type);
15011 } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
15012 this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
15016 if (support.blob) {
15017 this.blob = function() {
15018 var rejected = consumed(this);
15022 if (this._bodyBlob) {
15023 return Promise.resolve(this._bodyBlob);
15024 } else if (this._bodyArrayBuffer) {
15025 return Promise.resolve(new Blob([this._bodyArrayBuffer]));
15026 } else if (this._bodyFormData) {
15027 throw new Error("could not read FormData body as blob");
15029 return Promise.resolve(new Blob([this._bodyText]));
15033 this.arrayBuffer = function() {
15034 if (this._bodyArrayBuffer) {
15035 var isConsumed = consumed(this);
15038 } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
15039 return Promise.resolve(
15040 this._bodyArrayBuffer.buffer.slice(
15041 this._bodyArrayBuffer.byteOffset,
15042 this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
15046 return Promise.resolve(this._bodyArrayBuffer);
15048 } else if (support.blob) {
15049 return this.blob().then(readBlobAsArrayBuffer);
15051 throw new Error("could not read as ArrayBuffer");
15054 this.text = function() {
15055 var rejected = consumed(this);
15059 if (this._bodyBlob) {
15060 return readBlobAsText(this._bodyBlob);
15061 } else if (this._bodyArrayBuffer) {
15062 return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
15063 } else if (this._bodyFormData) {
15064 throw new Error("could not read FormData body as text");
15066 return Promise.resolve(this._bodyText);
15069 if (support.formData) {
15070 this.formData = function() {
15071 return this.text().then(decode);
15074 this.json = function() {
15075 return this.text().then(JSON.parse);
15079 var methods = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
15080 function normalizeMethod(method) {
15081 var upcased = method.toUpperCase();
15082 return methods.indexOf(upcased) > -1 ? upcased : method;
15084 function Request(input, options2) {
15085 if (!(this instanceof Request)) {
15086 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
15088 options2 = options2 || {};
15089 var body = options2.body;
15090 if (input instanceof Request) {
15091 if (input.bodyUsed) {
15092 throw new TypeError("Already read");
15094 this.url = input.url;
15095 this.credentials = input.credentials;
15096 if (!options2.headers) {
15097 this.headers = new Headers(input.headers);
15099 this.method = input.method;
15100 this.mode = input.mode;
15101 this.signal = input.signal;
15102 if (!body && input._bodyInit != null) {
15103 body = input._bodyInit;
15104 input.bodyUsed = true;
15107 this.url = String(input);
15109 this.credentials = options2.credentials || this.credentials || "same-origin";
15110 if (options2.headers || !this.headers) {
15111 this.headers = new Headers(options2.headers);
15113 this.method = normalizeMethod(options2.method || this.method || "GET");
15114 this.mode = options2.mode || this.mode || null;
15115 this.signal = options2.signal || this.signal || function() {
15116 if ("AbortController" in g) {
15117 var ctrl = new AbortController();
15118 return ctrl.signal;
15121 this.referrer = null;
15122 if ((this.method === "GET" || this.method === "HEAD") && body) {
15123 throw new TypeError("Body not allowed for GET or HEAD requests");
15125 this._initBody(body);
15126 if (this.method === "GET" || this.method === "HEAD") {
15127 if (options2.cache === "no-store" || options2.cache === "no-cache") {
15128 var reParamSearch = /([?&])_=[^&]*/;
15129 if (reParamSearch.test(this.url)) {
15130 this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
15132 var reQueryString = /\?/;
15133 this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
15138 Request.prototype.clone = function() {
15139 return new Request(this, { body: this._bodyInit });
15141 function decode(body) {
15142 var form = new FormData();
15143 body.trim().split("&").forEach(function(bytes) {
15145 var split = bytes.split("=");
15146 var name = split.shift().replace(/\+/g, " ");
15147 var value = split.join("=").replace(/\+/g, " ");
15148 form.append(decodeURIComponent(name), decodeURIComponent(value));
15153 function parseHeaders(rawHeaders) {
15154 var headers = new Headers();
15155 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
15156 preProcessedHeaders.split("\r").map(function(header) {
15157 return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
15158 }).forEach(function(line) {
15159 var parts = line.split(":");
15160 var key = parts.shift().trim();
15162 var value = parts.join(":").trim();
15164 headers.append(key, value);
15166 console.warn("Response " + error.message);
15172 Body.call(Request.prototype);
15173 function Response(bodyInit, options2) {
15174 if (!(this instanceof Response)) {
15175 throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
15180 this.type = "default";
15181 this.status = options2.status === void 0 ? 200 : options2.status;
15182 if (this.status < 200 || this.status > 599) {
15183 throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
15185 this.ok = this.status >= 200 && this.status < 300;
15186 this.statusText = options2.statusText === void 0 ? "" : "" + options2.statusText;
15187 this.headers = new Headers(options2.headers);
15188 this.url = options2.url || "";
15189 this._initBody(bodyInit);
15191 Body.call(Response.prototype);
15192 Response.prototype.clone = function() {
15193 return new Response(this._bodyInit, {
15194 status: this.status,
15195 statusText: this.statusText,
15196 headers: new Headers(this.headers),
15200 Response.error = function() {
15201 var response = new Response(null, { status: 200, statusText: "" });
15202 response.status = 0;
15203 response.type = "error";
15206 var redirectStatuses = [301, 302, 303, 307, 308];
15207 Response.redirect = function(url, status) {
15208 if (redirectStatuses.indexOf(status) === -1) {
15209 throw new RangeError("Invalid status code");
15211 return new Response(null, { status, headers: { location: url } });
15213 var DOMException2 = g.DOMException;
15215 new DOMException2();
15217 DOMException2 = function(message, name) {
15218 this.message = message;
15220 var error = Error(message);
15221 this.stack = error.stack;
15223 DOMException2.prototype = Object.create(Error.prototype);
15224 DOMException2.prototype.constructor = DOMException2;
15226 function fetch2(input, init2) {
15227 return new Promise(function(resolve, reject) {
15228 var request3 = new Request(input, init2);
15229 if (request3.signal && request3.signal.aborted) {
15230 return reject(new DOMException2("Aborted", "AbortError"));
15232 var xhr = new XMLHttpRequest();
15233 function abortXhr() {
15236 xhr.onload = function() {
15238 status: xhr.status,
15239 statusText: xhr.statusText,
15240 headers: parseHeaders(xhr.getAllResponseHeaders() || "")
15242 options2.url = "responseURL" in xhr ? xhr.responseURL : options2.headers.get("X-Request-URL");
15243 var body = "response" in xhr ? xhr.response : xhr.responseText;
15244 setTimeout(function() {
15245 resolve(new Response(body, options2));
15248 xhr.onerror = function() {
15249 setTimeout(function() {
15250 reject(new TypeError("Network request failed"));
15253 xhr.ontimeout = function() {
15254 setTimeout(function() {
15255 reject(new TypeError("Network request failed"));
15258 xhr.onabort = function() {
15259 setTimeout(function() {
15260 reject(new DOMException2("Aborted", "AbortError"));
15263 function fixUrl(url) {
15265 return url === "" && g.location.href ? g.location.href : url;
15270 xhr.open(request3.method, fixUrl(request3.url), true);
15271 if (request3.credentials === "include") {
15272 xhr.withCredentials = true;
15273 } else if (request3.credentials === "omit") {
15274 xhr.withCredentials = false;
15276 if ("responseType" in xhr) {
15277 if (support.blob) {
15278 xhr.responseType = "blob";
15279 } else if (support.arrayBuffer) {
15280 xhr.responseType = "arraybuffer";
15283 if (init2 && typeof init2.headers === "object" && !(init2.headers instanceof Headers || g.Headers && init2.headers instanceof g.Headers)) {
15285 Object.getOwnPropertyNames(init2.headers).forEach(function(name) {
15286 names.push(normalizeName(name));
15287 xhr.setRequestHeader(name, normalizeValue(init2.headers[name]));
15289 request3.headers.forEach(function(value, name) {
15290 if (names.indexOf(name) === -1) {
15291 xhr.setRequestHeader(name, value);
15295 request3.headers.forEach(function(value, name) {
15296 xhr.setRequestHeader(name, value);
15299 if (request3.signal) {
15300 request3.signal.addEventListener("abort", abortXhr);
15301 xhr.onreadystatechange = function() {
15302 if (xhr.readyState === 4) {
15303 request3.signal.removeEventListener("abort", abortXhr);
15307 xhr.send(typeof request3._bodyInit === "undefined" ? null : request3._bodyInit);
15310 fetch2.polyfill = true;
15313 g.Headers = Headers;
15314 g.Request = Request;
15315 g.Response = Response;
15318 // node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js
15319 (function(factory) {
15320 typeof define === "function" && define.amd ? define(factory) : factory();
15323 function _classCallCheck(instance, Constructor) {
15324 if (!(instance instanceof Constructor)) {
15325 throw new TypeError("Cannot call a class as a function");
15328 function _defineProperties(target, props) {
15329 for (var i3 = 0; i3 < props.length; i3++) {
15330 var descriptor = props[i3];
15331 descriptor.enumerable = descriptor.enumerable || false;
15332 descriptor.configurable = true;
15333 if ("value" in descriptor)
15334 descriptor.writable = true;
15335 Object.defineProperty(target, descriptor.key, descriptor);
15338 function _createClass(Constructor, protoProps, staticProps) {
15340 _defineProperties(Constructor.prototype, protoProps);
15342 _defineProperties(Constructor, staticProps);
15343 Object.defineProperty(Constructor, "prototype", {
15346 return Constructor;
15348 function _inherits(subClass, superClass) {
15349 if (typeof superClass !== "function" && superClass !== null) {
15350 throw new TypeError("Super expression must either be null or a function");
15352 subClass.prototype = Object.create(superClass && superClass.prototype, {
15359 Object.defineProperty(subClass, "prototype", {
15363 _setPrototypeOf(subClass, superClass);
15365 function _getPrototypeOf(o2) {
15366 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o3) {
15367 return o3.__proto__ || Object.getPrototypeOf(o3);
15369 return _getPrototypeOf(o2);
15371 function _setPrototypeOf(o2, p2) {
15372 _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p3) {
15376 return _setPrototypeOf(o2, p2);
15378 function _isNativeReflectConstruct() {
15379 if (typeof Reflect === "undefined" || !Reflect.construct)
15381 if (Reflect.construct.sham)
15383 if (typeof Proxy === "function")
15386 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
15393 function _assertThisInitialized(self2) {
15394 if (self2 === void 0) {
15395 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
15399 function _possibleConstructorReturn(self2, call) {
15400 if (call && (typeof call === "object" || typeof call === "function")) {
15402 } else if (call !== void 0) {
15403 throw new TypeError("Derived constructors may only return object or undefined");
15405 return _assertThisInitialized(self2);
15407 function _createSuper(Derived) {
15408 var hasNativeReflectConstruct = _isNativeReflectConstruct();
15409 return function _createSuperInternal() {
15410 var Super = _getPrototypeOf(Derived), result;
15411 if (hasNativeReflectConstruct) {
15412 var NewTarget = _getPrototypeOf(this).constructor;
15413 result = Reflect.construct(Super, arguments, NewTarget);
15415 result = Super.apply(this, arguments);
15417 return _possibleConstructorReturn(this, result);
15420 function _superPropBase(object, property) {
15421 while (!Object.prototype.hasOwnProperty.call(object, property)) {
15422 object = _getPrototypeOf(object);
15423 if (object === null)
15429 if (typeof Reflect !== "undefined" && Reflect.get) {
15430 _get = Reflect.get.bind();
15432 _get = function _get2(target, property, receiver) {
15433 var base = _superPropBase(target, property);
15436 var desc = Object.getOwnPropertyDescriptor(base, property);
15438 return desc.get.call(arguments.length < 3 ? target : receiver);
15443 return _get.apply(this, arguments);
15445 var Emitter = /* @__PURE__ */ function() {
15446 function Emitter2() {
15447 _classCallCheck(this, Emitter2);
15448 Object.defineProperty(this, "listeners", {
15454 _createClass(Emitter2, [{
15455 key: "addEventListener",
15456 value: function addEventListener(type2, callback, options2) {
15457 if (!(type2 in this.listeners)) {
15458 this.listeners[type2] = [];
15460 this.listeners[type2].push({
15466 key: "removeEventListener",
15467 value: function removeEventListener(type2, callback) {
15468 if (!(type2 in this.listeners)) {
15471 var stack = this.listeners[type2];
15472 for (var i3 = 0, l2 = stack.length; i3 < l2; i3++) {
15473 if (stack[i3].callback === callback) {
15474 stack.splice(i3, 1);
15480 key: "dispatchEvent",
15481 value: function dispatchEvent2(event) {
15482 if (!(event.type in this.listeners)) {
15485 var stack = this.listeners[event.type];
15486 var stackToCall = stack.slice();
15487 for (var i3 = 0, l2 = stackToCall.length; i3 < l2; i3++) {
15488 var listener = stackToCall[i3];
15490 listener.callback.call(this, event);
15492 Promise.resolve().then(function() {
15496 if (listener.options && listener.options.once) {
15497 this.removeEventListener(event.type, listener.callback);
15500 return !event.defaultPrevented;
15505 var AbortSignal = /* @__PURE__ */ function(_Emitter) {
15506 _inherits(AbortSignal2, _Emitter);
15507 var _super = _createSuper(AbortSignal2);
15508 function AbortSignal2() {
15510 _classCallCheck(this, AbortSignal2);
15511 _this = _super.call(this);
15512 if (!_this.listeners) {
15513 Emitter.call(_assertThisInitialized(_this));
15515 Object.defineProperty(_assertThisInitialized(_this), "aborted", {
15520 Object.defineProperty(_assertThisInitialized(_this), "onabort", {
15525 Object.defineProperty(_assertThisInitialized(_this), "reason", {
15532 _createClass(AbortSignal2, [{
15534 value: function toString2() {
15535 return "[object AbortSignal]";
15538 key: "dispatchEvent",
15539 value: function dispatchEvent2(event) {
15540 if (event.type === "abort") {
15541 this.aborted = true;
15542 if (typeof this.onabort === "function") {
15543 this.onabort.call(this, event);
15546 _get(_getPrototypeOf(AbortSignal2.prototype), "dispatchEvent", this).call(this, event);
15549 return AbortSignal2;
15551 var AbortController2 = /* @__PURE__ */ function() {
15552 function AbortController3() {
15553 _classCallCheck(this, AbortController3);
15554 Object.defineProperty(this, "signal", {
15555 value: new AbortSignal(),
15560 _createClass(AbortController3, [{
15562 value: function abort(reason) {
15565 event = new Event("abort");
15567 if (typeof document !== "undefined") {
15568 if (!document.createEvent) {
15569 event = document.createEventObject();
15570 event.type = "abort";
15572 event = document.createEvent("Event");
15573 event.initEvent("abort", false, false);
15583 var signalReason = reason;
15584 if (signalReason === void 0) {
15585 if (typeof document === "undefined") {
15586 signalReason = new Error("This operation was aborted");
15587 signalReason.name = "AbortError";
15590 signalReason = new DOMException("signal is aborted without reason");
15592 signalReason = new Error("This operation was aborted");
15593 signalReason.name = "AbortError";
15597 this.signal.reason = signalReason;
15598 this.signal.dispatchEvent(event);
15602 value: function toString2() {
15603 return "[object AbortController]";
15606 return AbortController3;
15608 if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
15609 AbortController2.prototype[Symbol.toStringTag] = "AbortController";
15610 AbortSignal.prototype[Symbol.toStringTag] = "AbortSignal";
15612 function polyfillNeeded(self2) {
15613 if (self2.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {
15614 console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill");
15617 return typeof self2.Request === "function" && !self2.Request.prototype.hasOwnProperty("signal") || !self2.AbortController;
15619 function abortableFetchDecorator(patchTargets) {
15620 if ("function" === typeof patchTargets) {
15622 fetch: patchTargets
15625 var _patchTargets = patchTargets, fetch3 = _patchTargets.fetch, _patchTargets$Request = _patchTargets.Request, NativeRequest = _patchTargets$Request === void 0 ? fetch3.Request : _patchTargets$Request, NativeAbortController = _patchTargets.AbortController, _patchTargets$__FORCE = _patchTargets.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL, __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL = _patchTargets$__FORCE === void 0 ? false : _patchTargets$__FORCE;
15626 if (!polyfillNeeded({
15628 Request: NativeRequest,
15629 AbortController: NativeAbortController,
15630 __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL
15637 var Request2 = NativeRequest;
15638 if (Request2 && !Request2.prototype.hasOwnProperty("signal") || __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {
15639 Request2 = function Request3(input, init2) {
15641 if (init2 && init2.signal) {
15642 signal = init2.signal;
15643 delete init2.signal;
15645 var request3 = new NativeRequest(input, init2);
15647 Object.defineProperty(request3, "signal", {
15650 configurable: true,
15656 Request2.prototype = NativeRequest.prototype;
15658 var realFetch = fetch3;
15659 var abortableFetch = function abortableFetch2(input, init2) {
15660 var signal = Request2 && Request2.prototype.isPrototypeOf(input) ? input.signal : init2 ? init2.signal : void 0;
15664 abortError = new DOMException("Aborted", "AbortError");
15666 abortError = new Error("Aborted");
15667 abortError.name = "AbortError";
15669 if (signal.aborted) {
15670 return Promise.reject(abortError);
15672 var cancellation = new Promise(function(_2, reject) {
15673 signal.addEventListener("abort", function() {
15674 return reject(abortError);
15679 if (init2 && init2.signal) {
15680 delete init2.signal;
15682 return Promise.race([cancellation, realFetch(input, init2)]);
15684 return realFetch(input, init2);
15687 fetch: abortableFetch,
15692 if (!polyfillNeeded(self2)) {
15695 if (!self2.fetch) {
15696 console.warn("fetch() is not available, cannot install abortcontroller-polyfill");
15699 var _abortableFetch = abortableFetchDecorator(self2), fetch3 = _abortableFetch.fetch, Request2 = _abortableFetch.Request;
15700 self2.fetch = fetch3;
15701 self2.Request = Request2;
15702 Object.defineProperty(self2, "AbortController", {
15705 configurable: true,
15706 value: AbortController2
15708 Object.defineProperty(self2, "AbortSignal", {
15711 configurable: true,
15714 })(typeof self !== "undefined" ? self : global);
15717 // modules/index.js
15718 var modules_exports = {};
15719 __export(modules_exports, {
15720 LocationManager: () => LocationManager,
15721 QAItem: () => QAItem,
15722 actionAddEntity: () => actionAddEntity,
15723 actionAddMember: () => actionAddMember,
15724 actionAddMidpoint: () => actionAddMidpoint,
15725 actionAddVertex: () => actionAddVertex,
15726 actionChangeMember: () => actionChangeMember,
15727 actionChangePreset: () => actionChangePreset,
15728 actionChangeTags: () => actionChangeTags,
15729 actionCircularize: () => actionCircularize,
15730 actionConnect: () => actionConnect,
15731 actionCopyEntities: () => actionCopyEntities,
15732 actionDeleteMember: () => actionDeleteMember,
15733 actionDeleteMultiple: () => actionDeleteMultiple,
15734 actionDeleteNode: () => actionDeleteNode,
15735 actionDeleteRelation: () => actionDeleteRelation,
15736 actionDeleteWay: () => actionDeleteWay,
15737 actionDiscardTags: () => actionDiscardTags,
15738 actionDisconnect: () => actionDisconnect,
15739 actionExtract: () => actionExtract,
15740 actionJoin: () => actionJoin,
15741 actionMerge: () => actionMerge,
15742 actionMergeNodes: () => actionMergeNodes,
15743 actionMergePolygon: () => actionMergePolygon,
15744 actionMergeRemoteChanges: () => actionMergeRemoteChanges,
15745 actionMove: () => actionMove,
15746 actionMoveMember: () => actionMoveMember,
15747 actionMoveNode: () => actionMoveNode,
15748 actionNoop: () => actionNoop,
15749 actionOrthogonalize: () => actionOrthogonalize,
15750 actionReflect: () => actionReflect,
15751 actionRestrictTurn: () => actionRestrictTurn,
15752 actionReverse: () => actionReverse,
15753 actionRevert: () => actionRevert,
15754 actionRotate: () => actionRotate,
15755 actionScale: () => actionScale,
15756 actionSplit: () => actionSplit,
15757 actionStraightenNodes: () => actionStraightenNodes,
15758 actionStraightenWay: () => actionStraightenWay,
15759 actionUnrestrictTurn: () => actionUnrestrictTurn,
15760 actionUpgradeTags: () => actionUpgradeTags,
15761 behaviorAddWay: () => behaviorAddWay,
15762 behaviorBreathe: () => behaviorBreathe,
15763 behaviorDrag: () => behaviorDrag,
15764 behaviorDraw: () => behaviorDraw,
15765 behaviorDrawWay: () => behaviorDrawWay,
15766 behaviorEdit: () => behaviorEdit,
15767 behaviorHash: () => behaviorHash,
15768 behaviorHover: () => behaviorHover,
15769 behaviorLasso: () => behaviorLasso,
15770 behaviorOperation: () => behaviorOperation,
15771 behaviorPaste: () => behaviorPaste,
15772 behaviorSelect: () => behaviorSelect,
15773 coreContext: () => coreContext,
15774 coreDifference: () => coreDifference,
15775 coreFileFetcher: () => coreFileFetcher,
15776 coreGraph: () => coreGraph,
15777 coreHistory: () => coreHistory,
15778 coreLocalizer: () => coreLocalizer,
15779 coreTree: () => coreTree,
15780 coreUploader: () => coreUploader,
15781 coreValidator: () => coreValidator,
15783 debug: () => debug,
15784 fileFetcher: () => _mainFileFetcher,
15785 geoAngle: () => geoAngle,
15786 geoChooseEdge: () => geoChooseEdge,
15787 geoEdgeEqual: () => geoEdgeEqual,
15788 geoExtent: () => geoExtent,
15789 geoGetSmallestSurroundingRectangle: () => geoGetSmallestSurroundingRectangle,
15790 geoHasLineIntersections: () => geoHasLineIntersections,
15791 geoHasSelfIntersections: () => geoHasSelfIntersections,
15792 geoLatToMeters: () => geoLatToMeters,
15793 geoLineIntersection: () => geoLineIntersection,
15794 geoLonToMeters: () => geoLonToMeters,
15795 geoMetersToLat: () => geoMetersToLat,
15796 geoMetersToLon: () => geoMetersToLon,
15797 geoMetersToOffset: () => geoMetersToOffset,
15798 geoOffsetToMeters: () => geoOffsetToMeters,
15799 geoOrthoCalcScore: () => geoOrthoCalcScore,
15800 geoOrthoCanOrthogonalize: () => geoOrthoCanOrthogonalize,
15801 geoOrthoMaxOffsetAngle: () => geoOrthoMaxOffsetAngle,
15802 geoOrthoNormalizedDotProduct: () => geoOrthoNormalizedDotProduct,
15803 geoPathHasIntersections: () => geoPathHasIntersections,
15804 geoPathIntersections: () => geoPathIntersections,
15805 geoPathLength: () => geoPathLength,
15806 geoPointInPolygon: () => geoPointInPolygon,
15807 geoPolygonContainsPolygon: () => geoPolygonContainsPolygon,
15808 geoPolygonIntersectsPolygon: () => geoPolygonIntersectsPolygon,
15809 geoRawMercator: () => geoRawMercator,
15810 geoRotate: () => geoRotate,
15811 geoScaleToZoom: () => geoScaleToZoom,
15812 geoSphericalClosestNode: () => geoSphericalClosestNode,
15813 geoSphericalDistance: () => geoSphericalDistance,
15814 geoVecAdd: () => geoVecAdd,
15815 geoVecAngle: () => geoVecAngle,
15816 geoVecCross: () => geoVecCross,
15817 geoVecDot: () => geoVecDot,
15818 geoVecEqual: () => geoVecEqual,
15819 geoVecFloor: () => geoVecFloor,
15820 geoVecInterp: () => geoVecInterp,
15821 geoVecLength: () => geoVecLength,
15822 geoVecLengthSquare: () => geoVecLengthSquare,
15823 geoVecNormalize: () => geoVecNormalize,
15824 geoVecNormalizedDot: () => geoVecNormalizedDot,
15825 geoVecProject: () => geoVecProject,
15826 geoVecScale: () => geoVecScale,
15827 geoVecSubtract: () => geoVecSubtract,
15828 geoViewportEdge: () => geoViewportEdge,
15829 geoZoomToScale: () => geoZoomToScale,
15830 likelyRawNumberFormat: () => likelyRawNumberFormat,
15831 localizer: () => _mainLocalizer,
15832 locationManager: () => _sharedLocationManager,
15833 modeAddArea: () => modeAddArea,
15834 modeAddLine: () => modeAddLine,
15835 modeAddNote: () => modeAddNote,
15836 modeAddPoint: () => modeAddPoint,
15837 modeBrowse: () => modeBrowse,
15838 modeDragNode: () => modeDragNode,
15839 modeDragNote: () => modeDragNote,
15840 modeDrawArea: () => modeDrawArea,
15841 modeDrawLine: () => modeDrawLine,
15842 modeMove: () => modeMove,
15843 modeRotate: () => modeRotate,
15844 modeSave: () => modeSave,
15845 modeSelect: () => modeSelect,
15846 modeSelectData: () => modeSelectData,
15847 modeSelectError: () => modeSelectError,
15848 modeSelectNote: () => modeSelectNote,
15849 operationCircularize: () => operationCircularize,
15850 operationContinue: () => operationContinue,
15851 operationCopy: () => operationCopy,
15852 operationDelete: () => operationDelete,
15853 operationDisconnect: () => operationDisconnect,
15854 operationDowngrade: () => operationDowngrade,
15855 operationExtract: () => operationExtract,
15856 operationMerge: () => operationMerge,
15857 operationMove: () => operationMove,
15858 operationOrthogonalize: () => operationOrthogonalize,
15859 operationPaste: () => operationPaste,
15860 operationReflectLong: () => operationReflectLong,
15861 operationReflectShort: () => operationReflectShort,
15862 operationReverse: () => operationReverse,
15863 operationRotate: () => operationRotate,
15864 operationSplit: () => operationSplit,
15865 operationStraighten: () => operationStraighten,
15866 osmAreaKeys: () => osmAreaKeys,
15867 osmChangeset: () => osmChangeset,
15868 osmEntity: () => osmEntity,
15869 osmFlowingWaterwayTagValues: () => osmFlowingWaterwayTagValues,
15870 osmInferRestriction: () => osmInferRestriction,
15871 osmIntersection: () => osmIntersection,
15872 osmIsInterestingTag: () => osmIsInterestingTag,
15873 osmIsOldMultipolygonOuterMember: () => osmIsOldMultipolygonOuterMember,
15874 osmJoinWays: () => osmJoinWays,
15875 osmLanes: () => osmLanes,
15876 osmLifecyclePrefixes: () => osmLifecyclePrefixes,
15877 osmNode: () => osmNode,
15878 osmNodeGeometriesForTags: () => osmNodeGeometriesForTags,
15879 osmNote: () => osmNote,
15880 osmOldMultipolygonOuterMember: () => osmOldMultipolygonOuterMember,
15881 osmOldMultipolygonOuterMemberOfRelation: () => osmOldMultipolygonOuterMemberOfRelation,
15882 osmOneWayTags: () => osmOneWayTags,
15883 osmPavedTags: () => osmPavedTags,
15884 osmPointTags: () => osmPointTags,
15885 osmRailwayTrackTagValues: () => osmRailwayTrackTagValues,
15886 osmRelation: () => osmRelation,
15887 osmRemoveLifecyclePrefix: () => osmRemoveLifecyclePrefix,
15888 osmRoutableHighwayTagValues: () => osmRoutableHighwayTagValues,
15889 osmSetAreaKeys: () => osmSetAreaKeys,
15890 osmSetPointTags: () => osmSetPointTags,
15891 osmSetVertexTags: () => osmSetVertexTags,
15892 osmTagSuggestingArea: () => osmTagSuggestingArea,
15893 osmTurn: () => osmTurn,
15894 osmVertexTags: () => osmVertexTags,
15895 osmWay: () => osmWay,
15896 prefs: () => corePreferences,
15897 presetCategory: () => presetCategory,
15898 presetCollection: () => presetCollection,
15899 presetField: () => presetField,
15900 presetIndex: () => presetIndex,
15901 presetManager: () => _mainPresetIndex,
15902 presetPreset: () => presetPreset,
15903 rendererBackground: () => rendererBackground,
15904 rendererBackgroundSource: () => rendererBackgroundSource,
15905 rendererFeatures: () => rendererFeatures,
15906 rendererMap: () => rendererMap,
15907 rendererPhotos: () => rendererPhotos,
15908 rendererTileLayer: () => rendererTileLayer,
15909 serviceImproveOSM: () => improveOSM_default,
15910 serviceKartaview: () => kartaview_default,
15911 serviceKeepRight: () => keepRight_default,
15912 serviceMapRules: () => maprules_default,
15913 serviceMapilio: () => mapilio_default,
15914 serviceMapillary: () => mapillary_default,
15915 serviceNominatim: () => nominatim_default,
15916 serviceNsi: () => nsi_default,
15917 serviceOsm: () => osm_default,
15918 serviceOsmWikibase: () => osm_wikibase_default,
15919 serviceOsmose: () => osmose_default,
15920 serviceStreetside: () => streetside_default,
15921 serviceTaginfo: () => taginfo_default,
15922 serviceVectorTile: () => vector_tile_default,
15923 serviceVegbilder: () => vegbilder_default,
15924 serviceWikidata: () => wikidata_default,
15925 serviceWikipedia: () => wikipedia_default,
15926 services: () => services,
15927 svgAreas: () => svgAreas,
15928 svgData: () => svgData,
15929 svgDebug: () => svgDebug,
15930 svgDefs: () => svgDefs,
15931 svgGeolocate: () => svgGeolocate,
15932 svgIcon: () => svgIcon,
15933 svgKartaviewImages: () => svgKartaviewImages,
15934 svgKeepRight: () => svgKeepRight,
15935 svgLabels: () => svgLabels,
15936 svgLayers: () => svgLayers,
15937 svgLines: () => svgLines,
15938 svgMapilioImages: () => svgMapilioImages,
15939 svgMapillaryImages: () => svgMapillaryImages,
15940 svgMapillarySigns: () => svgMapillarySigns,
15941 svgMarkerSegments: () => svgMarkerSegments,
15942 svgMidpoints: () => svgMidpoints,
15943 svgNotes: () => svgNotes,
15944 svgOsm: () => svgOsm,
15945 svgPassiveVertex: () => svgPassiveVertex,
15946 svgPath: () => svgPath,
15947 svgPointTransform: () => svgPointTransform,
15948 svgPoints: () => svgPoints,
15949 svgRelationMemberTags: () => svgRelationMemberTags,
15950 svgSegmentWay: () => svgSegmentWay,
15951 svgStreetside: () => svgStreetside,
15952 svgTagClasses: () => svgTagClasses,
15953 svgTagPattern: () => svgTagPattern,
15954 svgTouch: () => svgTouch,
15955 svgTurns: () => svgTurns,
15956 svgVegbilder: () => svgVegbilder,
15957 svgVertices: () => svgVertices,
15959 uiAccount: () => uiAccount,
15960 uiAttribution: () => uiAttribution,
15961 uiChangesetEditor: () => uiChangesetEditor,
15962 uiCmd: () => uiCmd,
15963 uiCombobox: () => uiCombobox,
15964 uiCommit: () => uiCommit,
15965 uiCommitWarnings: () => uiCommitWarnings,
15966 uiConfirm: () => uiConfirm,
15967 uiConflicts: () => uiConflicts,
15968 uiContributors: () => uiContributors,
15969 uiCurtain: () => uiCurtain,
15970 uiDataEditor: () => uiDataEditor,
15971 uiDataHeader: () => uiDataHeader,
15972 uiDisclosure: () => uiDisclosure,
15973 uiEditMenu: () => uiEditMenu,
15974 uiEntityEditor: () => uiEntityEditor,
15975 uiFeatureInfo: () => uiFeatureInfo,
15976 uiFeatureList: () => uiFeatureList,
15977 uiField: () => uiField,
15978 uiFieldAccess: () => uiFieldAccess,
15979 uiFieldAddress: () => uiFieldAddress,
15980 uiFieldCheck: () => uiFieldCheck,
15981 uiFieldColour: () => uiFieldText,
15982 uiFieldCombo: () => uiFieldCombo,
15983 uiFieldDefaultCheck: () => uiFieldCheck,
15984 uiFieldDirectionalCombo: () => uiFieldDirectionalCombo,
15985 uiFieldEmail: () => uiFieldText,
15986 uiFieldHelp: () => uiFieldHelp,
15987 uiFieldIdentifier: () => uiFieldText,
15988 uiFieldLanes: () => uiFieldLanes,
15989 uiFieldLocalized: () => uiFieldLocalized,
15990 uiFieldManyCombo: () => uiFieldCombo,
15991 uiFieldMultiCombo: () => uiFieldCombo,
15992 uiFieldNetworkCombo: () => uiFieldCombo,
15993 uiFieldNumber: () => uiFieldText,
15994 uiFieldOnewayCheck: () => uiFieldCheck,
15995 uiFieldRadio: () => uiFieldRadio,
15996 uiFieldRestrictions: () => uiFieldRestrictions,
15997 uiFieldRoadheight: () => uiFieldRoadheight,
15998 uiFieldRoadspeed: () => uiFieldRoadspeed,
15999 uiFieldSemiCombo: () => uiFieldCombo,
16000 uiFieldStructureRadio: () => uiFieldRadio,
16001 uiFieldTel: () => uiFieldText,
16002 uiFieldText: () => uiFieldText,
16003 uiFieldTextarea: () => uiFieldTextarea,
16004 uiFieldTypeCombo: () => uiFieldCombo,
16005 uiFieldUrl: () => uiFieldText,
16006 uiFieldWikidata: () => uiFieldWikidata,
16007 uiFieldWikipedia: () => uiFieldWikipedia,
16008 uiFields: () => uiFields,
16009 uiFlash: () => uiFlash,
16010 uiFormFields: () => uiFormFields,
16011 uiFullScreen: () => uiFullScreen,
16012 uiGeolocate: () => uiGeolocate,
16013 uiImproveOsmComments: () => uiImproveOsmComments,
16014 uiImproveOsmDetails: () => uiImproveOsmDetails,
16015 uiImproveOsmEditor: () => uiImproveOsmEditor,
16016 uiImproveOsmHeader: () => uiImproveOsmHeader,
16017 uiInfo: () => uiInfo,
16018 uiInfoPanels: () => uiInfoPanels,
16019 uiInit: () => uiInit,
16020 uiInspector: () => uiInspector,
16021 uiIntro: () => uiIntro,
16022 uiIssuesInfo: () => uiIssuesInfo,
16023 uiKeepRightDetails: () => uiKeepRightDetails,
16024 uiKeepRightEditor: () => uiKeepRightEditor,
16025 uiKeepRightHeader: () => uiKeepRightHeader,
16026 uiLasso: () => uiLasso,
16027 uiLengthIndicator: () => uiLengthIndicator,
16028 uiLoading: () => uiLoading,
16029 uiMapInMap: () => uiMapInMap,
16030 uiModal: () => uiModal,
16031 uiNoteComments: () => uiNoteComments,
16032 uiNoteEditor: () => uiNoteEditor,
16033 uiNoteHeader: () => uiNoteHeader,
16034 uiNoteReport: () => uiNoteReport,
16035 uiNotice: () => uiNotice,
16036 uiPaneBackground: () => uiPaneBackground,
16037 uiPaneHelp: () => uiPaneHelp,
16038 uiPaneIssues: () => uiPaneIssues,
16039 uiPaneMapData: () => uiPaneMapData,
16040 uiPanePreferences: () => uiPanePreferences,
16041 uiPanelBackground: () => uiPanelBackground,
16042 uiPanelHistory: () => uiPanelHistory,
16043 uiPanelLocation: () => uiPanelLocation,
16044 uiPanelMeasurement: () => uiPanelMeasurement,
16045 uiPopover: () => uiPopover,
16046 uiPresetIcon: () => uiPresetIcon,
16047 uiPresetList: () => uiPresetList,
16048 uiRestore: () => uiRestore,
16049 uiScale: () => uiScale,
16050 uiSectionBackgroundDisplayOptions: () => uiSectionBackgroundDisplayOptions,
16051 uiSectionBackgroundList: () => uiSectionBackgroundList,
16052 uiSectionBackgroundOffset: () => uiSectionBackgroundOffset,
16053 uiSectionChanges: () => uiSectionChanges,
16054 uiSectionDataLayers: () => uiSectionDataLayers,
16055 uiSectionEntityIssues: () => uiSectionEntityIssues,
16056 uiSectionFeatureType: () => uiSectionFeatureType,
16057 uiSectionMapFeatures: () => uiSectionMapFeatures,
16058 uiSectionMapStyleOptions: () => uiSectionMapStyleOptions,
16059 uiSectionOverlayList: () => uiSectionOverlayList,
16060 uiSectionPhotoOverlays: () => uiSectionPhotoOverlays,
16061 uiSectionPresetFields: () => uiSectionPresetFields,
16062 uiSectionPrivacy: () => uiSectionPrivacy,
16063 uiSectionRawMemberEditor: () => uiSectionRawMemberEditor,
16064 uiSectionRawMembershipEditor: () => uiSectionRawMembershipEditor,
16065 uiSectionRawTagEditor: () => uiSectionRawTagEditor,
16066 uiSectionSelectionList: () => uiSectionSelectionList,
16067 uiSectionValidationIssues: () => uiSectionValidationIssues,
16068 uiSectionValidationOptions: () => uiSectionValidationOptions,
16069 uiSectionValidationRules: () => uiSectionValidationRules,
16070 uiSectionValidationStatus: () => uiSectionValidationStatus,
16071 uiSettingsCustomBackground: () => uiSettingsCustomBackground,
16072 uiSettingsCustomData: () => uiSettingsCustomData,
16073 uiSidebar: () => uiSidebar,
16074 uiSourceSwitch: () => uiSourceSwitch,
16075 uiSpinner: () => uiSpinner,
16076 uiSplash: () => uiSplash,
16077 uiStatus: () => uiStatus,
16078 uiSuccess: () => uiSuccess,
16079 uiTagReference: () => uiTagReference,
16080 uiToggle: () => uiToggle,
16081 uiTooltip: () => uiTooltip,
16082 uiVersion: () => uiVersion,
16083 uiViewOnKeepRight: () => uiViewOnKeepRight,
16084 uiViewOnOSM: () => uiViewOnOSM,
16085 uiZoom: () => uiZoom,
16086 utilAesDecrypt: () => utilAesDecrypt,
16087 utilAesEncrypt: () => utilAesEncrypt,
16088 utilArrayChunk: () => utilArrayChunk,
16089 utilArrayDifference: () => utilArrayDifference,
16090 utilArrayFlatten: () => utilArrayFlatten,
16091 utilArrayGroupBy: () => utilArrayGroupBy,
16092 utilArrayIdentical: () => utilArrayIdentical,
16093 utilArrayIntersection: () => utilArrayIntersection,
16094 utilArrayUnion: () => utilArrayUnion,
16095 utilArrayUniq: () => utilArrayUniq,
16096 utilArrayUniqBy: () => utilArrayUniqBy,
16097 utilAsyncMap: () => utilAsyncMap,
16098 utilCleanOsmString: () => utilCleanOsmString,
16099 utilCleanTags: () => utilCleanTags,
16100 utilCombinedTags: () => utilCombinedTags,
16101 utilCompareIDs: () => utilCompareIDs,
16102 utilDeepMemberSelector: () => utilDeepMemberSelector,
16103 utilDetect: () => utilDetect,
16104 utilDisplayLabel: () => utilDisplayLabel,
16105 utilDisplayName: () => utilDisplayName,
16106 utilDisplayNameForPath: () => utilDisplayNameForPath,
16107 utilDisplayType: () => utilDisplayType,
16108 utilEditDistance: () => utilEditDistance,
16109 utilEntityAndDeepMemberIDs: () => utilEntityAndDeepMemberIDs,
16110 utilEntityOrDeepMemberSelector: () => utilEntityOrDeepMemberSelector,
16111 utilEntityOrMemberSelector: () => utilEntityOrMemberSelector,
16112 utilEntityRoot: () => utilEntityRoot,
16113 utilEntitySelector: () => utilEntitySelector,
16114 utilFastMouse: () => utilFastMouse,
16115 utilFunctor: () => utilFunctor,
16116 utilGetAllNodes: () => utilGetAllNodes,
16117 utilGetSetValue: () => utilGetSetValue,
16118 utilHashcode: () => utilHashcode,
16119 utilHighlightEntities: () => utilHighlightEntities,
16120 utilKeybinding: () => utilKeybinding,
16121 utilNoAuto: () => utilNoAuto,
16122 utilObjectOmit: () => utilObjectOmit,
16123 utilOldestID: () => utilOldestID,
16124 utilPrefixCSSProperty: () => utilPrefixCSSProperty,
16125 utilPrefixDOMProperty: () => utilPrefixDOMProperty,
16126 utilQsString: () => utilQsString,
16127 utilRebind: () => utilRebind,
16128 utilSafeClassName: () => utilSafeClassName,
16129 utilSessionMutex: () => utilSessionMutex,
16130 utilSetTransform: () => utilSetTransform,
16131 utilStringQs: () => utilStringQs,
16132 utilTagDiff: () => utilTagDiff,
16133 utilTagText: () => utilTagText,
16134 utilTiler: () => utilTiler,
16135 utilTotalExtent: () => utilTotalExtent,
16136 utilTriggerEvent: () => utilTriggerEvent,
16137 utilUnicodeCharsCount: () => utilUnicodeCharsCount,
16138 utilUnicodeCharsTruncated: () => utilUnicodeCharsTruncated,
16139 utilUniqueDomId: () => utilUniqueDomId,
16140 utilWrap: () => utilWrap,
16141 validationAlmostJunction: () => validationAlmostJunction,
16142 validationCloseNodes: () => validationCloseNodes,
16143 validationCrossingWays: () => validationCrossingWays,
16144 validationDisconnectedWay: () => validationDisconnectedWay,
16145 validationFormatting: () => validationFormatting,
16146 validationHelpRequest: () => validationHelpRequest,
16147 validationImpossibleOneway: () => validationImpossibleOneway,
16148 validationIncompatibleSource: () => validationIncompatibleSource,
16149 validationMaprules: () => validationMaprules,
16150 validationMismatchedGeometry: () => validationMismatchedGeometry,
16151 validationMissingRole: () => validationMissingRole,
16152 validationMissingTag: () => validationMissingTag,
16153 validationOutdatedTags: () => validationOutdatedTags,
16154 validationPrivateData: () => validationPrivateData,
16155 validationSuspiciousName: () => validationSuspiciousName,
16156 validationUnsquareWay: () => validationUnsquareWay
16159 // modules/actions/add_entity.js
16160 function actionAddEntity(way) {
16161 return function(graph) {
16162 return graph.replace(way);
16166 // modules/actions/reverse.js
16167 function actionReverse(entityID, options2) {
16168 var ignoreKey = /^.*(_|:)?(description|name|note|website|ref|source|comment|watch|attribution)(_|:)?/;
16169 var numeric = /^([+\-]?)(?=[\d.])/;
16170 var directionKey = /direction$/;
16171 var turn_lanes = /^turn:lanes:?/;
16172 var keyReplacements = [
16173 [/:right$/, ":left"],
16174 [/:left$/, ":right"],
16175 [/:forward$/, ":backward"],
16176 [/:backward$/, ":forward"],
16177 [/:right:/, ":left:"],
16178 [/:left:/, ":right:"],
16179 [/:forward:/, ":backward:"],
16180 [/:backward:/, ":forward:"]
16182 var valueReplacements = {
16187 forward: "backward",
16188 backward: "forward",
16189 forwards: "backward",
16190 backwards: "forward"
16192 var roleReplacements = {
16193 forward: "backward",
16194 backward: "forward",
16195 forwards: "backward",
16196 backwards: "forward"
16198 var onewayReplacements = {
16203 var compassReplacements = {
16221 function reverseKey(key) {
16222 for (var i3 = 0; i3 < keyReplacements.length; ++i3) {
16223 var replacement = keyReplacements[i3];
16224 if (replacement[0].test(key)) {
16225 return key.replace(replacement[0], replacement[1]);
16230 function reverseValue(key, value, includeAbsolute) {
16231 if (ignoreKey.test(key))
16233 if (turn_lanes.test(key)) {
16235 } else if (key === "incline" && numeric.test(value)) {
16236 return value.replace(numeric, function(_2, sign2) {
16237 return sign2 === "-" ? "" : "-";
16239 } else if (options2 && options2.reverseOneway && key === "oneway") {
16240 return onewayReplacements[value] || value;
16241 } else if (includeAbsolute && directionKey.test(key)) {
16242 return value.split(";").map((value2) => {
16243 if (compassReplacements[value2])
16244 return compassReplacements[value2];
16245 var degrees3 = Number(value2);
16246 if (isFinite(degrees3)) {
16247 if (degrees3 < 180) {
16252 return degrees3.toString();
16254 return valueReplacements[value2] || value2;
16258 return valueReplacements[value] || value;
16260 function reverseNodeTags(graph, nodeIDs) {
16261 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
16262 var node = graph.hasEntity(nodeIDs[i3]);
16263 if (!node || !Object.keys(node.tags).length)
16266 for (var key in node.tags) {
16267 tags[reverseKey(key)] = reverseValue(key, node.tags[key], node.id === entityID);
16269 graph = graph.replace(node.update({ tags }));
16273 function reverseWay(graph, way) {
16274 var nodes = way.nodes.slice().reverse();
16277 for (var key in way.tags) {
16278 tags[reverseKey(key)] = reverseValue(key, way.tags[key]);
16280 graph.parentRelations(way).forEach(function(relation) {
16281 relation.members.forEach(function(member, index) {
16282 if (member.id === way.id && (role = roleReplacements[member.role])) {
16283 relation = relation.updateMember({ role }, index);
16284 graph = graph.replace(relation);
16288 return reverseNodeTags(graph, nodes).replace(way.update({ nodes, tags }));
16290 var action = function(graph) {
16291 var entity = graph.entity(entityID);
16292 if (entity.type === "way") {
16293 return reverseWay(graph, entity);
16295 return reverseNodeTags(graph, [entityID]);
16297 action.disabled = function(graph) {
16298 var entity = graph.hasEntity(entityID);
16299 if (!entity || entity.type === "way")
16301 for (var key in entity.tags) {
16302 var value = entity.tags[key];
16303 if (reverseKey(key) !== key || reverseValue(key, value, true) !== value) {
16307 return "nondirectional_node";
16309 action.entityID = function() {
16315 // modules/osm/tags.js
16316 function osmIsInterestingTag(key) {
16317 return key !== "attribution" && key !== "created_by" && key !== "source" && key !== "odbl" && key.indexOf("source:") !== 0 && key.indexOf("source_ref") !== 0 && // purposely exclude colon
16318 key.indexOf("tiger:") !== 0;
16320 var osmLifecyclePrefixes = {
16321 // nonexistent, might be built
16324 // under maintentance or between groundbreaking and opening
16325 construction: true,
16326 // existent but not functional
16328 // dilapidated to nonexistent
16331 // nonexistent, still may appear in imagery
16338 // existent occasionally, e.g. stormwater drainage basin
16341 function osmRemoveLifecyclePrefix(key) {
16342 const keySegments = key.split(":");
16343 if (keySegments.length === 1)
16345 if (keySegments[0] in osmLifecyclePrefixes) {
16346 return key.slice(keySegments[0].length + 1);
16350 var osmAreaKeys = {};
16351 function osmSetAreaKeys(value) {
16352 osmAreaKeys = value;
16354 var osmAreaKeysExceptions = {
16360 public_transport: {
16378 function osmTagSuggestingArea(tags) {
16379 if (tags.area === "yes")
16380 return { area: "yes" };
16381 if (tags.area === "no")
16383 var returnTags = {};
16384 for (var realKey in tags) {
16385 const key = osmRemoveLifecyclePrefix(realKey);
16386 if (key in osmAreaKeys && !(tags[realKey] in osmAreaKeys[key])) {
16387 returnTags[realKey] = tags[realKey];
16390 if (key in osmAreaKeysExceptions && tags[realKey] in osmAreaKeysExceptions[key]) {
16391 returnTags[realKey] = tags[realKey];
16397 var osmLineTags = {};
16398 function osmSetLineTags(value) {
16399 osmLineTags = value;
16401 var osmPointTags = {};
16402 function osmSetPointTags(value) {
16403 osmPointTags = value;
16405 var osmVertexTags = {};
16406 function osmSetVertexTags(value) {
16407 osmVertexTags = value;
16409 function osmNodeGeometriesForTags(nodeTags) {
16410 var geometries = {};
16411 for (var key in nodeTags) {
16412 if (osmPointTags[key] && (osmPointTags[key]["*"] || osmPointTags[key][nodeTags[key]])) {
16413 geometries.point = true;
16415 if (osmVertexTags[key] && (osmVertexTags[key]["*"] || osmVertexTags[key][nodeTags[key]])) {
16416 geometries.vertex = true;
16418 if (geometries.point && geometries.vertex)
16423 var osmOneWayTags = {
16425 "chair_lift": true,
16428 "magic_carpet": true,
16429 "mixed_lift": true,
16443 "goods_conveyor": true,
16444 "piste:halfpipe": true
16452 "two-way_route": true,
16453 "recommended_traffic_lane": true,
16454 "separation_lane": true,
16455 "separation_roundabout": true
16462 "pressurised": true,
16466 "tidal_channel": true
16469 var osmPavedTags = {
16475 "concrete:lanes": true,
16476 "concrete:plates": true
16482 var osmSemipavedTags = {
16484 "cobblestone": true,
16485 "cobblestone:flattened": true,
16486 "unhewn_cobblestone": true,
16488 "paving_stones": true,
16493 var osmRightSideIsInsideTags = {
16496 "coastline": "coastline"
16499 "retaining_wall": true,
16501 "guard_rail": true,
16505 "embankment": true,
16512 var osmRoutableHighwayTagValues = {
16519 motorway_link: true,
16521 primary_link: true,
16522 secondary_link: true,
16523 tertiary_link: true,
16524 unclassified: true,
16528 living_street: true,
16529 bus_guideway: true,
16538 var osmPathHighwayTagValues = {
16547 var osmRailwayTrackTagValues = {
16555 narrow_gauge: true,
16559 var osmFlowingWaterwayTagValues = {
16566 tidal_channel: true
16568 var allowUpperCaseTagValues = /network|taxon|genus|species|brand|grape_variety|royal_cypher|listed_status|booth|rating|stars|:output|_hours|_times|_ref|manufacturer|country|target|brewery|cai_scale|traffic_sign/;
16570 // node_modules/d3-array/src/ascending.js
16571 function ascending(a2, b2) {
16572 return a2 == null || b2 == null ? NaN : a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
16575 // node_modules/d3-array/src/descending.js
16576 function descending(a2, b2) {
16577 return a2 == null || b2 == null ? NaN : b2 < a2 ? -1 : b2 > a2 ? 1 : b2 >= a2 ? 0 : NaN;
16580 // node_modules/d3-array/src/bisector.js
16581 function bisector(f3) {
16582 let compare1, compare2, delta;
16583 if (f3.length !== 2) {
16584 compare1 = ascending;
16585 compare2 = (d2, x2) => ascending(f3(d2), x2);
16586 delta = (d2, x2) => f3(d2) - x2;
16588 compare1 = f3 === ascending || f3 === descending ? f3 : zero;
16592 function left(a2, x2, lo = 0, hi = a2.length) {
16594 if (compare1(x2, x2) !== 0)
16597 const mid = lo + hi >>> 1;
16598 if (compare2(a2[mid], x2) < 0)
16606 function right(a2, x2, lo = 0, hi = a2.length) {
16608 if (compare1(x2, x2) !== 0)
16611 const mid = lo + hi >>> 1;
16612 if (compare2(a2[mid], x2) <= 0)
16620 function center(a2, x2, lo = 0, hi = a2.length) {
16621 const i3 = left(a2, x2, lo, hi - 1);
16622 return i3 > lo && delta(a2[i3 - 1], x2) > -delta(a2[i3], x2) ? i3 - 1 : i3;
16624 return { left, center, right };
16630 // node_modules/d3-array/src/number.js
16631 function number(x2) {
16632 return x2 === null ? NaN : +x2;
16634 function* numbers(values, valueof) {
16635 if (valueof === void 0) {
16636 for (let value of values) {
16637 if (value != null && (value = +value) >= value) {
16643 for (let value of values) {
16644 if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
16651 // node_modules/d3-array/src/bisect.js
16652 var ascendingBisect = bisector(ascending);
16653 var bisectRight = ascendingBisect.right;
16654 var bisectLeft = ascendingBisect.left;
16655 var bisectCenter = bisector(number).center;
16656 var bisect_default = bisectRight;
16658 // node_modules/d3-array/src/fsum.js
16659 var Adder = class {
16661 this._partials = new Float64Array(32);
16665 const p2 = this._partials;
16667 for (let j3 = 0; j3 < this._n && j3 < 32; j3++) {
16668 const y2 = p2[j3], hi = x2 + y2, lo = Math.abs(x2) < Math.abs(y2) ? x2 - (hi - y2) : y2 - (hi - x2);
16678 const p2 = this._partials;
16679 let n3 = this._n, x2, y2, lo, hi = 0;
16686 lo = y2 - (hi - x2);
16690 if (n3 > 0 && (lo < 0 && p2[n3 - 1] < 0 || lo > 0 && p2[n3 - 1] > 0)) {
16701 // node_modules/d3-array/src/sort.js
16702 function compareDefined(compare = ascending) {
16703 if (compare === ascending)
16704 return ascendingDefined;
16705 if (typeof compare !== "function")
16706 throw new TypeError("compare is not a function");
16707 return (a2, b2) => {
16708 const x2 = compare(a2, b2);
16709 if (x2 || x2 === 0)
16711 return (compare(b2, b2) === 0) - (compare(a2, a2) === 0);
16714 function ascendingDefined(a2, b2) {
16715 return (a2 == null || !(a2 >= a2)) - (b2 == null || !(b2 >= b2)) || (a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
16718 // node_modules/d3-array/src/ticks.js
16719 var e10 = Math.sqrt(50);
16720 var e5 = Math.sqrt(10);
16721 var e2 = Math.sqrt(2);
16722 function ticks(start2, stop, count) {
16723 var reverse, i3 = -1, n3, ticks2, step;
16724 stop = +stop, start2 = +start2, count = +count;
16725 if (start2 === stop && count > 0)
16727 if (reverse = stop < start2)
16728 n3 = start2, start2 = stop, stop = n3;
16729 if ((step = tickIncrement(start2, stop, count)) === 0 || !isFinite(step))
16732 let r0 = Math.round(start2 / step), r1 = Math.round(stop / step);
16733 if (r0 * step < start2)
16735 if (r1 * step > stop)
16737 ticks2 = new Array(n3 = r1 - r0 + 1);
16739 ticks2[i3] = (r0 + i3) * step;
16742 let r0 = Math.round(start2 * step), r1 = Math.round(stop * step);
16743 if (r0 / step < start2)
16745 if (r1 / step > stop)
16747 ticks2 = new Array(n3 = r1 - r0 + 1);
16749 ticks2[i3] = (r0 + i3) / step;
16755 function tickIncrement(start2, stop, count) {
16756 var step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log(step) / Math.LN10), error = step / Math.pow(10, power);
16757 return power >= 0 ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);
16759 function tickStep(start2, stop, count) {
16760 var step0 = Math.abs(stop - start2) / Math.max(0, count), step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), error = step0 / step1;
16763 else if (error >= e5)
16765 else if (error >= e2)
16767 return stop < start2 ? -step1 : step1;
16770 // node_modules/d3-array/src/max.js
16771 function max(values, valueof) {
16773 if (valueof === void 0) {
16774 for (const value of values) {
16775 if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
16781 for (let value of values) {
16782 if ((value = valueof(value, ++index, values)) != null && (max3 < value || max3 === void 0 && value >= value)) {
16790 // node_modules/d3-array/src/min.js
16791 function min(values, valueof) {
16793 if (valueof === void 0) {
16794 for (const value of values) {
16795 if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
16801 for (let value of values) {
16802 if ((value = valueof(value, ++index, values)) != null && (min3 > value || min3 === void 0 && value >= value)) {
16810 // node_modules/d3-array/src/quickselect.js
16811 function quickselect(array2, k2, left = 0, right = array2.length - 1, compare) {
16812 compare = compare === void 0 ? ascendingDefined : compareDefined(compare);
16813 while (right > left) {
16814 if (right - left > 600) {
16815 const n3 = right - left + 1;
16816 const m2 = k2 - left + 1;
16817 const z2 = Math.log(n3);
16818 const s2 = 0.5 * Math.exp(2 * z2 / 3);
16819 const sd = 0.5 * Math.sqrt(z2 * s2 * (n3 - s2) / n3) * (m2 - n3 / 2 < 0 ? -1 : 1);
16820 const newLeft = Math.max(left, Math.floor(k2 - m2 * s2 / n3 + sd));
16821 const newRight = Math.min(right, Math.floor(k2 + (n3 - m2) * s2 / n3 + sd));
16822 quickselect(array2, k2, newLeft, newRight, compare);
16824 const t2 = array2[k2];
16827 swap(array2, left, k2);
16828 if (compare(array2[right], t2) > 0)
16829 swap(array2, left, right);
16831 swap(array2, i3, j3), ++i3, --j3;
16832 while (compare(array2[i3], t2) < 0)
16834 while (compare(array2[j3], t2) > 0)
16837 if (compare(array2[left], t2) === 0)
16838 swap(array2, left, j3);
16840 ++j3, swap(array2, j3, right);
16848 function swap(array2, i3, j3) {
16849 const t2 = array2[i3];
16850 array2[i3] = array2[j3];
16854 // node_modules/d3-array/src/quantile.js
16855 function quantile(values, p2, valueof) {
16856 values = Float64Array.from(numbers(values, valueof));
16857 if (!(n3 = values.length))
16859 if ((p2 = +p2) <= 0 || n3 < 2)
16860 return min(values);
16862 return max(values);
16863 var n3, i3 = (n3 - 1) * p2, i0 = Math.floor(i3), value0 = max(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min(values.subarray(i0 + 1));
16864 return value0 + (value1 - value0) * (i3 - i0);
16867 // node_modules/d3-array/src/median.js
16868 function median(values, valueof) {
16869 return quantile(values, 0.5, valueof);
16872 // node_modules/d3-array/src/merge.js
16873 function* flatten(arrays) {
16874 for (const array2 of arrays) {
16878 function merge(arrays) {
16879 return Array.from(flatten(arrays));
16882 // node_modules/d3-array/src/pairs.js
16883 function pairs(values, pairof = pair) {
16887 for (const value of values) {
16889 pairs2.push(pairof(previous, value));
16895 function pair(a2, b2) {
16899 // node_modules/d3-array/src/range.js
16900 function range(start2, stop, step) {
16901 start2 = +start2, stop = +stop, step = (n3 = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n3 < 3 ? 1 : +step;
16902 var i3 = -1, n3 = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range3 = new Array(n3);
16903 while (++i3 < n3) {
16904 range3[i3] = start2 + i3 * step;
16909 // node_modules/d3-geo/src/math.js
16910 var epsilon = 1e-6;
16911 var epsilon2 = 1e-12;
16913 var halfPi = pi / 2;
16914 var quarterPi = pi / 4;
16916 var degrees = 180 / pi;
16917 var radians = pi / 180;
16918 var abs = Math.abs;
16919 var atan = Math.atan;
16920 var atan2 = Math.atan2;
16921 var cos = Math.cos;
16922 var exp = Math.exp;
16923 var log = Math.log;
16924 var sin = Math.sin;
16925 var sign = Math.sign || function(x2) {
16926 return x2 > 0 ? 1 : x2 < 0 ? -1 : 0;
16928 var sqrt = Math.sqrt;
16929 var tan = Math.tan;
16930 function acos(x2) {
16931 return x2 > 1 ? 0 : x2 < -1 ? pi : Math.acos(x2);
16933 function asin(x2) {
16934 return x2 > 1 ? halfPi : x2 < -1 ? -halfPi : Math.asin(x2);
16937 // node_modules/d3-geo/src/noop.js
16941 // node_modules/d3-geo/src/stream.js
16942 function streamGeometry(geometry, stream) {
16943 if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
16944 streamGeometryType[geometry.type](geometry, stream);
16947 var streamObjectType = {
16948 Feature: function(object, stream) {
16949 streamGeometry(object.geometry, stream);
16951 FeatureCollection: function(object, stream) {
16952 var features = object.features, i3 = -1, n3 = features.length;
16954 streamGeometry(features[i3].geometry, stream);
16957 var streamGeometryType = {
16958 Sphere: function(object, stream) {
16961 Point: function(object, stream) {
16962 object = object.coordinates;
16963 stream.point(object[0], object[1], object[2]);
16965 MultiPoint: function(object, stream) {
16966 var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
16968 object = coordinates[i3], stream.point(object[0], object[1], object[2]);
16970 LineString: function(object, stream) {
16971 streamLine(object.coordinates, stream, 0);
16973 MultiLineString: function(object, stream) {
16974 var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
16976 streamLine(coordinates[i3], stream, 0);
16978 Polygon: function(object, stream) {
16979 streamPolygon(object.coordinates, stream);
16981 MultiPolygon: function(object, stream) {
16982 var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
16984 streamPolygon(coordinates[i3], stream);
16986 GeometryCollection: function(object, stream) {
16987 var geometries = object.geometries, i3 = -1, n3 = geometries.length;
16989 streamGeometry(geometries[i3], stream);
16992 function streamLine(coordinates, stream, closed) {
16993 var i3 = -1, n3 = coordinates.length - closed, coordinate;
16994 stream.lineStart();
16996 coordinate = coordinates[i3], stream.point(coordinate[0], coordinate[1], coordinate[2]);
16999 function streamPolygon(coordinates, stream) {
17000 var i3 = -1, n3 = coordinates.length;
17001 stream.polygonStart();
17003 streamLine(coordinates[i3], stream, 1);
17004 stream.polygonEnd();
17006 function stream_default(object, stream) {
17007 if (object && streamObjectType.hasOwnProperty(object.type)) {
17008 streamObjectType[object.type](object, stream);
17010 streamGeometry(object, stream);
17014 // node_modules/d3-geo/src/area.js
17015 var areaRingSum = new Adder();
17016 var areaSum = new Adder();
17026 polygonStart: function() {
17027 areaRingSum = new Adder();
17028 areaStream.lineStart = areaRingStart;
17029 areaStream.lineEnd = areaRingEnd;
17031 polygonEnd: function() {
17032 var areaRing = +areaRingSum;
17033 areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);
17034 this.lineStart = this.lineEnd = this.point = noop;
17036 sphere: function() {
17040 function areaRingStart() {
17041 areaStream.point = areaPointFirst;
17043 function areaRingEnd() {
17044 areaPoint(lambda00, phi00);
17046 function areaPointFirst(lambda, phi) {
17047 areaStream.point = areaPoint;
17048 lambda00 = lambda, phi00 = phi;
17049 lambda *= radians, phi *= radians;
17050 lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);
17052 function areaPoint(lambda, phi) {
17053 lambda *= radians, phi *= radians;
17054 phi = phi / 2 + quarterPi;
17055 var dLambda = lambda - lambda0, sdLambda = dLambda >= 0 ? 1 : -1, adLambda = sdLambda * dLambda, cosPhi = cos(phi), sinPhi = sin(phi), k2 = sinPhi0 * sinPhi, u2 = cosPhi0 * cosPhi + k2 * cos(adLambda), v2 = k2 * sdLambda * sin(adLambda);
17056 areaRingSum.add(atan2(v2, u2));
17057 lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
17059 function area_default(object) {
17060 areaSum = new Adder();
17061 stream_default(object, areaStream);
17062 return areaSum * 2;
17065 // node_modules/d3-geo/src/cartesian.js
17066 function spherical(cartesian2) {
17067 return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])];
17069 function cartesian(spherical2) {
17070 var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi);
17071 return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];
17073 function cartesianDot(a2, b2) {
17074 return a2[0] * b2[0] + a2[1] * b2[1] + a2[2] * b2[2];
17076 function cartesianCross(a2, b2) {
17077 return [a2[1] * b2[2] - a2[2] * b2[1], a2[2] * b2[0] - a2[0] * b2[2], a2[0] * b2[1] - a2[1] * b2[0]];
17079 function cartesianAddInPlace(a2, b2) {
17080 a2[0] += b2[0], a2[1] += b2[1], a2[2] += b2[2];
17082 function cartesianScale(vector, k2) {
17083 return [vector[0] * k2, vector[1] * k2, vector[2] * k2];
17085 function cartesianNormalizeInPlace(d2) {
17086 var l2 = sqrt(d2[0] * d2[0] + d2[1] * d2[1] + d2[2] * d2[2]);
17087 d2[0] /= l2, d2[1] /= l2, d2[2] /= l2;
17090 // node_modules/d3-geo/src/bounds.js
17102 var boundsStream = {
17103 point: boundsPoint,
17104 lineStart: boundsLineStart,
17105 lineEnd: boundsLineEnd,
17106 polygonStart: function() {
17107 boundsStream.point = boundsRingPoint;
17108 boundsStream.lineStart = boundsRingStart;
17109 boundsStream.lineEnd = boundsRingEnd;
17110 deltaSum = new Adder();
17111 areaStream.polygonStart();
17113 polygonEnd: function() {
17114 areaStream.polygonEnd();
17115 boundsStream.point = boundsPoint;
17116 boundsStream.lineStart = boundsLineStart;
17117 boundsStream.lineEnd = boundsLineEnd;
17118 if (areaRingSum < 0)
17119 lambda02 = -(lambda1 = 180), phi0 = -(phi1 = 90);
17120 else if (deltaSum > epsilon)
17122 else if (deltaSum < -epsilon)
17124 range2[0] = lambda02, range2[1] = lambda1;
17126 sphere: function() {
17127 lambda02 = -(lambda1 = 180), phi0 = -(phi1 = 90);
17130 function boundsPoint(lambda, phi) {
17131 ranges.push(range2 = [lambda02 = lambda, lambda1 = lambda]);
17137 function linePoint(lambda, phi) {
17138 var p2 = cartesian([lambda * radians, phi * radians]);
17140 var normal = cartesianCross(p0, p2), equatorial = [normal[1], -normal[0], 0], inflection = cartesianCross(equatorial, normal);
17141 cartesianNormalizeInPlace(inflection);
17142 inflection = spherical(inflection);
17143 var delta = lambda - lambda2, sign2 = delta > 0 ? 1 : -1, lambdai = inflection[0] * degrees * sign2, phii, antimeridian = abs(delta) > 180;
17144 if (antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
17145 phii = inflection[1] * degrees;
17148 } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
17149 phii = -inflection[1] * degrees;
17158 if (antimeridian) {
17159 if (lambda < lambda2) {
17160 if (angle(lambda02, lambda) > angle(lambda02, lambda1))
17163 if (angle(lambda, lambda1) > angle(lambda02, lambda1))
17167 if (lambda1 >= lambda02) {
17168 if (lambda < lambda02)
17170 if (lambda > lambda1)
17173 if (lambda > lambda2) {
17174 if (angle(lambda02, lambda) > angle(lambda02, lambda1))
17177 if (angle(lambda, lambda1) > angle(lambda02, lambda1))
17183 ranges.push(range2 = [lambda02 = lambda, lambda1 = lambda]);
17189 p0 = p2, lambda2 = lambda;
17191 function boundsLineStart() {
17192 boundsStream.point = linePoint;
17194 function boundsLineEnd() {
17195 range2[0] = lambda02, range2[1] = lambda1;
17196 boundsStream.point = boundsPoint;
17199 function boundsRingPoint(lambda, phi) {
17201 var delta = lambda - lambda2;
17202 deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
17204 lambda002 = lambda, phi002 = phi;
17206 areaStream.point(lambda, phi);
17207 linePoint(lambda, phi);
17209 function boundsRingStart() {
17210 areaStream.lineStart();
17212 function boundsRingEnd() {
17213 boundsRingPoint(lambda002, phi002);
17214 areaStream.lineEnd();
17215 if (abs(deltaSum) > epsilon)
17216 lambda02 = -(lambda1 = 180);
17217 range2[0] = lambda02, range2[1] = lambda1;
17220 function angle(lambda04, lambda12) {
17221 return (lambda12 -= lambda04) < 0 ? lambda12 + 360 : lambda12;
17223 function rangeCompare(a2, b2) {
17224 return a2[0] - b2[0];
17226 function rangeContains(range3, x2) {
17227 return range3[0] <= range3[1] ? range3[0] <= x2 && x2 <= range3[1] : x2 < range3[0] || range3[1] < x2;
17229 function bounds_default(feature3) {
17230 var i3, n3, a2, b2, merged, deltaMax, delta;
17231 phi1 = lambda1 = -(lambda02 = phi0 = Infinity);
17233 stream_default(feature3, boundsStream);
17234 if (n3 = ranges.length) {
17235 ranges.sort(rangeCompare);
17236 for (i3 = 1, a2 = ranges[0], merged = [a2]; i3 < n3; ++i3) {
17238 if (rangeContains(a2, b2[0]) || rangeContains(a2, b2[1])) {
17239 if (angle(a2[0], b2[1]) > angle(a2[0], a2[1]))
17241 if (angle(b2[0], a2[1]) > angle(a2[0], a2[1]))
17244 merged.push(a2 = b2);
17247 for (deltaMax = -Infinity, n3 = merged.length - 1, i3 = 0, a2 = merged[n3]; i3 <= n3; a2 = b2, ++i3) {
17249 if ((delta = angle(a2[1], b2[0])) > deltaMax)
17250 deltaMax = delta, lambda02 = b2[0], lambda1 = a2[1];
17253 ranges = range2 = null;
17254 return lambda02 === Infinity || phi0 === Infinity ? [[NaN, NaN], [NaN, NaN]] : [[lambda02, phi0], [lambda1, phi1]];
17257 // node_modules/d3-geo/src/compose.js
17258 function compose_default(a2, b2) {
17259 function compose(x2, y2) {
17260 return x2 = a2(x2, y2), b2(x2[0], x2[1]);
17262 if (a2.invert && b2.invert)
17263 compose.invert = function(x2, y2) {
17264 return x2 = b2.invert(x2, y2), x2 && a2.invert(x2[0], x2[1]);
17269 // node_modules/d3-geo/src/rotation.js
17270 function rotationIdentity(lambda, phi) {
17271 return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi];
17273 rotationIdentity.invert = rotationIdentity;
17274 function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
17275 return (deltaLambda %= tau) ? deltaPhi || deltaGamma ? compose_default(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
17277 function forwardRotationLambda(deltaLambda) {
17278 return function(lambda, phi) {
17279 return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];
17282 function rotationLambda(deltaLambda) {
17283 var rotation = forwardRotationLambda(deltaLambda);
17284 rotation.invert = forwardRotationLambda(-deltaLambda);
17287 function rotationPhiGamma(deltaPhi, deltaGamma) {
17288 var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
17289 function rotation(lambda, phi) {
17290 var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z2 = sin(phi), k2 = z2 * cosDeltaPhi + x2 * sinDeltaPhi;
17292 atan2(y2 * cosDeltaGamma - k2 * sinDeltaGamma, x2 * cosDeltaPhi - z2 * sinDeltaPhi),
17293 asin(k2 * cosDeltaGamma + y2 * sinDeltaGamma)
17296 rotation.invert = function(lambda, phi) {
17297 var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z2 = sin(phi), k2 = z2 * cosDeltaGamma - y2 * sinDeltaGamma;
17299 atan2(y2 * cosDeltaGamma + z2 * sinDeltaGamma, x2 * cosDeltaPhi + k2 * sinDeltaPhi),
17300 asin(k2 * cosDeltaPhi - x2 * sinDeltaPhi)
17305 function rotation_default(rotate) {
17306 rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
17307 function forward(coordinates) {
17308 coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
17309 return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
17311 forward.invert = function(coordinates) {
17312 coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
17313 return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
17318 // node_modules/d3-geo/src/circle.js
17319 function circleStream(stream, radius, delta, direction, t0, t1) {
17322 var cosRadius = cos(radius), sinRadius = sin(radius), step = direction * delta;
17324 t0 = radius + direction * tau;
17325 t1 = radius - step / 2;
17327 t0 = circleRadius(cosRadius, t0);
17328 t1 = circleRadius(cosRadius, t1);
17329 if (direction > 0 ? t0 < t1 : t0 > t1)
17330 t0 += direction * tau;
17332 for (var point2, t2 = t0; direction > 0 ? t2 > t1 : t2 < t1; t2 -= step) {
17333 point2 = spherical([cosRadius, -sinRadius * cos(t2), -sinRadius * sin(t2)]);
17334 stream.point(point2[0], point2[1]);
17337 function circleRadius(cosRadius, point2) {
17338 point2 = cartesian(point2), point2[0] -= cosRadius;
17339 cartesianNormalizeInPlace(point2);
17340 var radius = acos(-point2[1]);
17341 return ((-point2[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
17344 // node_modules/d3-geo/src/clip/buffer.js
17345 function buffer_default() {
17346 var lines = [], line;
17348 point: function(x2, y2, m2) {
17349 line.push([x2, y2, m2]);
17351 lineStart: function() {
17352 lines.push(line = []);
17355 rejoin: function() {
17356 if (lines.length > 1)
17357 lines.push(lines.pop().concat(lines.shift()));
17359 result: function() {
17360 var result = lines;
17368 // node_modules/d3-geo/src/pointEqual.js
17369 function pointEqual_default(a2, b2) {
17370 return abs(a2[0] - b2[0]) < epsilon && abs(a2[1] - b2[1]) < epsilon;
17373 // node_modules/d3-geo/src/clip/rejoin.js
17374 function Intersection(point2, points, other, entry) {
17380 this.n = this.p = null;
17382 function rejoin_default(segments, compareIntersection2, startInside, interpolate, stream) {
17383 var subject = [], clip = [], i3, n3;
17384 segments.forEach(function(segment) {
17385 if ((n4 = segment.length - 1) <= 0)
17387 var n4, p02 = segment[0], p1 = segment[n4], x2;
17388 if (pointEqual_default(p02, p1)) {
17389 if (!p02[2] && !p1[2]) {
17390 stream.lineStart();
17391 for (i3 = 0; i3 < n4; ++i3)
17392 stream.point((p02 = segment[i3])[0], p02[1]);
17396 p1[0] += 2 * epsilon;
17398 subject.push(x2 = new Intersection(p02, segment, null, true));
17399 clip.push(x2.o = new Intersection(p02, null, x2, false));
17400 subject.push(x2 = new Intersection(p1, segment, null, false));
17401 clip.push(x2.o = new Intersection(p1, null, x2, true));
17403 if (!subject.length)
17405 clip.sort(compareIntersection2);
17408 for (i3 = 0, n3 = clip.length; i3 < n3; ++i3) {
17409 clip[i3].e = startInside = !startInside;
17411 var start2 = subject[0], points, point2;
17413 var current = start2, isSubject = true;
17415 if ((current = current.n) === start2)
17417 points = current.z;
17418 stream.lineStart();
17420 current.v = current.o.v = true;
17423 for (i3 = 0, n3 = points.length; i3 < n3; ++i3)
17424 stream.point((point2 = points[i3])[0], point2[1]);
17426 interpolate(current.x, current.n.x, 1, stream);
17428 current = current.n;
17431 points = current.p.z;
17432 for (i3 = points.length - 1; i3 >= 0; --i3)
17433 stream.point((point2 = points[i3])[0], point2[1]);
17435 interpolate(current.x, current.p.x, -1, stream);
17437 current = current.p;
17439 current = current.o;
17440 points = current.z;
17441 isSubject = !isSubject;
17442 } while (!current.v);
17446 function link(array2) {
17447 if (!(n3 = array2.length))
17449 var n3, i3 = 0, a2 = array2[0], b2;
17450 while (++i3 < n3) {
17451 a2.n = b2 = array2[i3];
17455 a2.n = b2 = array2[0];
17459 // node_modules/d3-geo/src/polygonContains.js
17460 function longitude(point2) {
17461 return abs(point2[0]) <= pi ? point2[0] : sign(point2[0]) * ((abs(point2[0]) + pi) % tau - pi);
17463 function polygonContains_default(polygon2, point2) {
17464 var lambda = longitude(point2), phi = point2[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle2 = 0, winding = 0;
17465 var sum = new Adder();
17467 phi = halfPi + epsilon;
17468 else if (sinPhi === -1)
17469 phi = -halfPi - epsilon;
17470 for (var i3 = 0, n3 = polygon2.length; i3 < n3; ++i3) {
17471 if (!(m2 = (ring = polygon2[i3]).length))
17473 var ring, m2, point0 = ring[m2 - 1], lambda04 = longitude(point0), phi02 = point0[1] / 2 + quarterPi, sinPhi03 = sin(phi02), cosPhi03 = cos(phi02);
17474 for (var j3 = 0; j3 < m2; ++j3, lambda04 = lambda12, sinPhi03 = sinPhi1, cosPhi03 = cosPhi1, point0 = point1) {
17475 var point1 = ring[j3], lambda12 = longitude(point1), phi12 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi12), cosPhi1 = cos(phi12), delta = lambda12 - lambda04, sign2 = delta >= 0 ? 1 : -1, absDelta = sign2 * delta, antimeridian = absDelta > pi, k2 = sinPhi03 * sinPhi1;
17476 sum.add(atan2(k2 * sign2 * sin(absDelta), cosPhi03 * cosPhi1 + k2 * cos(absDelta)));
17477 angle2 += antimeridian ? delta + sign2 * tau : delta;
17478 if (antimeridian ^ lambda04 >= lambda ^ lambda12 >= lambda) {
17479 var arc = cartesianCross(cartesian(point0), cartesian(point1));
17480 cartesianNormalizeInPlace(arc);
17481 var intersection = cartesianCross(normal, arc);
17482 cartesianNormalizeInPlace(intersection);
17483 var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);
17484 if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
17485 winding += antimeridian ^ delta >= 0 ? 1 : -1;
17490 return (angle2 < -epsilon || angle2 < epsilon && sum < -epsilon2) ^ winding & 1;
17493 // node_modules/d3-geo/src/clip/index.js
17494 function clip_default(pointVisible, clipLine, interpolate, start2) {
17495 return function(sink) {
17496 var line = clipLine(sink), ringBuffer = buffer_default(), ringSink = clipLine(ringBuffer), polygonStarted = false, polygon2, segments, ring;
17501 polygonStart: function() {
17502 clip.point = pointRing;
17503 clip.lineStart = ringStart;
17504 clip.lineEnd = ringEnd;
17508 polygonEnd: function() {
17509 clip.point = point2;
17510 clip.lineStart = lineStart;
17511 clip.lineEnd = lineEnd;
17512 segments = merge(segments);
17513 var startInside = polygonContains_default(polygon2, start2);
17514 if (segments.length) {
17515 if (!polygonStarted)
17516 sink.polygonStart(), polygonStarted = true;
17517 rejoin_default(segments, compareIntersection, startInside, interpolate, sink);
17518 } else if (startInside) {
17519 if (!polygonStarted)
17520 sink.polygonStart(), polygonStarted = true;
17522 interpolate(null, null, 1, sink);
17525 if (polygonStarted)
17526 sink.polygonEnd(), polygonStarted = false;
17527 segments = polygon2 = null;
17529 sphere: function() {
17530 sink.polygonStart();
17532 interpolate(null, null, 1, sink);
17537 function point2(lambda, phi) {
17538 if (pointVisible(lambda, phi))
17539 sink.point(lambda, phi);
17541 function pointLine(lambda, phi) {
17542 line.point(lambda, phi);
17544 function lineStart() {
17545 clip.point = pointLine;
17548 function lineEnd() {
17549 clip.point = point2;
17552 function pointRing(lambda, phi) {
17553 ring.push([lambda, phi]);
17554 ringSink.point(lambda, phi);
17556 function ringStart() {
17557 ringSink.lineStart();
17560 function ringEnd() {
17561 pointRing(ring[0][0], ring[0][1]);
17562 ringSink.lineEnd();
17563 var clean2 = ringSink.clean(), ringSegments = ringBuffer.result(), i3, n3 = ringSegments.length, m2, segment, point3;
17565 polygon2.push(ring);
17570 segment = ringSegments[0];
17571 if ((m2 = segment.length - 1) > 0) {
17572 if (!polygonStarted)
17573 sink.polygonStart(), polygonStarted = true;
17575 for (i3 = 0; i3 < m2; ++i3)
17576 sink.point((point3 = segment[i3])[0], point3[1]);
17581 if (n3 > 1 && clean2 & 2)
17582 ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
17583 segments.push(ringSegments.filter(validSegment));
17588 function validSegment(segment) {
17589 return segment.length > 1;
17591 function compareIntersection(a2, b2) {
17592 return ((a2 = a2.x)[0] < 0 ? a2[1] - halfPi - epsilon : halfPi - a2[1]) - ((b2 = b2.x)[0] < 0 ? b2[1] - halfPi - epsilon : halfPi - b2[1]);
17595 // node_modules/d3-geo/src/clip/antimeridian.js
17596 var antimeridian_default = clip_default(
17600 clipAntimeridianLine,
17601 clipAntimeridianInterpolate,
17604 function clipAntimeridianLine(stream) {
17605 var lambda04 = NaN, phi02 = NaN, sign0 = NaN, clean2;
17607 lineStart: function() {
17608 stream.lineStart();
17611 point: function(lambda12, phi12) {
17612 var sign1 = lambda12 > 0 ? pi : -pi, delta = abs(lambda12 - lambda04);
17613 if (abs(delta - pi) < epsilon) {
17614 stream.point(lambda04, phi02 = (phi02 + phi12) / 2 > 0 ? halfPi : -halfPi);
17615 stream.point(sign0, phi02);
17617 stream.lineStart();
17618 stream.point(sign1, phi02);
17619 stream.point(lambda12, phi02);
17621 } else if (sign0 !== sign1 && delta >= pi) {
17622 if (abs(lambda04 - sign0) < epsilon)
17623 lambda04 -= sign0 * epsilon;
17624 if (abs(lambda12 - sign1) < epsilon)
17625 lambda12 -= sign1 * epsilon;
17626 phi02 = clipAntimeridianIntersect(lambda04, phi02, lambda12, phi12);
17627 stream.point(sign0, phi02);
17629 stream.lineStart();
17630 stream.point(sign1, phi02);
17633 stream.point(lambda04 = lambda12, phi02 = phi12);
17636 lineEnd: function() {
17638 lambda04 = phi02 = NaN;
17640 clean: function() {
17645 function clipAntimeridianIntersect(lambda04, phi02, lambda12, phi12) {
17646 var cosPhi03, cosPhi1, sinLambda0Lambda1 = sin(lambda04 - lambda12);
17647 return abs(sinLambda0Lambda1) > epsilon ? atan((sin(phi02) * (cosPhi1 = cos(phi12)) * sin(lambda12) - sin(phi12) * (cosPhi03 = cos(phi02)) * sin(lambda04)) / (cosPhi03 * cosPhi1 * sinLambda0Lambda1)) : (phi02 + phi12) / 2;
17649 function clipAntimeridianInterpolate(from, to, direction, stream) {
17651 if (from == null) {
17652 phi = direction * halfPi;
17653 stream.point(-pi, phi);
17654 stream.point(0, phi);
17655 stream.point(pi, phi);
17656 stream.point(pi, 0);
17657 stream.point(pi, -phi);
17658 stream.point(0, -phi);
17659 stream.point(-pi, -phi);
17660 stream.point(-pi, 0);
17661 stream.point(-pi, phi);
17662 } else if (abs(from[0] - to[0]) > epsilon) {
17663 var lambda = from[0] < to[0] ? pi : -pi;
17664 phi = direction * lambda / 2;
17665 stream.point(-lambda, phi);
17666 stream.point(0, phi);
17667 stream.point(lambda, phi);
17669 stream.point(to[0], to[1]);
17673 // node_modules/d3-geo/src/clip/circle.js
17674 function circle_default(radius) {
17675 var cr = cos(radius), delta = 6 * radians, smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon;
17676 function interpolate(from, to, direction, stream) {
17677 circleStream(stream, radius, delta, direction, from, to);
17679 function visible(lambda, phi) {
17680 return cos(lambda) * cos(phi) > cr;
17682 function clipLine(stream) {
17683 var point0, c0, v0, v00, clean2;
17685 lineStart: function() {
17689 point: function(lambda, phi) {
17690 var point1 = [lambda, phi], point2, v2 = visible(lambda, phi), c2 = smallRadius ? v2 ? 0 : code(lambda, phi) : v2 ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;
17691 if (!point0 && (v00 = v0 = v2))
17692 stream.lineStart();
17694 point2 = intersect2(point0, point1);
17695 if (!point2 || pointEqual_default(point0, point2) || pointEqual_default(point1, point2))
17701 stream.lineStart();
17702 point2 = intersect2(point1, point0);
17703 stream.point(point2[0], point2[1]);
17705 point2 = intersect2(point0, point1);
17706 stream.point(point2[0], point2[1], 2);
17710 } else if (notHemisphere && point0 && smallRadius ^ v2) {
17712 if (!(c2 & c0) && (t2 = intersect2(point1, point0, true))) {
17715 stream.lineStart();
17716 stream.point(t2[0][0], t2[0][1]);
17717 stream.point(t2[1][0], t2[1][1]);
17720 stream.point(t2[1][0], t2[1][1]);
17722 stream.lineStart();
17723 stream.point(t2[0][0], t2[0][1], 3);
17727 if (v2 && (!point0 || !pointEqual_default(point0, point1))) {
17728 stream.point(point1[0], point1[1]);
17730 point0 = point1, v0 = v2, c0 = c2;
17732 lineEnd: function() {
17737 // Rejoin first and last segments if there were intersections and the first
17738 // and last points were visible.
17739 clean: function() {
17740 return clean2 | (v00 && v0) << 1;
17744 function intersect2(a2, b2, two) {
17745 var pa = cartesian(a2), pb = cartesian(b2);
17746 var n1 = [1, 0, 0], n22 = cartesianCross(pa, pb), n2n2 = cartesianDot(n22, n22), n1n2 = n22[0], determinant = n2n2 - n1n2 * n1n2;
17749 var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n22), A2 = cartesianScale(n1, c1), B2 = cartesianScale(n22, c2);
17750 cartesianAddInPlace(A2, B2);
17751 var u2 = n1xn2, w2 = cartesianDot(A2, u2), uu = cartesianDot(u2, u2), t2 = w2 * w2 - uu * (cartesianDot(A2, A2) - 1);
17754 var t3 = sqrt(t2), q2 = cartesianScale(u2, (-w2 - t3) / uu);
17755 cartesianAddInPlace(q2, A2);
17756 q2 = spherical(q2);
17759 var lambda04 = a2[0], lambda12 = b2[0], phi02 = a2[1], phi12 = b2[1], z2;
17760 if (lambda12 < lambda04)
17761 z2 = lambda04, lambda04 = lambda12, lambda12 = z2;
17762 var delta2 = lambda12 - lambda04, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
17763 if (!polar && phi12 < phi02)
17764 z2 = phi02, phi02 = phi12, phi12 = z2;
17765 if (meridian ? polar ? phi02 + phi12 > 0 ^ q2[1] < (abs(q2[0] - lambda04) < epsilon ? phi02 : phi12) : phi02 <= q2[1] && q2[1] <= phi12 : delta2 > pi ^ (lambda04 <= q2[0] && q2[0] <= lambda12)) {
17766 var q1 = cartesianScale(u2, (-w2 + t3) / uu);
17767 cartesianAddInPlace(q1, A2);
17768 return [q2, spherical(q1)];
17771 function code(lambda, phi) {
17772 var r2 = smallRadius ? radius : pi - radius, code2 = 0;
17775 else if (lambda > r2)
17783 return clip_default(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
17786 // node_modules/d3-geo/src/clip/line.js
17787 function line_default(a2, b2, x05, y05, x12, y12) {
17788 var ax = a2[0], ay = a2[1], bx = b2[0], by = b2[1], t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r2;
17798 } else if (dx > 0) {
17813 } else if (dx > 0) {
17828 } else if (dy > 0) {
17843 } else if (dy > 0) {
17850 a2[0] = ax + t0 * dx, a2[1] = ay + t0 * dy;
17852 b2[0] = ax + t1 * dx, b2[1] = ay + t1 * dy;
17856 // node_modules/d3-geo/src/clip/rectangle.js
17858 var clipMin = -clipMax;
17859 function clipRectangle(x05, y05, x12, y12) {
17860 function visible(x2, y2) {
17861 return x05 <= x2 && x2 <= x12 && y05 <= y2 && y2 <= y12;
17863 function interpolate(from, to, direction, stream) {
17864 var a2 = 0, a1 = 0;
17865 if (from == null || (a2 = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
17867 stream.point(a2 === 0 || a2 === 3 ? x05 : x12, a2 > 1 ? y12 : y05);
17868 while ((a2 = (a2 + direction + 4) % 4) !== a1);
17870 stream.point(to[0], to[1]);
17873 function corner(p2, direction) {
17874 return abs(p2[0] - x05) < epsilon ? direction > 0 ? 0 : 3 : abs(p2[0] - x12) < epsilon ? direction > 0 ? 2 : 1 : abs(p2[1] - y05) < epsilon ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
17876 function compareIntersection2(a2, b2) {
17877 return comparePoint(a2.x, b2.x);
17879 function comparePoint(a2, b2) {
17880 var ca = corner(a2, 1), cb = corner(b2, 1);
17881 return ca !== cb ? ca - cb : ca === 0 ? b2[1] - a2[1] : ca === 1 ? a2[0] - b2[0] : ca === 2 ? a2[1] - b2[1] : b2[0] - a2[0];
17883 return function(stream) {
17884 var activeStream = stream, bufferStream = buffer_default(), segments, polygon2, ring, x__, y__, v__, x_, y_, v_, first, clean2;
17892 function point2(x2, y2) {
17893 if (visible(x2, y2))
17894 activeStream.point(x2, y2);
17896 function polygonInside() {
17898 for (var i3 = 0, n3 = polygon2.length; i3 < n3; ++i3) {
17899 for (var ring2 = polygon2[i3], j3 = 1, m2 = ring2.length, point3 = ring2[0], a0, a1, b0 = point3[0], b1 = point3[1]; j3 < m2; ++j3) {
17900 a0 = b0, a1 = b1, point3 = ring2[j3], b0 = point3[0], b1 = point3[1];
17902 if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x05 - a0))
17905 if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x05 - a0))
17912 function polygonStart() {
17913 activeStream = bufferStream, segments = [], polygon2 = [], clean2 = true;
17915 function polygonEnd() {
17916 var startInside = polygonInside(), cleanInside = clean2 && startInside, visible2 = (segments = merge(segments)).length;
17917 if (cleanInside || visible2) {
17918 stream.polygonStart();
17920 stream.lineStart();
17921 interpolate(null, null, 1, stream);
17925 rejoin_default(segments, compareIntersection2, startInside, interpolate, stream);
17927 stream.polygonEnd();
17929 activeStream = stream, segments = polygon2 = ring = null;
17931 function lineStart() {
17932 clipStream.point = linePoint2;
17934 polygon2.push(ring = []);
17939 function lineEnd() {
17941 linePoint2(x__, y__);
17943 bufferStream.rejoin();
17944 segments.push(bufferStream.result());
17946 clipStream.point = point2;
17948 activeStream.lineEnd();
17950 function linePoint2(x2, y2) {
17951 var v2 = visible(x2, y2);
17953 ring.push([x2, y2]);
17955 x__ = x2, y__ = y2, v__ = v2;
17958 activeStream.lineStart();
17959 activeStream.point(x2, y2);
17963 activeStream.point(x2, y2);
17965 var a2 = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b2 = [x2 = Math.max(clipMin, Math.min(clipMax, x2)), y2 = Math.max(clipMin, Math.min(clipMax, y2))];
17966 if (line_default(a2, b2, x05, y05, x12, y12)) {
17968 activeStream.lineStart();
17969 activeStream.point(a2[0], a2[1]);
17971 activeStream.point(b2[0], b2[1]);
17973 activeStream.lineEnd();
17976 activeStream.lineStart();
17977 activeStream.point(x2, y2);
17982 x_ = x2, y_ = y2, v_ = v2;
17988 // node_modules/d3-geo/src/length.js
17993 var lengthStream = {
17996 lineStart: lengthLineStart,
17998 polygonStart: noop,
18001 function lengthLineStart() {
18002 lengthStream.point = lengthPointFirst;
18003 lengthStream.lineEnd = lengthLineEnd;
18005 function lengthLineEnd() {
18006 lengthStream.point = lengthStream.lineEnd = noop;
18008 function lengthPointFirst(lambda, phi) {
18009 lambda *= radians, phi *= radians;
18010 lambda03 = lambda, sinPhi02 = sin(phi), cosPhi02 = cos(phi);
18011 lengthStream.point = lengthPoint;
18013 function lengthPoint(lambda, phi) {
18014 lambda *= radians, phi *= radians;
18015 var sinPhi = sin(phi), cosPhi = cos(phi), delta = abs(lambda - lambda03), cosDelta = cos(delta), sinDelta = sin(delta), x2 = cosPhi * sinDelta, y2 = cosPhi02 * sinPhi - sinPhi02 * cosPhi * cosDelta, z2 = sinPhi02 * sinPhi + cosPhi02 * cosPhi * cosDelta;
18016 lengthSum.add(atan2(sqrt(x2 * x2 + y2 * y2), z2));
18017 lambda03 = lambda, sinPhi02 = sinPhi, cosPhi02 = cosPhi;
18019 function length_default(object) {
18020 lengthSum = new Adder();
18021 stream_default(object, lengthStream);
18025 // node_modules/d3-geo/src/identity.js
18026 var identity_default = (x2) => x2;
18028 // node_modules/d3-geo/src/path/area.js
18029 var areaSum2 = new Adder();
18030 var areaRingSum2 = new Adder();
18035 var areaStream2 = {
18039 polygonStart: function() {
18040 areaStream2.lineStart = areaRingStart2;
18041 areaStream2.lineEnd = areaRingEnd2;
18043 polygonEnd: function() {
18044 areaStream2.lineStart = areaStream2.lineEnd = areaStream2.point = noop;
18045 areaSum2.add(abs(areaRingSum2));
18046 areaRingSum2 = new Adder();
18048 result: function() {
18049 var area = areaSum2 / 2;
18050 areaSum2 = new Adder();
18054 function areaRingStart2() {
18055 areaStream2.point = areaPointFirst2;
18057 function areaPointFirst2(x2, y2) {
18058 areaStream2.point = areaPoint2;
18059 x00 = x0 = x2, y00 = y0 = y2;
18061 function areaPoint2(x2, y2) {
18062 areaRingSum2.add(y0 * x2 - x0 * y2);
18065 function areaRingEnd2() {
18066 areaPoint2(x00, y00);
18068 var area_default2 = areaStream2;
18070 // node_modules/d3-geo/src/path/bounds.js
18071 var x02 = Infinity;
18075 var boundsStream2 = {
18076 point: boundsPoint2,
18079 polygonStart: noop,
18081 result: function() {
18082 var bounds = [[x02, y02], [x1, y1]];
18083 x1 = y1 = -(y02 = x02 = Infinity);
18087 function boundsPoint2(x2, y2) {
18097 var bounds_default2 = boundsStream2;
18099 // node_modules/d3-geo/src/path/centroid.js
18113 var centroidStream = {
18114 point: centroidPoint,
18115 lineStart: centroidLineStart,
18116 lineEnd: centroidLineEnd,
18117 polygonStart: function() {
18118 centroidStream.lineStart = centroidRingStart;
18119 centroidStream.lineEnd = centroidRingEnd;
18121 polygonEnd: function() {
18122 centroidStream.point = centroidPoint;
18123 centroidStream.lineStart = centroidLineStart;
18124 centroidStream.lineEnd = centroidLineEnd;
18126 result: function() {
18127 var centroid = Z2 ? [X2 / Z2, Y2 / Z2] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN];
18128 X0 = Y0 = Z0 = X1 = Y1 = Z1 = X2 = Y2 = Z2 = 0;
18132 function centroidPoint(x2, y2) {
18137 function centroidLineStart() {
18138 centroidStream.point = centroidPointFirstLine;
18140 function centroidPointFirstLine(x2, y2) {
18141 centroidStream.point = centroidPointLine;
18142 centroidPoint(x03 = x2, y03 = y2);
18144 function centroidPointLine(x2, y2) {
18145 var dx = x2 - x03, dy = y2 - y03, z2 = sqrt(dx * dx + dy * dy);
18146 X1 += z2 * (x03 + x2) / 2;
18147 Y1 += z2 * (y03 + y2) / 2;
18149 centroidPoint(x03 = x2, y03 = y2);
18151 function centroidLineEnd() {
18152 centroidStream.point = centroidPoint;
18154 function centroidRingStart() {
18155 centroidStream.point = centroidPointFirstRing;
18157 function centroidRingEnd() {
18158 centroidPointRing(x002, y002);
18160 function centroidPointFirstRing(x2, y2) {
18161 centroidStream.point = centroidPointRing;
18162 centroidPoint(x002 = x03 = x2, y002 = y03 = y2);
18164 function centroidPointRing(x2, y2) {
18165 var dx = x2 - x03, dy = y2 - y03, z2 = sqrt(dx * dx + dy * dy);
18166 X1 += z2 * (x03 + x2) / 2;
18167 Y1 += z2 * (y03 + y2) / 2;
18169 z2 = y03 * x2 - x03 * y2;
18170 X2 += z2 * (x03 + x2);
18171 Y2 += z2 * (y03 + y2);
18173 centroidPoint(x03 = x2, y03 = y2);
18175 var centroid_default = centroidStream;
18177 // node_modules/d3-geo/src/path/context.js
18178 function PathContext(context) {
18179 this._context = context;
18181 PathContext.prototype = {
18183 pointRadius: function(_2) {
18184 return this._radius = _2, this;
18186 polygonStart: function() {
18189 polygonEnd: function() {
18192 lineStart: function() {
18195 lineEnd: function() {
18196 if (this._line === 0)
18197 this._context.closePath();
18200 point: function(x2, y2) {
18201 switch (this._point) {
18203 this._context.moveTo(x2, y2);
18208 this._context.lineTo(x2, y2);
18212 this._context.moveTo(x2 + this._radius, y2);
18213 this._context.arc(x2, y2, this._radius, 0, tau);
18221 // node_modules/d3-geo/src/path/measure.js
18222 var lengthSum2 = new Adder();
18228 var lengthStream2 = {
18230 lineStart: function() {
18231 lengthStream2.point = lengthPointFirst2;
18233 lineEnd: function() {
18235 lengthPoint2(x003, y003);
18236 lengthStream2.point = noop;
18238 polygonStart: function() {
18241 polygonEnd: function() {
18244 result: function() {
18245 var length = +lengthSum2;
18246 lengthSum2 = new Adder();
18250 function lengthPointFirst2(x2, y2) {
18251 lengthStream2.point = lengthPoint2;
18252 x003 = x04 = x2, y003 = y04 = y2;
18254 function lengthPoint2(x2, y2) {
18255 x04 -= x2, y04 -= y2;
18256 lengthSum2.add(sqrt(x04 * x04 + y04 * y04));
18257 x04 = x2, y04 = y2;
18259 var measure_default = lengthStream2;
18261 // node_modules/d3-geo/src/path/string.js
18262 function PathString() {
18265 PathString.prototype = {
18267 _circle: circle(4.5),
18268 pointRadius: function(_2) {
18269 if ((_2 = +_2) !== this._radius)
18270 this._radius = _2, this._circle = null;
18273 polygonStart: function() {
18276 polygonEnd: function() {
18279 lineStart: function() {
18282 lineEnd: function() {
18283 if (this._line === 0)
18284 this._string.push("Z");
18287 point: function(x2, y2) {
18288 switch (this._point) {
18290 this._string.push("M", x2, ",", y2);
18295 this._string.push("L", x2, ",", y2);
18299 if (this._circle == null)
18300 this._circle = circle(this._radius);
18301 this._string.push("M", x2, ",", y2, this._circle);
18306 result: function() {
18307 if (this._string.length) {
18308 var result = this._string.join("");
18316 function circle(radius) {
18317 return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
18320 // node_modules/d3-geo/src/path/index.js
18321 function path_default(projection2, context) {
18322 var pointRadius = 4.5, projectionStream, contextStream;
18323 function path(object) {
18325 if (typeof pointRadius === "function")
18326 contextStream.pointRadius(+pointRadius.apply(this, arguments));
18327 stream_default(object, projectionStream(contextStream));
18329 return contextStream.result();
18331 path.area = function(object) {
18332 stream_default(object, projectionStream(area_default2));
18333 return area_default2.result();
18335 path.measure = function(object) {
18336 stream_default(object, projectionStream(measure_default));
18337 return measure_default.result();
18339 path.bounds = function(object) {
18340 stream_default(object, projectionStream(bounds_default2));
18341 return bounds_default2.result();
18343 path.centroid = function(object) {
18344 stream_default(object, projectionStream(centroid_default));
18345 return centroid_default.result();
18347 path.projection = function(_2) {
18348 return arguments.length ? (projectionStream = _2 == null ? (projection2 = null, identity_default) : (projection2 = _2).stream, path) : projection2;
18350 path.context = function(_2) {
18351 if (!arguments.length)
18353 contextStream = _2 == null ? (context = null, new PathString()) : new PathContext(context = _2);
18354 if (typeof pointRadius !== "function")
18355 contextStream.pointRadius(pointRadius);
18358 path.pointRadius = function(_2) {
18359 if (!arguments.length)
18360 return pointRadius;
18361 pointRadius = typeof _2 === "function" ? _2 : (contextStream.pointRadius(+_2), +_2);
18364 return path.projection(projection2).context(context);
18367 // node_modules/d3-geo/src/transform.js
18368 function transform_default(methods2) {
18370 stream: transformer(methods2)
18373 function transformer(methods2) {
18374 return function(stream) {
18375 var s2 = new TransformStream();
18376 for (var key in methods2)
18377 s2[key] = methods2[key];
18378 s2.stream = stream;
18382 function TransformStream() {
18384 TransformStream.prototype = {
18385 constructor: TransformStream,
18386 point: function(x2, y2) {
18387 this.stream.point(x2, y2);
18389 sphere: function() {
18390 this.stream.sphere();
18392 lineStart: function() {
18393 this.stream.lineStart();
18395 lineEnd: function() {
18396 this.stream.lineEnd();
18398 polygonStart: function() {
18399 this.stream.polygonStart();
18401 polygonEnd: function() {
18402 this.stream.polygonEnd();
18406 // node_modules/d3-geo/src/projection/fit.js
18407 function fit(projection2, fitBounds, object) {
18408 var clip = projection2.clipExtent && projection2.clipExtent();
18409 projection2.scale(150).translate([0, 0]);
18411 projection2.clipExtent(null);
18412 stream_default(object, projection2.stream(bounds_default2));
18413 fitBounds(bounds_default2.result());
18415 projection2.clipExtent(clip);
18416 return projection2;
18418 function fitExtent(projection2, extent, object) {
18419 return fit(projection2, function(b2) {
18420 var w2 = extent[1][0] - extent[0][0], h2 = extent[1][1] - extent[0][1], k2 = Math.min(w2 / (b2[1][0] - b2[0][0]), h2 / (b2[1][1] - b2[0][1])), x2 = +extent[0][0] + (w2 - k2 * (b2[1][0] + b2[0][0])) / 2, y2 = +extent[0][1] + (h2 - k2 * (b2[1][1] + b2[0][1])) / 2;
18421 projection2.scale(150 * k2).translate([x2, y2]);
18424 function fitSize(projection2, size, object) {
18425 return fitExtent(projection2, [[0, 0], size], object);
18427 function fitWidth(projection2, width, object) {
18428 return fit(projection2, function(b2) {
18429 var w2 = +width, k2 = w2 / (b2[1][0] - b2[0][0]), x2 = (w2 - k2 * (b2[1][0] + b2[0][0])) / 2, y2 = -k2 * b2[0][1];
18430 projection2.scale(150 * k2).translate([x2, y2]);
18433 function fitHeight(projection2, height, object) {
18434 return fit(projection2, function(b2) {
18435 var h2 = +height, k2 = h2 / (b2[1][1] - b2[0][1]), x2 = -k2 * b2[0][0], y2 = (h2 - k2 * (b2[1][1] + b2[0][1])) / 2;
18436 projection2.scale(150 * k2).translate([x2, y2]);
18440 // node_modules/d3-geo/src/projection/resample.js
18442 var cosMinDistance = cos(30 * radians);
18443 function resample_default(project, delta2) {
18444 return +delta2 ? resample(project, delta2) : resampleNone(project);
18446 function resampleNone(project) {
18447 return transformer({
18448 point: function(x2, y2) {
18449 x2 = project(x2, y2);
18450 this.stream.point(x2[0], x2[1]);
18454 function resample(project, delta2) {
18455 function resampleLineTo(x05, y05, lambda04, a0, b0, c0, x12, y12, lambda12, a1, b1, c1, depth, stream) {
18456 var dx = x12 - x05, dy = y12 - y05, d2 = dx * dx + dy * dy;
18457 if (d2 > 4 * delta2 && depth--) {
18458 var a2 = a0 + a1, b2 = b0 + b1, c2 = c0 + c1, m2 = sqrt(a2 * a2 + b2 * b2 + c2 * c2), phi2 = asin(c2 /= m2), lambda22 = abs(abs(c2) - 1) < epsilon || abs(lambda04 - lambda12) < epsilon ? (lambda04 + lambda12) / 2 : atan2(b2, a2), p2 = project(lambda22, phi2), x2 = p2[0], y2 = p2[1], dx2 = x2 - x05, dy2 = y2 - y05, dz = dy * dx2 - dx * dy2;
18459 if (dz * dz / d2 > delta2 || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
18460 resampleLineTo(x05, y05, lambda04, a0, b0, c0, x2, y2, lambda22, a2 /= m2, b2 /= m2, c2, depth, stream);
18461 stream.point(x2, y2);
18462 resampleLineTo(x2, y2, lambda22, a2, b2, c2, x12, y12, lambda12, a1, b1, c1, depth, stream);
18466 return function(stream) {
18467 var lambda003, x004, y004, a00, b00, c00, lambda04, x05, y05, a0, b0, c0;
18468 var resampleStream = {
18472 polygonStart: function() {
18473 stream.polygonStart();
18474 resampleStream.lineStart = ringStart;
18476 polygonEnd: function() {
18477 stream.polygonEnd();
18478 resampleStream.lineStart = lineStart;
18481 function point2(x2, y2) {
18482 x2 = project(x2, y2);
18483 stream.point(x2[0], x2[1]);
18485 function lineStart() {
18487 resampleStream.point = linePoint2;
18488 stream.lineStart();
18490 function linePoint2(lambda, phi) {
18491 var c2 = cartesian([lambda, phi]), p2 = project(lambda, phi);
18492 resampleLineTo(x05, y05, lambda04, a0, b0, c0, x05 = p2[0], y05 = p2[1], lambda04 = lambda, a0 = c2[0], b0 = c2[1], c0 = c2[2], maxDepth, stream);
18493 stream.point(x05, y05);
18495 function lineEnd() {
18496 resampleStream.point = point2;
18499 function ringStart() {
18501 resampleStream.point = ringPoint;
18502 resampleStream.lineEnd = ringEnd;
18504 function ringPoint(lambda, phi) {
18505 linePoint2(lambda003 = lambda, phi), x004 = x05, y004 = y05, a00 = a0, b00 = b0, c00 = c0;
18506 resampleStream.point = linePoint2;
18508 function ringEnd() {
18509 resampleLineTo(x05, y05, lambda04, a0, b0, c0, x004, y004, lambda003, a00, b00, c00, maxDepth, stream);
18510 resampleStream.lineEnd = lineEnd;
18513 return resampleStream;
18517 // node_modules/d3-geo/src/projection/index.js
18518 var transformRadians = transformer({
18519 point: function(x2, y2) {
18520 this.stream.point(x2 * radians, y2 * radians);
18523 function transformRotate(rotate) {
18524 return transformer({
18525 point: function(x2, y2) {
18526 var r2 = rotate(x2, y2);
18527 return this.stream.point(r2[0], r2[1]);
18531 function scaleTranslate(k2, dx, dy, sx, sy) {
18532 function transform2(x2, y2) {
18535 return [dx + k2 * x2, dy - k2 * y2];
18537 transform2.invert = function(x2, y2) {
18538 return [(x2 - dx) / k2 * sx, (dy - y2) / k2 * sy];
18542 function scaleTranslateRotate(k2, dx, dy, sx, sy, alpha) {
18544 return scaleTranslate(k2, dx, dy, sx, sy);
18545 var cosAlpha = cos(alpha), sinAlpha = sin(alpha), a2 = cosAlpha * k2, b2 = sinAlpha * k2, ai = cosAlpha / k2, bi = sinAlpha / k2, ci = (sinAlpha * dy - cosAlpha * dx) / k2, fi = (sinAlpha * dx + cosAlpha * dy) / k2;
18546 function transform2(x2, y2) {
18549 return [a2 * x2 - b2 * y2 + dx, dy - b2 * x2 - a2 * y2];
18551 transform2.invert = function(x2, y2) {
18552 return [sx * (ai * x2 - bi * y2 + ci), sy * (fi - bi * x2 - ai * y2)];
18556 function projection(project) {
18557 return projectionMutator(function() {
18561 function projectionMutator(projectAt) {
18562 var project, k2 = 150, x2 = 480, y2 = 250, lambda = 0, phi = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, alpha = 0, sx = 1, sy = 1, theta = null, preclip = antimeridian_default, x05 = null, y05, x12, y12, postclip = identity_default, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache, cacheStream;
18563 function projection2(point2) {
18564 return projectRotateTransform(point2[0] * radians, point2[1] * radians);
18566 function invert(point2) {
18567 point2 = projectRotateTransform.invert(point2[0], point2[1]);
18568 return point2 && [point2[0] * degrees, point2[1] * degrees];
18570 projection2.stream = function(stream) {
18571 return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
18573 projection2.preclip = function(_2) {
18574 return arguments.length ? (preclip = _2, theta = void 0, reset()) : preclip;
18576 projection2.postclip = function(_2) {
18577 return arguments.length ? (postclip = _2, x05 = y05 = x12 = y12 = null, reset()) : postclip;
18579 projection2.clipAngle = function(_2) {
18580 return arguments.length ? (preclip = +_2 ? circle_default(theta = _2 * radians) : (theta = null, antimeridian_default), reset()) : theta * degrees;
18582 projection2.clipExtent = function(_2) {
18583 return arguments.length ? (postclip = _2 == null ? (x05 = y05 = x12 = y12 = null, identity_default) : clipRectangle(x05 = +_2[0][0], y05 = +_2[0][1], x12 = +_2[1][0], y12 = +_2[1][1]), reset()) : x05 == null ? null : [[x05, y05], [x12, y12]];
18585 projection2.scale = function(_2) {
18586 return arguments.length ? (k2 = +_2, recenter()) : k2;
18588 projection2.translate = function(_2) {
18589 return arguments.length ? (x2 = +_2[0], y2 = +_2[1], recenter()) : [x2, y2];
18591 projection2.center = function(_2) {
18592 return arguments.length ? (lambda = _2[0] % 360 * radians, phi = _2[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
18594 projection2.rotate = function(_2) {
18595 return arguments.length ? (deltaLambda = _2[0] % 360 * radians, deltaPhi = _2[1] % 360 * radians, deltaGamma = _2.length > 2 ? _2[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
18597 projection2.angle = function(_2) {
18598 return arguments.length ? (alpha = _2 % 360 * radians, recenter()) : alpha * degrees;
18600 projection2.reflectX = function(_2) {
18601 return arguments.length ? (sx = _2 ? -1 : 1, recenter()) : sx < 0;
18603 projection2.reflectY = function(_2) {
18604 return arguments.length ? (sy = _2 ? -1 : 1, recenter()) : sy < 0;
18606 projection2.precision = function(_2) {
18607 return arguments.length ? (projectResample = resample_default(projectTransform, delta2 = _2 * _2), reset()) : sqrt(delta2);
18609 projection2.fitExtent = function(extent, object) {
18610 return fitExtent(projection2, extent, object);
18612 projection2.fitSize = function(size, object) {
18613 return fitSize(projection2, size, object);
18615 projection2.fitWidth = function(width, object) {
18616 return fitWidth(projection2, width, object);
18618 projection2.fitHeight = function(height, object) {
18619 return fitHeight(projection2, height, object);
18621 function recenter() {
18622 var center = scaleTranslateRotate(k2, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), transform2 = scaleTranslateRotate(k2, x2 - center[0], y2 - center[1], sx, sy, alpha);
18623 rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
18624 projectTransform = compose_default(project, transform2);
18625 projectRotateTransform = compose_default(rotate, projectTransform);
18626 projectResample = resample_default(projectTransform, delta2);
18630 cache = cacheStream = null;
18631 return projection2;
18633 return function() {
18634 project = projectAt.apply(this, arguments);
18635 projection2.invert = project.invert && invert;
18640 // node_modules/d3-geo/src/projection/mercator.js
18641 function mercatorRaw(lambda, phi) {
18642 return [lambda, log(tan((halfPi + phi) / 2))];
18644 mercatorRaw.invert = function(x2, y2) {
18645 return [x2, 2 * atan(exp(y2)) - halfPi];
18647 function mercator_default() {
18648 return mercatorProjection(mercatorRaw).scale(961 / tau);
18650 function mercatorProjection(project) {
18651 var m2 = projection(project), center = m2.center, scale = m2.scale, translate = m2.translate, clipExtent = m2.clipExtent, x05 = null, y05, x12, y12;
18652 m2.scale = function(_2) {
18653 return arguments.length ? (scale(_2), reclip()) : scale();
18655 m2.translate = function(_2) {
18656 return arguments.length ? (translate(_2), reclip()) : translate();
18658 m2.center = function(_2) {
18659 return arguments.length ? (center(_2), reclip()) : center();
18661 m2.clipExtent = function(_2) {
18662 return arguments.length ? (_2 == null ? x05 = y05 = x12 = y12 = null : (x05 = +_2[0][0], y05 = +_2[0][1], x12 = +_2[1][0], y12 = +_2[1][1]), reclip()) : x05 == null ? null : [[x05, y05], [x12, y12]];
18664 function reclip() {
18665 var k2 = pi * scale(), t2 = m2(rotation_default(m2.rotate()).invert([0, 0]));
18666 return clipExtent(x05 == null ? [[t2[0] - k2, t2[1] - k2], [t2[0] + k2, t2[1] + k2]] : project === mercatorRaw ? [[Math.max(t2[0] - k2, x05), y05], [Math.min(t2[0] + k2, x12), y12]] : [[x05, Math.max(t2[1] - k2, y05)], [x12, Math.min(t2[1] + k2, y12)]]);
18671 // node_modules/d3-geo/src/projection/identity.js
18672 function identity_default2() {
18673 var k2 = 1, tx = 0, ty = 0, sx = 1, sy = 1, alpha = 0, ca, sa, x05 = null, y05, x12, y12, kx = 1, ky = 1, transform2 = transformer({
18674 point: function(x2, y2) {
18675 var p2 = projection2([x2, y2]);
18676 this.stream.point(p2[0], p2[1]);
18678 }), postclip = identity_default, cache, cacheStream;
18682 cache = cacheStream = null;
18683 return projection2;
18685 function projection2(p2) {
18686 var x2 = p2[0] * kx, y2 = p2[1] * ky;
18688 var t2 = y2 * ca - x2 * sa;
18689 x2 = x2 * ca + y2 * sa;
18692 return [x2 + tx, y2 + ty];
18694 projection2.invert = function(p2) {
18695 var x2 = p2[0] - tx, y2 = p2[1] - ty;
18697 var t2 = y2 * ca + x2 * sa;
18698 x2 = x2 * ca - y2 * sa;
18701 return [x2 / kx, y2 / ky];
18703 projection2.stream = function(stream) {
18704 return cache && cacheStream === stream ? cache : cache = transform2(postclip(cacheStream = stream));
18706 projection2.postclip = function(_2) {
18707 return arguments.length ? (postclip = _2, x05 = y05 = x12 = y12 = null, reset()) : postclip;
18709 projection2.clipExtent = function(_2) {
18710 return arguments.length ? (postclip = _2 == null ? (x05 = y05 = x12 = y12 = null, identity_default) : clipRectangle(x05 = +_2[0][0], y05 = +_2[0][1], x12 = +_2[1][0], y12 = +_2[1][1]), reset()) : x05 == null ? null : [[x05, y05], [x12, y12]];
18712 projection2.scale = function(_2) {
18713 return arguments.length ? (k2 = +_2, reset()) : k2;
18715 projection2.translate = function(_2) {
18716 return arguments.length ? (tx = +_2[0], ty = +_2[1], reset()) : [tx, ty];
18718 projection2.angle = function(_2) {
18719 return arguments.length ? (alpha = _2 % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;
18721 projection2.reflectX = function(_2) {
18722 return arguments.length ? (sx = _2 ? -1 : 1, reset()) : sx < 0;
18724 projection2.reflectY = function(_2) {
18725 return arguments.length ? (sy = _2 ? -1 : 1, reset()) : sy < 0;
18727 projection2.fitExtent = function(extent, object) {
18728 return fitExtent(projection2, extent, object);
18730 projection2.fitSize = function(size, object) {
18731 return fitSize(projection2, size, object);
18733 projection2.fitWidth = function(width, object) {
18734 return fitWidth(projection2, width, object);
18736 projection2.fitHeight = function(height, object) {
18737 return fitHeight(projection2, height, object);
18739 return projection2;
18742 // modules/geo/geo.js
18743 var TAU = 2 * Math.PI;
18744 var EQUATORIAL_RADIUS = 6378137;
18745 var POLAR_RADIUS = 63567523e-1;
18746 function geoLatToMeters(dLat) {
18747 return dLat * (TAU * POLAR_RADIUS / 360);
18749 function geoLonToMeters(dLon, atLat) {
18750 return Math.abs(atLat) >= 90 ? 0 : dLon * (TAU * EQUATORIAL_RADIUS / 360) * Math.abs(Math.cos(atLat * (Math.PI / 180)));
18752 function geoMetersToLat(m2) {
18753 return m2 / (TAU * POLAR_RADIUS / 360);
18755 function geoMetersToLon(m2, atLat) {
18756 return Math.abs(atLat) >= 90 ? 0 : m2 / (TAU * EQUATORIAL_RADIUS / 360) / Math.abs(Math.cos(atLat * (Math.PI / 180)));
18758 function geoMetersToOffset(meters, tileSize) {
18759 tileSize = tileSize || 256;
18761 meters[0] * tileSize / (TAU * EQUATORIAL_RADIUS),
18762 -meters[1] * tileSize / (TAU * POLAR_RADIUS)
18765 function geoOffsetToMeters(offset, tileSize) {
18766 tileSize = tileSize || 256;
18768 offset[0] * TAU * EQUATORIAL_RADIUS / tileSize,
18769 -offset[1] * TAU * POLAR_RADIUS / tileSize
18772 function geoSphericalDistance(a2, b2) {
18773 var x2 = geoLonToMeters(a2[0] - b2[0], (a2[1] + b2[1]) / 2);
18774 var y2 = geoLatToMeters(a2[1] - b2[1]);
18775 return Math.sqrt(x2 * x2 + y2 * y2);
18777 function geoScaleToZoom(k2, tileSize) {
18778 tileSize = tileSize || 256;
18779 var log2ts = Math.log(tileSize) * Math.LOG2E;
18780 return Math.log(k2 * TAU) / Math.LN2 - log2ts;
18782 function geoZoomToScale(z2, tileSize) {
18783 tileSize = tileSize || 256;
18784 return tileSize * Math.pow(2, z2) / TAU;
18786 function geoSphericalClosestNode(nodes, point2) {
18787 var minDistance = Infinity, distance;
18789 for (var i3 in nodes) {
18790 distance = geoSphericalDistance(nodes[i3].loc, point2);
18791 if (distance < minDistance) {
18792 minDistance = distance;
18796 if (indexOfMin !== void 0) {
18797 return { index: indexOfMin, distance: minDistance, node: nodes[indexOfMin] };
18803 // modules/geo/extent.js
18804 function geoExtent(min3, max3) {
18805 if (!(this instanceof geoExtent)) {
18806 return new geoExtent(min3, max3);
18807 } else if (min3 instanceof geoExtent) {
18809 } else if (min3 && min3.length === 2 && min3[0].length === 2 && min3[1].length === 2) {
18813 this[0] = min3 || [Infinity, Infinity];
18814 this[1] = max3 || min3 || [-Infinity, -Infinity];
18817 geoExtent.prototype = new Array(2);
18818 Object.assign(geoExtent.prototype, {
18819 equals: function(obj) {
18820 return this[0][0] === obj[0][0] && this[0][1] === obj[0][1] && this[1][0] === obj[1][0] && this[1][1] === obj[1][1];
18822 extend: function(obj) {
18823 if (!(obj instanceof geoExtent))
18824 obj = new geoExtent(obj);
18826 [Math.min(obj[0][0], this[0][0]), Math.min(obj[0][1], this[0][1])],
18827 [Math.max(obj[1][0], this[1][0]), Math.max(obj[1][1], this[1][1])]
18830 _extend: function(extent) {
18831 this[0][0] = Math.min(extent[0][0], this[0][0]);
18832 this[0][1] = Math.min(extent[0][1], this[0][1]);
18833 this[1][0] = Math.max(extent[1][0], this[1][0]);
18834 this[1][1] = Math.max(extent[1][1], this[1][1]);
18837 return Math.abs((this[1][0] - this[0][0]) * (this[1][1] - this[0][1]));
18839 center: function() {
18840 return [(this[0][0] + this[1][0]) / 2, (this[0][1] + this[1][1]) / 2];
18842 rectangle: function() {
18843 return [this[0][0], this[0][1], this[1][0], this[1][1]];
18846 return { minX: this[0][0], minY: this[0][1], maxX: this[1][0], maxY: this[1][1] };
18848 polygon: function() {
18850 [this[0][0], this[0][1]],
18851 [this[0][0], this[1][1]],
18852 [this[1][0], this[1][1]],
18853 [this[1][0], this[0][1]],
18854 [this[0][0], this[0][1]]
18857 contains: function(obj) {
18858 if (!(obj instanceof geoExtent))
18859 obj = new geoExtent(obj);
18860 return obj[0][0] >= this[0][0] && obj[0][1] >= this[0][1] && obj[1][0] <= this[1][0] && obj[1][1] <= this[1][1];
18862 intersects: function(obj) {
18863 if (!(obj instanceof geoExtent))
18864 obj = new geoExtent(obj);
18865 return obj[0][0] <= this[1][0] && obj[0][1] <= this[1][1] && obj[1][0] >= this[0][0] && obj[1][1] >= this[0][1];
18867 intersection: function(obj) {
18868 if (!this.intersects(obj))
18869 return new geoExtent();
18870 return new geoExtent(
18871 [Math.max(obj[0][0], this[0][0]), Math.max(obj[0][1], this[0][1])],
18872 [Math.min(obj[1][0], this[1][0]), Math.min(obj[1][1], this[1][1])]
18875 percentContainedIn: function(obj) {
18876 if (!(obj instanceof geoExtent))
18877 obj = new geoExtent(obj);
18878 var a1 = this.intersection(obj).area();
18879 var a2 = this.area();
18880 if (a1 === Infinity || a2 === Infinity) {
18882 } else if (a1 === 0 || a2 === 0) {
18883 if (obj.contains(this)) {
18891 padByMeters: function(meters) {
18892 var dLat = geoMetersToLat(meters);
18893 var dLon = geoMetersToLon(meters, this.center()[1]);
18895 [this[0][0] - dLon, this[0][1] - dLat],
18896 [this[1][0] + dLon, this[1][1] + dLat]
18899 toParam: function() {
18900 return this.rectangle().join(",");
18904 // node_modules/d3-polygon/src/area.js
18905 function area_default3(polygon2) {
18906 var i3 = -1, n3 = polygon2.length, a2, b2 = polygon2[n3 - 1], area = 0;
18907 while (++i3 < n3) {
18910 area += a2[1] * b2[0] - a2[0] * b2[1];
18915 // node_modules/d3-polygon/src/centroid.js
18916 function centroid_default2(polygon2) {
18917 var i3 = -1, n3 = polygon2.length, x2 = 0, y2 = 0, a2, b2 = polygon2[n3 - 1], c2, k2 = 0;
18918 while (++i3 < n3) {
18921 k2 += c2 = a2[0] * b2[1] - b2[0] * a2[1];
18922 x2 += (a2[0] + b2[0]) * c2;
18923 y2 += (a2[1] + b2[1]) * c2;
18925 return k2 *= 3, [x2 / k2, y2 / k2];
18928 // node_modules/d3-polygon/src/cross.js
18929 function cross_default(a2, b2, c2) {
18930 return (b2[0] - a2[0]) * (c2[1] - a2[1]) - (b2[1] - a2[1]) * (c2[0] - a2[0]);
18933 // node_modules/d3-polygon/src/hull.js
18934 function lexicographicOrder(a2, b2) {
18935 return a2[0] - b2[0] || a2[1] - b2[1];
18937 function computeUpperHullIndexes(points) {
18938 const n3 = points.length, indexes = [0, 1];
18940 for (i3 = 2; i3 < n3; ++i3) {
18941 while (size > 1 && cross_default(points[indexes[size - 2]], points[indexes[size - 1]], points[i3]) <= 0)
18943 indexes[size++] = i3;
18945 return indexes.slice(0, size);
18947 function hull_default(points) {
18948 if ((n3 = points.length) < 3)
18950 var i3, n3, sortedPoints = new Array(n3), flippedPoints = new Array(n3);
18951 for (i3 = 0; i3 < n3; ++i3)
18952 sortedPoints[i3] = [+points[i3][0], +points[i3][1], i3];
18953 sortedPoints.sort(lexicographicOrder);
18954 for (i3 = 0; i3 < n3; ++i3)
18955 flippedPoints[i3] = [sortedPoints[i3][0], -sortedPoints[i3][1]];
18956 var upperIndexes = computeUpperHullIndexes(sortedPoints), lowerIndexes = computeUpperHullIndexes(flippedPoints);
18957 var skipLeft = lowerIndexes[0] === upperIndexes[0], skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1], hull = [];
18958 for (i3 = upperIndexes.length - 1; i3 >= 0; --i3)
18959 hull.push(points[sortedPoints[upperIndexes[i3]][2]]);
18960 for (i3 = +skipLeft; i3 < lowerIndexes.length - skipRight; ++i3)
18961 hull.push(points[sortedPoints[lowerIndexes[i3]][2]]);
18965 // modules/geo/vector.js
18966 function geoVecEqual(a2, b2, epsilon3) {
18968 return Math.abs(a2[0] - b2[0]) <= epsilon3 && Math.abs(a2[1] - b2[1]) <= epsilon3;
18970 return a2[0] === b2[0] && a2[1] === b2[1];
18973 function geoVecAdd(a2, b2) {
18974 return [a2[0] + b2[0], a2[1] + b2[1]];
18976 function geoVecSubtract(a2, b2) {
18977 return [a2[0] - b2[0], a2[1] - b2[1]];
18979 function geoVecScale(a2, mag) {
18980 return [a2[0] * mag, a2[1] * mag];
18982 function geoVecFloor(a2) {
18983 return [Math.floor(a2[0]), Math.floor(a2[1])];
18985 function geoVecInterp(a2, b2, t2) {
18987 a2[0] + (b2[0] - a2[0]) * t2,
18988 a2[1] + (b2[1] - a2[1]) * t2
18991 function geoVecLength(a2, b2) {
18992 return Math.sqrt(geoVecLengthSquare(a2, b2));
18994 function geoVecLengthSquare(a2, b2) {
18996 var x2 = a2[0] - b2[0];
18997 var y2 = a2[1] - b2[1];
18998 return x2 * x2 + y2 * y2;
19000 function geoVecNormalize(a2) {
19001 var length = Math.sqrt(a2[0] * a2[0] + a2[1] * a2[1]);
19002 if (length !== 0) {
19003 return geoVecScale(a2, 1 / length);
19007 function geoVecAngle(a2, b2) {
19008 return Math.atan2(b2[1] - a2[1], b2[0] - a2[0]);
19010 function geoVecDot(a2, b2, origin) {
19011 origin = origin || [0, 0];
19012 var p2 = geoVecSubtract(a2, origin);
19013 var q2 = geoVecSubtract(b2, origin);
19014 return p2[0] * q2[0] + p2[1] * q2[1];
19016 function geoVecNormalizedDot(a2, b2, origin) {
19017 origin = origin || [0, 0];
19018 var p2 = geoVecNormalize(geoVecSubtract(a2, origin));
19019 var q2 = geoVecNormalize(geoVecSubtract(b2, origin));
19020 return geoVecDot(p2, q2);
19022 function geoVecCross(a2, b2, origin) {
19023 origin = origin || [0, 0];
19024 var p2 = geoVecSubtract(a2, origin);
19025 var q2 = geoVecSubtract(b2, origin);
19026 return p2[0] * q2[1] - p2[1] * q2[0];
19028 function geoVecProject(a2, points) {
19029 var min3 = Infinity;
19032 for (var i3 = 0; i3 < points.length - 1; i3++) {
19033 var o2 = points[i3];
19034 var s2 = geoVecSubtract(points[i3 + 1], o2);
19035 var v2 = geoVecSubtract(a2, o2);
19036 var proj = geoVecDot(v2, s2) / geoVecDot(s2, s2);
19040 } else if (proj > 1) {
19041 p2 = points[i3 + 1];
19043 p2 = [o2[0] + proj * s2[0], o2[1] + proj * s2[1]];
19045 var dist = geoVecLength(p2, a2);
19052 if (idx !== void 0) {
19053 return { index: idx, distance: min3, target };
19059 // modules/geo/geom.js
19060 function geoAngle(a2, b2, projection2) {
19061 return geoVecAngle(projection2(a2.loc), projection2(b2.loc));
19063 function geoEdgeEqual(a2, b2) {
19064 return a2[0] === b2[0] && a2[1] === b2[1] || a2[0] === b2[1] && a2[1] === b2[0];
19066 function geoRotate(points, angle2, around) {
19067 return points.map(function(point2) {
19068 var radial = geoVecSubtract(point2, around);
19070 radial[0] * Math.cos(angle2) - radial[1] * Math.sin(angle2) + around[0],
19071 radial[0] * Math.sin(angle2) + radial[1] * Math.cos(angle2) + around[1]
19075 function geoChooseEdge(nodes, point2, projection2, activeID) {
19076 var dist = geoVecLength;
19077 var points = nodes.map(function(n3) {
19078 return projection2(n3.loc);
19080 var ids = nodes.map(function(n3) {
19083 var min3 = Infinity;
19086 for (var i3 = 0; i3 < points.length - 1; i3++) {
19087 if (ids[i3] === activeID || ids[i3 + 1] === activeID)
19089 var o2 = points[i3];
19090 var s2 = geoVecSubtract(points[i3 + 1], o2);
19091 var v2 = geoVecSubtract(point2, o2);
19092 var proj = geoVecDot(v2, s2) / geoVecDot(s2, s2);
19096 } else if (proj > 1) {
19097 p2 = points[i3 + 1];
19099 p2 = [o2[0] + proj * s2[0], o2[1] + proj * s2[1]];
19101 var d2 = dist(p2, point2);
19105 loc = projection2.invert(p2);
19108 if (idx !== void 0) {
19109 return { index: idx, distance: min3, loc };
19114 function geoHasLineIntersections(activeNodes, inactiveNodes, activeID) {
19116 var inactives = [];
19117 var j3, k2, n1, n22, segment;
19118 for (j3 = 0; j3 < activeNodes.length - 1; j3++) {
19119 n1 = activeNodes[j3];
19120 n22 = activeNodes[j3 + 1];
19121 segment = [n1.loc, n22.loc];
19122 if (n1.id === activeID || n22.id === activeID) {
19123 actives.push(segment);
19126 for (j3 = 0; j3 < inactiveNodes.length - 1; j3++) {
19127 n1 = inactiveNodes[j3];
19128 n22 = inactiveNodes[j3 + 1];
19129 segment = [n1.loc, n22.loc];
19130 inactives.push(segment);
19132 for (j3 = 0; j3 < actives.length; j3++) {
19133 for (k2 = 0; k2 < inactives.length; k2++) {
19134 var p2 = actives[j3];
19135 var q2 = inactives[k2];
19136 var hit = geoLineIntersection(p2, q2);
19144 function geoHasSelfIntersections(nodes, activeID) {
19146 var inactives = [];
19148 for (j3 = 0; j3 < nodes.length - 1; j3++) {
19149 var n1 = nodes[j3];
19150 var n22 = nodes[j3 + 1];
19151 var segment = [n1.loc, n22.loc];
19152 if (n1.id === activeID || n22.id === activeID) {
19153 actives.push(segment);
19155 inactives.push(segment);
19158 for (j3 = 0; j3 < actives.length; j3++) {
19159 for (k2 = 0; k2 < inactives.length; k2++) {
19160 var p2 = actives[j3];
19161 var q2 = inactives[k2];
19162 if (geoVecEqual(p2[1], q2[0]) || geoVecEqual(p2[0], q2[1]) || geoVecEqual(p2[0], q2[0]) || geoVecEqual(p2[1], q2[1])) {
19165 var hit = geoLineIntersection(p2, q2);
19167 var epsilon3 = 1e-8;
19168 if (geoVecEqual(p2[1], hit, epsilon3) || geoVecEqual(p2[0], hit, epsilon3) || geoVecEqual(q2[1], hit, epsilon3) || geoVecEqual(q2[0], hit, epsilon3)) {
19178 function geoLineIntersection(a2, b2) {
19179 var p2 = [a2[0][0], a2[0][1]];
19180 var p22 = [a2[1][0], a2[1][1]];
19181 var q2 = [b2[0][0], b2[0][1]];
19182 var q22 = [b2[1][0], b2[1][1]];
19183 var r2 = geoVecSubtract(p22, p2);
19184 var s2 = geoVecSubtract(q22, q2);
19185 var uNumerator = geoVecCross(geoVecSubtract(q2, p2), r2);
19186 var denominator = geoVecCross(r2, s2);
19187 if (uNumerator && denominator) {
19188 var u2 = uNumerator / denominator;
19189 var t2 = geoVecCross(geoVecSubtract(q2, p2), s2) / denominator;
19190 if (t2 >= 0 && t2 <= 1 && u2 >= 0 && u2 <= 1) {
19191 return geoVecInterp(p2, p22, t2);
19196 function geoPathIntersections(path1, path2) {
19197 var intersections = [];
19198 for (var i3 = 0; i3 < path1.length - 1; i3++) {
19199 for (var j3 = 0; j3 < path2.length - 1; j3++) {
19200 var a2 = [path1[i3], path1[i3 + 1]];
19201 var b2 = [path2[j3], path2[j3 + 1]];
19202 var hit = geoLineIntersection(a2, b2);
19204 intersections.push(hit);
19208 return intersections;
19210 function geoPathHasIntersections(path1, path2) {
19211 for (var i3 = 0; i3 < path1.length - 1; i3++) {
19212 for (var j3 = 0; j3 < path2.length - 1; j3++) {
19213 var a2 = [path1[i3], path1[i3 + 1]];
19214 var b2 = [path2[j3], path2[j3 + 1]];
19215 var hit = geoLineIntersection(a2, b2);
19223 function geoPointInPolygon(point2, polygon2) {
19224 var x2 = point2[0];
19225 var y2 = point2[1];
19226 var inside = false;
19227 for (var i3 = 0, j3 = polygon2.length - 1; i3 < polygon2.length; j3 = i3++) {
19228 var xi = polygon2[i3][0];
19229 var yi = polygon2[i3][1];
19230 var xj = polygon2[j3][0];
19231 var yj = polygon2[j3][1];
19232 var intersect2 = yi > y2 !== yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
19238 function geoPolygonContainsPolygon(outer, inner) {
19239 return inner.every(function(point2) {
19240 return geoPointInPolygon(point2, outer);
19243 function geoPolygonIntersectsPolygon(outer, inner, checkSegments) {
19244 function testPoints(outer2, inner2) {
19245 return inner2.some(function(point2) {
19246 return geoPointInPolygon(point2, outer2);
19249 return testPoints(outer, inner) || !!checkSegments && geoPathHasIntersections(outer, inner);
19251 function geoGetSmallestSurroundingRectangle(points) {
19252 var hull = hull_default(points);
19253 var centroid = centroid_default2(hull);
19254 var minArea = Infinity;
19255 var ssrExtent = [];
19258 for (var i3 = 0; i3 <= hull.length - 1; i3++) {
19259 var c2 = i3 === hull.length - 1 ? hull[0] : hull[i3 + 1];
19260 var angle2 = Math.atan2(c2[1] - c1[1], c2[0] - c1[0]);
19261 var poly = geoRotate(hull, -angle2, centroid);
19262 var extent = poly.reduce(function(extent2, point2) {
19263 return extent2.extend(geoExtent(point2));
19265 var area = extent.area();
19266 if (area < minArea) {
19268 ssrExtent = extent;
19274 poly: geoRotate(ssrExtent.polygon(), ssrAngle, centroid),
19278 function geoPathLength(path) {
19280 for (var i3 = 0; i3 < path.length - 1; i3++) {
19281 length += geoVecLength(path[i3], path[i3 + 1]);
19285 function geoViewportEdge(point2, dimensions) {
19286 var pad2 = [80, 20, 50, 20];
19289 if (point2[0] > dimensions[0] - pad2[1]) {
19292 if (point2[0] < pad2[3]) {
19295 if (point2[1] > dimensions[1] - pad2[2]) {
19298 if (point2[1] < pad2[0]) {
19308 // node_modules/d3-dispatch/src/dispatch.js
19309 var noop2 = { value: () => {
19311 function dispatch() {
19312 for (var i3 = 0, n3 = arguments.length, _2 = {}, t2; i3 < n3; ++i3) {
19313 if (!(t2 = arguments[i3] + "") || t2 in _2 || /[\s.]/.test(t2))
19314 throw new Error("illegal type: " + t2);
19317 return new Dispatch(_2);
19319 function Dispatch(_2) {
19322 function parseTypenames(typenames, types) {
19323 return typenames.trim().split(/^|\s+/).map(function(t2) {
19324 var name = "", i3 = t2.indexOf(".");
19326 name = t2.slice(i3 + 1), t2 = t2.slice(0, i3);
19327 if (t2 && !types.hasOwnProperty(t2))
19328 throw new Error("unknown type: " + t2);
19329 return { type: t2, name };
19332 Dispatch.prototype = dispatch.prototype = {
19333 constructor: Dispatch,
19334 on: function(typename, callback) {
19335 var _2 = this._, T2 = parseTypenames(typename + "", _2), t2, i3 = -1, n3 = T2.length;
19336 if (arguments.length < 2) {
19338 if ((t2 = (typename = T2[i3]).type) && (t2 = get(_2[t2], typename.name)))
19342 if (callback != null && typeof callback !== "function")
19343 throw new Error("invalid callback: " + callback);
19344 while (++i3 < n3) {
19345 if (t2 = (typename = T2[i3]).type)
19346 _2[t2] = set(_2[t2], typename.name, callback);
19347 else if (callback == null)
19349 _2[t2] = set(_2[t2], typename.name, null);
19354 var copy2 = {}, _2 = this._;
19356 copy2[t2] = _2[t2].slice();
19357 return new Dispatch(copy2);
19359 call: function(type2, that) {
19360 if ((n3 = arguments.length - 2) > 0)
19361 for (var args = new Array(n3), i3 = 0, n3, t2; i3 < n3; ++i3)
19362 args[i3] = arguments[i3 + 2];
19363 if (!this._.hasOwnProperty(type2))
19364 throw new Error("unknown type: " + type2);
19365 for (t2 = this._[type2], i3 = 0, n3 = t2.length; i3 < n3; ++i3)
19366 t2[i3].value.apply(that, args);
19368 apply: function(type2, that, args) {
19369 if (!this._.hasOwnProperty(type2))
19370 throw new Error("unknown type: " + type2);
19371 for (var t2 = this._[type2], i3 = 0, n3 = t2.length; i3 < n3; ++i3)
19372 t2[i3].value.apply(that, args);
19375 function get(type2, name) {
19376 for (var i3 = 0, n3 = type2.length, c2; i3 < n3; ++i3) {
19377 if ((c2 = type2[i3]).name === name) {
19382 function set(type2, name, callback) {
19383 for (var i3 = 0, n3 = type2.length; i3 < n3; ++i3) {
19384 if (type2[i3].name === name) {
19385 type2[i3] = noop2, type2 = type2.slice(0, i3).concat(type2.slice(i3 + 1));
19389 if (callback != null)
19390 type2.push({ name, value: callback });
19393 var dispatch_default = dispatch;
19395 // node_modules/d3-selection/src/namespaces.js
19396 var xhtml = "http://www.w3.org/1999/xhtml";
19397 var namespaces_default = {
19398 svg: "http://www.w3.org/2000/svg",
19400 xlink: "http://www.w3.org/1999/xlink",
19401 xml: "http://www.w3.org/XML/1998/namespace",
19402 xmlns: "http://www.w3.org/2000/xmlns/"
19405 // node_modules/d3-selection/src/namespace.js
19406 function namespace_default(name) {
19407 var prefix = name += "", i3 = prefix.indexOf(":");
19408 if (i3 >= 0 && (prefix = name.slice(0, i3)) !== "xmlns")
19409 name = name.slice(i3 + 1);
19410 return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name;
19413 // node_modules/d3-selection/src/creator.js
19414 function creatorInherit(name) {
19415 return function() {
19416 var document2 = this.ownerDocument, uri = this.namespaceURI;
19417 return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
19420 function creatorFixed(fullname) {
19421 return function() {
19422 return this.ownerDocument.createElementNS(fullname.space, fullname.local);
19425 function creator_default(name) {
19426 var fullname = namespace_default(name);
19427 return (fullname.local ? creatorFixed : creatorInherit)(fullname);
19430 // node_modules/d3-selection/src/selector.js
19433 function selector_default(selector) {
19434 return selector == null ? none : function() {
19435 return this.querySelector(selector);
19439 // node_modules/d3-selection/src/selection/select.js
19440 function select_default(select) {
19441 if (typeof select !== "function")
19442 select = selector_default(select);
19443 for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j3 = 0; j3 < m2; ++j3) {
19444 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = new Array(n3), node, subnode, i3 = 0; i3 < n3; ++i3) {
19445 if ((node = group[i3]) && (subnode = select.call(node, node.__data__, i3, group))) {
19446 if ("__data__" in node)
19447 subnode.__data__ = node.__data__;
19448 subgroup[i3] = subnode;
19452 return new Selection(subgroups, this._parents);
19455 // node_modules/d3-selection/src/array.js
19456 function array(x2) {
19457 return x2 == null ? [] : Array.isArray(x2) ? x2 : Array.from(x2);
19460 // node_modules/d3-selection/src/selectorAll.js
19464 function selectorAll_default(selector) {
19465 return selector == null ? empty : function() {
19466 return this.querySelectorAll(selector);
19470 // node_modules/d3-selection/src/selection/selectAll.js
19471 function arrayAll(select) {
19472 return function() {
19473 return array(select.apply(this, arguments));
19476 function selectAll_default(select) {
19477 if (typeof select === "function")
19478 select = arrayAll(select);
19480 select = selectorAll_default(select);
19481 for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j3 = 0; j3 < m2; ++j3) {
19482 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
19483 if (node = group[i3]) {
19484 subgroups.push(select.call(node, node.__data__, i3, group));
19485 parents.push(node);
19489 return new Selection(subgroups, parents);
19492 // node_modules/d3-selection/src/matcher.js
19493 function matcher_default(selector) {
19494 return function() {
19495 return this.matches(selector);
19498 function childMatcher(selector) {
19499 return function(node) {
19500 return node.matches(selector);
19504 // node_modules/d3-selection/src/selection/selectChild.js
19505 var find = Array.prototype.find;
19506 function childFind(match) {
19507 return function() {
19508 return find.call(this.children, match);
19511 function childFirst() {
19512 return this.firstElementChild;
19514 function selectChild_default(match) {
19515 return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
19518 // node_modules/d3-selection/src/selection/selectChildren.js
19519 var filter = Array.prototype.filter;
19520 function children() {
19521 return Array.from(this.children);
19523 function childrenFilter(match) {
19524 return function() {
19525 return filter.call(this.children, match);
19528 function selectChildren_default(match) {
19529 return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
19532 // node_modules/d3-selection/src/selection/filter.js
19533 function filter_default(match) {
19534 if (typeof match !== "function")
19535 match = matcher_default(match);
19536 for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j3 = 0; j3 < m2; ++j3) {
19537 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = [], node, i3 = 0; i3 < n3; ++i3) {
19538 if ((node = group[i3]) && match.call(node, node.__data__, i3, group)) {
19539 subgroup.push(node);
19543 return new Selection(subgroups, this._parents);
19546 // node_modules/d3-selection/src/selection/sparse.js
19547 function sparse_default(update) {
19548 return new Array(update.length);
19551 // node_modules/d3-selection/src/selection/enter.js
19552 function enter_default() {
19553 return new Selection(this._enter || this._groups.map(sparse_default), this._parents);
19555 function EnterNode(parent, datum2) {
19556 this.ownerDocument = parent.ownerDocument;
19557 this.namespaceURI = parent.namespaceURI;
19559 this._parent = parent;
19560 this.__data__ = datum2;
19562 EnterNode.prototype = {
19563 constructor: EnterNode,
19564 appendChild: function(child) {
19565 return this._parent.insertBefore(child, this._next);
19567 insertBefore: function(child, next) {
19568 return this._parent.insertBefore(child, next);
19570 querySelector: function(selector) {
19571 return this._parent.querySelector(selector);
19573 querySelectorAll: function(selector) {
19574 return this._parent.querySelectorAll(selector);
19578 // node_modules/d3-selection/src/constant.js
19579 function constant_default(x2) {
19580 return function() {
19585 // node_modules/d3-selection/src/selection/data.js
19586 function bindIndex(parent, group, enter, update, exit, data) {
19587 var i3 = 0, node, groupLength = group.length, dataLength = data.length;
19588 for (; i3 < dataLength; ++i3) {
19589 if (node = group[i3]) {
19590 node.__data__ = data[i3];
19593 enter[i3] = new EnterNode(parent, data[i3]);
19596 for (; i3 < groupLength; ++i3) {
19597 if (node = group[i3]) {
19602 function bindKey(parent, group, enter, update, exit, data, key) {
19603 var i3, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
19604 for (i3 = 0; i3 < groupLength; ++i3) {
19605 if (node = group[i3]) {
19606 keyValues[i3] = keyValue = key.call(node, node.__data__, i3, group) + "";
19607 if (nodeByKeyValue.has(keyValue)) {
19610 nodeByKeyValue.set(keyValue, node);
19614 for (i3 = 0; i3 < dataLength; ++i3) {
19615 keyValue = key.call(parent, data[i3], i3, data) + "";
19616 if (node = nodeByKeyValue.get(keyValue)) {
19618 node.__data__ = data[i3];
19619 nodeByKeyValue.delete(keyValue);
19621 enter[i3] = new EnterNode(parent, data[i3]);
19624 for (i3 = 0; i3 < groupLength; ++i3) {
19625 if ((node = group[i3]) && nodeByKeyValue.get(keyValues[i3]) === node) {
19630 function datum(node) {
19631 return node.__data__;
19633 function data_default(value, key) {
19634 if (!arguments.length)
19635 return Array.from(this, datum);
19636 var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
19637 if (typeof value !== "function")
19638 value = constant_default(value);
19639 for (var m2 = groups.length, update = new Array(m2), enter = new Array(m2), exit = new Array(m2), j3 = 0; j3 < m2; ++j3) {
19640 var parent = parents[j3], group = groups[j3], groupLength = group.length, data = arraylike(value.call(parent, parent && parent.__data__, j3, parents)), dataLength = data.length, enterGroup = enter[j3] = new Array(dataLength), updateGroup = update[j3] = new Array(dataLength), exitGroup = exit[j3] = new Array(groupLength);
19641 bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
19642 for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
19643 if (previous = enterGroup[i0]) {
19646 while (!(next = updateGroup[i1]) && ++i1 < dataLength)
19648 previous._next = next || null;
19652 update = new Selection(update, parents);
19653 update._enter = enter;
19654 update._exit = exit;
19657 function arraylike(data) {
19658 return typeof data === "object" && "length" in data ? data : Array.from(data);
19661 // node_modules/d3-selection/src/selection/exit.js
19662 function exit_default() {
19663 return new Selection(this._exit || this._groups.map(sparse_default), this._parents);
19666 // node_modules/d3-selection/src/selection/join.js
19667 function join_default(onenter, onupdate, onexit) {
19668 var enter = this.enter(), update = this, exit = this.exit();
19669 if (typeof onenter === "function") {
19670 enter = onenter(enter);
19672 enter = enter.selection();
19674 enter = enter.append(onenter + "");
19676 if (onupdate != null) {
19677 update = onupdate(update);
19679 update = update.selection();
19681 if (onexit == null)
19685 return enter && update ? enter.merge(update).order() : update;
19688 // node_modules/d3-selection/src/selection/merge.js
19689 function merge_default(context) {
19690 var selection2 = context.selection ? context.selection() : context;
19691 for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j3 = 0; j3 < m2; ++j3) {
19692 for (var group0 = groups0[j3], group1 = groups1[j3], n3 = group0.length, merge2 = merges[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
19693 if (node = group0[i3] || group1[i3]) {
19698 for (; j3 < m0; ++j3) {
19699 merges[j3] = groups0[j3];
19701 return new Selection(merges, this._parents);
19704 // node_modules/d3-selection/src/selection/order.js
19705 function order_default() {
19706 for (var groups = this._groups, j3 = -1, m2 = groups.length; ++j3 < m2; ) {
19707 for (var group = groups[j3], i3 = group.length - 1, next = group[i3], node; --i3 >= 0; ) {
19708 if (node = group[i3]) {
19709 if (next && node.compareDocumentPosition(next) ^ 4)
19710 next.parentNode.insertBefore(node, next);
19718 // node_modules/d3-selection/src/selection/sort.js
19719 function sort_default(compare) {
19721 compare = ascending2;
19722 function compareNode(a2, b2) {
19723 return a2 && b2 ? compare(a2.__data__, b2.__data__) : !a2 - !b2;
19725 for (var groups = this._groups, m2 = groups.length, sortgroups = new Array(m2), j3 = 0; j3 < m2; ++j3) {
19726 for (var group = groups[j3], n3 = group.length, sortgroup = sortgroups[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
19727 if (node = group[i3]) {
19728 sortgroup[i3] = node;
19731 sortgroup.sort(compareNode);
19733 return new Selection(sortgroups, this._parents).order();
19735 function ascending2(a2, b2) {
19736 return a2 < b2 ? -1 : a2 > b2 ? 1 : a2 >= b2 ? 0 : NaN;
19739 // node_modules/d3-selection/src/selection/call.js
19740 function call_default() {
19741 var callback = arguments[0];
19742 arguments[0] = this;
19743 callback.apply(null, arguments);
19747 // node_modules/d3-selection/src/selection/nodes.js
19748 function nodes_default() {
19749 return Array.from(this);
19752 // node_modules/d3-selection/src/selection/node.js
19753 function node_default() {
19754 for (var groups = this._groups, j3 = 0, m2 = groups.length; j3 < m2; ++j3) {
19755 for (var group = groups[j3], i3 = 0, n3 = group.length; i3 < n3; ++i3) {
19756 var node = group[i3];
19764 // node_modules/d3-selection/src/selection/size.js
19765 function size_default() {
19767 for (const node of this)
19772 // node_modules/d3-selection/src/selection/empty.js
19773 function empty_default() {
19774 return !this.node();
19777 // node_modules/d3-selection/src/selection/each.js
19778 function each_default(callback) {
19779 for (var groups = this._groups, j3 = 0, m2 = groups.length; j3 < m2; ++j3) {
19780 for (var group = groups[j3], i3 = 0, n3 = group.length, node; i3 < n3; ++i3) {
19781 if (node = group[i3])
19782 callback.call(node, node.__data__, i3, group);
19788 // node_modules/d3-selection/src/selection/attr.js
19789 function attrRemove(name) {
19790 return function() {
19791 this.removeAttribute(name);
19794 function attrRemoveNS(fullname) {
19795 return function() {
19796 this.removeAttributeNS(fullname.space, fullname.local);
19799 function attrConstant(name, value) {
19800 return function() {
19801 this.setAttribute(name, value);
19804 function attrConstantNS(fullname, value) {
19805 return function() {
19806 this.setAttributeNS(fullname.space, fullname.local, value);
19809 function attrFunction(name, value) {
19810 return function() {
19811 var v2 = value.apply(this, arguments);
19813 this.removeAttribute(name);
19815 this.setAttribute(name, v2);
19818 function attrFunctionNS(fullname, value) {
19819 return function() {
19820 var v2 = value.apply(this, arguments);
19822 this.removeAttributeNS(fullname.space, fullname.local);
19824 this.setAttributeNS(fullname.space, fullname.local, v2);
19827 function attr_default(name, value) {
19828 var fullname = namespace_default(name);
19829 if (arguments.length < 2) {
19830 var node = this.node();
19831 return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
19833 return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
19836 // node_modules/d3-selection/src/window.js
19837 function window_default(node) {
19838 return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
19841 // node_modules/d3-selection/src/selection/style.js
19842 function styleRemove(name) {
19843 return function() {
19844 this.style.removeProperty(name);
19847 function styleConstant(name, value, priority) {
19848 return function() {
19849 this.style.setProperty(name, value, priority);
19852 function styleFunction(name, value, priority) {
19853 return function() {
19854 var v2 = value.apply(this, arguments);
19856 this.style.removeProperty(name);
19858 this.style.setProperty(name, v2, priority);
19861 function style_default(name, value, priority) {
19862 return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
19864 function styleValue(node, name) {
19865 return node.style.getPropertyValue(name) || window_default(node).getComputedStyle(node, null).getPropertyValue(name);
19868 // node_modules/d3-selection/src/selection/property.js
19869 function propertyRemove(name) {
19870 return function() {
19874 function propertyConstant(name, value) {
19875 return function() {
19876 this[name] = value;
19879 function propertyFunction(name, value) {
19880 return function() {
19881 var v2 = value.apply(this, arguments);
19888 function property_default(name, value) {
19889 return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
19892 // node_modules/d3-selection/src/selection/classed.js
19893 function classArray(string) {
19894 return string.trim().split(/^|\s+/);
19896 function classList(node) {
19897 return node.classList || new ClassList(node);
19899 function ClassList(node) {
19901 this._names = classArray(node.getAttribute("class") || "");
19903 ClassList.prototype = {
19904 add: function(name) {
19905 var i3 = this._names.indexOf(name);
19907 this._names.push(name);
19908 this._node.setAttribute("class", this._names.join(" "));
19911 remove: function(name) {
19912 var i3 = this._names.indexOf(name);
19914 this._names.splice(i3, 1);
19915 this._node.setAttribute("class", this._names.join(" "));
19918 contains: function(name) {
19919 return this._names.indexOf(name) >= 0;
19922 function classedAdd(node, names) {
19923 var list = classList(node), i3 = -1, n3 = names.length;
19925 list.add(names[i3]);
19927 function classedRemove(node, names) {
19928 var list = classList(node), i3 = -1, n3 = names.length;
19930 list.remove(names[i3]);
19932 function classedTrue(names) {
19933 return function() {
19934 classedAdd(this, names);
19937 function classedFalse(names) {
19938 return function() {
19939 classedRemove(this, names);
19942 function classedFunction(names, value) {
19943 return function() {
19944 (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
19947 function classed_default(name, value) {
19948 var names = classArray(name + "");
19949 if (arguments.length < 2) {
19950 var list = classList(this.node()), i3 = -1, n3 = names.length;
19952 if (!list.contains(names[i3]))
19956 return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
19959 // node_modules/d3-selection/src/selection/text.js
19960 function textRemove() {
19961 this.textContent = "";
19963 function textConstant(value) {
19964 return function() {
19965 this.textContent = value;
19968 function textFunction(value) {
19969 return function() {
19970 var v2 = value.apply(this, arguments);
19971 this.textContent = v2 == null ? "" : v2;
19974 function text_default(value) {
19975 return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
19978 // node_modules/d3-selection/src/selection/html.js
19979 function htmlRemove() {
19980 this.innerHTML = "";
19982 function htmlConstant(value) {
19983 return function() {
19984 this.innerHTML = value;
19987 function htmlFunction(value) {
19988 return function() {
19989 var v2 = value.apply(this, arguments);
19990 this.innerHTML = v2 == null ? "" : v2;
19993 function html_default(value) {
19994 return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
19997 // node_modules/d3-selection/src/selection/raise.js
19999 if (this.nextSibling)
20000 this.parentNode.appendChild(this);
20002 function raise_default() {
20003 return this.each(raise);
20006 // node_modules/d3-selection/src/selection/lower.js
20008 if (this.previousSibling)
20009 this.parentNode.insertBefore(this, this.parentNode.firstChild);
20011 function lower_default() {
20012 return this.each(lower);
20015 // node_modules/d3-selection/src/selection/append.js
20016 function append_default(name) {
20017 var create2 = typeof name === "function" ? name : creator_default(name);
20018 return this.select(function() {
20019 return this.appendChild(create2.apply(this, arguments));
20023 // node_modules/d3-selection/src/selection/insert.js
20024 function constantNull() {
20027 function insert_default(name, before) {
20028 var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
20029 return this.select(function() {
20030 return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null);
20034 // node_modules/d3-selection/src/selection/remove.js
20035 function remove() {
20036 var parent = this.parentNode;
20038 parent.removeChild(this);
20040 function remove_default() {
20041 return this.each(remove);
20044 // node_modules/d3-selection/src/selection/clone.js
20045 function selection_cloneShallow() {
20046 var clone = this.cloneNode(false), parent = this.parentNode;
20047 return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
20049 function selection_cloneDeep() {
20050 var clone = this.cloneNode(true), parent = this.parentNode;
20051 return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
20053 function clone_default(deep) {
20054 return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
20057 // node_modules/d3-selection/src/selection/datum.js
20058 function datum_default(value) {
20059 return arguments.length ? this.property("__data__", value) : this.node().__data__;
20062 // node_modules/d3-selection/src/selection/on.js
20063 function contextListener(listener) {
20064 return function(event) {
20065 listener.call(this, event, this.__data__);
20068 function parseTypenames2(typenames) {
20069 return typenames.trim().split(/^|\s+/).map(function(t2) {
20070 var name = "", i3 = t2.indexOf(".");
20072 name = t2.slice(i3 + 1), t2 = t2.slice(0, i3);
20073 return { type: t2, name };
20076 function onRemove(typename) {
20077 return function() {
20078 var on = this.__on;
20081 for (var j3 = 0, i3 = -1, m2 = on.length, o2; j3 < m2; ++j3) {
20082 if (o2 = on[j3], (!typename.type || o2.type === typename.type) && o2.name === typename.name) {
20083 this.removeEventListener(o2.type, o2.listener, o2.options);
20094 function onAdd(typename, value, options2) {
20095 return function() {
20096 var on = this.__on, o2, listener = contextListener(value);
20098 for (var j3 = 0, m2 = on.length; j3 < m2; ++j3) {
20099 if ((o2 = on[j3]).type === typename.type && o2.name === typename.name) {
20100 this.removeEventListener(o2.type, o2.listener, o2.options);
20101 this.addEventListener(o2.type, o2.listener = listener, o2.options = options2);
20106 this.addEventListener(typename.type, listener, options2);
20107 o2 = { type: typename.type, name: typename.name, value, listener, options: options2 };
20114 function on_default(typename, value, options2) {
20115 var typenames = parseTypenames2(typename + ""), i3, n3 = typenames.length, t2;
20116 if (arguments.length < 2) {
20117 var on = this.node().__on;
20119 for (var j3 = 0, m2 = on.length, o2; j3 < m2; ++j3) {
20120 for (i3 = 0, o2 = on[j3]; i3 < n3; ++i3) {
20121 if ((t2 = typenames[i3]).type === o2.type && t2.name === o2.name) {
20128 on = value ? onAdd : onRemove;
20129 for (i3 = 0; i3 < n3; ++i3)
20130 this.each(on(typenames[i3], value, options2));
20134 // node_modules/d3-selection/src/selection/dispatch.js
20135 function dispatchEvent(node, type2, params) {
20136 var window2 = window_default(node), event = window2.CustomEvent;
20137 if (typeof event === "function") {
20138 event = new event(type2, params);
20140 event = window2.document.createEvent("Event");
20142 event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail;
20144 event.initEvent(type2, false, false);
20146 node.dispatchEvent(event);
20148 function dispatchConstant(type2, params) {
20149 return function() {
20150 return dispatchEvent(this, type2, params);
20153 function dispatchFunction(type2, params) {
20154 return function() {
20155 return dispatchEvent(this, type2, params.apply(this, arguments));
20158 function dispatch_default2(type2, params) {
20159 return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params));
20162 // node_modules/d3-selection/src/selection/iterator.js
20163 function* iterator_default() {
20164 for (var groups = this._groups, j3 = 0, m2 = groups.length; j3 < m2; ++j3) {
20165 for (var group = groups[j3], i3 = 0, n3 = group.length, node; i3 < n3; ++i3) {
20166 if (node = group[i3])
20172 // node_modules/d3-selection/src/selection/index.js
20174 function Selection(groups, parents) {
20175 this._groups = groups;
20176 this._parents = parents;
20178 function selection() {
20179 return new Selection([[document.documentElement]], root);
20181 function selection_selection() {
20184 Selection.prototype = selection.prototype = {
20185 constructor: Selection,
20186 select: select_default,
20187 selectAll: selectAll_default,
20188 selectChild: selectChild_default,
20189 selectChildren: selectChildren_default,
20190 filter: filter_default,
20191 data: data_default,
20192 enter: enter_default,
20193 exit: exit_default,
20194 join: join_default,
20195 merge: merge_default,
20196 selection: selection_selection,
20197 order: order_default,
20198 sort: sort_default,
20199 call: call_default,
20200 nodes: nodes_default,
20201 node: node_default,
20202 size: size_default,
20203 empty: empty_default,
20204 each: each_default,
20205 attr: attr_default,
20206 style: style_default,
20207 property: property_default,
20208 classed: classed_default,
20209 text: text_default,
20210 html: html_default,
20211 raise: raise_default,
20212 lower: lower_default,
20213 append: append_default,
20214 insert: insert_default,
20215 remove: remove_default,
20216 clone: clone_default,
20217 datum: datum_default,
20219 dispatch: dispatch_default2,
20220 [Symbol.iterator]: iterator_default
20222 var selection_default = selection;
20224 // node_modules/d3-selection/src/select.js
20225 function select_default2(selector) {
20226 return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
20229 // node_modules/d3-selection/src/sourceEvent.js
20230 function sourceEvent_default(event) {
20232 while (sourceEvent = event.sourceEvent)
20233 event = sourceEvent;
20237 // node_modules/d3-selection/src/pointer.js
20238 function pointer_default(event, node) {
20239 event = sourceEvent_default(event);
20240 if (node === void 0)
20241 node = event.currentTarget;
20243 var svg2 = node.ownerSVGElement || node;
20244 if (svg2.createSVGPoint) {
20245 var point2 = svg2.createSVGPoint();
20246 point2.x = event.clientX, point2.y = event.clientY;
20247 point2 = point2.matrixTransform(node.getScreenCTM().inverse());
20248 return [point2.x, point2.y];
20250 if (node.getBoundingClientRect) {
20251 var rect = node.getBoundingClientRect();
20252 return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
20255 return [event.pageX, event.pageY];
20258 // node_modules/d3-selection/src/selectAll.js
20259 function selectAll_default2(selector) {
20260 return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([array(selector)], root);
20263 // node_modules/d3-drag/src/noevent.js
20264 var nonpassive = { passive: false };
20265 var nonpassivecapture = { capture: true, passive: false };
20266 function nopropagation(event) {
20267 event.stopImmediatePropagation();
20269 function noevent_default(event) {
20270 event.preventDefault();
20271 event.stopImmediatePropagation();
20274 // node_modules/d3-drag/src/nodrag.js
20275 function nodrag_default(view) {
20276 var root3 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", noevent_default, nonpassivecapture);
20277 if ("onselectstart" in root3) {
20278 selection2.on("selectstart.drag", noevent_default, nonpassivecapture);
20280 root3.__noselect = root3.style.MozUserSelect;
20281 root3.style.MozUserSelect = "none";
20284 function yesdrag(view, noclick) {
20285 var root3 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", null);
20287 selection2.on("click.drag", noevent_default, nonpassivecapture);
20288 setTimeout(function() {
20289 selection2.on("click.drag", null);
20292 if ("onselectstart" in root3) {
20293 selection2.on("selectstart.drag", null);
20295 root3.style.MozUserSelect = root3.__noselect;
20296 delete root3.__noselect;
20300 // node_modules/d3-drag/src/constant.js
20301 var constant_default2 = (x2) => () => x2;
20303 // node_modules/d3-drag/src/event.js
20304 function DragEvent(type2, {
20314 dispatch: dispatch14
20316 Object.defineProperties(this, {
20317 type: { value: type2, enumerable: true, configurable: true },
20318 sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
20319 subject: { value: subject, enumerable: true, configurable: true },
20320 target: { value: target, enumerable: true, configurable: true },
20321 identifier: { value: identifier, enumerable: true, configurable: true },
20322 active: { value: active, enumerable: true, configurable: true },
20323 x: { value: x2, enumerable: true, configurable: true },
20324 y: { value: y2, enumerable: true, configurable: true },
20325 dx: { value: dx, enumerable: true, configurable: true },
20326 dy: { value: dy, enumerable: true, configurable: true },
20327 _: { value: dispatch14 }
20330 DragEvent.prototype.on = function() {
20331 var value = this._.on.apply(this._, arguments);
20332 return value === this._ ? this : value;
20335 // node_modules/d3-drag/src/drag.js
20336 function defaultFilter(event) {
20337 return !event.ctrlKey && !event.button;
20339 function defaultContainer() {
20340 return this.parentNode;
20342 function defaultSubject(event, d2) {
20343 return d2 == null ? { x: event.x, y: event.y } : d2;
20345 function defaultTouchable() {
20346 return navigator.maxTouchPoints || "ontouchstart" in this;
20348 function drag_default() {
20349 var filter2 = defaultFilter, container = defaultContainer, subject = defaultSubject, touchable = defaultTouchable, gestures = {}, listeners = dispatch_default("start", "drag", "end"), active = 0, mousedownx, mousedowny, mousemoving, touchending, clickDistance2 = 0;
20350 function drag(selection2) {
20351 selection2.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
20353 function mousedowned(event, d2) {
20354 if (touchending || !filter2.call(this, event, d2))
20356 var gesture = beforestart(this, container.call(this, event, d2), event, d2, "mouse");
20359 select_default2(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture);
20360 nodrag_default(event.view);
20361 nopropagation(event);
20362 mousemoving = false;
20363 mousedownx = event.clientX;
20364 mousedowny = event.clientY;
20365 gesture("start", event);
20367 function mousemoved(event) {
20368 noevent_default(event);
20369 if (!mousemoving) {
20370 var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;
20371 mousemoving = dx * dx + dy * dy > clickDistance2;
20373 gestures.mouse("drag", event);
20375 function mouseupped(event) {
20376 select_default2(event.view).on("mousemove.drag mouseup.drag", null);
20377 yesdrag(event.view, mousemoving);
20378 noevent_default(event);
20379 gestures.mouse("end", event);
20381 function touchstarted(event, d2) {
20382 if (!filter2.call(this, event, d2))
20384 var touches = event.changedTouches, c2 = container.call(this, event, d2), n3 = touches.length, i3, gesture;
20385 for (i3 = 0; i3 < n3; ++i3) {
20386 if (gesture = beforestart(this, c2, event, d2, touches[i3].identifier, touches[i3])) {
20387 nopropagation(event);
20388 gesture("start", event, touches[i3]);
20392 function touchmoved(event) {
20393 var touches = event.changedTouches, n3 = touches.length, i3, gesture;
20394 for (i3 = 0; i3 < n3; ++i3) {
20395 if (gesture = gestures[touches[i3].identifier]) {
20396 noevent_default(event);
20397 gesture("drag", event, touches[i3]);
20401 function touchended(event) {
20402 var touches = event.changedTouches, n3 = touches.length, i3, gesture;
20404 clearTimeout(touchending);
20405 touchending = setTimeout(function() {
20406 touchending = null;
20408 for (i3 = 0; i3 < n3; ++i3) {
20409 if (gesture = gestures[touches[i3].identifier]) {
20410 nopropagation(event);
20411 gesture("end", event, touches[i3]);
20415 function beforestart(that, container2, event, d2, identifier, touch) {
20416 var dispatch14 = listeners.copy(), p2 = pointer_default(touch || event, container2), dx, dy, s2;
20417 if ((s2 = subject.call(that, new DragEvent("beforestart", {
20418 sourceEvent: event,
20426 dispatch: dispatch14
20429 dx = s2.x - p2[0] || 0;
20430 dy = s2.y - p2[1] || 0;
20431 return function gesture(type2, event2, touch2) {
20435 gestures[identifier] = gesture, n3 = active++;
20438 delete gestures[identifier], --active;
20440 p2 = pointer_default(touch2 || event2, container2), n3 = active;
20446 new DragEvent(type2, {
20447 sourceEvent: event2,
20454 dx: p2[0] - p02[0],
20455 dy: p2[1] - p02[1],
20456 dispatch: dispatch14
20462 drag.filter = function(_2) {
20463 return arguments.length ? (filter2 = typeof _2 === "function" ? _2 : constant_default2(!!_2), drag) : filter2;
20465 drag.container = function(_2) {
20466 return arguments.length ? (container = typeof _2 === "function" ? _2 : constant_default2(_2), drag) : container;
20468 drag.subject = function(_2) {
20469 return arguments.length ? (subject = typeof _2 === "function" ? _2 : constant_default2(_2), drag) : subject;
20471 drag.touchable = function(_2) {
20472 return arguments.length ? (touchable = typeof _2 === "function" ? _2 : constant_default2(!!_2), drag) : touchable;
20474 drag.on = function() {
20475 var value = listeners.on.apply(listeners, arguments);
20476 return value === listeners ? drag : value;
20478 drag.clickDistance = function(_2) {
20479 return arguments.length ? (clickDistance2 = (_2 = +_2) * _2, drag) : Math.sqrt(clickDistance2);
20484 // node_modules/d3-color/src/define.js
20485 function define_default(constructor, factory, prototype) {
20486 constructor.prototype = factory.prototype = prototype;
20487 prototype.constructor = constructor;
20489 function extend(parent, definition) {
20490 var prototype = Object.create(parent.prototype);
20491 for (var key in definition)
20492 prototype[key] = definition[key];
20496 // node_modules/d3-color/src/color.js
20500 var brighter = 1 / darker;
20501 var reI = "\\s*([+-]?\\d+)\\s*";
20502 var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
20503 var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
20504 var reHex = /^#([0-9a-f]{3,8})$/;
20505 var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
20506 var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
20507 var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
20508 var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
20509 var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
20510 var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
20512 aliceblue: 15792383,
20513 antiquewhite: 16444375,
20515 aquamarine: 8388564,
20520 blanchedalmond: 16772045,
20522 blueviolet: 9055202,
20524 burlywood: 14596231,
20525 cadetblue: 6266528,
20526 chartreuse: 8388352,
20527 chocolate: 13789470,
20529 cornflowerblue: 6591981,
20530 cornsilk: 16775388,
20535 darkgoldenrod: 12092939,
20536 darkgray: 11119017,
20538 darkgrey: 11119017,
20539 darkkhaki: 12433259,
20540 darkmagenta: 9109643,
20541 darkolivegreen: 5597999,
20542 darkorange: 16747520,
20543 darkorchid: 10040012,
20545 darksalmon: 15308410,
20546 darkseagreen: 9419919,
20547 darkslateblue: 4734347,
20548 darkslategray: 3100495,
20549 darkslategrey: 3100495,
20550 darkturquoise: 52945,
20551 darkviolet: 9699539,
20552 deeppink: 16716947,
20553 deepskyblue: 49151,
20556 dodgerblue: 2003199,
20557 firebrick: 11674146,
20558 floralwhite: 16775920,
20559 forestgreen: 2263842,
20561 gainsboro: 14474460,
20562 ghostwhite: 16316671,
20564 goldenrod: 14329120,
20567 greenyellow: 11403055,
20569 honeydew: 15794160,
20571 indianred: 13458524,
20575 lavender: 15132410,
20576 lavenderblush: 16773365,
20577 lawngreen: 8190976,
20578 lemonchiffon: 16775885,
20579 lightblue: 11393254,
20580 lightcoral: 15761536,
20581 lightcyan: 14745599,
20582 lightgoldenrodyellow: 16448210,
20583 lightgray: 13882323,
20584 lightgreen: 9498256,
20585 lightgrey: 13882323,
20586 lightpink: 16758465,
20587 lightsalmon: 16752762,
20588 lightseagreen: 2142890,
20589 lightskyblue: 8900346,
20590 lightslategray: 7833753,
20591 lightslategrey: 7833753,
20592 lightsteelblue: 11584734,
20593 lightyellow: 16777184,
20595 limegreen: 3329330,
20599 mediumaquamarine: 6737322,
20601 mediumorchid: 12211667,
20602 mediumpurple: 9662683,
20603 mediumseagreen: 3978097,
20604 mediumslateblue: 8087790,
20605 mediumspringgreen: 64154,
20606 mediumturquoise: 4772300,
20607 mediumvioletred: 13047173,
20608 midnightblue: 1644912,
20609 mintcream: 16121850,
20610 mistyrose: 16770273,
20611 moccasin: 16770229,
20612 navajowhite: 16768685,
20616 olivedrab: 7048739,
20618 orangered: 16729344,
20620 palegoldenrod: 15657130,
20621 palegreen: 10025880,
20622 paleturquoise: 11529966,
20623 palevioletred: 14381203,
20624 papayawhip: 16773077,
20625 peachpuff: 16767673,
20629 powderblue: 11591910,
20631 rebeccapurple: 6697881,
20633 rosybrown: 12357519,
20634 royalblue: 4286945,
20635 saddlebrown: 9127187,
20637 sandybrown: 16032864,
20639 seashell: 16774638,
20643 slateblue: 6970061,
20644 slategray: 7372944,
20645 slategrey: 7372944,
20647 springgreen: 65407,
20648 steelblue: 4620980,
20653 turquoise: 4251856,
20657 whitesmoke: 16119285,
20659 yellowgreen: 10145074
20661 define_default(Color, color, {
20663 return Object.assign(new this.constructor(), this, channels);
20666 return this.rgb().displayable();
20668 hex: color_formatHex,
20669 // Deprecated! Use color.formatHex.
20670 formatHex: color_formatHex,
20671 formatHex8: color_formatHex8,
20672 formatHsl: color_formatHsl,
20673 formatRgb: color_formatRgb,
20674 toString: color_formatRgb
20676 function color_formatHex() {
20677 return this.rgb().formatHex();
20679 function color_formatHex8() {
20680 return this.rgb().formatHex8();
20682 function color_formatHsl() {
20683 return hslConvert(this).formatHsl();
20685 function color_formatRgb() {
20686 return this.rgb().formatRgb();
20688 function color(format2) {
20690 format2 = (format2 + "").trim().toLowerCase();
20691 return (m2 = reHex.exec(format2)) ? (l2 = m2[1].length, m2 = parseInt(m2[1], 16), l2 === 6 ? rgbn(m2) : l2 === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l2 === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l2 === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format2)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format2)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format2)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format2)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
20693 function rgbn(n3) {
20694 return new Rgb(n3 >> 16 & 255, n3 >> 8 & 255, n3 & 255, 1);
20696 function rgba(r2, g3, b2, a2) {
20698 r2 = g3 = b2 = NaN;
20699 return new Rgb(r2, g3, b2, a2);
20701 function rgbConvert(o2) {
20702 if (!(o2 instanceof Color))
20707 return new Rgb(o2.r, o2.g, o2.b, o2.opacity);
20709 function rgb(r2, g3, b2, opacity) {
20710 return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g3, b2, opacity == null ? 1 : opacity);
20712 function Rgb(r2, g3, b2, opacity) {
20716 this.opacity = +opacity;
20718 define_default(Rgb, rgb, extend(Color, {
20720 k2 = k2 == null ? brighter : Math.pow(brighter, k2);
20721 return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
20724 k2 = k2 == null ? darker : Math.pow(darker, k2);
20725 return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
20731 return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
20734 return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
20736 hex: rgb_formatHex,
20737 // Deprecated! Use color.formatHex.
20738 formatHex: rgb_formatHex,
20739 formatHex8: rgb_formatHex8,
20740 formatRgb: rgb_formatRgb,
20741 toString: rgb_formatRgb
20743 function rgb_formatHex() {
20744 return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
20746 function rgb_formatHex8() {
20747 return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
20749 function rgb_formatRgb() {
20750 const a2 = clampa(this.opacity);
20751 return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
20753 function clampa(opacity) {
20754 return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
20756 function clampi(value) {
20757 return Math.max(0, Math.min(255, Math.round(value) || 0));
20759 function hex(value) {
20760 value = clampi(value);
20761 return (value < 16 ? "0" : "") + value.toString(16);
20763 function hsla(h2, s2, l2, a2) {
20765 h2 = s2 = l2 = NaN;
20766 else if (l2 <= 0 || l2 >= 1)
20770 return new Hsl(h2, s2, l2, a2);
20772 function hslConvert(o2) {
20773 if (o2 instanceof Hsl)
20774 return new Hsl(o2.h, o2.s, o2.l, o2.opacity);
20775 if (!(o2 instanceof Color))
20779 if (o2 instanceof Hsl)
20782 var r2 = o2.r / 255, g3 = o2.g / 255, b2 = o2.b / 255, min3 = Math.min(r2, g3, b2), max3 = Math.max(r2, g3, b2), h2 = NaN, s2 = max3 - min3, l2 = (max3 + min3) / 2;
20785 h2 = (g3 - b2) / s2 + (g3 < b2) * 6;
20786 else if (g3 === max3)
20787 h2 = (b2 - r2) / s2 + 2;
20789 h2 = (r2 - g3) / s2 + 4;
20790 s2 /= l2 < 0.5 ? max3 + min3 : 2 - max3 - min3;
20793 s2 = l2 > 0 && l2 < 1 ? 0 : h2;
20795 return new Hsl(h2, s2, l2, o2.opacity);
20797 function hsl(h2, s2, l2, opacity) {
20798 return arguments.length === 1 ? hslConvert(h2) : new Hsl(h2, s2, l2, opacity == null ? 1 : opacity);
20800 function Hsl(h2, s2, l2, opacity) {
20804 this.opacity = +opacity;
20806 define_default(Hsl, hsl, extend(Color, {
20808 k2 = k2 == null ? brighter : Math.pow(brighter, k2);
20809 return new Hsl(this.h, this.s, this.l * k2, this.opacity);
20812 k2 = k2 == null ? darker : Math.pow(darker, k2);
20813 return new Hsl(this.h, this.s, this.l * k2, this.opacity);
20816 var h2 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h2) || isNaN(this.s) ? 0 : this.s, l2 = this.l, m2 = l2 + (l2 < 0.5 ? l2 : 1 - l2) * s2, m1 = 2 * l2 - m2;
20818 hsl2rgb(h2 >= 240 ? h2 - 240 : h2 + 120, m1, m2),
20819 hsl2rgb(h2, m1, m2),
20820 hsl2rgb(h2 < 120 ? h2 + 240 : h2 - 120, m1, m2),
20825 return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
20828 return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
20831 const a2 = clampa(this.opacity);
20832 return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
20835 function clamph(value) {
20836 value = (value || 0) % 360;
20837 return value < 0 ? value + 360 : value;
20839 function clampt(value) {
20840 return Math.max(0, Math.min(1, value || 0));
20842 function hsl2rgb(h2, m1, m2) {
20843 return (h2 < 60 ? m1 + (m2 - m1) * h2 / 60 : h2 < 180 ? m2 : h2 < 240 ? m1 + (m2 - m1) * (240 - h2) / 60 : m1) * 255;
20846 // node_modules/d3-interpolate/src/basis.js
20847 function basis(t1, v0, v1, v2, v3) {
20848 var t2 = t1 * t1, t3 = t2 * t1;
20849 return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
20851 function basis_default(values) {
20852 var n3 = values.length - 1;
20853 return function(t2) {
20854 var i3 = t2 <= 0 ? t2 = 0 : t2 >= 1 ? (t2 = 1, n3 - 1) : Math.floor(t2 * n3), v1 = values[i3], v2 = values[i3 + 1], v0 = i3 > 0 ? values[i3 - 1] : 2 * v1 - v2, v3 = i3 < n3 - 1 ? values[i3 + 2] : 2 * v2 - v1;
20855 return basis((t2 - i3 / n3) * n3, v0, v1, v2, v3);
20859 // node_modules/d3-interpolate/src/basisClosed.js
20860 function basisClosed_default(values) {
20861 var n3 = values.length;
20862 return function(t2) {
20863 var i3 = Math.floor(((t2 %= 1) < 0 ? ++t2 : t2) * n3), v0 = values[(i3 + n3 - 1) % n3], v1 = values[i3 % n3], v2 = values[(i3 + 1) % n3], v3 = values[(i3 + 2) % n3];
20864 return basis((t2 - i3 / n3) * n3, v0, v1, v2, v3);
20868 // node_modules/d3-interpolate/src/constant.js
20869 var constant_default3 = (x2) => () => x2;
20871 // node_modules/d3-interpolate/src/color.js
20872 function linear(a2, d2) {
20873 return function(t2) {
20874 return a2 + t2 * d2;
20877 function exponential(a2, b2, y2) {
20878 return a2 = Math.pow(a2, y2), b2 = Math.pow(b2, y2) - a2, y2 = 1 / y2, function(t2) {
20879 return Math.pow(a2 + t2 * b2, y2);
20882 function gamma(y2) {
20883 return (y2 = +y2) === 1 ? nogamma : function(a2, b2) {
20884 return b2 - a2 ? exponential(a2, b2, y2) : constant_default3(isNaN(a2) ? b2 : a2);
20887 function nogamma(a2, b2) {
20889 return d2 ? linear(a2, d2) : constant_default3(isNaN(a2) ? b2 : a2);
20892 // node_modules/d3-interpolate/src/rgb.js
20893 var rgb_default = function rgbGamma(y2) {
20894 var color2 = gamma(y2);
20895 function rgb2(start2, end) {
20896 var r2 = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g3 = color2(start2.g, end.g), b2 = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
20897 return function(t2) {
20901 start2.opacity = opacity(t2);
20902 return start2 + "";
20905 rgb2.gamma = rgbGamma;
20908 function rgbSpline(spline) {
20909 return function(colors) {
20910 var n3 = colors.length, r2 = new Array(n3), g3 = new Array(n3), b2 = new Array(n3), i3, color2;
20911 for (i3 = 0; i3 < n3; ++i3) {
20912 color2 = rgb(colors[i3]);
20913 r2[i3] = color2.r || 0;
20914 g3[i3] = color2.g || 0;
20915 b2[i3] = color2.b || 0;
20920 color2.opacity = 1;
20921 return function(t2) {
20925 return color2 + "";
20929 var rgbBasis = rgbSpline(basis_default);
20930 var rgbBasisClosed = rgbSpline(basisClosed_default);
20932 // node_modules/d3-interpolate/src/numberArray.js
20933 function numberArray_default(a2, b2) {
20936 var n3 = a2 ? Math.min(b2.length, a2.length) : 0, c2 = b2.slice(), i3;
20937 return function(t2) {
20938 for (i3 = 0; i3 < n3; ++i3)
20939 c2[i3] = a2[i3] * (1 - t2) + b2[i3] * t2;
20943 function isNumberArray(x2) {
20944 return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
20947 // node_modules/d3-interpolate/src/array.js
20948 function genericArray(a2, b2) {
20949 var nb = b2 ? b2.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c2 = new Array(nb), i3;
20950 for (i3 = 0; i3 < na; ++i3)
20951 x2[i3] = value_default(a2[i3], b2[i3]);
20952 for (; i3 < nb; ++i3)
20954 return function(t2) {
20955 for (i3 = 0; i3 < na; ++i3)
20956 c2[i3] = x2[i3](t2);
20961 // node_modules/d3-interpolate/src/date.js
20962 function date_default(a2, b2) {
20963 var d2 = /* @__PURE__ */ new Date();
20964 return a2 = +a2, b2 = +b2, function(t2) {
20965 return d2.setTime(a2 * (1 - t2) + b2 * t2), d2;
20969 // node_modules/d3-interpolate/src/number.js
20970 function number_default(a2, b2) {
20971 return a2 = +a2, b2 = +b2, function(t2) {
20972 return a2 * (1 - t2) + b2 * t2;
20976 // node_modules/d3-interpolate/src/object.js
20977 function object_default(a2, b2) {
20978 var i3 = {}, c2 = {}, k2;
20979 if (a2 === null || typeof a2 !== "object")
20981 if (b2 === null || typeof b2 !== "object")
20985 i3[k2] = value_default(a2[k2], b2[k2]);
20990 return function(t2) {
20992 c2[k2] = i3[k2](t2);
20997 // node_modules/d3-interpolate/src/string.js
20998 var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
20999 var reB = new RegExp(reA.source, "g");
21000 function zero2(b2) {
21001 return function() {
21006 return function(t2) {
21007 return b2(t2) + "";
21010 function string_default(a2, b2) {
21011 var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i3 = -1, s2 = [], q2 = [];
21012 a2 = a2 + "", b2 = b2 + "";
21013 while ((am = reA.exec(a2)) && (bm = reB.exec(b2))) {
21014 if ((bs = bm.index) > bi) {
21015 bs = b2.slice(bi, bs);
21021 if ((am = am[0]) === (bm = bm[0])) {
21028 q2.push({ i: i3, x: number_default(am, bm) });
21030 bi = reB.lastIndex;
21032 if (bi < b2.length) {
21039 return s2.length < 2 ? q2[0] ? one(q2[0].x) : zero2(b2) : (b2 = q2.length, function(t2) {
21040 for (var i4 = 0, o2; i4 < b2; ++i4)
21041 s2[(o2 = q2[i4]).i] = o2.x(t2);
21042 return s2.join("");
21046 // node_modules/d3-interpolate/src/value.js
21047 function value_default(a2, b2) {
21048 var t2 = typeof b2, c2;
21049 return b2 == null || t2 === "boolean" ? constant_default3(b2) : (t2 === "number" ? number_default : t2 === "string" ? (c2 = color(b2)) ? (b2 = c2, rgb_default) : string_default : b2 instanceof color ? rgb_default : b2 instanceof Date ? date_default : isNumberArray(b2) ? numberArray_default : Array.isArray(b2) ? genericArray : typeof b2.valueOf !== "function" && typeof b2.toString !== "function" || isNaN(b2) ? object_default : number_default)(a2, b2);
21052 // node_modules/d3-interpolate/src/round.js
21053 function round_default(a2, b2) {
21054 return a2 = +a2, b2 = +b2, function(t2) {
21055 return Math.round(a2 * (1 - t2) + b2 * t2);
21059 // node_modules/d3-interpolate/src/transform/decompose.js
21060 var degrees2 = 180 / Math.PI;
21069 function decompose_default(a2, b2, c2, d2, e3, f3) {
21070 var scaleX, scaleY, skewX;
21071 if (scaleX = Math.sqrt(a2 * a2 + b2 * b2))
21072 a2 /= scaleX, b2 /= scaleX;
21073 if (skewX = a2 * c2 + b2 * d2)
21074 c2 -= a2 * skewX, d2 -= b2 * skewX;
21075 if (scaleY = Math.sqrt(c2 * c2 + d2 * d2))
21076 c2 /= scaleY, d2 /= scaleY, skewX /= scaleY;
21077 if (a2 * d2 < b2 * c2)
21078 a2 = -a2, b2 = -b2, skewX = -skewX, scaleX = -scaleX;
21082 rotate: Math.atan2(b2, a2) * degrees2,
21083 skewX: Math.atan(skewX) * degrees2,
21089 // node_modules/d3-interpolate/src/transform/parse.js
21091 function parseCss(value) {
21092 const m2 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
21093 return m2.isIdentity ? identity : decompose_default(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);
21095 function parseSvg(value) {
21099 svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
21100 svgNode.setAttribute("transform", value);
21101 if (!(value = svgNode.transform.baseVal.consolidate()))
21103 value = value.matrix;
21104 return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f);
21107 // node_modules/d3-interpolate/src/transform/index.js
21108 function interpolateTransform(parse, pxComma, pxParen, degParen) {
21110 return s2.length ? s2.pop() + " " : "";
21112 function translate(xa, ya, xb, yb, s2, q2) {
21113 if (xa !== xb || ya !== yb) {
21114 var i3 = s2.push("translate(", null, pxComma, null, pxParen);
21115 q2.push({ i: i3 - 4, x: number_default(xa, xb) }, { i: i3 - 2, x: number_default(ya, yb) });
21116 } else if (xb || yb) {
21117 s2.push("translate(" + xb + pxComma + yb + pxParen);
21120 function rotate(a2, b2, s2, q2) {
21124 else if (b2 - a2 > 180)
21126 q2.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b2) });
21128 s2.push(pop(s2) + "rotate(" + b2 + degParen);
21131 function skewX(a2, b2, s2, q2) {
21133 q2.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b2) });
21135 s2.push(pop(s2) + "skewX(" + b2 + degParen);
21138 function scale(xa, ya, xb, yb, s2, q2) {
21139 if (xa !== xb || ya !== yb) {
21140 var i3 = s2.push(pop(s2) + "scale(", null, ",", null, ")");
21141 q2.push({ i: i3 - 4, x: number_default(xa, xb) }, { i: i3 - 2, x: number_default(ya, yb) });
21142 } else if (xb !== 1 || yb !== 1) {
21143 s2.push(pop(s2) + "scale(" + xb + "," + yb + ")");
21146 return function(a2, b2) {
21147 var s2 = [], q2 = [];
21148 a2 = parse(a2), b2 = parse(b2);
21149 translate(a2.translateX, a2.translateY, b2.translateX, b2.translateY, s2, q2);
21150 rotate(a2.rotate, b2.rotate, s2, q2);
21151 skewX(a2.skewX, b2.skewX, s2, q2);
21152 scale(a2.scaleX, a2.scaleY, b2.scaleX, b2.scaleY, s2, q2);
21154 return function(t2) {
21155 var i3 = -1, n3 = q2.length, o2;
21157 s2[(o2 = q2[i3]).i] = o2.x(t2);
21158 return s2.join("");
21162 var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
21163 var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
21165 // node_modules/d3-interpolate/src/zoom.js
21166 var epsilon22 = 1e-12;
21167 function cosh(x2) {
21168 return ((x2 = Math.exp(x2)) + 1 / x2) / 2;
21170 function sinh(x2) {
21171 return ((x2 = Math.exp(x2)) - 1 / x2) / 2;
21173 function tanh(x2) {
21174 return ((x2 = Math.exp(2 * x2)) - 1) / (x2 + 1);
21176 var zoom_default = function zoomRho(rho, rho2, rho4) {
21177 function zoom(p02, p1) {
21178 var ux0 = p02[0], uy0 = p02[1], w0 = p02[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i3, S2;
21179 if (d2 < epsilon22) {
21180 S2 = Math.log(w1 / w0) / rho;
21181 i3 = function(t2) {
21185 w0 * Math.exp(rho * t2 * S2)
21189 var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
21190 S2 = (r1 - r0) / rho;
21191 i3 = function(t2) {
21192 var s2 = t2 * S2, coshr0 = cosh(r0), u2 = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
21196 w0 * coshr0 / cosh(rho * s2 + r0)
21200 i3.duration = S2 * 1e3 * rho / Math.SQRT2;
21203 zoom.rho = function(_2) {
21204 var _1 = Math.max(1e-3, +_2), _22 = _1 * _1, _4 = _22 * _22;
21205 return zoomRho(_1, _22, _4);
21208 }(Math.SQRT2, 2, 4);
21210 // node_modules/d3-interpolate/src/quantize.js
21211 function quantize_default(interpolator, n3) {
21212 var samples = new Array(n3);
21213 for (var i3 = 0; i3 < n3; ++i3)
21214 samples[i3] = interpolator(i3 / (n3 - 1));
21218 // node_modules/d3-timer/src/timer.js
21222 var pokeDelay = 1e3;
21228 var clock = typeof performance === "object" && performance.now ? performance : Date;
21229 var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f3) {
21230 setTimeout(f3, 17);
21233 return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
21235 function clearNow() {
21239 this._call = this._time = this._next = null;
21241 Timer.prototype = timer.prototype = {
21242 constructor: Timer,
21243 restart: function(callback, delay, time) {
21244 if (typeof callback !== "function")
21245 throw new TypeError("callback is not a function");
21246 time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
21247 if (!this._next && taskTail !== this) {
21249 taskTail._next = this;
21254 this._call = callback;
21261 this._time = Infinity;
21266 function timer(callback, delay, time) {
21267 var t2 = new Timer();
21268 t2.restart(callback, delay, time);
21271 function timerFlush() {
21274 var t2 = taskHead, e3;
21276 if ((e3 = clockNow - t2._time) >= 0)
21277 t2._call.call(void 0, e3);
21283 clockNow = (clockLast = clock.now()) + clockSkew;
21284 frame = timeout = 0;
21294 var now3 = clock.now(), delay = now3 - clockLast;
21295 if (delay > pokeDelay)
21296 clockSkew -= delay, clockLast = now3;
21299 var t0, t1 = taskHead, t2, time = Infinity;
21302 if (time > t1._time)
21304 t0 = t1, t1 = t1._next;
21306 t2 = t1._next, t1._next = null;
21307 t1 = t0 ? t0._next = t2 : taskHead = t2;
21313 function sleep(time) {
21317 timeout = clearTimeout(timeout);
21318 var delay = time - clockNow;
21320 if (time < Infinity)
21321 timeout = setTimeout(wake, time - clock.now() - clockSkew);
21323 interval = clearInterval(interval);
21326 clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
21327 frame = 1, setFrame(wake);
21331 // node_modules/d3-timer/src/timeout.js
21332 function timeout_default(callback, delay, time) {
21333 var t2 = new Timer();
21334 delay = delay == null ? 0 : +delay;
21335 t2.restart((elapsed) => {
21337 callback(elapsed + delay);
21342 // node_modules/d3-transition/src/transition/schedule.js
21343 var emptyOn = dispatch_default("start", "end", "cancel", "interrupt");
21344 var emptyTween = [];
21352 function schedule_default(node, name, id2, index, group, timing) {
21353 var schedules = node.__transition;
21355 node.__transition = {};
21356 else if (id2 in schedules)
21358 create(node, id2, {
21361 // For context during callback.
21363 // For context during callback.
21367 delay: timing.delay,
21368 duration: timing.duration,
21374 function init(node, id2) {
21375 var schedule = get2(node, id2);
21376 if (schedule.state > CREATED)
21377 throw new Error("too late; already scheduled");
21380 function set2(node, id2) {
21381 var schedule = get2(node, id2);
21382 if (schedule.state > STARTED)
21383 throw new Error("too late; already running");
21386 function get2(node, id2) {
21387 var schedule = node.__transition;
21388 if (!schedule || !(schedule = schedule[id2]))
21389 throw new Error("transition not found");
21392 function create(node, id2, self2) {
21393 var schedules = node.__transition, tween;
21394 schedules[id2] = self2;
21395 self2.timer = timer(schedule, 0, self2.time);
21396 function schedule(elapsed) {
21397 self2.state = SCHEDULED;
21398 self2.timer.restart(start2, self2.delay, self2.time);
21399 if (self2.delay <= elapsed)
21400 start2(elapsed - self2.delay);
21402 function start2(elapsed) {
21403 var i3, j3, n3, o2;
21404 if (self2.state !== SCHEDULED)
21406 for (i3 in schedules) {
21407 o2 = schedules[i3];
21408 if (o2.name !== self2.name)
21410 if (o2.state === STARTED)
21411 return timeout_default(start2);
21412 if (o2.state === RUNNING) {
21415 o2.on.call("interrupt", node, node.__data__, o2.index, o2.group);
21416 delete schedules[i3];
21417 } else if (+i3 < id2) {
21420 o2.on.call("cancel", node, node.__data__, o2.index, o2.group);
21421 delete schedules[i3];
21424 timeout_default(function() {
21425 if (self2.state === STARTED) {
21426 self2.state = RUNNING;
21427 self2.timer.restart(tick, self2.delay, self2.time);
21431 self2.state = STARTING;
21432 self2.on.call("start", node, node.__data__, self2.index, self2.group);
21433 if (self2.state !== STARTING)
21435 self2.state = STARTED;
21436 tween = new Array(n3 = self2.tween.length);
21437 for (i3 = 0, j3 = -1; i3 < n3; ++i3) {
21438 if (o2 = self2.tween[i3].value.call(node, node.__data__, self2.index, self2.group)) {
21442 tween.length = j3 + 1;
21444 function tick(elapsed) {
21445 var t2 = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop), self2.state = ENDING, 1), i3 = -1, n3 = tween.length;
21446 while (++i3 < n3) {
21447 tween[i3].call(node, t2);
21449 if (self2.state === ENDING) {
21450 self2.on.call("end", node, node.__data__, self2.index, self2.group);
21455 self2.state = ENDED;
21456 self2.timer.stop();
21457 delete schedules[id2];
21458 for (var i3 in schedules)
21460 delete node.__transition;
21464 // node_modules/d3-transition/src/interrupt.js
21465 function interrupt_default(node, name) {
21466 var schedules = node.__transition, schedule, active, empty2 = true, i3;
21469 name = name == null ? null : name + "";
21470 for (i3 in schedules) {
21471 if ((schedule = schedules[i3]).name !== name) {
21475 active = schedule.state > STARTING && schedule.state < ENDING;
21476 schedule.state = ENDED;
21477 schedule.timer.stop();
21478 schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
21479 delete schedules[i3];
21482 delete node.__transition;
21485 // node_modules/d3-transition/src/selection/interrupt.js
21486 function interrupt_default2(name) {
21487 return this.each(function() {
21488 interrupt_default(this, name);
21492 // node_modules/d3-transition/src/transition/tween.js
21493 function tweenRemove(id2, name) {
21494 var tween0, tween1;
21495 return function() {
21496 var schedule = set2(this, id2), tween = schedule.tween;
21497 if (tween !== tween0) {
21498 tween1 = tween0 = tween;
21499 for (var i3 = 0, n3 = tween1.length; i3 < n3; ++i3) {
21500 if (tween1[i3].name === name) {
21501 tween1 = tween1.slice();
21502 tween1.splice(i3, 1);
21507 schedule.tween = tween1;
21510 function tweenFunction(id2, name, value) {
21511 var tween0, tween1;
21512 if (typeof value !== "function")
21514 return function() {
21515 var schedule = set2(this, id2), tween = schedule.tween;
21516 if (tween !== tween0) {
21517 tween1 = (tween0 = tween).slice();
21518 for (var t2 = { name, value }, i3 = 0, n3 = tween1.length; i3 < n3; ++i3) {
21519 if (tween1[i3].name === name) {
21527 schedule.tween = tween1;
21530 function tween_default(name, value) {
21531 var id2 = this._id;
21533 if (arguments.length < 2) {
21534 var tween = get2(this.node(), id2).tween;
21535 for (var i3 = 0, n3 = tween.length, t2; i3 < n3; ++i3) {
21536 if ((t2 = tween[i3]).name === name) {
21542 return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
21544 function tweenValue(transition2, name, value) {
21545 var id2 = transition2._id;
21546 transition2.each(function() {
21547 var schedule = set2(this, id2);
21548 (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
21550 return function(node) {
21551 return get2(node, id2).value[name];
21555 // node_modules/d3-transition/src/transition/interpolate.js
21556 function interpolate_default(a2, b2) {
21558 return (typeof b2 === "number" ? number_default : b2 instanceof color ? rgb_default : (c2 = color(b2)) ? (b2 = c2, rgb_default) : string_default)(a2, b2);
21561 // node_modules/d3-transition/src/transition/attr.js
21562 function attrRemove2(name) {
21563 return function() {
21564 this.removeAttribute(name);
21567 function attrRemoveNS2(fullname) {
21568 return function() {
21569 this.removeAttributeNS(fullname.space, fullname.local);
21572 function attrConstant2(name, interpolate, value1) {
21573 var string00, string1 = value1 + "", interpolate0;
21574 return function() {
21575 var string0 = this.getAttribute(name);
21576 return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
21579 function attrConstantNS2(fullname, interpolate, value1) {
21580 var string00, string1 = value1 + "", interpolate0;
21581 return function() {
21582 var string0 = this.getAttributeNS(fullname.space, fullname.local);
21583 return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
21586 function attrFunction2(name, interpolate, value) {
21587 var string00, string10, interpolate0;
21588 return function() {
21589 var string0, value1 = value(this), string1;
21590 if (value1 == null)
21591 return void this.removeAttribute(name);
21592 string0 = this.getAttribute(name);
21593 string1 = value1 + "";
21594 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
21597 function attrFunctionNS2(fullname, interpolate, value) {
21598 var string00, string10, interpolate0;
21599 return function() {
21600 var string0, value1 = value(this), string1;
21601 if (value1 == null)
21602 return void this.removeAttributeNS(fullname.space, fullname.local);
21603 string0 = this.getAttributeNS(fullname.space, fullname.local);
21604 string1 = value1 + "";
21605 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
21608 function attr_default2(name, value) {
21609 var fullname = namespace_default(name), i3 = fullname === "transform" ? interpolateTransformSvg : interpolate_default;
21610 return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i3, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i3, value));
21613 // node_modules/d3-transition/src/transition/attrTween.js
21614 function attrInterpolate(name, i3) {
21615 return function(t2) {
21616 this.setAttribute(name, i3.call(this, t2));
21619 function attrInterpolateNS(fullname, i3) {
21620 return function(t2) {
21621 this.setAttributeNS(fullname.space, fullname.local, i3.call(this, t2));
21624 function attrTweenNS(fullname, value) {
21627 var i3 = value.apply(this, arguments);
21629 t0 = (i0 = i3) && attrInterpolateNS(fullname, i3);
21632 tween._value = value;
21635 function attrTween(name, value) {
21638 var i3 = value.apply(this, arguments);
21640 t0 = (i0 = i3) && attrInterpolate(name, i3);
21643 tween._value = value;
21646 function attrTween_default(name, value) {
21647 var key = "attr." + name;
21648 if (arguments.length < 2)
21649 return (key = this.tween(key)) && key._value;
21651 return this.tween(key, null);
21652 if (typeof value !== "function")
21654 var fullname = namespace_default(name);
21655 return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
21658 // node_modules/d3-transition/src/transition/delay.js
21659 function delayFunction(id2, value) {
21660 return function() {
21661 init(this, id2).delay = +value.apply(this, arguments);
21664 function delayConstant(id2, value) {
21665 return value = +value, function() {
21666 init(this, id2).delay = value;
21669 function delay_default(value) {
21670 var id2 = this._id;
21671 return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get2(this.node(), id2).delay;
21674 // node_modules/d3-transition/src/transition/duration.js
21675 function durationFunction(id2, value) {
21676 return function() {
21677 set2(this, id2).duration = +value.apply(this, arguments);
21680 function durationConstant(id2, value) {
21681 return value = +value, function() {
21682 set2(this, id2).duration = value;
21685 function duration_default(value) {
21686 var id2 = this._id;
21687 return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get2(this.node(), id2).duration;
21690 // node_modules/d3-transition/src/transition/ease.js
21691 function easeConstant(id2, value) {
21692 if (typeof value !== "function")
21694 return function() {
21695 set2(this, id2).ease = value;
21698 function ease_default(value) {
21699 var id2 = this._id;
21700 return arguments.length ? this.each(easeConstant(id2, value)) : get2(this.node(), id2).ease;
21703 // node_modules/d3-transition/src/transition/easeVarying.js
21704 function easeVarying(id2, value) {
21705 return function() {
21706 var v2 = value.apply(this, arguments);
21707 if (typeof v2 !== "function")
21709 set2(this, id2).ease = v2;
21712 function easeVarying_default(value) {
21713 if (typeof value !== "function")
21715 return this.each(easeVarying(this._id, value));
21718 // node_modules/d3-transition/src/transition/filter.js
21719 function filter_default2(match) {
21720 if (typeof match !== "function")
21721 match = matcher_default(match);
21722 for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j3 = 0; j3 < m2; ++j3) {
21723 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = [], node, i3 = 0; i3 < n3; ++i3) {
21724 if ((node = group[i3]) && match.call(node, node.__data__, i3, group)) {
21725 subgroup.push(node);
21729 return new Transition(subgroups, this._parents, this._name, this._id);
21732 // node_modules/d3-transition/src/transition/merge.js
21733 function merge_default2(transition2) {
21734 if (transition2._id !== this._id)
21736 for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j3 = 0; j3 < m2; ++j3) {
21737 for (var group0 = groups0[j3], group1 = groups1[j3], n3 = group0.length, merge2 = merges[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
21738 if (node = group0[i3] || group1[i3]) {
21743 for (; j3 < m0; ++j3) {
21744 merges[j3] = groups0[j3];
21746 return new Transition(merges, this._parents, this._name, this._id);
21749 // node_modules/d3-transition/src/transition/on.js
21750 function start(name) {
21751 return (name + "").trim().split(/^|\s+/).every(function(t2) {
21752 var i3 = t2.indexOf(".");
21754 t2 = t2.slice(0, i3);
21755 return !t2 || t2 === "start";
21758 function onFunction(id2, name, listener) {
21759 var on0, on1, sit = start(name) ? init : set2;
21760 return function() {
21761 var schedule = sit(this, id2), on = schedule.on;
21763 (on1 = (on0 = on).copy()).on(name, listener);
21767 function on_default2(name, listener) {
21768 var id2 = this._id;
21769 return arguments.length < 2 ? get2(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
21772 // node_modules/d3-transition/src/transition/remove.js
21773 function removeFunction(id2) {
21774 return function() {
21775 var parent = this.parentNode;
21776 for (var i3 in this.__transition)
21780 parent.removeChild(this);
21783 function remove_default2() {
21784 return this.on("end.remove", removeFunction(this._id));
21787 // node_modules/d3-transition/src/transition/select.js
21788 function select_default3(select) {
21789 var name = this._name, id2 = this._id;
21790 if (typeof select !== "function")
21791 select = selector_default(select);
21792 for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j3 = 0; j3 < m2; ++j3) {
21793 for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = new Array(n3), node, subnode, i3 = 0; i3 < n3; ++i3) {
21794 if ((node = group[i3]) && (subnode = select.call(node, node.__data__, i3, group))) {
21795 if ("__data__" in node)
21796 subnode.__data__ = node.__data__;
21797 subgroup[i3] = subnode;
21798 schedule_default(subgroup[i3], name, id2, i3, subgroup, get2(node, id2));
21802 return new Transition(subgroups, this._parents, name, id2);
21805 // node_modules/d3-transition/src/transition/selectAll.js
21806 function selectAll_default3(select) {
21807 var name = this._name, id2 = this._id;
21808 if (typeof select !== "function")
21809 select = selectorAll_default(select);
21810 for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j3 = 0; j3 < m2; ++j3) {
21811 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
21812 if (node = group[i3]) {
21813 for (var children2 = select.call(node, node.__data__, i3, group), child, inherit2 = get2(node, id2), k2 = 0, l2 = children2.length; k2 < l2; ++k2) {
21814 if (child = children2[k2]) {
21815 schedule_default(child, name, id2, k2, children2, inherit2);
21818 subgroups.push(children2);
21819 parents.push(node);
21823 return new Transition(subgroups, parents, name, id2);
21826 // node_modules/d3-transition/src/transition/selection.js
21827 var Selection2 = selection_default.prototype.constructor;
21828 function selection_default2() {
21829 return new Selection2(this._groups, this._parents);
21832 // node_modules/d3-transition/src/transition/style.js
21833 function styleNull(name, interpolate) {
21834 var string00, string10, interpolate0;
21835 return function() {
21836 var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
21837 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
21840 function styleRemove2(name) {
21841 return function() {
21842 this.style.removeProperty(name);
21845 function styleConstant2(name, interpolate, value1) {
21846 var string00, string1 = value1 + "", interpolate0;
21847 return function() {
21848 var string0 = styleValue(this, name);
21849 return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
21852 function styleFunction2(name, interpolate, value) {
21853 var string00, string10, interpolate0;
21854 return function() {
21855 var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
21856 if (value1 == null)
21857 string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
21858 return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
21861 function styleMaybeRemove(id2, name) {
21862 var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
21863 return function() {
21864 var schedule = set2(this, id2), on = schedule.on, listener = schedule.value[key] == null ? remove2 || (remove2 = styleRemove2(name)) : void 0;
21865 if (on !== on0 || listener0 !== listener)
21866 (on1 = (on0 = on).copy()).on(event, listener0 = listener);
21870 function style_default2(name, value, priority) {
21871 var i3 = (name += "") === "transform" ? interpolateTransformCss : interpolate_default;
21872 return value == null ? this.styleTween(name, styleNull(name, i3)).on("end.style." + name, styleRemove2(name)) : typeof value === "function" ? this.styleTween(name, styleFunction2(name, i3, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i3, value), priority).on("end.style." + name, null);
21875 // node_modules/d3-transition/src/transition/styleTween.js
21876 function styleInterpolate(name, i3, priority) {
21877 return function(t2) {
21878 this.style.setProperty(name, i3.call(this, t2), priority);
21881 function styleTween(name, value, priority) {
21884 var i3 = value.apply(this, arguments);
21886 t2 = (i0 = i3) && styleInterpolate(name, i3, priority);
21889 tween._value = value;
21892 function styleTween_default(name, value, priority) {
21893 var key = "style." + (name += "");
21894 if (arguments.length < 2)
21895 return (key = this.tween(key)) && key._value;
21897 return this.tween(key, null);
21898 if (typeof value !== "function")
21900 return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
21903 // node_modules/d3-transition/src/transition/text.js
21904 function textConstant2(value) {
21905 return function() {
21906 this.textContent = value;
21909 function textFunction2(value) {
21910 return function() {
21911 var value1 = value(this);
21912 this.textContent = value1 == null ? "" : value1;
21915 function text_default2(value) {
21916 return this.tween("text", typeof value === "function" ? textFunction2(tweenValue(this, "text", value)) : textConstant2(value == null ? "" : value + ""));
21919 // node_modules/d3-transition/src/transition/textTween.js
21920 function textInterpolate(i3) {
21921 return function(t2) {
21922 this.textContent = i3.call(this, t2);
21925 function textTween(value) {
21928 var i3 = value.apply(this, arguments);
21930 t0 = (i0 = i3) && textInterpolate(i3);
21933 tween._value = value;
21936 function textTween_default(value) {
21938 if (arguments.length < 1)
21939 return (key = this.tween(key)) && key._value;
21941 return this.tween(key, null);
21942 if (typeof value !== "function")
21944 return this.tween(key, textTween(value));
21947 // node_modules/d3-transition/src/transition/transition.js
21948 function transition_default() {
21949 var name = this._name, id0 = this._id, id1 = newId();
21950 for (var groups = this._groups, m2 = groups.length, j3 = 0; j3 < m2; ++j3) {
21951 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
21952 if (node = group[i3]) {
21953 var inherit2 = get2(node, id0);
21954 schedule_default(node, name, id1, i3, group, {
21955 time: inherit2.time + inherit2.delay + inherit2.duration,
21957 duration: inherit2.duration,
21958 ease: inherit2.ease
21963 return new Transition(groups, this._parents, name, id1);
21966 // node_modules/d3-transition/src/transition/end.js
21967 function end_default() {
21968 var on0, on1, that = this, id2 = that._id, size = that.size();
21969 return new Promise(function(resolve, reject) {
21970 var cancel = { value: reject }, end = { value: function() {
21974 that.each(function() {
21975 var schedule = set2(this, id2), on = schedule.on;
21977 on1 = (on0 = on).copy();
21978 on1._.cancel.push(cancel);
21979 on1._.interrupt.push(cancel);
21980 on1._.end.push(end);
21989 // node_modules/d3-transition/src/transition/index.js
21991 function Transition(groups, parents, name, id2) {
21992 this._groups = groups;
21993 this._parents = parents;
21997 function transition(name) {
21998 return selection_default().transition(name);
22003 var selection_prototype = selection_default.prototype;
22004 Transition.prototype = transition.prototype = {
22005 constructor: Transition,
22006 select: select_default3,
22007 selectAll: selectAll_default3,
22008 selectChild: selection_prototype.selectChild,
22009 selectChildren: selection_prototype.selectChildren,
22010 filter: filter_default2,
22011 merge: merge_default2,
22012 selection: selection_default2,
22013 transition: transition_default,
22014 call: selection_prototype.call,
22015 nodes: selection_prototype.nodes,
22016 node: selection_prototype.node,
22017 size: selection_prototype.size,
22018 empty: selection_prototype.empty,
22019 each: selection_prototype.each,
22021 attr: attr_default2,
22022 attrTween: attrTween_default,
22023 style: style_default2,
22024 styleTween: styleTween_default,
22025 text: text_default2,
22026 textTween: textTween_default,
22027 remove: remove_default2,
22028 tween: tween_default,
22029 delay: delay_default,
22030 duration: duration_default,
22031 ease: ease_default,
22032 easeVarying: easeVarying_default,
22034 [Symbol.iterator]: selection_prototype[Symbol.iterator]
22037 // node_modules/d3-ease/src/linear.js
22038 var linear2 = (t2) => +t2;
22040 // node_modules/d3-ease/src/cubic.js
22041 function cubicInOut(t2) {
22042 return ((t2 *= 2) <= 1 ? t2 * t2 * t2 : (t2 -= 2) * t2 * t2 + 2) / 2;
22045 // node_modules/d3-transition/src/selection/transition.js
22046 var defaultTiming = {
22053 function inherit(node, id2) {
22055 while (!(timing = node.__transition) || !(timing = timing[id2])) {
22056 if (!(node = node.parentNode)) {
22057 throw new Error(`transition ${id2} not found`);
22062 function transition_default2(name) {
22064 if (name instanceof Transition) {
22065 id2 = name._id, name = name._name;
22067 id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
22069 for (var groups = this._groups, m2 = groups.length, j3 = 0; j3 < m2; ++j3) {
22070 for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
22071 if (node = group[i3]) {
22072 schedule_default(node, name, id2, i3, group, timing || inherit(node, id2));
22076 return new Transition(groups, this._parents, name, id2);
22079 // node_modules/d3-transition/src/selection/index.js
22080 selection_default.prototype.interrupt = interrupt_default2;
22081 selection_default.prototype.transition = transition_default2;
22083 // node_modules/d3-zoom/src/constant.js
22084 var constant_default4 = (x2) => () => x2;
22086 // node_modules/d3-zoom/src/event.js
22087 function ZoomEvent(type2, {
22090 transform: transform2,
22091 dispatch: dispatch14
22093 Object.defineProperties(this, {
22094 type: { value: type2, enumerable: true, configurable: true },
22095 sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
22096 target: { value: target, enumerable: true, configurable: true },
22097 transform: { value: transform2, enumerable: true, configurable: true },
22098 _: { value: dispatch14 }
22102 // node_modules/d3-zoom/src/transform.js
22103 function Transform(k2, x2, y2) {
22108 Transform.prototype = {
22109 constructor: Transform,
22110 scale: function(k2) {
22111 return k2 === 1 ? this : new Transform(this.k * k2, this.x, this.y);
22113 translate: function(x2, y2) {
22114 return x2 === 0 & y2 === 0 ? this : new Transform(this.k, this.x + this.k * x2, this.y + this.k * y2);
22116 apply: function(point2) {
22117 return [point2[0] * this.k + this.x, point2[1] * this.k + this.y];
22119 applyX: function(x2) {
22120 return x2 * this.k + this.x;
22122 applyY: function(y2) {
22123 return y2 * this.k + this.y;
22125 invert: function(location) {
22126 return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
22128 invertX: function(x2) {
22129 return (x2 - this.x) / this.k;
22131 invertY: function(y2) {
22132 return (y2 - this.y) / this.k;
22134 rescaleX: function(x2) {
22135 return x2.copy().domain(x2.range().map(this.invertX, this).map(x2.invert, x2));
22137 rescaleY: function(y2) {
22138 return y2.copy().domain(y2.range().map(this.invertY, this).map(y2.invert, y2));
22140 toString: function() {
22141 return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
22144 var identity2 = new Transform(1, 0, 0);
22145 transform.prototype = Transform.prototype;
22146 function transform(node) {
22147 while (!node.__zoom)
22148 if (!(node = node.parentNode))
22150 return node.__zoom;
22153 // node_modules/d3-zoom/src/noevent.js
22154 function nopropagation2(event) {
22155 event.stopImmediatePropagation();
22157 function noevent_default2(event) {
22158 event.preventDefault();
22159 event.stopImmediatePropagation();
22162 // node_modules/d3-zoom/src/zoom.js
22163 function defaultFilter2(event) {
22164 return (!event.ctrlKey || event.type === "wheel") && !event.button;
22166 function defaultExtent() {
22168 if (e3 instanceof SVGElement) {
22169 e3 = e3.ownerSVGElement || e3;
22170 if (e3.hasAttribute("viewBox")) {
22171 e3 = e3.viewBox.baseVal;
22172 return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
22174 return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
22176 return [[0, 0], [e3.clientWidth, e3.clientHeight]];
22178 function defaultTransform() {
22179 return this.__zoom || identity2;
22181 function defaultWheelDelta(event) {
22182 return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
22184 function defaultTouchable2() {
22185 return navigator.maxTouchPoints || "ontouchstart" in this;
22187 function defaultConstrain(transform2, extent, translateExtent) {
22188 var dx0 = transform2.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform2.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform2.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform2.invertY(extent[1][1]) - translateExtent[1][1];
22189 return transform2.translate(
22190 dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
22191 dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
22194 function zoom_default2() {
22195 var filter2 = defaultFilter2, extent = defaultExtent, constrain = defaultConstrain, wheelDelta = defaultWheelDelta, touchable = defaultTouchable2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], duration = 250, interpolate = zoom_default, listeners = dispatch_default("start", "zoom", "end"), touchstarting, touchfirst, touchending, touchDelay = 500, wheelDelay = 150, clickDistance2 = 0, tapDistance = 10;
22196 function zoom(selection2) {
22197 selection2.property("__zoom", defaultTransform).on("wheel.zoom", wheeled, { passive: false }).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
22199 zoom.transform = function(collection, transform2, point2, event) {
22200 var selection2 = collection.selection ? collection.selection() : collection;
22201 selection2.property("__zoom", defaultTransform);
22202 if (collection !== selection2) {
22203 schedule(collection, transform2, point2, event);
22205 selection2.interrupt().each(function() {
22206 gesture(this, arguments).event(event).start().zoom(null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end();
22210 zoom.scaleBy = function(selection2, k2, p2, event) {
22211 zoom.scaleTo(selection2, function() {
22212 var k0 = this.__zoom.k, k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
22216 zoom.scaleTo = function(selection2, k2, p2, event) {
22217 zoom.transform(selection2, function() {
22218 var e3 = extent.apply(this, arguments), t0 = this.__zoom, p02 = p2 == null ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2, p1 = t0.invert(p02), k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
22219 return constrain(translate(scale(t0, k1), p02, p1), e3, translateExtent);
22222 zoom.translateBy = function(selection2, x2, y2, event) {
22223 zoom.transform(selection2, function() {
22224 return constrain(this.__zoom.translate(
22225 typeof x2 === "function" ? x2.apply(this, arguments) : x2,
22226 typeof y2 === "function" ? y2.apply(this, arguments) : y2
22227 ), extent.apply(this, arguments), translateExtent);
22230 zoom.translateTo = function(selection2, x2, y2, p2, event) {
22231 zoom.transform(selection2, function() {
22232 var e3 = extent.apply(this, arguments), t2 = this.__zoom, p02 = p2 == null ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
22233 return constrain(identity2.translate(p02[0], p02[1]).scale(t2.k).translate(
22234 typeof x2 === "function" ? -x2.apply(this, arguments) : -x2,
22235 typeof y2 === "function" ? -y2.apply(this, arguments) : -y2
22236 ), e3, translateExtent);
22239 function scale(transform2, k2) {
22240 k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k2));
22241 return k2 === transform2.k ? transform2 : new Transform(k2, transform2.x, transform2.y);
22243 function translate(transform2, p02, p1) {
22244 var x2 = p02[0] - p1[0] * transform2.k, y2 = p02[1] - p1[1] * transform2.k;
22245 return x2 === transform2.x && y2 === transform2.y ? transform2 : new Transform(transform2.k, x2, y2);
22247 function centroid(extent2) {
22248 return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
22250 function schedule(transition2, transform2, point2, event) {
22251 transition2.on("start.zoom", function() {
22252 gesture(this, arguments).event(event).start();
22253 }).on("interrupt.zoom end.zoom", function() {
22254 gesture(this, arguments).event(event).end();
22255 }).tween("zoom", function() {
22256 var that = this, args = arguments, g3 = gesture(that, args).event(event), e3 = extent.apply(that, args), p2 = point2 == null ? centroid(e3) : typeof point2 === "function" ? point2.apply(that, args) : point2, w2 = Math.max(e3[1][0] - e3[0][0], e3[1][1] - e3[0][1]), a2 = that.__zoom, b2 = typeof transform2 === "function" ? transform2.apply(that, args) : transform2, i3 = interpolate(a2.invert(p2).concat(w2 / a2.k), b2.invert(p2).concat(w2 / b2.k));
22257 return function(t2) {
22261 var l2 = i3(t2), k2 = w2 / l2[2];
22262 t2 = new Transform(k2, p2[0] - l2[0] * k2, p2[1] - l2[1] * k2);
22268 function gesture(that, args, clean2) {
22269 return !clean2 && that.__zooming || new Gesture(that, args);
22271 function Gesture(that, args) {
22275 this.sourceEvent = null;
22276 this.extent = extent.apply(that, args);
22279 Gesture.prototype = {
22280 event: function(event) {
22282 this.sourceEvent = event;
22285 start: function() {
22286 if (++this.active === 1) {
22287 this.that.__zooming = this;
22288 this.emit("start");
22292 zoom: function(key, transform2) {
22293 if (this.mouse && key !== "mouse")
22294 this.mouse[1] = transform2.invert(this.mouse[0]);
22295 if (this.touch0 && key !== "touch")
22296 this.touch0[1] = transform2.invert(this.touch0[0]);
22297 if (this.touch1 && key !== "touch")
22298 this.touch1[1] = transform2.invert(this.touch1[0]);
22299 this.that.__zoom = transform2;
22304 if (--this.active === 0) {
22305 delete this.that.__zooming;
22310 emit: function(type2) {
22311 var d2 = select_default2(this.that).datum();
22315 new ZoomEvent(type2, {
22316 sourceEvent: this.sourceEvent,
22319 transform: this.that.__zoom,
22320 dispatch: listeners
22326 function wheeled(event, ...args) {
22327 if (!filter2.apply(this, arguments))
22329 var g3 = gesture(this, args).event(event), t2 = this.__zoom, k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p2 = pointer_default(event);
22331 if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
22332 g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
22334 clearTimeout(g3.wheel);
22335 } else if (t2.k === k2)
22338 g3.mouse = [p2, t2.invert(p2)];
22339 interrupt_default(this);
22342 noevent_default2(event);
22343 g3.wheel = setTimeout(wheelidled, wheelDelay);
22344 g3.zoom("mouse", constrain(translate(scale(t2, k2), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
22345 function wheelidled() {
22350 function mousedowned(event, ...args) {
22351 if (touchending || !filter2.apply(this, arguments))
22353 var currentTarget = event.currentTarget, g3 = gesture(this, args, true).event(event), v2 = select_default2(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), p2 = pointer_default(event, currentTarget), x05 = event.clientX, y05 = event.clientY;
22354 nodrag_default(event.view);
22355 nopropagation2(event);
22356 g3.mouse = [p2, this.__zoom.invert(p2)];
22357 interrupt_default(this);
22359 function mousemoved(event2) {
22360 noevent_default2(event2);
22362 var dx = event2.clientX - x05, dy = event2.clientY - y05;
22363 g3.moved = dx * dx + dy * dy > clickDistance2;
22365 g3.event(event2).zoom("mouse", constrain(translate(g3.that.__zoom, g3.mouse[0] = pointer_default(event2, currentTarget), g3.mouse[1]), g3.extent, translateExtent));
22367 function mouseupped(event2) {
22368 v2.on("mousemove.zoom mouseup.zoom", null);
22369 yesdrag(event2.view, g3.moved);
22370 noevent_default2(event2);
22371 g3.event(event2).end();
22374 function dblclicked(event, ...args) {
22375 if (!filter2.apply(this, arguments))
22377 var t0 = this.__zoom, p02 = pointer_default(event.changedTouches ? event.changedTouches[0] : event, this), p1 = t0.invert(p02), k1 = t0.k * (event.shiftKey ? 0.5 : 2), t1 = constrain(translate(scale(t0, k1), p02, p1), extent.apply(this, args), translateExtent);
22378 noevent_default2(event);
22380 select_default2(this).transition().duration(duration).call(schedule, t1, p02, event);
22382 select_default2(this).call(zoom.transform, t1, p02, event);
22384 function touchstarted(event, ...args) {
22385 if (!filter2.apply(this, arguments))
22387 var touches = event.touches, n3 = touches.length, g3 = gesture(this, args, event.changedTouches.length === n3).event(event), started, i3, t2, p2;
22388 nopropagation2(event);
22389 for (i3 = 0; i3 < n3; ++i3) {
22390 t2 = touches[i3], p2 = pointer_default(t2, this);
22391 p2 = [p2, this.__zoom.invert(p2), t2.identifier];
22393 g3.touch0 = p2, started = true, g3.taps = 1 + !!touchstarting;
22394 else if (!g3.touch1 && g3.touch0[2] !== p2[2])
22395 g3.touch1 = p2, g3.taps = 0;
22398 touchstarting = clearTimeout(touchstarting);
22401 touchfirst = p2[0], touchstarting = setTimeout(function() {
22402 touchstarting = null;
22404 interrupt_default(this);
22408 function touchmoved(event, ...args) {
22409 if (!this.__zooming)
22411 var g3 = gesture(this, args).event(event), touches = event.changedTouches, n3 = touches.length, i3, t2, p2, l2;
22412 noevent_default2(event);
22413 for (i3 = 0; i3 < n3; ++i3) {
22414 t2 = touches[i3], p2 = pointer_default(t2, this);
22415 if (g3.touch0 && g3.touch0[2] === t2.identifier)
22417 else if (g3.touch1 && g3.touch1[2] === t2.identifier)
22420 t2 = g3.that.__zoom;
22422 var p02 = g3.touch0[0], l0 = g3.touch0[1], p1 = g3.touch1[0], l1 = g3.touch1[1], dp = (dp = p1[0] - p02[0]) * dp + (dp = p1[1] - p02[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
22423 t2 = scale(t2, Math.sqrt(dp / dl));
22424 p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
22425 l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
22426 } else if (g3.touch0)
22427 p2 = g3.touch0[0], l2 = g3.touch0[1];
22430 g3.zoom("touch", constrain(translate(t2, p2, l2), g3.extent, translateExtent));
22432 function touchended(event, ...args) {
22433 if (!this.__zooming)
22435 var g3 = gesture(this, args).event(event), touches = event.changedTouches, n3 = touches.length, i3, t2;
22436 nopropagation2(event);
22438 clearTimeout(touchending);
22439 touchending = setTimeout(function() {
22440 touchending = null;
22442 for (i3 = 0; i3 < n3; ++i3) {
22444 if (g3.touch0 && g3.touch0[2] === t2.identifier)
22446 else if (g3.touch1 && g3.touch1[2] === t2.identifier)
22449 if (g3.touch1 && !g3.touch0)
22450 g3.touch0 = g3.touch1, delete g3.touch1;
22452 g3.touch0[1] = this.__zoom.invert(g3.touch0[0]);
22455 if (g3.taps === 2) {
22456 t2 = pointer_default(t2, this);
22457 if (Math.hypot(touchfirst[0] - t2[0], touchfirst[1] - t2[1]) < tapDistance) {
22458 var p2 = select_default2(this).on("dblclick.zoom");
22460 p2.apply(this, arguments);
22465 zoom.wheelDelta = function(_2) {
22466 return arguments.length ? (wheelDelta = typeof _2 === "function" ? _2 : constant_default4(+_2), zoom) : wheelDelta;
22468 zoom.filter = function(_2) {
22469 return arguments.length ? (filter2 = typeof _2 === "function" ? _2 : constant_default4(!!_2), zoom) : filter2;
22471 zoom.touchable = function(_2) {
22472 return arguments.length ? (touchable = typeof _2 === "function" ? _2 : constant_default4(!!_2), zoom) : touchable;
22474 zoom.extent = function(_2) {
22475 return arguments.length ? (extent = typeof _2 === "function" ? _2 : constant_default4([[+_2[0][0], +_2[0][1]], [+_2[1][0], +_2[1][1]]]), zoom) : extent;
22477 zoom.scaleExtent = function(_2) {
22478 return arguments.length ? (scaleExtent[0] = +_2[0], scaleExtent[1] = +_2[1], zoom) : [scaleExtent[0], scaleExtent[1]];
22480 zoom.translateExtent = function(_2) {
22481 return arguments.length ? (translateExtent[0][0] = +_2[0][0], translateExtent[1][0] = +_2[1][0], translateExtent[0][1] = +_2[0][1], translateExtent[1][1] = +_2[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
22483 zoom.constrain = function(_2) {
22484 return arguments.length ? (constrain = _2, zoom) : constrain;
22486 zoom.duration = function(_2) {
22487 return arguments.length ? (duration = +_2, zoom) : duration;
22489 zoom.interpolate = function(_2) {
22490 return arguments.length ? (interpolate = _2, zoom) : interpolate;
22492 zoom.on = function() {
22493 var value = listeners.on.apply(listeners, arguments);
22494 return value === listeners ? zoom : value;
22496 zoom.clickDistance = function(_2) {
22497 return arguments.length ? (clickDistance2 = (_2 = +_2) * _2, zoom) : Math.sqrt(clickDistance2);
22499 zoom.tapDistance = function(_2) {
22500 return arguments.length ? (tapDistance = +_2, zoom) : tapDistance;
22505 // modules/geo/raw_mercator.js
22506 function geoRawMercator() {
22507 var project = mercatorRaw;
22508 var k2 = 512 / Math.PI;
22511 var clipExtent = [[0, 0], [0, 0]];
22512 function projection2(point2) {
22513 point2 = project(point2[0] * Math.PI / 180, point2[1] * Math.PI / 180);
22514 return [point2[0] * k2 + x2, y2 - point2[1] * k2];
22516 projection2.invert = function(point2) {
22517 point2 = project.invert((point2[0] - x2) / k2, (y2 - point2[1]) / k2);
22518 return point2 && [point2[0] * 180 / Math.PI, point2[1] * 180 / Math.PI];
22520 projection2.scale = function(_2) {
22521 if (!arguments.length)
22524 return projection2;
22526 projection2.translate = function(_2) {
22527 if (!arguments.length)
22531 return projection2;
22533 projection2.clipExtent = function(_2) {
22534 if (!arguments.length)
22537 return projection2;
22539 projection2.transform = function(obj) {
22540 if (!arguments.length)
22541 return identity2.translate(x2, y2).scale(k2);
22545 return projection2;
22547 projection2.stream = transform_default({
22548 point: function(x3, y3) {
22549 var vec = projection2([x3, y3]);
22550 this.stream.point(vec[0], vec[1]);
22553 return projection2;
22556 // modules/geo/ortho.js
22557 function geoOrthoNormalizedDotProduct(a2, b2, origin) {
22558 if (geoVecEqual(origin, a2) || geoVecEqual(origin, b2)) {
22561 return geoVecNormalizedDot(a2, b2, origin);
22563 function geoOrthoFilterDotProduct(dotp, epsilon3, lowerThreshold, upperThreshold, allowStraightAngles) {
22564 var val = Math.abs(dotp);
22565 if (val < epsilon3) {
22567 } else if (allowStraightAngles && Math.abs(val - 1) < epsilon3) {
22569 } else if (val < lowerThreshold || val > upperThreshold) {
22575 function geoOrthoCalcScore(points, isClosed, epsilon3, threshold) {
22577 var first = isClosed ? 0 : 1;
22578 var last = isClosed ? points.length : points.length - 1;
22579 var coords = points.map(function(p2) {
22582 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
22583 var upperThreshold = Math.cos(threshold * Math.PI / 180);
22584 for (var i3 = first; i3 < last; i3++) {
22585 var a2 = coords[(i3 - 1 + coords.length) % coords.length];
22586 var origin = coords[i3];
22587 var b2 = coords[(i3 + 1) % coords.length];
22588 var dotp = geoOrthoFilterDotProduct(geoOrthoNormalizedDotProduct(a2, b2, origin), epsilon3, lowerThreshold, upperThreshold);
22591 score = score + 2 * Math.min(Math.abs(dotp - 1), Math.min(Math.abs(dotp), Math.abs(dotp + 1)));
22595 function geoOrthoMaxOffsetAngle(coords, isClosed, lessThan) {
22596 var max3 = -Infinity;
22597 var first = isClosed ? 0 : 1;
22598 var last = isClosed ? coords.length : coords.length - 1;
22599 for (var i3 = first; i3 < last; i3++) {
22600 var a2 = coords[(i3 - 1 + coords.length) % coords.length];
22601 var origin = coords[i3];
22602 var b2 = coords[(i3 + 1) % coords.length];
22603 var normalizedDotP = geoOrthoNormalizedDotProduct(a2, b2, origin);
22604 var angle2 = Math.acos(Math.abs(normalizedDotP)) * 180 / Math.PI;
22606 angle2 = 90 - angle2;
22607 if (angle2 >= lessThan)
22612 if (max3 === -Infinity)
22616 function geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles) {
22618 var first = isClosed ? 0 : 1;
22619 var last = isClosed ? coords.length : coords.length - 1;
22620 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
22621 var upperThreshold = Math.cos(threshold * Math.PI / 180);
22622 for (var i3 = first; i3 < last; i3++) {
22623 var a2 = coords[(i3 - 1 + coords.length) % coords.length];
22624 var origin = coords[i3];
22625 var b2 = coords[(i3 + 1) % coords.length];
22626 var dotp = geoOrthoFilterDotProduct(geoOrthoNormalizedDotProduct(a2, b2, origin), epsilon3, lowerThreshold, upperThreshold, allowStraightAngles);
22629 if (Math.abs(dotp) > 0)
22636 // modules/util/array.js
22637 function utilArrayIdentical(a2, b2) {
22640 var i3 = a2.length;
22641 if (i3 !== b2.length)
22644 if (a2[i3] !== b2[i3])
22649 function utilArrayDifference(a2, b2) {
22650 var other = new Set(b2);
22651 return Array.from(new Set(a2)).filter(function(v2) {
22652 return !other.has(v2);
22655 function utilArrayIntersection(a2, b2) {
22656 var other = new Set(b2);
22657 return Array.from(new Set(a2)).filter(function(v2) {
22658 return other.has(v2);
22661 function utilArrayUnion(a2, b2) {
22662 var result = new Set(a2);
22663 b2.forEach(function(v2) {
22666 return Array.from(result);
22668 function utilArrayUniq(a2) {
22669 return Array.from(new Set(a2));
22671 function utilArrayChunk(a2, chunkSize) {
22672 if (!chunkSize || chunkSize < 0)
22673 return [a2.slice()];
22674 var result = new Array(Math.ceil(a2.length / chunkSize));
22675 return Array.from(result, function(item, i3) {
22676 return a2.slice(i3 * chunkSize, i3 * chunkSize + chunkSize);
22679 function utilArrayFlatten(a2) {
22680 return a2.reduce(function(acc, val) {
22681 return acc.concat(val);
22684 function utilArrayGroupBy(a2, key) {
22685 return a2.reduce(function(acc, item) {
22686 var group = typeof key === "function" ? key(item) : item[key];
22687 (acc[group] = acc[group] || []).push(item);
22691 function utilArrayUniqBy(a2, key) {
22692 var seen = /* @__PURE__ */ new Set();
22693 return a2.reduce(function(acc, item) {
22694 var val = typeof key === "function" ? key(item) : item[key];
22695 if (val && !seen.has(val)) {
22703 // modules/util/util.js
22704 var import_diacritics = __toESM(require_diacritics());
22706 // modules/util/svg_paths_rtl_fix.js
22707 var import_alif_toolkit = __toESM(require_lib());
22708 var rtlRegex = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u07BF\u08A0–\u08BF]/;
22709 function fixRTLTextForSvg(inputText) {
22710 var ret = "", rtlBuffer = [];
22711 var arabicRegex = /[\u0600-\u06FF]/g;
22712 var arabicDiacritics = /[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g;
22713 var arabicMath = /[\u0660-\u066C\u06F0-\u06F9]+/g;
22714 var thaanaVowel = /[\u07A6-\u07B0]/;
22715 var hebrewSign = /[\u0591-\u05bd\u05bf\u05c1-\u05c5\u05c7]/;
22716 if (arabicRegex.test(inputText)) {
22717 inputText = (0, import_alif_toolkit.WordShaper)(inputText);
22719 for (var n3 = 0; n3 < inputText.length; n3++) {
22720 var c2 = inputText[n3];
22721 if (arabicMath.test(c2)) {
22722 ret += rtlBuffer.reverse().join("");
22725 if (rtlBuffer.length && arabicMath.test(rtlBuffer[rtlBuffer.length - 1])) {
22726 ret += rtlBuffer.reverse().join("");
22729 if ((thaanaVowel.test(c2) || hebrewSign.test(c2) || arabicDiacritics.test(c2)) && rtlBuffer.length) {
22730 rtlBuffer[rtlBuffer.length - 1] += c2;
22731 } else if (rtlRegex.test(c2) || c2.charCodeAt(0) >= 64336 && c2.charCodeAt(0) <= 65023 || c2.charCodeAt(0) >= 65136 && c2.charCodeAt(0) <= 65279) {
22732 rtlBuffer.push(c2);
22733 } else if (c2 === " " && rtlBuffer.length) {
22734 rtlBuffer = [rtlBuffer.reverse().join("") + " "];
22736 ret += rtlBuffer.reverse().join("") + c2;
22741 ret += rtlBuffer.reverse().join("");
22745 // modules/core/preferences.js
22748 _storage = localStorage;
22751 _storage = _storage || (() => {
22754 getItem: (k2) => s2[k2],
22755 setItem: (k2, v2) => s2[k2] = v2,
22756 removeItem: (k2) => delete s2[k2]
22759 var _listeners = {};
22760 function corePreferences(k2, v2) {
22763 return _storage.getItem(k2);
22764 else if (v2 === null)
22765 _storage.removeItem(k2);
22767 _storage.setItem(k2, v2);
22768 if (_listeners[k2]) {
22769 _listeners[k2].forEach((handler) => handler(v2));
22773 if (typeof console !== "undefined") {
22774 console.error("localStorage quota exceeded");
22779 corePreferences.onChange = function(k2, handler) {
22780 _listeners[k2] = _listeners[k2] || [];
22781 _listeners[k2].push(handler);
22784 // modules/core/file_fetcher.js
22785 var import_vparse = __toESM(require_vparse());
22788 var presetsCdnUrl = "https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@{presets_version}/";
22789 var ociCdnUrl = "https://cdn.jsdelivr.net/npm/osm-community-index@{version}/";
22790 var wmfSitematrixCdnUrl = "https://cdn.jsdelivr.net/npm/wmf-sitematrix@{version}/";
22791 var nsiCdnUrl = "https://cdn.jsdelivr.net/npm/name-suggestion-index@{version}/";
22792 var defaultOsmApiConnections = {
22794 url: "https://www.openstreetmap.org",
22795 client_id: "0tmNTmd0Jo1dQp4AUmMBLtGiD9YpMuXzHefitcuVStc",
22796 client_secret: "BTlNrNxIPitHdL4sP2clHw5KLoee9aKkA7dQbc0Bj7Q"
22799 url: "https://api06.dev.openstreetmap.org",
22800 client_id: "Ee1wWJ6UlpERbF6BfTNOpwn0R8k_06mvMXdDUkeHMgw",
22801 client_secret: "OnfWFC-JkZNHyYdr_viNn_h_RTZXRslKcUxllOXqf5g"
22804 var osmApiConnections = [];
22806 osmApiConnections.push({
22809 client_secret: null
22811 } else if (false) {
22812 osmApiConnections.push(defaultOsmApiConnections[null]);
22814 osmApiConnections.push(defaultOsmApiConnections.live);
22815 osmApiConnections.push(defaultOsmApiConnections.dev);
22817 var taginfoApiUrl = "https://taginfo.openstreetmap.org/api/4/";
22818 var nominatimApiUrl = "https://nominatim.openstreetmap.org/";
22821 var package_default = {
22824 description: "A friendly editor for OpenStreetMap",
22825 main: "dist/iD.min.js",
22826 repository: "github:openstreetmap/iD",
22827 homepage: "https://github.com/openstreetmap/iD",
22828 bugs: "https://github.com/openstreetmap/iD/issues",
22835 all: "run-s clean build dist",
22836 build: "run-s build:css build:data build:js",
22837 "build:css": "node scripts/build_css.js",
22838 "build:data": "shx mkdir -p dist/data && node scripts/build_data.js",
22839 "build:stats": "node config/esbuild.config.mjs --stats && esbuild-visualizer --metadata dist/esbuild.json --exclude *.png --filename docs/statistics.html && shx rm dist/esbuild.json",
22840 "build:js": "node config/esbuild.config.mjs",
22841 "build:js:watch": "node config/esbuild.config.mjs --watch",
22842 clean: "shx rm -f dist/esbuild.json dist/*.js dist/*.map dist/*.css dist/img/*.svg",
22843 dist: "run-p dist:**",
22844 "dist:mapillary": "shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/",
22845 "dist:pannellum": "shx mkdir -p dist/pannellum && shx cp -R node_modules/pannellum/build/* dist/pannellum/",
22846 "dist:min": "node config/esbuild.config.min.mjs",
22847 "dist:svg:iD": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "iD-%s" --symbol-sprite dist/img/iD-sprite.svg "svg/iD-sprite/**/*.svg"',
22848 "dist:svg:community": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "community-%s" --symbol-sprite dist/img/community-sprite.svg node_modules/osm-community-index/dist/img/*.svg',
22849 "dist:svg:fa": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/fa-sprite.svg svg/fontawesome/*.svg",
22850 "dist:svg:maki": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "maki-%s" --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg',
22851 "dist:svg:mapillary:signs": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-sprite.svg node_modules/mapillary_sprite_source/package_signs/*.svg",
22852 "dist:svg:mapillary:objects": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-object-sprite.svg node_modules/mapillary_sprite_source/package_objects/*.svg",
22853 "dist:svg:roentgen": 'svg-sprite --shape-id-generator "roentgen-%s" --shape-dim-width 16 --shape-dim-height 16 --symbol --symbol-dest . --symbol-sprite dist/img/roentgen-sprite.svg svg/roentgen/*.svg',
22854 "dist:svg:temaki": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "temaki-%s" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@rapideditor/temaki/icons/*.svg',
22855 imagery: "node scripts/update_imagery.js",
22856 lint: "eslint config scripts test/spec modules --ext js,mjs",
22857 "lint:fix": "eslint scripts test/spec modules --fix",
22858 start: "run-s start:watch",
22859 "start:single-build": "run-p build:js start:server",
22860 "start:watch": "run-p build:js:watch start:server",
22861 "start:server": "node scripts/server.js",
22862 test: "npm-run-all -s lint build test:spec",
22863 "test:spec": "karma start config/karma.conf.js",
22864 translations: "node scripts/update_locales.js"
22867 "@mapbox/geojson-area": "^0.2.2",
22868 "@mapbox/sexagesimal": "1.2.0",
22869 "@mapbox/vector-tile": "^1.3.1",
22870 "@rapideditor/country-coder": "~5.2.0",
22871 "@rapideditor/location-conflation": "~1.2.1",
22872 "@tmcw/togeojson": "^5.8.1",
22873 "@turf/bbox": "^6.0.0",
22874 "@turf/bbox-clip": "^6.0.0",
22875 "abortcontroller-polyfill": "^1.7.5",
22876 "aes-js": "^3.1.2",
22877 "alif-toolkit": "^1.2.9",
22878 "core-js-bundle": "^3.32.0",
22879 diacritics: "1.3.0",
22881 "fast-deep-equal": "~3.1.1",
22882 "fast-json-stable-stringify": "2.1.0",
22883 "lodash-es": "~4.17.15",
22885 "node-diff3": "~3.1.0",
22886 "osm-auth": "~2.2.0",
22887 pannellum: "2.5.6",
22889 "polygon-clipping": "~0.15.1",
22891 "whatwg-fetch": "^3.6.17",
22892 "which-polygon": "2.2.1"
22895 "@fortawesome/fontawesome-svg-core": "~6.4.2",
22896 "@fortawesome/free-brands-svg-icons": "~6.4.2",
22897 "@fortawesome/free-regular-svg-icons": "~6.4.2",
22898 "@fortawesome/free-solid-svg-icons": "~6.4.2",
22899 "@mapbox/maki": "^8.0.1",
22900 "@openstreetmap/id-tagging-schema": "^6.3.0",
22901 "@rapideditor/temaki": "~5.4.0",
22902 "@transifex/api": "^5.4.0",
22903 autoprefixer: "^10.4.15",
22906 "cldr-core": "^43.0.0",
22907 "cldr-localenames-full": "^43.1.0",
22908 "concat-files": "^0.1.1",
22911 "editor-layer-index": "github:osmlab/editor-layer-index#gh-pages",
22912 esbuild: "^0.19.2",
22913 "esbuild-visualizer": "^0.4.1",
22915 "fetch-mock": "^9.11.0",
22919 "js-yaml": "^4.0.0",
22920 "json-stringify-pretty-compact": "^3.0.0",
22922 "karma-chrome-launcher": "^3.2.0",
22923 "karma-coverage": "2.1.1",
22924 "karma-mocha": "^2.0.1",
22925 "karma-remap-istanbul": "^0.6.0",
22926 mapillary_sprite_source: "^1.8.0",
22927 "mapillary-js": "4.1.1",
22928 minimist: "^1.2.8",
22930 "name-suggestion-index": "~6.0",
22931 "node-fetch": "^2.6.12",
22932 "npm-run-all": "^4.0.0",
22933 "osm-community-index": "~5.5.4",
22934 postcss: "^8.4.27",
22935 "postcss-selector-prepend": "^0.5.0",
22939 "sinon-chai": "^3.7.0",
22941 "static-server": "^2.2.1",
22942 "svg-sprite": "2.0.2",
22949 "> 0.2%, last 6 major versions, Firefox ESR, maintained node versions"
22953 // modules/core/file_fetcher.js
22954 var _mainFileFetcher = coreFileFetcher();
22955 function coreFileFetcher() {
22956 const ociVersion = package_default.dependencies["osm-community-index"] || package_default.devDependencies["osm-community-index"];
22957 const v2 = (0, import_vparse.default)(ociVersion);
22958 const ociVersionMinor = `${v2.major}.${v2.minor}`;
22959 const presetsVersion = package_default.devDependencies["@openstreetmap/id-tagging-schema"];
22961 let _inflight4 = {};
22963 "address_formats": "data/address_formats.min.json",
22964 "imagery": "data/imagery.min.json",
22965 "intro_graph": "data/intro_graph.min.json",
22966 "keepRight": "data/keepRight.min.json",
22967 "languages": "data/languages.min.json",
22968 "locales": "locales/index.min.json",
22969 "phone_formats": "data/phone_formats.min.json",
22970 "qa_data": "data/qa_data.min.json",
22971 "shortcuts": "data/shortcuts.min.json",
22972 "territory_languages": "data/territory_languages.min.json",
22973 "oci_defaults": ociCdnUrl.replace("{version}", ociVersionMinor) + "dist/defaults.min.json",
22974 "oci_features": ociCdnUrl.replace("{version}", ociVersionMinor) + "dist/featureCollection.min.json",
22975 "oci_resources": ociCdnUrl.replace("{version}", ociVersionMinor) + "dist/resources.min.json",
22976 "presets_package": presetsCdnUrl.replace("{presets_version}", presetsVersion) + "package.json",
22977 "deprecated": presetsCdnUrl + "dist/deprecated.min.json",
22978 "discarded": presetsCdnUrl + "dist/discarded.min.json",
22979 "preset_categories": presetsCdnUrl + "dist/preset_categories.min.json",
22980 "preset_defaults": presetsCdnUrl + "dist/preset_defaults.min.json",
22981 "preset_fields": presetsCdnUrl + "dist/fields.min.json",
22982 "preset_presets": presetsCdnUrl + "dist/presets.min.json",
22983 "wmf_sitematrix": wmfSitematrixCdnUrl.replace("{version}", "0.1") + "wikipedia.min.json"
22985 let _cachedData = {};
22986 _this.cache = () => _cachedData;
22987 _this.get = (which) => {
22988 if (_cachedData[which]) {
22989 return Promise.resolve(_cachedData[which]);
22991 const file = _fileMap[which];
22992 const url = file && _this.asset(file);
22994 return Promise.reject(`Unknown data file for "${which}"`);
22996 if (url.includes("{presets_version}")) {
22997 return _this.get("presets_package").then((result) => {
22998 const presetsVersion2 = result.version;
22999 return getUrl(url.replace("{presets_version}", presetsVersion2), which);
23002 return getUrl(url);
23005 function getUrl(url, which) {
23006 let prom = _inflight4[url];
23008 _inflight4[url] = prom = fetch(url).then((response) => {
23009 if (!response.ok || !response.json) {
23010 throw new Error(response.status + " " + response.statusText);
23012 if (response.status === 204 || response.status === 205)
23014 return response.json();
23015 }).then((result) => {
23016 delete _inflight4[url];
23018 throw new Error(`No data loaded for "${which}"`);
23020 _cachedData[which] = result;
23022 }).catch((err) => {
23023 delete _inflight4[url];
23029 _this.fileMap = function(val) {
23030 if (!arguments.length)
23035 let _assetPath = "";
23036 _this.assetPath = function(val) {
23037 if (!arguments.length)
23042 let _assetMap = {};
23043 _this.assetMap = function(val) {
23044 if (!arguments.length)
23049 _this.asset = (val) => {
23050 if (/^http(s)?:\/\//i.test(val))
23052 const filename = _assetPath + val;
23053 return _assetMap[filename] || filename;
23058 // node_modules/@rapideditor/country-coder/dist/country-coder.mjs
23059 var import_which_polygon = __toESM(require_which_polygon(), 1);
23060 var borders_default = { type: "FeatureCollection", features: [
23061 { type: "Feature", properties: { wikidata: "Q21", nameEn: "England", aliases: ["GB-ENG"], country: "GB", groups: ["Q23666", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-6.03913, 51.13217], [-7.74976, 48.64773], [1.17405, 50.74239], [2.18458, 51.52087], [2.56575, 51.85301], [0.792, 57.56437], [-2.30613, 55.62698], [-2.17058, 55.45916], [-2.6095, 55.28488], [-2.63532, 55.19452], [-3.02906, 55.04606], [-3.09361, 54.94924], [-3.38407, 54.94278], [-4.1819, 54.57861], [-3.5082, 53.54318], [-3.08228, 53.25526], [-3.03675, 53.25092], [-2.92329, 53.19383], [-2.92022, 53.17685], [-2.98598, 53.15589], [-2.90649, 53.10964], [-2.87469, 53.12337], [-2.89131, 53.09374], [-2.83133, 52.99184], [-2.7251, 52.98389], [-2.72221, 52.92969], [-2.80549, 52.89428], [-2.85897, 52.94487], [-2.92401, 52.93836], [-2.97243, 52.9651], [-3.13576, 52.895], [-3.15744, 52.84947], [-3.16105, 52.79599], [-3.08734, 52.77504], [-3.01001, 52.76636], [-2.95581, 52.71794], [-3.01724, 52.72083], [-3.04398, 52.65435], [-3.13648, 52.58208], [-3.12926, 52.5286], [-3.09746, 52.53077], [-3.08662, 52.54811], [-3.00929, 52.57774], [-2.99701, 52.551], [-3.03603, 52.49969], [-3.13359, 52.49174], [-3.22971, 52.45344], [-3.22754, 52.42526], [-3.04687, 52.34504], [-2.95364, 52.3501], [-2.99701, 52.323], [-3.00785, 52.2753], [-3.09289, 52.20546], [-3.12638, 52.08114], [-2.97111, 51.90456], [-2.8818, 51.93196], [-2.78742, 51.88833], [-2.74277, 51.84367], [-2.66234, 51.83555], [-2.66336, 51.59504], [-3.20563, 51.31615], [-6.03913, 51.13217]]]] } },
23062 { type: "Feature", properties: { wikidata: "Q22", nameEn: "Scotland", aliases: ["GB-SCT"], country: "GB", groups: ["Q23666", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[0.792, 57.56437], [-0.3751, 61.32236], [-14.78497, 57.60709], [-6.82333, 55.83103], [-4.69044, 54.3629], [-3.38407, 54.94278], [-3.09361, 54.94924], [-3.02906, 55.04606], [-2.63532, 55.19452], [-2.6095, 55.28488], [-2.17058, 55.45916], [-2.30613, 55.62698], [0.792, 57.56437]]]] } },
23063 { type: "Feature", properties: { wikidata: "Q25", nameEn: "Wales", aliases: ["GB-WLS"], country: "GB", groups: ["Q23666", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-3.5082, 53.54318], [-5.37267, 53.63269], [-6.03913, 51.13217], [-3.20563, 51.31615], [-2.66336, 51.59504], [-2.66234, 51.83555], [-2.74277, 51.84367], [-2.78742, 51.88833], [-2.8818, 51.93196], [-2.97111, 51.90456], [-3.12638, 52.08114], [-3.09289, 52.20546], [-3.00785, 52.2753], [-2.99701, 52.323], [-2.95364, 52.3501], [-3.04687, 52.34504], [-3.22754, 52.42526], [-3.22971, 52.45344], [-3.13359, 52.49174], [-3.03603, 52.49969], [-2.99701, 52.551], [-3.00929, 52.57774], [-3.08662, 52.54811], [-3.09746, 52.53077], [-3.12926, 52.5286], [-3.13648, 52.58208], [-3.04398, 52.65435], [-3.01724, 52.72083], [-2.95581, 52.71794], [-3.01001, 52.76636], [-3.08734, 52.77504], [-3.16105, 52.79599], [-3.15744, 52.84947], [-3.13576, 52.895], [-2.97243, 52.9651], [-2.92401, 52.93836], [-2.85897, 52.94487], [-2.80549, 52.89428], [-2.72221, 52.92969], [-2.7251, 52.98389], [-2.83133, 52.99184], [-2.89131, 53.09374], [-2.87469, 53.12337], [-2.90649, 53.10964], [-2.98598, 53.15589], [-2.92022, 53.17685], [-2.92329, 53.19383], [-3.03675, 53.25092], [-3.08228, 53.25526], [-3.5082, 53.54318]]]] } },
23064 { type: "Feature", properties: { wikidata: "Q26", nameEn: "Northern Ireland", aliases: ["GB-NIR"], country: "GB", groups: ["Q22890", "Q3336843", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-6.34755, 55.49206], [-7.2471, 55.06933], [-7.34464, 55.04688], [-7.4033, 55.00391], [-7.40004, 54.94498], [-7.44404, 54.9403], [-7.4473, 54.87003], [-7.47626, 54.83084], [-7.54508, 54.79401], [-7.54671, 54.74606], [-7.64449, 54.75265], [-7.75041, 54.7103], [-7.83352, 54.73854], [-7.93293, 54.66603], [-7.70315, 54.62077], [-7.8596, 54.53671], [-7.99812, 54.54427], [-8.04538, 54.48941], [-8.179, 54.46763], [-8.04555, 54.36292], [-7.87101, 54.29299], [-7.8596, 54.21779], [-7.81397, 54.20159], [-7.69501, 54.20731], [-7.55812, 54.12239], [-7.4799, 54.12239], [-7.44567, 54.1539], [-7.32834, 54.11475], [-7.30553, 54.11869], [-7.34005, 54.14698], [-7.29157, 54.17191], [-7.28017, 54.16714], [-7.29687, 54.1354], [-7.29493, 54.12013], [-7.26316, 54.13863], [-7.25012, 54.20063], [-7.14908, 54.22732], [-7.19145, 54.31296], [-7.02034, 54.4212], [-6.87775, 54.34682], [-6.85179, 54.29176], [-6.81583, 54.22791], [-6.74575, 54.18788], [-6.70175, 54.20218], [-6.6382, 54.17071], [-6.66264, 54.0666], [-6.62842, 54.03503], [-6.47849, 54.06947], [-6.36605, 54.07234], [-6.36279, 54.11248], [-6.32694, 54.09337], [-6.29003, 54.11278], [-6.26218, 54.09785], [-5.83481, 53.87749], [-4.69044, 54.3629], [-6.34755, 55.49206]]]] } },
23065 { type: "Feature", properties: { wikidata: "Q35", nameEn: "Denmark", country: "DK", groups: ["EU", "154", "150", "UN"], callingCodes: ["45"] }, geometry: { type: "MultiPolygon", coordinates: [[[[12.16597, 56.60205], [10.40861, 58.38489], [7.28637, 57.35913], [8.02459, 55.09613], [8.45719, 55.06747], [8.55769, 54.91837], [8.63979, 54.91069], [8.76387, 54.8948], [8.81178, 54.90518], [8.92795, 54.90452], [9.04629, 54.87249], [9.14275, 54.87421], [9.20571, 54.85841], [9.24631, 54.84726], [9.23445, 54.83432], [9.2474, 54.8112], [9.32771, 54.80602], [9.33849, 54.80233], [9.36496, 54.81749], [9.38532, 54.83968], [9.41213, 54.84254], [9.43155, 54.82586], [9.4659, 54.83131], [9.58937, 54.88785], [9.62734, 54.88057], [9.61187, 54.85548], [9.73563, 54.8247], [9.89314, 54.84171], [10.16755, 54.73883], [10.31111, 54.65968], [11.00303, 54.63689], [11.90309, 54.38543], [12.85844, 54.82438], [13.93395, 54.84044], [15.36991, 54.73263], [15.79951, 55.54655], [14.89259, 55.5623], [14.28399, 55.1553], [12.84405, 55.13257], [12.60345, 55.42675], [12.88472, 55.63369], [12.6372, 55.91371], [12.65312, 56.04345], [12.07466, 56.29488], [12.16597, 56.60205]]]] } },
23066 { type: "Feature", properties: { wikidata: "Q55", nameEn: "Netherlands", country: "NL", groups: ["EU", "155", "150", "UN"], callingCodes: ["31"] }, geometry: { type: "MultiPolygon", coordinates: [[[[5.45168, 54.20039], [2.56575, 51.85301], [3.36263, 51.37112], [3.38696, 51.33436], [3.35847, 51.31572], [3.38289, 51.27331], [3.41704, 51.25933], [3.43488, 51.24135], [3.52698, 51.2458], [3.51502, 51.28697], [3.58939, 51.30064], [3.78999, 51.25766], [3.78783, 51.2151], [3.90125, 51.20371], [3.97889, 51.22537], [4.01957, 51.24504], [4.05165, 51.24171], [4.16721, 51.29348], [4.24024, 51.35371], [4.21923, 51.37443], [4.33265, 51.37687], [4.34086, 51.35738], [4.39292, 51.35547], [4.43777, 51.36989], [4.38064, 51.41965], [4.39747, 51.43316], [4.38122, 51.44905], [4.47736, 51.4778], [4.5388, 51.48184], [4.54675, 51.47265], [4.52846, 51.45002], [4.53521, 51.4243], [4.57489, 51.4324], [4.65442, 51.42352], [4.72935, 51.48424], [4.74578, 51.48937], [4.77321, 51.50529], [4.78803, 51.50284], [4.84139, 51.4799], [4.82409, 51.44736], [4.82946, 51.4213], [4.78314, 51.43319], [4.76577, 51.43046], [4.77229, 51.41337], [4.78941, 51.41102], [4.84988, 51.41502], [4.90016, 51.41404], [4.92152, 51.39487], [5.00393, 51.44406], [5.0106, 51.47167], [5.03281, 51.48679], [5.04774, 51.47022], [5.07891, 51.4715], [5.10456, 51.43163], [5.07102, 51.39469], [5.13105, 51.34791], [5.13377, 51.31592], [5.16222, 51.31035], [5.2002, 51.32243], [5.24244, 51.30495], [5.22542, 51.26888], [5.23814, 51.26064], [5.26461, 51.26693], [5.29716, 51.26104], [5.33886, 51.26314], [5.347, 51.27502], [5.41672, 51.26248], [5.4407, 51.28169], [5.46519, 51.2849], [5.48476, 51.30053], [5.515, 51.29462], [5.5569, 51.26544], [5.5603, 51.22249], [5.65145, 51.19788], [5.65528, 51.18736], [5.70344, 51.1829], [5.74617, 51.18928], [5.77735, 51.17845], [5.77697, 51.1522], [5.82564, 51.16753], [5.85508, 51.14445], [5.80798, 51.11661], [5.8109, 51.10861], [5.83226, 51.10585], [5.82921, 51.09328], [5.79903, 51.09371], [5.79835, 51.05834], [5.77258, 51.06196], [5.75961, 51.03113], [5.77688, 51.02483], [5.76242, 50.99703], [5.71864, 50.96092], [5.72875, 50.95428], [5.74752, 50.96202], [5.75927, 50.95601], [5.74644, 50.94723], [5.72545, 50.92312], [5.72644, 50.91167], [5.71626, 50.90796], [5.69858, 50.91046], [5.67886, 50.88142], [5.64504, 50.87107], [5.64009, 50.84742], [5.65259, 50.82309], [5.70118, 50.80764], [5.68995, 50.79641], [5.70107, 50.7827], [5.68091, 50.75804], [5.69469, 50.75529], [5.72216, 50.76398], [5.73904, 50.75674], [5.74356, 50.7691], [5.76533, 50.78159], [5.77513, 50.78308], [5.80673, 50.7558], [5.84548, 50.76542], [5.84888, 50.75448], [5.88734, 50.77092], [5.89129, 50.75125], [5.89132, 50.75124], [5.95942, 50.7622], [5.97545, 50.75441], [6.01976, 50.75398], [6.02624, 50.77453], [5.97497, 50.79992], [5.98404, 50.80988], [6.00462, 50.80065], [6.02328, 50.81694], [6.01921, 50.84435], [6.05623, 50.8572], [6.05702, 50.85179], [6.07431, 50.84674], [6.07693, 50.86025], [6.08805, 50.87223], [6.07486, 50.89307], [6.09297, 50.92066], [6.01615, 50.93367], [6.02697, 50.98303], [5.95282, 50.98728], [5.90296, 50.97356], [5.90493, 51.00198], [5.87849, 51.01969], [5.86735, 51.05182], [5.9134, 51.06736], [5.9541, 51.03496], [5.98292, 51.07469], [6.16706, 51.15677], [6.17384, 51.19589], [6.07889, 51.17038], [6.07889, 51.24432], [6.16977, 51.33169], [6.22674, 51.36135], [6.22641, 51.39948], [6.20654, 51.40049], [6.21724, 51.48568], [6.18017, 51.54096], [6.09055, 51.60564], [6.11759, 51.65609], [6.02767, 51.6742], [6.04091, 51.71821], [5.95003, 51.7493], [5.98665, 51.76944], [5.94568, 51.82786], [5.99848, 51.83195], [6.06705, 51.86136], [6.10337, 51.84829], [6.16902, 51.84094], [6.11551, 51.89769], [6.15349, 51.90439], [6.21443, 51.86801], [6.29872, 51.86801], [6.30593, 51.84998], [6.40704, 51.82771], [6.38815, 51.87257], [6.47179, 51.85395], [6.50231, 51.86313], [6.58556, 51.89386], [6.68386, 51.91861], [6.72319, 51.89518], [6.82357, 51.96711], [6.83035, 51.9905], [6.68128, 52.05052], [6.76117, 52.11895], [6.83984, 52.11728], [6.97189, 52.20329], [6.9897, 52.2271], [7.03729, 52.22695], [7.06365, 52.23789], [7.02703, 52.27941], [7.07044, 52.37805], [7.03417, 52.40237], [6.99041, 52.47235], [6.94293, 52.43597], [6.69507, 52.488], [6.71641, 52.62905], [6.77307, 52.65375], [7.04557, 52.63318], [7.07253, 52.81083], [7.21694, 53.00742], [7.17898, 53.13817], [7.22681, 53.18165], [7.21679, 53.20058], [7.19052, 53.31866], [7.00198, 53.32672], [6.91025, 53.44221], [5.45168, 54.20039]], [[4.93295, 51.44945], [4.95244, 51.45207], [4.9524, 51.45014], [4.93909, 51.44632], [4.93295, 51.44945]], [[4.91493, 51.4353], [4.91935, 51.43634], [4.92227, 51.44252], [4.91811, 51.44621], [4.92287, 51.44741], [4.92811, 51.4437], [4.92566, 51.44273], [4.92815, 51.43856], [4.92879, 51.44161], [4.93544, 51.44634], [4.94025, 51.44193], [4.93416, 51.44185], [4.93471, 51.43861], [4.94265, 51.44003], [4.93986, 51.43064], [4.92952, 51.42984], [4.92652, 51.43329], [4.91493, 51.4353]]]] } },
23067 { type: "Feature", properties: { wikidata: "Q782", nameEn: "Hawaii", aliases: ["US-HI"], country: "US", groups: ["Q35657", "061", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-177.8563, 29.18961], [-179.49839, 27.86265], [-151.6784, 9.55515], [-154.05867, 45.51124], [-177.5224, 27.7635], [-177.8563, 29.18961]]]] } },
23068 { type: "Feature", properties: { wikidata: "Q797", nameEn: "Alaska", aliases: ["US-AK"], country: "US", groups: ["Q35657", "021", "003", "019", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169.34848, 52.47228], [180, 51.0171], [179.84401, 55.10087], [169.34848, 52.47228]]], [[[-168.95635, 65.98512], [-169.03888, 65.48473], [-172.76104, 63.77445], [-179.55295, 57.62081], [-179.55295, 50.81807], [-133.92876, 54.62289], [-130.61931, 54.70835], [-130.64499, 54.76912], [-130.44184, 54.85377], [-130.27203, 54.97174], [-130.18765, 55.07744], [-130.08035, 55.21556], [-129.97513, 55.28029], [-130.15373, 55.74895], [-130.00857, 55.91344], [-130.00093, 56.00325], [-130.10173, 56.12178], [-130.33965, 56.10849], [-130.77769, 56.36185], [-131.8271, 56.62247], [-133.38523, 58.42773], [-133.84645, 58.73543], [-134.27175, 58.8634], [-134.48059, 59.13231], [-134.55699, 59.1297], [-134.7047, 59.2458], [-135.00267, 59.28745], [-135.03069, 59.56208], [-135.48007, 59.79937], [-136.31566, 59.59083], [-136.22381, 59.55526], [-136.33727, 59.44466], [-136.47323, 59.46617], [-136.52365, 59.16752], [-136.82619, 59.16198], [-137.4925, 58.89415], [-137.60623, 59.24465], [-138.62145, 59.76431], [-138.71149, 59.90728], [-139.05365, 59.99655], [-139.20603, 60.08896], [-139.05831, 60.35205], [-139.68991, 60.33693], [-139.98024, 60.18027], [-140.45648, 60.30919], [-140.5227, 60.22077], [-141.00116, 60.30648], [-140.97446, 84.39275], [-168.25765, 71.99091], [-168.95635, 65.98512]]]] } },
23069 { type: "Feature", properties: { wikidata: "Q3492", nameEn: "Sumatra", aliases: ["ID-SM"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[109.82788, 2.86812], [110.90339, 7.52694], [105.01437, 3.24936], [104.56723, 1.44271], [104.34728, 1.33529], [104.12282, 1.27714], [104.03085, 1.26954], [103.74084, 1.12902], [103.66049, 1.18825], [103.56591, 1.19719], [103.03657, 1.30383], [96.11174, 6.69841], [74.28481, -3.17525], [102.92489, -8.17146], [106.32259, -5.50116], [106.38511, -5.16715], [109.17017, -4.07401], [109.3962, -2.07276], [108.50935, -2.01066], [107.94791, 1.06924], [109.82788, 2.86812]]]] } },
23070 { type: "Feature", properties: { wikidata: "Q3757", nameEn: "Java", aliases: ["ID-JW"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[109.17017, -4.07401], [106.38511, -5.16715], [106.32259, -5.50116], [102.92489, -8.17146], [116.22542, -10.49172], [114.39575, -8.2889], [114.42235, -8.09762], [114.92859, -7.49253], [116.33992, -7.56171], [116.58433, -5.30385], [109.17017, -4.07401]]]] } },
23071 { type: "Feature", properties: { wikidata: "Q3795", nameEn: "Kalimantan", aliases: ["ID-KA"], country: "ID", groups: ["Q36117", "035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[120.02464, 2.83703], [118.06469, 4.16638], [117.67641, 4.16535], [117.47313, 4.18857], [117.25801, 4.35108], [115.90217, 4.37708], [115.58276, 3.93499], [115.53713, 3.14776], [115.11343, 2.82879], [115.1721, 2.49671], [114.80706, 2.21665], [114.80706, 1.92351], [114.57892, 1.5], [114.03788, 1.44787], [113.64677, 1.23933], [113.01448, 1.42832], [113.021, 1.57819], [112.48648, 1.56516], [112.2127, 1.44135], [112.15679, 1.17004], [111.94553, 1.12016], [111.82846, 0.99349], [111.55434, 0.97864], [111.22979, 1.08326], [110.62374, 0.873], [110.49182, 0.88088], [110.35354, 0.98869], [109.66397, 1.60425], [109.66397, 1.79972], [109.57923, 1.80624], [109.53794, 1.91771], [109.62558, 1.99182], [109.82788, 2.86812], [107.94791, 1.06924], [108.50935, -2.01066], [109.3962, -2.07276], [109.17017, -4.07401], [116.58433, -5.30385], [120.02464, 2.83703]]]] } },
23072 { type: "Feature", properties: { wikidata: "Q3803", nameEn: "Lesser Sunda Islands", aliases: ["ID-NU"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[116.96967, -8.01483], [114.92859, -7.49253], [114.42235, -8.09762], [114.39575, -8.2889], [116.22542, -10.49172], [122.14954, -11.52517], [125.68138, -9.85176], [125.09025, -9.46406], [124.97892, -9.19281], [125.04044, -9.17093], [125.09434, -9.19669], [125.18907, -9.16434], [125.18632, -9.03142], [125.11764, -8.96359], [124.97742, -9.08128], [124.94011, -8.85617], [124.46701, -9.13002], [124.45971, -9.30263], [124.38554, -9.3582], [124.35258, -9.43002], [124.3535, -9.48493], [124.28115, -9.50453], [124.28115, -9.42189], [124.21247, -9.36904], [124.14517, -9.42324], [124.10539, -9.41206], [124.04286, -9.34243], [124.04628, -9.22671], [124.33472, -9.11416], [124.92337, -8.75859], [125.87688, -7.49892], [116.96967, -8.01483]]]] } },
23073 { type: "Feature", properties: { wikidata: "Q3812", nameEn: "Sulawesi", aliases: ["ID-SL"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[128.34321, 3.90322], [126.69413, 6.02692], [119.56457, 0.90759], [116.58433, -5.30385], [116.33992, -7.56171], [116.96967, -8.01483], [125.87688, -7.49892], [123.78965, -0.86805], [128.34321, 3.90322]]]] } },
23074 { type: "Feature", properties: { wikidata: "Q3827", nameEn: "Maluku Islands", aliases: ["ID-ML"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[129.63187, 2.21409], [128.34321, 3.90322], [123.78965, -0.86805], [125.87688, -7.49892], [125.58506, -7.95311], [125.87691, -8.31789], [127.42116, -8.22471], [127.55165, -9.05052], [135.49042, -9.2276], [135.35517, -5.01442], [132.8312, -4.70282], [130.8468, -2.61103], [128.40647, -2.30349], [129.71519, -0.24692], [129.63187, 2.21409]]]] } },
23075 { type: "Feature", properties: { wikidata: "Q3845", nameEn: "Western New Guinea", aliases: ["ID-PP"], country: "ID", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["62"] }, geometry: { type: "MultiPolygon", coordinates: [[[[135.49042, -9.2276], [141.01842, -9.35091], [141.01763, -6.90181], [140.90448, -6.85033], [140.85295, -6.72996], [140.99813, -6.3233], [141.02352, 0.08993], [129.63187, 2.21409], [129.71519, -0.24692], [128.40647, -2.30349], [130.8468, -2.61103], [132.8312, -4.70282], [135.35517, -5.01442], [135.49042, -9.2276]]]] } },
23076 { type: "Feature", properties: { wikidata: "Q5765", nameEn: "Balearic Islands", aliases: ["ES-IB"], country: "ES", groups: ["EU", "039", "150", "UN"], callingCodes: ["34 971"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.27707, 35.35051], [5.10072, 39.89531], [3.75438, 42.33445], [-2.27707, 35.35051]]]] } },
23077 { type: "Feature", properties: { wikidata: "Q5823", nameEn: "Ceuta", aliases: ["ES-CE"], country: "ES", groups: ["EA", "EU", "015", "002", "UN"], level: "subterritory", callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-5.38491, 35.92591], [-5.37338, 35.88417], [-5.35844, 35.87375], [-5.34379, 35.8711], [-5.21179, 35.90091], [-5.38491, 35.92591]]]] } },
23078 { type: "Feature", properties: { wikidata: "Q5831", nameEn: "Melilla", aliases: ["ES-ML"], country: "ES", groups: ["EA", "EU", "015", "002", "UN"], level: "subterritory", callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.91909, 35.33927], [-2.96038, 35.31609], [-2.96648, 35.30475], [-2.96978, 35.29459], [-2.97035, 35.28852], [-2.96507, 35.28801], [-2.96826, 35.28296], [-2.96516, 35.27967], [-2.95431, 35.2728], [-2.95065, 35.26576], [-2.93893, 35.26737], [-2.92272, 35.27509], [-2.91909, 35.33927]]]] } },
23079 { type: "Feature", properties: { wikidata: "Q7835", nameEn: "Crimea", country: "RU", groups: ["151", "150", "UN"], level: "subterritory", callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.5, 44], [36.4883, 45.0488], [36.475, 45.2411], [36.5049, 45.3136], [36.6545, 45.3417], [36.6645, 45.4514], [35.0498, 45.7683], [34.9601, 45.7563], [34.7991, 45.8101], [34.8015, 45.9005], [34.7548, 45.907], [34.6668, 45.9714], [34.6086, 45.9935], [34.5589, 45.9935], [34.5201, 45.951], [34.4873, 45.9427], [34.4415, 45.9599], [34.4122, 46.0025], [34.3391, 46.0611], [34.2511, 46.0532], [34.181, 46.068], [34.1293, 46.1049], [34.0731, 46.1177], [34.0527, 46.1084], [33.9155, 46.1594], [33.8523, 46.1986], [33.7972, 46.2048], [33.7405, 46.1855], [33.646, 46.2303], [33.6152, 46.2261], [33.6385, 46.1415], [33.6147, 46.1356], [33.5732, 46.1032], [33.5909, 46.0601], [33.5597, 46.0307], [31.5, 45.5], [33.5, 44]]]] } },
23080 { type: "Feature", properties: { wikidata: "Q12837", nameEn: "Iberia", level: "sharedLandform" }, geometry: null },
23081 { type: "Feature", properties: { wikidata: "Q14056", nameEn: "Jan Mayen", aliases: ["NO-22"], country: "NO", groups: ["SJ", "154", "150", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-9.18243, 72.23144], [-10.71459, 70.09565], [-5.93364, 70.76368], [-9.18243, 72.23144]]]] } },
23082 { type: "Feature", properties: { wikidata: "Q19188", nameEn: "Mainland China", country: "CN", groups: ["030", "142", "UN"], callingCodes: ["86"] }, geometry: { type: "MultiPolygon", coordinates: [[[[125.6131, 53.07229], [125.17522, 53.20225], [124.46078, 53.21881], [123.86158, 53.49391], [123.26989, 53.54843], [122.85966, 53.47395], [122.35063, 53.49565], [121.39213, 53.31888], [120.85633, 53.28499], [120.0451, 52.7359], [120.04049, 52.58773], [120.46454, 52.63811], [120.71673, 52.54099], [120.61346, 52.32447], [120.77337, 52.20805], [120.65907, 51.93544], [120.10963, 51.671], [119.13553, 50.37412], [119.38598, 50.35162], [119.27996, 50.13348], [119.11003, 50.00276], [118.61623, 49.93809], [117.82343, 49.52696], [117.48208, 49.62324], [117.27597, 49.62544], [116.71193, 49.83813], [116.03781, 48.87014], [116.06565, 48.81716], [115.78876, 48.51781], [115.811, 48.25699], [115.52082, 48.15367], [115.57128, 47.91988], [115.94296, 47.67741], [116.21879, 47.88505], [116.4465, 47.83662], [116.67405, 47.89039], [116.9723, 47.87285], [117.37875, 47.63627], [117.50181, 47.77216], [117.80196, 48.01661], [118.03676, 48.00982], [118.11009, 48.04], [118.22677, 48.03853], [118.29654, 48.00246], [118.55766, 47.99277], [118.7564, 47.76947], [119.12343, 47.66458], [119.13995, 47.53997], [119.35892, 47.48104], [119.31964, 47.42617], [119.54918, 47.29505], [119.56019, 47.24874], [119.62403, 47.24575], [119.71209, 47.19192], [119.85518, 46.92196], [119.91242, 46.90091], [119.89261, 46.66423], [119.80455, 46.67631], [119.77373, 46.62947], [119.68127, 46.59015], [119.65265, 46.62342], [119.42827, 46.63783], [119.32827, 46.61433], [119.24978, 46.64761], [119.10448, 46.65516], [119.00541, 46.74273], [118.92616, 46.72765], [118.89974, 46.77139], [118.8337, 46.77742], [118.78747, 46.68689], [118.30534, 46.73519], [117.69554, 46.50991], [117.60748, 46.59771], [117.41782, 46.57862], [117.36609, 46.36335], [116.83166, 46.38637], [116.75551, 46.33083], [116.58612, 46.30211], [116.26678, 45.96479], [116.24012, 45.8778], [116.27366, 45.78637], [116.16989, 45.68603], [115.60329, 45.44717], [114.94546, 45.37377], [114.74612, 45.43585], [114.54801, 45.38337], [114.5166, 45.27189], [113.70918, 44.72891], [112.74662, 44.86297], [112.4164, 45.06858], [111.98695, 45.09074], [111.76275, 44.98032], [111.40498, 44.3461], [111.96289, 43.81596], [111.93776, 43.68709], [111.79758, 43.6637], [111.59087, 43.51207], [111.0149, 43.3289], [110.4327, 42.78293], [110.08401, 42.6411], [109.89402, 42.63111], [109.452, 42.44842], [109.00679, 42.45302], [108.84489, 42.40246], [107.57258, 42.40898], [107.49681, 42.46221], [107.29755, 42.41395], [107.24774, 42.36107], [106.76517, 42.28741], [105.0123, 41.63188], [104.51667, 41.66113], [104.52258, 41.8706], [103.92804, 41.78246], [102.72403, 42.14675], [102.07645, 42.22519], [101.80515, 42.50074], [100.84979, 42.67087], [100.33297, 42.68231], [99.50671, 42.56535], [97.1777, 42.7964], [96.37926, 42.72055], [96.35658, 42.90363], [95.89543, 43.2528], [95.52594, 43.99353], [95.32891, 44.02407], [95.39772, 44.2805], [95.01191, 44.25274], [94.71959, 44.35284], [94.10003, 44.71016], [93.51161, 44.95964], [91.64048, 45.07408], [90.89169, 45.19667], [90.65114, 45.49314], [90.70907, 45.73437], [91.03026, 46.04194], [90.99672, 46.14207], [90.89639, 46.30711], [91.07696, 46.57315], [91.0147, 46.58171], [91.03649, 46.72916], [90.84035, 46.99525], [90.76108, 46.99399], [90.48542, 47.30438], [90.48854, 47.41826], [90.33598, 47.68303], [90.10871, 47.7375], [90.06512, 47.88177], [89.76624, 47.82745], [89.55453, 48.0423], [89.0711, 47.98528], [88.93186, 48.10263], [88.8011, 48.11302], [88.58316, 48.21893], [88.58939, 48.34531], [87.96361, 48.58478], [88.0788, 48.71436], [87.73822, 48.89582], [87.88171, 48.95853], [87.81333, 49.17354], [87.48983, 49.13794], [87.478, 49.07403], [87.28386, 49.11626], [86.87238, 49.12432], [86.73568, 48.99918], [86.75343, 48.70331], [86.38069, 48.46064], [85.73581, 48.3939], [85.5169, 48.05493], [85.61067, 47.49753], [85.69696, 47.2898], [85.54294, 47.06171], [85.22443, 47.04816], [84.93995, 46.87399], [84.73077, 47.01394], [83.92184, 46.98912], [83.04622, 47.19053], [82.21792, 45.56619], [82.58474, 45.40027], [82.51374, 45.1755], [81.73278, 45.3504], [80.11169, 45.03352], [79.8987, 44.89957], [80.38384, 44.63073], [80.40229, 44.23319], [80.40031, 44.10986], [80.75156, 43.44948], [80.69718, 43.32589], [80.77771, 43.30065], [80.78817, 43.14235], [80.62913, 43.141], [80.3735, 43.01557], [80.58999, 42.9011], [80.38169, 42.83142], [80.26886, 42.8366], [80.16892, 42.61137], [80.26841, 42.23797], [80.17807, 42.21166], [80.17842, 42.03211], [79.92977, 42.04113], [78.3732, 41.39603], [78.15757, 41.38565], [78.12873, 41.23091], [77.81287, 41.14307], [77.76206, 41.01574], [77.52723, 41.00227], [77.3693, 41.0375], [77.28004, 41.0033], [76.99302, 41.0696], [76.75681, 40.95354], [76.5261, 40.46114], [76.33659, 40.3482], [75.96168, 40.38064], [75.91361, 40.2948], [75.69663, 40.28642], [75.5854, 40.66874], [75.22834, 40.45382], [75.08243, 40.43945], [74.82013, 40.52197], [74.78168, 40.44886], [74.85996, 40.32857], [74.69875, 40.34668], [74.35063, 40.09742], [74.25533, 40.13191], [73.97049, 40.04378], [73.83006, 39.76136], [73.9051, 39.75073], [73.92354, 39.69565], [73.94683, 39.60733], [73.87018, 39.47879], [73.59831, 39.46425], [73.59241, 39.40843], [73.5004, 39.38402], [73.55396, 39.3543], [73.54572, 39.27567], [73.60638, 39.24534], [73.75823, 39.023], [73.81728, 39.04007], [73.82964, 38.91517], [73.7445, 38.93867], [73.7033, 38.84782], [73.80656, 38.66449], [73.79806, 38.61106], [73.97933, 38.52945], [74.17022, 38.65504], [74.51217, 38.47034], [74.69619, 38.42947], [74.69894, 38.22155], [74.80331, 38.19889], [74.82665, 38.07359], [74.9063, 38.03033], [74.92416, 37.83428], [75.00935, 37.77486], [74.8912, 37.67576], [74.94338, 37.55501], [75.06011, 37.52779], [75.15899, 37.41443], [75.09719, 37.37297], [75.12328, 37.31839], [74.88887, 37.23275], [74.80605, 37.21565], [74.49981, 37.24518], [74.56453, 37.03023], [75.13839, 37.02622], [75.40481, 36.95382], [75.45562, 36.71971], [75.72737, 36.7529], [75.92391, 36.56986], [76.0324, 36.41198], [76.00906, 36.17511], [75.93028, 36.13136], [76.15325, 35.9264], [76.14913, 35.82848], [76.33453, 35.84296], [76.50961, 35.8908], [76.77323, 35.66062], [76.84539, 35.67356], [76.96624, 35.5932], [77.44277, 35.46132], [77.70232, 35.46244], [77.80532, 35.52058], [78.11664, 35.48022], [78.03466, 35.3785], [78.00033, 35.23954], [78.22692, 34.88771], [78.18435, 34.7998], [78.27781, 34.61484], [78.54964, 34.57283], [78.56475, 34.50835], [78.74465, 34.45174], [79.05364, 34.32482], [78.99802, 34.3027], [78.91769, 34.15452], [78.66225, 34.08858], [78.65657, 34.03195], [78.73367, 34.01121], [78.77349, 33.73871], [78.67599, 33.66445], [78.73636, 33.56521], [79.15252, 33.17156], [79.14016, 33.02545], [79.46562, 32.69668], [79.26768, 32.53277], [79.13174, 32.47766], [79.0979, 32.38051], [78.99322, 32.37948], [78.96713, 32.33655], [78.7831, 32.46873], [78.73916, 32.69438], [78.38897, 32.53938], [78.4645, 32.45367], [78.49609, 32.2762], [78.68754, 32.10256], [78.74404, 32.00384], [78.78036, 31.99478], [78.69933, 31.78723], [78.84516, 31.60631], [78.71032, 31.50197], [78.77898, 31.31209], [78.89344, 31.30481], [79.01931, 31.42817], [79.14016, 31.43403], [79.30694, 31.17357], [79.59884, 30.93943], [79.93255, 30.88288], [80.20721, 30.58541], [80.54504, 30.44936], [80.83343, 30.32023], [81.03953, 30.20059], [81.12842, 30.01395], [81.24362, 30.0126], [81.29032, 30.08806], [81.2623, 30.14596], [81.33355, 30.15303], [81.39928, 30.21862], [81.41018, 30.42153], [81.5459, 30.37688], [81.62033, 30.44703], [81.99082, 30.33423], [82.10135, 30.35439], [82.10757, 30.23745], [82.19475, 30.16884], [82.16984, 30.0692], [82.38622, 30.02608], [82.5341, 29.9735], [82.73024, 29.81695], [83.07116, 29.61957], [83.28131, 29.56813], [83.44787, 29.30513], [83.63156, 29.16249], [83.82303, 29.30513], [83.97559, 29.33091], [84.18107, 29.23451], [84.24801, 29.02783], [84.2231, 28.89571], [84.47528, 28.74023], [84.62317, 28.73887], [84.85511, 28.58041], [85.06059, 28.68562], [85.19135, 28.62825], [85.18668, 28.54076], [85.10729, 28.34092], [85.38127, 28.28336], [85.4233, 28.32996], [85.59765, 28.30529], [85.60854, 28.25045], [85.69105, 28.38475], [85.71907, 28.38064], [85.74864, 28.23126], [85.84672, 28.18187], [85.90743, 28.05144], [85.97813, 27.99023], [85.94946, 27.9401], [86.06309, 27.90021], [86.12069, 27.93047], [86.08333, 28.02121], [86.088, 28.09264], [86.18607, 28.17364], [86.22966, 27.9786], [86.42736, 27.91122], [86.51609, 27.96623], [86.56265, 28.09569], [86.74181, 28.10638], [86.75582, 28.04182], [87.03757, 27.94835], [87.11696, 27.84104], [87.56996, 27.84517], [87.72718, 27.80938], [87.82681, 27.95248], [88.13378, 27.88015], [88.1278, 27.95417], [88.25332, 27.9478], [88.54858, 28.06057], [88.63235, 28.12356], [88.83559, 28.01936], [88.88091, 27.85192], [88.77517, 27.45415], [88.82981, 27.38814], [88.91901, 27.32483], [88.93678, 27.33777], [88.96947, 27.30319], [89.00216, 27.32532], [88.95355, 27.4106], [88.97213, 27.51671], [89.0582, 27.60985], [89.12825, 27.62502], [89.59525, 28.16433], [89.79762, 28.23979], [90.13387, 28.19178], [90.58842, 28.02838], [90.69894, 28.07784], [91.20019, 27.98715], [91.25779, 28.07509], [91.46327, 28.0064], [91.48973, 27.93903], [91.5629, 27.84823], [91.6469, 27.76358], [91.84722, 27.76325], [91.87057, 27.7195], [92.27432, 27.89077], [92.32101, 27.79363], [92.42538, 27.80092], [92.7275, 27.98662], [92.73025, 28.05814], [92.65472, 28.07632], [92.67486, 28.15018], [92.93075, 28.25671], [93.14635, 28.37035], [93.18069, 28.50319], [93.44621, 28.67189], [93.72797, 28.68821], [94.35897, 29.01965], [94.2752, 29.11687], [94.69318, 29.31739], [94.81353, 29.17804], [95.0978, 29.14446], [95.11291, 29.09527], [95.2214, 29.10727], [95.26122, 29.07727], [95.3038, 29.13847], [95.41091, 29.13007], [95.50842, 29.13487], [95.72086, 29.20797], [95.75149, 29.32063], [95.84899, 29.31464], [96.05361, 29.38167], [96.31316, 29.18643], [96.18682, 29.11087], [96.20467, 29.02325], [96.3626, 29.10607], [96.61391, 28.72742], [96.40929, 28.51526], [96.48895, 28.42955], [96.6455, 28.61657], [96.85561, 28.4875], [96.88445, 28.39452], [96.98882, 28.32564], [97.1289, 28.3619], [97.34547, 28.21385], [97.41729, 28.29783], [97.47085, 28.2688], [97.50518, 28.49716], [97.56835, 28.55628], [97.70705, 28.5056], [97.79632, 28.33168], [97.90069, 28.3776], [98.15337, 28.12114], [98.13964, 27.9478], [98.32641, 27.51385], [98.42529, 27.55404], [98.43353, 27.67086], [98.69582, 27.56499], [98.7333, 26.85615], [98.77547, 26.61994], [98.72741, 26.36183], [98.67797, 26.24487], [98.7329, 26.17218], [98.66884, 26.09165], [98.63128, 26.15492], [98.57085, 26.11547], [98.60763, 26.01512], [98.70818, 25.86241], [98.63128, 25.79937], [98.54064, 25.85129], [98.40606, 25.61129], [98.31268, 25.55307], [98.25774, 25.6051], [98.16848, 25.62739], [98.18084, 25.56298], [98.12591, 25.50722], [98.14925, 25.41547], [97.92541, 25.20815], [97.83614, 25.2715], [97.77023, 25.11492], [97.72216, 25.08508], [97.72903, 24.91332], [97.79949, 24.85655], [97.76481, 24.8289], [97.73127, 24.83015], [97.70181, 24.84557], [97.64354, 24.79171], [97.56648, 24.76475], [97.56383, 24.75535], [97.5542, 24.74943], [97.54675, 24.74202], [97.56525, 24.72838], [97.56286, 24.54535], [97.52757, 24.43748], [97.60029, 24.4401], [97.66998, 24.45288], [97.7098, 24.35658], [97.65624, 24.33781], [97.66723, 24.30027], [97.71941, 24.29652], [97.76799, 24.26365], [97.72998, 24.2302], [97.72799, 24.18883], [97.75305, 24.16902], [97.72903, 24.12606], [97.62363, 24.00506], [97.5247, 23.94032], [97.64667, 23.84574], [97.72302, 23.89288], [97.79456, 23.94836], [97.79416, 23.95663], [97.84328, 23.97603], [97.86545, 23.97723], [97.88811, 23.97446], [97.8955, 23.97758], [97.89676, 23.97931], [97.89683, 23.98389], [97.88814, 23.98605], [97.88414, 23.99405], [97.88616, 24.00463], [97.90998, 24.02094], [97.93951, 24.01953], [97.98691, 24.03897], [97.99583, 24.04932], [98.04709, 24.07616], [98.05302, 24.07408], [98.05671, 24.07961], [98.0607, 24.07812], [98.06703, 24.08028], [98.07806, 24.07988], [98.20666, 24.11406], [98.54476, 24.13119], [98.59256, 24.08371], [98.85319, 24.13042], [98.87998, 24.15624], [98.89632, 24.10612], [98.67797, 23.9644], [98.68209, 23.80492], [98.79607, 23.77947], [98.82933, 23.72921], [98.81775, 23.694], [98.88396, 23.59555], [98.80294, 23.5345], [98.82877, 23.47908], [98.87683, 23.48995], [98.92104, 23.36946], [98.87573, 23.33038], [98.93958, 23.31414], [98.92515, 23.29535], [98.88597, 23.18656], [99.05975, 23.16382], [99.04601, 23.12215], [99.25741, 23.09025], [99.34127, 23.13099], [99.52214, 23.08218], [99.54218, 22.90014], [99.43537, 22.94086], [99.45654, 22.85726], [99.31243, 22.73893], [99.38247, 22.57544], [99.37972, 22.50188], [99.28771, 22.4105], [99.17318, 22.18025], [99.19176, 22.16983], [99.1552, 22.15874], [99.33166, 22.09656], [99.47585, 22.13345], [99.85351, 22.04183], [99.96612, 22.05965], [99.99084, 21.97053], [99.94003, 21.82782], [99.98654, 21.71064], [100.04956, 21.66843], [100.12679, 21.70539], [100.17486, 21.65306], [100.10757, 21.59945], [100.12542, 21.50365], [100.1625, 21.48704], [100.18447, 21.51898], [100.25863, 21.47043], [100.35201, 21.53176], [100.42892, 21.54325], [100.4811, 21.46148], [100.57861, 21.45637], [100.72143, 21.51898], [100.87265, 21.67396], [101.11744, 21.77659], [101.15156, 21.56129], [101.2124, 21.56422], [101.19349, 21.41959], [101.26912, 21.36482], [101.2229, 21.23271], [101.29326, 21.17254], [101.54563, 21.25668], [101.6068, 21.23329], [101.59491, 21.18621], [101.60886, 21.17947], [101.66977, 21.20004], [101.70548, 21.14911], [101.7622, 21.14813], [101.79266, 21.19025], [101.76745, 21.21571], [101.83887, 21.20983], [101.84412, 21.25291], [101.74014, 21.30967], [101.74224, 21.48276], [101.7727, 21.51794], [101.7475, 21.5873], [101.80001, 21.57461], [101.83257, 21.61562], [101.74555, 21.72852], [101.7791, 21.83019], [101.62566, 21.96574], [101.57525, 22.13026], [101.60675, 22.13513], [101.53638, 22.24794], [101.56789, 22.28876], [101.61306, 22.27515], [101.68973, 22.46843], [101.7685, 22.50337], [101.86828, 22.38397], [101.90714, 22.38688], [101.91344, 22.44417], [101.98487, 22.42766], [102.03633, 22.46164], [102.1245, 22.43372], [102.14099, 22.40092], [102.16621, 22.43336], [102.26428, 22.41321], [102.25339, 22.4607], [102.41061, 22.64184], [102.38415, 22.67919], [102.42618, 22.69212], [102.46665, 22.77108], [102.51802, 22.77969], [102.57095, 22.7036], [102.60675, 22.73376], [102.8636, 22.60735], [102.9321, 22.48659], [103.0722, 22.44775], [103.07843, 22.50097], [103.17961, 22.55705], [103.15782, 22.59873], [103.18895, 22.64471], [103.28079, 22.68063], [103.32282, 22.8127], [103.43179, 22.75816], [103.43646, 22.70648], [103.52675, 22.59155], [103.57812, 22.65764], [103.56255, 22.69499], [103.64506, 22.79979], [103.87904, 22.56683], [103.93286, 22.52703], [103.94513, 22.52553], [103.95191, 22.5134], [103.96352, 22.50584], [103.96783, 22.51173], [103.97384, 22.50634], [103.99247, 22.51958], [104.01088, 22.51823], [104.03734, 22.72945], [104.11384, 22.80363], [104.27084, 22.8457], [104.25683, 22.76534], [104.35593, 22.69353], [104.47225, 22.75813], [104.58122, 22.85571], [104.60457, 22.81841], [104.65283, 22.83419], [104.72755, 22.81984], [104.77114, 22.90017], [104.84942, 22.93631], [104.86765, 22.95178], [104.8334, 23.01484], [104.79478, 23.12934], [104.87382, 23.12854], [104.87992, 23.17141], [104.91435, 23.18666], [104.9486, 23.17235], [104.96532, 23.20463], [104.98712, 23.19176], [105.07002, 23.26248], [105.11672, 23.25247], [105.17276, 23.28679], [105.22569, 23.27249], [105.32376, 23.39684], [105.40782, 23.28107], [105.42805, 23.30824], [105.49966, 23.20669], [105.56037, 23.16806], [105.57594, 23.075], [105.72382, 23.06641], [105.8726, 22.92756], [105.90119, 22.94168], [105.99568, 22.94178], [106.00179, 22.99049], [106.19705, 22.98475], [106.27022, 22.87722], [106.34961, 22.86718], [106.49749, 22.91164], [106.51306, 22.94891], [106.55976, 22.92311], [106.60179, 22.92884], [106.6516, 22.86862], [106.6734, 22.89587], [106.71387, 22.88296], [106.71128, 22.85982], [106.78422, 22.81532], [106.81271, 22.8226], [106.83685, 22.8098], [106.82404, 22.7881], [106.76293, 22.73491], [106.72321, 22.63606], [106.71698, 22.58432], [106.65316, 22.5757], [106.61269, 22.60301], [106.58395, 22.474], [106.55665, 22.46498], [106.57221, 22.37], [106.55976, 22.34841], [106.6516, 22.33977], [106.69986, 22.22309], [106.67495, 22.1885], [106.6983, 22.15102], [106.70142, 22.02409], [106.68274, 21.99811], [106.69276, 21.96013], [106.72551, 21.97923], [106.74345, 22.00965], [106.81038, 21.97934], [106.9178, 21.97357], [106.92714, 21.93459], [106.97228, 21.92592], [106.99252, 21.95191], [107.05634, 21.92303], [107.06101, 21.88982], [107.00964, 21.85948], [107.02615, 21.81981], [107.10771, 21.79879], [107.20734, 21.71493], [107.24625, 21.7077], [107.29296, 21.74674], [107.35834, 21.6672], [107.35989, 21.60063], [107.38636, 21.59774], [107.41593, 21.64839], [107.47197, 21.6672], [107.49532, 21.62958], [107.49065, 21.59774], [107.54047, 21.5934], [107.56537, 21.61945], [107.66967, 21.60787], [107.80355, 21.66141], [107.86114, 21.65128], [107.90006, 21.5905], [107.92652, 21.58906], [107.95232, 21.5388], [107.96774, 21.53601], [107.97074, 21.54072], [107.97383, 21.53961], [107.97932, 21.54503], [108.02926, 21.54997], [108.0569, 21.53604], [108.10003, 21.47338], [108.00365, 17.98159], [111.60491, 13.57105], [118.41371, 24.06775], [118.11703, 24.39734], [118.28244, 24.51231], [118.35291, 24.51645], [118.42453, 24.54644], [118.6333, 24.46259], [119.42295, 25.0886], [119.98511, 25.37624], [119.78816, 26.2348], [120.0693, 26.3959], [120.5128, 26.536], [121.03532, 26.8787], [123.5458, 31.01942], [122.29378, 31.76513], [122.80525, 33.30571], [123.85601, 37.49093], [123.90497, 38.79949], [124.17532, 39.8232], [124.23201, 39.9248], [124.35029, 39.95639], [124.37089, 40.03004], [124.3322, 40.05573], [124.38556, 40.11047], [124.40719, 40.13655], [124.86913, 40.45387], [125.71172, 40.85223], [125.76869, 40.87908], [126.00335, 40.92835], [126.242, 41.15454], [126.53189, 41.35206], [126.60631, 41.65565], [126.90729, 41.79955], [127.17841, 41.59714], [127.29712, 41.49473], [127.92943, 41.44291], [128.02633, 41.42103], [128.03311, 41.39232], [128.12967, 41.37931], [128.18546, 41.41279], [128.20061, 41.40895], [128.30716, 41.60322], [128.15119, 41.74568], [128.04487, 42.01769], [128.94007, 42.03537], [128.96068, 42.06657], [129.15178, 42.17224], [129.22285, 42.26491], [129.22423, 42.3553], [129.28541, 42.41574], [129.42882, 42.44702], [129.54701, 42.37254], [129.60482, 42.44461], [129.72541, 42.43739], [129.75294, 42.59409], [129.77183, 42.69435], [129.7835, 42.76521], [129.80719, 42.79218], [129.83277, 42.86746], [129.85261, 42.96494], [129.8865, 43.00395], [129.95082, 43.01051], [129.96409, 42.97306], [130.12957, 42.98361], [130.09764, 42.91425], [130.26095, 42.9027], [130.23068, 42.80125], [130.2385, 42.71127], [130.41826, 42.6011], [130.44361, 42.54849], [130.50123, 42.61636], [130.55143, 42.52158], [130.62107, 42.58413], [130.56576, 42.68925], [130.40213, 42.70788], [130.44361, 42.76205], [130.66524, 42.84753], [131.02438, 42.86518], [131.02668, 42.91246], [131.135, 42.94114], [131.10274, 43.04734], [131.20414, 43.13654], [131.19031, 43.21385], [131.30324, 43.39498], [131.29402, 43.46695], [131.19492, 43.53047], [131.21105, 43.82383], [131.26176, 43.94011], [131.23583, 43.96085], [131.25484, 44.03131], [131.30365, 44.04262], [131.1108, 44.70266], [130.95639, 44.85154], [131.48415, 44.99513], [131.68466, 45.12374], [131.66852, 45.2196], [131.76532, 45.22609], [131.86903, 45.33636], [131.99417, 45.2567], [132.83978, 45.05916], [132.96373, 45.0212], [133.12293, 45.1332], [133.09279, 45.25693], [133.19419, 45.51913], [133.41083, 45.57723], [133.48457, 45.86203], [133.60442, 45.90053], [133.67569, 45.9759], [133.72695, 46.05576], [133.68047, 46.14697], [133.88097, 46.25066], [133.91496, 46.4274], [133.84104, 46.46681], [134.03538, 46.75668], [134.20016, 47.33458], [134.50898, 47.4812], [134.7671, 47.72051], [134.55508, 47.98651], [134.67098, 48.1564], [134.75328, 48.36763], [134.49516, 48.42884], [132.66989, 47.96491], [132.57309, 47.71741], [131.90448, 47.68011], [131.2635, 47.73325], [131.09871, 47.6852], [130.95985, 47.6957], [130.90915, 47.90623], [130.65103, 48.10052], [130.84462, 48.30942], [130.52147, 48.61745], [130.66946, 48.88251], [130.43232, 48.90844], [130.2355, 48.86741], [129.85416, 49.11067], [129.67598, 49.29596], [129.50685, 49.42398], [129.40398, 49.44194], [129.35317, 49.3481], [129.23232, 49.40353], [129.11153, 49.36813], [128.72896, 49.58676], [127.83476, 49.5748], [127.53516, 49.84306], [127.49299, 50.01251], [127.60515, 50.23503], [127.37384, 50.28393], [127.36009, 50.43787], [127.28765, 50.46585], [127.36335, 50.58306], [127.28165, 50.72075], [127.14586, 50.91152], [126.93135, 51.0841], [126.90369, 51.3238], [126.68349, 51.70607], [126.44606, 51.98254], [126.558, 52.13738], [125.6131, 53.07229]], [[113.56865, 22.20973], [113.57123, 22.20416], [113.60504, 22.20464], [113.63011, 22.10782], [113.57191, 22.07696], [113.54839, 22.10909], [113.54942, 22.14519], [113.54093, 22.15497], [113.52659, 22.18271], [113.53552, 22.20607], [113.53301, 22.21235], [113.53591, 22.21369], [113.54093, 22.21314], [113.54333, 22.21688], [113.5508, 22.21672], [113.56865, 22.20973]], [[114.50148, 22.15017], [113.92195, 22.13873], [113.83338, 22.1826], [113.81621, 22.2163], [113.86771, 22.42972], [114.03113, 22.5065], [114.05438, 22.5026], [114.05729, 22.51104], [114.06272, 22.51617], [114.07267, 22.51855], [114.07817, 22.52997], [114.08606, 22.53276], [114.09048, 22.53716], [114.09692, 22.53435], [114.1034, 22.5352], [114.11181, 22.52878], [114.11656, 22.53415], [114.12665, 22.54003], [114.13823, 22.54319], [114.1482, 22.54091], [114.15123, 22.55163], [114.1597, 22.56041], [114.17247, 22.55944], [114.18338, 22.55444], [114.20655, 22.55706], [114.22185, 22.55343], [114.22888, 22.5436], [114.25154, 22.55977], [114.44998, 22.55977], [114.50148, 22.15017]]]] } },
23083 { type: "Feature", properties: { wikidata: "Q22890", nameEn: "Ireland", level: "sharedLandform" }, geometry: null },
23084 { type: "Feature", properties: { wikidata: "Q23666", nameEn: "Great Britain", country: "GB", level: "sharedLandform" }, geometry: null },
23085 { type: "Feature", properties: { wikidata: "Q23681", nameEn: "Northern Cyprus", groups: ["Q644636", "145", "142"], driveSide: "left", callingCodes: ["90 392"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.67678, 35.03866], [33.67742, 35.05963], [33.68474, 35.06602], [33.69095, 35.06237], [33.70861, 35.07644], [33.7161, 35.07279], [33.70209, 35.04882], [33.71482, 35.03722], [33.73824, 35.05321], [33.76106, 35.04253], [33.78581, 35.05104], [33.82067, 35.07826], [33.84168, 35.06823], [33.8541, 35.07201], [33.87479, 35.08881], [33.87097, 35.09389], [33.87622, 35.10457], [33.87224, 35.12293], [33.88561, 35.12449], [33.88943, 35.12007], [33.88737, 35.11408], [33.89853, 35.11377], [33.91789, 35.08688], [33.91299, 35.07579], [33.90247, 35.07686], [33.89485, 35.06873], [33.88367, 35.07877], [33.85261, 35.0574], [33.8355, 35.05777], [33.82051, 35.0667], [33.8012, 35.04786], [33.81524, 35.04192], [33.83055, 35.02865], [33.82875, 35.01685], [33.84045, 35.00616], [33.85216, 35.00579], [33.85891, 35.001], [33.85621, 34.98956], [33.83505, 34.98108], [33.84811, 34.97075], [33.86432, 34.97592], [33.90075, 34.96623], [33.98684, 34.76642], [35.48515, 34.70851], [35.51152, 36.10954], [32.82353, 35.70297], [32.46489, 35.48584], [32.60361, 35.16647], [32.64864, 35.19967], [32.70947, 35.18328], [32.70779, 35.14127], [32.85733, 35.07742], [32.86406, 35.1043], [32.94471, 35.09422], [33.01192, 35.15639], [33.08249, 35.17319], [33.11105, 35.15639], [33.15138, 35.19504], [33.27068, 35.16815], [33.3072, 35.16816], [33.31955, 35.18096], [33.35056, 35.18328], [33.34964, 35.17803], [33.35596, 35.17942], [33.35612, 35.17402], [33.36569, 35.17479], [33.3717, 35.1788], [33.37248, 35.18698], [33.38575, 35.2018], [33.4076, 35.20062], [33.41675, 35.16325], [33.46813, 35.10564], [33.48136, 35.0636], [33.47825, 35.04103], [33.45178, 35.02078], [33.45256, 35.00288], [33.47666, 35.00701], [33.48915, 35.06594], [33.53975, 35.08151], [33.57478, 35.06049], [33.567, 35.04803], [33.59658, 35.03635], [33.61215, 35.0527], [33.63765, 35.03869], [33.67678, 35.03866]]]] } },
23086 { type: "Feature", properties: { wikidata: "Q25231", nameEn: "Svalbard", aliases: ["NO-21"], country: "NO", groups: ["SJ", "154", "150", "UN"], level: "subterritory", callingCodes: ["47 79"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-7.49892, 77.24208], [32.07813, 72.01005], [36.85549, 84.09565], [-7.49892, 77.24208]]]] } },
23087 { type: "Feature", properties: { wikidata: "Q25263", nameEn: "Azores", aliases: ["PT-20"], country: "PT", groups: ["Q3320166", "Q2914565", "Q105472", "EU", "039", "150", "UN"], callingCodes: ["351"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-23.12984, 40.26428], [-36.43765, 41.39418], [-22.54767, 33.34416], [-23.12984, 40.26428]]]] } },
23088 { type: "Feature", properties: { wikidata: "Q25359", nameEn: "Navassa Island", aliases: ["UM-76"], country: "US", groups: ["UM", "Q1352230", "029", "003", "419", "019", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-74.7289, 18.71009], [-75.71816, 18.46438], [-74.76465, 18.06252], [-74.7289, 18.71009]]]] } },
23089 { type: "Feature", properties: { wikidata: "Q25396", nameEn: "Bonaire", aliases: ["BQ-BO", "NL-BQ1"], country: "NL", groups: ["Q1451600", "BQ", "029", "003", "419", "019", "UN"], level: "subterritory", callingCodes: ["599 7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-67.89186, 12.4116], [-68.90012, 12.62309], [-68.33524, 11.78151], [-68.01417, 11.77722], [-67.89186, 12.4116]]]] } },
23090 { type: "Feature", properties: { wikidata: "Q25528", nameEn: "Saba", aliases: ["BQ-SA", "NL-BQ2"], country: "NL", groups: ["Q1451600", "BQ", "029", "003", "419", "019", "UN"], level: "subterritory", callingCodes: ["599 4"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.07669, 17.79659], [-63.81314, 17.95045], [-63.22932, 17.32592], [-63.07669, 17.79659]]]] } },
23091 { type: "Feature", properties: { wikidata: "Q26180", nameEn: "Sint Eustatius", aliases: ["BQ-SE", "NL-BQ3"], country: "NL", groups: ["Q1451600", "BQ", "029", "003", "419", "019", "UN"], level: "subterritory", callingCodes: ["599 3"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.07669, 17.79659], [-63.34999, 16.94218], [-62.76692, 17.64353], [-63.07669, 17.79659]]]] } },
23092 { type: "Feature", properties: { wikidata: "Q26253", nameEn: "Madeira", aliases: ["PT-30"], country: "PT", groups: ["Q3320166", "Q2914565", "Q105472", "EU", "039", "150", "UN"], callingCodes: ["351"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-19.30302, 33.65304], [-16.04789, 29.65076], [-11.68307, 33.12333], [-19.30302, 33.65304]]]] } },
23093 { type: "Feature", properties: { wikidata: "Q26927", nameEn: "Lakshadweep", aliases: ["IN-LD"], country: "IN", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["91"] }, geometry: { type: "MultiPolygon", coordinates: [[[[67.64074, 11.57295], [76.59015, 5.591], [72.67494, 13.58102], [67.64074, 11.57295]]]] } },
23094 { type: "Feature", properties: { wikidata: "Q27329", nameEn: "Asian Russia", country: "RU", groups: ["142", "UN"], callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-179.99933, 64.74703], [-172.76104, 63.77445], [-169.03888, 65.48473], [-168.95635, 65.98512], [-168.25765, 71.99091], [-179.9843, 71.90735], [-179.99933, 64.74703]]], [[[59.99809, 51.98263], [60.19925, 51.99173], [60.48915, 52.15175], [60.72581, 52.15538], [60.78201, 52.22067], [61.05417, 52.35096], [60.98021, 52.50068], [60.84709, 52.52228], [60.84118, 52.63912], [60.71693, 52.66245], [60.71989, 52.75923], [61.05842, 52.92217], [61.23462, 53.03227], [62.0422, 52.96105], [62.12799, 52.99133], [62.14574, 53.09626], [61.19024, 53.30536], [61.14291, 53.41481], [61.29082, 53.50992], [61.37957, 53.45887], [61.57185, 53.50112], [61.55706, 53.57144], [60.90626, 53.62937], [61.22574, 53.80268], [61.14283, 53.90063], [60.99796, 53.93699], [61.26863, 53.92797], [61.3706, 54.08464], [61.47603, 54.08048], [61.56941, 53.95703], [61.65318, 54.02445], [62.03913, 53.94768], [62.00966, 54.04134], [62.38535, 54.03961], [62.45931, 53.90737], [62.56876, 53.94047], [62.58651, 54.05871], [63.80604, 54.27079], [63.91224, 54.20013], [64.02715, 54.22679], [63.97686, 54.29763], [64.97216, 54.4212], [65.11033, 54.33028], [65.24663, 54.35721], [65.20174, 54.55216], [68.21308, 54.98645], [68.26661, 55.09226], [68.19206, 55.18823], [68.90865, 55.38148], [69.34224, 55.36344], [69.74917, 55.35545], [70.19179, 55.1476], [70.76493, 55.3027], [70.96009, 55.10558], [71.08288, 54.71253], [71.24185, 54.64965], [71.08706, 54.33376], [71.10379, 54.13326], [71.96141, 54.17736], [72.17477, 54.36303], [72.43415, 53.92685], [72.71026, 54.1161], [73.37963, 53.96132], [73.74778, 54.07194], [73.68921, 53.86522], [73.25412, 53.61532], [73.39218, 53.44623], [75.07405, 53.80831], [75.43398, 53.98652], [75.3668, 54.07439], [76.91052, 54.4677], [76.82266, 54.1798], [76.44076, 54.16017], [76.54243, 53.99329], [77.90383, 53.29807], [79.11255, 52.01171], [80.08138, 50.77658], [80.4127, 50.95581], [80.44819, 51.20855], [80.80318, 51.28262], [81.16999, 51.15662], [81.06091, 50.94833], [81.41248, 50.97524], [81.46581, 50.77658], [81.94999, 50.79307], [82.55443, 50.75412], [83.14607, 51.00796], [83.8442, 50.87375], [84.29385, 50.27257], [84.99198, 50.06793], [85.24047, 49.60239], [86.18709, 49.50259], [86.63674, 49.80136], [86.79056, 49.74787], [86.61307, 49.60239], [86.82606, 49.51796], [87.03071, 49.25142], [87.31465, 49.23603], [87.28386, 49.11626], [87.478, 49.07403], [87.48983, 49.13794], [87.81333, 49.17354], [87.98977, 49.18147], [88.15543, 49.30314], [88.17223, 49.46934], [88.42449, 49.48821], [88.82499, 49.44808], [89.70687, 49.72535], [89.59711, 49.90851], [91.86048, 50.73734], [92.07173, 50.69585], [92.44714, 50.78762], [93.01109, 50.79001], [92.99595, 50.63183], [94.30823, 50.57498], [94.39258, 50.22193], [94.49477, 50.17832], [94.6121, 50.04239], [94.97166, 50.04725], [95.02465, 49.96941], [95.74757, 49.97915], [95.80056, 50.04239], [96.97388, 49.88413], [97.24639, 49.74737], [97.56811, 49.84265], [97.56432, 49.92801], [97.76871, 49.99861], [97.85197, 49.91339], [98.29481, 50.33561], [98.31373, 50.4996], [98.06393, 50.61262], [97.9693, 50.78044], [98.01472, 50.86652], [97.83305, 51.00248], [98.05257, 51.46696], [98.22053, 51.46579], [98.33222, 51.71832], [98.74142, 51.8637], [98.87768, 52.14563], [99.27888, 51.96876], [99.75578, 51.90108], [99.89203, 51.74903], [100.61116, 51.73028], [101.39085, 51.45753], [101.5044, 51.50467], [102.14032, 51.35566], [102.32194, 50.67982], [102.71178, 50.38873], [103.70343, 50.13952], [105.32528, 50.4648], [106.05562, 50.40582], [106.07865, 50.33474], [106.47156, 50.31909], [106.49628, 50.32436], [106.51122, 50.34408], [106.58373, 50.34044], [106.80326, 50.30177], [107.00007, 50.1977], [107.1174, 50.04239], [107.36407, 49.97612], [107.96116, 49.93191], [107.95387, 49.66659], [108.27937, 49.53167], [108.53969, 49.32325], [109.18017, 49.34709], [109.51325, 49.22859], [110.24373, 49.16676], [110.39891, 49.25083], [110.64493, 49.1816], [113.02647, 49.60772], [113.20216, 49.83356], [114.325, 50.28098], [114.9703, 50.19254], [115.26068, 49.97367], [115.73602, 49.87688], [116.22402, 50.04477], [116.62502, 49.92919], [116.71193, 49.83813], [117.27597, 49.62544], [117.48208, 49.62324], [117.82343, 49.52696], [118.61623, 49.93809], [119.11003, 50.00276], [119.27996, 50.13348], [119.38598, 50.35162], [119.13553, 50.37412], [120.10963, 51.671], [120.65907, 51.93544], [120.77337, 52.20805], [120.61346, 52.32447], [120.71673, 52.54099], [120.46454, 52.63811], [120.04049, 52.58773], [120.0451, 52.7359], [120.85633, 53.28499], [121.39213, 53.31888], [122.35063, 53.49565], [122.85966, 53.47395], [123.26989, 53.54843], [123.86158, 53.49391], [124.46078, 53.21881], [125.17522, 53.20225], [125.6131, 53.07229], [126.558, 52.13738], [126.44606, 51.98254], [126.68349, 51.70607], [126.90369, 51.3238], [126.93135, 51.0841], [127.14586, 50.91152], [127.28165, 50.72075], [127.36335, 50.58306], [127.28765, 50.46585], [127.36009, 50.43787], [127.37384, 50.28393], [127.60515, 50.23503], [127.49299, 50.01251], [127.53516, 49.84306], [127.83476, 49.5748], [128.72896, 49.58676], [129.11153, 49.36813], [129.23232, 49.40353], [129.35317, 49.3481], [129.40398, 49.44194], [129.50685, 49.42398], [129.67598, 49.29596], [129.85416, 49.11067], [130.2355, 48.86741], [130.43232, 48.90844], [130.66946, 48.88251], [130.52147, 48.61745], [130.84462, 48.30942], [130.65103, 48.10052], [130.90915, 47.90623], [130.95985, 47.6957], [131.09871, 47.6852], [131.2635, 47.73325], [131.90448, 47.68011], [132.57309, 47.71741], [132.66989, 47.96491], [134.49516, 48.42884], [134.75328, 48.36763], [134.67098, 48.1564], [134.55508, 47.98651], [134.7671, 47.72051], [134.50898, 47.4812], [134.20016, 47.33458], [134.03538, 46.75668], [133.84104, 46.46681], [133.91496, 46.4274], [133.88097, 46.25066], [133.68047, 46.14697], [133.72695, 46.05576], [133.67569, 45.9759], [133.60442, 45.90053], [133.48457, 45.86203], [133.41083, 45.57723], [133.19419, 45.51913], [133.09279, 45.25693], [133.12293, 45.1332], [132.96373, 45.0212], [132.83978, 45.05916], [131.99417, 45.2567], [131.86903, 45.33636], [131.76532, 45.22609], [131.66852, 45.2196], [131.68466, 45.12374], [131.48415, 44.99513], [130.95639, 44.85154], [131.1108, 44.70266], [131.30365, 44.04262], [131.25484, 44.03131], [131.23583, 43.96085], [131.26176, 43.94011], [131.21105, 43.82383], [131.19492, 43.53047], [131.29402, 43.46695], [131.30324, 43.39498], [131.19031, 43.21385], [131.20414, 43.13654], [131.10274, 43.04734], [131.135, 42.94114], [131.02668, 42.91246], [131.02438, 42.86518], [130.66524, 42.84753], [130.44361, 42.76205], [130.40213, 42.70788], [130.56576, 42.68925], [130.62107, 42.58413], [130.55143, 42.52158], [130.56835, 42.43281], [130.60805, 42.4317], [130.64181, 42.41422], [130.66367, 42.38024], [130.65022, 42.32281], [131.95041, 41.5445], [140.9182, 45.92937], [145.82343, 44.571], [145.23667, 43.76813], [153.94307, 38.42848], [180, 62.52334], [180, 71.53642], [155.31937, 81.93282], [76.13964, 83.37843], [64.18965, 69.94255], [66.1708, 67.61252], [61.98014, 65.72191], [60.74386, 64.95767], [59.63945, 64.78384], [59.80579, 64.13948], [59.24834, 63.01859], [59.61398, 62.44915], [59.36223, 61.3882], [59.50685, 60.91162], [58.3853, 59.487], [59.15636, 59.14682], [59.40376, 58.45822], [58.71104, 58.07475], [58.81412, 57.71602], [58.13789, 57.68097], [58.07604, 57.08308], [57.28024, 56.87898], [57.51527, 56.08729], [59.28419, 56.15739], [59.49035, 55.60486], [58.81825, 55.03378], [57.25137, 55.26262], [57.14829, 54.84204], [57.95234, 54.39672], [59.95217, 54.85853], [59.70487, 54.14846], [58.94336, 53.953], [58.79644, 52.43392], [59.22409, 52.28437], [59.25033, 52.46803], [60.17516, 52.39457], [60.17253, 52.25814], [59.91279, 52.06924], [59.99809, 51.98263]]]] } },
23095 { type: "Feature", properties: { wikidata: "Q34366", nameEn: "Tasmania", aliases: ["AU-TAS"], country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[123.64533, -39.13605], [159.69067, -56.28945], [159.74028, -39.1978], [123.64533, -39.13605]]]] } },
23096 { type: "Feature", properties: { wikidata: "Q34497", nameEn: "Saint Helena", aliases: ["SH-HL"], country: "GB", groups: ["SH", "BOTS", "011", "202", "002", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["290"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.3824, -13.9131], [-6.17428, -19.07236], [-3.29308, -15.22647], [-8.3824, -13.9131]]]] } },
23097 { type: "Feature", properties: { wikidata: "Q35657", nameEn: "US States", country: "US", level: "subcountryGroup" }, geometry: null },
23098 { type: "Feature", properties: { wikidata: "Q36117", nameEn: "Borneo", level: "sharedLandform" }, geometry: null },
23099 { type: "Feature", properties: { wikidata: "Q36678", nameEn: "West Bank", country: "PS", groups: ["145", "142"], callingCodes: ["970"] }, geometry: { type: "MultiPolygon", coordinates: [[[[35.47672, 31.49578], [35.55941, 31.76535], [35.52758, 31.9131], [35.54375, 31.96587], [35.52012, 32.04076], [35.57111, 32.21877], [35.55807, 32.38674], [35.42078, 32.41562], [35.41048, 32.43706], [35.41598, 32.45593], [35.42034, 32.46009], [35.40224, 32.50136], [35.35212, 32.52047], [35.30685, 32.51024], [35.29306, 32.50947], [35.25049, 32.52453], [35.2244, 32.55289], [35.15937, 32.50466], [35.10882, 32.4757], [35.10024, 32.47856], [35.09236, 32.47614], [35.08564, 32.46948], [35.07059, 32.4585], [35.05423, 32.41754], [35.05311, 32.4024], [35.0421, 32.38242], [35.05142, 32.3667], [35.04243, 32.35008], [35.01772, 32.33863], [35.01119, 32.28684], [35.02939, 32.2671], [35.01841, 32.23981], [34.98885, 32.20758], [34.95703, 32.19522], [34.96009, 32.17503], [34.99039, 32.14626], [34.98507, 32.12606], [34.99437, 32.10962], [34.9863, 32.09551], [35.00261, 32.027], [34.98682, 31.96935], [35.00124, 31.93264], [35.03489, 31.92448], [35.03978, 31.89276], [35.03489, 31.85919], [34.99712, 31.85569], [34.9724, 31.83352], [35.01978, 31.82944], [35.05617, 31.85685], [35.07677, 31.85627], [35.14174, 31.81325], [35.18603, 31.80901], [35.18169, 31.82542], [35.19461, 31.82687], [35.21469, 31.81835], [35.216, 31.83894], [35.21128, 31.863], [35.20381, 31.86716], [35.20673, 31.88151], [35.20791, 31.8821], [35.20945, 31.8815], [35.21016, 31.88237], [35.21276, 31.88153], [35.2136, 31.88241], [35.22014, 31.88264], [35.22294, 31.87889], [35.22567, 31.86745], [35.22817, 31.8638], [35.2249, 31.85433], [35.2304, 31.84222], [35.24816, 31.8458], [35.25753, 31.8387], [35.251, 31.83085], [35.26404, 31.82567], [35.25573, 31.81362], [35.26058, 31.79064], [35.25225, 31.7678], [35.26319, 31.74846], [35.25182, 31.73945], [35.24981, 31.72543], [35.2438, 31.7201], [35.24315, 31.71244], [35.23972, 31.70896], [35.22392, 31.71899], [35.21937, 31.71578], [35.20538, 31.72388], [35.18023, 31.72067], [35.16478, 31.73242], [35.15474, 31.73352], [35.15119, 31.73634], [35.13931, 31.73012], [35.12933, 31.7325], [35.11895, 31.71454], [35.10782, 31.71594], [35.08226, 31.69107], [35.00879, 31.65426], [34.95249, 31.59813], [34.9415, 31.55601], [34.94356, 31.50743], [34.93258, 31.47816], [34.89756, 31.43891], [34.87833, 31.39321], [34.88932, 31.37093], [34.92571, 31.34337], [35.02459, 31.35979], [35.13033, 31.3551], [35.22921, 31.37445], [35.39675, 31.49572], [35.47672, 31.49578]]]] } },
23100 { type: "Feature", properties: { wikidata: "Q37362", nameEn: "Akrotiri and Dhekelia", aliases: ["SBA"], country: "GB" }, geometry: null },
23101 { type: "Feature", properties: { wikidata: "Q38095", nameEn: "Gal\xE1pagos Islands", aliases: ["EC-W"], country: "EC", groups: ["005", "419", "019", "UN"], callingCodes: ["593"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-93.12365, 2.64343], [-92.46744, -2.52874], [-87.07749, -0.8849], [-93.12365, 2.64343]]]] } },
23102 { type: "Feature", properties: { wikidata: "Q39760", nameEn: "Gaza Strip", country: "PS", groups: ["145", "142"], callingCodes: ["970"] }, geometry: { type: "MultiPolygon", coordinates: [[[[34.052, 31.46619], [34.21853, 31.32363], [34.23572, 31.2966], [34.24012, 31.29591], [34.26742, 31.21998], [34.29417, 31.24194], [34.36523, 31.28963], [34.37381, 31.30598], [34.36505, 31.36404], [34.40077, 31.40926], [34.48892, 31.48365], [34.56797, 31.54197], [34.48681, 31.59711], [34.29262, 31.70393], [34.052, 31.46619]]]] } },
23103 { type: "Feature", properties: { wikidata: "Q40888", nameEn: "Andaman and Nicobar Islands", aliases: ["IN-AN"], country: "IN", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["91"] }, geometry: { type: "MultiPolygon", coordinates: [[[[94.42132, 5.96581], [94.6371, 13.81803], [86.7822, 13.41052], [94.42132, 5.96581]]]] } },
23104 { type: "Feature", properties: { wikidata: "Q41684", nameEn: "Stewart Island", country: "NZ", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[166.59185, -47.61313], [169.70504, -47.56021], [167.52103, -46.41337], [166.59185, -47.61313]]]] } },
23105 { type: "Feature", properties: { wikidata: "Q43296", nameEn: "Wake Island", aliases: ["WK", "WAK", "WKUM", "872", "UM-79"], country: "US", groups: ["UM", "Q1352230", "057", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[167.34779, 18.97692], [166.67967, 20.14834], [165.82549, 18.97692], [167.34779, 18.97692]]]] } },
23106 { type: "Feature", properties: { wikidata: "Q46275", nameEn: "New Zealand Subantarctic Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[164.30551, -47.88072], [161.96603, -56.07661], [179.49541, -50.04657], [179.49541, -47.2902], [169.91032, -47.66283], [164.30551, -47.88072]]]] } },
23107 { type: "Feature", properties: { wikidata: "Q46395", nameEn: "British Overseas Territories", aliases: ["BOTS", "UKOTS"], country: "GB", level: "subcountryGroup" }, geometry: null },
23108 { type: "Feature", properties: { wikidata: "Q46772", nameEn: "Kerguelen Islands", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[61.9216, -49.39746], [70.67507, -51.14192], [74.25129, -45.45074], [61.9216, -49.39746]]]] } },
23109 { type: "Feature", properties: { wikidata: "Q46879", nameEn: "Baker Island", aliases: ["UM-81"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-175.33482, -1.40631], [-175.31323, 0.5442], [-177.91421, 0.39582], [-175.33482, -1.40631]]]] } },
23110 { type: "Feature", properties: { wikidata: "Q47863", nameEn: "Midway Atoll", aliases: ["MI", "MID", "MIUM", "488", "UM-71"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-176.29741, 29.09786], [-177.77531, 29.29793], [-177.5224, 27.7635], [-176.29741, 29.09786]]]] } },
23111 { type: "Feature", properties: { wikidata: "Q62218", nameEn: "Jarvis Island", aliases: ["UM-86"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-160.42921, -1.4364], [-159.12443, 0.19975], [-160.38779, 0.30331], [-160.42921, -1.4364]]]] } },
23112 { type: "Feature", properties: { wikidata: "Q105472", nameEn: "Macaronesia", level: "sharedLandform" }, geometry: null },
23113 { type: "Feature", properties: { wikidata: "Q114935", nameEn: "Kermadec Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-174.40891, -29.09438], [-180, -24.21376], [-179.96512, -35.00791], [-174.40891, -29.09438]]]] } },
23114 { type: "Feature", properties: { wikidata: "Q115459", nameEn: "Chatham Islands", aliases: ["NZ-CIT"], country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-179.93224, -45.18423], [-172.47015, -45.17912], [-176.30998, -41.38382], [-179.93224, -45.18423]]]] } },
23115 { type: "Feature", properties: { wikidata: "Q118863", nameEn: "North Island", country: "NZ", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[179.49541, -47.2902], [179.49541, -36.79303], [174.17679, -32.62487], [170.27492, -36.38133], [174.58663, -40.80446], [174.46634, -41.55028], [179.49541, -47.2902]]]] } },
23116 { type: "Feature", properties: { wikidata: "Q120755", nameEn: "South Island", country: "NZ", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169.70504, -47.56021], [179.49541, -47.2902], [174.46634, -41.55028], [174.58663, -40.80446], [170.27492, -36.38133], [166.56976, -39.94841], [164.8365, -46.0205], [167.52103, -46.41337], [169.70504, -47.56021]]]] } },
23117 { type: "Feature", properties: { wikidata: "Q123076", nameEn: "Palmyra Atoll", aliases: ["UM-95"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-161.06795, 5.2462], [-161.0731, 7.1291], [-163.24478, 5.24198], [-161.06795, 5.2462]]]] } },
23118 { type: "Feature", properties: { wikidata: "Q130574", nameEn: "Chafarinas Islands", country: "ES", groups: ["EU", "Q191011", "015", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.40316, 35.16893], [-2.43262, 35.20652], [-2.45965, 35.16527], [-2.40316, 35.16893]]]] } },
23119 { type: "Feature", properties: { wikidata: "Q130895", nameEn: "Kingman Reef", aliases: ["UM-89"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-161.0731, 7.1291], [-163.16627, 7.15036], [-163.24478, 5.24198], [-161.0731, 7.1291]]]] } },
23120 { type: "Feature", properties: { wikidata: "Q131008", nameEn: "Johnston Atoll", aliases: ["JT", "JTN", "JTUM", "396", "UM-67"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-170.65691, 16.57199], [-168.87689, 16.01159], [-169.2329, 17.4933], [-170.65691, 16.57199]]]] } },
23121 { type: "Feature", properties: { wikidata: "Q131305", nameEn: "Howland Island", aliases: ["UM-84"], country: "US", groups: ["UM", "Q1352230", "061", "009", "UN"], level: "subterritory", roadSpeedUnit: "mph", roadHeightUnit: "ft" }, geometry: { type: "MultiPolygon", coordinates: [[[[-177.91421, 0.39582], [-175.31323, 0.5442], [-176.74464, 2.28109], [-177.91421, 0.39582]]]] } },
23122 { type: "Feature", properties: { wikidata: "Q133888", nameEn: "Ashmore and Cartier Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[123.7463, -11.1783], [120.6877, -13.59408], [125.29076, -12.33139], [123.7463, -11.1783]]]] } },
23123 { type: "Feature", properties: { wikidata: "Q153732", nameEn: "Mariana Islands", level: "sharedLandform" }, geometry: null },
23124 { type: "Feature", properties: { wikidata: "Q172216", nameEn: "Coral Sea Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[159.77159, -28.41151], [156.73836, -14.50464], [145.2855, -9.62524], [147.69992, -17.5933], [152.93188, -20.92631], [154.02855, -24.43238], [159.77159, -28.41151]]]] } },
23125 { type: "Feature", properties: { wikidata: "Q179313", nameEn: "Alderney", country: "GB", groups: ["GG", "830", "Q185086", "154", "150", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01481"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.36485, 49.48223], [-2.09454, 49.46288], [-2.02963, 49.91866], [-2.49556, 49.79012], [-2.36485, 49.48223]]]] } },
23126 { type: "Feature", properties: { wikidata: "Q185086", nameEn: "Crown Dependencies", country: "GB", level: "subcountryGroup" }, geometry: null },
23127 { type: "Feature", properties: { wikidata: "Q190571", nameEn: "Scattered Islands", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[53.53458, -16.36909], [54.96649, -16.28353], [54.61476, -15.02273], [53.53458, -16.36909]]], [[[38.55969, -20.75596], [40.68027, -23.38889], [43.52893, -15.62903], [38.55969, -20.75596]]], [[[47.03092, -11.05648], [47.11593, -12.08552], [47.96702, -11.46447], [47.03092, -11.05648]]]] } },
23128 { type: "Feature", properties: { wikidata: "Q191011", nameEn: "Plazas de soberan\xEDa", country: "ES" }, geometry: null },
23129 { type: "Feature", properties: { wikidata: "Q191146", nameEn: "Pe\xF1\xF3n de V\xE9lez de la Gomera", country: "ES", groups: ["EU", "Q191011", "015", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-4.30191, 35.17419], [-4.30112, 35.17058], [-4.29436, 35.17149], [-4.30191, 35.17419]]]] } },
23130 { type: "Feature", properties: { wikidata: "Q201698", nameEn: "Crozet Islands", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[55.03425, -43.65017], [46.31615, -46.28749], [54.5587, -47.93013], [55.03425, -43.65017]]]] } },
23131 { type: "Feature", properties: { wikidata: "Q578170", nameEn: "Contiguous United States", aliases: ["CONUS"], country: "US", groups: ["Q35657", "021", "003", "019", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-97.13927, 25.96583], [-96.92418, 25.97377], [-80.57035, 24.0565], [-78.91214, 27.76553], [-61.98255, 37.34815], [-67.16117, 44.20069], [-66.93432, 44.82597], [-66.96824, 44.83078], [-66.98249, 44.87071], [-66.96824, 44.90965], [-67.0216, 44.95333], [-67.11316, 45.11176], [-67.15965, 45.16179], [-67.19603, 45.16771], [-67.20349, 45.1722], [-67.22751, 45.16344], [-67.27039, 45.1934], [-67.29748, 45.18173], [-67.29754, 45.14865], [-67.34927, 45.122], [-67.48201, 45.27351], [-67.42394, 45.37969], [-67.50578, 45.48971], [-67.42144, 45.50584], [-67.43815, 45.59162], [-67.6049, 45.60725], [-67.80705, 45.69528], [-67.80653, 45.80022], [-67.75654, 45.82324], [-67.80961, 45.87531], [-67.75196, 45.91814], [-67.78111, 45.9392], [-67.78578, 47.06473], [-67.87993, 47.10377], [-67.94843, 47.1925], [-68.23244, 47.35712], [-68.37458, 47.35851], [-68.38332, 47.28723], [-68.57914, 47.28431], [-68.60575, 47.24659], [-68.70125, 47.24399], [-68.89222, 47.1807], [-69.05039, 47.2456], [-69.05073, 47.30076], [-69.05148, 47.42012], [-69.22119, 47.46461], [-69.99966, 46.69543], [-70.05812, 46.41768], [-70.18547, 46.35357], [-70.29078, 46.18832], [-70.23855, 46.1453], [-70.31025, 45.96424], [-70.24694, 45.95138], [-70.25976, 45.89675], [-70.41523, 45.79497], [-70.38934, 45.73215], [-70.54019, 45.67291], [-70.68516, 45.56964], [-70.72651, 45.49771], [-70.62518, 45.42286], [-70.65383, 45.37592], [-70.78372, 45.43269], [-70.82638, 45.39828], [-70.80236, 45.37444], [-70.84816, 45.22698], [-70.89864, 45.2398], [-70.91169, 45.29849], [-70.95193, 45.33895], [-71.0107, 45.34819], [-71.01866, 45.31573], [-71.08364, 45.30623], [-71.14568, 45.24128], [-71.19723, 45.25438], [-71.22338, 45.25184], [-71.29371, 45.29996], [-71.37133, 45.24624], [-71.44252, 45.2361], [-71.40364, 45.21382], [-71.42778, 45.12624], [-71.48735, 45.07784], [-71.50067, 45.01357], [-73.35025, 45.00942], [-74.32699, 44.99029], [-74.66689, 45.00646], [-74.8447, 45.00606], [-74.99101, 44.98051], [-75.01363, 44.95608], [-75.2193, 44.87821], [-75.41441, 44.76614], [-75.76813, 44.51537], [-75.8217, 44.43176], [-75.95947, 44.34463], [-76.00018, 44.34896], [-76.16285, 44.28262], [-76.1664, 44.23051], [-76.244, 44.19643], [-76.31222, 44.19894], [-76.35324, 44.13493], [-76.43859, 44.09393], [-76.79706, 43.63099], [-79.25796, 43.54052], [-79.06921, 43.26183], [-79.05512, 43.25375], [-79.05544, 43.21224], [-79.05002, 43.20133], [-79.05384, 43.17418], [-79.04652, 43.16396], [-79.0427, 43.13934], [-79.06881, 43.12029], [-79.05671, 43.10937], [-79.07486, 43.07845], [-79.01055, 43.06659], [-78.99941, 43.05612], [-79.02424, 43.01983], [-79.02074, 42.98444], [-78.98126, 42.97], [-78.96312, 42.95509], [-78.93224, 42.95229], [-78.90905, 42.93022], [-78.90712, 42.89733], [-78.93684, 42.82887], [-82.67862, 41.67615], [-83.11184, 41.95671], [-83.14962, 42.04089], [-83.12724, 42.2376], [-83.09837, 42.28877], [-83.07837, 42.30978], [-83.02253, 42.33045], [-82.82964, 42.37355], [-82.64242, 42.55594], [-82.58873, 42.54984], [-82.57583, 42.5718], [-82.51858, 42.611], [-82.51063, 42.66025], [-82.46613, 42.76615], [-82.4826, 42.8068], [-82.45331, 42.93139], [-82.4253, 42.95423], [-82.4146, 42.97626], [-82.42469, 42.992], [-82.48419, 45.30225], [-83.59589, 45.82131], [-83.43746, 45.99749], [-83.57017, 46.105], [-83.83329, 46.12169], [-83.90453, 46.05922], [-83.95399, 46.05634], [-84.1096, 46.23987], [-84.09756, 46.25512], [-84.11615, 46.2681], [-84.11254, 46.32329], [-84.13451, 46.39218], [-84.11196, 46.50248], [-84.12885, 46.53068], [-84.17723, 46.52753], [-84.1945, 46.54061], [-84.2264, 46.53337], [-84.26351, 46.49508], [-84.29893, 46.49127], [-84.34174, 46.50683], [-84.42101, 46.49853], [-84.4481, 46.48972], [-84.47607, 46.45225], [-84.55635, 46.45974], [-84.85871, 46.88881], [-88.37033, 48.30586], [-89.48837, 48.01412], [-89.57972, 48.00023], [-89.77248, 48.02607], [-89.89974, 47.98109], [-90.07418, 48.11043], [-90.56312, 48.09488], [-90.56444, 48.12184], [-90.75045, 48.09143], [-90.87588, 48.2484], [-91.08016, 48.18096], [-91.25025, 48.08522], [-91.43248, 48.04912], [-91.45829, 48.07454], [-91.58025, 48.04339], [-91.55649, 48.10611], [-91.70451, 48.11805], [-91.71231, 48.19875], [-91.86125, 48.21278], [-91.98929, 48.25409], [-92.05339, 48.35958], [-92.14732, 48.36578], [-92.202, 48.35252], [-92.26662, 48.35651], [-92.30939, 48.31251], [-92.27167, 48.25046], [-92.37185, 48.22259], [-92.48147, 48.36609], [-92.45588, 48.40624], [-92.50712, 48.44921], [-92.65606, 48.43471], [-92.71323, 48.46081], [-92.69927, 48.49573], [-92.62747, 48.50278], [-92.6342, 48.54133], [-92.7287, 48.54005], [-92.94973, 48.60866], [-93.25391, 48.64266], [-93.33946, 48.62787], [-93.3712, 48.60599], [-93.39758, 48.60364], [-93.40693, 48.60948], [-93.44472, 48.59147], [-93.47022, 48.54357], [-93.66382, 48.51845], [-93.79267, 48.51631], [-93.80939, 48.52439], [-93.80676, 48.58232], [-93.83288, 48.62745], [-93.85769, 48.63284], [-94.23215, 48.65202], [-94.25104, 48.65729], [-94.25172, 48.68404], [-94.27153, 48.70232], [-94.4174, 48.71049], [-94.44258, 48.69223], [-94.53826, 48.70216], [-94.54885, 48.71543], [-94.58903, 48.71803], [-94.69335, 48.77883], [-94.69669, 48.80918], [-94.70486, 48.82365], [-94.70087, 48.8339], [-94.687, 48.84077], [-94.75017, 49.09931], [-94.77355, 49.11998], [-94.82487, 49.29483], [-94.8159, 49.32299], [-94.85381, 49.32492], [-94.95681, 49.37035], [-94.99532, 49.36579], [-95.01419, 49.35647], [-95.05825, 49.35311], [-95.12903, 49.37056], [-95.15357, 49.384], [-95.15355, 48.9996], [-123.32163, 49.00419], [-123.0093, 48.83186], [-123.0093, 48.76586], [-123.26565, 48.6959], [-123.15614, 48.35395], [-123.50039, 48.21223], [-125.03842, 48.53282], [-133.98258, 38.06389], [-118.48109, 32.5991], [-117.1243, 32.53427], [-115.88053, 32.63624], [-114.71871, 32.71894], [-114.76736, 32.64094], [-114.80584, 32.62028], [-114.81141, 32.55543], [-114.79524, 32.55731], [-114.82011, 32.49609], [-111.07523, 31.33232], [-108.20979, 31.33316], [-108.20899, 31.78534], [-106.529, 31.784], [-106.52266, 31.77509], [-106.51251, 31.76922], [-106.50962, 31.76155], [-106.50111, 31.75714], [-106.48815, 31.74769], [-106.47298, 31.75054], [-106.46726, 31.75998], [-106.45244, 31.76523], [-106.43419, 31.75478], [-106.41773, 31.75196], [-106.38003, 31.73151], [-106.3718, 31.71165], [-106.34864, 31.69663], [-106.33419, 31.66303], [-106.30305, 31.62154], [-106.28084, 31.56173], [-106.24612, 31.54193], [-106.23711, 31.51262], [-106.20346, 31.46305], [-106.09025, 31.40569], [-106.00363, 31.39181], [-104.77674, 30.4236], [-104.5171, 29.64671], [-104.3969, 29.57105], [-104.39363, 29.55396], [-104.37752, 29.54255], [-103.15787, 28.93865], [-102.60596, 29.8192], [-101.47277, 29.7744], [-101.05686, 29.44738], [-101.01128, 29.36947], [-100.96725, 29.3477], [-100.94579, 29.34523], [-100.94056, 29.33371], [-100.87982, 29.296], [-100.79696, 29.24688], [-100.67294, 29.09744], [-100.63689, 28.90812], [-100.59809, 28.88197], [-100.52313, 28.75598], [-100.5075, 28.74066], [-100.51222, 28.70679], [-100.50029, 28.66117], [-99.55409, 27.61314], [-99.51478, 27.55836], [-99.52955, 27.49747], [-99.50208, 27.50021], [-99.48045, 27.49016], [-99.482, 27.47128], [-99.49744, 27.43746], [-99.53573, 27.30926], [-99.08477, 26.39849], [-99.03053, 26.41249], [-99.00546, 26.3925], [-98.35126, 26.15129], [-98.30491, 26.10475], [-98.27075, 26.09457], [-98.24603, 26.07191], [-97.97017, 26.05232], [-97.95155, 26.0625], [-97.66511, 26.01708], [-97.52025, 25.88518], [-97.49828, 25.89877], [-97.45669, 25.86874], [-97.42511, 25.83969], [-97.37332, 25.83854], [-97.35946, 25.92189], [-97.13927, 25.96583]]]] } },
23132 { type: "Feature", properties: { wikidata: "Q620634", nameEn: "Bir Tawil", groups: ["015", "002"], level: "territory" }, geometry: { type: "MultiPolygon", coordinates: [[[[33.17563, 22.00405], [33.57251, 21.72406], [33.99686, 21.76784], [34.0765, 22.00501], [33.17563, 22.00405]]]] } },
23133 { type: "Feature", properties: { wikidata: "Q639185", nameEn: "Peros Banhos", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[72.12587, -4.02588], [70.1848, -6.37445], [72.09518, -5.61768], [72.12587, -4.02588]]]] } },
23134 { type: "Feature", properties: { wikidata: "Q644636", nameEn: "Cyprus", level: "sharedLandform" }, geometry: null },
23135 { type: "Feature", properties: { wikidata: "Q851132", nameEn: "New Zealand Outlying Islands", country: "NZ", level: "subcountryGroup" }, geometry: null },
23136 { type: "Feature", properties: { wikidata: "Q875134", nameEn: "European Russia", country: "RU", groups: ["151", "150", "UN"], callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[18.57853, 55.25302], [19.64312, 54.45423], [19.8038, 54.44203], [20.63871, 54.3706], [21.41123, 54.32395], [22.79705, 54.36264], [22.7253, 54.41732], [22.70208, 54.45312], [22.67788, 54.532], [22.71293, 54.56454], [22.68021, 54.58486], [22.7522, 54.63525], [22.74225, 54.64339], [22.75467, 54.6483], [22.73397, 54.66604], [22.73631, 54.72952], [22.87317, 54.79492], [22.85083, 54.88711], [22.76422, 54.92521], [22.68723, 54.9811], [22.65451, 54.97037], [22.60075, 55.01863], [22.58907, 55.07085], [22.47688, 55.04408], [22.31562, 55.0655], [22.14267, 55.05345], [22.11697, 55.02131], [22.06087, 55.02935], [22.02582, 55.05078], [22.03984, 55.07888], [21.99543, 55.08691], [21.96505, 55.07353], [21.85521, 55.09493], [21.64954, 55.1791], [21.55605, 55.20311], [21.51095, 55.18507], [21.46766, 55.21115], [21.38446, 55.29348], [21.35465, 55.28427], [21.26425, 55.24456], [20.95181, 55.27994], [20.60454, 55.40986], [18.57853, 55.25302]]], [[[26.32936, 60.00121], [26.90044, 59.63819], [27.85643, 59.58538], [28.04187, 59.47017], [28.19061, 59.39962], [28.21137, 59.38058], [28.20537, 59.36491], [28.19284, 59.35791], [28.14215, 59.28934], [28.00689, 59.28351], [27.90911, 59.24353], [27.87978, 59.18097], [27.80482, 59.1116], [27.74429, 58.98351], [27.36366, 58.78381], [27.55489, 58.39525], [27.48541, 58.22615], [27.62393, 58.09462], [27.67282, 57.92627], [27.81841, 57.89244], [27.78526, 57.83963], [27.56689, 57.83356], [27.50171, 57.78842], [27.52615, 57.72843], [27.3746, 57.66834], [27.40393, 57.62125], [27.31919, 57.57672], [27.34698, 57.52242], [27.56832, 57.53728], [27.52453, 57.42826], [27.86101, 57.29402], [27.66511, 56.83921], [27.86101, 56.88204], [28.04768, 56.59004], [28.13526, 56.57989], [28.10069, 56.524], [28.19057, 56.44637], [28.16599, 56.37806], [28.23716, 56.27588], [28.15217, 56.16964], [28.30571, 56.06035], [28.36888, 56.05805], [28.37987, 56.11399], [28.43068, 56.09407], [28.5529, 56.11705], [28.68337, 56.10173], [28.63668, 56.07262], [28.73418, 55.97131], [29.08299, 56.03427], [29.21717, 55.98971], [29.44692, 55.95978], [29.3604, 55.75862], [29.51283, 55.70294], [29.61446, 55.77716], [29.80672, 55.79569], [29.97975, 55.87281], [30.12136, 55.8358], [30.27776, 55.86819], [30.30987, 55.83592], [30.48257, 55.81066], [30.51346, 55.78982], [30.51037, 55.76568], [30.63344, 55.73079], [30.67464, 55.64176], [30.72957, 55.66268], [30.7845, 55.58514], [30.86003, 55.63169], [30.93419, 55.6185], [30.95204, 55.50667], [30.90123, 55.46621], [30.93144, 55.3914], [30.8257, 55.3313], [30.81946, 55.27931], [30.87944, 55.28223], [30.97369, 55.17134], [31.02071, 55.06167], [31.00972, 55.02783], [30.94243, 55.03964], [30.9081, 55.02232], [30.95754, 54.98609], [30.93144, 54.9585], [30.81759, 54.94064], [30.8264, 54.90062], [30.75165, 54.80699], [30.95479, 54.74346], [30.97127, 54.71967], [31.0262, 54.70698], [30.98226, 54.68872], [30.99187, 54.67046], [31.19339, 54.66947], [31.21399, 54.63113], [31.08543, 54.50361], [31.22945, 54.46585], [31.3177, 54.34067], [31.30791, 54.25315], [31.57002, 54.14535], [31.89599, 54.0837], [31.88744, 54.03653], [31.85019, 53.91801], [31.77028, 53.80015], [31.89137, 53.78099], [32.12621, 53.81586], [32.36663, 53.7166], [32.45717, 53.74039], [32.50112, 53.68594], [32.40499, 53.6656], [32.47777, 53.5548], [32.74968, 53.45597], [32.73257, 53.33494], [32.51725, 53.28431], [32.40773, 53.18856], [32.15368, 53.07594], [31.82373, 53.10042], [31.787, 53.18033], [31.62496, 53.22886], [31.56316, 53.19432], [31.40523, 53.21406], [31.36403, 53.13504], [31.3915, 53.09712], [31.33519, 53.08805], [31.32283, 53.04101], [31.24147, 53.031], [31.35667, 52.97854], [31.592, 52.79011], [31.57277, 52.71613], [31.50406, 52.69707], [31.63869, 52.55361], [31.56316, 52.51518], [31.61397, 52.48843], [31.62084, 52.33849], [31.57971, 52.32146], [31.70735, 52.26711], [31.6895, 52.1973], [31.77877, 52.18636], [31.7822, 52.11406], [31.81722, 52.09955], [31.85018, 52.11305], [31.96141, 52.08015], [31.92159, 52.05144], [32.08813, 52.03319], [32.23331, 52.08085], [32.2777, 52.10266], [32.34044, 52.1434], [32.33083, 52.23685], [32.38988, 52.24946], [32.3528, 52.32842], [32.54781, 52.32423], [32.69475, 52.25535], [32.85405, 52.27888], [32.89937, 52.2461], [33.18913, 52.3754], [33.51323, 52.35779], [33.48027, 52.31499], [33.55718, 52.30324], [33.78789, 52.37204], [34.05239, 52.20132], [34.11199, 52.14087], [34.09413, 52.00835], [34.41136, 51.82793], [34.42922, 51.72852], [34.07765, 51.67065], [34.17599, 51.63253], [34.30562, 51.5205], [34.22048, 51.4187], [34.33446, 51.363], [34.23009, 51.26429], [34.31661, 51.23936], [34.38802, 51.2746], [34.6613, 51.25053], [34.6874, 51.18], [34.82472, 51.17483], [34.97304, 51.2342], [35.14058, 51.23162], [35.12685, 51.16191], [35.20375, 51.04723], [35.31774, 51.08434], [35.40837, 51.04119], [35.32598, 50.94524], [35.39307, 50.92145], [35.41367, 50.80227], [35.47704, 50.77274], [35.48116, 50.66405], [35.39464, 50.64751], [35.47463, 50.49247], [35.58003, 50.45117], [35.61711, 50.35707], [35.73659, 50.35489], [35.80388, 50.41356], [35.8926, 50.43829], [36.06893, 50.45205], [36.20763, 50.3943], [36.30101, 50.29088], [36.47817, 50.31457], [36.58371, 50.28563], [36.56655, 50.2413], [36.64571, 50.218], [36.69377, 50.26982], [36.91762, 50.34963], [37.08468, 50.34935], [37.48204, 50.46079], [37.47243, 50.36277], [37.62486, 50.29966], [37.62879, 50.24481], [37.61113, 50.21976], [37.75807, 50.07896], [37.79515, 50.08425], [37.90776, 50.04194], [38.02999, 49.94482], [38.02999, 49.90592], [38.21675, 49.98104], [38.18517, 50.08161], [38.32524, 50.08866], [38.35408, 50.00664], [38.65688, 49.97176], [38.68677, 50.00904], [38.73311, 49.90238], [38.90477, 49.86787], [38.9391, 49.79524], [39.1808, 49.88911], [39.27968, 49.75976], [39.44496, 49.76067], [39.59142, 49.73758], [39.65047, 49.61761], [39.84548, 49.56064], [40.13249, 49.61672], [40.16683, 49.56865], [40.03636, 49.52321], [40.03087, 49.45452], [40.1141, 49.38798], [40.14912, 49.37681], [40.18331, 49.34996], [40.22176, 49.25683], [40.01988, 49.1761], [39.93437, 49.05709], [39.6836, 49.05121], [39.6683, 48.99454], [39.71353, 48.98959], [39.72649, 48.9754], [39.74874, 48.98675], [39.78368, 48.91596], [39.98967, 48.86901], [40.03636, 48.91957], [40.08168, 48.87443], [39.97182, 48.79398], [39.79466, 48.83739], [39.73104, 48.7325], [39.71765, 48.68673], [39.67226, 48.59368], [39.79764, 48.58668], [39.84548, 48.57821], [39.86196, 48.46633], [39.88794, 48.44226], [39.94847, 48.35055], [39.84136, 48.33321], [39.84273, 48.30947], [39.90041, 48.3049], [39.91465, 48.26743], [39.95248, 48.29972], [39.9693, 48.29904], [39.97325, 48.31399], [39.99241, 48.31768], [40.00752, 48.22445], [39.94847, 48.22811], [39.83724, 48.06501], [39.88256, 48.04482], [39.77544, 48.04206], [39.82213, 47.96396], [39.73935, 47.82876], [38.87979, 47.87719], [38.79628, 47.81109], [38.76379, 47.69346], [38.35062, 47.61631], [38.28679, 47.53552], [38.28954, 47.39255], [38.22225, 47.30788], [38.33074, 47.30508], [38.32112, 47.2585], [38.23049, 47.2324], [38.22955, 47.12069], [38.3384, 46.98085], [38.12112, 46.86078], [37.62608, 46.82615], [35.23066, 45.79231], [35.04991, 45.76827], [36.6645, 45.4514], [36.6545, 45.3417], [36.5049, 45.3136], [36.475, 45.2411], [36.4883, 45.0488], [33.5943, 44.03313], [39.81147, 43.06294], [40.0078, 43.38551], [40.00853, 43.40578], [40.01552, 43.42025], [40.01007, 43.42411], [40.03312, 43.44262], [40.04445, 43.47776], [40.10657, 43.57344], [40.65957, 43.56212], [41.64935, 43.22331], [42.40563, 43.23226], [42.66667, 43.13917], [42.75889, 43.19651], [43.03322, 43.08883], [43.0419, 43.02413], [43.81453, 42.74297], [43.73119, 42.62043], [43.95517, 42.55396], [44.54202, 42.75699], [44.70002, 42.74679], [44.80941, 42.61277], [44.88754, 42.74934], [45.15318, 42.70598], [45.36501, 42.55268], [45.78692, 42.48358], [45.61676, 42.20768], [46.42738, 41.91323], [46.5332, 41.87389], [46.58924, 41.80547], [46.75269, 41.8623], [46.8134, 41.76252], [47.00955, 41.63583], [46.99554, 41.59743], [47.03757, 41.55434], [47.10762, 41.59044], [47.34579, 41.27884], [47.49004, 41.26366], [47.54504, 41.20275], [47.62288, 41.22969], [47.75831, 41.19455], [47.87973, 41.21798], [48.07587, 41.49957], [48.22064, 41.51472], [48.2878, 41.56221], [48.40277, 41.60441], [48.42301, 41.65444], [48.55078, 41.77917], [48.5867, 41.84306], [48.80971, 41.95365], [49.2134, 44.84989], [49.88945, 46.04554], [49.32259, 46.26944], [49.16518, 46.38542], [48.54988, 46.56267], [48.51142, 46.69268], [49.01136, 46.72716], [48.52326, 47.4102], [48.45173, 47.40818], [48.15348, 47.74545], [47.64973, 47.76559], [47.41689, 47.83687], [47.38731, 47.68176], [47.12107, 47.83687], [47.11516, 48.27188], [46.49011, 48.43019], [46.78392, 48.95352], [47.00857, 49.04921], [47.04658, 49.19834], [46.78398, 49.34026], [46.9078, 49.86707], [47.18319, 49.93721], [47.34589, 50.09308], [47.30448, 50.30894], [47.58551, 50.47867], [48.10044, 50.09242], [48.24519, 49.86099], [48.42564, 49.82283], [48.68352, 49.89546], [48.90782, 50.02281], [48.57946, 50.63278], [48.86936, 50.61589], [49.12673, 50.78639], [49.41959, 50.85927], [49.39001, 51.09396], [49.76866, 51.11067], [49.97277, 51.2405], [50.26859, 51.28677], [50.59695, 51.61859], [51.26254, 51.68466], [51.301, 51.48799], [51.77431, 51.49536], [51.8246, 51.67916], [52.36119, 51.74161], [52.54329, 51.48444], [53.46165, 51.49445], [53.69299, 51.23466], [54.12248, 51.11542], [54.46331, 50.85554], [54.41894, 50.61214], [54.55797, 50.52006], [54.71476, 50.61214], [54.56685, 51.01958], [54.72067, 51.03261], [55.67774, 50.54508], [56.11398, 50.7471], [56.17906, 50.93204], [57.17302, 51.11253], [57.44221, 50.88354], [57.74986, 50.93017], [57.75578, 51.13852], [58.3208, 51.15151], [58.87974, 50.70852], [59.48928, 50.64216], [59.51886, 50.49937], [59.81172, 50.54451], [60.01288, 50.8163], [60.17262, 50.83312], [60.31914, 50.67705], [60.81833, 50.6629], [61.4431, 50.80679], [61.56889, 51.23679], [61.6813, 51.25716], [61.55114, 51.32746], [61.50677, 51.40687], [60.95655, 51.48615], [60.92401, 51.61124], [60.5424, 51.61675], [60.36787, 51.66815], [60.50986, 51.7964], [60.09867, 51.87135], [59.99809, 51.98263], [59.91279, 52.06924], [60.17253, 52.25814], [60.17516, 52.39457], [59.25033, 52.46803], [59.22409, 52.28437], [58.79644, 52.43392], [58.94336, 53.953], [59.70487, 54.14846], [59.95217, 54.85853], [57.95234, 54.39672], [57.14829, 54.84204], [57.25137, 55.26262], [58.81825, 55.03378], [59.49035, 55.60486], [59.28419, 56.15739], [57.51527, 56.08729], [57.28024, 56.87898], [58.07604, 57.08308], [58.13789, 57.68097], [58.81412, 57.71602], [58.71104, 58.07475], [59.40376, 58.45822], [59.15636, 59.14682], [58.3853, 59.487], [59.50685, 60.91162], [59.36223, 61.3882], [59.61398, 62.44915], [59.24834, 63.01859], [59.80579, 64.13948], [59.63945, 64.78384], [60.74386, 64.95767], [61.98014, 65.72191], [66.1708, 67.61252], [64.18965, 69.94255], [76.13964, 83.37843], [36.85549, 84.09565], [32.07813, 72.01005], [31.59909, 70.16571], [30.84095, 69.80584], [30.95011, 69.54699], [30.52662, 69.54699], [30.16363, 69.65244], [29.97205, 69.41623], [29.27631, 69.2811], [29.26623, 69.13794], [29.0444, 69.0119], [28.91738, 69.04774], [28.45957, 68.91417], [28.78224, 68.86696], [28.43941, 68.53366], [28.62982, 68.19816], [29.34179, 68.06655], [29.66955, 67.79872], [30.02041, 67.67523], [29.91155, 67.51507], [28.9839, 66.94139], [29.91155, 66.13863], [30.16363, 65.66935], [29.97205, 65.70256], [29.74013, 65.64025], [29.84096, 65.56945], [29.68972, 65.31803], [29.61914, 65.23791], [29.8813, 65.22101], [29.84096, 65.1109], [29.61914, 65.05993], [29.68972, 64.80789], [30.05271, 64.79072], [30.12329, 64.64862], [30.01238, 64.57513], [30.06279, 64.35782], [30.4762, 64.25728], [30.55687, 64.09036], [30.25437, 63.83364], [29.98213, 63.75795], [30.49637, 63.46666], [31.23244, 63.22239], [31.29294, 63.09035], [31.58535, 62.91642], [31.38369, 62.66284], [31.10136, 62.43042], [29.01829, 61.17448], [28.82816, 61.1233], [28.47974, 60.93365], [27.77352, 60.52722], [27.71177, 60.3893], [27.44953, 60.22766], [26.32936, 60.00121]]]] } },
23137 { type: "Feature", properties: { wikidata: "Q1083368", nameEn: "Mainland Finland", country: "FI", groups: ["EU", "154", "150", "UN"], callingCodes: ["358"] }, geometry: { type: "MultiPolygon", coordinates: [[[[29.12697, 69.69193], [28.36883, 69.81658], [28.32849, 69.88605], [27.97558, 69.99671], [27.95542, 70.0965], [27.57226, 70.06215], [27.05802, 69.92069], [26.64461, 69.96565], [26.40261, 69.91377], [25.96904, 69.68397], [25.69679, 69.27039], [25.75729, 68.99383], [25.61613, 68.89602], [25.42455, 68.90328], [25.12206, 68.78684], [25.10189, 68.63307], [24.93048, 68.61102], [24.90023, 68.55579], [24.74898, 68.65143], [24.18432, 68.73936], [24.02299, 68.81601], [23.781, 68.84514], [23.68017, 68.70276], [23.13064, 68.64684], [22.53321, 68.74393], [22.38367, 68.71561], [22.27276, 68.89514], [21.63833, 69.27485], [21.27827, 69.31281], [21.00732, 69.22755], [20.98641, 69.18809], [21.11099, 69.10291], [21.05775, 69.0356], [20.72171, 69.11874], [20.55258, 69.06069], [20.78802, 69.03087], [20.91658, 68.96764], [20.85104, 68.93142], [20.90649, 68.89696], [21.03001, 68.88969], [22.00429, 68.50692], [22.73028, 68.40881], [23.10336, 68.26551], [23.15377, 68.14759], [23.26469, 68.15134], [23.40081, 68.05545], [23.65793, 67.9497], [23.45627, 67.85297], [23.54701, 67.59306], [23.39577, 67.46974], [23.75372, 67.43688], [23.75372, 67.29914], [23.54701, 67.25435], [23.58735, 67.20752], [23.56214, 67.17038], [23.98563, 66.84149], [23.98059, 66.79585], [23.89488, 66.772], [23.85959, 66.56434], [23.63776, 66.43568], [23.67591, 66.3862], [23.64982, 66.30603], [23.71339, 66.21299], [23.90497, 66.15802], [24.15791, 65.85385], [24.14798, 65.83466], [24.15107, 65.81427], [24.14112, 65.39731], [20.15877, 63.06556], [19.23413, 60.61414], [20.96741, 60.71528], [21.15143, 60.54555], [21.08159, 60.20167], [21.02509, 60.12142], [21.35468, 59.67511], [20.5104, 59.15546], [26.32936, 60.00121], [27.44953, 60.22766], [27.71177, 60.3893], [27.77352, 60.52722], [28.47974, 60.93365], [28.82816, 61.1233], [29.01829, 61.17448], [31.10136, 62.43042], [31.38369, 62.66284], [31.58535, 62.91642], [31.29294, 63.09035], [31.23244, 63.22239], [30.49637, 63.46666], [29.98213, 63.75795], [30.25437, 63.83364], [30.55687, 64.09036], [30.4762, 64.25728], [30.06279, 64.35782], [30.01238, 64.57513], [30.12329, 64.64862], [30.05271, 64.79072], [29.68972, 64.80789], [29.61914, 65.05993], [29.84096, 65.1109], [29.8813, 65.22101], [29.61914, 65.23791], [29.68972, 65.31803], [29.84096, 65.56945], [29.74013, 65.64025], [29.97205, 65.70256], [30.16363, 65.66935], [29.91155, 66.13863], [28.9839, 66.94139], [29.91155, 67.51507], [30.02041, 67.67523], [29.66955, 67.79872], [29.34179, 68.06655], [28.62982, 68.19816], [28.43941, 68.53366], [28.78224, 68.86696], [28.45957, 68.91417], [28.91738, 69.04774], [28.81248, 69.11997], [28.8629, 69.22395], [29.31664, 69.47994], [29.12697, 69.69193]]]] } },
23138 { type: "Feature", properties: { wikidata: "Q1184963", nameEn: "Alhucemas Islands", country: "ES", groups: ["EU", "Q191011", "015", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[-3.90602, 35.21494], [-3.88372, 35.20767], [-3.89343, 35.22728], [-3.90602, 35.21494]]]] } },
23139 { type: "Feature", properties: { wikidata: "Q1298289", nameEn: "Egmont Islands", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[70.1848, -6.37445], [70.67958, -8.2663], [72.17991, -6.68509], [70.1848, -6.37445]]]] } },
23140 { type: "Feature", properties: { wikidata: "Q1352230", nameEn: "US Territories", country: "US", level: "subcountryGroup" }, geometry: null },
23141 { type: "Feature", properties: { wikidata: "Q1451600", nameEn: "Overseas Countries and Territories of the EU", aliases: ["OCT"], level: "subunion" }, geometry: null },
23142 { type: "Feature", properties: { wikidata: "Q1544253", nameEn: "Great Chagos Bank", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[70.1848, -6.37445], [72.17991, -6.68509], [73.20573, -5.20727], [70.1848, -6.37445]]]] } },
23143 { type: "Feature", properties: { wikidata: "Q1585511", nameEn: "Salomon Atoll", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[72.09518, -5.61768], [73.20573, -5.20727], [72.12587, -4.02588], [72.09518, -5.61768]]]] } },
23144 { type: "Feature", properties: { wikidata: "Q1681727", nameEn: "Saint-Paul and Amsterdam", country: "FR", groups: ["EU", "TF", "Q1451600", "014", "202", "002", "UN"], level: "subterritory" }, geometry: { type: "MultiPolygon", coordinates: [[[[76.31747, -42.16264], [80.15867, -36.04977], [71.22311, -38.75287], [76.31747, -42.16264]]]] } },
23145 { type: "Feature", properties: { wikidata: "Q1901211", nameEn: "East Malaysia", country: "MY", groups: ["Q36117", "035", "142", "UN"], driveSide: "left", callingCodes: ["60"] }, geometry: { type: "MultiPolygon", coordinates: [[[[110.90339, 7.52694], [109.82788, 2.86812], [109.62558, 1.99182], [109.53794, 1.91771], [109.57923, 1.80624], [109.66397, 1.79972], [109.66397, 1.60425], [110.35354, 0.98869], [110.49182, 0.88088], [110.62374, 0.873], [111.22979, 1.08326], [111.55434, 0.97864], [111.82846, 0.99349], [111.94553, 1.12016], [112.15679, 1.17004], [112.2127, 1.44135], [112.48648, 1.56516], [113.021, 1.57819], [113.01448, 1.42832], [113.64677, 1.23933], [114.03788, 1.44787], [114.57892, 1.5], [114.80706, 1.92351], [114.80706, 2.21665], [115.1721, 2.49671], [115.11343, 2.82879], [115.53713, 3.14776], [115.58276, 3.93499], [115.90217, 4.37708], [117.25801, 4.35108], [117.47313, 4.18857], [117.67641, 4.16535], [118.06469, 4.16638], [118.93936, 4.09009], [119.52945, 5.35672], [117.98544, 6.27477], [117.93857, 6.89845], [117.17735, 7.52841], [116.79524, 7.43869], [115.02521, 5.35005], [115.16236, 5.01011], [115.15092, 4.87604], [115.20737, 4.8256], [115.27819, 4.63661], [115.2851, 4.42295], [115.36346, 4.33563], [115.31275, 4.30806], [115.09978, 4.39123], [115.07737, 4.53418], [115.04064, 4.63706], [115.02278, 4.74137], [115.02955, 4.82087], [115.05038, 4.90275], [114.99417, 4.88201], [114.96982, 4.81146], [114.88841, 4.81905], [114.8266, 4.75062], [114.77303, 4.72871], [114.83189, 4.42387], [114.88039, 4.4257], [114.78539, 4.12205], [114.64211, 4.00694], [114.49922, 4.13108], [114.4416, 4.27588], [114.32176, 4.2552], [114.32176, 4.34942], [114.26876, 4.49878], [114.15813, 4.57], [114.07448, 4.58441], [114.10166, 4.76112], [110.90339, 7.52694]]]] } },
23146 { type: "Feature", properties: { wikidata: "Q1973345", nameEn: "Peninsular Malaysia", country: "MY", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["60"] }, geometry: { type: "MultiPolygon", coordinates: [[[[102.46318, 7.22462], [102.09086, 6.23546], [102.08127, 6.22679], [102.07732, 6.193], [102.09182, 6.14161], [102.01835, 6.05407], [101.99209, 6.04075], [101.97114, 6.01992], [101.9714, 6.00575], [101.94712, 5.98421], [101.92819, 5.85511], [101.91776, 5.84269], [101.89188, 5.8386], [101.80144, 5.74505], [101.75074, 5.79091], [101.69773, 5.75881], [101.58019, 5.93534], [101.25524, 5.78633], [101.25755, 5.71065], [101.14062, 5.61613], [100.98815, 5.79464], [101.02708, 5.91013], [101.087, 5.9193], [101.12388, 6.11411], [101.06165, 6.14161], [101.12618, 6.19431], [101.10313, 6.25617], [100.85884, 6.24929], [100.81045, 6.45086], [100.74822, 6.46231], [100.74361, 6.50811], [100.66986, 6.45086], [100.43027, 6.52389], [100.42351, 6.51762], [100.41791, 6.5189], [100.41152, 6.52299], [100.35413, 6.54932], [100.31929, 6.65413], [100.32607, 6.65933], [100.32671, 6.66526], [100.31884, 6.66423], [100.31618, 6.66781], [100.30828, 6.66462], [100.29651, 6.68439], [100.19511, 6.72559], [100.12, 6.42105], [100.0756, 6.4045], [99.91873, 6.50233], [99.50117, 6.44501], [99.31854, 5.99868], [99.75778, 3.86466], [103.03657, 1.30383], [103.56591, 1.19719], [103.62738, 1.35255], [103.67468, 1.43166], [103.7219, 1.46108], [103.74161, 1.4502], [103.76395, 1.45183], [103.81181, 1.47953], [103.86383, 1.46288], [103.89565, 1.42841], [103.93384, 1.42926], [104.00131, 1.42405], [104.02277, 1.4438], [104.04622, 1.44691], [104.07348, 1.43322], [104.08871, 1.42015], [104.09162, 1.39694], [104.08072, 1.35998], [104.12282, 1.27714], [104.34728, 1.33529], [104.56723, 1.44271], [105.01437, 3.24936], [102.46318, 7.22462]]]] } },
23147 { type: "Feature", properties: { wikidata: "Q2093907", nameEn: "Three Kings Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[174.17679, -32.62487], [170.93268, -32.97889], [171.97383, -34.64644], [174.17679, -32.62487]]]] } },
23148 { type: "Feature", properties: { wikidata: "Q2298216", nameEn: "Solander Islands", country: "NZ", groups: ["Q851132", "053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[167.39068, -46.49187], [166.5534, -46.39484], [166.84561, -46.84889], [167.39068, -46.49187]]]] } },
23149 { type: "Feature", properties: { wikidata: "Q2872203", nameEn: "Mainland Australia", country: "AU", groups: ["053", "009", "UN"], level: "subcountryGroup", driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[88.16419, -23.49578], [123.64533, -39.13605], [159.74028, -39.1978], [159.76765, -29.76946], [154.02855, -24.43238], [152.93188, -20.92631], [147.69992, -17.5933], [145.2855, -9.62524], [143.87386, -9.02382], [143.29772, -9.33993], [142.48658, -9.36754], [142.19246, -9.15378], [141.88934, -9.36111], [141.01842, -9.35091], [135.49042, -9.2276], [127.55165, -9.05052], [125.29076, -12.33139], [88.16419, -23.49578]]]] } },
23150 { type: "Feature", properties: { wikidata: "Q2914565", nameEn: "Autonomous Regions of Portugal", country: "PT", level: "subcountryGroup" }, geometry: null },
23151 { type: "Feature", properties: { wikidata: "Q2915956", nameEn: "Mainland Portugal", country: "PT", groups: ["Q12837", "EU", "039", "150", "UN"], level: "subcountryGroup", callingCodes: ["351"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-10.39881, 36.12218], [-7.37282, 36.96896], [-7.39769, 37.16868], [-7.41133, 37.20314], [-7.41854, 37.23813], [-7.43227, 37.25152], [-7.43974, 37.38913], [-7.46878, 37.47127], [-7.51759, 37.56119], [-7.41981, 37.75729], [-7.33441, 37.81193], [-7.27314, 37.90145], [-7.24544, 37.98884], [-7.12648, 38.00296], [-7.10366, 38.04404], [-7.05966, 38.01966], [-7.00375, 38.01914], [-6.93418, 38.21454], [-7.09389, 38.17227], [-7.15581, 38.27597], [-7.32529, 38.44336], [-7.265, 38.61674], [-7.26174, 38.72107], [-7.03848, 38.87221], [-7.051, 38.907], [-6.95211, 39.0243], [-6.97004, 39.07619], [-7.04011, 39.11919], [-7.10692, 39.10275], [-7.14929, 39.11287], [-7.12811, 39.17101], [-7.23566, 39.20132], [-7.23403, 39.27579], [-7.3149, 39.34857], [-7.2927, 39.45847], [-7.49477, 39.58794], [-7.54121, 39.66717], [-7.33507, 39.64569], [-7.24707, 39.66576], [-7.01613, 39.66877], [-6.97492, 39.81488], [-6.91463, 39.86618], [-6.86737, 40.01986], [-6.94233, 40.10716], [-7.00589, 40.12087], [-7.02544, 40.18564], [-7.00426, 40.23169], [-6.86085, 40.26776], [-6.86085, 40.2976], [-6.80218, 40.33239], [-6.78426, 40.36468], [-6.84618, 40.42177], [-6.84944, 40.46394], [-6.7973, 40.51723], [-6.80218, 40.55067], [-6.84292, 40.56801], [-6.79567, 40.65955], [-6.82826, 40.74603], [-6.82337, 40.84472], [-6.79892, 40.84842], [-6.80707, 40.88047], [-6.84292, 40.89771], [-6.8527, 40.93958], [-6.9357, 41.02888], [-6.913, 41.03922], [-6.88843, 41.03027], [-6.84781, 41.02692], [-6.80942, 41.03629], [-6.79241, 41.05397], [-6.75655, 41.10187], [-6.77319, 41.13049], [-6.69711, 41.1858], [-6.68286, 41.21641], [-6.65046, 41.24725], [-6.55937, 41.24417], [-6.38551, 41.35274], [-6.38553, 41.38655], [-6.3306, 41.37677], [-6.26777, 41.48796], [-6.19128, 41.57638], [-6.29863, 41.66432], [-6.44204, 41.68258], [-6.49907, 41.65823], [-6.54633, 41.68623], [-6.56426, 41.74219], [-6.51374, 41.8758], [-6.56752, 41.88429], [-6.5447, 41.94371], [-6.58544, 41.96674], [-6.61967, 41.94008], [-6.75004, 41.94129], [-6.76959, 41.98734], [-6.81196, 41.99097], [-6.82174, 41.94493], [-6.94396, 41.94403], [-6.95537, 41.96553], [-6.98144, 41.9728], [-7.01078, 41.94977], [-7.07596, 41.94977], [-7.08574, 41.97401], [-7.14115, 41.98855], [-7.18549, 41.97515], [-7.18677, 41.88793], [-7.32366, 41.8406], [-7.37092, 41.85031], [-7.42864, 41.80589], [-7.42854, 41.83262], [-7.44759, 41.84451], [-7.45566, 41.86488], [-7.49803, 41.87095], [-7.52737, 41.83939], [-7.62188, 41.83089], [-7.58603, 41.87944], [-7.65774, 41.88308], [-7.69848, 41.90977], [-7.84188, 41.88065], [-7.88055, 41.84571], [-7.88751, 41.92553], [-7.90707, 41.92432], [-7.92336, 41.8758], [-7.9804, 41.87337], [-8.01136, 41.83453], [-8.0961, 41.81024], [-8.16455, 41.81753], [-8.16944, 41.87944], [-8.19551, 41.87459], [-8.2185, 41.91237], [-8.16232, 41.9828], [-8.08796, 42.01398], [-8.08847, 42.05767], [-8.11729, 42.08537], [-8.18178, 42.06436], [-8.19406, 42.12141], [-8.18947, 42.13853], [-8.1986, 42.15402], [-8.22406, 42.1328], [-8.24681, 42.13993], [-8.2732, 42.12396], [-8.29809, 42.106], [-8.32161, 42.10218], [-8.33912, 42.08358], [-8.36353, 42.09065], [-8.38323, 42.07683], [-8.40143, 42.08052], [-8.42512, 42.07199], [-8.44123, 42.08218], [-8.48185, 42.0811], [-8.52837, 42.07658], [-8.5252, 42.06264], [-8.54563, 42.0537], [-8.58086, 42.05147], [-8.59493, 42.05708], [-8.63791, 42.04691], [-8.64626, 42.03668], [-8.65832, 42.02972], [-8.6681, 41.99703], [-8.69071, 41.98862], [-8.7478, 41.96282], [-8.74606, 41.9469], [-8.75712, 41.92833], [-8.81794, 41.90375], [-8.87157, 41.86488], [-11.19304, 41.83075], [-10.39881, 36.12218]]]] } },
23152 { type: "Feature", properties: { wikidata: "Q3311985", nameEn: "Guernsey", country: "GB", groups: ["GG", "830", "Q185086", "154", "150", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01481"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.49556, 49.79012], [-3.28154, 49.57329], [-2.65349, 49.15373], [-2.36485, 49.48223], [-2.49556, 49.79012]]]] } },
23153 { type: "Feature", properties: { wikidata: "Q3320166", nameEn: "Outermost Regions of the EU", aliases: ["OMR"], level: "subunion" }, geometry: null },
23154 { type: "Feature", properties: { wikidata: "Q3336843", nameEn: "Countries of the United Kingdom", aliases: ["GB-UKM"], country: "GB", level: "subcountryGroup" }, geometry: null },
23155 { type: "Feature", properties: { wikidata: "Q6736667", nameEn: "Mainland India", country: "IN", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["91"] }, geometry: { type: "MultiPolygon", coordinates: [[[[89.08044, 21.41871], [89.07114, 22.15335], [88.9367, 22.58527], [88.94614, 22.66941], [88.9151, 22.75228], [88.96713, 22.83346], [88.87063, 22.95235], [88.88327, 23.03885], [88.86377, 23.08759], [88.99148, 23.21134], [88.71133, 23.2492], [88.79254, 23.46028], [88.79351, 23.50535], [88.74841, 23.47361], [88.56507, 23.64044], [88.58087, 23.87105], [88.66189, 23.87607], [88.73743, 23.91751], [88.6976, 24.14703], [88.74841, 24.1959], [88.68801, 24.31464], [88.50934, 24.32474], [88.12296, 24.51301], [88.08786, 24.63232], [88.00683, 24.66477], [88.15515, 24.85806], [88.14004, 24.93529], [88.21832, 24.96642], [88.27325, 24.88796], [88.33917, 24.86803], [88.46277, 25.07468], [88.44766, 25.20149], [88.94067, 25.18534], [89.00463, 25.26583], [89.01105, 25.30303], [88.85278, 25.34679], [88.81296, 25.51546], [88.677, 25.46959], [88.4559, 25.59227], [88.45103, 25.66245], [88.242, 25.80811], [88.13138, 25.78773], [88.08804, 25.91334], [88.16581, 26.0238], [88.1844, 26.14417], [88.34757, 26.22216], [88.35153, 26.29123], [88.51649, 26.35923], [88.48749, 26.45855], [88.36938, 26.48683], [88.35153, 26.45241], [88.33093, 26.48929], [88.41196, 26.63837], [88.4298, 26.54489], [88.62144, 26.46783], [88.69485, 26.38353], [88.67837, 26.26291], [88.78961, 26.31093], [88.85004, 26.23211], [89.05328, 26.2469], [88.91321, 26.37984], [88.92357, 26.40711], [88.95612, 26.4564], [89.08899, 26.38845], [89.15869, 26.13708], [89.35953, 26.0077], [89.53515, 26.00382], [89.57101, 25.9682], [89.63968, 26.22595], [89.70201, 26.15138], [89.73581, 26.15818], [89.77865, 26.08387], [89.77728, 26.04254], [89.86592, 25.93115], [89.80585, 25.82489], [89.84388, 25.70042], [89.86129, 25.61714], [89.81208, 25.37244], [89.84086, 25.31854], [89.83371, 25.29548], [89.87629, 25.28337], [89.90478, 25.31038], [90.1155, 25.22686], [90.40034, 25.1534], [90.65042, 25.17788], [90.87427, 25.15799], [91.25517, 25.20677], [91.63648, 25.12846], [92.0316, 25.1834], [92.33957, 25.07593], [92.39147, 25.01471], [92.49887, 24.88796], [92.38626, 24.86055], [92.25854, 24.9191], [92.15796, 24.54435], [92.11662, 24.38997], [91.96603, 24.3799], [91.89258, 24.14674], [91.82596, 24.22345], [91.76004, 24.23848], [91.73257, 24.14703], [91.65292, 24.22095], [91.63782, 24.1132], [91.55542, 24.08687], [91.37414, 24.10693], [91.35741, 23.99072], [91.29587, 24.0041], [91.22308, 23.89616], [91.25192, 23.83463], [91.15579, 23.6599], [91.28293, 23.37538], [91.36453, 23.06612], [91.40848, 23.07117], [91.4035, 23.27522], [91.46615, 23.2328], [91.54993, 23.01051], [91.61571, 22.93929], [91.7324, 23.00043], [91.81634, 23.08001], [91.76417, 23.26619], [91.84789, 23.42235], [91.95642, 23.47361], [91.95093, 23.73284], [92.04706, 23.64229], [92.15417, 23.73409], [92.26541, 23.70392], [92.38214, 23.28705], [92.37665, 22.9435], [92.5181, 22.71441], [92.60029, 22.1522], [92.56616, 22.13554], [92.60949, 21.97638], [92.67532, 22.03547], [92.70416, 22.16017], [92.86208, 22.05456], [92.89504, 21.95143], [92.93899, 22.02656], [92.99804, 21.98964], [92.99255, 22.05965], [93.04885, 22.20595], [93.15734, 22.18687], [93.14224, 22.24535], [93.19991, 22.25425], [93.18206, 22.43716], [93.13537, 22.45873], [93.11477, 22.54374], [93.134, 22.59573], [93.09417, 22.69459], [93.134, 22.92498], [93.12988, 23.05772], [93.2878, 23.00464], [93.38478, 23.13698], [93.36862, 23.35426], [93.38781, 23.36139], [93.39981, 23.38828], [93.38805, 23.4728], [93.43475, 23.68299], [93.3908, 23.7622], [93.3908, 23.92925], [93.36059, 23.93176], [93.32351, 24.04468], [93.34735, 24.10151], [93.41415, 24.07854], [93.46633, 23.97067], [93.50616, 23.94432], [93.62871, 24.00922], [93.75952, 24.0003], [93.80279, 23.92549], [93.92089, 23.95812], [94.14081, 23.83333], [94.30215, 24.23752], [94.32362, 24.27692], [94.45279, 24.56656], [94.50729, 24.59281], [94.5526, 24.70764], [94.60204, 24.70889], [94.73937, 25.00545], [94.74212, 25.13606], [94.57458, 25.20318], [94.68032, 25.47003], [94.80117, 25.49359], [95.18556, 26.07338], [95.11428, 26.1019], [95.12801, 26.38397], [95.05798, 26.45408], [95.23513, 26.68499], [95.30339, 26.65372], [95.437, 26.7083], [95.81603, 27.01335], [95.93002, 27.04149], [96.04949, 27.19428], [96.15591, 27.24572], [96.40779, 27.29818], [96.55761, 27.29928], [96.73888, 27.36638], [96.88445, 27.25046], [96.85287, 27.2065], [96.89132, 27.17474], [97.14675, 27.09041], [97.17422, 27.14052], [96.91431, 27.45752], [96.90112, 27.62149], [97.29919, 27.92233], [97.35824, 27.87256], [97.38845, 28.01329], [97.35412, 28.06663], [97.31292, 28.06784], [97.34547, 28.21385], [97.1289, 28.3619], [96.98882, 28.32564], [96.88445, 28.39452], [96.85561, 28.4875], [96.6455, 28.61657], [96.48895, 28.42955], [96.40929, 28.51526], [96.61391, 28.72742], [96.3626, 29.10607], [96.20467, 29.02325], [96.18682, 29.11087], [96.31316, 29.18643], [96.05361, 29.38167], [95.84899, 29.31464], [95.75149, 29.32063], [95.72086, 29.20797], [95.50842, 29.13487], [95.41091, 29.13007], [95.3038, 29.13847], [95.26122, 29.07727], [95.2214, 29.10727], [95.11291, 29.09527], [95.0978, 29.14446], [94.81353, 29.17804], [94.69318, 29.31739], [94.2752, 29.11687], [94.35897, 29.01965], [93.72797, 28.68821], [93.44621, 28.67189], [93.18069, 28.50319], [93.14635, 28.37035], [92.93075, 28.25671], [92.67486, 28.15018], [92.65472, 28.07632], [92.73025, 28.05814], [92.7275, 27.98662], [92.42538, 27.80092], [92.32101, 27.79363], [92.27432, 27.89077], [91.87057, 27.7195], [91.84722, 27.76325], [91.6469, 27.76358], [91.55819, 27.6144], [91.65007, 27.48287], [92.01132, 27.47352], [92.12019, 27.27829], [92.04702, 27.26861], [92.03457, 27.07334], [92.11863, 26.893], [92.05523, 26.8692], [91.83181, 26.87318], [91.50067, 26.79223], [90.67715, 26.77215], [90.48504, 26.8594], [90.39271, 26.90704], [90.30402, 26.85098], [90.04535, 26.72422], [89.86124, 26.73307], [89.63369, 26.74402], [89.42349, 26.83727], [89.3901, 26.84225], [89.38319, 26.85963], [89.37913, 26.86224], [89.1926, 26.81329], [89.12825, 26.81661], [89.09554, 26.89089], [88.95807, 26.92668], [88.92301, 26.99286], [88.8714, 26.97488], [88.86984, 27.10937], [88.74219, 27.144], [88.91901, 27.32483], [88.82981, 27.38814], [88.77517, 27.45415], [88.88091, 27.85192], [88.83559, 28.01936], [88.63235, 28.12356], [88.54858, 28.06057], [88.25332, 27.9478], [88.1278, 27.95417], [88.13378, 27.88015], [88.1973, 27.85067], [88.19107, 27.79285], [88.04008, 27.49223], [88.07277, 27.43007], [88.01646, 27.21612], [88.01587, 27.21388], [87.9887, 27.11045], [88.11719, 26.98758], [88.13422, 26.98705], [88.12302, 26.95324], [88.19107, 26.75516], [88.1659, 26.68177], [88.16452, 26.64111], [88.09963, 26.54195], [88.09414, 26.43732], [88.00895, 26.36029], [87.90115, 26.44923], [87.89085, 26.48565], [87.84193, 26.43663], [87.7918, 26.46737], [87.76004, 26.40711], [87.67893, 26.43501], [87.66803, 26.40294], [87.59175, 26.38342], [87.55274, 26.40596], [87.51571, 26.43106], [87.46566, 26.44058], [87.37314, 26.40815], [87.34568, 26.34787], [87.26568, 26.37294], [87.26587, 26.40592], [87.24682, 26.4143], [87.18863, 26.40558], [87.14751, 26.40542], [87.09147, 26.45039], [87.0707, 26.58571], [87.04691, 26.58685], [87.01559, 26.53228], [86.95912, 26.52076], [86.94543, 26.52076], [86.82898, 26.43919], [86.76797, 26.45892], [86.74025, 26.42386], [86.69124, 26.45169], [86.62686, 26.46891], [86.61313, 26.48658], [86.57073, 26.49825], [86.54258, 26.53819], [86.49726, 26.54218], [86.31564, 26.61925], [86.26235, 26.61886], [86.22513, 26.58863], [86.13596, 26.60651], [86.02729, 26.66756], [85.8492, 26.56667], [85.85126, 26.60866], [85.83126, 26.61134], [85.76907, 26.63076], [85.72315, 26.67471], [85.73483, 26.79613], [85.66239, 26.84822], [85.61621, 26.86721], [85.59461, 26.85161], [85.5757, 26.85955], [85.56471, 26.84133], [85.47752, 26.79292], [85.34302, 26.74954], [85.21159, 26.75933], [85.18046, 26.80519], [85.19291, 26.86909], [85.15883, 26.86966], [85.02635, 26.85381], [85.05592, 26.88991], [85.00536, 26.89523], [84.97186, 26.9149], [84.96687, 26.95599], [84.85754, 26.98984], [84.82913, 27.01989], [84.793, 26.9968], [84.64496, 27.04669], [84.69166, 27.21294], [84.62161, 27.33885], [84.29315, 27.39], [84.25735, 27.44941], [84.21376, 27.45218], [84.10791, 27.52399], [84.02229, 27.43836], [83.93306, 27.44939], [83.86182, 27.4241], [83.85595, 27.35797], [83.61288, 27.47013], [83.39495, 27.4798], [83.38872, 27.39276], [83.35136, 27.33885], [83.29999, 27.32778], [83.2673, 27.36235], [83.27197, 27.38309], [83.19413, 27.45632], [82.94938, 27.46036], [82.93261, 27.50328], [82.74119, 27.49838], [82.70378, 27.72122], [82.46405, 27.6716], [82.06554, 27.92222], [81.97214, 27.93322], [81.91223, 27.84995], [81.47867, 28.08303], [81.48179, 28.12148], [81.38683, 28.17638], [81.32923, 28.13521], [81.19847, 28.36284], [81.03471, 28.40054], [80.55142, 28.69182], [80.50575, 28.6706], [80.52443, 28.54897], [80.44504, 28.63098], [80.37188, 28.63371], [80.12125, 28.82346], [80.06957, 28.82763], [80.05743, 28.91479], [80.18085, 29.13649], [80.23178, 29.11626], [80.26602, 29.13938], [80.24112, 29.21414], [80.28626, 29.20327], [80.31428, 29.30784], [80.24322, 29.44299], [80.37939, 29.57098], [80.41858, 29.63581], [80.38428, 29.68513], [80.36803, 29.73865], [80.41554, 29.79451], [80.43458, 29.80466], [80.48997, 29.79566], [80.56247, 29.86661], [80.57179, 29.91422], [80.60226, 29.95732], [80.67076, 29.95732], [80.8778, 30.13384], [80.86673, 30.17321], [80.91143, 30.22173], [80.92547, 30.17193], [81.03953, 30.20059], [80.83343, 30.32023], [80.54504, 30.44936], [80.20721, 30.58541], [79.93255, 30.88288], [79.59884, 30.93943], [79.30694, 31.17357], [79.14016, 31.43403], [79.01931, 31.42817], [78.89344, 31.30481], [78.77898, 31.31209], [78.71032, 31.50197], [78.84516, 31.60631], [78.69933, 31.78723], [78.78036, 31.99478], [78.74404, 32.00384], [78.68754, 32.10256], [78.49609, 32.2762], [78.4645, 32.45367], [78.38897, 32.53938], [78.73916, 32.69438], [78.7831, 32.46873], [78.96713, 32.33655], [78.99322, 32.37948], [79.0979, 32.38051], [79.13174, 32.47766], [79.26768, 32.53277], [79.46562, 32.69668], [79.14016, 33.02545], [79.15252, 33.17156], [78.73636, 33.56521], [78.67599, 33.66445], [78.77349, 33.73871], [78.73367, 34.01121], [78.65657, 34.03195], [78.66225, 34.08858], [78.91769, 34.15452], [78.99802, 34.3027], [79.05364, 34.32482], [78.74465, 34.45174], [78.56475, 34.50835], [78.54964, 34.57283], [78.27781, 34.61484], [78.18435, 34.7998], [78.22692, 34.88771], [78.00033, 35.23954], [78.03466, 35.3785], [78.11664, 35.48022], [77.80532, 35.52058], [77.70232, 35.46244], [77.44277, 35.46132], [76.96624, 35.5932], [76.84539, 35.67356], [76.77323, 35.66062], [76.75475, 35.52617], [76.85088, 35.39754], [76.93465, 35.39866], [77.11796, 35.05419], [76.99251, 34.93349], [76.87193, 34.96906], [76.74514, 34.92488], [76.74377, 34.84039], [76.67648, 34.76371], [76.47186, 34.78965], [76.15463, 34.6429], [76.04614, 34.67566], [75.75438, 34.51827], [75.38009, 34.55021], [75.01479, 34.64629], [74.6663, 34.703], [74.58083, 34.77386], [74.31239, 34.79626], [74.12897, 34.70073], [73.96423, 34.68244], [73.93401, 34.63386], [73.93951, 34.57169], [73.89419, 34.54568], [73.88732, 34.48911], [73.74999, 34.3781], [73.74862, 34.34183], [73.8475, 34.32935], [73.90517, 34.35317], [73.98208, 34.2522], [73.90677, 34.10504], [73.88732, 34.05105], [73.91341, 34.01235], [74.21554, 34.03853], [74.25262, 34.01577], [74.26086, 33.92237], [74.14001, 33.83002], [74.05898, 33.82089], [74.00891, 33.75437], [73.96423, 33.73071], [73.98968, 33.66155], [73.97367, 33.64061], [74.03576, 33.56718], [74.10115, 33.56392], [74.18121, 33.4745], [74.17983, 33.3679], [74.08782, 33.26232], [74.01366, 33.25199], [74.02144, 33.18908], [74.15374, 33.13477], [74.17571, 33.07495], [74.31854, 33.02891], [74.34875, 32.97823], [74.31227, 32.92795], [74.41467, 32.90563], [74.45312, 32.77755], [74.6289, 32.75561], [74.64675, 32.82604], [74.7113, 32.84219], [74.65345, 32.71225], [74.69542, 32.66792], [74.64424, 32.60985], [74.65251, 32.56416], [74.67431, 32.56676], [74.68362, 32.49298], [74.84725, 32.49075], [74.97634, 32.45367], [75.03265, 32.49538], [75.28259, 32.36556], [75.38046, 32.26836], [75.25649, 32.10187], [75.00793, 32.03786], [74.9269, 32.0658], [74.86236, 32.04485], [74.79919, 31.95983], [74.58907, 31.87824], [74.47771, 31.72227], [74.57498, 31.60382], [74.61517, 31.55698], [74.59319, 31.50197], [74.64713, 31.45605], [74.59773, 31.4136], [74.53223, 31.30321], [74.51629, 31.13829], [74.56023, 31.08303], [74.60281, 31.10419], [74.60006, 31.13711], [74.6852, 31.12771], [74.67971, 31.05479], [74.5616, 31.04153], [73.88993, 30.36305], [73.95736, 30.28466], [73.97225, 30.19829], [73.80299, 30.06969], [73.58665, 30.01848], [73.3962, 29.94707], [73.28094, 29.56646], [73.05886, 29.1878], [73.01337, 29.16422], [72.94272, 29.02487], [72.40402, 28.78283], [72.29495, 28.66367], [72.20329, 28.3869], [71.9244, 28.11555], [71.89921, 27.96035], [70.79054, 27.68423], [70.60927, 28.02178], [70.37307, 28.01208], [70.12502, 27.8057], [70.03136, 27.56627], [69.58519, 27.18109], [69.50904, 26.74892], [69.88555, 26.56836], [70.05584, 26.60398], [70.17532, 26.55362], [70.17532, 26.24118], [70.08193, 26.08094], [70.0985, 25.93238], [70.2687, 25.71156], [70.37444, 25.67443], [70.53649, 25.68928], [70.60378, 25.71898], [70.67382, 25.68186], [70.66695, 25.39314], [70.89148, 25.15064], [70.94002, 24.92843], [71.09405, 24.69017], [70.97594, 24.60904], [71.00341, 24.46038], [71.12838, 24.42662], [71.04461, 24.34657], [70.94985, 24.3791], [70.85784, 24.30903], [70.88393, 24.27398], [70.71502, 24.23517], [70.57906, 24.27774], [70.5667, 24.43787], [70.11712, 24.30915], [70.03428, 24.172], [69.73335, 24.17007], [69.59579, 24.29777], [69.29778, 24.28712], [69.19341, 24.25646], [69.07806, 24.29777], [68.97781, 24.26021], [68.90914, 24.33156], [68.7416, 24.31904], [68.74643, 23.97027], [68.39339, 23.96838], [68.20763, 23.85849], [68.11329, 23.53945], [76.59015, 5.591], [79.50447, 8.91876], [79.42124, 9.80115], [80.48418, 10.20786], [89.08044, 21.41871]]]] } },
23156 { type: "Feature", properties: { wikidata: "Q9143535", nameEn: "Akrotiri", country: "GB", groups: ["Q644636", "Q37362", "BOTS", "145", "142", "UN"], level: "subterritory", driveSide: "left", callingCodes: ["357"] }, geometry: { type: "MultiPolygon", coordinates: [[[[32.86014, 34.70585], [32.82717, 34.70622], [32.79433, 34.67883], [32.76136, 34.68318], [32.75515, 34.64985], [32.74412, 34.43926], [33.26744, 34.49942], [33.0138, 34.64424], [32.96968, 34.64046], [32.96718, 34.63446], [32.95891, 34.62919], [32.95323, 34.64075], [32.95471, 34.64528], [32.94976, 34.65204], [32.94796, 34.6587], [32.95325, 34.66462], [32.97079, 34.66112], [32.97736, 34.65277], [32.99014, 34.65518], [32.98668, 34.67268], [32.99135, 34.68061], [32.95539, 34.68471], [32.94683, 34.67907], [32.94379, 34.67111], [32.93693, 34.67027], [32.93449, 34.66241], [32.92807, 34.66736], [32.93043, 34.67091], [32.91398, 34.67343], [32.9068, 34.66102], [32.86167, 34.68734], [32.86014, 34.70585]]]] } },
23157 { type: "Feature", properties: { wikidata: "Q9206745", nameEn: "Dhekelia", country: "GB", groups: ["Q644636", "Q37362", "BOTS", "145", "142", "UN"], level: "subterritory", driveSide: "left", callingCodes: ["357"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.70575, 34.97947], [33.83531, 34.73974], [33.98684, 34.76642], [33.90075, 34.96623], [33.86432, 34.97592], [33.84811, 34.97075], [33.83505, 34.98108], [33.85621, 34.98956], [33.85891, 35.001], [33.85216, 35.00579], [33.84045, 35.00616], [33.82875, 35.01685], [33.83055, 35.02865], [33.81524, 35.04192], [33.8012, 35.04786], [33.82051, 35.0667], [33.8355, 35.05777], [33.85261, 35.0574], [33.88367, 35.07877], [33.89485, 35.06873], [33.90247, 35.07686], [33.91299, 35.07579], [33.91789, 35.08688], [33.89853, 35.11377], [33.88737, 35.11408], [33.88943, 35.12007], [33.88561, 35.12449], [33.87224, 35.12293], [33.87622, 35.10457], [33.87097, 35.09389], [33.87479, 35.08881], [33.8541, 35.07201], [33.84168, 35.06823], [33.82067, 35.07826], [33.78581, 35.05104], [33.76106, 35.04253], [33.73824, 35.05321], [33.71482, 35.03722], [33.70209, 35.04882], [33.7161, 35.07279], [33.70861, 35.07644], [33.69095, 35.06237], [33.68474, 35.06602], [33.67742, 35.05963], [33.67678, 35.03866], [33.69938, 35.03123], [33.69731, 35.01754], [33.71514, 35.00294], [33.70639, 34.99303], [33.70575, 34.97947]], [[33.77312, 34.9976], [33.77553, 34.99518], [33.78516, 34.99582], [33.79191, 34.98914], [33.78917, 34.98854], [33.78571, 34.98951], [33.78318, 34.98699], [33.78149, 34.98854], [33.77843, 34.988], [33.7778, 34.98981], [33.76738, 34.99188], [33.76605, 34.99543], [33.75682, 34.99916], [33.75994, 35.00113], [33.77312, 34.9976]], [[33.74144, 35.01053], [33.7343, 35.01178], [33.73781, 35.02181], [33.74265, 35.02329], [33.74983, 35.02274], [33.7492, 35.01319], [33.74144, 35.01053]]]] } },
23158 { type: "Feature", properties: { wikidata: "Q16390686", nameEn: "Peninsular Spain", country: "ES", groups: ["Q12837", "EU", "039", "150", "UN"], callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[3.75438, 42.33445], [3.17156, 42.43545], [3.11379, 42.43646], [3.10027, 42.42621], [3.08167, 42.42748], [3.03734, 42.47363], [2.96518, 42.46692], [2.94283, 42.48174], [2.92107, 42.4573], [2.88413, 42.45938], [2.86983, 42.46843], [2.85675, 42.45444], [2.84335, 42.45724], [2.77464, 42.41046], [2.75497, 42.42578], [2.72056, 42.42298], [2.65311, 42.38771], [2.6747, 42.33974], [2.57934, 42.35808], [2.55516, 42.35351], [2.54382, 42.33406], [2.48457, 42.33933], [2.43508, 42.37568], [2.43299, 42.39423], [2.38504, 42.39977], [2.25551, 42.43757], [2.20578, 42.41633], [2.16599, 42.42314], [2.12789, 42.41291], [2.11621, 42.38393], [2.06241, 42.35906], [2.00488, 42.35399], [1.96482, 42.37787], [1.9574, 42.42401], [1.94084, 42.43039], [1.94061, 42.43333], [1.94292, 42.44316], [1.93663, 42.45439], [1.88853, 42.4501], [1.83037, 42.48395], [1.76335, 42.48863], [1.72515, 42.50338], [1.70571, 42.48867], [1.66826, 42.50779], [1.65674, 42.47125], [1.58933, 42.46275], [1.57953, 42.44957], [1.55937, 42.45808], [1.55073, 42.43299], [1.5127, 42.42959], [1.44529, 42.43724], [1.43838, 42.47848], [1.41648, 42.48315], [1.46661, 42.50949], [1.44759, 42.54431], [1.41245, 42.53539], [1.4234, 42.55959], [1.44529, 42.56722], [1.42512, 42.58292], [1.44197, 42.60217], [1.35562, 42.71944], [1.15928, 42.71407], [1.0804, 42.78569], [0.98292, 42.78754], [0.96166, 42.80629], [0.93089, 42.79154], [0.711, 42.86372], [0.66121, 42.84021], [0.65421, 42.75872], [0.67873, 42.69458], [0.40214, 42.69779], [0.36251, 42.72282], [0.29407, 42.67431], [0.25336, 42.7174], [0.17569, 42.73424], [-0.02468, 42.68513], [-0.10519, 42.72761], [-0.16141, 42.79535], [-0.17939, 42.78974], [-0.3122, 42.84788], [-0.38833, 42.80132], [-0.41319, 42.80776], [-0.44334, 42.79939], [-0.50863, 42.82713], [-0.55497, 42.77846], [-0.67637, 42.88303], [-0.69837, 42.87945], [-0.72608, 42.89318], [-0.73422, 42.91228], [-0.72037, 42.92541], [-0.75478, 42.96916], [-0.81652, 42.95166], [-0.97133, 42.96239], [-1.00963, 42.99279], [-1.10333, 43.0059], [-1.22881, 43.05534], [-1.25244, 43.04164], [-1.30531, 43.06859], [-1.30052, 43.09581], [-1.27118, 43.11961], [-1.32209, 43.1127], [-1.34419, 43.09665], [-1.35272, 43.02658], [-1.44067, 43.047], [-1.47555, 43.08372], [-1.41562, 43.12815], [-1.3758, 43.24511], [-1.40942, 43.27272], [-1.45289, 43.27049], [-1.50992, 43.29481], [-1.55963, 43.28828], [-1.57674, 43.25269], [-1.61341, 43.25269], [-1.63052, 43.28591], [-1.62481, 43.30726], [-1.69407, 43.31378], [-1.73074, 43.29481], [-1.7397, 43.32979], [-1.75079, 43.3317], [-1.75334, 43.34107], [-1.77068, 43.34396], [-1.78714, 43.35476], [-1.78332, 43.36399], [-1.79319, 43.37497], [-1.77289, 43.38957], [-1.81005, 43.59738], [-10.14298, 44.17365], [-11.19304, 41.83075], [-8.87157, 41.86488], [-8.81794, 41.90375], [-8.75712, 41.92833], [-8.74606, 41.9469], [-8.7478, 41.96282], [-8.69071, 41.98862], [-8.6681, 41.99703], [-8.65832, 42.02972], [-8.64626, 42.03668], [-8.63791, 42.04691], [-8.59493, 42.05708], [-8.58086, 42.05147], [-8.54563, 42.0537], [-8.5252, 42.06264], [-8.52837, 42.07658], [-8.48185, 42.0811], [-8.44123, 42.08218], [-8.42512, 42.07199], [-8.40143, 42.08052], [-8.38323, 42.07683], [-8.36353, 42.09065], [-8.33912, 42.08358], [-8.32161, 42.10218], [-8.29809, 42.106], [-8.2732, 42.12396], [-8.24681, 42.13993], [-8.22406, 42.1328], [-8.1986, 42.15402], [-8.18947, 42.13853], [-8.19406, 42.12141], [-8.18178, 42.06436], [-8.11729, 42.08537], [-8.08847, 42.05767], [-8.08796, 42.01398], [-8.16232, 41.9828], [-8.2185, 41.91237], [-8.19551, 41.87459], [-8.16944, 41.87944], [-8.16455, 41.81753], [-8.0961, 41.81024], [-8.01136, 41.83453], [-7.9804, 41.87337], [-7.92336, 41.8758], [-7.90707, 41.92432], [-7.88751, 41.92553], [-7.88055, 41.84571], [-7.84188, 41.88065], [-7.69848, 41.90977], [-7.65774, 41.88308], [-7.58603, 41.87944], [-7.62188, 41.83089], [-7.52737, 41.83939], [-7.49803, 41.87095], [-7.45566, 41.86488], [-7.44759, 41.84451], [-7.42854, 41.83262], [-7.42864, 41.80589], [-7.37092, 41.85031], [-7.32366, 41.8406], [-7.18677, 41.88793], [-7.18549, 41.97515], [-7.14115, 41.98855], [-7.08574, 41.97401], [-7.07596, 41.94977], [-7.01078, 41.94977], [-6.98144, 41.9728], [-6.95537, 41.96553], [-6.94396, 41.94403], [-6.82174, 41.94493], [-6.81196, 41.99097], [-6.76959, 41.98734], [-6.75004, 41.94129], [-6.61967, 41.94008], [-6.58544, 41.96674], [-6.5447, 41.94371], [-6.56752, 41.88429], [-6.51374, 41.8758], [-6.56426, 41.74219], [-6.54633, 41.68623], [-6.49907, 41.65823], [-6.44204, 41.68258], [-6.29863, 41.66432], [-6.19128, 41.57638], [-6.26777, 41.48796], [-6.3306, 41.37677], [-6.38553, 41.38655], [-6.38551, 41.35274], [-6.55937, 41.24417], [-6.65046, 41.24725], [-6.68286, 41.21641], [-6.69711, 41.1858], [-6.77319, 41.13049], [-6.75655, 41.10187], [-6.79241, 41.05397], [-6.80942, 41.03629], [-6.84781, 41.02692], [-6.88843, 41.03027], [-6.913, 41.03922], [-6.9357, 41.02888], [-6.8527, 40.93958], [-6.84292, 40.89771], [-6.80707, 40.88047], [-6.79892, 40.84842], [-6.82337, 40.84472], [-6.82826, 40.74603], [-6.79567, 40.65955], [-6.84292, 40.56801], [-6.80218, 40.55067], [-6.7973, 40.51723], [-6.84944, 40.46394], [-6.84618, 40.42177], [-6.78426, 40.36468], [-6.80218, 40.33239], [-6.86085, 40.2976], [-6.86085, 40.26776], [-7.00426, 40.23169], [-7.02544, 40.18564], [-7.00589, 40.12087], [-6.94233, 40.10716], [-6.86737, 40.01986], [-6.91463, 39.86618], [-6.97492, 39.81488], [-7.01613, 39.66877], [-7.24707, 39.66576], [-7.33507, 39.64569], [-7.54121, 39.66717], [-7.49477, 39.58794], [-7.2927, 39.45847], [-7.3149, 39.34857], [-7.23403, 39.27579], [-7.23566, 39.20132], [-7.12811, 39.17101], [-7.14929, 39.11287], [-7.10692, 39.10275], [-7.04011, 39.11919], [-6.97004, 39.07619], [-6.95211, 39.0243], [-7.051, 38.907], [-7.03848, 38.87221], [-7.26174, 38.72107], [-7.265, 38.61674], [-7.32529, 38.44336], [-7.15581, 38.27597], [-7.09389, 38.17227], [-6.93418, 38.21454], [-7.00375, 38.01914], [-7.05966, 38.01966], [-7.10366, 38.04404], [-7.12648, 38.00296], [-7.24544, 37.98884], [-7.27314, 37.90145], [-7.33441, 37.81193], [-7.41981, 37.75729], [-7.51759, 37.56119], [-7.46878, 37.47127], [-7.43974, 37.38913], [-7.43227, 37.25152], [-7.41854, 37.23813], [-7.41133, 37.20314], [-7.39769, 37.16868], [-7.37282, 36.96896], [-7.2725, 35.73269], [-5.10878, 36.05227], [-2.27707, 35.35051], [3.75438, 42.33445]], [[-5.27801, 36.14942], [-5.34064, 36.03744], [-5.40526, 36.15488], [-5.34536, 36.15501], [-5.33822, 36.15272], [-5.27801, 36.14942]]], [[[1.99838, 42.44682], [2.01564, 42.45171], [1.99216, 42.46208], [1.98579, 42.47486], [1.99766, 42.4858], [1.98916, 42.49351], [1.98022, 42.49569], [1.97697, 42.48568], [1.97227, 42.48487], [1.97003, 42.48081], [1.96215, 42.47854], [1.95606, 42.45785], [1.96125, 42.45364], [1.98378, 42.44697], [1.99838, 42.44682]]]] } },
23159 { type: "Feature", properties: { wikidata: "Q98059339", nameEn: "Mainland Norway", country: "NO", groups: ["154", "150", "UN"], callingCodes: ["47"] }, geometry: { type: "MultiPolygon", coordinates: [[[[10.40861, 58.38489], [10.64958, 58.89391], [11.08911, 58.98745], [11.15367, 59.07862], [11.34459, 59.11672], [11.4601, 58.99022], [11.45199, 58.89604], [11.65732, 58.90177], [11.8213, 59.24985], [11.69297, 59.59442], [11.92112, 59.69531], [11.87121, 59.86039], [12.15641, 59.8926], [12.36317, 59.99259], [12.52003, 60.13846], [12.59133, 60.50559], [12.2277, 61.02442], [12.69115, 61.06584], [12.86939, 61.35427], [12.57707, 61.56547], [12.40595, 61.57226], [12.14746, 61.7147], [12.29187, 62.25699], [12.07085, 62.6297], [12.19919, 63.00104], [11.98529, 63.27487], [12.19919, 63.47935], [12.14928, 63.59373], [12.74105, 64.02171], [13.23411, 64.09087], [13.98222, 64.00953], [14.16051, 64.18725], [14.11117, 64.46674], [13.64276, 64.58402], [14.50926, 65.31786], [14.53778, 66.12399], [15.05113, 66.15572], [15.49318, 66.28509], [15.37197, 66.48217], [16.35589, 67.06419], [16.39154, 67.21653], [16.09922, 67.4364], [16.12774, 67.52106], [16.38441, 67.52923], [16.7409, 67.91037], [17.30416, 68.11591], [17.90787, 67.96537], [18.13836, 68.20874], [18.1241, 68.53721], [18.39503, 68.58672], [18.63032, 68.50849], [18.97255, 68.52416], [19.93508, 68.35911], [20.22027, 68.48759], [19.95647, 68.55546], [20.22027, 68.67246], [20.33435, 68.80174], [20.28444, 68.93283], [20.0695, 69.04469], [20.55258, 69.06069], [20.72171, 69.11874], [21.05775, 69.0356], [21.11099, 69.10291], [20.98641, 69.18809], [21.00732, 69.22755], [21.27827, 69.31281], [21.63833, 69.27485], [22.27276, 68.89514], [22.38367, 68.71561], [22.53321, 68.74393], [23.13064, 68.64684], [23.68017, 68.70276], [23.781, 68.84514], [24.02299, 68.81601], [24.18432, 68.73936], [24.74898, 68.65143], [24.90023, 68.55579], [24.93048, 68.61102], [25.10189, 68.63307], [25.12206, 68.78684], [25.42455, 68.90328], [25.61613, 68.89602], [25.75729, 68.99383], [25.69679, 69.27039], [25.96904, 69.68397], [26.40261, 69.91377], [26.64461, 69.96565], [27.05802, 69.92069], [27.57226, 70.06215], [27.95542, 70.0965], [27.97558, 69.99671], [28.32849, 69.88605], [28.36883, 69.81658], [29.12697, 69.69193], [29.31664, 69.47994], [28.8629, 69.22395], [28.81248, 69.11997], [28.91738, 69.04774], [29.0444, 69.0119], [29.26623, 69.13794], [29.27631, 69.2811], [29.97205, 69.41623], [30.16363, 69.65244], [30.52662, 69.54699], [30.95011, 69.54699], [30.84095, 69.80584], [31.59909, 70.16571], [32.07813, 72.01005], [-11.60274, 67.73467], [7.28637, 57.35913], [10.40861, 58.38489]]]] } },
23160 { type: "Feature", properties: { wikidata: "Q98543636", nameEn: "Mainland Ecuador", country: "EC", groups: ["005", "419", "019", "UN"], callingCodes: ["593"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-84.52388, -3.36941], [-80.30602, -3.39149], [-80.20647, -3.431], [-80.24123, -3.46124], [-80.24586, -3.48677], [-80.23651, -3.48652], [-80.22629, -3.501], [-80.20535, -3.51667], [-80.21642, -3.5888], [-80.19848, -3.59249], [-80.18741, -3.63994], [-80.19926, -3.68894], [-80.13232, -3.90317], [-80.46386, -4.01342], [-80.4822, -4.05477], [-80.45023, -4.20938], [-80.32114, -4.21323], [-80.46386, -4.41516], [-80.39256, -4.48269], [-80.13945, -4.29786], [-79.79722, -4.47558], [-79.59402, -4.46848], [-79.26248, -4.95167], [-79.1162, -4.97774], [-79.01659, -5.01481], [-78.85149, -4.66795], [-78.68394, -4.60754], [-78.34362, -3.38633], [-78.24589, -3.39907], [-78.22642, -3.51113], [-78.14324, -3.47653], [-78.19369, -3.36431], [-77.94147, -3.05454], [-76.6324, -2.58397], [-76.05203, -2.12179], [-75.57429, -1.55961], [-75.3872, -0.9374], [-75.22862, -0.95588], [-75.22862, -0.60048], [-75.53615, -0.19213], [-75.60169, -0.18708], [-75.61997, -0.10012], [-75.40192, -0.17196], [-75.25764, -0.11943], [-75.82927, 0.09578], [-76.23441, 0.42294], [-76.41215, 0.38228], [-76.4094, 0.24015], [-76.89177, 0.24736], [-77.52001, 0.40782], [-77.49984, 0.64476], [-77.67815, 0.73863], [-77.66416, 0.81604], [-77.68613, 0.83029], [-77.7148, 0.85003], [-77.85677, 0.80197], [-78.42749, 1.15389], [-78.87137, 1.47457], [-82.12561, 4.00341], [-84.52388, -3.36941]]]] } },
23161 { type: "Feature", properties: { m49: "001", wikidata: "Q2", nameEn: "World", aliases: ["Earth", "Planet"], level: "world" }, geometry: null },
23162 { type: "Feature", properties: { m49: "002", wikidata: "Q15", nameEn: "Africa", level: "region" }, geometry: null },
23163 { type: "Feature", properties: { m49: "003", wikidata: "Q49", nameEn: "North America", level: "subregion" }, geometry: null },
23164 { type: "Feature", properties: { m49: "005", wikidata: "Q18", nameEn: "South America", level: "intermediateRegion" }, geometry: null },
23165 { type: "Feature", properties: { m49: "009", wikidata: "Q538", nameEn: "Oceania", level: "region" }, geometry: null },
23166 { type: "Feature", properties: { m49: "011", wikidata: "Q4412", nameEn: "Western Africa", level: "intermediateRegion" }, geometry: null },
23167 { type: "Feature", properties: { m49: "013", wikidata: "Q27611", nameEn: "Central America", level: "intermediateRegion" }, geometry: null },
23168 { type: "Feature", properties: { m49: "014", wikidata: "Q27407", nameEn: "Eastern Africa", level: "intermediateRegion" }, geometry: null },
23169 { type: "Feature", properties: { m49: "015", wikidata: "Q27381", nameEn: "Northern Africa", level: "subregion" }, geometry: null },
23170 { type: "Feature", properties: { m49: "017", wikidata: "Q27433", nameEn: "Middle Africa", level: "intermediateRegion" }, geometry: null },
23171 { type: "Feature", properties: { m49: "018", wikidata: "Q27394", nameEn: "Southern Africa", level: "intermediateRegion" }, geometry: null },
23172 { type: "Feature", properties: { m49: "019", wikidata: "Q828", nameEn: "Americas", level: "region" }, geometry: null },
23173 { type: "Feature", properties: { m49: "021", wikidata: "Q2017699", nameEn: "Northern America", level: "subregion" }, geometry: null },
23174 { type: "Feature", properties: { m49: "029", wikidata: "Q664609", nameEn: "Caribbean", level: "intermediateRegion" }, geometry: null },
23175 { type: "Feature", properties: { m49: "030", wikidata: "Q27231", nameEn: "Eastern Asia", level: "subregion" }, geometry: null },
23176 { type: "Feature", properties: { m49: "034", wikidata: "Q771405", nameEn: "Southern Asia", level: "subregion" }, geometry: null },
23177 { type: "Feature", properties: { m49: "035", wikidata: "Q11708", nameEn: "South-eastern Asia", level: "subregion" }, geometry: null },
23178 { type: "Feature", properties: { m49: "039", wikidata: "Q27449", nameEn: "Southern Europe", level: "subregion" }, geometry: null },
23179 { type: "Feature", properties: { m49: "053", wikidata: "Q45256", nameEn: "Australia and New Zealand", aliases: ["Australasia"], level: "subregion" }, geometry: null },
23180 { type: "Feature", properties: { m49: "054", wikidata: "Q37394", nameEn: "Melanesia", level: "subregion" }, geometry: null },
23181 { type: "Feature", properties: { m49: "057", wikidata: "Q3359409", nameEn: "Micronesia", level: "subregion" }, geometry: null },
23182 { type: "Feature", properties: { m49: "061", wikidata: "Q35942", nameEn: "Polynesia", level: "subregion" }, geometry: null },
23183 { type: "Feature", properties: { m49: "142", wikidata: "Q48", nameEn: "Asia", level: "region" }, geometry: null },
23184 { type: "Feature", properties: { m49: "143", wikidata: "Q27275", nameEn: "Central Asia", level: "subregion" }, geometry: null },
23185 { type: "Feature", properties: { m49: "145", wikidata: "Q27293", nameEn: "Western Asia", level: "subregion" }, geometry: null },
23186 { type: "Feature", properties: { m49: "150", wikidata: "Q46", nameEn: "Europe", level: "region" }, geometry: null },
23187 { type: "Feature", properties: { m49: "151", wikidata: "Q27468", nameEn: "Eastern Europe", level: "subregion" }, geometry: null },
23188 { type: "Feature", properties: { m49: "154", wikidata: "Q27479", nameEn: "Northern Europe", level: "subregion" }, geometry: null },
23189 { type: "Feature", properties: { m49: "155", wikidata: "Q27496", nameEn: "Western Europe", level: "subregion" }, geometry: null },
23190 { type: "Feature", properties: { m49: "202", wikidata: "Q132959", nameEn: "Sub-Saharan Africa", level: "subregion" }, geometry: null },
23191 { type: "Feature", properties: { m49: "419", wikidata: "Q72829598", nameEn: "Latin America and the Caribbean", level: "subregion" }, geometry: null },
23192 { type: "Feature", properties: { m49: "680", wikidata: "Q3405693", nameEn: "Sark", country: "GB", groups: ["GG", "830", "Q185086", "154", "150", "UN"], level: "subterritory", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01481"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.36485, 49.48223], [-2.65349, 49.15373], [-2.09454, 49.46288], [-2.36485, 49.48223]]]] } },
23193 { type: "Feature", properties: { m49: "830", wikidata: "Q42314", nameEn: "Channel Islands", level: "intermediateRegion" }, geometry: null },
23194 { type: "Feature", properties: { iso1A2: "AC", iso1A3: "ASC", wikidata: "Q46197", nameEn: "Ascension Island", aliases: ["SH-AC"], country: "GB", groups: ["SH", "BOTS", "011", "202", "002", "UN"], isoStatus: "excRes", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["247"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-14.82771, -8.70814], [-13.33271, -8.07391], [-14.91926, -6.63386], [-14.82771, -8.70814]]]] } },
23195 { type: "Feature", properties: { iso1A2: "AD", iso1A3: "AND", iso1N3: "020", wikidata: "Q228", nameEn: "Andorra", groups: ["Q12837", "039", "150", "UN"], callingCodes: ["376"] }, geometry: { type: "MultiPolygon", coordinates: [[[[1.72515, 42.50338], [1.73683, 42.55492], [1.7858, 42.57698], [1.72588, 42.59098], [1.73452, 42.61515], [1.68267, 42.62533], [1.6625, 42.61982], [1.63485, 42.62957], [1.60085, 42.62703], [1.55418, 42.65669], [1.50867, 42.64483], [1.48043, 42.65203], [1.46718, 42.63296], [1.47986, 42.61346], [1.44197, 42.60217], [1.42512, 42.58292], [1.44529, 42.56722], [1.4234, 42.55959], [1.41245, 42.53539], [1.44759, 42.54431], [1.46661, 42.50949], [1.41648, 42.48315], [1.43838, 42.47848], [1.44529, 42.43724], [1.5127, 42.42959], [1.55073, 42.43299], [1.55937, 42.45808], [1.57953, 42.44957], [1.58933, 42.46275], [1.65674, 42.47125], [1.66826, 42.50779], [1.70571, 42.48867], [1.72515, 42.50338]]]] } },
23196 { type: "Feature", properties: { iso1A2: "AE", iso1A3: "ARE", iso1N3: "784", wikidata: "Q878", nameEn: "United Arab Emirates", groups: ["145", "142", "UN"], callingCodes: ["971"] }, geometry: { type: "MultiPolygon", coordinates: [[[[56.26534, 25.62825], [56.25341, 25.61443], [56.26636, 25.60643], [56.25365, 25.60211], [56.20473, 25.61119], [56.18363, 25.65508], [56.14826, 25.66351], [56.13579, 25.73524], [56.17416, 25.77239], [56.13963, 25.82765], [56.19334, 25.9795], [56.15498, 26.06828], [56.08666, 26.05038], [55.81777, 26.18798], [55.14145, 25.62624], [53.97892, 24.64436], [52.82259, 25.51697], [52.35509, 25.00368], [52.02277, 24.75635], [51.83108, 24.71675], [51.58834, 24.66608], [51.41644, 24.39615], [51.58871, 24.27256], [51.59617, 24.12041], [52.56622, 22.94341], [55.13599, 22.63334], [55.2137, 22.71065], [55.22634, 23.10378], [55.57358, 23.669], [55.48677, 23.94946], [55.73301, 24.05994], [55.8308, 24.01633], [56.01799, 24.07426], [55.95472, 24.2172], [55.83367, 24.20193], [55.77658, 24.23476], [55.76558, 24.23227], [55.75257, 24.23466], [55.75382, 24.2466], [55.75939, 24.26114], [55.76781, 24.26209], [55.79145, 24.27914], [55.80747, 24.31069], [55.83395, 24.32776], [55.83271, 24.41521], [55.76461, 24.5287], [55.83271, 24.68567], [55.83408, 24.77858], [55.81348, 24.80102], [55.81116, 24.9116], [55.85094, 24.96858], [55.90849, 24.96771], [55.96316, 25.00857], [56.05715, 24.95727], [56.05106, 24.87461], [55.97467, 24.89639], [55.97836, 24.87673], [56.03535, 24.81161], [56.06128, 24.74457], [56.13684, 24.73699], [56.20062, 24.78565], [56.20568, 24.85063], [56.30269, 24.88334], [56.34873, 24.93205], [56.3227, 24.97284], [56.86325, 25.03856], [56.82555, 25.7713], [56.26534, 25.62825]], [[56.26062, 25.33108], [56.3005, 25.31815], [56.3111, 25.30107], [56.35172, 25.30681], [56.34438, 25.26653], [56.27628, 25.23404], [56.24341, 25.22867], [56.20872, 25.24104], [56.20838, 25.25668], [56.24465, 25.27505], [56.25008, 25.28843], [56.23362, 25.31253], [56.26062, 25.33108]]], [[[56.28423, 25.26344], [56.29379, 25.2754], [56.28102, 25.28486], [56.2716, 25.27916], [56.27086, 25.26128], [56.28423, 25.26344]]]] } },
23197 { type: "Feature", properties: { iso1A2: "AF", iso1A3: "AFG", iso1N3: "004", wikidata: "Q889", nameEn: "Afghanistan", groups: ["034", "142", "UN"], callingCodes: ["93"] }, geometry: { type: "MultiPolygon", coordinates: [[[[70.61526, 38.34774], [70.60407, 38.28046], [70.54673, 38.24541], [70.4898, 38.12546], [70.17206, 37.93276], [70.1863, 37.84296], [70.27694, 37.81258], [70.28243, 37.66706], [70.15015, 37.52519], [69.95971, 37.5659], [69.93362, 37.61378], [69.84435, 37.60616], [69.80041, 37.5746], [69.51888, 37.5844], [69.44954, 37.4869], [69.36645, 37.40462], [69.45022, 37.23315], [69.39529, 37.16752], [69.25152, 37.09426], [69.03274, 37.25174], [68.96407, 37.32603], [68.88168, 37.33368], [68.91189, 37.26704], [68.80889, 37.32494], [68.81438, 37.23862], [68.6798, 37.27906], [68.61851, 37.19815], [68.41888, 37.13906], [68.41201, 37.10402], [68.29253, 37.10621], [68.27605, 37.00977], [68.18542, 37.02074], [68.02194, 36.91923], [67.87917, 37.0591], [67.7803, 37.08978], [67.78329, 37.1834], [67.51868, 37.26102], [67.2581, 37.17216], [67.2224, 37.24545], [67.13039, 37.27168], [67.08232, 37.35469], [66.95598, 37.40162], [66.64699, 37.32958], [66.55743, 37.35409], [66.30993, 37.32409], [65.72274, 37.55438], [65.64137, 37.45061], [65.64263, 37.34388], [65.51778, 37.23881], [64.97945, 37.21913], [64.61141, 36.6351], [64.62514, 36.44311], [64.57295, 36.34362], [64.43288, 36.24401], [64.05385, 36.10433], [63.98519, 36.03773], [63.56496, 35.95106], [63.53475, 35.90881], [63.29579, 35.85985], [63.12276, 35.86208], [63.10318, 35.81782], [63.23262, 35.67487], [63.10079, 35.63024], [63.12276, 35.53196], [63.0898, 35.43131], [62.90853, 35.37086], [62.74098, 35.25432], [62.62288, 35.22067], [62.48006, 35.28796], [62.29878, 35.13312], [62.29191, 35.25964], [62.15871, 35.33278], [62.05709, 35.43803], [61.97743, 35.4604], [61.77693, 35.41341], [61.58742, 35.43803], [61.27371, 35.61482], [61.18187, 35.30249], [61.0991, 35.27845], [61.12831, 35.09938], [61.06926, 34.82139], [61.00197, 34.70631], [60.99922, 34.63064], [60.72316, 34.52857], [60.91321, 34.30411], [60.66502, 34.31539], [60.50209, 34.13992], [60.5838, 33.80793], [60.5485, 33.73422], [60.57762, 33.59772], [60.69573, 33.56054], [60.91133, 33.55596], [60.88908, 33.50219], [60.56485, 33.12944], [60.86191, 32.22565], [60.84541, 31.49561], [61.70929, 31.37391], [61.80569, 31.16167], [61.80957, 31.12576], [61.83257, 31.0452], [61.8335, 30.97669], [61.78268, 30.92724], [61.80829, 30.84224], [60.87231, 29.86514], [62.47751, 29.40782], [63.5876, 29.50456], [64.12966, 29.39157], [64.19796, 29.50407], [64.62116, 29.58903], [65.04005, 29.53957], [66.24175, 29.85181], [66.36042, 29.9583], [66.23609, 30.06321], [66.34869, 30.404], [66.28413, 30.57001], [66.39194, 30.9408], [66.42645, 30.95309], [66.58175, 30.97532], [66.68166, 31.07597], [66.72561, 31.20526], [66.83273, 31.26867], [67.04147, 31.31561], [67.03323, 31.24519], [67.29964, 31.19586], [67.78854, 31.33203], [67.7748, 31.4188], [67.62374, 31.40473], [67.58323, 31.52772], [67.72056, 31.52304], [67.86887, 31.63536], [68.00071, 31.6564], [68.1655, 31.82691], [68.25614, 31.80357], [68.27605, 31.75863], [68.44222, 31.76446], [68.57475, 31.83158], [68.6956, 31.75687], [68.79997, 31.61665], [68.91078, 31.59687], [68.95995, 31.64822], [69.00939, 31.62249], [69.11514, 31.70782], [69.20577, 31.85957], [69.3225, 31.93186], [69.27032, 32.14141], [69.27932, 32.29119], [69.23599, 32.45946], [69.2868, 32.53938], [69.38155, 32.56601], [69.44747, 32.6678], [69.43649, 32.7302], [69.38018, 32.76601], [69.47082, 32.85834], [69.5436, 32.8768], [69.49854, 32.88843], [69.49004, 33.01509], [69.57656, 33.09911], [69.71526, 33.09911], [69.79766, 33.13247], [69.85259, 33.09451], [70.02563, 33.14282], [70.07369, 33.22557], [70.13686, 33.21064], [70.32775, 33.34496], [70.17062, 33.53535], [70.20141, 33.64387], [70.14785, 33.6553], [70.14236, 33.71701], [70.00503, 33.73528], [69.85671, 33.93719], [69.87307, 33.9689], [69.90203, 34.04194], [70.54336, 33.9463], [70.88119, 33.97933], [71.07345, 34.06242], [71.06933, 34.10564], [71.09307, 34.11961], [71.09453, 34.13524], [71.13078, 34.16503], [71.12815, 34.26619], [71.17662, 34.36769], [71.02401, 34.44835], [71.0089, 34.54568], [71.11602, 34.63047], [71.08718, 34.69034], [71.28356, 34.80882], [71.29472, 34.87728], [71.50329, 34.97328], [71.49917, 35.00478], [71.55273, 35.02615], [71.52938, 35.09023], [71.67495, 35.21262], [71.5541, 35.28776], [71.54294, 35.31037], [71.65435, 35.4479], [71.49917, 35.6267], [71.55273, 35.71483], [71.37969, 35.95865], [71.19505, 36.04134], [71.60491, 36.39429], [71.80267, 36.49924], [72.18135, 36.71838], [72.6323, 36.84601], [73.82685, 36.91421], [74.04856, 36.82648], [74.43389, 37.00977], [74.53739, 36.96224], [74.56453, 37.03023], [74.49981, 37.24518], [74.80605, 37.21565], [74.88887, 37.23275], [74.8294, 37.3435], [74.68383, 37.3948], [74.56161, 37.37734], [74.41055, 37.3948], [74.23339, 37.41116], [74.20308, 37.34208], [73.8564, 37.26158], [73.82552, 37.22659], [73.64974, 37.23643], [73.61129, 37.27469], [73.76647, 37.33913], [73.77197, 37.4417], [73.29633, 37.46495], [73.06884, 37.31729], [72.79693, 37.22222], [72.66381, 37.02014], [72.54095, 37.00007], [72.31676, 36.98115], [71.83229, 36.68084], [71.67083, 36.67346], [71.57195, 36.74943], [71.51502, 36.89128], [71.48481, 36.93218], [71.46923, 36.99925], [71.45578, 37.03094], [71.43097, 37.05855], [71.44127, 37.11856], [71.4494, 37.18137], [71.4555, 37.21418], [71.47386, 37.2269], [71.48339, 37.23937], [71.4824, 37.24921], [71.48536, 37.26017], [71.50674, 37.31502], [71.49821, 37.31975], [71.4862, 37.33405], [71.47685, 37.40281], [71.49612, 37.4279], [71.5256, 37.47971], [71.50616, 37.50733], [71.49693, 37.53527], [71.5065, 37.60912], [71.51972, 37.61945], [71.54186, 37.69691], [71.55234, 37.73209], [71.53053, 37.76534], [71.54324, 37.77104], [71.55752, 37.78677], [71.59255, 37.79956], [71.58843, 37.92425], [71.51565, 37.95349], [71.32871, 37.88564], [71.296, 37.93403], [71.2809, 37.91995], [71.24969, 37.93031], [71.27278, 37.96496], [71.27622, 37.99946], [71.28922, 38.01272], [71.29878, 38.04429], [71.36444, 38.15358], [71.37803, 38.25641], [71.33869, 38.27335], [71.33114, 38.30339], [71.21291, 38.32797], [71.1451, 38.40106], [71.10957, 38.40671], [71.10592, 38.42077], [71.09542, 38.42517], [71.0556, 38.40176], [71.03545, 38.44779], [70.98693, 38.48862], [70.92728, 38.43021], [70.88719, 38.46826], [70.84376, 38.44688], [70.82538, 38.45394], [70.81697, 38.44507], [70.80521, 38.44447], [70.79766, 38.44944], [70.78702, 38.45031], [70.78581, 38.45502], [70.77132, 38.45548], [70.75455, 38.4252], [70.72485, 38.4131], [70.69807, 38.41861], [70.67438, 38.40597], [70.6761, 38.39144], [70.69189, 38.37031], [70.64966, 38.34999], [70.61526, 38.34774]]]] } },
23198 { type: "Feature", properties: { iso1A2: "AG", iso1A3: "ATG", iso1N3: "028", wikidata: "Q781", nameEn: "Antigua and Barbuda", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 268"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.66959, 18.6782], [-62.58307, 16.68909], [-62.1023, 16.97277], [-61.23098, 16.62484], [-61.66959, 18.6782]]]] } },
23199 { type: "Feature", properties: { iso1A2: "AI", iso1A3: "AIA", iso1N3: "660", wikidata: "Q25228", nameEn: "Anguilla", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 264"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.79029, 19.11219], [-63.35989, 18.06012], [-62.62718, 18.26185], [-63.79029, 19.11219]]]] } },
23200 { type: "Feature", properties: { iso1A2: "AL", iso1A3: "ALB", iso1N3: "008", wikidata: "Q222", nameEn: "Albania", groups: ["039", "150", "UN"], callingCodes: ["355"] }, geometry: { type: "MultiPolygon", coordinates: [[[[20.07761, 42.55582], [20.01834, 42.54622], [20.00842, 42.5109], [19.9324, 42.51699], [19.82333, 42.46581], [19.76549, 42.50237], [19.74731, 42.57422], [19.77375, 42.58517], [19.73244, 42.66299], [19.65972, 42.62774], [19.4836, 42.40831], [19.42352, 42.36546], [19.42, 42.33019], [19.28623, 42.17745], [19.40687, 42.10024], [19.37548, 42.06835], [19.36867, 42.02564], [19.37691, 41.96977], [19.34601, 41.95675], [19.33812, 41.90669], [19.37451, 41.8842], [19.37597, 41.84849], [19.26406, 41.74971], [19.0384, 40.35325], [19.95905, 39.82857], [19.97622, 39.78684], [19.92466, 39.69533], [19.98042, 39.6504], [20.00957, 39.69227], [20.05189, 39.69112], [20.12956, 39.65805], [20.15988, 39.652], [20.22376, 39.64532], [20.22707, 39.67459], [20.27412, 39.69884], [20.31961, 39.72799], [20.29152, 39.80421], [20.30804, 39.81563], [20.38572, 39.78516], [20.41475, 39.81437], [20.41546, 39.82832], [20.31135, 39.99438], [20.37911, 39.99058], [20.42373, 40.06777], [20.48487, 40.06271], [20.51297, 40.08168], [20.55593, 40.06524], [20.61081, 40.07866], [20.62566, 40.0897], [20.67162, 40.09433], [20.71789, 40.27739], [20.78234, 40.35803], [20.7906, 40.42726], [20.83688, 40.47882], [20.94925, 40.46625], [20.96908, 40.51526], [21.03932, 40.56299], [21.05833, 40.66586], [20.98134, 40.76046], [20.95752, 40.76982], [20.98396, 40.79109], [20.97887, 40.85475], [20.97693, 40.90103], [20.94305, 40.92399], [20.83671, 40.92752], [20.81567, 40.89662], [20.73504, 40.9081], [20.71634, 40.91781], [20.65558, 41.08009], [20.63454, 41.0889], [20.59832, 41.09066], [20.58546, 41.11179], [20.59715, 41.13644], [20.51068, 41.2323], [20.49432, 41.33679], [20.52119, 41.34381], [20.55976, 41.4087], [20.51301, 41.442], [20.49039, 41.49277], [20.45331, 41.51436], [20.45809, 41.5549], [20.52103, 41.56473], [20.55508, 41.58113], [20.51769, 41.65975], [20.52937, 41.69292], [20.51301, 41.72433], [20.53405, 41.78099], [20.57144, 41.7897], [20.55976, 41.87068], [20.59524, 41.8818], [20.57946, 41.91593], [20.63069, 41.94913], [20.59434, 42.03879], [20.55633, 42.08173], [20.56955, 42.12097], [20.48857, 42.25444], [20.3819, 42.3029], [20.34479, 42.32656], [20.24399, 42.32168], [20.21797, 42.41237], [20.17127, 42.50469], [20.07761, 42.55582]]]] } },
23201 { type: "Feature", properties: { iso1A2: "AM", iso1A3: "ARM", iso1N3: "051", wikidata: "Q399", nameEn: "Armenia", groups: ["145", "142", "UN"], callingCodes: ["374"] }, geometry: { type: "MultiPolygon", coordinates: [[[[45.0133, 41.29747], [44.93493, 41.25685], [44.81437, 41.30371], [44.80053, 41.25949], [44.81749, 41.23488], [44.84358, 41.23088], [44.89911, 41.21366], [44.87887, 41.20195], [44.82084, 41.21513], [44.72814, 41.20338], [44.61462, 41.24018], [44.59322, 41.1933], [44.46791, 41.18204], [44.34417, 41.2382], [44.34337, 41.20312], [44.32139, 41.2079], [44.18148, 41.24644], [44.16591, 41.19141], [43.84835, 41.16329], [43.74717, 41.1117], [43.67712, 41.13398], [43.4717, 41.12611], [43.44984, 41.0988], [43.47319, 41.02251], [43.58683, 40.98961], [43.67712, 40.93084], [43.67712, 40.84846], [43.74872, 40.7365], [43.7425, 40.66805], [43.63664, 40.54159], [43.54791, 40.47413], [43.60862, 40.43267], [43.59928, 40.34019], [43.71136, 40.16673], [43.65221, 40.14889], [43.65688, 40.11199], [43.92307, 40.01787], [44.1057, 40.03555], [44.1778, 40.02845], [44.26973, 40.04866], [44.46635, 39.97733], [44.61845, 39.8281], [44.75779, 39.7148], [44.88354, 39.74432], [44.92869, 39.72157], [45.06604, 39.79277], [45.18554, 39.67846], [45.17464, 39.58614], [45.21784, 39.58074], [45.23535, 39.61373], [45.30385, 39.61373], [45.29606, 39.57654], [45.46992, 39.49888], [45.70547, 39.60174], [45.80804, 39.56716], [45.83, 39.46487], [45.79225, 39.3695], [45.99774, 39.28931], [46.02303, 39.09978], [46.06973, 39.0744], [46.14785, 38.84206], [46.20601, 38.85262], [46.34059, 38.92076], [46.53497, 38.86548], [46.51805, 38.94982], [46.54296, 39.07078], [46.44022, 39.19636], [46.52584, 39.18912], [46.54141, 39.15895], [46.58032, 39.21204], [46.63481, 39.23013], [46.56476, 39.24942], [46.50093, 39.33736], [46.43244, 39.35181], [46.37795, 39.42039], [46.4013, 39.45405], [46.53051, 39.47809], [46.51027, 39.52373], [46.57721, 39.54414], [46.57098, 39.56694], [46.52117, 39.58734], [46.42465, 39.57534], [46.40286, 39.63651], [46.18493, 39.60533], [45.96543, 39.78859], [45.82533, 39.82925], [45.7833, 39.9475], [45.60895, 39.97733], [45.59806, 40.0131], [45.78642, 40.03218], [45.83779, 39.98925], [45.97944, 40.181], [45.95609, 40.27846], [45.65098, 40.37696], [45.42994, 40.53804], [45.45484, 40.57707], [45.35366, 40.65979], [45.4206, 40.7424], [45.55914, 40.78366], [45.60584, 40.87436], [45.40814, 40.97904], [45.44083, 41.01663], [45.39725, 41.02603], [45.35677, 40.99784], [45.28859, 41.03757], [45.26162, 41.0228], [45.25897, 41.0027], [45.1994, 41.04518], [45.16493, 41.05068], [45.1634, 41.08082], [45.1313, 41.09369], [45.12923, 41.06059], [45.06784, 41.05379], [45.08028, 41.10917], [45.19942, 41.13299], [45.1969, 41.168], [45.11811, 41.19967], [45.05201, 41.19211], [45.02932, 41.2101], [45.05497, 41.2464], [45.0133, 41.29747]], [[45.21324, 40.9817], [45.21219, 40.99001], [45.20518, 40.99348], [45.19312, 40.98998], [45.18382, 41.0066], [45.20625, 41.01484], [45.23487, 41.00226], [45.23095, 40.97828], [45.21324, 40.9817]], [[45.00864, 41.03411], [44.9903, 41.05657], [44.96031, 41.06345], [44.95383, 41.07553], [44.97169, 41.09176], [45.00864, 41.09407], [45.03406, 41.07931], [45.04517, 41.06653], [45.03792, 41.03938], [45.00864, 41.03411]]], [[[45.50279, 40.58424], [45.56071, 40.64765], [45.51825, 40.67382], [45.47927, 40.65023], [45.50279, 40.58424]]]] } },
23202 { type: "Feature", properties: { iso1A2: "AO", iso1A3: "AGO", iso1N3: "024", wikidata: "Q916", nameEn: "Angola", groups: ["017", "202", "002", "UN"], callingCodes: ["244"] }, geometry: { type: "MultiPolygon", coordinates: [[[[16.55507, -5.85631], [13.04371, -5.87078], [12.42245, -6.07585], [11.95767, -5.94705], [12.20376, -5.76338], [12.26557, -5.74031], [12.52318, -5.74353], [12.52301, -5.17481], [12.53599, -5.1618], [12.53586, -5.14658], [12.51589, -5.1332], [12.49815, -5.14058], [12.46297, -5.09408], [12.60251, -5.01715], [12.63465, -4.94632], [12.70868, -4.95505], [12.8733, -4.74346], [13.11195, -4.67745], [13.09648, -4.63739], [12.91489, -4.47907], [12.87096, -4.40315], [12.76844, -4.38709], [12.64835, -4.55937], [12.40964, -4.60609], [12.32324, -4.78415], [12.25587, -4.79437], [12.20901, -4.75642], [12.16068, -4.90089], [12.00924, -5.02627], [11.50888, -5.33417], [10.5065, -17.25284], [11.75063, -17.25013], [12.07076, -17.15165], [12.52111, -17.24495], [12.97145, -16.98567], [13.36212, -16.98048], [13.95896, -17.43141], [14.28743, -17.38814], [18.39229, -17.38927], [18.84226, -17.80375], [21.14283, -17.94318], [21.42741, -18.02787], [23.47474, -17.62877], [23.20038, -17.47563], [22.17217, -16.50269], [22.00323, -16.18028], [21.97988, -13.00148], [24.03339, -12.99091], [23.90937, -12.844], [24.06672, -12.29058], [23.98804, -12.13149], [24.02603, -11.15368], [24.00027, -10.89356], [23.86868, -11.02856], [23.45631, -10.946], [23.16602, -11.10577], [22.54205, -11.05784], [22.25951, -11.24911], [22.17954, -10.85884], [22.32604, -10.76291], [22.19039, -9.94628], [21.84856, -9.59871], [21.79824, -7.29628], [20.56263, -7.28566], [20.61689, -6.90876], [20.31846, -6.91953], [20.30218, -6.98955], [19.5469, -7.00195], [19.33698, -7.99743], [18.33635, -8.00126], [17.5828, -8.13784], [16.96282, -7.21787], [16.55507, -5.85631]]]] } },
23203 { type: "Feature", properties: { iso1A2: "AQ", iso1A3: "ATA", iso1N3: "010", wikidata: "Q51", nameEn: "Antarctica", level: "region", callingCodes: ["672"] }, geometry: { type: "MultiPolygon", coordinates: [[[[180, -60], [-180, -60], [-180, -90], [180, -90], [180, -60]]]] } },
23204 { type: "Feature", properties: { iso1A2: "AR", iso1A3: "ARG", iso1N3: "032", wikidata: "Q414", nameEn: "Argentina", aliases: ["RA"], groups: ["005", "419", "019", "UN"], callingCodes: ["54"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-72.31343, -50.58411], [-72.33873, -51.59954], [-71.99889, -51.98018], [-69.97824, -52.00845], [-68.41683, -52.33516], [-68.60702, -52.65781], [-68.60733, -54.9125], [-68.01394, -54.8753], [-67.46182, -54.92205], [-67.11046, -54.94199], [-66.07313, -55.19618], [-63.67376, -55.11859], [-54.78916, -36.21945], [-57.83001, -34.69099], [-58.34425, -34.15035], [-58.44442, -33.84033], [-58.40475, -33.11777], [-58.1224, -32.98842], [-58.22362, -32.52416], [-58.10036, -32.25338], [-58.20252, -31.86966], [-58.00076, -31.65016], [-58.0023, -31.53084], [-58.07569, -31.44916], [-57.98127, -31.3872], [-57.9908, -31.34924], [-57.86729, -31.06352], [-57.89476, -30.95994], [-57.8024, -30.77193], [-57.89115, -30.49572], [-57.64859, -30.35095], [-57.61478, -30.25165], [-57.65132, -30.19229], [-57.09386, -29.74211], [-56.81251, -29.48154], [-56.62789, -29.18073], [-56.57295, -29.11357], [-56.54171, -29.11447], [-56.05265, -28.62651], [-56.00458, -28.60421], [-56.01729, -28.51223], [-55.65418, -28.18304], [-55.6262, -28.17124], [-55.33303, -27.94661], [-55.16872, -27.86224], [-55.1349, -27.89759], [-54.90805, -27.73149], [-54.90159, -27.63132], [-54.67657, -27.57214], [-54.50416, -27.48232], [-54.41888, -27.40882], [-54.19268, -27.30751], [-54.19062, -27.27639], [-54.15978, -27.2889], [-53.80144, -27.09844], [-53.73372, -26.6131], [-53.68269, -26.33359], [-53.64505, -26.28089], [-53.64186, -26.25976], [-53.64632, -26.24798], [-53.63881, -26.25075], [-53.63739, -26.2496], [-53.65237, -26.23289], [-53.65018, -26.19501], [-53.73968, -26.10012], [-53.73391, -26.07006], [-53.7264, -26.0664], [-53.73086, -26.05842], [-53.73511, -26.04211], [-53.83691, -25.94849], [-53.90831, -25.55513], [-54.52926, -25.62846], [-54.5502, -25.58915], [-54.59398, -25.59224], [-54.62063, -25.91213], [-54.60664, -25.9691], [-54.67359, -25.98607], [-54.69333, -26.37705], [-54.70732, -26.45099], [-54.80868, -26.55669], [-55.00584, -26.78754], [-55.06351, -26.80195], [-55.16948, -26.96068], [-55.25243, -26.93808], [-55.39611, -26.97679], [-55.62322, -27.1941], [-55.59094, -27.32444], [-55.74475, -27.44485], [-55.89195, -27.3467], [-56.18313, -27.29851], [-56.85337, -27.5165], [-58.04205, -27.2387], [-58.59549, -27.29973], [-58.65321, -27.14028], [-58.3198, -26.83443], [-58.1188, -26.16704], [-57.87176, -25.93604], [-57.57431, -25.47269], [-57.80821, -25.13863], [-58.25492, -24.92528], [-58.33055, -24.97099], [-59.33886, -24.49935], [-59.45482, -24.34787], [-60.03367, -24.00701], [-60.28163, -24.04436], [-60.99754, -23.80934], [-61.0782, -23.62932], [-61.9756, -23.0507], [-62.22768, -22.55807], [-62.51761, -22.37684], [-62.64455, -22.25091], [-62.8078, -22.12534], [-62.81124, -21.9987], [-63.66482, -21.99918], [-63.68113, -22.0544], [-63.70963, -21.99934], [-63.93287, -21.99934], [-64.22918, -22.55807], [-64.31489, -22.88824], [-64.35108, -22.73282], [-64.4176, -22.67692], [-64.58888, -22.25035], [-64.67174, -22.18957], [-64.90014, -22.12136], [-64.99524, -22.08255], [-65.47435, -22.08908], [-65.57743, -22.07675], [-65.58694, -22.09794], [-65.61166, -22.09504], [-65.7467, -22.10105], [-65.9261, -21.93335], [-66.04832, -21.9187], [-66.03836, -21.84829], [-66.24077, -21.77837], [-66.29714, -22.08741], [-66.7298, -22.23644], [-67.18382, -22.81525], [-66.99632, -22.99839], [-67.33563, -24.04237], [-68.24825, -24.42596], [-68.56909, -24.69831], [-68.38372, -25.08636], [-68.57622, -25.32505], [-68.38372, -26.15353], [-68.56909, -26.28146], [-68.59048, -26.49861], [-68.27677, -26.90626], [-68.43363, -27.08414], [-68.77586, -27.16029], [-69.22504, -27.95042], [-69.66709, -28.44055], [-69.80969, -29.07185], [-69.99507, -29.28351], [-69.8596, -30.26131], [-70.14479, -30.36595], [-70.55832, -31.51559], [-69.88099, -33.34489], [-69.87386, -34.13344], [-70.49416, -35.24145], [-70.38008, -36.02375], [-70.95047, -36.4321], [-71.24279, -37.20264], [-70.89532, -38.6923], [-71.37826, -38.91474], [-71.92726, -40.72714], [-71.74901, -42.11711], [-72.15541, -42.15941], [-72.14828, -42.85321], [-71.64206, -43.64774], [-71.81318, -44.38097], [-71.16436, -44.46244], [-71.26418, -44.75684], [-72.06985, -44.81756], [-71.35687, -45.22075], [-71.75614, -45.61611], [-71.68577, -46.55385], [-71.94152, -47.13595], [-72.50478, -47.80586], [-72.27662, -48.28727], [-72.54042, -48.52392], [-72.56894, -48.81116], [-73.09655, -49.14342], [-73.45156, -49.79461], [-73.55259, -49.92488], [-73.15765, -50.78337], [-72.31343, -50.58411]]]] } },
23205 { type: "Feature", properties: { iso1A2: "AS", iso1A3: "ASM", iso1N3: "016", wikidata: "Q16641", nameEn: "American Samoa", aliases: ["US-AS"], country: "US", groups: ["Q1352230", "061", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 684"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-171.39864, -10.21587], [-170.99605, -15.1275], [-166.32598, -15.26169], [-171.39864, -10.21587]]]] } },
23206 { type: "Feature", properties: { iso1A2: "AT", iso1A3: "AUT", iso1N3: "040", wikidata: "Q40", nameEn: "Austria", groups: ["EU", "155", "150", "UN"], callingCodes: ["43"] }, geometry: { type: "MultiPolygon", coordinates: [[[[15.34823, 48.98444], [15.28305, 48.98831], [15.26177, 48.95766], [15.16358, 48.94278], [15.15534, 48.99056], [14.99878, 49.01444], [14.97612, 48.96983], [14.98917, 48.90082], [14.95072, 48.79101], [14.98032, 48.77959], [14.9782, 48.7766], [14.98112, 48.77524], [14.9758, 48.76857], [14.95641, 48.75915], [14.94773, 48.76268], [14.81545, 48.7874], [14.80821, 48.77711], [14.80584, 48.73489], [14.72756, 48.69502], [14.71794, 48.59794], [14.66762, 48.58215], [14.60808, 48.62881], [14.56139, 48.60429], [14.4587, 48.64695], [14.43076, 48.58855], [14.33909, 48.55852], [14.20691, 48.5898], [14.09104, 48.5943], [14.01482, 48.63788], [14.06151, 48.66873], [13.84023, 48.76988], [13.82266, 48.75544], [13.81863, 48.73257], [13.79337, 48.71375], [13.81791, 48.69832], [13.81283, 48.68426], [13.81901, 48.6761], [13.82609, 48.62345], [13.80038, 48.59487], [13.80519, 48.58026], [13.76921, 48.55324], [13.7513, 48.5624], [13.74816, 48.53058], [13.72802, 48.51208], [13.66113, 48.53558], [13.65186, 48.55092], [13.62508, 48.55501], [13.59705, 48.57013], [13.57535, 48.55912], [13.51291, 48.59023], [13.50131, 48.58091], [13.50663, 48.57506], [13.46967, 48.55157], [13.45214, 48.56472], [13.43695, 48.55776], [13.45727, 48.51092], [13.42527, 48.45711], [13.43929, 48.43386], [13.40709, 48.37292], [13.30897, 48.31575], [13.26039, 48.29422], [13.18093, 48.29577], [13.126, 48.27867], [13.0851, 48.27711], [13.02083, 48.25689], [12.95306, 48.20629], [12.87126, 48.20318], [12.84475, 48.16556], [12.836, 48.1647], [12.8362, 48.15876], [12.82673, 48.15245], [12.80676, 48.14979], [12.78595, 48.12445], [12.7617, 48.12796], [12.74973, 48.10885], [12.76141, 48.07373], [12.8549, 48.01122], [12.87476, 47.96195], [12.91683, 47.95647], [12.9211, 47.95135], [12.91985, 47.94069], [12.92668, 47.93879], [12.93419, 47.94063], [12.93642, 47.94436], [12.93886, 47.94046], [12.94163, 47.92927], [13.00588, 47.84374], [12.98543, 47.82896], [12.96311, 47.79957], [12.93202, 47.77302], [12.94371, 47.76281], [12.9353, 47.74788], [12.91711, 47.74026], [12.90274, 47.72513], [12.91333, 47.7178], [12.92969, 47.71094], [12.98578, 47.7078], [13.01382, 47.72116], [13.07692, 47.68814], [13.09562, 47.63304], [13.06407, 47.60075], [13.06641, 47.58577], [13.04537, 47.58183], [13.05355, 47.56291], [13.03252, 47.53373], [13.04537, 47.49426], [12.9998, 47.46267], [12.98344, 47.48716], [12.9624, 47.47452], [12.85256, 47.52741], [12.84672, 47.54556], [12.80699, 47.54477], [12.77427, 47.58025], [12.82101, 47.61493], [12.76492, 47.64485], [12.77777, 47.66689], [12.7357, 47.6787], [12.6071, 47.6741], [12.57438, 47.63238], [12.53816, 47.63553], [12.50076, 47.62293], [12.44117, 47.6741], [12.43883, 47.6977], [12.37222, 47.68433], [12.336, 47.69534], [12.27991, 47.68827], [12.26004, 47.67725], [12.24017, 47.69534], [12.26238, 47.73544], [12.2542, 47.7433], [12.22571, 47.71776], [12.18303, 47.70065], [12.16217, 47.70105], [12.16769, 47.68167], [12.18347, 47.66663], [12.18507, 47.65984], [12.19895, 47.64085], [12.20801, 47.61082], [12.20398, 47.60667], [12.18568, 47.6049], [12.17737, 47.60121], [12.18145, 47.61019], [12.17824, 47.61506], [12.13734, 47.60639], [12.05788, 47.61742], [12.02282, 47.61033], [12.0088, 47.62451], [11.85572, 47.60166], [11.84052, 47.58354], [11.63934, 47.59202], [11.60681, 47.57881], [11.58811, 47.55515], [11.58578, 47.52281], [11.52618, 47.50939], [11.4362, 47.51413], [11.38128, 47.47465], [11.4175, 47.44621], [11.33804, 47.44937], [11.29597, 47.42566], [11.27844, 47.39956], [11.22002, 47.3964], [11.25157, 47.43277], [11.20482, 47.43198], [11.12536, 47.41222], [11.11835, 47.39719], [10.97111, 47.39561], [10.97111, 47.41617], [10.98513, 47.42882], [10.92437, 47.46991], [10.93839, 47.48018], [10.90918, 47.48571], [10.87061, 47.4786], [10.86945, 47.5015], [10.91268, 47.51334], [10.88814, 47.53701], [10.77596, 47.51729], [10.7596, 47.53228], [10.6965, 47.54253], [10.68832, 47.55752], [10.63456, 47.5591], [10.60337, 47.56755], [10.56912, 47.53584], [10.48849, 47.54057], [10.47329, 47.58552], [10.43473, 47.58394], [10.44992, 47.5524], [10.4324, 47.50111], [10.44291, 47.48453], [10.46278, 47.47901], [10.47446, 47.43318], [10.4359, 47.41183], [10.4324, 47.38494], [10.39851, 47.37623], [10.33424, 47.30813], [10.23257, 47.27088], [10.17531, 47.27167], [10.17648, 47.29149], [10.2147, 47.31014], [10.19998, 47.32832], [10.23757, 47.37609], [10.22774, 47.38904], [10.2127, 47.38019], [10.17648, 47.38889], [10.16362, 47.36674], [10.11805, 47.37228], [10.09819, 47.35724], [10.06897, 47.40709], [10.1052, 47.4316], [10.09001, 47.46005], [10.07131, 47.45531], [10.03859, 47.48927], [10.00003, 47.48216], [9.96029, 47.53899], [9.92407, 47.53111], [9.87733, 47.54688], [9.87499, 47.52953], [9.8189, 47.54688], [9.82591, 47.58158], [9.80254, 47.59419], [9.76748, 47.5934], [9.72736, 47.53457], [9.55125, 47.53629], [9.56312, 47.49495], [9.58208, 47.48344], [9.59482, 47.46305], [9.60205, 47.46165], [9.60484, 47.46358], [9.60841, 47.47178], [9.62158, 47.45858], [9.62475, 47.45685], [9.6423, 47.45599], [9.65728, 47.45383], [9.65863, 47.44847], [9.64483, 47.43842], [9.6446, 47.43233], [9.65043, 47.41937], [9.65136, 47.40504], [9.6629, 47.39591], [9.67334, 47.39191], [9.67445, 47.38429], [9.6711, 47.37824], [9.66243, 47.37136], [9.65427, 47.36824], [9.62476, 47.36639], [9.59978, 47.34671], [9.58513, 47.31334], [9.55857, 47.29919], [9.54773, 47.2809], [9.53116, 47.27029], [9.56766, 47.24281], [9.55176, 47.22585], [9.56981, 47.21926], [9.58264, 47.20673], [9.56539, 47.17124], [9.62623, 47.14685], [9.63395, 47.08443], [9.61216, 47.07732], [9.60717, 47.06091], [9.87935, 47.01337], [9.88266, 46.93343], [9.98058, 46.91434], [10.10715, 46.84296], [10.22675, 46.86942], [10.24128, 46.93147], [10.30031, 46.92093], [10.36933, 47.00212], [10.48376, 46.93891], [10.47197, 46.85698], [10.54783, 46.84505], [10.66405, 46.87614], [10.75753, 46.82258], [10.72974, 46.78972], [11.00764, 46.76896], [11.10618, 46.92966], [11.33355, 46.99862], [11.50739, 47.00644], [11.74789, 46.98484], [12.19254, 47.09331], [12.21781, 47.03996], [12.11675, 47.01241], [12.2006, 46.88854], [12.27591, 46.88651], [12.38708, 46.71529], [12.59992, 46.6595], [12.94445, 46.60401], [13.27627, 46.56059], [13.64088, 46.53438], [13.7148, 46.5222], [13.89837, 46.52331], [14.00422, 46.48474], [14.04002, 46.49117], [14.12097, 46.47724], [14.15989, 46.43327], [14.28326, 46.44315], [14.314, 46.43327], [14.42608, 46.44614], [14.45877, 46.41717], [14.52176, 46.42617], [14.56463, 46.37208], [14.5942, 46.43434], [14.66892, 46.44936], [14.72185, 46.49974], [14.81836, 46.51046], [14.83549, 46.56614], [14.86419, 46.59411], [14.87129, 46.61], [14.92283, 46.60848], [14.96002, 46.63459], [14.98024, 46.6009], [15.01451, 46.641], [15.14215, 46.66131], [15.23711, 46.63994], [15.41235, 46.65556], [15.45514, 46.63697], [15.46906, 46.61321], [15.54431, 46.6312], [15.55333, 46.64988], [15.54533, 46.66985], [15.59826, 46.68908], [15.62317, 46.67947], [15.63255, 46.68069], [15.6365, 46.6894], [15.6543, 46.69228], [15.6543, 46.70616], [15.67411, 46.70735], [15.69523, 46.69823], [15.72279, 46.69548], [15.73823, 46.70011], [15.76771, 46.69863], [15.78518, 46.70712], [15.8162, 46.71897], [15.87691, 46.7211], [15.94864, 46.68769], [15.98512, 46.68463], [15.99988, 46.67947], [16.04036, 46.6549], [16.04347, 46.68694], [16.02808, 46.71094], [15.99769, 46.7266], [15.98432, 46.74991], [15.99126, 46.78199], [15.99054, 46.82772], [16.05786, 46.83927], [16.10983, 46.867], [16.19904, 46.94134], [16.22403, 46.939], [16.27594, 46.9643], [16.28202, 47.00159], [16.51369, 47.00084], [16.43936, 47.03548], [16.52176, 47.05747], [16.46134, 47.09395], [16.52863, 47.13974], [16.44932, 47.14418], [16.46442, 47.16845], [16.4523, 47.18812], [16.42801, 47.18422], [16.41739, 47.20649], [16.43663, 47.21127], [16.44142, 47.25079], [16.47782, 47.25918], [16.45104, 47.41181], [16.49908, 47.39416], [16.52414, 47.41007], [16.57152, 47.40868], [16.6718, 47.46139], [16.64821, 47.50155], [16.71059, 47.52692], [16.64193, 47.63114], [16.58699, 47.61772], [16.4222, 47.66537], [16.55129, 47.72268], [16.53514, 47.73837], [16.54779, 47.75074], [16.61183, 47.76171], [16.65679, 47.74197], [16.72089, 47.73469], [16.7511, 47.67878], [16.82938, 47.68432], [16.86509, 47.72268], [16.87538, 47.68895], [17.08893, 47.70928], [17.05048, 47.79377], [17.07039, 47.81129], [17.00997, 47.86245], [17.08275, 47.87719], [17.11022, 47.92461], [17.09786, 47.97336], [17.16001, 48.00636], [17.07039, 48.0317], [17.09168, 48.09366], [17.05735, 48.14179], [17.02919, 48.13996], [16.97701, 48.17385], [16.89461, 48.31332], [16.90903, 48.32519], [16.84243, 48.35258], [16.83317, 48.38138], [16.83588, 48.3844], [16.8497, 48.38321], [16.85204, 48.44968], [16.94611, 48.53614], [16.93955, 48.60371], [16.90354, 48.71541], [16.79779, 48.70998], [16.71883, 48.73806], [16.68518, 48.7281], [16.67008, 48.77699], [16.46134, 48.80865], [16.40915, 48.74576], [16.37345, 48.729], [16.06034, 48.75436], [15.84404, 48.86921], [15.78087, 48.87644], [15.75341, 48.8516], [15.6921, 48.85973], [15.61622, 48.89541], [15.51357, 48.91549], [15.48027, 48.94481], [15.34823, 48.98444]]]] } },
23207 { type: "Feature", properties: { iso1A2: "AU", iso1A3: "AUS", iso1N3: "036", wikidata: "Q408", nameEn: "Australia" }, geometry: null },
23208 { type: "Feature", properties: { iso1A2: "AW", iso1A3: "ABW", iso1N3: "533", wikidata: "Q21203", nameEn: "Aruba", aliases: ["NL-AW"], country: "NL", groups: ["Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["297"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-70.00823, 12.98375], [-70.35625, 12.58277], [-69.60231, 12.17], [-70.00823, 12.98375]]]] } },
23209 { type: "Feature", properties: { iso1A2: "AX", iso1A3: "ALA", iso1N3: "248", wikidata: "Q5689", nameEn: "\xC5land Islands", country: "FI", groups: ["EU", "154", "150", "UN"], callingCodes: ["358 18", "358 457"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.08191, 60.19152], [20.5104, 59.15546], [21.35468, 59.67511], [21.02509, 60.12142], [21.08159, 60.20167], [21.15143, 60.54555], [20.96741, 60.71528], [19.23413, 60.61414], [19.08191, 60.19152]]]] } },
23210 { type: "Feature", properties: { iso1A2: "AZ", iso1A3: "AZE", iso1N3: "031", wikidata: "Q227", nameEn: "Azerbaijan", groups: ["145", "142", "UN"], callingCodes: ["994"] }, geometry: { type: "MultiPolygon", coordinates: [[[[46.42738, 41.91323], [46.3984, 41.84399], [46.30863, 41.79133], [46.23962, 41.75811], [46.20538, 41.77205], [46.17891, 41.72094], [46.19759, 41.62327], [46.24429, 41.59883], [46.26531, 41.63339], [46.28182, 41.60089], [46.3253, 41.60912], [46.34039, 41.5947], [46.34126, 41.57454], [46.29794, 41.5724], [46.33925, 41.4963], [46.40307, 41.48464], [46.4669, 41.43331], [46.63658, 41.37727], [46.72375, 41.28609], [46.66148, 41.20533], [46.63969, 41.09515], [46.55096, 41.1104], [46.48558, 41.0576], [46.456, 41.09984], [46.37661, 41.10805], [46.27698, 41.19011], [46.13221, 41.19479], [45.95786, 41.17956], [45.80842, 41.2229], [45.69946, 41.29545], [45.75705, 41.35157], [45.71035, 41.36208], [45.68389, 41.3539], [45.45973, 41.45898], [45.4006, 41.42402], [45.31352, 41.47168], [45.26285, 41.46433], [45.1797, 41.42231], [45.09867, 41.34065], [45.0133, 41.29747], [45.05497, 41.2464], [45.02932, 41.2101], [45.05201, 41.19211], [45.11811, 41.19967], [45.1969, 41.168], [45.19942, 41.13299], [45.08028, 41.10917], [45.06784, 41.05379], [45.12923, 41.06059], [45.1313, 41.09369], [45.1634, 41.08082], [45.16493, 41.05068], [45.1994, 41.04518], [45.25897, 41.0027], [45.26162, 41.0228], [45.28859, 41.03757], [45.35677, 40.99784], [45.39725, 41.02603], [45.44083, 41.01663], [45.40814, 40.97904], [45.60584, 40.87436], [45.55914, 40.78366], [45.4206, 40.7424], [45.35366, 40.65979], [45.45484, 40.57707], [45.42994, 40.53804], [45.65098, 40.37696], [45.95609, 40.27846], [45.97944, 40.181], [45.83779, 39.98925], [45.78642, 40.03218], [45.59806, 40.0131], [45.60895, 39.97733], [45.7833, 39.9475], [45.82533, 39.82925], [45.96543, 39.78859], [46.18493, 39.60533], [46.40286, 39.63651], [46.42465, 39.57534], [46.52117, 39.58734], [46.57098, 39.56694], [46.57721, 39.54414], [46.51027, 39.52373], [46.53051, 39.47809], [46.4013, 39.45405], [46.37795, 39.42039], [46.43244, 39.35181], [46.50093, 39.33736], [46.56476, 39.24942], [46.63481, 39.23013], [46.58032, 39.21204], [46.54141, 39.15895], [46.52584, 39.18912], [46.44022, 39.19636], [46.54296, 39.07078], [46.51805, 38.94982], [46.53497, 38.86548], [46.75752, 39.03231], [46.83822, 39.13143], [46.92539, 39.16644], [46.95341, 39.13505], [47.05771, 39.20143], [47.05927, 39.24846], [47.31301, 39.37492], [47.38978, 39.45999], [47.50099, 39.49615], [47.84774, 39.66285], [47.98977, 39.70999], [48.34264, 39.42935], [48.37385, 39.37584], [48.15984, 39.30028], [48.12404, 39.25208], [48.15361, 39.19419], [48.31239, 39.09278], [48.33884, 39.03022], [48.28437, 38.97186], [48.08627, 38.94434], [48.07734, 38.91616], [48.01409, 38.90333], [48.02581, 38.82705], [48.24773, 38.71883], [48.3146, 38.59958], [48.45084, 38.61013], [48.58793, 38.45076], [48.62217, 38.40198], [48.70001, 38.40564], [48.78979, 38.45026], [48.81072, 38.44853], [48.84969, 38.45015], [48.88288, 38.43975], [52.39847, 39.43556], [48.80971, 41.95365], [48.5867, 41.84306], [48.55078, 41.77917], [48.42301, 41.65444], [48.40277, 41.60441], [48.2878, 41.56221], [48.22064, 41.51472], [48.07587, 41.49957], [47.87973, 41.21798], [47.75831, 41.19455], [47.62288, 41.22969], [47.54504, 41.20275], [47.49004, 41.26366], [47.34579, 41.27884], [47.10762, 41.59044], [47.03757, 41.55434], [46.99554, 41.59743], [47.00955, 41.63583], [46.8134, 41.76252], [46.75269, 41.8623], [46.58924, 41.80547], [46.5332, 41.87389], [46.42738, 41.91323]], [[45.50279, 40.58424], [45.47927, 40.65023], [45.51825, 40.67382], [45.56071, 40.64765], [45.50279, 40.58424]]], [[[45.00864, 41.03411], [45.03792, 41.03938], [45.04517, 41.06653], [45.03406, 41.07931], [45.00864, 41.09407], [44.97169, 41.09176], [44.95383, 41.07553], [44.96031, 41.06345], [44.9903, 41.05657], [45.00864, 41.03411]]], [[[45.21324, 40.9817], [45.23095, 40.97828], [45.23487, 41.00226], [45.20625, 41.01484], [45.18382, 41.0066], [45.19312, 40.98998], [45.20518, 40.99348], [45.21219, 40.99001], [45.21324, 40.9817]]], [[[45.46992, 39.49888], [45.29606, 39.57654], [45.30385, 39.61373], [45.23535, 39.61373], [45.21784, 39.58074], [45.17464, 39.58614], [45.18554, 39.67846], [45.06604, 39.79277], [44.92869, 39.72157], [44.88354, 39.74432], [44.75779, 39.7148], [44.80977, 39.65768], [44.81043, 39.62677], [44.88916, 39.59653], [44.96746, 39.42998], [45.05932, 39.36435], [45.08751, 39.35052], [45.16168, 39.21952], [45.30489, 39.18333], [45.40148, 39.09007], [45.40452, 39.07224], [45.44811, 39.04927], [45.44966, 38.99243], [45.6131, 38.964], [45.6155, 38.94304], [45.65172, 38.95199], [45.83883, 38.90768], [45.90266, 38.87739], [45.94624, 38.89072], [46.00228, 38.87376], [46.06766, 38.87861], [46.14785, 38.84206], [46.06973, 39.0744], [46.02303, 39.09978], [45.99774, 39.28931], [45.79225, 39.3695], [45.83, 39.46487], [45.80804, 39.56716], [45.70547, 39.60174], [45.46992, 39.49888]]]] } },
23211 { type: "Feature", properties: { iso1A2: "BA", iso1A3: "BIH", iso1N3: "070", wikidata: "Q225", nameEn: "Bosnia and Herzegovina", groups: ["039", "150", "UN"], callingCodes: ["387"] }, geometry: { type: "MultiPolygon", coordinates: [[[[17.84826, 45.04489], [17.66571, 45.13408], [17.59104, 45.10816], [17.51469, 45.10791], [17.47589, 45.12656], [17.45615, 45.12523], [17.4498, 45.16119], [17.41229, 45.13335], [17.33573, 45.14521], [17.32092, 45.16246], [17.26815, 45.18444], [17.25131, 45.14957], [17.24325, 45.146], [17.18438, 45.14764], [17.0415, 45.20759], [16.9385, 45.22742], [16.92405, 45.27607], [16.83804, 45.18951], [16.81137, 45.18434], [16.78219, 45.19002], [16.74845, 45.20393], [16.64962, 45.20714], [16.60194, 45.23042], [16.56559, 45.22307], [16.5501, 45.2212], [16.52982, 45.22713], [16.49155, 45.21153], [16.4634, 45.14522], [16.40023, 45.1147], [16.38309, 45.05955], [16.38219, 45.05139], [16.3749, 45.05206], [16.35863, 45.03529], [16.35404, 45.00241], [16.29036, 44.99732], [16.12153, 45.09616], [15.98412, 45.23088], [15.83512, 45.22459], [15.76371, 45.16508], [15.78842, 45.11519], [15.74585, 45.0638], [15.78568, 44.97401], [15.74723, 44.96818], [15.76096, 44.87045], [15.79472, 44.8455], [15.72584, 44.82334], [15.8255, 44.71501], [15.89348, 44.74964], [16.05828, 44.61538], [16.00884, 44.58605], [16.03012, 44.55572], [16.10566, 44.52586], [16.16814, 44.40679], [16.12969, 44.38275], [16.21346, 44.35231], [16.18688, 44.27012], [16.36864, 44.08263], [16.43662, 44.07523], [16.43629, 44.02826], [16.50528, 44.0244], [16.55472, 43.95326], [16.70922, 43.84887], [16.75316, 43.77157], [16.80736, 43.76011], [17.00585, 43.58037], [17.15828, 43.49376], [17.24411, 43.49376], [17.29699, 43.44542], [17.25579, 43.40353], [17.286, 43.33065], [17.46986, 43.16559], [17.64268, 43.08595], [17.70879, 42.97223], [17.5392, 42.92787], [17.6444, 42.88641], [17.68151, 42.92725], [17.7948, 42.89556], [17.80854, 42.9182], [17.88201, 42.83668], [18.24318, 42.6112], [18.36197, 42.61423], [18.43735, 42.55921], [18.49778, 42.58409], [18.53751, 42.57376], [18.55504, 42.58409], [18.52232, 42.62279], [18.57373, 42.64429], [18.54841, 42.68328], [18.54603, 42.69171], [18.55221, 42.69045], [18.56789, 42.72074], [18.47324, 42.74992], [18.45921, 42.81682], [18.47633, 42.85829], [18.4935, 42.86433], [18.49661, 42.89306], [18.49076, 42.95553], [18.52232, 43.01451], [18.66254, 43.03928], [18.64735, 43.14766], [18.66605, 43.2056], [18.71747, 43.2286], [18.6976, 43.25243], [18.76538, 43.29838], [18.85342, 43.32426], [18.84794, 43.33735], [18.83912, 43.34795], [18.90911, 43.36383], [18.95819, 43.32899], [18.95001, 43.29327], [19.00844, 43.24988], [19.04233, 43.30008], [19.08206, 43.29668], [19.08673, 43.31453], [19.04071, 43.397], [19.01078, 43.43854], [18.96053, 43.45042], [18.95469, 43.49367], [18.91379, 43.50299], [19.01078, 43.55806], [19.04934, 43.50384], [19.13933, 43.5282], [19.15685, 43.53943], [19.22807, 43.5264], [19.24774, 43.53061], [19.2553, 43.5938], [19.33426, 43.58833], [19.36653, 43.60921], [19.41941, 43.54056], [19.42696, 43.57987], [19.50455, 43.58385], [19.5176, 43.71403], [19.3986, 43.79668], [19.23465, 43.98764], [19.24363, 44.01502], [19.38439, 43.96611], [19.52515, 43.95573], [19.56498, 43.99922], [19.61836, 44.01464], [19.61991, 44.05254], [19.57467, 44.04716], [19.55999, 44.06894], [19.51167, 44.08158], [19.47321, 44.1193], [19.48386, 44.14332], [19.47338, 44.15034], [19.43905, 44.13088], [19.40927, 44.16722], [19.3588, 44.18353], [19.34773, 44.23244], [19.32464, 44.27185], [19.26945, 44.26957], [19.23306, 44.26097], [19.20508, 44.2917], [19.18328, 44.28383], [19.16741, 44.28648], [19.13332, 44.31492], [19.13556, 44.338], [19.11547, 44.34218], [19.1083, 44.3558], [19.11865, 44.36712], [19.10298, 44.36924], [19.10365, 44.37795], [19.10704, 44.38249], [19.10749, 44.39421], [19.11785, 44.40313], [19.14681, 44.41463], [19.14837, 44.45253], [19.12278, 44.50132], [19.13369, 44.52521], [19.16699, 44.52197], [19.26388, 44.65412], [19.32543, 44.74058], [19.36722, 44.88164], [19.18183, 44.92055], [19.01994, 44.85493], [18.8704, 44.85097], [18.76347, 44.90669], [18.76369, 44.93707], [18.80661, 44.93561], [18.78357, 44.97741], [18.65723, 45.07544], [18.47939, 45.05871], [18.41896, 45.11083], [18.32077, 45.1021], [18.24387, 45.13699], [18.1624, 45.07654], [18.03121, 45.12632], [18.01594, 45.15163], [17.99479, 45.14958], [17.97834, 45.13831], [17.97336, 45.12245], [17.93706, 45.08016], [17.87148, 45.04645], [17.84826, 45.04489]]]] } },
23212 { type: "Feature", properties: { iso1A2: "BB", iso1A3: "BRB", iso1N3: "052", wikidata: "Q244", nameEn: "Barbados", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", callingCodes: ["1 246"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-58.56442, 13.24471], [-59.80731, 13.87556], [-59.82929, 12.70644], [-58.56442, 13.24471]]]] } },
23213 { type: "Feature", properties: { iso1A2: "BD", iso1A3: "BGD", iso1N3: "050", wikidata: "Q902", nameEn: "Bangladesh", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["880"] }, geometry: { type: "MultiPolygon", coordinates: [[[[89.15869, 26.13708], [89.08899, 26.38845], [88.95612, 26.4564], [88.92357, 26.40711], [88.91321, 26.37984], [89.05328, 26.2469], [88.85004, 26.23211], [88.78961, 26.31093], [88.67837, 26.26291], [88.69485, 26.38353], [88.62144, 26.46783], [88.4298, 26.54489], [88.41196, 26.63837], [88.33093, 26.48929], [88.35153, 26.45241], [88.36938, 26.48683], [88.48749, 26.45855], [88.51649, 26.35923], [88.35153, 26.29123], [88.34757, 26.22216], [88.1844, 26.14417], [88.16581, 26.0238], [88.08804, 25.91334], [88.13138, 25.78773], [88.242, 25.80811], [88.45103, 25.66245], [88.4559, 25.59227], [88.677, 25.46959], [88.81296, 25.51546], [88.85278, 25.34679], [89.01105, 25.30303], [89.00463, 25.26583], [88.94067, 25.18534], [88.44766, 25.20149], [88.46277, 25.07468], [88.33917, 24.86803], [88.27325, 24.88796], [88.21832, 24.96642], [88.14004, 24.93529], [88.15515, 24.85806], [88.00683, 24.66477], [88.08786, 24.63232], [88.12296, 24.51301], [88.50934, 24.32474], [88.68801, 24.31464], [88.74841, 24.1959], [88.6976, 24.14703], [88.73743, 23.91751], [88.66189, 23.87607], [88.58087, 23.87105], [88.56507, 23.64044], [88.74841, 23.47361], [88.79351, 23.50535], [88.79254, 23.46028], [88.71133, 23.2492], [88.99148, 23.21134], [88.86377, 23.08759], [88.88327, 23.03885], [88.87063, 22.95235], [88.96713, 22.83346], [88.9151, 22.75228], [88.94614, 22.66941], [88.9367, 22.58527], [89.07114, 22.15335], [89.08044, 21.41871], [92.47409, 20.38654], [92.26071, 21.05697], [92.17752, 21.17445], [92.20087, 21.337], [92.37939, 21.47764], [92.43158, 21.37025], [92.55105, 21.3856], [92.60187, 21.24615], [92.68152, 21.28454], [92.59775, 21.6092], [92.62187, 21.87037], [92.60949, 21.97638], [92.56616, 22.13554], [92.60029, 22.1522], [92.5181, 22.71441], [92.37665, 22.9435], [92.38214, 23.28705], [92.26541, 23.70392], [92.15417, 23.73409], [92.04706, 23.64229], [91.95093, 23.73284], [91.95642, 23.47361], [91.84789, 23.42235], [91.76417, 23.26619], [91.81634, 23.08001], [91.7324, 23.00043], [91.61571, 22.93929], [91.54993, 23.01051], [91.46615, 23.2328], [91.4035, 23.27522], [91.40848, 23.07117], [91.36453, 23.06612], [91.28293, 23.37538], [91.15579, 23.6599], [91.25192, 23.83463], [91.22308, 23.89616], [91.29587, 24.0041], [91.35741, 23.99072], [91.37414, 24.10693], [91.55542, 24.08687], [91.63782, 24.1132], [91.65292, 24.22095], [91.73257, 24.14703], [91.76004, 24.23848], [91.82596, 24.22345], [91.89258, 24.14674], [91.96603, 24.3799], [92.11662, 24.38997], [92.15796, 24.54435], [92.25854, 24.9191], [92.38626, 24.86055], [92.49887, 24.88796], [92.39147, 25.01471], [92.33957, 25.07593], [92.0316, 25.1834], [91.63648, 25.12846], [91.25517, 25.20677], [90.87427, 25.15799], [90.65042, 25.17788], [90.40034, 25.1534], [90.1155, 25.22686], [89.90478, 25.31038], [89.87629, 25.28337], [89.83371, 25.29548], [89.84086, 25.31854], [89.81208, 25.37244], [89.86129, 25.61714], [89.84388, 25.70042], [89.80585, 25.82489], [89.86592, 25.93115], [89.77728, 26.04254], [89.77865, 26.08387], [89.73581, 26.15818], [89.70201, 26.15138], [89.63968, 26.22595], [89.57101, 25.9682], [89.53515, 26.00382], [89.35953, 26.0077], [89.15869, 26.13708]]]] } },
23214 { type: "Feature", properties: { iso1A2: "BE", iso1A3: "BEL", iso1N3: "056", wikidata: "Q31", nameEn: "Belgium", groups: ["EU", "155", "150", "UN"], callingCodes: ["32"] }, geometry: { type: "MultiPolygon", coordinates: [[[[4.93295, 51.44945], [4.93909, 51.44632], [4.9524, 51.45014], [4.95244, 51.45207], [4.93295, 51.44945]]], [[[4.91493, 51.4353], [4.92652, 51.43329], [4.92952, 51.42984], [4.93986, 51.43064], [4.94265, 51.44003], [4.93471, 51.43861], [4.93416, 51.44185], [4.94025, 51.44193], [4.93544, 51.44634], [4.92879, 51.44161], [4.92815, 51.43856], [4.92566, 51.44273], [4.92811, 51.4437], [4.92287, 51.44741], [4.91811, 51.44621], [4.92227, 51.44252], [4.91935, 51.43634], [4.91493, 51.4353]]], [[[4.82946, 51.4213], [4.82409, 51.44736], [4.84139, 51.4799], [4.78803, 51.50284], [4.77321, 51.50529], [4.74578, 51.48937], [4.72935, 51.48424], [4.65442, 51.42352], [4.57489, 51.4324], [4.53521, 51.4243], [4.52846, 51.45002], [4.54675, 51.47265], [4.5388, 51.48184], [4.47736, 51.4778], [4.38122, 51.44905], [4.39747, 51.43316], [4.38064, 51.41965], [4.43777, 51.36989], [4.39292, 51.35547], [4.34086, 51.35738], [4.33265, 51.37687], [4.21923, 51.37443], [4.24024, 51.35371], [4.16721, 51.29348], [4.05165, 51.24171], [4.01957, 51.24504], [3.97889, 51.22537], [3.90125, 51.20371], [3.78783, 51.2151], [3.78999, 51.25766], [3.58939, 51.30064], [3.51502, 51.28697], [3.52698, 51.2458], [3.43488, 51.24135], [3.41704, 51.25933], [3.38289, 51.27331], [3.35847, 51.31572], [3.38696, 51.33436], [3.36263, 51.37112], [2.56575, 51.85301], [2.18458, 51.52087], [2.55904, 51.07014], [2.57551, 51.00326], [2.63074, 50.94746], [2.59093, 50.91751], [2.63331, 50.81457], [2.71165, 50.81295], [2.81056, 50.71773], [2.8483, 50.72276], [2.86985, 50.7033], [2.87937, 50.70298], [2.88504, 50.70656], [2.90069, 50.69263], [2.91036, 50.6939], [2.90873, 50.702], [2.95019, 50.75138], [2.96778, 50.75242], [3.00537, 50.76588], [3.04314, 50.77674], [3.09163, 50.77717], [3.10614, 50.78303], [3.11206, 50.79416], [3.11987, 50.79188], [3.1257, 50.78603], [3.15017, 50.79031], [3.16476, 50.76843], [3.18339, 50.74981], [3.18811, 50.74025], [3.20064, 50.73547], [3.19017, 50.72569], [3.20845, 50.71662], [3.22042, 50.71019], [3.24593, 50.71389], [3.26063, 50.70086], [3.26141, 50.69151], [3.2536, 50.68977], [3.264, 50.67668], [3.23951, 50.6585], [3.2729, 50.60718], [3.28575, 50.52724], [3.37693, 50.49538], [3.44629, 50.51009], [3.47385, 50.53397], [3.51564, 50.5256], [3.49509, 50.48885], [3.5683, 50.50192], [3.58361, 50.49049], [3.61014, 50.49568], [3.64426, 50.46275], [3.66153, 50.45165], [3.67494, 50.40239], [3.67262, 50.38663], [3.65709, 50.36873], [3.66976, 50.34563], [3.71009, 50.30305], [3.70987, 50.3191], [3.73911, 50.34809], [3.84314, 50.35219], [3.90781, 50.32814], [3.96771, 50.34989], [4.0268, 50.35793], [4.0689, 50.3254], [4.10237, 50.31247], [4.10957, 50.30234], [4.11954, 50.30425], [4.13665, 50.25609], [4.16808, 50.25786], [4.15524, 50.2833], [4.17347, 50.28838], [4.17861, 50.27443], [4.20651, 50.27333], [4.21945, 50.25539], [4.15524, 50.21103], [4.16014, 50.19239], [4.13561, 50.13078], [4.20147, 50.13535], [4.23101, 50.06945], [4.16294, 50.04719], [4.13508, 50.01976], [4.14239, 49.98034], [4.20532, 49.95803], [4.31963, 49.97043], [4.35051, 49.95315], [4.43488, 49.94122], [4.51098, 49.94659], [4.5414, 49.96911], [4.68695, 49.99685], [4.70064, 50.09384], [4.75237, 50.11314], [4.82438, 50.16878], [4.83279, 50.15331], [4.88602, 50.15182], [4.8382, 50.06738], [4.78827, 49.95609], [4.88529, 49.9236], [4.85134, 49.86457], [4.86965, 49.82271], [4.85464, 49.78995], [4.96714, 49.79872], [5.09249, 49.76193], [5.14545, 49.70287], [5.26232, 49.69456], [5.31465, 49.66846], [5.33039, 49.6555], [5.30214, 49.63055], [5.3137, 49.61225], [5.33851, 49.61599], [5.34837, 49.62889], [5.3974, 49.61596], [5.43713, 49.5707], [5.46734, 49.52648], [5.46541, 49.49825], [5.55001, 49.52729], [5.60909, 49.51228], [5.64505, 49.55146], [5.75649, 49.54321], [5.7577, 49.55915], [5.77435, 49.56298], [5.79195, 49.55228], [5.81838, 49.54777], [5.84143, 49.5533], [5.84692, 49.55663], [5.8424, 49.56082], [5.87256, 49.57539], [5.86986, 49.58756], [5.84971, 49.58674], [5.84826, 49.5969], [5.8762, 49.60898], [5.87609, 49.62047], [5.88393, 49.62802], [5.88552, 49.63507], [5.90599, 49.63853], [5.90164, 49.6511], [5.9069, 49.66377], [5.86175, 49.67862], [5.86527, 49.69291], [5.88677, 49.70951], [5.86503, 49.72739], [5.84193, 49.72161], [5.82562, 49.72395], [5.83149, 49.74729], [5.82245, 49.75048], [5.78871, 49.7962], [5.75409, 49.79239], [5.74953, 49.81428], [5.74364, 49.82058], [5.74844, 49.82435], [5.7404, 49.83452], [5.74076, 49.83823], [5.74975, 49.83933], [5.74953, 49.84709], [5.75884, 49.84811], [5.74567, 49.85368], [5.75861, 49.85631], [5.75269, 49.8711], [5.78415, 49.87922], [5.73621, 49.89796], [5.77314, 49.93646], [5.77291, 49.96056], [5.80833, 49.96451], [5.81163, 49.97142], [5.83467, 49.97823], [5.83968, 49.9892], [5.82331, 49.99662], [5.81866, 50.01286], [5.8551, 50.02683], [5.86904, 50.04614], [5.85474, 50.06342], [5.8857, 50.07824], [5.89488, 50.11476], [5.95929, 50.13295], [5.96453, 50.17259], [6.02488, 50.18283], [6.03093, 50.16362], [6.06406, 50.15344], [6.08577, 50.17246], [6.12028, 50.16374], [6.1137, 50.13668], [6.1379, 50.12964], [6.15298, 50.14126], [6.14132, 50.14971], [6.14588, 50.17106], [6.18739, 50.1822], [6.18364, 50.20815], [6.16853, 50.2234], [6.208, 50.25179], [6.28797, 50.27458], [6.29949, 50.30887], [6.32488, 50.32333], [6.35701, 50.31139], [6.40641, 50.32425], [6.40785, 50.33557], [6.3688, 50.35898], [6.34406, 50.37994], [6.36852, 50.40776], [6.37219, 50.45397], [6.34005, 50.46083], [6.3465, 50.48833], [6.30809, 50.50058], [6.26637, 50.50272], [6.22335, 50.49578], [6.20599, 50.52089], [6.19193, 50.5212], [6.18716, 50.52653], [6.19579, 50.5313], [6.19735, 50.53576], [6.17802, 50.54179], [6.17739, 50.55875], [6.20281, 50.56952], [6.22581, 50.5907], [6.24005, 50.58732], [6.24888, 50.59869], [6.2476, 50.60392], [6.26957, 50.62444], [6.17852, 50.6245], [6.11707, 50.72231], [6.04428, 50.72861], [6.0406, 50.71848], [6.0326, 50.72647], [6.03889, 50.74618], [6.01976, 50.75398], [5.97545, 50.75441], [5.95942, 50.7622], [5.89132, 50.75124], [5.89129, 50.75125], [5.88734, 50.77092], [5.84888, 50.75448], [5.84548, 50.76542], [5.80673, 50.7558], [5.77513, 50.78308], [5.76533, 50.78159], [5.74356, 50.7691], [5.73904, 50.75674], [5.72216, 50.76398], [5.69469, 50.75529], [5.68091, 50.75804], [5.70107, 50.7827], [5.68995, 50.79641], [5.70118, 50.80764], [5.65259, 50.82309], [5.64009, 50.84742], [5.64504, 50.87107], [5.67886, 50.88142], [5.69858, 50.91046], [5.71626, 50.90796], [5.72644, 50.91167], [5.72545, 50.92312], [5.74644, 50.94723], [5.75927, 50.95601], [5.74752, 50.96202], [5.72875, 50.95428], [5.71864, 50.96092], [5.76242, 50.99703], [5.77688, 51.02483], [5.75961, 51.03113], [5.77258, 51.06196], [5.79835, 51.05834], [5.79903, 51.09371], [5.82921, 51.09328], [5.83226, 51.10585], [5.8109, 51.10861], [5.80798, 51.11661], [5.85508, 51.14445], [5.82564, 51.16753], [5.77697, 51.1522], [5.77735, 51.17845], [5.74617, 51.18928], [5.70344, 51.1829], [5.65528, 51.18736], [5.65145, 51.19788], [5.5603, 51.22249], [5.5569, 51.26544], [5.515, 51.29462], [5.48476, 51.30053], [5.46519, 51.2849], [5.4407, 51.28169], [5.41672, 51.26248], [5.347, 51.27502], [5.33886, 51.26314], [5.29716, 51.26104], [5.26461, 51.26693], [5.23814, 51.26064], [5.22542, 51.26888], [5.24244, 51.30495], [5.2002, 51.32243], [5.16222, 51.31035], [5.13377, 51.31592], [5.13105, 51.34791], [5.07102, 51.39469], [5.10456, 51.43163], [5.07891, 51.4715], [5.04774, 51.47022], [5.03281, 51.48679], [5.0106, 51.47167], [5.00393, 51.44406], [4.92152, 51.39487], [4.90016, 51.41404], [4.84988, 51.41502], [4.78941, 51.41102], [4.77229, 51.41337], [4.76577, 51.43046], [4.78314, 51.43319], [4.82946, 51.4213]]]] } },
23215 { type: "Feature", properties: { iso1A2: "BF", iso1A3: "BFA", iso1N3: "854", wikidata: "Q965", nameEn: "Burkina Faso", groups: ["011", "202", "002", "UN"], callingCodes: ["226"] }, geometry: { type: "MultiPolygon", coordinates: [[[[0.23859, 15.00135], [0.06588, 14.96961], [-0.24673, 15.07805], [-0.72004, 15.08655], [-1.05875, 14.7921], [-1.32166, 14.72774], [-1.68083, 14.50023], [-1.97945, 14.47709], [-1.9992, 14.19011], [-2.10223, 14.14878], [-2.47587, 14.29671], [-2.66175, 14.14713], [-2.84667, 14.05532], [-2.90831, 13.81174], [-2.88189, 13.64921], [-3.26407, 13.70699], [-3.28396, 13.5422], [-3.23599, 13.29035], [-3.43507, 13.27272], [-3.4313, 13.1588], [-3.54454, 13.1781], [-3.7911, 13.36665], [-3.96282, 13.38164], [-3.90558, 13.44375], [-3.96501, 13.49778], [-4.34477, 13.12927], [-4.21819, 12.95722], [-4.238, 12.71467], [-4.47356, 12.71252], [-4.41412, 12.31922], [-4.57703, 12.19875], [-4.54841, 12.1385], [-4.62546, 12.13204], [-4.62987, 12.06531], [-4.70692, 12.06746], [-4.72893, 12.01579], [-5.07897, 11.97918], [-5.26389, 11.84778], [-5.40258, 11.8327], [-5.26389, 11.75728], [-5.29251, 11.61715], [-5.22867, 11.60421], [-5.20665, 11.43811], [-5.25509, 11.36905], [-5.25949, 11.24816], [-5.32553, 11.21578], [-5.32994, 11.13371], [-5.49284, 11.07538], [-5.41579, 10.84628], [-5.47083, 10.75329], [-5.46643, 10.56074], [-5.51058, 10.43177], [-5.39602, 10.2929], [-5.12465, 10.29788], [-4.96453, 9.99923], [-4.96621, 9.89132], [-4.6426, 9.70696], [-4.31392, 9.60062], [-4.25999, 9.76012], [-3.69703, 9.94279], [-3.31779, 9.91125], [-3.27228, 9.84981], [-3.19306, 9.93781], [-3.16609, 9.85147], [-3.00765, 9.74019], [-2.93012, 9.57403], [-2.76494, 9.40778], [-2.68802, 9.49343], [-2.76534, 9.56589], [-2.74174, 9.83172], [-2.83108, 10.40252], [-2.94232, 10.64281], [-2.83373, 11.0067], [-0.67143, 10.99811], [-0.61937, 10.91305], [-0.44298, 11.04292], [-0.42391, 11.11661], [-0.38219, 11.12596], [-0.35955, 11.07801], [-0.28566, 11.12713], [-0.27374, 11.17157], [-0.13493, 11.14075], [0.50388, 11.01011], [0.48852, 10.98561], [0.50521, 10.98035], [0.4958, 10.93269], [0.66104, 10.99964], [0.91245, 10.99597], [0.9813, 11.08876], [1.03409, 11.04719], [1.42823, 11.46822], [2.00988, 11.42227], [2.29983, 11.68254], [2.39723, 11.89473], [2.05785, 12.35539], [2.26349, 12.41915], [0.99167, 13.10727], [0.99253, 13.37515], [1.18873, 13.31771], [1.21217, 13.37853], [1.24516, 13.33968], [1.28509, 13.35488], [1.24429, 13.39373], [1.20088, 13.38951], [1.02813, 13.46635], [0.99514, 13.5668], [0.77637, 13.64442], [0.77377, 13.6866], [0.61924, 13.68491], [0.38051, 14.05575], [0.16936, 14.51654], [0.23859, 15.00135]]]] } },
23216 { type: "Feature", properties: { iso1A2: "BG", iso1A3: "BGR", iso1N3: "100", wikidata: "Q219", nameEn: "Bulgaria", groups: ["EU", "151", "150", "UN"], callingCodes: ["359"] }, geometry: { type: "MultiPolygon", coordinates: [[[[23.05288, 43.79494], [22.85314, 43.84452], [22.83753, 43.88055], [22.87873, 43.9844], [23.01674, 44.01946], [23.04988, 44.07694], [22.67173, 44.21564], [22.61711, 44.16938], [22.61688, 44.06534], [22.41449, 44.00514], [22.35558, 43.81281], [22.41043, 43.69566], [22.47582, 43.6558], [22.53397, 43.47225], [22.82036, 43.33665], [22.89727, 43.22417], [23.00806, 43.19279], [22.98104, 43.11199], [22.89521, 43.03625], [22.78397, 42.98253], [22.74826, 42.88701], [22.54302, 42.87774], [22.43309, 42.82057], [22.4997, 42.74144], [22.43983, 42.56851], [22.55669, 42.50144], [22.51961, 42.3991], [22.47498, 42.3915], [22.45919, 42.33822], [22.34773, 42.31725], [22.38136, 42.30339], [22.47251, 42.20393], [22.50289, 42.19527], [22.51224, 42.15457], [22.67701, 42.06614], [22.86749, 42.02275], [22.90254, 41.87587], [22.96682, 41.77137], [23.01239, 41.76527], [23.03342, 41.71034], [22.95513, 41.63265], [22.96331, 41.35782], [22.93334, 41.34104], [23.1833, 41.31755], [23.21953, 41.33773], [23.22771, 41.37106], [23.31301, 41.40525], [23.33639, 41.36317], [23.40416, 41.39999], [23.52453, 41.40262], [23.63203, 41.37632], [23.67644, 41.41139], [23.76525, 41.40175], [23.80148, 41.43943], [23.89613, 41.45257], [23.91483, 41.47971], [23.96975, 41.44118], [24.06908, 41.46132], [24.06323, 41.53222], [24.10063, 41.54796], [24.18126, 41.51735], [24.27124, 41.57682], [24.30513, 41.51297], [24.52599, 41.56808], [24.61129, 41.42278], [24.71529, 41.41928], [24.8041, 41.34913], [24.82514, 41.4035], [24.86136, 41.39298], [24.90928, 41.40876], [24.942, 41.38685], [25.11611, 41.34212], [25.28322, 41.23411], [25.48187, 41.28506], [25.52394, 41.2798], [25.55082, 41.31667], [25.61042, 41.30614], [25.66183, 41.31316], [25.70507, 41.29209], [25.8266, 41.34563], [25.87919, 41.30526], [26.12926, 41.35878], [26.16548, 41.42278], [26.20288, 41.43943], [26.14796, 41.47533], [26.176, 41.50072], [26.17951, 41.55409], [26.14328, 41.55496], [26.15146, 41.60828], [26.07083, 41.64584], [26.06148, 41.70345], [26.16841, 41.74858], [26.21325, 41.73223], [26.22888, 41.74139], [26.2654, 41.71544], [26.30255, 41.70925], [26.35957, 41.71149], [26.32952, 41.73637], [26.33589, 41.76802], [26.36952, 41.82265], [26.53968, 41.82653], [26.57961, 41.90024], [26.56051, 41.92995], [26.62996, 41.97644], [26.79143, 41.97386], [26.95638, 42.00741], [27.03277, 42.0809], [27.08486, 42.08735], [27.19251, 42.06028], [27.22376, 42.10152], [27.27411, 42.10409], [27.45478, 41.96591], [27.52379, 41.93756], [27.55191, 41.90928], [27.69949, 41.97515], [27.81235, 41.94803], [27.83492, 41.99709], [27.91479, 41.97902], [28.02971, 41.98066], [28.32297, 41.98371], [29.24336, 43.70874], [28.23293, 43.76], [27.99558, 43.84193], [27.92008, 44.00761], [27.73468, 43.95326], [27.64542, 44.04958], [27.60834, 44.01206], [27.39757, 44.0141], [27.26845, 44.12602], [26.95141, 44.13555], [26.62712, 44.05698], [26.38764, 44.04356], [26.10115, 43.96908], [26.05584, 43.90925], [25.94911, 43.85745], [25.72792, 43.69263], [25.39528, 43.61866], [25.17144, 43.70261], [25.10718, 43.6831], [24.96682, 43.72693], [24.73542, 43.68523], [24.62281, 43.74082], [24.50264, 43.76314], [24.35364, 43.70211], [24.18149, 43.68218], [23.73978, 43.80627], [23.61687, 43.79289], [23.4507, 43.84936], [23.26772, 43.84843], [23.05288, 43.79494]]]] } },
23217 { type: "Feature", properties: { iso1A2: "BH", iso1A3: "BHR", iso1N3: "048", wikidata: "Q398", nameEn: "Bahrain", groups: ["145", "142", "UN"], callingCodes: ["973"] }, geometry: { type: "MultiPolygon", coordinates: [[[[50.93865, 26.30758], [50.71771, 26.73086], [50.38162, 26.53976], [50.26923, 26.08243], [50.302, 25.87592], [50.57069, 25.57887], [50.80824, 25.54641], [50.7801, 25.595], [50.86149, 25.6965], [50.81266, 25.88946], [50.93865, 26.30758]]]] } },
23218 { type: "Feature", properties: { iso1A2: "BI", iso1A3: "BDI", iso1N3: "108", wikidata: "Q967", nameEn: "Burundi", groups: ["014", "202", "002", "UN"], callingCodes: ["257"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.54501, -2.41404], [30.42933, -2.31064], [30.14034, -2.43626], [29.95911, -2.33348], [29.88237, -2.75105], [29.36805, -2.82933], [29.32234, -2.6483], [29.0562, -2.58632], [29.04081, -2.7416], [29.00167, -2.78523], [29.00404, -2.81978], [29.0505, -2.81774], [29.09119, -2.87871], [29.09797, -2.91935], [29.16037, -2.95457], [29.17258, -2.99385], [29.25633, -3.05471], [29.21463, -3.3514], [29.23708, -3.75856], [29.43673, -4.44845], [29.63827, -4.44681], [29.75109, -4.45836], [29.77289, -4.41733], [29.82885, -4.36153], [29.88172, -4.35743], [30.03323, -4.26631], [30.22042, -4.01738], [30.45915, -3.56532], [30.84165, -3.25152], [30.83823, -2.97837], [30.6675, -2.98987], [30.57926, -2.89791], [30.4987, -2.9573], [30.40662, -2.86151], [30.52747, -2.65841], [30.41789, -2.66266], [30.54501, -2.41404]]]] } },
23219 { type: "Feature", properties: { iso1A2: "BJ", iso1A3: "BEN", iso1N3: "204", wikidata: "Q962", nameEn: "Benin", aliases: ["DY"], groups: ["011", "202", "002", "UN"], callingCodes: ["229"] }, geometry: { type: "MultiPolygon", coordinates: [[[[3.59375, 11.70269], [3.48187, 11.86092], [3.31613, 11.88495], [3.25352, 12.01467], [2.83978, 12.40585], [2.6593, 12.30631], [2.37783, 12.24804], [2.39657, 12.10952], [2.45824, 11.98672], [2.39723, 11.89473], [2.29983, 11.68254], [2.00988, 11.42227], [1.42823, 11.46822], [1.03409, 11.04719], [0.9813, 11.08876], [0.91245, 10.99597], [0.8804, 10.803], [0.80358, 10.71459], [0.77666, 10.37665], [1.35507, 9.99525], [1.36624, 9.5951], [1.33675, 9.54765], [1.41746, 9.3226], [1.5649, 9.16941], [1.61838, 9.0527], [1.64249, 6.99562], [1.55877, 6.99737], [1.61812, 6.74843], [1.58105, 6.68619], [1.76906, 6.43189], [1.79826, 6.28221], [1.62913, 6.24075], [1.67336, 6.02702], [2.74181, 6.13349], [2.70566, 6.38038], [2.70464, 6.50831], [2.74334, 6.57291], [2.7325, 6.64057], [2.78204, 6.70514], [2.78823, 6.76356], [2.73405, 6.78508], [2.74024, 6.92802], [2.71702, 6.95722], [2.76965, 7.13543], [2.74489, 7.42565], [2.79442, 7.43486], [2.78668, 7.5116], [2.73405, 7.5423], [2.73095, 7.7755], [2.67523, 7.87825], [2.77907, 9.06924], [3.08017, 9.10006], [3.14147, 9.28375], [3.13928, 9.47167], [3.25093, 9.61632], [3.34726, 9.70696], [3.32099, 9.78032], [3.35383, 9.83641], [3.54429, 9.87739], [3.66908, 10.18136], [3.57275, 10.27185], [3.6844, 10.46351], [3.78292, 10.40538], [3.84243, 10.59316], [3.71505, 11.13015], [3.49175, 11.29765], [3.59375, 11.70269]]]] } },
23220 { type: "Feature", properties: { iso1A2: "BL", iso1A3: "BLM", iso1N3: "652", wikidata: "Q25362", nameEn: "Saint-Barth\xE9lemy", country: "FR", groups: ["EU", "Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["590"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.62718, 18.26185], [-63.1055, 17.86651], [-62.34423, 17.49165], [-62.62718, 18.26185]]]] } },
23221 { type: "Feature", properties: { iso1A2: "BM", iso1A3: "BMU", iso1N3: "060", wikidata: "Q23635", nameEn: "Bermuda", country: "GB", groups: ["BOTS", "021", "003", "019", "UN"], driveSide: "left", callingCodes: ["1 441"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.20987, 32.6953], [-65.31453, 32.68437], [-65.63955, 31.43417], [-63.20987, 32.6953]]]] } },
23222 { type: "Feature", properties: { iso1A2: "BN", iso1A3: "BRN", iso1N3: "096", wikidata: "Q921", nameEn: "Brunei", groups: ["Q36117", "035", "142", "UN"], driveSide: "left", callingCodes: ["673"] }, geometry: { type: "MultiPolygon", coordinates: [[[[115.16236, 5.01011], [115.02521, 5.35005], [114.10166, 4.76112], [114.07448, 4.58441], [114.15813, 4.57], [114.26876, 4.49878], [114.32176, 4.34942], [114.32176, 4.2552], [114.4416, 4.27588], [114.49922, 4.13108], [114.64211, 4.00694], [114.78539, 4.12205], [114.88039, 4.4257], [114.83189, 4.42387], [114.77303, 4.72871], [114.8266, 4.75062], [114.88841, 4.81905], [114.96982, 4.81146], [114.99417, 4.88201], [115.05038, 4.90275], [115.02955, 4.82087], [115.02278, 4.74137], [115.04064, 4.63706], [115.07737, 4.53418], [115.09978, 4.39123], [115.31275, 4.30806], [115.36346, 4.33563], [115.2851, 4.42295], [115.27819, 4.63661], [115.20737, 4.8256], [115.15092, 4.87604], [115.16236, 5.01011]]]] } },
23223 { type: "Feature", properties: { iso1A2: "BO", iso1A3: "BOL", iso1N3: "068", wikidata: "Q750", nameEn: "Bolivia", groups: ["005", "419", "019", "UN"], callingCodes: ["591"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.90248, -12.52544], [-64.22539, -12.45267], [-64.30708, -12.46398], [-64.99778, -11.98604], [-65.30027, -11.48749], [-65.28141, -10.86289], [-65.35402, -10.78685], [-65.37923, -10.35141], [-65.29019, -9.86253], [-65.40615, -9.63894], [-65.56244, -9.84266], [-65.68343, -9.75323], [-67.17784, -10.34016], [-68.71533, -11.14749], [-68.7651, -11.0496], [-68.75179, -11.03688], [-68.75265, -11.02383], [-68.74802, -11.00891], [-69.42792, -10.93451], [-69.47839, -10.95254], [-69.57156, -10.94555], [-68.98115, -11.8979], [-68.65044, -12.50689], [-68.85615, -12.87769], [-68.8864, -13.40792], [-69.05265, -13.68546], [-68.88135, -14.18639], [-69.36254, -14.94634], [-69.14856, -15.23478], [-69.40336, -15.61358], [-69.20291, -16.16668], [-69.09986, -16.22693], [-68.96238, -16.194], [-68.79464, -16.33272], [-68.98358, -16.42165], [-69.04027, -16.57214], [-69.00853, -16.66769], [-69.16896, -16.72233], [-69.62883, -17.28142], [-69.46863, -17.37466], [-69.46897, -17.4988], [-69.46623, -17.60518], [-69.34126, -17.72753], [-69.28671, -17.94844], [-69.07496, -18.03715], [-69.14807, -18.16893], [-69.07432, -18.28259], [-68.94987, -18.93302], [-68.87082, -19.06003], [-68.80602, -19.08355], [-68.61989, -19.27584], [-68.41218, -19.40499], [-68.66761, -19.72118], [-68.54611, -19.84651], [-68.57132, -20.03134], [-68.74273, -20.08817], [-68.7276, -20.46178], [-68.44023, -20.62701], [-68.55383, -20.7355], [-68.53957, -20.91542], [-68.40403, -20.94562], [-68.18816, -21.28614], [-67.85114, -22.87076], [-67.54284, -22.89771], [-67.18382, -22.81525], [-66.7298, -22.23644], [-66.29714, -22.08741], [-66.24077, -21.77837], [-66.03836, -21.84829], [-66.04832, -21.9187], [-65.9261, -21.93335], [-65.7467, -22.10105], [-65.61166, -22.09504], [-65.58694, -22.09794], [-65.57743, -22.07675], [-65.47435, -22.08908], [-64.99524, -22.08255], [-64.90014, -22.12136], [-64.67174, -22.18957], [-64.58888, -22.25035], [-64.4176, -22.67692], [-64.35108, -22.73282], [-64.31489, -22.88824], [-64.22918, -22.55807], [-63.93287, -21.99934], [-63.70963, -21.99934], [-63.68113, -22.0544], [-63.66482, -21.99918], [-62.81124, -21.9987], [-62.8078, -22.12534], [-62.64455, -22.25091], [-62.2757, -21.06657], [-62.26883, -20.55311], [-61.93912, -20.10053], [-61.73723, -19.63958], [-60.00638, -19.2981], [-59.06965, -19.29148], [-58.23216, -19.80058], [-58.16225, -20.16193], [-57.8496, -19.98346], [-58.14215, -19.76276], [-57.78463, -19.03259], [-57.71113, -19.03161], [-57.69134, -19.00544], [-57.71995, -18.97546], [-57.71995, -18.89573], [-57.76764, -18.90087], [-57.56807, -18.25655], [-57.48237, -18.24219], [-57.69877, -17.8431], [-57.73949, -17.56095], [-57.90082, -17.44555], [-57.99661, -17.5273], [-58.32935, -17.28195], [-58.5058, -16.80958], [-58.30918, -16.3699], [-58.32431, -16.25861], [-58.41506, -16.32636], [-60.16069, -16.26479], [-60.23797, -15.50267], [-60.58224, -15.09887], [-60.23968, -15.09515], [-60.27887, -14.63021], [-60.46037, -14.22496], [-60.48053, -13.77981], [-61.05527, -13.50054], [-61.81151, -13.49564], [-63.76259, -12.42952], [-63.90248, -12.52544]]]] } },
23224 { type: "Feature", properties: { iso1A2: "BQ", iso1A3: "BES", iso1N3: "535", wikidata: "Q27561", nameEn: "Caribbean Netherlands", country: "NL" }, geometry: null },
23225 { type: "Feature", properties: { iso1A2: "BR", iso1A3: "BRA", iso1N3: "076", wikidata: "Q155", nameEn: "Brazil", groups: ["005", "419", "019", "UN"], callingCodes: ["55"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-59.69361, 4.34069], [-59.78878, 4.45637], [-60.15953, 4.53456], [-60.04189, 4.69801], [-59.98129, 5.07097], [-60.20944, 5.28754], [-60.32352, 5.21299], [-60.73204, 5.20931], [-60.5802, 4.94312], [-60.86539, 4.70512], [-60.98303, 4.54167], [-61.15703, 4.49839], [-61.31457, 4.54167], [-61.29675, 4.44216], [-61.48569, 4.43149], [-61.54629, 4.2822], [-62.13094, 4.08309], [-62.44822, 4.18621], [-62.57656, 4.04754], [-62.74411, 4.03331], [-62.7655, 3.73099], [-62.98296, 3.59935], [-63.21111, 3.96219], [-63.4464, 3.9693], [-63.42233, 3.89995], [-63.50611, 3.83592], [-63.67099, 4.01731], [-63.70218, 3.91417], [-63.86082, 3.94796], [-63.99183, 3.90172], [-64.14512, 4.12932], [-64.57648, 4.12576], [-64.72977, 4.28931], [-64.84028, 4.24665], [-64.48379, 3.7879], [-64.02908, 2.79797], [-64.0257, 2.48156], [-63.39114, 2.4317], [-63.39827, 2.16098], [-64.06135, 1.94722], [-64.08274, 1.64792], [-64.34654, 1.35569], [-64.38932, 1.5125], [-65.11657, 1.12046], [-65.57288, 0.62856], [-65.50158, 0.92086], [-65.6727, 1.01353], [-66.28507, 0.74585], [-66.85795, 1.22998], [-67.08222, 1.17441], [-67.15784, 1.80439], [-67.299, 1.87494], [-67.40488, 2.22258], [-67.9292, 1.82455], [-68.18632, 2.00091], [-68.26699, 1.83463], [-68.18128, 1.72881], [-69.38621, 1.70865], [-69.53746, 1.76408], [-69.83491, 1.69353], [-69.82987, 1.07864], [-69.26017, 1.06856], [-69.14422, 0.84172], [-69.20976, 0.57958], [-69.47696, 0.71065], [-70.04162, 0.55437], [-70.03658, -0.19681], [-69.603, -0.51947], [-69.59796, -0.75136], [-69.4215, -1.01853], [-69.43395, -1.42219], [-69.94708, -4.2431], [-70.00888, -4.37833], [-70.11305, -4.27281], [-70.19582, -4.3607], [-70.33236, -4.15214], [-70.77601, -4.15717], [-70.96814, -4.36915], [-71.87003, -4.51661], [-72.64391, -5.0391], [-72.83973, -5.14765], [-73.24579, -6.05764], [-73.12983, -6.43852], [-73.73986, -6.87919], [-73.77011, -7.28944], [-73.96938, -7.58465], [-73.65485, -7.77897], [-73.76576, -7.89884], [-72.92886, -9.04074], [-73.21498, -9.40904], [-72.72216, -9.41397], [-72.31883, -9.5184], [-72.14742, -9.98049], [-71.23394, -9.9668], [-70.53373, -9.42628], [-70.58453, -9.58303], [-70.55429, -9.76692], [-70.62487, -9.80666], [-70.64134, -11.0108], [-70.51395, -10.92249], [-70.38791, -11.07096], [-69.90896, -10.92744], [-69.57835, -10.94051], [-69.57156, -10.94555], [-69.47839, -10.95254], [-69.42792, -10.93451], [-68.74802, -11.00891], [-68.75265, -11.02383], [-68.75179, -11.03688], [-68.7651, -11.0496], [-68.71533, -11.14749], [-67.17784, -10.34016], [-65.68343, -9.75323], [-65.56244, -9.84266], [-65.40615, -9.63894], [-65.29019, -9.86253], [-65.37923, -10.35141], [-65.35402, -10.78685], [-65.28141, -10.86289], [-65.30027, -11.48749], [-64.99778, -11.98604], [-64.30708, -12.46398], [-64.22539, -12.45267], [-63.90248, -12.52544], [-63.76259, -12.42952], [-61.81151, -13.49564], [-61.05527, -13.50054], [-60.48053, -13.77981], [-60.46037, -14.22496], [-60.27887, -14.63021], [-60.23968, -15.09515], [-60.58224, -15.09887], [-60.23797, -15.50267], [-60.16069, -16.26479], [-58.41506, -16.32636], [-58.32431, -16.25861], [-58.30918, -16.3699], [-58.5058, -16.80958], [-58.32935, -17.28195], [-57.99661, -17.5273], [-57.90082, -17.44555], [-57.73949, -17.56095], [-57.69877, -17.8431], [-57.48237, -18.24219], [-57.56807, -18.25655], [-57.76764, -18.90087], [-57.71995, -18.89573], [-57.71995, -18.97546], [-57.69134, -19.00544], [-57.71113, -19.03161], [-57.78463, -19.03259], [-58.14215, -19.76276], [-57.8496, -19.98346], [-58.16225, -20.16193], [-57.84536, -20.93155], [-57.93492, -21.65505], [-57.88239, -21.6868], [-57.94642, -21.73799], [-57.98625, -22.09157], [-56.6508, -22.28387], [-56.5212, -22.11556], [-56.45893, -22.08072], [-56.23206, -22.25347], [-55.8331, -22.29008], [-55.74941, -22.46436], [-55.741, -22.52018], [-55.72366, -22.5519], [-55.6986, -22.56268], [-55.68742, -22.58407], [-55.62493, -22.62765], [-55.63849, -22.95122], [-55.5446, -23.22811], [-55.52288, -23.2595], [-55.5555, -23.28237], [-55.43585, -23.87157], [-55.44117, -23.9185], [-55.41784, -23.9657], [-55.12292, -23.99669], [-55.0518, -23.98666], [-55.02691, -23.97317], [-54.6238, -23.83078], [-54.32807, -24.01865], [-54.28207, -24.07305], [-54.4423, -25.13381], [-54.62033, -25.46026], [-54.60196, -25.48397], [-54.59509, -25.53696], [-54.59398, -25.59224], [-54.5502, -25.58915], [-54.52926, -25.62846], [-53.90831, -25.55513], [-53.83691, -25.94849], [-53.73511, -26.04211], [-53.73086, -26.05842], [-53.7264, -26.0664], [-53.73391, -26.07006], [-53.73968, -26.10012], [-53.65018, -26.19501], [-53.65237, -26.23289], [-53.63739, -26.2496], [-53.63881, -26.25075], [-53.64632, -26.24798], [-53.64186, -26.25976], [-53.64505, -26.28089], [-53.68269, -26.33359], [-53.73372, -26.6131], [-53.80144, -27.09844], [-54.15978, -27.2889], [-54.19062, -27.27639], [-54.19268, -27.30751], [-54.41888, -27.40882], [-54.50416, -27.48232], [-54.67657, -27.57214], [-54.90159, -27.63132], [-54.90805, -27.73149], [-55.1349, -27.89759], [-55.16872, -27.86224], [-55.33303, -27.94661], [-55.6262, -28.17124], [-55.65418, -28.18304], [-56.01729, -28.51223], [-56.00458, -28.60421], [-56.05265, -28.62651], [-56.54171, -29.11447], [-56.57295, -29.11357], [-56.62789, -29.18073], [-56.81251, -29.48154], [-57.09386, -29.74211], [-57.65132, -30.19229], [-57.22502, -30.26121], [-56.90236, -30.02578], [-56.49267, -30.39471], [-56.4795, -30.3899], [-56.4619, -30.38457], [-55.87388, -31.05053], [-55.58866, -30.84117], [-55.5634, -30.8686], [-55.55373, -30.8732], [-55.55218, -30.88193], [-55.54572, -30.89051], [-55.53431, -30.89714], [-55.53276, -30.90218], [-55.52712, -30.89997], [-55.51862, -30.89828], [-55.50841, -30.9027], [-55.50821, -30.91349], [-54.17384, -31.86168], [-53.76024, -32.0751], [-53.39572, -32.58596], [-53.37671, -32.57005], [-53.1111, -32.71147], [-53.53459, -33.16843], [-53.52794, -33.68908], [-53.44031, -33.69344], [-53.39593, -33.75169], [-53.37138, -33.74313], [-52.83257, -34.01481], [-28.34015, -20.99094], [-28.99601, 1.86593], [-51.35485, 4.8383], [-51.63798, 4.51394], [-51.61983, 4.14596], [-51.79599, 3.89336], [-51.82312, 3.85825], [-51.85573, 3.83427], [-52.31787, 3.17896], [-52.6906, 2.37298], [-52.96539, 2.1881], [-53.78743, 2.34412], [-54.16286, 2.10779], [-54.6084, 2.32856], [-55.01919, 2.564], [-55.71493, 2.40342], [-55.96292, 2.53188], [-56.13054, 2.27723], [-55.92159, 2.05236], [-55.89863, 1.89861], [-55.99278, 1.83137], [-56.47045, 1.95135], [-56.7659, 1.89509], [-57.07092, 1.95304], [-57.09109, 2.01854], [-57.23981, 1.95808], [-57.35073, 1.98327], [-57.55743, 1.69605], [-57.77281, 1.73344], [-57.97336, 1.64566], [-58.01873, 1.51966], [-58.33887, 1.58014], [-58.4858, 1.48399], [-58.53571, 1.29154], [-58.84229, 1.17749], [-58.92072, 1.31293], [-59.25583, 1.40559], [-59.74066, 1.87596], [-59.7264, 2.27497], [-59.91177, 2.36759], [-59.99733, 2.92312], [-59.79769, 3.37162], [-59.86899, 3.57089], [-59.51963, 3.91951], [-59.73353, 4.20399], [-59.69361, 4.34069]]]] } },
23226 { type: "Feature", properties: { iso1A2: "BS", iso1A3: "BHS", iso1N3: "044", wikidata: "Q778", nameEn: "The Bahamas", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 242"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-72.98446, 20.4801], [-71.70065, 25.7637], [-78.91214, 27.76553], [-80.65727, 23.71953], [-72.98446, 20.4801]]]] } },
23227 { type: "Feature", properties: { iso1A2: "BT", iso1A3: "BTN", iso1N3: "064", wikidata: "Q917", nameEn: "Bhutan", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["975"] }, geometry: { type: "MultiPolygon", coordinates: [[[[91.6469, 27.76358], [91.5629, 27.84823], [91.48973, 27.93903], [91.46327, 28.0064], [91.25779, 28.07509], [91.20019, 27.98715], [90.69894, 28.07784], [90.58842, 28.02838], [90.13387, 28.19178], [89.79762, 28.23979], [89.59525, 28.16433], [89.12825, 27.62502], [89.0582, 27.60985], [88.97213, 27.51671], [88.95355, 27.4106], [89.00216, 27.32532], [88.96947, 27.30319], [88.93678, 27.33777], [88.91901, 27.32483], [88.74219, 27.144], [88.86984, 27.10937], [88.8714, 26.97488], [88.92301, 26.99286], [88.95807, 26.92668], [89.09554, 26.89089], [89.12825, 26.81661], [89.1926, 26.81329], [89.37913, 26.86224], [89.38319, 26.85963], [89.3901, 26.84225], [89.42349, 26.83727], [89.63369, 26.74402], [89.86124, 26.73307], [90.04535, 26.72422], [90.30402, 26.85098], [90.39271, 26.90704], [90.48504, 26.8594], [90.67715, 26.77215], [91.50067, 26.79223], [91.83181, 26.87318], [92.05523, 26.8692], [92.11863, 26.893], [92.03457, 27.07334], [92.04702, 27.26861], [92.12019, 27.27829], [92.01132, 27.47352], [91.65007, 27.48287], [91.55819, 27.6144], [91.6469, 27.76358]]]] } },
23228 { type: "Feature", properties: { iso1A2: "BV", iso1A3: "BVT", iso1N3: "074", wikidata: "Q23408", nameEn: "Bouvet Island", country: "NO", groups: ["005", "419", "019", "UN"] }, geometry: { type: "MultiPolygon", coordinates: [[[[4.54042, -54.0949], [2.28941, -54.13089], [3.35353, -55.17558], [4.54042, -54.0949]]]] } },
23229 { type: "Feature", properties: { iso1A2: "BW", iso1A3: "BWA", iso1N3: "072", wikidata: "Q963", nameEn: "Botswana", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["267"] }, geometry: { type: "MultiPolygon", coordinates: [[[[25.26433, -17.79571], [25.16882, -17.78253], [25.05895, -17.84452], [24.95586, -17.79674], [24.73364, -17.89338], [24.71887, -17.9218], [24.6303, -17.9863], [24.57485, -18.07151], [24.40577, -17.95726], [24.19416, -18.01919], [23.61088, -18.4881], [23.29618, -17.99855], [23.0996, -18.00075], [21.45556, -18.31795], [20.99904, -18.31743], [20.99751, -22.00026], [19.99912, -21.99991], [19.99817, -24.76768], [20.02809, -24.78725], [20.03678, -24.81004], [20.29826, -24.94869], [20.64795, -25.47827], [20.86081, -26.14892], [20.61754, -26.4692], [20.63275, -26.78181], [20.68596, -26.9039], [20.87031, -26.80047], [21.13353, -26.86661], [21.37869, -26.82083], [21.69322, -26.86152], [21.7854, -26.79199], [21.77114, -26.69015], [21.83291, -26.65959], [21.90703, -26.66808], [22.06192, -26.61882], [22.21206, -26.3773], [22.41921, -26.23078], [22.56365, -26.19668], [22.70808, -25.99186], [22.86012, -25.50572], [23.03497, -25.29971], [23.47588, -25.29971], [23.9244, -25.64286], [24.18287, -25.62916], [24.36531, -25.773], [24.44703, -25.73021], [24.67319, -25.81749], [24.8946, -25.80723], [25.01718, -25.72507], [25.12266, -25.75931], [25.33076, -25.76616], [25.58543, -25.6343], [25.6643, -25.4491], [25.69661, -25.29284], [25.72702, -25.25503], [25.88571, -24.87802], [25.84295, -24.78661], [25.8515, -24.75727], [26.39409, -24.63468], [26.46346, -24.60358], [26.51667, -24.47219], [26.84165, -24.24885], [26.99749, -23.65486], [27.33768, -23.40917], [27.52393, -23.37952], [27.6066, -23.21894], [27.74154, -23.2137], [27.93539, -23.04941], [27.93729, -22.96194], [28.04752, -22.90243], [28.04562, -22.8394], [28.34874, -22.5694], [28.63287, -22.55887], [28.91889, -22.44299], [29.0151, -22.22907], [29.10881, -22.21202], [29.15268, -22.21399], [29.18974, -22.18599], [29.21955, -22.17771], [29.37703, -22.19581], [29.3533, -22.18363], [29.24648, -22.05967], [29.1974, -22.07472], [29.14501, -22.07275], [29.08495, -22.04867], [29.04108, -22.00563], [29.02191, -21.95665], [29.02191, -21.90647], [29.04023, -21.85864], [29.07763, -21.81877], [28.58114, -21.63455], [28.49942, -21.66634], [28.29416, -21.59037], [28.01669, -21.57624], [27.91407, -21.31621], [27.69171, -21.08409], [27.72972, -20.51735], [27.69361, -20.48531], [27.28865, -20.49873], [27.29831, -20.28935], [27.21278, -20.08244], [26.72246, -19.92707], [26.17227, -19.53709], [25.96226, -19.08152], [25.99837, -19.02943], [25.94326, -18.90362], [25.82353, -18.82808], [25.79217, -18.6355], [25.68859, -18.56165], [25.53465, -18.39041], [25.39972, -18.12691], [25.31799, -18.07091], [25.23909, -17.90832], [25.26433, -17.79571]]]] } },
23230 { type: "Feature", properties: { iso1A2: "BY", iso1A3: "BLR", iso1N3: "112", wikidata: "Q184", nameEn: "Belarus", groups: ["151", "150", "UN"], callingCodes: ["375"] }, geometry: { type: "MultiPolygon", coordinates: [[[[28.15217, 56.16964], [27.97865, 56.11849], [27.63065, 55.89687], [27.61683, 55.78558], [27.3541, 55.8089], [27.27804, 55.78299], [27.1559, 55.85032], [26.97153, 55.8102], [26.87448, 55.7172], [26.76872, 55.67658], [26.71802, 55.70645], [26.64888, 55.70515], [26.63231, 55.67968], [26.63167, 55.57887], [26.55094, 55.5093], [26.5522, 55.40277], [26.44937, 55.34832], [26.5709, 55.32572], [26.6714, 55.33902], [26.80929, 55.31642], [26.83266, 55.30444], [26.835, 55.28182], [26.73017, 55.24226], [26.72983, 55.21788], [26.68075, 55.19787], [26.69243, 55.16718], [26.54753, 55.14181], [26.51481, 55.16051], [26.46249, 55.12814], [26.35121, 55.1525], [26.30628, 55.12536], [26.23202, 55.10439], [26.26941, 55.08032], [26.20397, 54.99729], [26.13386, 54.98924], [26.05907, 54.94631], [25.99129, 54.95705], [25.89462, 54.93438], [25.74122, 54.80108], [25.75977, 54.57252], [25.68045, 54.5321], [25.64813, 54.48704], [25.62203, 54.4656], [25.63371, 54.42075], [25.5376, 54.33158], [25.55425, 54.31591], [25.68513, 54.31727], [25.78553, 54.23327], [25.78563, 54.15747], [25.71084, 54.16704], [25.64875, 54.1259], [25.54724, 54.14925], [25.51452, 54.17799], [25.56823, 54.25212], [25.509, 54.30267], [25.35559, 54.26544], [25.22705, 54.26271], [25.19199, 54.219], [25.0728, 54.13419], [24.991, 54.14241], [24.96894, 54.17589], [24.77131, 54.11091], [24.85311, 54.02862], [24.74279, 53.96663], [24.69185, 53.96543], [24.69652, 54.01901], [24.62275, 54.00217], [24.44411, 53.90076], [24.34128, 53.90076], [24.19638, 53.96405], [23.98837, 53.92554], [23.95098, 53.9613], [23.81309, 53.94205], [23.80543, 53.89558], [23.71726, 53.93379], [23.61677, 53.92691], [23.51284, 53.95052], [23.62004, 53.60942], [23.81995, 53.24131], [23.85657, 53.22923], [23.91393, 53.16469], [23.87548, 53.0831], [23.92184, 53.02079], [23.94689, 52.95919], [23.91805, 52.94016], [23.93763, 52.71332], [23.73615, 52.6149], [23.58296, 52.59868], [23.45112, 52.53774], [23.34141, 52.44845], [23.18196, 52.28812], [23.20071, 52.22848], [23.47859, 52.18215], [23.54314, 52.12148], [23.61, 52.11264], [23.64066, 52.07626], [23.68733, 51.9906], [23.61523, 51.92066], [23.62691, 51.78208], [23.53198, 51.74298], [23.57053, 51.55938], [23.56236, 51.53673], [23.62751, 51.50512], [23.6736, 51.50255], [23.60906, 51.62122], [23.7766, 51.66809], [23.91118, 51.63316], [23.8741, 51.59734], [23.99907, 51.58369], [24.13075, 51.66979], [24.3163, 51.75063], [24.29021, 51.80841], [24.37123, 51.88222], [24.98784, 51.91273], [25.20228, 51.97143], [25.46163, 51.92205], [25.73673, 51.91973], [25.80574, 51.94556], [25.83217, 51.92587], [26.00408, 51.92967], [26.19084, 51.86781], [26.39367, 51.87315], [26.46962, 51.80501], [26.69759, 51.82284], [26.80043, 51.75777], [26.9489, 51.73788], [26.99422, 51.76933], [27.20602, 51.77291], [27.20948, 51.66713], [27.26613, 51.65957], [27.24828, 51.60161], [27.47212, 51.61184], [27.51058, 51.5854], [27.55727, 51.63486], [27.71932, 51.60672], [27.67125, 51.50854], [27.76052, 51.47604], [27.85253, 51.62293], [27.91844, 51.61952], [27.95827, 51.56065], [28.10658, 51.57857], [28.23452, 51.66988], [28.37592, 51.54505], [28.47051, 51.59734], [28.64429, 51.5664], [28.69161, 51.44695], [28.73143, 51.46236], [28.75615, 51.41442], [28.78224, 51.45294], [28.76027, 51.48802], [28.81795, 51.55552], [28.95528, 51.59222], [28.99098, 51.56833], [29.1187, 51.65872], [29.16402, 51.64679], [29.20659, 51.56918], [29.25603, 51.57089], [29.25191, 51.49828], [29.32881, 51.37843], [29.42357, 51.4187], [29.49773, 51.39814], [29.54372, 51.48372], [29.7408, 51.53417], [29.77376, 51.4461], [30.17888, 51.51025], [30.34642, 51.42555], [30.36153, 51.33984], [30.56203, 51.25655], [30.64992, 51.35014], [30.51946, 51.59649], [30.68804, 51.82806], [30.76443, 51.89739], [30.90897, 52.00699], [30.95589, 52.07775], [31.13332, 52.1004], [31.25142, 52.04131], [31.38326, 52.12991], [31.7822, 52.11406], [31.77877, 52.18636], [31.6895, 52.1973], [31.70735, 52.26711], [31.57971, 52.32146], [31.62084, 52.33849], [31.61397, 52.48843], [31.56316, 52.51518], [31.63869, 52.55361], [31.50406, 52.69707], [31.57277, 52.71613], [31.592, 52.79011], [31.35667, 52.97854], [31.24147, 53.031], [31.32283, 53.04101], [31.33519, 53.08805], [31.3915, 53.09712], [31.36403, 53.13504], [31.40523, 53.21406], [31.56316, 53.19432], [31.62496, 53.22886], [31.787, 53.18033], [31.82373, 53.10042], [32.15368, 53.07594], [32.40773, 53.18856], [32.51725, 53.28431], [32.73257, 53.33494], [32.74968, 53.45597], [32.47777, 53.5548], [32.40499, 53.6656], [32.50112, 53.68594], [32.45717, 53.74039], [32.36663, 53.7166], [32.12621, 53.81586], [31.89137, 53.78099], [31.77028, 53.80015], [31.85019, 53.91801], [31.88744, 54.03653], [31.89599, 54.0837], [31.57002, 54.14535], [31.30791, 54.25315], [31.3177, 54.34067], [31.22945, 54.46585], [31.08543, 54.50361], [31.21399, 54.63113], [31.19339, 54.66947], [30.99187, 54.67046], [30.98226, 54.68872], [31.0262, 54.70698], [30.97127, 54.71967], [30.95479, 54.74346], [30.75165, 54.80699], [30.8264, 54.90062], [30.81759, 54.94064], [30.93144, 54.9585], [30.95754, 54.98609], [30.9081, 55.02232], [30.94243, 55.03964], [31.00972, 55.02783], [31.02071, 55.06167], [30.97369, 55.17134], [30.87944, 55.28223], [30.81946, 55.27931], [30.8257, 55.3313], [30.93144, 55.3914], [30.90123, 55.46621], [30.95204, 55.50667], [30.93419, 55.6185], [30.86003, 55.63169], [30.7845, 55.58514], [30.72957, 55.66268], [30.67464, 55.64176], [30.63344, 55.73079], [30.51037, 55.76568], [30.51346, 55.78982], [30.48257, 55.81066], [30.30987, 55.83592], [30.27776, 55.86819], [30.12136, 55.8358], [29.97975, 55.87281], [29.80672, 55.79569], [29.61446, 55.77716], [29.51283, 55.70294], [29.3604, 55.75862], [29.44692, 55.95978], [29.21717, 55.98971], [29.08299, 56.03427], [28.73418, 55.97131], [28.63668, 56.07262], [28.68337, 56.10173], [28.5529, 56.11705], [28.43068, 56.09407], [28.37987, 56.11399], [28.36888, 56.05805], [28.30571, 56.06035], [28.15217, 56.16964]]]] } },
23231 { type: "Feature", properties: { iso1A2: "BZ", iso1A3: "BLZ", iso1N3: "084", wikidata: "Q242", nameEn: "Belize", groups: ["013", "003", "419", "019", "UN"], roadSpeedUnit: "mph", callingCodes: ["501"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-88.3268, 18.49048], [-88.48242, 18.49164], [-88.71505, 18.0707], [-88.8716, 17.89535], [-89.03839, 18.0067], [-89.15105, 17.95104], [-89.14985, 17.81563], [-89.15025, 17.04813], [-89.22683, 15.88619], [-89.17418, 15.90898], [-89.02415, 15.9063], [-88.95358, 15.88698], [-88.40779, 16.09624], [-86.92368, 17.61462], [-87.84815, 18.18511], [-87.85693, 18.18266], [-87.86657, 18.19971], [-87.87604, 18.18313], [-87.90671, 18.15213], [-88.03165, 18.16657], [-88.03238, 18.41778], [-88.26593, 18.47617], [-88.29909, 18.47591], [-88.3268, 18.49048]]]] } },
23232 { type: "Feature", properties: { iso1A2: "CA", iso1A3: "CAN", iso1N3: "124", wikidata: "Q16", nameEn: "Canada", groups: ["021", "003", "019", "UN"], callingCodes: ["1"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-67.20349, 45.1722], [-67.19603, 45.16771], [-67.15965, 45.16179], [-67.11316, 45.11176], [-67.0216, 44.95333], [-66.96824, 44.90965], [-66.98249, 44.87071], [-66.96824, 44.83078], [-66.93432, 44.82597], [-67.16117, 44.20069], [-61.98255, 37.34815], [-56.27503, 47.39728], [-53.12387, 41.40385], [-46.37635, 57.3249], [-77.52957, 77.23408], [-68.21821, 80.48551], [-49.33696, 84.57952], [-140.97446, 84.39275], [-141.00116, 60.30648], [-140.5227, 60.22077], [-140.45648, 60.30919], [-139.98024, 60.18027], [-139.68991, 60.33693], [-139.05831, 60.35205], [-139.20603, 60.08896], [-139.05365, 59.99655], [-138.71149, 59.90728], [-138.62145, 59.76431], [-137.60623, 59.24465], [-137.4925, 58.89415], [-136.82619, 59.16198], [-136.52365, 59.16752], [-136.47323, 59.46617], [-136.33727, 59.44466], [-136.22381, 59.55526], [-136.31566, 59.59083], [-135.48007, 59.79937], [-135.03069, 59.56208], [-135.00267, 59.28745], [-134.7047, 59.2458], [-134.55699, 59.1297], [-134.48059, 59.13231], [-134.27175, 58.8634], [-133.84645, 58.73543], [-133.38523, 58.42773], [-131.8271, 56.62247], [-130.77769, 56.36185], [-130.33965, 56.10849], [-130.10173, 56.12178], [-130.00093, 56.00325], [-130.00857, 55.91344], [-130.15373, 55.74895], [-129.97513, 55.28029], [-130.08035, 55.21556], [-130.18765, 55.07744], [-130.27203, 54.97174], [-130.44184, 54.85377], [-130.64499, 54.76912], [-130.61931, 54.70835], [-133.92876, 54.62289], [-133.36909, 48.51151], [-125.03842, 48.53282], [-123.50039, 48.21223], [-123.15614, 48.35395], [-123.26565, 48.6959], [-123.0093, 48.76586], [-123.0093, 48.83186], [-123.32163, 49.00419], [-95.15355, 48.9996], [-95.15357, 49.384], [-95.12903, 49.37056], [-95.05825, 49.35311], [-95.01419, 49.35647], [-94.99532, 49.36579], [-94.95681, 49.37035], [-94.85381, 49.32492], [-94.8159, 49.32299], [-94.82487, 49.29483], [-94.77355, 49.11998], [-94.75017, 49.09931], [-94.687, 48.84077], [-94.70087, 48.8339], [-94.70486, 48.82365], [-94.69669, 48.80918], [-94.69335, 48.77883], [-94.58903, 48.71803], [-94.54885, 48.71543], [-94.53826, 48.70216], [-94.44258, 48.69223], [-94.4174, 48.71049], [-94.27153, 48.70232], [-94.25172, 48.68404], [-94.25104, 48.65729], [-94.23215, 48.65202], [-93.85769, 48.63284], [-93.83288, 48.62745], [-93.80676, 48.58232], [-93.80939, 48.52439], [-93.79267, 48.51631], [-93.66382, 48.51845], [-93.47022, 48.54357], [-93.44472, 48.59147], [-93.40693, 48.60948], [-93.39758, 48.60364], [-93.3712, 48.60599], [-93.33946, 48.62787], [-93.25391, 48.64266], [-92.94973, 48.60866], [-92.7287, 48.54005], [-92.6342, 48.54133], [-92.62747, 48.50278], [-92.69927, 48.49573], [-92.71323, 48.46081], [-92.65606, 48.43471], [-92.50712, 48.44921], [-92.45588, 48.40624], [-92.48147, 48.36609], [-92.37185, 48.22259], [-92.27167, 48.25046], [-92.30939, 48.31251], [-92.26662, 48.35651], [-92.202, 48.35252], [-92.14732, 48.36578], [-92.05339, 48.35958], [-91.98929, 48.25409], [-91.86125, 48.21278], [-91.71231, 48.19875], [-91.70451, 48.11805], [-91.55649, 48.10611], [-91.58025, 48.04339], [-91.45829, 48.07454], [-91.43248, 48.04912], [-91.25025, 48.08522], [-91.08016, 48.18096], [-90.87588, 48.2484], [-90.75045, 48.09143], [-90.56444, 48.12184], [-90.56312, 48.09488], [-90.07418, 48.11043], [-89.89974, 47.98109], [-89.77248, 48.02607], [-89.57972, 48.00023], [-89.48837, 48.01412], [-88.37033, 48.30586], [-84.85871, 46.88881], [-84.55635, 46.45974], [-84.47607, 46.45225], [-84.4481, 46.48972], [-84.42101, 46.49853], [-84.34174, 46.50683], [-84.29893, 46.49127], [-84.26351, 46.49508], [-84.2264, 46.53337], [-84.1945, 46.54061], [-84.17723, 46.52753], [-84.12885, 46.53068], [-84.11196, 46.50248], [-84.13451, 46.39218], [-84.11254, 46.32329], [-84.11615, 46.2681], [-84.09756, 46.25512], [-84.1096, 46.23987], [-83.95399, 46.05634], [-83.90453, 46.05922], [-83.83329, 46.12169], [-83.57017, 46.105], [-83.43746, 45.99749], [-83.59589, 45.82131], [-82.48419, 45.30225], [-82.42469, 42.992], [-82.4146, 42.97626], [-82.4253, 42.95423], [-82.45331, 42.93139], [-82.4826, 42.8068], [-82.46613, 42.76615], [-82.51063, 42.66025], [-82.51858, 42.611], [-82.57583, 42.5718], [-82.58873, 42.54984], [-82.64242, 42.55594], [-82.82964, 42.37355], [-83.02253, 42.33045], [-83.07837, 42.30978], [-83.09837, 42.28877], [-83.12724, 42.2376], [-83.14962, 42.04089], [-83.11184, 41.95671], [-82.67862, 41.67615], [-78.93684, 42.82887], [-78.90712, 42.89733], [-78.90905, 42.93022], [-78.93224, 42.95229], [-78.96312, 42.95509], [-78.98126, 42.97], [-79.02074, 42.98444], [-79.02424, 43.01983], [-78.99941, 43.05612], [-79.01055, 43.06659], [-79.07486, 43.07845], [-79.05671, 43.10937], [-79.06881, 43.12029], [-79.0427, 43.13934], [-79.04652, 43.16396], [-79.05384, 43.17418], [-79.05002, 43.20133], [-79.05544, 43.21224], [-79.05512, 43.25375], [-79.06921, 43.26183], [-79.25796, 43.54052], [-76.79706, 43.63099], [-76.43859, 44.09393], [-76.35324, 44.13493], [-76.31222, 44.19894], [-76.244, 44.19643], [-76.1664, 44.23051], [-76.16285, 44.28262], [-76.00018, 44.34896], [-75.95947, 44.34463], [-75.8217, 44.43176], [-75.76813, 44.51537], [-75.41441, 44.76614], [-75.2193, 44.87821], [-75.01363, 44.95608], [-74.99101, 44.98051], [-74.8447, 45.00606], [-74.66689, 45.00646], [-74.32699, 44.99029], [-73.35025, 45.00942], [-71.50067, 45.01357], [-71.48735, 45.07784], [-71.42778, 45.12624], [-71.40364, 45.21382], [-71.44252, 45.2361], [-71.37133, 45.24624], [-71.29371, 45.29996], [-71.22338, 45.25184], [-71.19723, 45.25438], [-71.14568, 45.24128], [-71.08364, 45.30623], [-71.01866, 45.31573], [-71.0107, 45.34819], [-70.95193, 45.33895], [-70.91169, 45.29849], [-70.89864, 45.2398], [-70.84816, 45.22698], [-70.80236, 45.37444], [-70.82638, 45.39828], [-70.78372, 45.43269], [-70.65383, 45.37592], [-70.62518, 45.42286], [-70.72651, 45.49771], [-70.68516, 45.56964], [-70.54019, 45.67291], [-70.38934, 45.73215], [-70.41523, 45.79497], [-70.25976, 45.89675], [-70.24694, 45.95138], [-70.31025, 45.96424], [-70.23855, 46.1453], [-70.29078, 46.18832], [-70.18547, 46.35357], [-70.05812, 46.41768], [-69.99966, 46.69543], [-69.22119, 47.46461], [-69.05148, 47.42012], [-69.05073, 47.30076], [-69.05039, 47.2456], [-68.89222, 47.1807], [-68.70125, 47.24399], [-68.60575, 47.24659], [-68.57914, 47.28431], [-68.38332, 47.28723], [-68.37458, 47.35851], [-68.23244, 47.35712], [-67.94843, 47.1925], [-67.87993, 47.10377], [-67.78578, 47.06473], [-67.78111, 45.9392], [-67.75196, 45.91814], [-67.80961, 45.87531], [-67.75654, 45.82324], [-67.80653, 45.80022], [-67.80705, 45.69528], [-67.6049, 45.60725], [-67.43815, 45.59162], [-67.42144, 45.50584], [-67.50578, 45.48971], [-67.42394, 45.37969], [-67.48201, 45.27351], [-67.34927, 45.122], [-67.29754, 45.14865], [-67.29748, 45.18173], [-67.27039, 45.1934], [-67.22751, 45.16344], [-67.20349, 45.1722]]]] } },
23233 { type: "Feature", properties: { iso1A2: "CC", iso1A3: "CCK", iso1N3: "166", wikidata: "Q36004", nameEn: "Cocos (Keeling) Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[96.61846, -10.82438], [96.02343, -12.68334], [97.93979, -12.33309], [96.61846, -10.82438]]]] } },
23234 { type: "Feature", properties: { iso1A2: "CD", iso1A3: "COD", iso1N3: "180", wikidata: "Q974", nameEn: "Democratic Republic of the Congo", aliases: ["ZR"], groups: ["017", "202", "002", "UN"], callingCodes: ["243"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.44012, 5.07349], [27.09575, 5.22305], [26.93064, 5.13535], [26.85579, 5.03887], [26.74572, 5.10685], [26.48595, 5.04984], [26.13371, 5.25594], [25.86073, 5.19455], [25.53271, 5.37431], [25.34558, 5.29101], [25.31256, 5.03668], [24.71816, 4.90509], [24.46719, 5.0915], [23.38847, 4.60013], [22.94817, 4.82392], [22.89094, 4.79321], [22.84691, 4.69887], [22.78526, 4.71423], [22.6928, 4.47285], [22.60915, 4.48821], [22.5431, 4.22041], [22.45504, 4.13039], [22.27682, 4.11347], [22.10721, 4.20723], [21.6405, 4.317], [21.55904, 4.25553], [21.25744, 4.33676], [21.21341, 4.29285], [21.11214, 4.33895], [21.08793, 4.39603], [20.90383, 4.44877], [20.60184, 4.42394], [18.62755, 3.47564], [18.63857, 3.19342], [18.10683, 2.26876], [18.08034, 1.58553], [17.85887, 1.04327], [17.86989, 0.58873], [17.95255, 0.48128], [17.93877, 0.32424], [17.81204, 0.23884], [17.66051, -0.26535], [17.72112, -0.52707], [17.32438, -0.99265], [16.97999, -1.12762], [16.70724, -1.45815], [16.50336, -1.8795], [16.16173, -2.16586], [16.22785, -2.59528], [16.1755, -3.25014], [16.21407, -3.2969], [15.89448, -3.9513], [15.53081, -4.042], [15.48121, -4.22062], [15.41785, -4.28381], [15.32693, -4.27282], [15.25411, -4.31121], [15.1978, -4.32388], [14.83101, -4.80838], [14.67948, -4.92093], [14.5059, -4.84956], [14.41499, -4.8825], [14.37366, -4.56125], [14.47284, -4.42941], [14.3957, -4.36623], [14.40672, -4.28381], [13.9108, -4.50906], [13.81162, -4.41842], [13.71794, -4.44864], [13.70417, -4.72601], [13.50305, -4.77818], [13.41764, -4.89897], [13.11182, -4.5942], [13.09648, -4.63739], [13.11195, -4.67745], [12.8733, -4.74346], [12.70868, -4.95505], [12.63465, -4.94632], [12.60251, -5.01715], [12.46297, -5.09408], [12.49815, -5.14058], [12.51589, -5.1332], [12.53586, -5.14658], [12.53599, -5.1618], [12.52301, -5.17481], [12.52318, -5.74353], [12.26557, -5.74031], [12.20376, -5.76338], [11.95767, -5.94705], [12.42245, -6.07585], [13.04371, -5.87078], [16.55507, -5.85631], [16.96282, -7.21787], [17.5828, -8.13784], [18.33635, -8.00126], [19.33698, -7.99743], [19.5469, -7.00195], [20.30218, -6.98955], [20.31846, -6.91953], [20.61689, -6.90876], [20.56263, -7.28566], [21.79824, -7.29628], [21.84856, -9.59871], [22.19039, -9.94628], [22.32604, -10.76291], [22.17954, -10.85884], [22.25951, -11.24911], [22.54205, -11.05784], [23.16602, -11.10577], [23.45631, -10.946], [23.86868, -11.02856], [24.00027, -10.89356], [24.34528, -11.06816], [24.42612, -11.44975], [25.34069, -11.19707], [25.33058, -11.65767], [26.01777, -11.91488], [26.88687, -12.01868], [27.04351, -11.61312], [27.22541, -11.60323], [27.21025, -11.76157], [27.59932, -12.22123], [28.33199, -12.41375], [29.01918, -13.41353], [29.60531, -13.21685], [29.65078, -13.41844], [29.81551, -13.44683], [29.8139, -12.14898], [29.48404, -12.23604], [29.4992, -12.43843], [29.18592, -12.37921], [28.48357, -11.87532], [28.37241, -11.57848], [28.65032, -10.65133], [28.62795, -9.92942], [28.68532, -9.78], [28.56208, -9.49122], [28.51627, -9.44726], [28.52636, -9.35379], [28.36562, -9.30091], [28.38526, -9.23393], [28.9711, -8.66935], [28.88917, -8.4831], [30.79243, -8.27382], [30.2567, -7.14121], [29.52552, -6.2731], [29.43673, -4.44845], [29.23708, -3.75856], [29.21463, -3.3514], [29.25633, -3.05471], [29.17258, -2.99385], [29.16037, -2.95457], [29.09797, -2.91935], [29.09119, -2.87871], [29.0505, -2.81774], [29.00404, -2.81978], [29.00167, -2.78523], [29.04081, -2.7416], [29.00357, -2.70596], [28.94346, -2.69124], [28.89793, -2.66111], [28.90226, -2.62385], [28.89288, -2.55848], [28.87943, -2.55165], [28.86193, -2.53185], [28.86209, -2.5231], [28.87497, -2.50887], [28.88846, -2.50493], [28.89342, -2.49017], [28.89132, -2.47557], [28.86846, -2.44866], [28.86826, -2.41888], [28.89601, -2.37321], [28.95642, -2.37321], [29.00051, -2.29001], [29.105, -2.27043], [29.17562, -2.12278], [29.11847, -1.90576], [29.24458, -1.69663], [29.24323, -1.66826], [29.36322, -1.50887], [29.45038, -1.5054], [29.53062, -1.40499], [29.59061, -1.39016], [29.58388, -0.89821], [29.63006, -0.8997], [29.62708, -0.71055], [29.67176, -0.55714], [29.67474, -0.47969], [29.65091, -0.46777], [29.72687, -0.08051], [29.7224, 0.07291], [29.77454, 0.16675], [29.81922, 0.16824], [29.87284, 0.39166], [29.97413, 0.52124], [29.95477, 0.64486], [29.98307, 0.84295], [30.1484, 0.89805], [30.22139, 0.99635], [30.24671, 1.14974], [30.48503, 1.21675], [31.30127, 2.11006], [31.28042, 2.17853], [31.20148, 2.2217], [31.1985, 2.29462], [31.12104, 2.27676], [31.07934, 2.30207], [31.06593, 2.35862], [30.96911, 2.41071], [30.91102, 2.33332], [30.83059, 2.42559], [30.74271, 2.43601], [30.75612, 2.5863], [30.8857, 2.83923], [30.8574, 2.9508], [30.77101, 3.04897], [30.84251, 3.26908], [30.93486, 3.40737], [30.94081, 3.50847], [30.85153, 3.48867], [30.85997, 3.5743], [30.80713, 3.60506], [30.78512, 3.67097], [30.56277, 3.62703], [30.57378, 3.74567], [30.55396, 3.84451], [30.47691, 3.83353], [30.27658, 3.95653], [30.22374, 3.93896], [30.1621, 4.10586], [30.06964, 4.13221], [29.79666, 4.37809], [29.82087, 4.56246], [29.49726, 4.7007], [29.43341, 4.50101], [29.22207, 4.34297], [29.03054, 4.48784], [28.8126, 4.48784], [28.6651, 4.42638], [28.20719, 4.35614], [27.79551, 4.59976], [27.76469, 4.79284], [27.65462, 4.89375], [27.56656, 4.89375], [27.44012, 5.07349]]]] } },
23235 { type: "Feature", properties: { iso1A2: "CF", iso1A3: "CAF", iso1N3: "140", wikidata: "Q929", nameEn: "Central African Republic", groups: ["017", "202", "002", "UN"], callingCodes: ["236"] }, geometry: { type: "MultiPolygon", coordinates: [[[[22.87758, 10.91915], [22.45889, 11.00246], [21.72139, 10.64136], [21.71479, 10.29932], [21.63553, 10.217], [21.52766, 10.2105], [21.34934, 9.95907], [21.26348, 9.97642], [20.82979, 9.44696], [20.36748, 9.11019], [19.06421, 9.00367], [18.86388, 8.87971], [19.11044, 8.68172], [18.79783, 8.25929], [18.67455, 8.22226], [18.62612, 8.14163], [18.64153, 8.08714], [18.6085, 8.05009], [18.02731, 8.01085], [17.93926, 7.95853], [17.67288, 7.98905], [16.8143, 7.53971], [16.6668, 7.67281], [16.658, 7.75353], [16.59415, 7.76444], [16.58315, 7.88657], [16.41583, 7.77971], [16.40703, 7.68809], [15.79942, 7.44149], [15.73118, 7.52006], [15.49743, 7.52179], [15.23397, 7.25135], [15.04717, 6.77085], [14.96311, 6.75693], [14.79966, 6.39043], [14.80122, 6.34866], [14.74206, 6.26356], [14.56149, 6.18928], [14.43073, 6.08867], [14.42917, 6.00508], [14.49455, 5.91683], [14.60974, 5.91838], [14.62375, 5.70466], [14.58951, 5.59777], [14.62531, 5.51411], [14.52724, 5.28319], [14.57083, 5.23979], [14.65489, 5.21343], [14.73383, 4.6135], [15.00825, 4.41458], [15.08609, 4.30282], [15.10644, 4.1362], [15.17482, 4.05131], [15.07686, 4.01805], [15.73522, 3.24348], [15.77725, 3.26835], [16.05449, 3.02306], [16.08252, 2.45708], [16.19357, 2.21537], [16.50126, 2.84739], [16.46701, 2.92512], [16.57598, 3.47999], [16.68283, 3.54257], [17.01746, 3.55136], [17.35649, 3.63045], [17.46876, 3.70515], [17.60966, 3.63705], [17.83421, 3.61068], [17.85842, 3.53378], [18.05656, 3.56893], [18.14902, 3.54476], [18.17323, 3.47665], [18.24148, 3.50302], [18.2723, 3.57992], [18.39558, 3.58212], [18.49245, 3.63924], [18.58711, 3.49423], [18.62755, 3.47564], [20.60184, 4.42394], [20.90383, 4.44877], [21.08793, 4.39603], [21.11214, 4.33895], [21.21341, 4.29285], [21.25744, 4.33676], [21.55904, 4.25553], [21.6405, 4.317], [22.10721, 4.20723], [22.27682, 4.11347], [22.45504, 4.13039], [22.5431, 4.22041], [22.60915, 4.48821], [22.6928, 4.47285], [22.78526, 4.71423], [22.84691, 4.69887], [22.89094, 4.79321], [22.94817, 4.82392], [23.38847, 4.60013], [24.46719, 5.0915], [24.71816, 4.90509], [25.31256, 5.03668], [25.34558, 5.29101], [25.53271, 5.37431], [25.86073, 5.19455], [26.13371, 5.25594], [26.48595, 5.04984], [26.74572, 5.10685], [26.85579, 5.03887], [26.93064, 5.13535], [27.09575, 5.22305], [27.44012, 5.07349], [27.26886, 5.25876], [27.23017, 5.37167], [27.28621, 5.56382], [27.22705, 5.62889], [27.22705, 5.71254], [26.51721, 6.09655], [26.58259, 6.1987], [26.32729, 6.36272], [26.38022, 6.63493], [25.90076, 7.09549], [25.37461, 7.33024], [25.35281, 7.42595], [25.20337, 7.50312], [25.20649, 7.61115], [25.29214, 7.66675], [25.25319, 7.8487], [24.98855, 7.96588], [24.85156, 8.16933], [24.35965, 8.26177], [24.13238, 8.36959], [24.25691, 8.69288], [23.51905, 8.71749], [23.59065, 8.99743], [23.44744, 8.99128], [23.4848, 9.16959], [23.56263, 9.19418], [23.64358, 9.28637], [23.64981, 9.44303], [23.62179, 9.53823], [23.69155, 9.67566], [23.67164, 9.86923], [23.3128, 10.45214], [23.02221, 10.69235], [22.87758, 10.91915]]]] } },
23236 { type: "Feature", properties: { iso1A2: "CG", iso1A3: "COG", iso1N3: "178", wikidata: "Q971", nameEn: "Republic of the Congo", groups: ["017", "202", "002", "UN"], callingCodes: ["242"] }, geometry: { type: "MultiPolygon", coordinates: [[[[18.62755, 3.47564], [18.58711, 3.49423], [18.49245, 3.63924], [18.39558, 3.58212], [18.2723, 3.57992], [18.24148, 3.50302], [18.17323, 3.47665], [18.14902, 3.54476], [18.05656, 3.56893], [17.85842, 3.53378], [17.83421, 3.61068], [17.60966, 3.63705], [17.46876, 3.70515], [17.35649, 3.63045], [17.01746, 3.55136], [16.68283, 3.54257], [16.57598, 3.47999], [16.46701, 2.92512], [16.50126, 2.84739], [16.19357, 2.21537], [16.15568, 2.18955], [16.08563, 2.19733], [16.05294, 1.9811], [16.14634, 1.70259], [16.02647, 1.65591], [16.02959, 1.76483], [15.48942, 1.98265], [15.34776, 1.91264], [15.22634, 2.03243], [15.00996, 1.98887], [14.61145, 2.17866], [13.29457, 2.16106], [13.13461, 1.57238], [13.25447, 1.32339], [13.15519, 1.23368], [13.89582, 1.4261], [14.25186, 1.39842], [14.48179, 0.9152], [14.26066, 0.57255], [14.10909, 0.58563], [13.88648, 0.26652], [13.90632, -0.2287], [14.06862, -0.20826], [14.2165, -0.38261], [14.41887, -0.44799], [14.52569, -0.57818], [14.41838, -1.89412], [14.25932, -1.97624], [14.23518, -2.15671], [14.16202, -2.23916], [14.23829, -2.33715], [14.10442, -2.49268], [13.85846, -2.46935], [13.92073, -2.35581], [13.75884, -2.09293], [13.47977, -2.43224], [13.02759, -2.33098], [12.82172, -1.91091], [12.61312, -1.8129], [12.44656, -1.92025], [12.47925, -2.32626], [12.04895, -2.41704], [11.96866, -2.33559], [11.74605, -2.39936], [11.57637, -2.33379], [11.64487, -2.61865], [11.5359, -2.85654], [11.64798, -2.81146], [11.80365, -3.00424], [11.70558, -3.0773], [11.70227, -3.17465], [11.96554, -3.30267], [11.8318, -3.5812], [11.92719, -3.62768], [11.87083, -3.71571], [11.68608, -3.68942], [11.57949, -3.52798], [11.48764, -3.51089], [11.22301, -3.69888], [11.12647, -3.94169], [10.75913, -4.39519], [11.50888, -5.33417], [12.00924, -5.02627], [12.16068, -4.90089], [12.20901, -4.75642], [12.25587, -4.79437], [12.32324, -4.78415], [12.40964, -4.60609], [12.64835, -4.55937], [12.76844, -4.38709], [12.87096, -4.40315], [12.91489, -4.47907], [13.09648, -4.63739], [13.11182, -4.5942], [13.41764, -4.89897], [13.50305, -4.77818], [13.70417, -4.72601], [13.71794, -4.44864], [13.81162, -4.41842], [13.9108, -4.50906], [14.40672, -4.28381], [14.3957, -4.36623], [14.47284, -4.42941], [14.37366, -4.56125], [14.41499, -4.8825], [14.5059, -4.84956], [14.67948, -4.92093], [14.83101, -4.80838], [15.1978, -4.32388], [15.25411, -4.31121], [15.32693, -4.27282], [15.41785, -4.28381], [15.48121, -4.22062], [15.53081, -4.042], [15.89448, -3.9513], [16.21407, -3.2969], [16.1755, -3.25014], [16.22785, -2.59528], [16.16173, -2.16586], [16.50336, -1.8795], [16.70724, -1.45815], [16.97999, -1.12762], [17.32438, -0.99265], [17.72112, -0.52707], [17.66051, -0.26535], [17.81204, 0.23884], [17.93877, 0.32424], [17.95255, 0.48128], [17.86989, 0.58873], [17.85887, 1.04327], [18.08034, 1.58553], [18.10683, 2.26876], [18.63857, 3.19342], [18.62755, 3.47564]]]] } },
23237 { type: "Feature", geometry: { type: "MultiPolygon", coordinates: [[[[8.72809, 47.69282], [8.72617, 47.69651], [8.73671, 47.7169], [8.70543, 47.73121], [8.74251, 47.75168], [8.71778, 47.76571], [8.68985, 47.75686], [8.68022, 47.78599], [8.65292, 47.80066], [8.64425, 47.76398], [8.62408, 47.7626], [8.61657, 47.79998], [8.56415, 47.80633], [8.56814, 47.78001], [8.48868, 47.77215], [8.45771, 47.7493], [8.44807, 47.72426], [8.40569, 47.69855], [8.4211, 47.68407], [8.40473, 47.67499], [8.41346, 47.66676], [8.42264, 47.66667], [8.44711, 47.65379], [8.4667, 47.65747], [8.46605, 47.64103], [8.49656, 47.64709], [8.5322, 47.64687], [8.52801, 47.66059], [8.56141, 47.67088], [8.57683, 47.66158], [8.6052, 47.67258], [8.61113, 47.66332], [8.62884, 47.65098], [8.62049, 47.63757], [8.60412, 47.63735], [8.61471, 47.64514], [8.60701, 47.65271], [8.59545, 47.64298], [8.60348, 47.61204], [8.57586, 47.59537], [8.55756, 47.62394], [8.51686, 47.63476], [8.50747, 47.61897], [8.45578, 47.60121], [8.46637, 47.58389], [8.48949, 47.588], [8.49431, 47.58107], [8.43235, 47.56617], [8.39477, 47.57826], [8.38273, 47.56608], [8.35512, 47.57014], [8.32735, 47.57133], [8.30277, 47.58607], [8.29524, 47.5919], [8.29722, 47.60603], [8.2824, 47.61225], [8.26313, 47.6103], [8.25863, 47.61571], [8.23809, 47.61204], [8.22577, 47.60385], [8.22011, 47.6181], [8.20617, 47.62141], [8.19378, 47.61636], [8.1652, 47.5945], [8.14947, 47.59558], [8.13823, 47.59147], [8.13662, 47.58432], [8.11543, 47.5841], [8.10395, 47.57918], [8.10002, 47.56504], [8.08557, 47.55768], [8.06663, 47.56374], [8.04383, 47.55443], [8.02136, 47.55096], [8.00113, 47.55616], [7.97581, 47.55493], [7.95682, 47.55789], [7.94494, 47.54511], [7.91251, 47.55031], [7.90673, 47.57674], [7.88664, 47.58854], [7.84412, 47.5841], [7.81901, 47.58798], [7.79486, 47.55691], [7.75261, 47.54599], [7.71961, 47.54219], [7.69642, 47.53297], [7.68101, 47.53232], [7.6656, 47.53752], [7.66174, 47.54554], [7.65083, 47.54662], [7.63338, 47.56256], [7.67655, 47.56435], [7.68904, 47.57133], [7.67115, 47.5871], [7.68486, 47.59601], [7.69385, 47.60099], [7.68229, 47.59905], [7.67395, 47.59212], [7.64599, 47.59695], [7.64213, 47.5944], [7.64309, 47.59151], [7.61929, 47.57683], [7.60459, 47.57869], [7.60523, 47.58519], [7.58945, 47.59017], [7.58386, 47.57536], [7.56684, 47.57785], [7.56548, 47.57617], [7.55689, 47.57232], [7.55652, 47.56779], [7.53634, 47.55553], [7.52831, 47.55347], [7.51723, 47.54578], [7.50873, 47.54546], [7.49691, 47.53821], [7.50588, 47.52856], [7.51904, 47.53515], [7.53199, 47.5284], [7.5229, 47.51644], [7.49804, 47.51798], [7.51076, 47.49651], [7.47534, 47.47932], [7.43356, 47.49712], [7.42923, 47.48628], [7.4583, 47.47216], [7.4462, 47.46264], [7.43088, 47.45846], [7.40308, 47.43638], [7.35603, 47.43432], [7.33526, 47.44186], [7.24669, 47.4205], [7.17026, 47.44312], [7.19583, 47.49455], [7.16249, 47.49025], [7.12781, 47.50371], [7.07425, 47.48863], [7.0231, 47.50522], [6.98425, 47.49432], [7.0024, 47.45264], [6.93953, 47.43388], [6.93744, 47.40714], [6.88542, 47.37262], [6.87959, 47.35335], [7.03125, 47.36996], [7.0564, 47.35134], [7.05305, 47.33304], [6.94316, 47.28747], [6.95108, 47.26428], [6.9508, 47.24338], [6.8489, 47.15933], [6.76788, 47.1208], [6.68823, 47.06616], [6.71531, 47.0494], [6.43341, 46.92703], [6.46456, 46.88865], [6.43216, 46.80336], [6.45209, 46.77502], [6.38351, 46.73171], [6.27135, 46.68251], [6.11084, 46.57649], [6.1567, 46.54402], [6.07269, 46.46244], [6.08427, 46.44305], [6.06407, 46.41676], [6.09926, 46.40768], [6.15016, 46.3778], [6.15985, 46.37721], [6.16987, 46.36759], [6.15738, 46.3491], [6.13876, 46.33844], [6.1198, 46.31157], [6.11697, 46.29547], [6.1013, 46.28512], [6.11926, 46.2634], [6.12446, 46.25059], [6.10071, 46.23772], [6.08563, 46.24651], [6.07072, 46.24085], [6.0633, 46.24583], [6.05029, 46.23518], [6.04602, 46.23127], [6.03342, 46.2383], [6.02461, 46.23313], [5.97542, 46.21525], [5.96515, 46.19638], [5.99573, 46.18587], [5.98846, 46.17046], [5.98188, 46.17392], [5.97508, 46.15863], [5.9641, 46.14412], [5.95781, 46.12925], [5.97893, 46.13303], [5.9871, 46.14499], [6.01791, 46.14228], [6.03614, 46.13712], [6.04564, 46.14031], [6.05203, 46.15191], [6.07491, 46.14879], [6.09199, 46.15191], [6.09926, 46.14373], [6.13397, 46.1406], [6.15305, 46.15194], [6.18116, 46.16187], [6.18871, 46.16644], [6.18707, 46.17999], [6.19552, 46.18401], [6.19807, 46.18369], [6.20539, 46.19163], [6.21114, 46.1927], [6.21273, 46.19409], [6.21603, 46.19507], [6.21844, 46.19837], [6.22222, 46.19888], [6.22175, 46.20045], [6.23544, 46.20714], [6.23913, 46.20511], [6.24821, 46.20531], [6.26007, 46.21165], [6.27694, 46.21566], [6.29663, 46.22688], [6.31041, 46.24417], [6.29474, 46.26221], [6.26749, 46.24745], [6.24952, 46.26255], [6.23775, 46.27822], [6.25137, 46.29014], [6.24826, 46.30175], [6.21981, 46.31304], [6.25432, 46.3632], [6.53358, 46.45431], [6.82312, 46.42661], [6.8024, 46.39171], [6.77152, 46.34784], [6.86052, 46.28512], [6.78968, 46.14058], [6.89321, 46.12548], [6.87868, 46.03855], [6.93862, 46.06502], [7.00946, 45.9944], [7.04151, 45.92435], [7.10685, 45.85653], [7.56343, 45.97421], [7.85949, 45.91485], [7.9049, 45.99945], [7.98881, 45.99867], [8.02906, 46.10331], [8.11383, 46.11577], [8.16866, 46.17817], [8.08814, 46.26692], [8.31162, 46.38044], [8.30648, 46.41587], [8.42464, 46.46367], [8.46317, 46.43712], [8.45032, 46.26869], [8.62242, 46.12112], [8.75697, 46.10395], [8.80778, 46.10085], [8.85617, 46.0748], [8.79414, 46.00913], [8.78585, 45.98973], [8.79362, 45.99207], [8.8319, 45.9879], [8.85121, 45.97239], [8.86688, 45.96135], [8.88904, 45.95465], [8.93649, 45.86775], [8.94372, 45.86587], [8.93504, 45.86245], [8.91129, 45.8388], [8.94737, 45.84285], [8.9621, 45.83707], [8.99663, 45.83466], [9.00324, 45.82055], [9.0298, 45.82127], [9.03279, 45.82865], [9.03793, 45.83548], [9.03505, 45.83976], [9.04059, 45.8464], [9.04546, 45.84968], [9.06642, 45.8761], [9.09065, 45.89906], [8.99257, 45.9698], [9.01618, 46.04928], [9.24503, 46.23616], [9.29226, 46.32717], [9.25502, 46.43743], [9.28136, 46.49685], [9.36128, 46.5081], [9.40487, 46.46621], [9.45936, 46.50873], [9.46117, 46.37481], [9.57015, 46.2958], [9.71273, 46.29266], [9.73086, 46.35071], [9.95249, 46.38045], [10.07055, 46.21668], [10.14439, 46.22992], [10.17862, 46.25626], [10.10506, 46.3372], [10.165, 46.41051], [10.03715, 46.44479], [10.10307, 46.61003], [10.23674, 46.63484], [10.25309, 46.57432], [10.46136, 46.53164], [10.49375, 46.62049], [10.44686, 46.64162], [10.40475, 46.63671], [10.38659, 46.67847], [10.47197, 46.85698], [10.48376, 46.93891], [10.36933, 47.00212], [10.30031, 46.92093], [10.24128, 46.93147], [10.22675, 46.86942], [10.10715, 46.84296], [9.98058, 46.91434], [9.88266, 46.93343], [9.87935, 47.01337], [9.60717, 47.06091], [9.55721, 47.04762], [9.54041, 47.06495], [9.47548, 47.05257], [9.47139, 47.06402], [9.51362, 47.08505], [9.52089, 47.10019], [9.51044, 47.13727], [9.48774, 47.17402], [9.4891, 47.19346], [9.50318, 47.22153], [9.52406, 47.24959], [9.53116, 47.27029], [9.54773, 47.2809], [9.55857, 47.29919], [9.58513, 47.31334], [9.59978, 47.34671], [9.62476, 47.36639], [9.65427, 47.36824], [9.66243, 47.37136], [9.6711, 47.37824], [9.67445, 47.38429], [9.67334, 47.39191], [9.6629, 47.39591], [9.65136, 47.40504], [9.65043, 47.41937], [9.6446, 47.43233], [9.64483, 47.43842], [9.65863, 47.44847], [9.65728, 47.45383], [9.6423, 47.45599], [9.62475, 47.45685], [9.62158, 47.45858], [9.60841, 47.47178], [9.60484, 47.46358], [9.60205, 47.46165], [9.59482, 47.46305], [9.58208, 47.48344], [9.56312, 47.49495], [9.55125, 47.53629], [9.25619, 47.65939], [9.18203, 47.65598], [9.17593, 47.65399], [9.1755, 47.65584], [9.1705, 47.65513], [9.15181, 47.66904], [9.13845, 47.66389], [9.09891, 47.67801], [9.02093, 47.6868], [8.94093, 47.65596], [8.89946, 47.64769], [8.87625, 47.65441], [8.87383, 47.67045], [8.85065, 47.68209], [8.86989, 47.70504], [8.82002, 47.71458], [8.80663, 47.73821], [8.77309, 47.72059], [8.76965, 47.7075], [8.79966, 47.70222], [8.79511, 47.67462], [8.75856, 47.68969], [8.72809, 47.69282]], [[8.95861, 45.96485], [8.96668, 45.98436], [8.97741, 45.98317], [8.97604, 45.96151], [8.95861, 45.96485]], [[8.70847, 47.68904], [8.68985, 47.69552], [8.66837, 47.68437], [8.65769, 47.68928], [8.67508, 47.6979], [8.66416, 47.71367], [8.70237, 47.71453], [8.71773, 47.69088], [8.70847, 47.68904]]]] }, properties: { iso1A2: "CH", iso1A3: "CHE", iso1N3: "756", wikidata: "Q39", nameEn: "Switzerland", groups: ["155", "150", "UN"], callingCodes: ["41"] } },
23238 { type: "Feature", properties: { iso1A2: "CI", iso1A3: "CIV", iso1N3: "384", wikidata: "Q1008", nameEn: "C\xF4te d'Ivoire", groups: ["011", "202", "002", "UN"], callingCodes: ["225"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-7.52774, 3.7105], [-3.34019, 4.17519], [-3.10675, 5.08515], [-3.11073, 5.12675], [-3.063, 5.13665], [-2.96554, 5.10397], [-2.95261, 5.12477], [-2.75502, 5.10657], [-2.73074, 5.1364], [-2.77625, 5.34621], [-2.72737, 5.34789], [-2.76614, 5.60963], [-2.85378, 5.65156], [-2.93132, 5.62137], [-2.96671, 5.6415], [-2.95323, 5.71865], [-3.01896, 5.71697], [-3.25999, 6.62521], [-3.21954, 6.74407], [-3.23327, 6.81744], [-2.95438, 7.23737], [-2.97822, 7.27165], [-2.92339, 7.60847], [-2.79467, 7.86002], [-2.78395, 7.94974], [-2.74819, 7.92613], [-2.67787, 8.02055], [-2.61232, 8.02645], [-2.62901, 8.11495], [-2.49037, 8.20872], [-2.58243, 8.7789], [-2.66357, 9.01771], [-2.77799, 9.04949], [-2.69814, 9.22717], [-2.68802, 9.49343], [-2.76494, 9.40778], [-2.93012, 9.57403], [-3.00765, 9.74019], [-3.16609, 9.85147], [-3.19306, 9.93781], [-3.27228, 9.84981], [-3.31779, 9.91125], [-3.69703, 9.94279], [-4.25999, 9.76012], [-4.31392, 9.60062], [-4.6426, 9.70696], [-4.96621, 9.89132], [-4.96453, 9.99923], [-5.12465, 10.29788], [-5.39602, 10.2929], [-5.51058, 10.43177], [-5.65135, 10.46767], [-5.78124, 10.43952], [-5.99478, 10.19694], [-6.18851, 10.24244], [-6.1731, 10.46983], [-6.24795, 10.74248], [-6.325, 10.68624], [-6.40646, 10.69922], [-6.42847, 10.5694], [-6.52974, 10.59104], [-6.63541, 10.66893], [-6.68164, 10.35074], [-6.93921, 10.35291], [-7.01186, 10.25111], [-6.97444, 10.21644], [-7.00966, 10.15794], [-7.0603, 10.14711], [-7.13331, 10.24877], [-7.3707, 10.24677], [-7.44555, 10.44602], [-7.52261, 10.4655], [-7.54462, 10.40921], [-7.63048, 10.46334], [-7.92107, 10.15577], [-7.97971, 10.17117], [-8.01225, 10.1021], [-8.11921, 10.04577], [-8.15652, 9.94288], [-8.09434, 9.86936], [-8.14657, 9.55062], [-8.03463, 9.39604], [-7.85056, 9.41812], [-7.90777, 9.20456], [-7.73862, 9.08422], [-7.92518, 8.99332], [-7.95503, 8.81146], [-7.69882, 8.66148], [-7.65653, 8.36873], [-7.92518, 8.50652], [-8.22991, 8.48438], [-8.2411, 8.24196], [-8.062, 8.16071], [-7.98675, 8.20134], [-7.99919, 8.11023], [-7.94695, 8.00925], [-8.06449, 8.04989], [-8.13414, 7.87991], [-8.09931, 7.78626], [-8.21374, 7.54466], [-8.4003, 7.6285], [-8.47114, 7.55676], [-8.41935, 7.51203], [-8.37458, 7.25794], [-8.29249, 7.1691], [-8.31736, 6.82837], [-8.59456, 6.50612], [-8.48652, 6.43797], [-8.45666, 6.49977], [-8.38453, 6.35887], [-8.3298, 6.36381], [-8.17557, 6.28222], [-8.00642, 6.31684], [-7.90692, 6.27728], [-7.83478, 6.20309], [-7.8497, 6.08932], [-7.79747, 6.07696], [-7.78254, 5.99037], [-7.70294, 5.90625], [-7.67309, 5.94337], [-7.48155, 5.80974], [-7.46165, 5.84934], [-7.43677, 5.84687], [-7.43926, 5.74787], [-7.37209, 5.61173], [-7.43428, 5.42355], [-7.36463, 5.32944], [-7.46165, 5.26256], [-7.48901, 5.14118], [-7.55369, 5.08667], [-7.53876, 4.94294], [-7.59349, 4.8909], [-7.53259, 4.35145], [-7.52774, 3.7105]]]] } },
23239 { type: "Feature", properties: { iso1A2: "CK", iso1A3: "COK", iso1N3: "184", wikidata: "Q26988", nameEn: "Cook Islands", country: "NZ", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["682"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-168.15106, -10.26955], [-156.45576, -31.75456], [-156.48634, -15.52824], [-156.50903, -7.4975], [-168.15106, -10.26955]]]] } },
23240 { type: "Feature", properties: { iso1A2: "CL", iso1A3: "CHL", iso1N3: "152", wikidata: "Q298", nameEn: "Chile", groups: ["005", "419", "019", "UN"], callingCodes: ["56"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-68.60702, -52.65781], [-68.41683, -52.33516], [-69.97824, -52.00845], [-71.99889, -51.98018], [-72.33873, -51.59954], [-72.31343, -50.58411], [-73.15765, -50.78337], [-73.55259, -49.92488], [-73.45156, -49.79461], [-73.09655, -49.14342], [-72.56894, -48.81116], [-72.54042, -48.52392], [-72.27662, -48.28727], [-72.50478, -47.80586], [-71.94152, -47.13595], [-71.68577, -46.55385], [-71.75614, -45.61611], [-71.35687, -45.22075], [-72.06985, -44.81756], [-71.26418, -44.75684], [-71.16436, -44.46244], [-71.81318, -44.38097], [-71.64206, -43.64774], [-72.14828, -42.85321], [-72.15541, -42.15941], [-71.74901, -42.11711], [-71.92726, -40.72714], [-71.37826, -38.91474], [-70.89532, -38.6923], [-71.24279, -37.20264], [-70.95047, -36.4321], [-70.38008, -36.02375], [-70.49416, -35.24145], [-69.87386, -34.13344], [-69.88099, -33.34489], [-70.55832, -31.51559], [-70.14479, -30.36595], [-69.8596, -30.26131], [-69.99507, -29.28351], [-69.80969, -29.07185], [-69.66709, -28.44055], [-69.22504, -27.95042], [-68.77586, -27.16029], [-68.43363, -27.08414], [-68.27677, -26.90626], [-68.59048, -26.49861], [-68.56909, -26.28146], [-68.38372, -26.15353], [-68.57622, -25.32505], [-68.38372, -25.08636], [-68.56909, -24.69831], [-68.24825, -24.42596], [-67.33563, -24.04237], [-66.99632, -22.99839], [-67.18382, -22.81525], [-67.54284, -22.89771], [-67.85114, -22.87076], [-68.18816, -21.28614], [-68.40403, -20.94562], [-68.53957, -20.91542], [-68.55383, -20.7355], [-68.44023, -20.62701], [-68.7276, -20.46178], [-68.74273, -20.08817], [-68.57132, -20.03134], [-68.54611, -19.84651], [-68.66761, -19.72118], [-68.41218, -19.40499], [-68.61989, -19.27584], [-68.80602, -19.08355], [-68.87082, -19.06003], [-68.94987, -18.93302], [-69.07432, -18.28259], [-69.14807, -18.16893], [-69.07496, -18.03715], [-69.28671, -17.94844], [-69.34126, -17.72753], [-69.46623, -17.60518], [-69.46897, -17.4988], [-69.66483, -17.65083], [-69.79087, -17.65563], [-69.82868, -17.72048], [-69.75305, -17.94605], [-69.81607, -18.12582], [-69.96732, -18.25992], [-70.16394, -18.31737], [-70.31267, -18.31258], [-70.378, -18.3495], [-70.59118, -18.35072], [-113.52687, -26.52828], [-68.11646, -58.14883], [-66.07313, -55.19618], [-67.11046, -54.94199], [-67.46182, -54.92205], [-68.01394, -54.8753], [-68.60733, -54.9125], [-68.60702, -52.65781]]]] } },
23241 { type: "Feature", properties: { iso1A2: "CM", iso1A3: "CMR", iso1N3: "120", wikidata: "Q1009", nameEn: "Cameroon", groups: ["017", "202", "002", "UN"], callingCodes: ["237"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.83314, 12.62963], [14.55058, 12.78256], [14.56101, 12.91036], [14.46881, 13.08259], [14.08251, 13.0797], [14.20204, 12.53405], [14.17523, 12.41916], [14.22215, 12.36533], [14.4843, 12.35223], [14.6474, 12.17466], [14.61612, 11.7798], [14.55207, 11.72001], [14.64591, 11.66166], [14.6124, 11.51283], [14.17821, 11.23831], [13.97489, 11.30258], [13.78945, 11.00154], [13.7403, 11.00593], [13.70753, 10.94451], [13.73434, 10.9255], [13.54964, 10.61236], [13.5705, 10.53183], [13.43644, 10.13326], [13.34111, 10.12299], [13.25025, 10.03647], [13.25323, 10.00127], [13.286, 9.9822], [13.27409, 9.93232], [13.24132, 9.91031], [13.25025, 9.86042], [13.29941, 9.8296], [13.25472, 9.76795], [13.22642, 9.57266], [13.02385, 9.49334], [12.85628, 9.36698], [12.91958, 9.33905], [12.90022, 9.11411], [12.81085, 8.91992], [12.79, 8.75361], [12.71701, 8.7595], [12.68722, 8.65938], [12.44146, 8.6152], [12.4489, 8.52536], [12.26123, 8.43696], [12.24782, 8.17904], [12.19271, 8.10826], [12.20909, 7.97553], [11.99908, 7.67302], [12.01844, 7.52981], [11.93205, 7.47812], [11.84864, 7.26098], [11.87396, 7.09398], [11.63117, 6.9905], [11.55818, 6.86186], [11.57755, 6.74059], [11.51499, 6.60892], [11.42264, 6.5882], [11.42041, 6.53789], [11.09495, 6.51717], [11.09644, 6.68437], [10.94302, 6.69325], [10.8179, 6.83377], [10.83727, 6.9358], [10.60789, 7.06885], [10.59746, 7.14719], [10.57214, 7.16345], [10.53639, 6.93432], [10.21466, 6.88996], [10.15135, 7.03781], [9.86314, 6.77756], [9.77824, 6.79088], [9.70674, 6.51717], [9.51757, 6.43874], [8.84209, 5.82562], [8.88156, 5.78857], [8.83687, 5.68483], [8.92029, 5.58403], [8.78027, 5.1243], [8.60302, 4.87353], [8.34397, 4.30689], [9.22018, 3.72052], [9.81162, 2.33797], [9.82123, 2.35097], [9.83754, 2.32428], [9.83238, 2.29079], [9.84716, 2.24676], [9.89012, 2.20457], [9.90749, 2.20049], [9.991, 2.16561], [11.3561, 2.17217], [11.37116, 2.29975], [13.28534, 2.25716], [13.29457, 2.16106], [14.61145, 2.17866], [15.00996, 1.98887], [15.22634, 2.03243], [15.34776, 1.91264], [15.48942, 1.98265], [16.02959, 1.76483], [16.02647, 1.65591], [16.14634, 1.70259], [16.05294, 1.9811], [16.08563, 2.19733], [16.15568, 2.18955], [16.19357, 2.21537], [16.08252, 2.45708], [16.05449, 3.02306], [15.77725, 3.26835], [15.73522, 3.24348], [15.07686, 4.01805], [15.17482, 4.05131], [15.10644, 4.1362], [15.08609, 4.30282], [15.00825, 4.41458], [14.73383, 4.6135], [14.65489, 5.21343], [14.57083, 5.23979], [14.52724, 5.28319], [14.62531, 5.51411], [14.58951, 5.59777], [14.62375, 5.70466], [14.60974, 5.91838], [14.49455, 5.91683], [14.42917, 6.00508], [14.43073, 6.08867], [14.56149, 6.18928], [14.74206, 6.26356], [14.80122, 6.34866], [14.79966, 6.39043], [14.96311, 6.75693], [15.04717, 6.77085], [15.23397, 7.25135], [15.49743, 7.52179], [15.56964, 7.58936], [15.59272, 7.7696], [15.50743, 7.79302], [15.20426, 8.50892], [15.09484, 8.65982], [14.83566, 8.80557], [14.35707, 9.19611], [14.37094, 9.2954], [13.97544, 9.6365], [14.01793, 9.73169], [14.1317, 9.82413], [14.20411, 10.00055], [14.4673, 10.00264], [14.80082, 9.93818], [14.95722, 9.97926], [15.05999, 9.94845], [15.14043, 9.99246], [15.24618, 9.99246], [15.41408, 9.92876], [15.68761, 9.99344], [15.50535, 10.1098], [15.30874, 10.31063], [15.23724, 10.47764], [15.14936, 10.53915], [15.15532, 10.62846], [15.06737, 10.80921], [15.09127, 10.87431], [15.04957, 11.02347], [15.10021, 11.04101], [15.0585, 11.40481], [15.13149, 11.5537], [15.06595, 11.71126], [15.11579, 11.79313], [15.04808, 11.8731], [15.05786, 12.0608], [15.0349, 12.10698], [15.00146, 12.1223], [14.96952, 12.0925], [14.89019, 12.16593], [14.90827, 12.3269], [14.83314, 12.62963]]]] } },
23242 { type: "Feature", properties: { iso1A2: "CN", iso1A3: "CHN", iso1N3: "156", wikidata: "Q148", nameEn: "People's Republic of China" }, geometry: null },
23243 { type: "Feature", properties: { iso1A2: "CO", iso1A3: "COL", iso1N3: "170", wikidata: "Q739", nameEn: "Colombia", groups: ["005", "419", "019", "UN"], callingCodes: ["57"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.19849, 12.65801], [-81.58685, 18.0025], [-82.06974, 14.49418], [-82.56142, 11.91792], [-78.79327, 9.93766], [-77.58292, 9.22278], [-77.32389, 8.81247], [-77.45064, 8.49991], [-77.17257, 7.97422], [-77.57185, 7.51147], [-77.72514, 7.72348], [-77.72157, 7.47612], [-77.81426, 7.48319], [-77.89178, 7.22681], [-78.06168, 7.07793], [-82.12561, 4.00341], [-78.87137, 1.47457], [-78.42749, 1.15389], [-77.85677, 0.80197], [-77.7148, 0.85003], [-77.68613, 0.83029], [-77.66416, 0.81604], [-77.67815, 0.73863], [-77.49984, 0.64476], [-77.52001, 0.40782], [-76.89177, 0.24736], [-76.4094, 0.24015], [-76.41215, 0.38228], [-76.23441, 0.42294], [-75.82927, 0.09578], [-75.25764, -0.11943], [-75.18513, -0.0308], [-74.42701, -0.50218], [-74.26675, -0.97229], [-73.65312, -1.26222], [-72.92587, -2.44514], [-71.75223, -2.15058], [-70.94377, -2.23142], [-70.04609, -2.73906], [-70.71396, -3.7921], [-70.52393, -3.87553], [-70.3374, -3.79505], [-69.94708, -4.2431], [-69.43395, -1.42219], [-69.4215, -1.01853], [-69.59796, -0.75136], [-69.603, -0.51947], [-70.03658, -0.19681], [-70.04162, 0.55437], [-69.47696, 0.71065], [-69.20976, 0.57958], [-69.14422, 0.84172], [-69.26017, 1.06856], [-69.82987, 1.07864], [-69.83491, 1.69353], [-69.53746, 1.76408], [-69.38621, 1.70865], [-68.18128, 1.72881], [-68.26699, 1.83463], [-68.18632, 2.00091], [-67.9292, 1.82455], [-67.40488, 2.22258], [-67.299, 1.87494], [-67.15784, 1.80439], [-67.08222, 1.17441], [-66.85795, 1.22998], [-67.21967, 2.35778], [-67.65696, 2.81691], [-67.85862, 2.79173], [-67.85862, 2.86727], [-67.30945, 3.38393], [-67.50067, 3.75812], [-67.62671, 3.74303], [-67.85358, 4.53249], [-67.83341, 5.31104], [-67.59141, 5.5369], [-67.63914, 5.64963], [-67.58558, 5.84537], [-67.43513, 5.98835], [-67.4625, 6.20625], [-67.60654, 6.2891], [-69.41843, 6.1072], [-70.10716, 6.96516], [-70.7596, 7.09799], [-71.03941, 6.98163], [-71.37234, 7.01588], [-71.42212, 7.03854], [-71.44118, 7.02116], [-71.82441, 7.04314], [-72.04895, 7.03837], [-72.19437, 7.37034], [-72.43132, 7.40034], [-72.47415, 7.48928], [-72.45321, 7.57232], [-72.47827, 7.65604], [-72.46763, 7.79518], [-72.44454, 7.86031], [-72.46183, 7.90682], [-72.45806, 7.91141], [-72.47042, 7.92306], [-72.48183, 7.92909], [-72.48801, 7.94329], [-72.47213, 7.96106], [-72.39137, 8.03534], [-72.35163, 8.01163], [-72.36987, 8.19976], [-72.4042, 8.36513], [-72.65474, 8.61428], [-72.77415, 9.10165], [-72.94052, 9.10663], [-73.02119, 9.27584], [-73.36905, 9.16636], [-72.98085, 9.85253], [-72.88002, 10.44309], [-72.4767, 11.1117], [-72.24983, 11.14138], [-71.9675, 11.65536], [-71.3275, 11.85], [-70.92579, 11.96275], [-71.19849, 12.65801]]]] } },
23244 { type: "Feature", properties: { iso1A2: "CP", iso1A3: "CPT", wikidata: "Q161258", nameEn: "Clipperton Island", country: "FR", groups: ["EU", "013", "003", "019", "UN"], isoStatus: "excRes" }, geometry: { type: "MultiPolygon", coordinates: [[[[-110.36279, 9.79626], [-108.755, 9.84085], [-109.04145, 11.13245], [-110.36279, 9.79626]]]] } },
23245 { type: "Feature", properties: { iso1A2: "CR", iso1A3: "CRI", iso1N3: "188", wikidata: "Q800", nameEn: "Costa Rica", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["506"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-83.68276, 11.01562], [-83.66597, 10.79916], [-83.90838, 10.71161], [-84.68197, 11.07568], [-84.92439, 10.9497], [-85.60529, 11.22607], [-85.71223, 11.06868], [-86.14524, 11.09059], [-87.41779, 5.02401], [-82.94503, 7.93865], [-82.89978, 8.04083], [-82.89137, 8.05755], [-82.88641, 8.10219], [-82.9388, 8.26634], [-83.05209, 8.33394], [-82.93056, 8.43465], [-82.8679, 8.44042], [-82.8382, 8.48117], [-82.83322, 8.52464], [-82.83975, 8.54755], [-82.82739, 8.60153], [-82.8794, 8.6981], [-82.92068, 8.74832], [-82.91377, 8.774], [-82.88253, 8.83331], [-82.72126, 8.97125], [-82.93516, 9.07687], [-82.93516, 9.46741], [-82.84871, 9.4973], [-82.87919, 9.62645], [-82.77206, 9.59573], [-82.66667, 9.49746], [-82.61345, 9.49881], [-82.56507, 9.57279], [-82.51044, 9.65379], [-83.54024, 10.96805], [-83.68276, 11.01562]]]] } },
23246 { type: "Feature", properties: { iso1A2: "CU", iso1A3: "CUB", iso1N3: "192", wikidata: "Q241", nameEn: "Cuba", groups: ["029", "003", "419", "019", "UN"], callingCodes: ["53"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-73.62304, 20.6935], [-82.02215, 24.23074], [-85.77883, 21.92705], [-74.81171, 18.82201], [-73.62304, 20.6935]]]] } },
23247 { type: "Feature", properties: { iso1A2: "CV", iso1A3: "CPV", iso1N3: "132", wikidata: "Q1011", nameEn: "Cape Verde", groups: ["Q105472", "011", "202", "002", "UN"], callingCodes: ["238"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-28.81604, 14.57305], [-20.39702, 14.12816], [-23.37101, 19.134], [-28.81604, 14.57305]]]] } },
23248 { type: "Feature", properties: { iso1A2: "CW", iso1A3: "CUW", iso1N3: "531", wikidata: "Q25279", nameEn: "Cura\xE7ao", aliases: ["NL-CW"], country: "NL", groups: ["Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["599"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-68.90012, 12.62309], [-69.59009, 12.46019], [-68.99639, 11.79035], [-68.33524, 11.78151], [-68.90012, 12.62309]]]] } },
23249 { type: "Feature", properties: { iso1A2: "CX", iso1A3: "CXR", iso1N3: "162", wikidata: "Q31063", nameEn: "Christmas Island", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["61"] }, geometry: { type: "MultiPolygon", coordinates: [[[[105.66835, -9.31927], [104.67494, -11.2566], [106.66176, -11.14349], [105.66835, -9.31927]]]] } },
23250 { type: "Feature", properties: { iso1A2: "CY", iso1A3: "CYP", iso1N3: "196", wikidata: "Q229", nameEn: "Republic of Cyprus", groups: ["Q644636", "EU", "145", "142", "UN"], driveSide: "left", callingCodes: ["357"] }, geometry: { type: "MultiPolygon", coordinates: [[[[32.46489, 35.48584], [30.15137, 34.08517], [32.74412, 34.43926], [32.75515, 34.64985], [32.76136, 34.68318], [32.79433, 34.67883], [32.82717, 34.70622], [32.86014, 34.70585], [32.86167, 34.68734], [32.9068, 34.66102], [32.91398, 34.67343], [32.93043, 34.67091], [32.92807, 34.66736], [32.93449, 34.66241], [32.93693, 34.67027], [32.94379, 34.67111], [32.94683, 34.67907], [32.95539, 34.68471], [32.99135, 34.68061], [32.98668, 34.67268], [32.99014, 34.65518], [32.97736, 34.65277], [32.97079, 34.66112], [32.95325, 34.66462], [32.94796, 34.6587], [32.94976, 34.65204], [32.95471, 34.64528], [32.95323, 34.64075], [32.95891, 34.62919], [32.96718, 34.63446], [32.96968, 34.64046], [33.0138, 34.64424], [33.26744, 34.49942], [33.83531, 34.73974], [33.70575, 34.97947], [33.70639, 34.99303], [33.71514, 35.00294], [33.69731, 35.01754], [33.69938, 35.03123], [33.67678, 35.03866], [33.63765, 35.03869], [33.61215, 35.0527], [33.59658, 35.03635], [33.567, 35.04803], [33.57478, 35.06049], [33.53975, 35.08151], [33.48915, 35.06594], [33.47666, 35.00701], [33.45256, 35.00288], [33.45178, 35.02078], [33.47825, 35.04103], [33.48136, 35.0636], [33.46813, 35.10564], [33.41675, 35.16325], [33.4076, 35.20062], [33.38575, 35.2018], [33.37248, 35.18698], [33.3717, 35.1788], [33.36569, 35.17479], [33.35612, 35.17402], [33.35596, 35.17942], [33.34964, 35.17803], [33.35056, 35.18328], [33.31955, 35.18096], [33.3072, 35.16816], [33.27068, 35.16815], [33.15138, 35.19504], [33.11105, 35.15639], [33.08249, 35.17319], [33.01192, 35.15639], [32.94471, 35.09422], [32.86406, 35.1043], [32.85733, 35.07742], [32.70779, 35.14127], [32.70947, 35.18328], [32.64864, 35.19967], [32.60361, 35.16647], [32.46489, 35.48584]]], [[[33.74144, 35.01053], [33.7492, 35.01319], [33.74983, 35.02274], [33.74265, 35.02329], [33.73781, 35.02181], [33.7343, 35.01178], [33.74144, 35.01053]]], [[[33.77312, 34.9976], [33.75994, 35.00113], [33.75682, 34.99916], [33.76605, 34.99543], [33.76738, 34.99188], [33.7778, 34.98981], [33.77843, 34.988], [33.78149, 34.98854], [33.78318, 34.98699], [33.78571, 34.98951], [33.78917, 34.98854], [33.79191, 34.98914], [33.78516, 34.99582], [33.77553, 34.99518], [33.77312, 34.9976]]]] } },
23251 { type: "Feature", properties: { iso1A2: "CZ", iso1A3: "CZE", iso1N3: "203", wikidata: "Q213", nameEn: "Czechia", groups: ["EU", "151", "150", "UN"], callingCodes: ["420"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.82803, 50.86966], [14.79139, 50.81438], [14.70661, 50.84096], [14.61993, 50.86049], [14.63434, 50.8883], [14.65259, 50.90513], [14.64802, 50.93241], [14.58024, 50.91443], [14.56374, 50.922], [14.59702, 50.96148], [14.59908, 50.98685], [14.58215, 50.99306], [14.56432, 51.01008], [14.53438, 51.00374], [14.53321, 51.01679], [14.49873, 51.02242], [14.50809, 51.0427], [14.49991, 51.04692], [14.49154, 51.04382], [14.49202, 51.02286], [14.45827, 51.03712], [14.41335, 51.02086], [14.30098, 51.05515], [14.25665, 50.98935], [14.28776, 50.97718], [14.32353, 50.98556], [14.32793, 50.97379], [14.30251, 50.96606], [14.31422, 50.95243], [14.39848, 50.93866], [14.38691, 50.89907], [14.30098, 50.88448], [14.27123, 50.89386], [14.24314, 50.88761], [14.22331, 50.86049], [14.02982, 50.80662], [13.98864, 50.8177], [13.89113, 50.78533], [13.89444, 50.74142], [13.82942, 50.7251], [13.76316, 50.73487], [13.70204, 50.71771], [13.65977, 50.73096], [13.52474, 50.70394], [13.53748, 50.67654], [13.5226, 50.64721], [13.49742, 50.63133], [13.46413, 50.60102], [13.42189, 50.61243], [13.37485, 50.64931], [13.37805, 50.627], [13.32264, 50.60317], [13.32594, 50.58009], [13.29454, 50.57904], [13.25158, 50.59268], [13.19043, 50.50237], [13.13424, 50.51709], [13.08301, 50.50132], [13.0312, 50.50944], [13.02038, 50.4734], [13.02147, 50.44763], [12.98433, 50.42016], [12.94058, 50.40944], [12.82465, 50.45738], [12.73476, 50.43237], [12.73044, 50.42268], [12.70731, 50.39948], [12.67261, 50.41949], [12.51356, 50.39694], [12.48747, 50.37278], [12.49214, 50.35228], [12.48256, 50.34784], [12.46643, 50.35527], [12.43722, 50.33774], [12.43371, 50.32506], [12.39924, 50.32302], [12.40158, 50.29521], [12.36594, 50.28289], [12.35425, 50.23993], [12.33263, 50.24367], [12.32445, 50.20442], [12.33847, 50.19432], [12.32596, 50.17146], [12.29232, 50.17524], [12.28063, 50.19544], [12.28755, 50.22429], [12.23943, 50.24594], [12.24791, 50.25525], [12.26953, 50.25189], [12.25119, 50.27079], [12.20823, 50.2729], [12.18013, 50.32146], [12.10907, 50.32041], [12.13716, 50.27396], [12.09287, 50.25032], [12.19335, 50.19997], [12.21484, 50.16399], [12.1917, 50.13434], [12.2073, 50.10315], [12.23709, 50.10213], [12.27433, 50.0771], [12.26111, 50.06331], [12.30798, 50.05719], [12.49908, 49.97305], [12.47264, 49.94222], [12.55197, 49.92094], [12.48256, 49.83575], [12.46603, 49.78882], [12.40489, 49.76321], [12.4462, 49.70233], [12.52553, 49.68415], [12.53544, 49.61888], [12.56188, 49.6146], [12.60155, 49.52887], [12.64782, 49.52565], [12.64121, 49.47628], [12.669, 49.42935], [12.71227, 49.42363], [12.75854, 49.3989], [12.78168, 49.34618], [12.88414, 49.33541], [12.88249, 49.35479], [12.94859, 49.34079], [13.03618, 49.30417], [13.02957, 49.27399], [13.05883, 49.26259], [13.17665, 49.16713], [13.17019, 49.14339], [13.20405, 49.12303], [13.23689, 49.11412], [13.28242, 49.1228], [13.39479, 49.04812], [13.40802, 48.98851], [13.50221, 48.93752], [13.50552, 48.97441], [13.58319, 48.96899], [13.61624, 48.9462], [13.67739, 48.87886], [13.73854, 48.88538], [13.76994, 48.83537], [13.78977, 48.83319], [13.8096, 48.77877], [13.84023, 48.76988], [14.06151, 48.66873], [14.01482, 48.63788], [14.09104, 48.5943], [14.20691, 48.5898], [14.33909, 48.55852], [14.43076, 48.58855], [14.4587, 48.64695], [14.56139, 48.60429], [14.60808, 48.62881], [14.66762, 48.58215], [14.71794, 48.59794], [14.72756, 48.69502], [14.80584, 48.73489], [14.80821, 48.77711], [14.81545, 48.7874], [14.94773, 48.76268], [14.95641, 48.75915], [14.9758, 48.76857], [14.98112, 48.77524], [14.9782, 48.7766], [14.98032, 48.77959], [14.95072, 48.79101], [14.98917, 48.90082], [14.97612, 48.96983], [14.99878, 49.01444], [15.15534, 48.99056], [15.16358, 48.94278], [15.26177, 48.95766], [15.28305, 48.98831], [15.34823, 48.98444], [15.48027, 48.94481], [15.51357, 48.91549], [15.61622, 48.89541], [15.6921, 48.85973], [15.75341, 48.8516], [15.78087, 48.87644], [15.84404, 48.86921], [16.06034, 48.75436], [16.37345, 48.729], [16.40915, 48.74576], [16.46134, 48.80865], [16.67008, 48.77699], [16.68518, 48.7281], [16.71883, 48.73806], [16.79779, 48.70998], [16.90354, 48.71541], [16.93955, 48.60371], [17.00215, 48.70887], [17.11202, 48.82925], [17.19355, 48.87602], [17.29054, 48.85546], [17.3853, 48.80936], [17.45671, 48.85004], [17.5295, 48.81117], [17.7094, 48.86721], [17.73126, 48.87885], [17.77944, 48.92318], [17.87831, 48.92679], [17.91814, 49.01784], [18.06885, 49.03157], [18.1104, 49.08624], [18.15022, 49.24518], [18.18456, 49.28909], [18.36446, 49.3267], [18.4139, 49.36517], [18.4084, 49.40003], [18.44686, 49.39467], [18.54848, 49.47059], [18.53063, 49.49022], [18.57183, 49.51162], [18.6144, 49.49824], [18.67757, 49.50895], [18.74761, 49.492], [18.84521, 49.51672], [18.84786, 49.5446], [18.80479, 49.6815], [18.72838, 49.68163], [18.69817, 49.70473], [18.62676, 49.71983], [18.62943, 49.74603], [18.62645, 49.75002], [18.61368, 49.75426], [18.61278, 49.7618], [18.57183, 49.83334], [18.60341, 49.86256], [18.57045, 49.87849], [18.57697, 49.91565], [18.54299, 49.92537], [18.54495, 49.9079], [18.53423, 49.89906], [18.41604, 49.93498], [18.33562, 49.94747], [18.33278, 49.92415], [18.31914, 49.91565], [18.27794, 49.93863], [18.27107, 49.96779], [18.21752, 49.97309], [18.20241, 49.99958], [18.10628, 50.00223], [18.07898, 50.04535], [18.03212, 50.06574], [18.00396, 50.04954], [18.04585, 50.03311], [18.04585, 50.01194], [18.00191, 50.01723], [17.86886, 49.97452], [17.77669, 50.02253], [17.7506, 50.07896], [17.6888, 50.12037], [17.66683, 50.10275], [17.59404, 50.16437], [17.70528, 50.18812], [17.76296, 50.23382], [17.72176, 50.25665], [17.74648, 50.29966], [17.69292, 50.32859], [17.67764, 50.28977], [17.58889, 50.27837], [17.3702, 50.28123], [17.34548, 50.2628], [17.34273, 50.32947], [17.27681, 50.32246], [17.19991, 50.3654], [17.19579, 50.38817], [17.14498, 50.38117], [17.1224, 50.39494], [16.89229, 50.45117], [16.85933, 50.41093], [16.90877, 50.38642], [16.94448, 50.31281], [16.99803, 50.30316], [17.02138, 50.27772], [16.99803, 50.25753], [17.02825, 50.23118], [17.00353, 50.21449], [16.98018, 50.24172], [16.8456, 50.20834], [16.7014, 50.09659], [16.63137, 50.1142], [16.55446, 50.16613], [16.56407, 50.21009], [16.42674, 50.32509], [16.39379, 50.3207], [16.3622, 50.34875], [16.36495, 50.37679], [16.30289, 50.38292], [16.28118, 50.36891], [16.22821, 50.41054], [16.21585, 50.40627], [16.19526, 50.43291], [16.31413, 50.50274], [16.34572, 50.49575], [16.44597, 50.58041], [16.33611, 50.66579], [16.23174, 50.67101], [16.20839, 50.63096], [16.10265, 50.66405], [16.02437, 50.60046], [15.98317, 50.61528], [16.0175, 50.63009], [15.97219, 50.69799], [15.87331, 50.67188], [15.81683, 50.75666], [15.73186, 50.73885], [15.43798, 50.80833], [15.3803, 50.77187], [15.36656, 50.83956], [15.2773, 50.8907], [15.27043, 50.97724], [15.2361, 50.99886], [15.1743, 50.9833], [15.16744, 51.01959], [15.11937, 50.99021], [15.10152, 51.01095], [15.06218, 51.02269], [15.03895, 51.0123], [15.02433, 51.0242], [14.96419, 50.99108], [15.01088, 50.97984], [14.99852, 50.86817], [14.82803, 50.86966]]]] } },
23252 { type: "Feature", properties: { iso1A2: "DE", iso1A3: "DEU", iso1N3: "276", wikidata: "Q183", nameEn: "Germany", groups: ["EU", "155", "150", "UN"], callingCodes: ["49"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.70847, 47.68904], [8.71773, 47.69088], [8.70237, 47.71453], [8.66416, 47.71367], [8.67508, 47.6979], [8.65769, 47.68928], [8.66837, 47.68437], [8.68985, 47.69552], [8.70847, 47.68904]]], [[[8.72617, 47.69651], [8.72809, 47.69282], [8.75856, 47.68969], [8.79511, 47.67462], [8.79966, 47.70222], [8.76965, 47.7075], [8.77309, 47.72059], [8.80663, 47.73821], [8.82002, 47.71458], [8.86989, 47.70504], [8.85065, 47.68209], [8.87383, 47.67045], [8.87625, 47.65441], [8.89946, 47.64769], [8.94093, 47.65596], [9.02093, 47.6868], [9.09891, 47.67801], [9.13845, 47.66389], [9.15181, 47.66904], [9.1705, 47.65513], [9.1755, 47.65584], [9.17593, 47.65399], [9.18203, 47.65598], [9.25619, 47.65939], [9.55125, 47.53629], [9.72736, 47.53457], [9.76748, 47.5934], [9.80254, 47.59419], [9.82591, 47.58158], [9.8189, 47.54688], [9.87499, 47.52953], [9.87733, 47.54688], [9.92407, 47.53111], [9.96029, 47.53899], [10.00003, 47.48216], [10.03859, 47.48927], [10.07131, 47.45531], [10.09001, 47.46005], [10.1052, 47.4316], [10.06897, 47.40709], [10.09819, 47.35724], [10.11805, 47.37228], [10.16362, 47.36674], [10.17648, 47.38889], [10.2127, 47.38019], [10.22774, 47.38904], [10.23757, 47.37609], [10.19998, 47.32832], [10.2147, 47.31014], [10.17648, 47.29149], [10.17531, 47.27167], [10.23257, 47.27088], [10.33424, 47.30813], [10.39851, 47.37623], [10.4324, 47.38494], [10.4359, 47.41183], [10.47446, 47.43318], [10.46278, 47.47901], [10.44291, 47.48453], [10.4324, 47.50111], [10.44992, 47.5524], [10.43473, 47.58394], [10.47329, 47.58552], [10.48849, 47.54057], [10.56912, 47.53584], [10.60337, 47.56755], [10.63456, 47.5591], [10.68832, 47.55752], [10.6965, 47.54253], [10.7596, 47.53228], [10.77596, 47.51729], [10.88814, 47.53701], [10.91268, 47.51334], [10.86945, 47.5015], [10.87061, 47.4786], [10.90918, 47.48571], [10.93839, 47.48018], [10.92437, 47.46991], [10.98513, 47.42882], [10.97111, 47.41617], [10.97111, 47.39561], [11.11835, 47.39719], [11.12536, 47.41222], [11.20482, 47.43198], [11.25157, 47.43277], [11.22002, 47.3964], [11.27844, 47.39956], [11.29597, 47.42566], [11.33804, 47.44937], [11.4175, 47.44621], [11.38128, 47.47465], [11.4362, 47.51413], [11.52618, 47.50939], [11.58578, 47.52281], [11.58811, 47.55515], [11.60681, 47.57881], [11.63934, 47.59202], [11.84052, 47.58354], [11.85572, 47.60166], [12.0088, 47.62451], [12.02282, 47.61033], [12.05788, 47.61742], [12.13734, 47.60639], [12.17824, 47.61506], [12.18145, 47.61019], [12.17737, 47.60121], [12.18568, 47.6049], [12.20398, 47.60667], [12.20801, 47.61082], [12.19895, 47.64085], [12.18507, 47.65984], [12.18347, 47.66663], [12.16769, 47.68167], [12.16217, 47.70105], [12.18303, 47.70065], [12.22571, 47.71776], [12.2542, 47.7433], [12.26238, 47.73544], [12.24017, 47.69534], [12.26004, 47.67725], [12.27991, 47.68827], [12.336, 47.69534], [12.37222, 47.68433], [12.43883, 47.6977], [12.44117, 47.6741], [12.50076, 47.62293], [12.53816, 47.63553], [12.57438, 47.63238], [12.6071, 47.6741], [12.7357, 47.6787], [12.77777, 47.66689], [12.76492, 47.64485], [12.82101, 47.61493], [12.77427, 47.58025], [12.80699, 47.54477], [12.84672, 47.54556], [12.85256, 47.52741], [12.9624, 47.47452], [12.98344, 47.48716], [12.9998, 47.46267], [13.04537, 47.49426], [13.03252, 47.53373], [13.05355, 47.56291], [13.04537, 47.58183], [13.06641, 47.58577], [13.06407, 47.60075], [13.09562, 47.63304], [13.07692, 47.68814], [13.01382, 47.72116], [12.98578, 47.7078], [12.92969, 47.71094], [12.91333, 47.7178], [12.90274, 47.72513], [12.91711, 47.74026], [12.9353, 47.74788], [12.94371, 47.76281], [12.93202, 47.77302], [12.96311, 47.79957], [12.98543, 47.82896], [13.00588, 47.84374], [12.94163, 47.92927], [12.93886, 47.94046], [12.93642, 47.94436], [12.93419, 47.94063], [12.92668, 47.93879], [12.91985, 47.94069], [12.9211, 47.95135], [12.91683, 47.95647], [12.87476, 47.96195], [12.8549, 48.01122], [12.76141, 48.07373], [12.74973, 48.10885], [12.7617, 48.12796], [12.78595, 48.12445], [12.80676, 48.14979], [12.82673, 48.15245], [12.8362, 48.15876], [12.836, 48.1647], [12.84475, 48.16556], [12.87126, 48.20318], [12.95306, 48.20629], [13.02083, 48.25689], [13.0851, 48.27711], [13.126, 48.27867], [13.18093, 48.29577], [13.26039, 48.29422], [13.30897, 48.31575], [13.40709, 48.37292], [13.43929, 48.43386], [13.42527, 48.45711], [13.45727, 48.51092], [13.43695, 48.55776], [13.45214, 48.56472], [13.46967, 48.55157], [13.50663, 48.57506], [13.50131, 48.58091], [13.51291, 48.59023], [13.57535, 48.55912], [13.59705, 48.57013], [13.62508, 48.55501], [13.65186, 48.55092], [13.66113, 48.53558], [13.72802, 48.51208], [13.74816, 48.53058], [13.7513, 48.5624], [13.76921, 48.55324], [13.80519, 48.58026], [13.80038, 48.59487], [13.82609, 48.62345], [13.81901, 48.6761], [13.81283, 48.68426], [13.81791, 48.69832], [13.79337, 48.71375], [13.81863, 48.73257], [13.82266, 48.75544], [13.84023, 48.76988], [13.8096, 48.77877], [13.78977, 48.83319], [13.76994, 48.83537], [13.73854, 48.88538], [13.67739, 48.87886], [13.61624, 48.9462], [13.58319, 48.96899], [13.50552, 48.97441], [13.50221, 48.93752], [13.40802, 48.98851], [13.39479, 49.04812], [13.28242, 49.1228], [13.23689, 49.11412], [13.20405, 49.12303], [13.17019, 49.14339], [13.17665, 49.16713], [13.05883, 49.26259], [13.02957, 49.27399], [13.03618, 49.30417], [12.94859, 49.34079], [12.88249, 49.35479], [12.88414, 49.33541], [12.78168, 49.34618], [12.75854, 49.3989], [12.71227, 49.42363], [12.669, 49.42935], [12.64121, 49.47628], [12.64782, 49.52565], [12.60155, 49.52887], [12.56188, 49.6146], [12.53544, 49.61888], [12.52553, 49.68415], [12.4462, 49.70233], [12.40489, 49.76321], [12.46603, 49.78882], [12.48256, 49.83575], [12.55197, 49.92094], [12.47264, 49.94222], [12.49908, 49.97305], [12.30798, 50.05719], [12.26111, 50.06331], [12.27433, 50.0771], [12.23709, 50.10213], [12.2073, 50.10315], [12.1917, 50.13434], [12.21484, 50.16399], [12.19335, 50.19997], [12.09287, 50.25032], [12.13716, 50.27396], [12.10907, 50.32041], [12.18013, 50.32146], [12.20823, 50.2729], [12.25119, 50.27079], [12.26953, 50.25189], [12.24791, 50.25525], [12.23943, 50.24594], [12.28755, 50.22429], [12.28063, 50.19544], [12.29232, 50.17524], [12.32596, 50.17146], [12.33847, 50.19432], [12.32445, 50.20442], [12.33263, 50.24367], [12.35425, 50.23993], [12.36594, 50.28289], [12.40158, 50.29521], [12.39924, 50.32302], [12.43371, 50.32506], [12.43722, 50.33774], [12.46643, 50.35527], [12.48256, 50.34784], [12.49214, 50.35228], [12.48747, 50.37278], [12.51356, 50.39694], [12.67261, 50.41949], [12.70731, 50.39948], [12.73044, 50.42268], [12.73476, 50.43237], [12.82465, 50.45738], [12.94058, 50.40944], [12.98433, 50.42016], [13.02147, 50.44763], [13.02038, 50.4734], [13.0312, 50.50944], [13.08301, 50.50132], [13.13424, 50.51709], [13.19043, 50.50237], [13.25158, 50.59268], [13.29454, 50.57904], [13.32594, 50.58009], [13.32264, 50.60317], [13.37805, 50.627], [13.37485, 50.64931], [13.42189, 50.61243], [13.46413, 50.60102], [13.49742, 50.63133], [13.5226, 50.64721], [13.53748, 50.67654], [13.52474, 50.70394], [13.65977, 50.73096], [13.70204, 50.71771], [13.76316, 50.73487], [13.82942, 50.7251], [13.89444, 50.74142], [13.89113, 50.78533], [13.98864, 50.8177], [14.02982, 50.80662], [14.22331, 50.86049], [14.24314, 50.88761], [14.27123, 50.89386], [14.30098, 50.88448], [14.38691, 50.89907], [14.39848, 50.93866], [14.31422, 50.95243], [14.30251, 50.96606], [14.32793, 50.97379], [14.32353, 50.98556], [14.28776, 50.97718], [14.25665, 50.98935], [14.30098, 51.05515], [14.41335, 51.02086], [14.45827, 51.03712], [14.49202, 51.02286], [14.49154, 51.04382], [14.49991, 51.04692], [14.50809, 51.0427], [14.49873, 51.02242], [14.53321, 51.01679], [14.53438, 51.00374], [14.56432, 51.01008], [14.58215, 50.99306], [14.59908, 50.98685], [14.59702, 50.96148], [14.56374, 50.922], [14.58024, 50.91443], [14.64802, 50.93241], [14.65259, 50.90513], [14.63434, 50.8883], [14.61993, 50.86049], [14.70661, 50.84096], [14.79139, 50.81438], [14.82803, 50.86966], [14.81664, 50.88148], [14.89681, 50.9422], [14.89252, 50.94999], [14.92942, 50.99744], [14.95529, 51.04552], [14.97938, 51.07742], [14.98229, 51.11354], [14.99689, 51.12205], [14.99079, 51.14284], [14.99646, 51.14365], [15.00083, 51.14974], [14.99414, 51.15813], [14.99311, 51.16249], [15.0047, 51.16874], [15.01242, 51.21285], [15.04288, 51.28387], [14.98008, 51.33449], [14.96899, 51.38367], [14.9652, 51.44793], [14.94749, 51.47155], [14.73219, 51.52922], [14.72652, 51.53902], [14.73047, 51.54606], [14.71125, 51.56209], [14.7727, 51.61263], [14.75759, 51.62318], [14.75392, 51.67445], [14.69065, 51.70842], [14.66386, 51.73282], [14.64625, 51.79472], [14.60493, 51.80473], [14.59089, 51.83302], [14.6588, 51.88359], [14.6933, 51.9044], [14.70601, 51.92944], [14.7177, 51.94048], [14.72163, 51.95188], [14.71836, 51.95606], [14.7139, 51.95643], [14.70488, 51.97679], [14.71339, 52.00337], [14.76026, 52.06624], [14.72971, 52.09167], [14.6917, 52.10283], [14.67683, 52.13936], [14.70616, 52.16927], [14.68344, 52.19612], [14.71319, 52.22144], [14.70139, 52.25038], [14.58149, 52.28007], [14.56378, 52.33838], [14.55228, 52.35264], [14.54423, 52.42568], [14.63056, 52.48993], [14.60081, 52.53116], [14.6289, 52.57136], [14.61073, 52.59847], [14.22071, 52.81175], [14.13806, 52.82392], [14.12256, 52.84311], [14.15873, 52.87715], [14.14056, 52.95786], [14.25954, 53.00264], [14.35044, 53.05829], [14.38679, 53.13669], [14.36696, 53.16444], [14.37853, 53.20405], [14.40662, 53.21098], [14.45125, 53.26241], [14.44133, 53.27427], [14.4215, 53.27724], [14.35209, 53.49506], [14.3273, 53.50587], [14.30416, 53.55499], [14.31904, 53.61581], [14.2853, 53.63392], [14.28477, 53.65955], [14.27133, 53.66613], [14.2836, 53.67721], [14.26782, 53.69866], [14.27249, 53.74464], [14.21323, 53.8664], [14.20823, 53.90776], [14.18544, 53.91258], [14.20647, 53.91671], [14.22634, 53.9291], [14.20811, 54.12784], [13.93395, 54.84044], [12.85844, 54.82438], [11.90309, 54.38543], [11.00303, 54.63689], [10.31111, 54.65968], [10.16755, 54.73883], [9.89314, 54.84171], [9.73563, 54.8247], [9.61187, 54.85548], [9.62734, 54.88057], [9.58937, 54.88785], [9.4659, 54.83131], [9.43155, 54.82586], [9.41213, 54.84254], [9.38532, 54.83968], [9.36496, 54.81749], [9.33849, 54.80233], [9.32771, 54.80602], [9.2474, 54.8112], [9.23445, 54.83432], [9.24631, 54.84726], [9.20571, 54.85841], [9.14275, 54.87421], [9.04629, 54.87249], [8.92795, 54.90452], [8.81178, 54.90518], [8.76387, 54.8948], [8.63979, 54.91069], [8.55769, 54.91837], [8.45719, 55.06747], [8.02459, 55.09613], [5.45168, 54.20039], [6.91025, 53.44221], [7.00198, 53.32672], [7.19052, 53.31866], [7.21679, 53.20058], [7.22681, 53.18165], [7.17898, 53.13817], [7.21694, 53.00742], [7.07253, 52.81083], [7.04557, 52.63318], [6.77307, 52.65375], [6.71641, 52.62905], [6.69507, 52.488], [6.94293, 52.43597], [6.99041, 52.47235], [7.03417, 52.40237], [7.07044, 52.37805], [7.02703, 52.27941], [7.06365, 52.23789], [7.03729, 52.22695], [6.9897, 52.2271], [6.97189, 52.20329], [6.83984, 52.11728], [6.76117, 52.11895], [6.68128, 52.05052], [6.83035, 51.9905], [6.82357, 51.96711], [6.72319, 51.89518], [6.68386, 51.91861], [6.58556, 51.89386], [6.50231, 51.86313], [6.47179, 51.85395], [6.38815, 51.87257], [6.40704, 51.82771], [6.30593, 51.84998], [6.29872, 51.86801], [6.21443, 51.86801], [6.15349, 51.90439], [6.11551, 51.89769], [6.16902, 51.84094], [6.10337, 51.84829], [6.06705, 51.86136], [5.99848, 51.83195], [5.94568, 51.82786], [5.98665, 51.76944], [5.95003, 51.7493], [6.04091, 51.71821], [6.02767, 51.6742], [6.11759, 51.65609], [6.09055, 51.60564], [6.18017, 51.54096], [6.21724, 51.48568], [6.20654, 51.40049], [6.22641, 51.39948], [6.22674, 51.36135], [6.16977, 51.33169], [6.07889, 51.24432], [6.07889, 51.17038], [6.17384, 51.19589], [6.16706, 51.15677], [5.98292, 51.07469], [5.9541, 51.03496], [5.9134, 51.06736], [5.86735, 51.05182], [5.87849, 51.01969], [5.90493, 51.00198], [5.90296, 50.97356], [5.95282, 50.98728], [6.02697, 50.98303], [6.01615, 50.93367], [6.09297, 50.92066], [6.07486, 50.89307], [6.08805, 50.87223], [6.07693, 50.86025], [6.07431, 50.84674], [6.05702, 50.85179], [6.05623, 50.8572], [6.01921, 50.84435], [6.02328, 50.81694], [6.00462, 50.80065], [5.98404, 50.80988], [5.97497, 50.79992], [6.02624, 50.77453], [6.01976, 50.75398], [6.03889, 50.74618], [6.0326, 50.72647], [6.0406, 50.71848], [6.04428, 50.72861], [6.11707, 50.72231], [6.17852, 50.6245], [6.26957, 50.62444], [6.2476, 50.60392], [6.24888, 50.59869], [6.24005, 50.58732], [6.22581, 50.5907], [6.20281, 50.56952], [6.17739, 50.55875], [6.17802, 50.54179], [6.19735, 50.53576], [6.19579, 50.5313], [6.18716, 50.52653], [6.19193, 50.5212], [6.20599, 50.52089], [6.22335, 50.49578], [6.26637, 50.50272], [6.30809, 50.50058], [6.3465, 50.48833], [6.34005, 50.46083], [6.37219, 50.45397], [6.36852, 50.40776], [6.34406, 50.37994], [6.3688, 50.35898], [6.40785, 50.33557], [6.40641, 50.32425], [6.35701, 50.31139], [6.32488, 50.32333], [6.29949, 50.30887], [6.28797, 50.27458], [6.208, 50.25179], [6.16853, 50.2234], [6.18364, 50.20815], [6.18739, 50.1822], [6.14588, 50.17106], [6.14132, 50.14971], [6.15298, 50.14126], [6.1379, 50.12964], [6.12055, 50.09171], [6.11274, 50.05916], [6.13458, 50.04141], [6.13044, 50.02929], [6.14666, 50.02207], [6.13794, 50.01466], [6.13273, 50.02019], [6.1295, 50.01849], [6.13806, 50.01056], [6.14948, 50.00908], [6.14147, 49.99563], [6.1701, 49.98518], [6.16466, 49.97086], [6.17872, 49.9537], [6.18554, 49.95622], [6.18045, 49.96611], [6.19089, 49.96991], [6.19856, 49.95053], [6.22094, 49.94955], [6.22608, 49.929], [6.21882, 49.92403], [6.22926, 49.92096], [6.23496, 49.89972], [6.26146, 49.88203], [6.28874, 49.87592], [6.29692, 49.86685], [6.30963, 49.87021], [6.32303, 49.85133], [6.32098, 49.83728], [6.33585, 49.83785], [6.34267, 49.84974], [6.36576, 49.85032], [6.40022, 49.82029], [6.42521, 49.81591], [6.42905, 49.81091], [6.44131, 49.81443], [6.45425, 49.81164], [6.47111, 49.82263], [6.48718, 49.81267], [6.50647, 49.80916], [6.51215, 49.80124], [6.52121, 49.81338], [6.53122, 49.80666], [6.52169, 49.79787], [6.50534, 49.78952], [6.51669, 49.78336], [6.51056, 49.77515], [6.51828, 49.76855], [6.51646, 49.75961], [6.50174, 49.75292], [6.50193, 49.73291], [6.51805, 49.72425], [6.51397, 49.72058], [6.50261, 49.72718], [6.49535, 49.72645], [6.49694, 49.72205], [6.5042, 49.71808], [6.50647, 49.71353], [6.49785, 49.71118], [6.48014, 49.69767], [6.46048, 49.69092], [6.44654, 49.67799], [6.42937, 49.66857], [6.42726, 49.66078], [6.43768, 49.66021], [6.4413, 49.65722], [6.41861, 49.61723], [6.39822, 49.60081], [6.385, 49.59946], [6.37464, 49.58886], [6.38342, 49.5799], [6.38024, 49.57593], [6.36676, 49.57813], [6.35825, 49.57053], [6.38228, 49.55855], [6.38072, 49.55171], [6.35666, 49.52931], [6.36788, 49.50377], [6.36907, 49.48931], [6.36778, 49.46937], [6.38352, 49.46463], [6.39168, 49.4667], [6.40274, 49.46546], [6.42432, 49.47683], [6.55404, 49.42464], [6.533, 49.40748], [6.60091, 49.36864], [6.58807, 49.35358], [6.572, 49.35027], [6.60186, 49.31055], [6.66583, 49.28065], [6.69274, 49.21661], [6.71843, 49.2208], [6.73256, 49.20486], [6.71137, 49.18808], [6.73765, 49.16375], [6.78265, 49.16793], [6.83385, 49.15162], [6.84703, 49.15734], [6.86225, 49.18185], [6.85016, 49.19354], [6.85119, 49.20038], [6.83555, 49.21249], [6.85939, 49.22376], [6.89298, 49.20863], [6.91875, 49.22261], [6.93831, 49.2223], [6.94028, 49.21641], [6.95963, 49.203], [6.97273, 49.2099], [7.01318, 49.19018], [7.03459, 49.19096], [7.0274, 49.17042], [7.03178, 49.15734], [7.04662, 49.13724], [7.04409, 49.12123], [7.04843, 49.11422], [7.05548, 49.11185], [7.06642, 49.11415], [7.07162, 49.1255], [7.09007, 49.13094], [7.07859, 49.15031], [7.10715, 49.15631], [7.10384, 49.13787], [7.12504, 49.14253], [7.1358, 49.1282], [7.1593, 49.1204], [7.23473, 49.12971], [7.29514, 49.11426], [7.3195, 49.14231], [7.35995, 49.14399], [7.3662, 49.17308], [7.44052, 49.18354], [7.44455, 49.16765], [7.49473, 49.17], [7.49172, 49.13915], [7.53012, 49.09818], [7.56416, 49.08136], [7.62575, 49.07654], [7.63618, 49.05428], [7.75948, 49.04562], [7.79557, 49.06583], [7.86386, 49.03499], [7.93641, 49.05544], [7.97783, 49.03161], [8.14189, 48.97833], [8.22604, 48.97352], [8.20031, 48.95856], [8.19989, 48.95825], [8.12813, 48.87985], [8.10253, 48.81829], [8.06802, 48.78957], [8.0326, 48.79017], [8.01534, 48.76085], [7.96994, 48.75606], [7.96812, 48.72491], [7.89002, 48.66317], [7.84098, 48.64217], [7.80057, 48.5857], [7.80167, 48.54758], [7.80647, 48.51239], [7.76833, 48.48945], [7.73109, 48.39192], [7.74562, 48.32736], [7.69022, 48.30018], [7.6648, 48.22219], [7.57137, 48.12292], [7.56966, 48.03265], [7.62302, 47.97898], [7.55673, 47.87371], [7.52921, 47.77747], [7.54761, 47.72912], [7.53722, 47.71635], [7.51266, 47.70197], [7.51915, 47.68335], [7.52067, 47.66437], [7.53384, 47.65115], [7.5591, 47.63849], [7.57423, 47.61628], [7.58851, 47.60794], [7.59301, 47.60058], [7.58945, 47.59017], [7.60523, 47.58519], [7.60459, 47.57869], [7.61929, 47.57683], [7.64309, 47.59151], [7.64213, 47.5944], [7.64599, 47.59695], [7.67395, 47.59212], [7.68229, 47.59905], [7.69385, 47.60099], [7.68486, 47.59601], [7.67115, 47.5871], [7.68904, 47.57133], [7.67655, 47.56435], [7.63338, 47.56256], [7.65083, 47.54662], [7.66174, 47.54554], [7.6656, 47.53752], [7.68101, 47.53232], [7.69642, 47.53297], [7.71961, 47.54219], [7.75261, 47.54599], [7.79486, 47.55691], [7.81901, 47.58798], [7.84412, 47.5841], [7.88664, 47.58854], [7.90673, 47.57674], [7.91251, 47.55031], [7.94494, 47.54511], [7.95682, 47.55789], [7.97581, 47.55493], [8.00113, 47.55616], [8.02136, 47.55096], [8.04383, 47.55443], [8.06663, 47.56374], [8.08557, 47.55768], [8.10002, 47.56504], [8.10395, 47.57918], [8.11543, 47.5841], [8.13662, 47.58432], [8.13823, 47.59147], [8.14947, 47.59558], [8.1652, 47.5945], [8.19378, 47.61636], [8.20617, 47.62141], [8.22011, 47.6181], [8.22577, 47.60385], [8.23809, 47.61204], [8.25863, 47.61571], [8.26313, 47.6103], [8.2824, 47.61225], [8.29722, 47.60603], [8.29524, 47.5919], [8.30277, 47.58607], [8.32735, 47.57133], [8.35512, 47.57014], [8.38273, 47.56608], [8.39477, 47.57826], [8.43235, 47.56617], [8.49431, 47.58107], [8.48949, 47.588], [8.46637, 47.58389], [8.45578, 47.60121], [8.50747, 47.61897], [8.51686, 47.63476], [8.55756, 47.62394], [8.57586, 47.59537], [8.60348, 47.61204], [8.59545, 47.64298], [8.60701, 47.65271], [8.61471, 47.64514], [8.60412, 47.63735], [8.62049, 47.63757], [8.62884, 47.65098], [8.61113, 47.66332], [8.6052, 47.67258], [8.57683, 47.66158], [8.56141, 47.67088], [8.52801, 47.66059], [8.5322, 47.64687], [8.49656, 47.64709], [8.46605, 47.64103], [8.4667, 47.65747], [8.44711, 47.65379], [8.42264, 47.66667], [8.41346, 47.66676], [8.40473, 47.67499], [8.4211, 47.68407], [8.40569, 47.69855], [8.44807, 47.72426], [8.45771, 47.7493], [8.48868, 47.77215], [8.56814, 47.78001], [8.56415, 47.80633], [8.61657, 47.79998], [8.62408, 47.7626], [8.64425, 47.76398], [8.65292, 47.80066], [8.68022, 47.78599], [8.68985, 47.75686], [8.71778, 47.76571], [8.74251, 47.75168], [8.70543, 47.73121], [8.73671, 47.7169], [8.72617, 47.69651]]]] } },
23253 { type: "Feature", properties: { iso1A2: "DG", iso1A3: "DGA", wikidata: "Q184851", nameEn: "Diego Garcia", country: "GB", groups: ["IO", "BOTS", "014", "202", "002", "UN"], isoStatus: "excRes", callingCodes: ["246"] }, geometry: { type: "MultiPolygon", coordinates: [[[[73.14823, -7.76302], [73.09982, -6.07324], [71.43792, -7.73904], [73.14823, -7.76302]]]] } },
23254 { type: "Feature", properties: { iso1A2: "DJ", iso1A3: "DJI", iso1N3: "262", wikidata: "Q977", nameEn: "Djibouti", groups: ["014", "202", "002", "UN"], callingCodes: ["253"] }, geometry: { type: "MultiPolygon", coordinates: [[[[43.90659, 12.3823], [43.90659, 12.3823], [43.32909, 12.59711], [43.29075, 12.79154], [42.86195, 12.58747], [42.7996, 12.42629], [42.6957, 12.36201], [42.46941, 12.52661], [42.4037, 12.46478], [41.95461, 11.81157], [41.82878, 11.72361], [41.77727, 11.49902], [41.8096, 11.33606], [41.80056, 10.97127], [42.06302, 10.92599], [42.13691, 10.97586], [42.42669, 10.98493], [42.62989, 11.09711], [42.75111, 11.06992], [42.79037, 10.98493], [42.95776, 10.98533], [43.90659, 12.3823]]]] } },
23255 { type: "Feature", properties: { iso1A2: "DK", iso1A3: "DNK", iso1N3: "208", wikidata: "Q756617", nameEn: "Kingdom of Denmark" }, geometry: null },
23256 { type: "Feature", properties: { iso1A2: "DM", iso1A3: "DMA", iso1N3: "212", wikidata: "Q784", nameEn: "Dominica", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 767"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.32485, 14.91445], [-60.86656, 15.82603], [-61.95646, 15.5094], [-61.32485, 14.91445]]]] } },
23257 { type: "Feature", properties: { iso1A2: "DO", iso1A3: "DOM", iso1N3: "214", wikidata: "Q786", nameEn: "Dominican Republic", groups: ["029", "003", "419", "019", "UN"], callingCodes: ["1 809", "1 829", "1 849"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-67.87844, 21.7938], [-72.38946, 20.27111], [-71.77419, 19.73128], [-71.75865, 19.70231], [-71.7429, 19.58445], [-71.71449, 19.55364], [-71.71268, 19.53374], [-71.6802, 19.45008], [-71.69448, 19.37866], [-71.77766, 19.33823], [-71.73229, 19.26686], [-71.62642, 19.21212], [-71.65337, 19.11759], [-71.69938, 19.10916], [-71.71088, 19.08353], [-71.74088, 19.0437], [-71.88102, 18.95007], [-71.77766, 18.95007], [-71.72624, 18.87802], [-71.71885, 18.78423], [-71.82556, 18.62551], [-71.95412, 18.64939], [-72.00201, 18.62312], [-71.88102, 18.50125], [-71.90875, 18.45821], [-71.69952, 18.34101], [-71.78271, 18.18302], [-71.75465, 18.14405], [-71.74994, 18.11115], [-71.73783, 18.07177], [-71.75671, 18.03456], [-72.29523, 17.48026], [-68.39466, 16.14167], [-67.87844, 21.7938]]]] } },
23258 { type: "Feature", properties: { iso1A2: "DZ", iso1A3: "DZA", iso1N3: "012", wikidata: "Q262", nameEn: "Algeria", groups: ["015", "002", "UN"], callingCodes: ["213"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.59123, 37.14286], [5.10072, 39.89531], [-2.27707, 35.35051], [-2.21248, 35.08532], [-2.21445, 35.04378], [-2.04734, 34.93218], [-1.97833, 34.93218], [-1.97469, 34.886], [-1.73707, 34.74226], [-1.84569, 34.61907], [-1.69788, 34.48056], [-1.78042, 34.39018], [-1.64666, 34.10405], [-1.73494, 33.71721], [-1.59508, 33.59929], [-1.67067, 33.27084], [-1.46249, 33.0499], [-1.54244, 32.95499], [-1.37794, 32.73628], [-0.9912, 32.52467], [-1.24998, 32.32993], [-1.24453, 32.1917], [-1.15735, 32.12096], [-1.22829, 32.07832], [-2.46166, 32.16603], [-2.93873, 32.06557], [-2.82784, 31.79459], [-3.66314, 31.6339], [-3.66386, 31.39202], [-3.77647, 31.31912], [-3.77103, 31.14984], [-3.54944, 31.0503], [-3.65418, 30.85566], [-3.64735, 30.67539], [-4.31774, 30.53229], [-4.6058, 30.28343], [-5.21671, 29.95253], [-5.58831, 29.48103], [-5.72121, 29.52322], [-5.75616, 29.61407], [-6.69965, 29.51623], [-6.78351, 29.44634], [-6.95824, 29.50924], [-7.61585, 29.36252], [-8.6715, 28.71194], [-8.66879, 27.6666], [-8.66674, 27.31569], [-4.83423, 24.99935], [1.15698, 21.12843], [1.20992, 20.73533], [3.24648, 19.81703], [3.12501, 19.1366], [3.36082, 18.9745], [4.26651, 19.14224], [5.8153, 19.45101], [7.38361, 20.79165], [7.48273, 20.87258], [11.96886, 23.51735], [11.62498, 24.26669], [11.41061, 24.21456], [10.85323, 24.5595], [10.33159, 24.5465], [10.02432, 24.98124], [10.03146, 25.35635], [9.38834, 26.19288], [9.51696, 26.39148], [9.89569, 26.57696], [9.78136, 29.40961], [9.3876, 30.16738], [9.55544, 30.23971], [9.07483, 32.07865], [8.35999, 32.50101], [8.31895, 32.83483], [8.1179, 33.05086], [8.11433, 33.10175], [7.83028, 33.18851], [7.73687, 33.42114], [7.54088, 33.7726], [7.52851, 34.06493], [7.66174, 34.20167], [7.74207, 34.16492], [7.81242, 34.21841], [7.86264, 34.3987], [8.20482, 34.57575], [8.29655, 34.72798], [8.25189, 34.92009], [8.30727, 34.95378], [8.3555, 35.10007], [8.47318, 35.23376], [8.30329, 35.29884], [8.36086, 35.47774], [8.35371, 35.66373], [8.26472, 35.73669], [8.2626, 35.91733], [8.40731, 36.42208], [8.18936, 36.44939], [8.16167, 36.48817], [8.47609, 36.66607], [8.46537, 36.7706], [8.57613, 36.78062], [8.67706, 36.8364], [8.62972, 36.86499], [8.64044, 36.9401], [8.59123, 37.14286]]]] } },
23259 { type: "Feature", properties: { iso1A2: "EA", wikidata: "Q28868874", nameEn: "Ceuta, Melilla", country: "ES", level: "territory", isoStatus: "excRes" }, geometry: null },
23260 { type: "Feature", properties: { iso1A2: "EC", iso1A3: "ECU", iso1N3: "218", wikidata: "Q736", nameEn: "Ecuador" }, geometry: null },
23261 { type: "Feature", properties: { iso1A2: "EE", iso1A3: "EST", iso1N3: "233", wikidata: "Q191", nameEn: "Estonia", aliases: ["EW"], groups: ["EU", "154", "150", "UN"], callingCodes: ["372"] }, geometry: { type: "MultiPolygon", coordinates: [[[[26.32936, 60.00121], [20.5104, 59.15546], [19.84909, 57.57876], [22.80496, 57.87798], [23.20055, 57.56697], [24.26221, 57.91787], [24.3579, 57.87471], [25.19484, 58.0831], [25.28237, 57.98539], [25.29581, 58.08288], [25.73499, 57.90193], [26.05949, 57.84744], [26.0324, 57.79037], [26.02456, 57.78342], [26.027, 57.78158], [26.0266, 57.77441], [26.02069, 57.77169], [26.02415, 57.76865], [26.03332, 57.7718], [26.0543, 57.76105], [26.08098, 57.76619], [26.2029, 57.7206], [26.1866, 57.6849], [26.29253, 57.59244], [26.46527, 57.56885], [26.54675, 57.51813], [26.90364, 57.62823], [27.34698, 57.52242], [27.31919, 57.57672], [27.40393, 57.62125], [27.3746, 57.66834], [27.52615, 57.72843], [27.50171, 57.78842], [27.56689, 57.83356], [27.78526, 57.83963], [27.81841, 57.89244], [27.67282, 57.92627], [27.62393, 58.09462], [27.48541, 58.22615], [27.55489, 58.39525], [27.36366, 58.78381], [27.74429, 58.98351], [27.80482, 59.1116], [27.87978, 59.18097], [27.90911, 59.24353], [28.00689, 59.28351], [28.14215, 59.28934], [28.19284, 59.35791], [28.20537, 59.36491], [28.21137, 59.38058], [28.19061, 59.39962], [28.04187, 59.47017], [27.85643, 59.58538], [26.90044, 59.63819], [26.32936, 60.00121]]]] } },
23262 { type: "Feature", properties: { iso1A2: "EG", iso1A3: "EGY", iso1N3: "818", wikidata: "Q79", nameEn: "Egypt", groups: ["015", "002", "UN"], callingCodes: ["20"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.62659, 31.82938], [26.92891, 33.39516], [24.8458, 31.39877], [25.01077, 30.73861], [24.71117, 30.17441], [24.99968, 29.24574], [24.99885, 21.99535], [33.17563, 22.00405], [34.0765, 22.00501], [37.8565, 22.00903], [34.4454, 27.91479], [34.8812, 29.36878], [34.92298, 29.45305], [34.26742, 31.21998], [34.24012, 31.29591], [34.23572, 31.2966], [34.21853, 31.32363], [34.052, 31.46619], [33.62659, 31.82938]]]] } },
23263 { type: "Feature", properties: { iso1A2: "EH", iso1A3: "ESH", iso1N3: "732", wikidata: "Q6250", nameEn: "Western Sahara", groups: ["015", "002"], callingCodes: ["212"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.66879, 27.6666], [-8.77527, 27.66663], [-8.71787, 26.9898], [-9.08698, 26.98639], [-9.56957, 26.90042], [-9.81998, 26.71379], [-10.68417, 26.90984], [-11.35695, 26.8505], [-11.23622, 26.72023], [-11.38635, 26.611], [-11.62052, 26.05229], [-12.06001, 26.04442], [-12.12281, 25.13682], [-12.92147, 24.39502], [-13.00628, 24.01923], [-13.75627, 23.77231], [-14.10361, 22.75501], [-14.1291, 22.41636], [-14.48112, 22.00886], [-14.47329, 21.63839], [-14.78487, 21.36587], [-16.44269, 21.39745], [-16.9978, 21.36239], [-17.02707, 21.34022], [-17.21511, 21.34226], [-17.35589, 20.80492], [-17.0471, 20.76408], [-17.0695, 20.85742], [-17.06781, 20.92697], [-17.0396, 20.9961], [-17.0357, 21.05368], [-16.99806, 21.12142], [-16.95474, 21.33997], [-13.01525, 21.33343], [-13.08438, 22.53866], [-13.15313, 22.75649], [-13.10753, 22.89493], [-13.00412, 23.02297], [-12.5741, 23.28975], [-12.36213, 23.3187], [-12.14969, 23.41935], [-12.00251, 23.4538], [-12.0002, 25.9986], [-8.66721, 25.99918], [-8.66674, 27.31569], [-8.66879, 27.6666]]]] } },
23264 { type: "Feature", properties: { iso1A2: "ER", iso1A3: "ERI", iso1N3: "232", wikidata: "Q986", nameEn: "Eritrea", groups: ["014", "202", "002", "UN"], callingCodes: ["291"] }, geometry: { type: "MultiPolygon", coordinates: [[[[40.99158, 15.81743], [39.63762, 18.37348], [38.57727, 17.98125], [38.45916, 17.87167], [38.37133, 17.66269], [38.13362, 17.53906], [37.50967, 17.32199], [37.42694, 17.04041], [36.99777, 17.07172], [36.92193, 16.23451], [36.76371, 15.80831], [36.69761, 15.75323], [36.54276, 15.23478], [36.44337, 15.14963], [36.54376, 14.25597], [36.56536, 14.26177], [36.55659, 14.28237], [36.63364, 14.31172], [36.85787, 14.32201], [37.01622, 14.2561], [37.09486, 14.27155], [37.13206, 14.40746], [37.3106, 14.44657], [37.47319, 14.2149], [37.528, 14.18413], [37.91287, 14.89447], [38.0364, 14.72745], [38.25562, 14.67287], [38.3533, 14.51323], [38.45748, 14.41445], [38.78306, 14.4754], [38.98058, 14.54895], [39.02834, 14.63717], [39.16074, 14.65187], [39.14772, 14.61827], [39.19547, 14.56996], [39.23888, 14.56365], [39.26927, 14.48801], [39.2302, 14.44598], [39.2519, 14.40393], [39.37685, 14.54402], [39.52756, 14.49011], [39.50585, 14.55735], [39.58182, 14.60987], [39.76632, 14.54264], [39.9443, 14.41024], [40.07236, 14.54264], [40.14649, 14.53969], [40.21128, 14.39342], [40.25686, 14.41445], [40.9167, 14.11152], [41.25097, 13.60787], [41.62864, 13.38626], [42.05841, 12.80912], [42.21469, 12.75832], [42.2798, 12.6355], [42.4037, 12.46478], [42.46941, 12.52661], [42.6957, 12.36201], [42.7996, 12.42629], [42.86195, 12.58747], [43.29075, 12.79154], [40.99158, 15.81743]]]] } },
23265 { type: "Feature", properties: { iso1A2: "ES", iso1A3: "ESP", iso1N3: "724", wikidata: "Q29", nameEn: "Spain" }, geometry: null },
23266 { type: "Feature", properties: { iso1A2: "ET", iso1A3: "ETH", iso1N3: "231", wikidata: "Q115", nameEn: "Ethiopia", groups: ["014", "202", "002", "UN"], callingCodes: ["251"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.4037, 12.46478], [42.2798, 12.6355], [42.21469, 12.75832], [42.05841, 12.80912], [41.62864, 13.38626], [41.25097, 13.60787], [40.9167, 14.11152], [40.25686, 14.41445], [40.21128, 14.39342], [40.14649, 14.53969], [40.07236, 14.54264], [39.9443, 14.41024], [39.76632, 14.54264], [39.58182, 14.60987], [39.50585, 14.55735], [39.52756, 14.49011], [39.37685, 14.54402], [39.2519, 14.40393], [39.2302, 14.44598], [39.26927, 14.48801], [39.23888, 14.56365], [39.19547, 14.56996], [39.14772, 14.61827], [39.16074, 14.65187], [39.02834, 14.63717], [38.98058, 14.54895], [38.78306, 14.4754], [38.45748, 14.41445], [38.3533, 14.51323], [38.25562, 14.67287], [38.0364, 14.72745], [37.91287, 14.89447], [37.528, 14.18413], [37.47319, 14.2149], [37.3106, 14.44657], [37.13206, 14.40746], [37.09486, 14.27155], [37.01622, 14.2561], [36.85787, 14.32201], [36.63364, 14.31172], [36.55659, 14.28237], [36.56536, 14.26177], [36.54376, 14.25597], [36.44653, 13.95666], [36.48824, 13.83954], [36.38993, 13.56459], [36.24545, 13.36759], [36.13374, 12.92665], [36.16651, 12.88019], [36.14268, 12.70879], [36.01458, 12.72478], [35.70476, 12.67101], [35.24302, 11.91132], [35.11492, 11.85156], [35.05832, 11.71158], [35.09556, 11.56278], [34.95704, 11.24448], [35.01215, 11.19626], [34.93172, 10.95946], [34.97789, 10.91559], [34.97491, 10.86147], [34.86916, 10.78832], [34.86618, 10.74588], [34.77532, 10.69027], [34.77383, 10.74588], [34.59062, 10.89072], [34.4372, 10.781], [34.2823, 10.53508], [34.34783, 10.23914], [34.32102, 10.11599], [34.22718, 10.02506], [34.20484, 9.9033], [34.13186, 9.7492], [34.08717, 9.55243], [34.10229, 9.50238], [34.14304, 9.04654], [34.14453, 8.60204], [34.01346, 8.50041], [33.89579, 8.4842], [33.87195, 8.41938], [33.71407, 8.3678], [33.66938, 8.44442], [33.54575, 8.47094], [33.3119, 8.45474], [33.19721, 8.40317], [33.1853, 8.29264], [33.18083, 8.13047], [33.08401, 8.05822], [33.0006, 7.90333], [33.04944, 7.78989], [33.24637, 7.77939], [33.32531, 7.71297], [33.44745, 7.7543], [33.71407, 7.65983], [33.87642, 7.5491], [34.02984, 7.36449], [34.03878, 7.27437], [34.01495, 7.25664], [34.19369, 7.12807], [34.19369, 7.04382], [34.35753, 6.91963], [34.47669, 6.91076], [34.53925, 6.82794], [34.53776, 6.74808], [34.65096, 6.72589], [34.77459, 6.5957], [34.87736, 6.60161], [35.01738, 6.46991], [34.96227, 6.26415], [35.00546, 5.89387], [35.12611, 5.68937], [35.13058, 5.62118], [35.31188, 5.50106], [35.29938, 5.34042], [35.50792, 5.42431], [35.8576, 5.33413], [35.81968, 5.10757], [35.82118, 4.77382], [35.9419, 4.61933], [35.95449, 4.53244], [36.03924, 4.44406], [36.84474, 4.44518], [37.07724, 4.33503], [38.14168, 3.62487], [38.45812, 3.60445], [38.52336, 3.62551], [38.91938, 3.51198], [39.07736, 3.5267], [39.19954, 3.47834], [39.49444, 3.45521], [39.51551, 3.40895], [39.55132, 3.39634], [39.58339, 3.47434], [39.76808, 3.67058], [39.86043, 3.86974], [40.77498, 4.27683], [41.1754, 3.94079], [41.89488, 3.97375], [42.07619, 4.17667], [42.55853, 4.20518], [42.84526, 4.28357], [42.97746, 4.44032], [43.04177, 4.57923], [43.40263, 4.79289], [44.02436, 4.9451], [44.98104, 4.91821], [47.97917, 8.00124], [47.92477, 8.00111], [46.99339, 7.9989], [44.19222, 8.93028], [43.32613, 9.59205], [43.23518, 9.84605], [43.0937, 9.90579], [42.87643, 10.18441], [42.69452, 10.62672], [42.95776, 10.98533], [42.79037, 10.98493], [42.75111, 11.06992], [42.62989, 11.09711], [42.42669, 10.98493], [42.13691, 10.97586], [42.06302, 10.92599], [41.80056, 10.97127], [41.8096, 11.33606], [41.77727, 11.49902], [41.82878, 11.72361], [41.95461, 11.81157], [42.4037, 12.46478]]]] } },
23267 { type: "Feature", properties: { iso1A2: "EU", iso1A3: "EUE", wikidata: "Q458", nameEn: "European Union", level: "union", isoStatus: "excRes" }, geometry: null },
23268 { type: "Feature", properties: { iso1A2: "FI", iso1A3: "FIN", iso1N3: "246", wikidata: "Q33", nameEn: "Finland", aliases: ["SF"] }, geometry: null },
23269 { type: "Feature", properties: { iso1A2: "FJ", iso1A3: "FJI", iso1N3: "242", wikidata: "Q712", nameEn: "Fiji", groups: ["054", "009", "UN"], driveSide: "left", callingCodes: ["679"] }, geometry: { type: "MultiPolygon", coordinates: [[[[174.245, -23.1974], [179.99999, -22.5], [179.99999, -11.5], [174, -11.5], [174.245, -23.1974]]], [[[-176.76826, -14.95183], [-180, -14.96041], [-180, -22.90585], [-176.74538, -22.89767], [-176.76826, -14.95183]]]] } },
23270 { type: "Feature", properties: { iso1A2: "FK", iso1A3: "FLK", iso1N3: "238", wikidata: "Q9648", nameEn: "Falkland Islands", country: "GB", groups: ["BOTS", "005", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["500"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.67376, -55.11859], [-54.56126, -51.26248], [-61.26735, -50.63919], [-63.67376, -55.11859]]]] } },
23271 { type: "Feature", properties: { iso1A2: "FM", iso1A3: "FSM", iso1N3: "583", wikidata: "Q702", nameEn: "Federated States of Micronesia", groups: ["057", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["691"] }, geometry: { type: "MultiPolygon", coordinates: [[[[138.20583, 13.3783], [136.27107, 6.73747], [156.88247, -1.39237], [165.19726, 6.22546], [138.20583, 13.3783]]]] } },
23272 { type: "Feature", properties: { iso1A2: "FO", iso1A3: "FRO", iso1N3: "234", wikidata: "Q4628", nameEn: "Faroe Islands", country: "DK", groups: ["154", "150", "UN"], callingCodes: ["298"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.51774, 62.35338], [-6.51083, 60.95272], [-5.70102, 62.77194], [-8.51774, 62.35338]]]] } },
23273 { type: "Feature", properties: { iso1A2: "FR", iso1A3: "FRA", iso1N3: "250", wikidata: "Q142", nameEn: "France" }, geometry: null },
23274 { type: "Feature", properties: { iso1A2: "FX", iso1A3: "FXX", iso1N3: "249", wikidata: "Q212429", nameEn: "Metropolitan France", country: "FR", groups: ["EU", "155", "150", "UN"], isoStatus: "excRes", callingCodes: ["33"] }, geometry: { type: "MultiPolygon", coordinates: [[[[2.55904, 51.07014], [2.18458, 51.52087], [1.17405, 50.74239], [-2.02963, 49.91866], [-2.09454, 49.46288], [-1.83944, 49.23037], [-2.00491, 48.86706], [-2.65349, 49.15373], [-6.28985, 48.93406], [-1.81005, 43.59738], [-1.77289, 43.38957], [-1.79319, 43.37497], [-1.78332, 43.36399], [-1.78714, 43.35476], [-1.77068, 43.34396], [-1.75334, 43.34107], [-1.75079, 43.3317], [-1.7397, 43.32979], [-1.73074, 43.29481], [-1.69407, 43.31378], [-1.62481, 43.30726], [-1.63052, 43.28591], [-1.61341, 43.25269], [-1.57674, 43.25269], [-1.55963, 43.28828], [-1.50992, 43.29481], [-1.45289, 43.27049], [-1.40942, 43.27272], [-1.3758, 43.24511], [-1.41562, 43.12815], [-1.47555, 43.08372], [-1.44067, 43.047], [-1.35272, 43.02658], [-1.34419, 43.09665], [-1.32209, 43.1127], [-1.27118, 43.11961], [-1.30052, 43.09581], [-1.30531, 43.06859], [-1.25244, 43.04164], [-1.22881, 43.05534], [-1.10333, 43.0059], [-1.00963, 42.99279], [-0.97133, 42.96239], [-0.81652, 42.95166], [-0.75478, 42.96916], [-0.72037, 42.92541], [-0.73422, 42.91228], [-0.72608, 42.89318], [-0.69837, 42.87945], [-0.67637, 42.88303], [-0.55497, 42.77846], [-0.50863, 42.82713], [-0.44334, 42.79939], [-0.41319, 42.80776], [-0.38833, 42.80132], [-0.3122, 42.84788], [-0.17939, 42.78974], [-0.16141, 42.79535], [-0.10519, 42.72761], [-0.02468, 42.68513], [0.17569, 42.73424], [0.25336, 42.7174], [0.29407, 42.67431], [0.36251, 42.72282], [0.40214, 42.69779], [0.67873, 42.69458], [0.65421, 42.75872], [0.66121, 42.84021], [0.711, 42.86372], [0.93089, 42.79154], [0.96166, 42.80629], [0.98292, 42.78754], [1.0804, 42.78569], [1.15928, 42.71407], [1.35562, 42.71944], [1.44197, 42.60217], [1.47986, 42.61346], [1.46718, 42.63296], [1.48043, 42.65203], [1.50867, 42.64483], [1.55418, 42.65669], [1.60085, 42.62703], [1.63485, 42.62957], [1.6625, 42.61982], [1.68267, 42.62533], [1.73452, 42.61515], [1.72588, 42.59098], [1.7858, 42.57698], [1.73683, 42.55492], [1.72515, 42.50338], [1.76335, 42.48863], [1.83037, 42.48395], [1.88853, 42.4501], [1.93663, 42.45439], [1.94292, 42.44316], [1.94061, 42.43333], [1.94084, 42.43039], [1.9574, 42.42401], [1.96482, 42.37787], [2.00488, 42.35399], [2.06241, 42.35906], [2.11621, 42.38393], [2.12789, 42.41291], [2.16599, 42.42314], [2.20578, 42.41633], [2.25551, 42.43757], [2.38504, 42.39977], [2.43299, 42.39423], [2.43508, 42.37568], [2.48457, 42.33933], [2.54382, 42.33406], [2.55516, 42.35351], [2.57934, 42.35808], [2.6747, 42.33974], [2.65311, 42.38771], [2.72056, 42.42298], [2.75497, 42.42578], [2.77464, 42.41046], [2.84335, 42.45724], [2.85675, 42.45444], [2.86983, 42.46843], [2.88413, 42.45938], [2.92107, 42.4573], [2.94283, 42.48174], [2.96518, 42.46692], [3.03734, 42.47363], [3.08167, 42.42748], [3.10027, 42.42621], [3.11379, 42.43646], [3.17156, 42.43545], [3.75438, 42.33445], [7.60802, 41.05927], [10.09675, 41.44089], [9.56115, 43.20816], [7.50102, 43.51859], [7.42422, 43.72209], [7.40903, 43.7296], [7.41113, 43.73156], [7.41291, 43.73168], [7.41298, 43.73311], [7.41233, 43.73439], [7.42062, 43.73977], [7.42299, 43.74176], [7.42443, 43.74087], [7.42809, 43.74396], [7.43013, 43.74895], [7.43624, 43.75014], [7.43708, 43.75197], [7.4389, 43.75151], [7.4379, 43.74963], [7.47823, 43.73341], [7.53006, 43.78405], [7.50423, 43.84345], [7.49355, 43.86551], [7.51162, 43.88301], [7.56075, 43.89932], [7.56858, 43.94506], [7.60771, 43.95772], [7.65266, 43.9763], [7.66848, 43.99943], [7.6597, 44.03009], [7.72508, 44.07578], [7.66878, 44.12795], [7.68694, 44.17487], [7.63245, 44.17877], [7.62155, 44.14881], [7.36364, 44.11882], [7.34547, 44.14359], [7.27827, 44.1462], [7.16929, 44.20352], [7.00764, 44.23736], [6.98221, 44.28289], [6.89171, 44.36637], [6.88784, 44.42043], [6.94504, 44.43112], [6.86233, 44.49834], [6.85507, 44.53072], [6.96042, 44.62129], [6.95133, 44.66264], [7.00582, 44.69364], [7.07484, 44.68073], [7.00401, 44.78782], [7.02217, 44.82519], [6.93499, 44.8664], [6.90774, 44.84322], [6.75518, 44.89915], [6.74519, 44.93661], [6.74791, 45.01939], [6.66981, 45.02324], [6.62803, 45.11175], [6.7697, 45.16044], [6.85144, 45.13226], [6.96706, 45.20841], [7.07074, 45.21228], [7.13115, 45.25386], [7.10572, 45.32924], [7.18019, 45.40071], [7.00037, 45.509], [6.98948, 45.63869], [6.80785, 45.71864], [6.80785, 45.83265], [6.95315, 45.85163], [7.04151, 45.92435], [7.00946, 45.9944], [6.93862, 46.06502], [6.87868, 46.03855], [6.89321, 46.12548], [6.78968, 46.14058], [6.86052, 46.28512], [6.77152, 46.34784], [6.8024, 46.39171], [6.82312, 46.42661], [6.53358, 46.45431], [6.25432, 46.3632], [6.21981, 46.31304], [6.24826, 46.30175], [6.25137, 46.29014], [6.23775, 46.27822], [6.24952, 46.26255], [6.26749, 46.24745], [6.29474, 46.26221], [6.31041, 46.24417], [6.29663, 46.22688], [6.27694, 46.21566], [6.26007, 46.21165], [6.24821, 46.20531], [6.23913, 46.20511], [6.23544, 46.20714], [6.22175, 46.20045], [6.22222, 46.19888], [6.21844, 46.19837], [6.21603, 46.19507], [6.21273, 46.19409], [6.21114, 46.1927], [6.20539, 46.19163], [6.19807, 46.18369], [6.19552, 46.18401], [6.18707, 46.17999], [6.18871, 46.16644], [6.18116, 46.16187], [6.15305, 46.15194], [6.13397, 46.1406], [6.09926, 46.14373], [6.09199, 46.15191], [6.07491, 46.14879], [6.05203, 46.15191], [6.04564, 46.14031], [6.03614, 46.13712], [6.01791, 46.14228], [5.9871, 46.14499], [5.97893, 46.13303], [5.95781, 46.12925], [5.9641, 46.14412], [5.97508, 46.15863], [5.98188, 46.17392], [5.98846, 46.17046], [5.99573, 46.18587], [5.96515, 46.19638], [5.97542, 46.21525], [6.02461, 46.23313], [6.03342, 46.2383], [6.04602, 46.23127], [6.05029, 46.23518], [6.0633, 46.24583], [6.07072, 46.24085], [6.08563, 46.24651], [6.10071, 46.23772], [6.12446, 46.25059], [6.11926, 46.2634], [6.1013, 46.28512], [6.11697, 46.29547], [6.1198, 46.31157], [6.13876, 46.33844], [6.15738, 46.3491], [6.16987, 46.36759], [6.15985, 46.37721], [6.15016, 46.3778], [6.09926, 46.40768], [6.06407, 46.41676], [6.08427, 46.44305], [6.07269, 46.46244], [6.1567, 46.54402], [6.11084, 46.57649], [6.27135, 46.68251], [6.38351, 46.73171], [6.45209, 46.77502], [6.43216, 46.80336], [6.46456, 46.88865], [6.43341, 46.92703], [6.71531, 47.0494], [6.68823, 47.06616], [6.76788, 47.1208], [6.8489, 47.15933], [6.9508, 47.24338], [6.95108, 47.26428], [6.94316, 47.28747], [7.05305, 47.33304], [7.0564, 47.35134], [7.03125, 47.36996], [6.87959, 47.35335], [6.88542, 47.37262], [6.93744, 47.40714], [6.93953, 47.43388], [7.0024, 47.45264], [6.98425, 47.49432], [7.0231, 47.50522], [7.07425, 47.48863], [7.12781, 47.50371], [7.16249, 47.49025], [7.19583, 47.49455], [7.17026, 47.44312], [7.24669, 47.4205], [7.33526, 47.44186], [7.35603, 47.43432], [7.40308, 47.43638], [7.43088, 47.45846], [7.4462, 47.46264], [7.4583, 47.47216], [7.42923, 47.48628], [7.43356, 47.49712], [7.47534, 47.47932], [7.51076, 47.49651], [7.49804, 47.51798], [7.5229, 47.51644], [7.53199, 47.5284], [7.51904, 47.53515], [7.50588, 47.52856], [7.49691, 47.53821], [7.50873, 47.54546], [7.51723, 47.54578], [7.52831, 47.55347], [7.53634, 47.55553], [7.55652, 47.56779], [7.55689, 47.57232], [7.56548, 47.57617], [7.56684, 47.57785], [7.58386, 47.57536], [7.58945, 47.59017], [7.59301, 47.60058], [7.58851, 47.60794], [7.57423, 47.61628], [7.5591, 47.63849], [7.53384, 47.65115], [7.52067, 47.66437], [7.51915, 47.68335], [7.51266, 47.70197], [7.53722, 47.71635], [7.54761, 47.72912], [7.52921, 47.77747], [7.55673, 47.87371], [7.62302, 47.97898], [7.56966, 48.03265], [7.57137, 48.12292], [7.6648, 48.22219], [7.69022, 48.30018], [7.74562, 48.32736], [7.73109, 48.39192], [7.76833, 48.48945], [7.80647, 48.51239], [7.80167, 48.54758], [7.80057, 48.5857], [7.84098, 48.64217], [7.89002, 48.66317], [7.96812, 48.72491], [7.96994, 48.75606], [8.01534, 48.76085], [8.0326, 48.79017], [8.06802, 48.78957], [8.10253, 48.81829], [8.12813, 48.87985], [8.19989, 48.95825], [8.20031, 48.95856], [8.22604, 48.97352], [8.14189, 48.97833], [7.97783, 49.03161], [7.93641, 49.05544], [7.86386, 49.03499], [7.79557, 49.06583], [7.75948, 49.04562], [7.63618, 49.05428], [7.62575, 49.07654], [7.56416, 49.08136], [7.53012, 49.09818], [7.49172, 49.13915], [7.49473, 49.17], [7.44455, 49.16765], [7.44052, 49.18354], [7.3662, 49.17308], [7.35995, 49.14399], [7.3195, 49.14231], [7.29514, 49.11426], [7.23473, 49.12971], [7.1593, 49.1204], [7.1358, 49.1282], [7.12504, 49.14253], [7.10384, 49.13787], [7.10715, 49.15631], [7.07859, 49.15031], [7.09007, 49.13094], [7.07162, 49.1255], [7.06642, 49.11415], [7.05548, 49.11185], [7.04843, 49.11422], [7.04409, 49.12123], [7.04662, 49.13724], [7.03178, 49.15734], [7.0274, 49.17042], [7.03459, 49.19096], [7.01318, 49.19018], [6.97273, 49.2099], [6.95963, 49.203], [6.94028, 49.21641], [6.93831, 49.2223], [6.91875, 49.22261], [6.89298, 49.20863], [6.85939, 49.22376], [6.83555, 49.21249], [6.85119, 49.20038], [6.85016, 49.19354], [6.86225, 49.18185], [6.84703, 49.15734], [6.83385, 49.15162], [6.78265, 49.16793], [6.73765, 49.16375], [6.71137, 49.18808], [6.73256, 49.20486], [6.71843, 49.2208], [6.69274, 49.21661], [6.66583, 49.28065], [6.60186, 49.31055], [6.572, 49.35027], [6.58807, 49.35358], [6.60091, 49.36864], [6.533, 49.40748], [6.55404, 49.42464], [6.42432, 49.47683], [6.40274, 49.46546], [6.39168, 49.4667], [6.38352, 49.46463], [6.36778, 49.46937], [6.3687, 49.4593], [6.28818, 49.48465], [6.27875, 49.503], [6.25029, 49.50609], [6.2409, 49.51408], [6.19543, 49.50536], [6.17386, 49.50934], [6.15366, 49.50226], [6.16115, 49.49297], [6.14321, 49.48796], [6.12814, 49.49365], [6.12346, 49.4735], [6.10325, 49.4707], [6.09845, 49.46351], [6.10072, 49.45268], [6.08373, 49.45594], [6.07887, 49.46399], [6.05553, 49.46663], [6.04176, 49.44801], [6.02743, 49.44845], [6.02648, 49.45451], [5.97693, 49.45513], [5.96876, 49.49053], [5.94224, 49.49608], [5.94128, 49.50034], [5.86571, 49.50015], [5.83389, 49.52152], [5.83467, 49.52717], [5.84466, 49.53027], [5.83648, 49.5425], [5.81664, 49.53775], [5.80871, 49.5425], [5.81838, 49.54777], [5.79195, 49.55228], [5.77435, 49.56298], [5.7577, 49.55915], [5.75649, 49.54321], [5.64505, 49.55146], [5.60909, 49.51228], [5.55001, 49.52729], [5.46541, 49.49825], [5.46734, 49.52648], [5.43713, 49.5707], [5.3974, 49.61596], [5.34837, 49.62889], [5.33851, 49.61599], [5.3137, 49.61225], [5.30214, 49.63055], [5.33039, 49.6555], [5.31465, 49.66846], [5.26232, 49.69456], [5.14545, 49.70287], [5.09249, 49.76193], [4.96714, 49.79872], [4.85464, 49.78995], [4.86965, 49.82271], [4.85134, 49.86457], [4.88529, 49.9236], [4.78827, 49.95609], [4.8382, 50.06738], [4.88602, 50.15182], [4.83279, 50.15331], [4.82438, 50.16878], [4.75237, 50.11314], [4.70064, 50.09384], [4.68695, 49.99685], [4.5414, 49.96911], [4.51098, 49.94659], [4.43488, 49.94122], [4.35051, 49.95315], [4.31963, 49.97043], [4.20532, 49.95803], [4.14239, 49.98034], [4.13508, 50.01976], [4.16294, 50.04719], [4.23101, 50.06945], [4.20147, 50.13535], [4.13561, 50.13078], [4.16014, 50.19239], [4.15524, 50.21103], [4.21945, 50.25539], [4.20651, 50.27333], [4.17861, 50.27443], [4.17347, 50.28838], [4.15524, 50.2833], [4.16808, 50.25786], [4.13665, 50.25609], [4.11954, 50.30425], [4.10957, 50.30234], [4.10237, 50.31247], [4.0689, 50.3254], [4.0268, 50.35793], [3.96771, 50.34989], [3.90781, 50.32814], [3.84314, 50.35219], [3.73911, 50.34809], [3.70987, 50.3191], [3.71009, 50.30305], [3.66976, 50.34563], [3.65709, 50.36873], [3.67262, 50.38663], [3.67494, 50.40239], [3.66153, 50.45165], [3.64426, 50.46275], [3.61014, 50.49568], [3.58361, 50.49049], [3.5683, 50.50192], [3.49509, 50.48885], [3.51564, 50.5256], [3.47385, 50.53397], [3.44629, 50.51009], [3.37693, 50.49538], [3.28575, 50.52724], [3.2729, 50.60718], [3.23951, 50.6585], [3.264, 50.67668], [3.2536, 50.68977], [3.26141, 50.69151], [3.26063, 50.70086], [3.24593, 50.71389], [3.22042, 50.71019], [3.20845, 50.71662], [3.19017, 50.72569], [3.20064, 50.73547], [3.18811, 50.74025], [3.18339, 50.74981], [3.16476, 50.76843], [3.15017, 50.79031], [3.1257, 50.78603], [3.11987, 50.79188], [3.11206, 50.79416], [3.10614, 50.78303], [3.09163, 50.77717], [3.04314, 50.77674], [3.00537, 50.76588], [2.96778, 50.75242], [2.95019, 50.75138], [2.90873, 50.702], [2.91036, 50.6939], [2.90069, 50.69263], [2.88504, 50.70656], [2.87937, 50.70298], [2.86985, 50.7033], [2.8483, 50.72276], [2.81056, 50.71773], [2.71165, 50.81295], [2.63331, 50.81457], [2.59093, 50.91751], [2.63074, 50.94746], [2.57551, 51.00326], [2.55904, 51.07014]], [[1.99838, 42.44682], [1.98378, 42.44697], [1.96125, 42.45364], [1.95606, 42.45785], [1.96215, 42.47854], [1.97003, 42.48081], [1.97227, 42.48487], [1.97697, 42.48568], [1.98022, 42.49569], [1.98916, 42.49351], [1.99766, 42.4858], [1.98579, 42.47486], [1.99216, 42.46208], [2.01564, 42.45171], [1.99838, 42.44682]]]] } },
23275 { type: "Feature", properties: { iso1A2: "GA", iso1A3: "GAB", iso1N3: "266", wikidata: "Q1000", nameEn: "Gabon", groups: ["017", "202", "002", "UN"], callingCodes: ["241"] }, geometry: { type: "MultiPolygon", coordinates: [[[[13.29457, 2.16106], [13.28534, 2.25716], [11.37116, 2.29975], [11.3561, 2.17217], [11.35307, 1.00251], [9.79648, 1.0019], [9.75065, 1.06753], [9.66433, 1.06723], [7.24416, -0.64092], [10.75913, -4.39519], [11.12647, -3.94169], [11.22301, -3.69888], [11.48764, -3.51089], [11.57949, -3.52798], [11.68608, -3.68942], [11.87083, -3.71571], [11.92719, -3.62768], [11.8318, -3.5812], [11.96554, -3.30267], [11.70227, -3.17465], [11.70558, -3.0773], [11.80365, -3.00424], [11.64798, -2.81146], [11.5359, -2.85654], [11.64487, -2.61865], [11.57637, -2.33379], [11.74605, -2.39936], [11.96866, -2.33559], [12.04895, -2.41704], [12.47925, -2.32626], [12.44656, -1.92025], [12.61312, -1.8129], [12.82172, -1.91091], [13.02759, -2.33098], [13.47977, -2.43224], [13.75884, -2.09293], [13.92073, -2.35581], [13.85846, -2.46935], [14.10442, -2.49268], [14.23829, -2.33715], [14.16202, -2.23916], [14.23518, -2.15671], [14.25932, -1.97624], [14.41838, -1.89412], [14.52569, -0.57818], [14.41887, -0.44799], [14.2165, -0.38261], [14.06862, -0.20826], [13.90632, -0.2287], [13.88648, 0.26652], [14.10909, 0.58563], [14.26066, 0.57255], [14.48179, 0.9152], [14.25186, 1.39842], [13.89582, 1.4261], [13.15519, 1.23368], [13.25447, 1.32339], [13.13461, 1.57238], [13.29457, 2.16106]]]] } },
23276 { type: "Feature", properties: { iso1A2: "GB", iso1A3: "GBR", iso1N3: "826", wikidata: "Q145", ccTLD: ".uk", nameEn: "United Kingdom", aliases: ["UK"] }, geometry: null },
23277 { type: "Feature", properties: { iso1A2: "GD", iso1A3: "GRD", iso1N3: "308", wikidata: "Q769", nameEn: "Grenada", aliases: ["WG"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 473"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.64026, 12.69984], [-61.77886, 11.36496], [-59.94058, 12.34011], [-62.64026, 12.69984]]]] } },
23278 { type: "Feature", properties: { iso1A2: "GE", iso1A3: "GEO", iso1N3: "268", wikidata: "Q230", nameEn: "Georgia", groups: ["145", "142", "UN"], callingCodes: ["995"] }, geometry: { type: "MultiPolygon", coordinates: [[[[46.42738, 41.91323], [45.61676, 42.20768], [45.78692, 42.48358], [45.36501, 42.55268], [45.15318, 42.70598], [44.88754, 42.74934], [44.80941, 42.61277], [44.70002, 42.74679], [44.54202, 42.75699], [43.95517, 42.55396], [43.73119, 42.62043], [43.81453, 42.74297], [43.0419, 43.02413], [43.03322, 43.08883], [42.75889, 43.19651], [42.66667, 43.13917], [42.40563, 43.23226], [41.64935, 43.22331], [40.65957, 43.56212], [40.10657, 43.57344], [40.04445, 43.47776], [40.03312, 43.44262], [40.01007, 43.42411], [40.01552, 43.42025], [40.00853, 43.40578], [40.0078, 43.38551], [39.81147, 43.06294], [40.89217, 41.72528], [41.54366, 41.52185], [41.7148, 41.4932], [41.7124, 41.47417], [41.81939, 41.43621], [41.95134, 41.52466], [42.26387, 41.49346], [42.51772, 41.43606], [42.59202, 41.58183], [42.72794, 41.59714], [42.84471, 41.58912], [42.78995, 41.50126], [42.84899, 41.47265], [42.8785, 41.50516], [43.02956, 41.37891], [43.21707, 41.30331], [43.13373, 41.25503], [43.1945, 41.25242], [43.23096, 41.17536], [43.36118, 41.2028], [43.44973, 41.17666], [43.4717, 41.12611], [43.67712, 41.13398], [43.74717, 41.1117], [43.84835, 41.16329], [44.16591, 41.19141], [44.18148, 41.24644], [44.32139, 41.2079], [44.34337, 41.20312], [44.34417, 41.2382], [44.46791, 41.18204], [44.59322, 41.1933], [44.61462, 41.24018], [44.72814, 41.20338], [44.82084, 41.21513], [44.87887, 41.20195], [44.89911, 41.21366], [44.84358, 41.23088], [44.81749, 41.23488], [44.80053, 41.25949], [44.81437, 41.30371], [44.93493, 41.25685], [45.0133, 41.29747], [45.09867, 41.34065], [45.1797, 41.42231], [45.26285, 41.46433], [45.31352, 41.47168], [45.4006, 41.42402], [45.45973, 41.45898], [45.68389, 41.3539], [45.71035, 41.36208], [45.75705, 41.35157], [45.69946, 41.29545], [45.80842, 41.2229], [45.95786, 41.17956], [46.13221, 41.19479], [46.27698, 41.19011], [46.37661, 41.10805], [46.456, 41.09984], [46.48558, 41.0576], [46.55096, 41.1104], [46.63969, 41.09515], [46.66148, 41.20533], [46.72375, 41.28609], [46.63658, 41.37727], [46.4669, 41.43331], [46.40307, 41.48464], [46.33925, 41.4963], [46.29794, 41.5724], [46.34126, 41.57454], [46.34039, 41.5947], [46.3253, 41.60912], [46.28182, 41.60089], [46.26531, 41.63339], [46.24429, 41.59883], [46.19759, 41.62327], [46.17891, 41.72094], [46.20538, 41.77205], [46.23962, 41.75811], [46.30863, 41.79133], [46.3984, 41.84399], [46.42738, 41.91323]]]] } },
23279 { type: "Feature", properties: { iso1A2: "GF", iso1A3: "GUF", iso1N3: "254", wikidata: "Q3769", nameEn: "French Guiana", country: "FR", groups: ["Q3320166", "EU", "005", "419", "019", "UN"], callingCodes: ["594"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-51.35485, 4.8383], [-53.7094, 6.2264], [-54.01074, 5.68785], [-54.01877, 5.52789], [-54.26916, 5.26909], [-54.4717, 4.91964], [-54.38444, 4.13222], [-54.19367, 3.84387], [-54.05128, 3.63557], [-53.98914, 3.627], [-53.9849, 3.58697], [-54.28534, 2.67798], [-54.42864, 2.42442], [-54.6084, 2.32856], [-54.16286, 2.10779], [-53.78743, 2.34412], [-52.96539, 2.1881], [-52.6906, 2.37298], [-52.31787, 3.17896], [-51.85573, 3.83427], [-51.82312, 3.85825], [-51.79599, 3.89336], [-51.61983, 4.14596], [-51.63798, 4.51394], [-51.35485, 4.8383]]]] } },
23280 { type: "Feature", properties: { iso1A2: "GG", iso1A3: "GGY", iso1N3: "831", wikidata: "Q25230", nameEn: "Bailiwick of Guernsey", country: "GB" }, geometry: null },
23281 { type: "Feature", properties: { iso1A2: "GH", iso1A3: "GHA", iso1N3: "288", wikidata: "Q117", nameEn: "Ghana", groups: ["011", "202", "002", "UN"], callingCodes: ["233"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-0.13493, 11.14075], [-0.27374, 11.17157], [-0.28566, 11.12713], [-0.35955, 11.07801], [-0.38219, 11.12596], [-0.42391, 11.11661], [-0.44298, 11.04292], [-0.61937, 10.91305], [-0.67143, 10.99811], [-2.83373, 11.0067], [-2.94232, 10.64281], [-2.83108, 10.40252], [-2.74174, 9.83172], [-2.76534, 9.56589], [-2.68802, 9.49343], [-2.69814, 9.22717], [-2.77799, 9.04949], [-2.66357, 9.01771], [-2.58243, 8.7789], [-2.49037, 8.20872], [-2.62901, 8.11495], [-2.61232, 8.02645], [-2.67787, 8.02055], [-2.74819, 7.92613], [-2.78395, 7.94974], [-2.79467, 7.86002], [-2.92339, 7.60847], [-2.97822, 7.27165], [-2.95438, 7.23737], [-3.23327, 6.81744], [-3.21954, 6.74407], [-3.25999, 6.62521], [-3.01896, 5.71697], [-2.95323, 5.71865], [-2.96671, 5.6415], [-2.93132, 5.62137], [-2.85378, 5.65156], [-2.76614, 5.60963], [-2.72737, 5.34789], [-2.77625, 5.34621], [-2.73074, 5.1364], [-2.75502, 5.10657], [-2.95261, 5.12477], [-2.96554, 5.10397], [-3.063, 5.13665], [-3.11073, 5.12675], [-3.10675, 5.08515], [-3.34019, 4.17519], [1.07031, 5.15655], [1.27574, 5.93551], [1.19771, 6.11522], [1.19966, 6.17069], [1.09187, 6.17074], [1.05969, 6.22998], [1.03108, 6.24064], [0.99652, 6.33779], [0.89283, 6.33779], [0.71048, 6.53083], [0.74862, 6.56517], [0.63659, 6.63857], [0.6497, 6.73682], [0.58176, 6.76049], [0.57406, 6.80348], [0.52853, 6.82921], [0.56508, 6.92971], [0.52098, 6.94391], [0.52217, 6.9723], [0.59606, 7.01252], [0.65327, 7.31643], [0.62943, 7.41099], [0.57223, 7.39326], [0.52455, 7.45354], [0.51979, 7.58706], [0.58295, 7.62368], [0.62943, 7.85751], [0.58891, 8.12779], [0.6056, 8.13959], [0.61156, 8.18324], [0.5913, 8.19622], [0.63897, 8.25873], [0.73432, 8.29529], [0.64731, 8.48866], [0.47211, 8.59945], [0.37319, 8.75262], [0.52455, 8.87746], [0.45424, 9.04581], [0.56388, 9.40697], [0.49118, 9.48339], [0.36485, 9.49749], [0.33148, 9.44812], [0.25758, 9.42696], [0.2254, 9.47869], [0.31241, 9.50337], [0.30406, 9.521], [0.2409, 9.52335], [0.23851, 9.57389], [0.38153, 9.58682], [0.36008, 9.6256], [0.29334, 9.59387], [0.26712, 9.66437], [0.28261, 9.69022], [0.32313, 9.6491], [0.34816, 9.66907], [0.34816, 9.71607], [0.32075, 9.72781], [0.36366, 10.03309], [0.41252, 10.02018], [0.41371, 10.06361], [0.35293, 10.09412], [0.39584, 10.31112], [0.33028, 10.30408], [0.29453, 10.41546], [0.18846, 10.4096], [0.12886, 10.53149], [-0.05945, 10.63458], [-0.09141, 10.7147], [-0.07327, 10.71845], [-0.07183, 10.76794], [-0.0228, 10.81916], [-0.02685, 10.8783], [-908e-5, 10.91644], [-63e-4, 10.96417], [0.03355, 10.9807], [0.02395, 11.06229], [342e-5, 11.08317], [-514e-5, 11.10763], [-0.0275, 11.11202], [-0.05733, 11.08628], [-0.14462, 11.10811], [-0.13493, 11.14075]]]] } },
23282 { type: "Feature", properties: { iso1A2: "GI", iso1A3: "GIB", iso1N3: "292", wikidata: "Q1410", nameEn: "Gibraltar", country: "GB", groups: ["Q12837", "BOTS", "039", "150", "UN"], callingCodes: ["350"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-5.34064, 36.03744], [-5.27801, 36.14942], [-5.33822, 36.15272], [-5.34536, 36.15501], [-5.40526, 36.15488], [-5.34064, 36.03744]]]] } },
23283 { type: "Feature", properties: { iso1A2: "GL", iso1A3: "GRL", iso1N3: "304", wikidata: "Q223", nameEn: "Greenland", country: "DK", groups: ["Q1451600", "021", "003", "019", "UN"], callingCodes: ["299"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-49.33696, 84.57952], [-68.21821, 80.48551], [-77.52957, 77.23408], [-46.37635, 57.3249], [-9.68082, 72.73731], [-5.7106, 84.28058], [-49.33696, 84.57952]]]] } },
23284 { type: "Feature", properties: { iso1A2: "GM", iso1A3: "GMB", iso1N3: "270", wikidata: "Q1005", nameEn: "The Gambia", groups: ["011", "202", "002", "UN"], callingCodes: ["220"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-15.14917, 13.57989], [-14.36795, 13.23033], [-13.79409, 13.34472], [-13.8955, 13.59126], [-14.34721, 13.46578], [-14.93719, 13.80173], [-15.36504, 13.79313], [-15.47902, 13.58758], [-17.43598, 13.59273], [-17.43966, 13.04579], [-16.74676, 13.06025], [-16.69343, 13.16791], [-15.80355, 13.16729], [-15.80478, 13.34832], [-15.26908, 13.37768], [-15.14917, 13.57989]]]] } },
23285 { type: "Feature", properties: { iso1A2: "GN", iso1A3: "GIN", iso1N3: "324", wikidata: "Q1006", nameEn: "Guinea", groups: ["011", "202", "002", "UN"], callingCodes: ["224"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-11.37536, 12.40788], [-11.46267, 12.44559], [-11.91331, 12.42008], [-12.35415, 12.32758], [-12.87336, 12.51892], [-13.06603, 12.49342], [-13.05296, 12.64003], [-13.70523, 12.68013], [-13.7039, 12.60313], [-13.65089, 12.49515], [-13.64168, 12.42764], [-13.70851, 12.24978], [-13.92745, 12.24077], [-13.94589, 12.16869], [-13.7039, 12.00869], [-13.7039, 11.70195], [-14.09799, 11.63649], [-14.26623, 11.67486], [-14.31513, 11.60713], [-14.51173, 11.49708], [-14.66677, 11.51188], [-14.77786, 11.36323], [-14.95993, 10.99244], [-15.07174, 10.89557], [-15.96748, 10.162], [-14.36218, 8.64107], [-13.29911, 9.04245], [-13.18586, 9.0925], [-13.08953, 9.0409], [-12.94095, 9.26335], [-12.76788, 9.3133], [-12.47254, 9.86834], [-12.24262, 9.92386], [-12.12634, 9.87203], [-11.91023, 9.93927], [-11.89624, 9.99763], [-11.2118, 10.00098], [-10.6534, 9.29919], [-10.74484, 9.07998], [-10.5783, 9.06386], [-10.56197, 8.81225], [-10.47707, 8.67669], [-10.61422, 8.5314], [-10.70565, 8.29235], [-10.63934, 8.35326], [-10.54891, 8.31174], [-10.37257, 8.48941], [-10.27575, 8.48711], [-10.203, 8.47991], [-10.14579, 8.52665], [-10.05375, 8.50697], [-10.05873, 8.42578], [-9.77763, 8.54633], [-9.47415, 8.35195], [-9.50898, 8.18455], [-9.41445, 8.02448], [-9.44928, 7.9284], [-9.35724, 7.74111], [-9.37465, 7.62032], [-9.48161, 7.37122], [-9.41943, 7.41809], [-9.305, 7.42056], [-9.20798, 7.38109], [-9.18311, 7.30461], [-9.09107, 7.1985], [-8.93435, 7.2824], [-8.85724, 7.26019], [-8.8448, 7.35149], [-8.72789, 7.51429], [-8.67814, 7.69428], [-8.55874, 7.70167], [-8.55874, 7.62525], [-8.47114, 7.55676], [-8.4003, 7.6285], [-8.21374, 7.54466], [-8.09931, 7.78626], [-8.13414, 7.87991], [-8.06449, 8.04989], [-7.94695, 8.00925], [-7.99919, 8.11023], [-7.98675, 8.20134], [-8.062, 8.16071], [-8.2411, 8.24196], [-8.22991, 8.48438], [-7.92518, 8.50652], [-7.65653, 8.36873], [-7.69882, 8.66148], [-7.95503, 8.81146], [-7.92518, 8.99332], [-7.73862, 9.08422], [-7.90777, 9.20456], [-7.85056, 9.41812], [-8.03463, 9.39604], [-8.14657, 9.55062], [-8.09434, 9.86936], [-8.15652, 9.94288], [-8.11921, 10.04577], [-8.01225, 10.1021], [-7.97971, 10.17117], [-7.9578, 10.2703], [-8.10207, 10.44649], [-8.22711, 10.41722], [-8.32614, 10.69273], [-8.2667, 10.91762], [-8.35083, 11.06234], [-8.66923, 10.99397], [-8.40058, 11.37466], [-8.80854, 11.66715], [-8.94784, 12.34842], [-9.13689, 12.50875], [-9.38067, 12.48446], [-9.32097, 12.29009], [-9.63938, 12.18312], [-9.714, 12.0226], [-10.30604, 12.24634], [-10.71897, 11.91552], [-10.80355, 12.1053], [-10.99758, 12.24634], [-11.24136, 12.01286], [-11.50006, 12.17826], [-11.37536, 12.40788]]]] } },
23286 { type: "Feature", properties: { iso1A2: "GP", iso1A3: "GLP", iso1N3: "312", wikidata: "Q17012", nameEn: "Guadeloupe", country: "FR", groups: ["Q3320166", "EU", "029", "003", "419", "019", "UN"], callingCodes: ["590"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-60.03183, 16.1129], [-61.60296, 16.73066], [-63.00549, 15.26166], [-60.03183, 16.1129]]]] } },
23287 { type: "Feature", properties: { iso1A2: "GQ", iso1A3: "GNQ", iso1N3: "226", wikidata: "Q983", nameEn: "Equatorial Guinea", groups: ["017", "202", "002", "UN"], callingCodes: ["240"] }, geometry: { type: "MultiPolygon", coordinates: [[[[9.22018, 3.72052], [8.34397, 4.30689], [7.71762, 0.6674], [3.35016, -3.29031], [9.66433, 1.06723], [9.75065, 1.06753], [9.79648, 1.0019], [11.35307, 1.00251], [11.3561, 2.17217], [9.991, 2.16561], [9.90749, 2.20049], [9.89012, 2.20457], [9.84716, 2.24676], [9.83238, 2.29079], [9.83754, 2.32428], [9.82123, 2.35097], [9.81162, 2.33797], [9.22018, 3.72052]]]] } },
23288 { type: "Feature", properties: { iso1A2: "GR", iso1A3: "GRC", iso1N3: "300", wikidata: "Q41", nameEn: "Greece", aliases: ["EL"], groups: ["EU", "039", "150", "UN"], callingCodes: ["30"] }, geometry: { type: "MultiPolygon", coordinates: [[[[26.03489, 40.73051], [26.0754, 40.72772], [26.08638, 40.73214], [26.12495, 40.74283], [26.12854, 40.77339], [26.15685, 40.80709], [26.21351, 40.83298], [26.20856, 40.86048], [26.26169, 40.9168], [26.29441, 40.89119], [26.28623, 40.93005], [26.32259, 40.94042], [26.35894, 40.94292], [26.33297, 40.98388], [26.3606, 41.02027], [26.31928, 41.07386], [26.32259, 41.24929], [26.39861, 41.25053], [26.5209, 41.33993], [26.5837, 41.32131], [26.62997, 41.34613], [26.61767, 41.42281], [26.59742, 41.48058], [26.59196, 41.60491], [26.5209, 41.62592], [26.47958, 41.67037], [26.35957, 41.71149], [26.30255, 41.70925], [26.2654, 41.71544], [26.22888, 41.74139], [26.21325, 41.73223], [26.16841, 41.74858], [26.06148, 41.70345], [26.07083, 41.64584], [26.15146, 41.60828], [26.14328, 41.55496], [26.17951, 41.55409], [26.176, 41.50072], [26.14796, 41.47533], [26.20288, 41.43943], [26.16548, 41.42278], [26.12926, 41.35878], [25.87919, 41.30526], [25.8266, 41.34563], [25.70507, 41.29209], [25.66183, 41.31316], [25.61042, 41.30614], [25.55082, 41.31667], [25.52394, 41.2798], [25.48187, 41.28506], [25.28322, 41.23411], [25.11611, 41.34212], [24.942, 41.38685], [24.90928, 41.40876], [24.86136, 41.39298], [24.82514, 41.4035], [24.8041, 41.34913], [24.71529, 41.41928], [24.61129, 41.42278], [24.52599, 41.56808], [24.30513, 41.51297], [24.27124, 41.57682], [24.18126, 41.51735], [24.10063, 41.54796], [24.06323, 41.53222], [24.06908, 41.46132], [23.96975, 41.44118], [23.91483, 41.47971], [23.89613, 41.45257], [23.80148, 41.43943], [23.76525, 41.40175], [23.67644, 41.41139], [23.63203, 41.37632], [23.52453, 41.40262], [23.40416, 41.39999], [23.33639, 41.36317], [23.31301, 41.40525], [23.22771, 41.37106], [23.21953, 41.33773], [23.1833, 41.31755], [22.93334, 41.34104], [22.81199, 41.3398], [22.76408, 41.32225], [22.74538, 41.16321], [22.71266, 41.13945], [22.65306, 41.18168], [22.62852, 41.14385], [22.58295, 41.11568], [22.5549, 41.13065], [22.42285, 41.11921], [22.26744, 41.16409], [22.17629, 41.15969], [22.1424, 41.12449], [22.06527, 41.15617], [21.90869, 41.09191], [21.91102, 41.04786], [21.7556, 40.92525], [21.69601, 40.9429], [21.57448, 40.86076], [21.53007, 40.90759], [21.41555, 40.9173], [21.35595, 40.87578], [21.25779, 40.86165], [21.21105, 40.8855], [21.15262, 40.85546], [20.97887, 40.85475], [20.98396, 40.79109], [20.95752, 40.76982], [20.98134, 40.76046], [21.05833, 40.66586], [21.03932, 40.56299], [20.96908, 40.51526], [20.94925, 40.46625], [20.83688, 40.47882], [20.7906, 40.42726], [20.78234, 40.35803], [20.71789, 40.27739], [20.67162, 40.09433], [20.62566, 40.0897], [20.61081, 40.07866], [20.55593, 40.06524], [20.51297, 40.08168], [20.48487, 40.06271], [20.42373, 40.06777], [20.37911, 39.99058], [20.31135, 39.99438], [20.41546, 39.82832], [20.41475, 39.81437], [20.38572, 39.78516], [20.30804, 39.81563], [20.29152, 39.80421], [20.31961, 39.72799], [20.27412, 39.69884], [20.22707, 39.67459], [20.22376, 39.64532], [20.15988, 39.652], [20.12956, 39.65805], [20.05189, 39.69112], [20.00957, 39.69227], [19.98042, 39.6504], [19.92466, 39.69533], [19.97622, 39.78684], [19.95905, 39.82857], [19.0384, 40.35325], [19.20409, 39.7532], [22.5213, 33.45682], [29.73302, 35.92555], [29.69611, 36.10365], [29.61805, 36.14179], [29.61002, 36.1731], [29.48192, 36.18377], [29.30783, 36.01033], [28.23708, 36.56812], [27.95037, 36.46155], [27.89482, 36.69898], [27.46117, 36.53789], [27.24613, 36.71622], [27.45627, 36.9008], [27.20312, 36.94571], [27.14757, 37.32], [26.95583, 37.64989], [26.99377, 37.69034], [27.16428, 37.72343], [27.05537, 37.9131], [26.21136, 38.17558], [26.24183, 38.44695], [26.32173, 38.48731], [26.21136, 38.65436], [26.61814, 38.81372], [26.70773, 39.0312], [26.43357, 39.43096], [25.94257, 39.39358], [25.61285, 40.17161], [26.04292, 40.3958], [25.94795, 40.72797], [26.03489, 40.73051]]]] } },
23289 { type: "Feature", properties: { iso1A2: "GS", iso1A3: "SGS", iso1N3: "239", wikidata: "Q35086", nameEn: "South Georgia and South Sandwich Islands", country: "GB", groups: ["BOTS", "005", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["500"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-35.26394, -43.68272], [-53.39656, -59.87088], [-22.31757, -59.85974], [-35.26394, -43.68272]]]] } },
23290 { type: "Feature", properties: { iso1A2: "GT", iso1A3: "GTM", iso1N3: "320", wikidata: "Q774", nameEn: "Guatemala", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["502"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-89.14985, 17.81563], [-90.98678, 17.81655], [-90.99199, 17.25192], [-91.43809, 17.25373], [-91.04436, 16.92175], [-90.69064, 16.70697], [-90.61212, 16.49832], [-90.40499, 16.40524], [-90.44567, 16.07573], [-91.73182, 16.07371], [-92.20983, 15.26077], [-92.0621, 15.07406], [-92.1454, 14.98143], [-92.1423, 14.88647], [-92.18161, 14.84147], [-92.1454, 14.6804], [-92.2261, 14.53423], [-92.37213, 14.39277], [-90.55276, 12.8866], [-90.11344, 13.73679], [-90.10505, 13.85104], [-89.88937, 14.0396], [-89.81807, 14.07073], [-89.76103, 14.02923], [-89.73251, 14.04133], [-89.75569, 14.07073], [-89.70756, 14.1537], [-89.61844, 14.21937], [-89.52397, 14.22628], [-89.50614, 14.26084], [-89.58814, 14.33165], [-89.57441, 14.41637], [-89.39028, 14.44561], [-89.34776, 14.43013], [-89.35189, 14.47553], [-89.23719, 14.58046], [-89.15653, 14.57802], [-89.13132, 14.71582], [-89.23467, 14.85596], [-89.15149, 14.97775], [-89.18048, 14.99967], [-89.15149, 15.07392], [-88.97343, 15.14039], [-88.32467, 15.63665], [-88.31459, 15.66942], [-88.24022, 15.69247], [-88.22552, 15.72294], [-88.20359, 16.03858], [-88.40779, 16.09624], [-88.95358, 15.88698], [-89.02415, 15.9063], [-89.17418, 15.90898], [-89.22683, 15.88619], [-89.15025, 17.04813], [-89.14985, 17.81563]]]] } },
23291 { type: "Feature", properties: { iso1A2: "GU", iso1A3: "GUM", iso1N3: "316", wikidata: "Q16635", nameEn: "Guam", aliases: ["US-GU"], country: "US", groups: ["Q1352230", "Q153732", "057", "009", "UN"], roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 671"] }, geometry: { type: "MultiPolygon", coordinates: [[[[146.25931, 13.85876], [143.82485, 13.92273], [144.61642, 12.82462], [146.25931, 13.85876]]]] } },
23292 { type: "Feature", properties: { iso1A2: "GW", iso1A3: "GNB", iso1N3: "624", wikidata: "Q1007", nameEn: "Guinea-Bissau", groups: ["011", "202", "002", "UN"], callingCodes: ["245"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-14.31513, 11.60713], [-14.26623, 11.67486], [-14.09799, 11.63649], [-13.7039, 11.70195], [-13.7039, 12.00869], [-13.94589, 12.16869], [-13.92745, 12.24077], [-13.70851, 12.24978], [-13.64168, 12.42764], [-13.65089, 12.49515], [-13.7039, 12.60313], [-13.70523, 12.68013], [-15.17582, 12.6847], [-15.67302, 12.42974], [-16.20591, 12.46157], [-16.38191, 12.36449], [-16.70562, 12.34803], [-17.4623, 11.92379], [-15.96748, 10.162], [-15.07174, 10.89557], [-14.95993, 10.99244], [-14.77786, 11.36323], [-14.66677, 11.51188], [-14.51173, 11.49708], [-14.31513, 11.60713]]]] } },
23293 { type: "Feature", properties: { iso1A2: "GY", iso1A3: "GUY", iso1N3: "328", wikidata: "Q734", nameEn: "Guyana", groups: ["005", "419", "019", "UN"], driveSide: "left", callingCodes: ["592"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-56.84822, 6.73257], [-59.54058, 8.6862], [-59.98508, 8.53046], [-59.85562, 8.35213], [-59.80661, 8.28906], [-59.83156, 8.23261], [-59.97059, 8.20791], [-60.02407, 8.04557], [-60.38056, 7.8302], [-60.51959, 7.83373], [-60.64793, 7.56877], [-60.71923, 7.55817], [-60.59802, 7.33194], [-60.63367, 7.25061], [-60.54098, 7.14804], [-60.44116, 7.20817], [-60.28074, 7.1162], [-60.39419, 6.94847], [-60.54873, 6.8631], [-61.13632, 6.70922], [-61.20762, 6.58174], [-61.15058, 6.19558], [-61.4041, 5.95304], [-60.73204, 5.20931], [-60.32352, 5.21299], [-60.20944, 5.28754], [-59.98129, 5.07097], [-60.04189, 4.69801], [-60.15953, 4.53456], [-59.78878, 4.45637], [-59.69361, 4.34069], [-59.73353, 4.20399], [-59.51963, 3.91951], [-59.86899, 3.57089], [-59.79769, 3.37162], [-59.99733, 2.92312], [-59.91177, 2.36759], [-59.7264, 2.27497], [-59.74066, 1.87596], [-59.25583, 1.40559], [-58.92072, 1.31293], [-58.84229, 1.17749], [-58.53571, 1.29154], [-58.4858, 1.48399], [-58.33887, 1.58014], [-58.01873, 1.51966], [-57.97336, 1.64566], [-57.77281, 1.73344], [-57.55743, 1.69605], [-57.35073, 1.98327], [-57.23981, 1.95808], [-57.09109, 2.01854], [-57.07092, 1.95304], [-56.7659, 1.89509], [-56.47045, 1.95135], [-56.55439, 2.02003], [-56.70519, 2.02964], [-57.35891, 3.32121], [-58.0307, 3.95513], [-57.8699, 4.89394], [-57.37442, 5.0208], [-57.22536, 5.15605], [-57.31629, 5.33714], [-56.84822, 6.73257]]]] } },
23294 { type: "Feature", properties: { iso1A2: "HK", iso1A3: "HKG", iso1N3: "344", wikidata: "Q8646", nameEn: "Hong Kong", country: "CN", groups: ["030", "142", "UN"], driveSide: "left", callingCodes: ["852"] }, geometry: { type: "MultiPolygon", coordinates: [[[[113.92195, 22.13873], [114.50148, 22.15017], [114.44998, 22.55977], [114.25154, 22.55977], [114.22888, 22.5436], [114.22185, 22.55343], [114.20655, 22.55706], [114.18338, 22.55444], [114.17247, 22.55944], [114.1597, 22.56041], [114.15123, 22.55163], [114.1482, 22.54091], [114.13823, 22.54319], [114.12665, 22.54003], [114.11656, 22.53415], [114.11181, 22.52878], [114.1034, 22.5352], [114.09692, 22.53435], [114.09048, 22.53716], [114.08606, 22.53276], [114.07817, 22.52997], [114.07267, 22.51855], [114.06272, 22.51617], [114.05729, 22.51104], [114.05438, 22.5026], [114.03113, 22.5065], [113.86771, 22.42972], [113.81621, 22.2163], [113.83338, 22.1826], [113.92195, 22.13873]]]] } },
23295 { type: "Feature", properties: { iso1A2: "HM", iso1A3: "HMD", iso1N3: "334", wikidata: "Q131198", nameEn: "Heard Island and McDonald Islands", country: "AU", groups: ["053", "009", "UN"], driveSide: "left" }, geometry: { type: "MultiPolygon", coordinates: [[[[71.08716, -53.87687], [75.44182, -53.99822], [72.87012, -51.48322], [71.08716, -53.87687]]]] } },
23296 { type: "Feature", properties: { iso1A2: "HN", iso1A3: "HND", iso1N3: "340", wikidata: "Q783", nameEn: "Honduras", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["504"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-83.86109, 17.73736], [-88.20359, 16.03858], [-88.22552, 15.72294], [-88.24022, 15.69247], [-88.31459, 15.66942], [-88.32467, 15.63665], [-88.97343, 15.14039], [-89.15149, 15.07392], [-89.18048, 14.99967], [-89.15149, 14.97775], [-89.23467, 14.85596], [-89.13132, 14.71582], [-89.15653, 14.57802], [-89.23719, 14.58046], [-89.35189, 14.47553], [-89.34776, 14.43013], [-89.04187, 14.33644], [-88.94608, 14.20207], [-88.85785, 14.17763], [-88.815, 14.11652], [-88.73182, 14.10919], [-88.70661, 14.04317], [-88.49738, 13.97224], [-88.48982, 13.86458], [-88.25791, 13.91108], [-88.23018, 13.99915], [-88.07641, 13.98447], [-88.00331, 13.86948], [-87.7966, 13.91353], [-87.68821, 13.80829], [-87.73106, 13.75443], [-87.78148, 13.52906], [-87.71657, 13.50577], [-87.72115, 13.46083], [-87.73841, 13.44169], [-87.77354, 13.45767], [-87.83467, 13.44655], [-87.84675, 13.41078], [-87.80177, 13.35689], [-87.73714, 13.32715], [-87.69751, 13.25228], [-87.55124, 13.12523], [-87.37107, 12.98646], [-87.06306, 13.00892], [-87.03785, 12.98682], [-86.93197, 13.05313], [-86.93383, 13.18677], [-86.87066, 13.30641], [-86.71267, 13.30348], [-86.76812, 13.79605], [-86.35219, 13.77157], [-86.14801, 14.04317], [-86.00685, 14.08474], [-86.03458, 13.99181], [-85.75477, 13.8499], [-85.73964, 13.9698], [-85.45762, 14.11304], [-85.32149, 14.2562], [-85.18602, 14.24929], [-85.1575, 14.53934], [-84.90082, 14.80489], [-84.82596, 14.82212], [-84.70119, 14.68078], [-84.48373, 14.63249], [-84.10584, 14.76353], [-83.89551, 14.76697], [-83.62101, 14.89448], [-83.49268, 15.01158], [-83.13724, 15.00002], [-83.04763, 15.03256], [-82.06974, 14.49418], [-81.58685, 18.0025], [-83.86109, 17.73736]]]] } },
23297 { type: "Feature", properties: { iso1A2: "HR", iso1A3: "HRV", iso1N3: "191", wikidata: "Q224", nameEn: "Croatia", groups: ["EU", "039", "150", "UN"], callingCodes: ["385"] }, geometry: { type: "MultiPolygon", coordinates: [[[[17.6444, 42.88641], [17.5392, 42.92787], [17.70879, 42.97223], [17.64268, 43.08595], [17.46986, 43.16559], [17.286, 43.33065], [17.25579, 43.40353], [17.29699, 43.44542], [17.24411, 43.49376], [17.15828, 43.49376], [17.00585, 43.58037], [16.80736, 43.76011], [16.75316, 43.77157], [16.70922, 43.84887], [16.55472, 43.95326], [16.50528, 44.0244], [16.43629, 44.02826], [16.43662, 44.07523], [16.36864, 44.08263], [16.18688, 44.27012], [16.21346, 44.35231], [16.12969, 44.38275], [16.16814, 44.40679], [16.10566, 44.52586], [16.03012, 44.55572], [16.00884, 44.58605], [16.05828, 44.61538], [15.89348, 44.74964], [15.8255, 44.71501], [15.72584, 44.82334], [15.79472, 44.8455], [15.76096, 44.87045], [15.74723, 44.96818], [15.78568, 44.97401], [15.74585, 45.0638], [15.78842, 45.11519], [15.76371, 45.16508], [15.83512, 45.22459], [15.98412, 45.23088], [16.12153, 45.09616], [16.29036, 44.99732], [16.35404, 45.00241], [16.35863, 45.03529], [16.3749, 45.05206], [16.38219, 45.05139], [16.38309, 45.05955], [16.40023, 45.1147], [16.4634, 45.14522], [16.49155, 45.21153], [16.52982, 45.22713], [16.5501, 45.2212], [16.56559, 45.22307], [16.60194, 45.23042], [16.64962, 45.20714], [16.74845, 45.20393], [16.78219, 45.19002], [16.81137, 45.18434], [16.83804, 45.18951], [16.92405, 45.27607], [16.9385, 45.22742], [17.0415, 45.20759], [17.18438, 45.14764], [17.24325, 45.146], [17.25131, 45.14957], [17.26815, 45.18444], [17.32092, 45.16246], [17.33573, 45.14521], [17.41229, 45.13335], [17.4498, 45.16119], [17.45615, 45.12523], [17.47589, 45.12656], [17.51469, 45.10791], [17.59104, 45.10816], [17.66571, 45.13408], [17.84826, 45.04489], [17.87148, 45.04645], [17.93706, 45.08016], [17.97336, 45.12245], [17.97834, 45.13831], [17.99479, 45.14958], [18.01594, 45.15163], [18.03121, 45.12632], [18.1624, 45.07654], [18.24387, 45.13699], [18.32077, 45.1021], [18.41896, 45.11083], [18.47939, 45.05871], [18.65723, 45.07544], [18.78357, 44.97741], [18.80661, 44.93561], [18.76369, 44.93707], [18.76347, 44.90669], [18.8704, 44.85097], [19.01994, 44.85493], [18.98957, 44.90645], [19.02871, 44.92541], [19.06853, 44.89915], [19.15573, 44.95409], [19.05205, 44.97692], [19.1011, 45.01191], [19.07952, 45.14668], [19.14063, 45.12972], [19.19144, 45.17863], [19.43589, 45.17137], [19.41941, 45.23475], [19.28208, 45.23813], [19.10774, 45.29547], [18.97446, 45.37528], [18.99918, 45.49333], [19.08364, 45.48804], [19.07471, 45.53086], [18.94562, 45.53712], [18.88776, 45.57253], [18.96691, 45.66731], [18.90305, 45.71863], [18.85783, 45.85493], [18.81394, 45.91329], [18.80211, 45.87995], [18.6792, 45.92057], [18.57483, 45.80772], [18.44368, 45.73972], [18.12439, 45.78905], [18.08869, 45.76511], [17.99805, 45.79671], [17.87377, 45.78522], [17.66545, 45.84207], [17.56821, 45.93728], [17.35672, 45.95209], [17.14592, 46.16697], [16.8903, 46.28122], [16.8541, 46.36255], [16.7154, 46.39523], [16.6639, 46.45203], [16.59527, 46.47524], [16.52604, 46.47831], [16.5007, 46.49644], [16.44036, 46.5171], [16.38771, 46.53608], [16.37193, 46.55008], [16.29793, 46.5121], [16.26733, 46.51505], [16.26759, 46.50566], [16.23961, 46.49653], [16.25124, 46.48067], [16.27398, 46.42875], [16.27329, 46.41467], [16.30162, 46.40437], [16.30233, 46.37837], [16.18824, 46.38282], [16.14859, 46.40547], [16.05281, 46.39141], [16.05065, 46.3833], [16.07314, 46.36458], [16.07616, 46.3463], [15.97965, 46.30652], [15.79284, 46.25811], [15.78817, 46.21719], [15.75479, 46.20336], [15.75436, 46.21969], [15.67395, 46.22478], [15.6434, 46.21396], [15.64904, 46.19229], [15.59909, 46.14761], [15.6083, 46.11992], [15.62317, 46.09103], [15.72977, 46.04682], [15.71246, 46.01196], [15.70327, 46.00015], [15.70636, 45.92116], [15.67967, 45.90455], [15.68383, 45.88867], [15.68232, 45.86819], [15.70411, 45.8465], [15.66662, 45.84085], [15.64185, 45.82915], [15.57952, 45.84953], [15.52234, 45.82195], [15.47325, 45.8253], [15.47531, 45.79802], [15.40836, 45.79491], [15.25423, 45.72275], [15.30872, 45.69014], [15.34919, 45.71623], [15.4057, 45.64727], [15.38952, 45.63682], [15.34214, 45.64702], [15.34695, 45.63382], [15.31027, 45.6303], [15.27747, 45.60504], [15.29837, 45.5841], [15.30249, 45.53224], [15.38188, 45.48752], [15.33051, 45.45258], [15.27758, 45.46678], [15.16862, 45.42309], [15.05187, 45.49079], [15.02385, 45.48533], [14.92266, 45.52788], [14.90554, 45.47769], [14.81992, 45.45913], [14.80124, 45.49515], [14.71718, 45.53442], [14.68605, 45.53006], [14.69694, 45.57366], [14.59576, 45.62812], [14.60977, 45.66403], [14.57397, 45.67165], [14.53816, 45.6205], [14.5008, 45.60852], [14.49769, 45.54424], [14.36693, 45.48642], [14.32487, 45.47142], [14.27681, 45.4902], [14.26611, 45.48239], [14.24239, 45.50607], [14.22371, 45.50388], [14.20348, 45.46896], [14.07116, 45.48752], [14.00578, 45.52352], [13.96063, 45.50825], [13.99488, 45.47551], [13.97309, 45.45258], [13.90771, 45.45149], [13.88124, 45.42637], [13.81742, 45.43729], [13.7785, 45.46787], [13.67398, 45.4436], [13.62902, 45.45898], [13.56979, 45.4895], [13.45644, 45.59464], [13.05142, 45.33128], [13.12821, 44.48877], [16.15283, 42.18525], [18.45131, 42.21682], [18.54128, 42.39171], [18.52152, 42.42302], [18.43588, 42.48556], [18.44307, 42.51077], [18.43735, 42.55921], [18.36197, 42.61423], [18.24318, 42.6112], [17.88201, 42.83668], [17.80854, 42.9182], [17.7948, 42.89556], [17.68151, 42.92725], [17.6444, 42.88641]]]] } },
23298 { type: "Feature", properties: { iso1A2: "HT", iso1A3: "HTI", iso1N3: "332", wikidata: "Q790", nameEn: "Haiti", aliases: ["RH"], groups: ["029", "003", "419", "019", "UN"], callingCodes: ["509"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.71885, 18.78423], [-71.72624, 18.87802], [-71.77766, 18.95007], [-71.88102, 18.95007], [-71.74088, 19.0437], [-71.71088, 19.08353], [-71.69938, 19.10916], [-71.65337, 19.11759], [-71.62642, 19.21212], [-71.73229, 19.26686], [-71.77766, 19.33823], [-71.69448, 19.37866], [-71.6802, 19.45008], [-71.71268, 19.53374], [-71.71449, 19.55364], [-71.7429, 19.58445], [-71.75865, 19.70231], [-71.77419, 19.73128], [-72.38946, 20.27111], [-73.37289, 20.43199], [-74.7289, 18.71009], [-74.76465, 18.06252], [-72.29523, 17.48026], [-71.75671, 18.03456], [-71.73783, 18.07177], [-71.74994, 18.11115], [-71.75465, 18.14405], [-71.78271, 18.18302], [-71.69952, 18.34101], [-71.90875, 18.45821], [-71.88102, 18.50125], [-72.00201, 18.62312], [-71.95412, 18.64939], [-71.82556, 18.62551], [-71.71885, 18.78423]]]] } },
23299 { type: "Feature", properties: { iso1A2: "HU", iso1A3: "HUN", iso1N3: "348", wikidata: "Q28", nameEn: "Hungary", groups: ["EU", "151", "150", "UN"], callingCodes: ["36"] }, geometry: { type: "MultiPolygon", coordinates: [[[[21.72525, 48.34628], [21.67134, 48.3989], [21.6068, 48.50365], [21.44063, 48.58456], [21.11516, 48.49546], [20.83248, 48.5824], [20.5215, 48.53336], [20.29943, 48.26104], [20.24312, 48.2784], [19.92452, 48.1283], [19.63338, 48.25006], [19.52489, 48.19791], [19.47957, 48.09437], [19.28182, 48.08336], [19.23924, 48.0595], [19.01952, 48.07052], [18.82176, 48.04206], [18.76134, 47.97499], [18.76821, 47.87469], [18.8506, 47.82308], [18.74074, 47.8157], [18.66521, 47.76772], [18.56496, 47.76588], [18.29305, 47.73541], [18.02938, 47.75665], [17.71215, 47.7548], [17.23699, 48.02094], [17.16001, 48.00636], [17.09786, 47.97336], [17.11022, 47.92461], [17.08275, 47.87719], [17.00997, 47.86245], [17.07039, 47.81129], [17.05048, 47.79377], [17.08893, 47.70928], [16.87538, 47.68895], [16.86509, 47.72268], [16.82938, 47.68432], [16.7511, 47.67878], [16.72089, 47.73469], [16.65679, 47.74197], [16.61183, 47.76171], [16.54779, 47.75074], [16.53514, 47.73837], [16.55129, 47.72268], [16.4222, 47.66537], [16.58699, 47.61772], [16.64193, 47.63114], [16.71059, 47.52692], [16.64821, 47.50155], [16.6718, 47.46139], [16.57152, 47.40868], [16.52414, 47.41007], [16.49908, 47.39416], [16.45104, 47.41181], [16.47782, 47.25918], [16.44142, 47.25079], [16.43663, 47.21127], [16.41739, 47.20649], [16.42801, 47.18422], [16.4523, 47.18812], [16.46442, 47.16845], [16.44932, 47.14418], [16.52863, 47.13974], [16.46134, 47.09395], [16.52176, 47.05747], [16.43936, 47.03548], [16.51369, 47.00084], [16.28202, 47.00159], [16.27594, 46.9643], [16.22403, 46.939], [16.19904, 46.94134], [16.10983, 46.867], [16.14365, 46.8547], [16.15711, 46.85434], [16.21892, 46.86961], [16.2365, 46.87775], [16.2941, 46.87137], [16.34547, 46.83836], [16.3408, 46.80641], [16.31303, 46.79838], [16.30966, 46.7787], [16.37816, 46.69975], [16.42641, 46.69228], [16.41863, 46.66238], [16.38594, 46.6549], [16.39217, 46.63673], [16.50139, 46.56684], [16.52885, 46.53303], [16.52604, 46.5051], [16.59527, 46.47524], [16.6639, 46.45203], [16.7154, 46.39523], [16.8541, 46.36255], [16.8903, 46.28122], [17.14592, 46.16697], [17.35672, 45.95209], [17.56821, 45.93728], [17.66545, 45.84207], [17.87377, 45.78522], [17.99805, 45.79671], [18.08869, 45.76511], [18.12439, 45.78905], [18.44368, 45.73972], [18.57483, 45.80772], [18.6792, 45.92057], [18.80211, 45.87995], [18.81394, 45.91329], [18.99712, 45.93537], [19.01284, 45.96529], [19.0791, 45.96458], [19.10388, 46.04015], [19.14543, 45.9998], [19.28826, 45.99694], [19.52473, 46.1171], [19.56113, 46.16824], [19.66007, 46.19005], [19.81491, 46.1313], [19.93508, 46.17553], [20.01816, 46.17696], [20.03533, 46.14509], [20.09713, 46.17315], [20.26068, 46.12332], [20.28324, 46.1438], [20.35573, 46.16629], [20.45377, 46.14405], [20.49718, 46.18721], [20.63863, 46.12728], [20.76085, 46.21002], [20.74574, 46.25467], [20.86797, 46.28884], [21.06572, 46.24897], [21.16872, 46.30118], [21.28061, 46.44941], [21.26929, 46.4993], [21.33214, 46.63035], [21.43926, 46.65109], [21.5151, 46.72147], [21.48935, 46.7577], [21.52028, 46.84118], [21.59307, 46.86935], [21.59581, 46.91628], [21.68645, 46.99595], [21.648, 47.03902], [21.78395, 47.11104], [21.94463, 47.38046], [22.01055, 47.37767], [22.03389, 47.42508], [22.00917, 47.50492], [22.31816, 47.76126], [22.41979, 47.7391], [22.46559, 47.76583], [22.67247, 47.7871], [22.76617, 47.8417], [22.77991, 47.87211], [22.89849, 47.95851], [22.84276, 47.98602], [22.87847, 48.04665], [22.81804, 48.11363], [22.73427, 48.12005], [22.66835, 48.09162], [22.58733, 48.10813], [22.59007, 48.15121], [22.49806, 48.25189], [22.38133, 48.23726], [22.2083, 48.42534], [22.14689, 48.4005], [21.83339, 48.36242], [21.8279, 48.33321], [21.72525, 48.34628]]]] } },
23300 { type: "Feature", properties: { iso1A2: "IC", wikidata: "Q5813", nameEn: "Canary Islands", country: "ES", groups: ["Q3320166", "Q105472", "EU", "039", "150", "UN"], isoStatus: "excRes", callingCodes: ["34"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-12.00985, 30.24121], [-25.3475, 27.87574], [-14.43883, 27.02969], [-12.00985, 30.24121]]]] } },
23301 { type: "Feature", properties: { iso1A2: "ID", iso1A3: "IDN", iso1N3: "360", wikidata: "Q252", nameEn: "Indonesia", aliases: ["RI"] }, geometry: null },
23302 { type: "Feature", geometry: { type: "MultiPolygon", coordinates: [[[[-6.26218, 54.09785], [-6.29003, 54.11278], [-6.32694, 54.09337], [-6.36279, 54.11248], [-6.36605, 54.07234], [-6.47849, 54.06947], [-6.62842, 54.03503], [-6.66264, 54.0666], [-6.6382, 54.17071], [-6.70175, 54.20218], [-6.74575, 54.18788], [-6.81583, 54.22791], [-6.85179, 54.29176], [-6.87775, 54.34682], [-7.02034, 54.4212], [-7.19145, 54.31296], [-7.14908, 54.22732], [-7.25012, 54.20063], [-7.26316, 54.13863], [-7.29493, 54.12013], [-7.29687, 54.1354], [-7.28017, 54.16714], [-7.29157, 54.17191], [-7.34005, 54.14698], [-7.30553, 54.11869], [-7.32834, 54.11475], [-7.44567, 54.1539], [-7.4799, 54.12239], [-7.55812, 54.12239], [-7.69501, 54.20731], [-7.81397, 54.20159], [-7.8596, 54.21779], [-7.87101, 54.29299], [-8.04555, 54.36292], [-8.179, 54.46763], [-8.04538, 54.48941], [-7.99812, 54.54427], [-7.8596, 54.53671], [-7.70315, 54.62077], [-7.93293, 54.66603], [-7.83352, 54.73854], [-7.75041, 54.7103], [-7.64449, 54.75265], [-7.54671, 54.74606], [-7.54508, 54.79401], [-7.47626, 54.83084], [-7.4473, 54.87003], [-7.44404, 54.9403], [-7.40004, 54.94498], [-7.4033, 55.00391], [-7.34464, 55.04688], [-7.2471, 55.06933], [-6.34755, 55.49206], [-7.75229, 55.93854], [-11.75, 54], [-11, 51], [-6.03913, 51.13217], [-5.37267, 53.63269], [-6.26218, 54.09785]]]] }, properties: { iso1A2: "IE", iso1A3: "IRL", iso1N3: "372", wikidata: "Q27", nameEn: "Republic of Ireland", groups: ["EU", "Q22890", "154", "150", "UN"], driveSide: "left", callingCodes: ["353"] } },
23303 { type: "Feature", properties: { iso1A2: "IL", iso1A3: "ISR", iso1N3: "376", wikidata: "Q801", nameEn: "Israel", groups: ["145", "142", "UN"], callingCodes: ["972"] }, geometry: { type: "MultiPolygon", coordinates: [[[[34.052, 31.46619], [34.29262, 31.70393], [34.48681, 31.59711], [34.56797, 31.54197], [34.48892, 31.48365], [34.40077, 31.40926], [34.36505, 31.36404], [34.37381, 31.30598], [34.36523, 31.28963], [34.29417, 31.24194], [34.26742, 31.21998], [34.92298, 29.45305], [34.97718, 29.54294], [34.98207, 29.58147], [35.02147, 29.66343], [35.14108, 30.07374], [35.19183, 30.34636], [35.16218, 30.43535], [35.19595, 30.50297], [35.21379, 30.60401], [35.29311, 30.71365], [35.33456, 30.81224], [35.33984, 30.8802], [35.41371, 30.95565], [35.43658, 31.12444], [35.40316, 31.25535], [35.47672, 31.49578], [35.39675, 31.49572], [35.22921, 31.37445], [35.13033, 31.3551], [35.02459, 31.35979], [34.92571, 31.34337], [34.88932, 31.37093], [34.87833, 31.39321], [34.89756, 31.43891], [34.93258, 31.47816], [34.94356, 31.50743], [34.9415, 31.55601], [34.95249, 31.59813], [35.00879, 31.65426], [35.08226, 31.69107], [35.10782, 31.71594], [35.11895, 31.71454], [35.12933, 31.7325], [35.13931, 31.73012], [35.15119, 31.73634], [35.15474, 31.73352], [35.16478, 31.73242], [35.18023, 31.72067], [35.20538, 31.72388], [35.21937, 31.71578], [35.22392, 31.71899], [35.23972, 31.70896], [35.24315, 31.71244], [35.2438, 31.7201], [35.24981, 31.72543], [35.25182, 31.73945], [35.26319, 31.74846], [35.25225, 31.7678], [35.26058, 31.79064], [35.25573, 31.81362], [35.26404, 31.82567], [35.251, 31.83085], [35.25753, 31.8387], [35.24816, 31.8458], [35.2304, 31.84222], [35.2249, 31.85433], [35.22817, 31.8638], [35.22567, 31.86745], [35.22294, 31.87889], [35.22014, 31.88264], [35.2136, 31.88241], [35.21276, 31.88153], [35.21016, 31.88237], [35.20945, 31.8815], [35.20791, 31.8821], [35.20673, 31.88151], [35.20381, 31.86716], [35.21128, 31.863], [35.216, 31.83894], [35.21469, 31.81835], [35.19461, 31.82687], [35.18169, 31.82542], [35.18603, 31.80901], [35.14174, 31.81325], [35.07677, 31.85627], [35.05617, 31.85685], [35.01978, 31.82944], [34.9724, 31.83352], [34.99712, 31.85569], [35.03489, 31.85919], [35.03978, 31.89276], [35.03489, 31.92448], [35.00124, 31.93264], [34.98682, 31.96935], [35.00261, 32.027], [34.9863, 32.09551], [34.99437, 32.10962], [34.98507, 32.12606], [34.99039, 32.14626], [34.96009, 32.17503], [34.95703, 32.19522], [34.98885, 32.20758], [35.01841, 32.23981], [35.02939, 32.2671], [35.01119, 32.28684], [35.01772, 32.33863], [35.04243, 32.35008], [35.05142, 32.3667], [35.0421, 32.38242], [35.05311, 32.4024], [35.05423, 32.41754], [35.07059, 32.4585], [35.08564, 32.46948], [35.09236, 32.47614], [35.10024, 32.47856], [35.10882, 32.4757], [35.15937, 32.50466], [35.2244, 32.55289], [35.25049, 32.52453], [35.29306, 32.50947], [35.30685, 32.51024], [35.35212, 32.52047], [35.40224, 32.50136], [35.42034, 32.46009], [35.41598, 32.45593], [35.41048, 32.43706], [35.42078, 32.41562], [35.55807, 32.38674], [35.55494, 32.42687], [35.57485, 32.48669], [35.56614, 32.64393], [35.59813, 32.65159], [35.61669, 32.67999], [35.66527, 32.681], [35.68467, 32.70715], [35.75983, 32.74803], [35.78745, 32.77938], [35.83758, 32.82817], [35.84021, 32.8725], [35.87012, 32.91976], [35.89298, 32.9456], [35.87188, 32.98028], [35.84802, 33.1031], [35.81911, 33.11077], [35.81911, 33.1336], [35.84285, 33.16673], [35.83846, 33.19397], [35.81647, 33.2028], [35.81295, 33.24841], [35.77513, 33.27342], [35.813, 33.3172], [35.77477, 33.33609], [35.62019, 33.27278], [35.62283, 33.24226], [35.58502, 33.26653], [35.58326, 33.28381], [35.56523, 33.28969], [35.55555, 33.25844], [35.54544, 33.25513], [35.54808, 33.236], [35.5362, 33.23196], [35.54228, 33.19865], [35.52573, 33.11921], [35.50335, 33.114], [35.50272, 33.09056], [35.448, 33.09264], [35.43059, 33.06659], [35.35223, 33.05617], [35.31429, 33.10515], [35.1924, 33.08743], [35.10645, 33.09318], [34.78515, 33.20368], [33.62659, 31.82938], [34.052, 31.46619]]]] } },
23304 { type: "Feature", properties: { iso1A2: "IM", iso1A3: "IMN", iso1N3: "833", wikidata: "Q9676", nameEn: "Isle of Man", country: "GB", groups: ["Q185086", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01624", "44 07624", "44 07524", "44 07924"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-3.98763, 54.07351], [-4.1819, 54.57861], [-5.6384, 53.81157], [-3.98763, 54.07351]]]] } },
23305 { type: "Feature", properties: { iso1A2: "IN", iso1A3: "IND", iso1N3: "356", wikidata: "Q668", nameEn: "India" }, geometry: null },
23306 { type: "Feature", properties: { iso1A2: "IO", iso1A3: "IOT", iso1N3: "086", wikidata: "Q43448", nameEn: "British Indian Ocean Territory", country: "GB" }, geometry: null },
23307 { type: "Feature", properties: { iso1A2: "IQ", iso1A3: "IRQ", iso1N3: "368", wikidata: "Q796", nameEn: "Iraq", groups: ["145", "142", "UN"], callingCodes: ["964"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.78887, 37.38615], [42.56725, 37.14878], [42.35724, 37.10998], [42.36697, 37.0627], [41.81736, 36.58782], [41.40058, 36.52502], [41.28864, 36.35368], [41.2564, 36.06012], [41.37027, 35.84095], [41.38184, 35.62502], [41.26569, 35.42708], [41.21654, 35.1508], [41.2345, 34.80049], [41.12388, 34.65742], [40.97676, 34.39788], [40.64314, 34.31604], [38.79171, 33.37328], [39.08202, 32.50304], [38.98762, 32.47694], [39.04251, 32.30203], [39.26157, 32.35555], [39.29903, 32.23259], [40.01521, 32.05667], [42.97601, 30.72204], [42.97796, 30.48295], [44.72255, 29.19736], [46.42415, 29.05947], [46.5527, 29.10283], [46.89695, 29.50584], [47.15166, 30.01044], [47.37192, 30.10421], [47.7095, 30.10453], [48.01114, 29.98906], [48.06782, 30.02906], [48.17332, 30.02448], [48.40479, 29.85763], [48.59531, 29.66815], [48.83867, 29.78572], [48.61441, 29.93675], [48.51011, 29.96238], [48.44785, 30.00148], [48.4494, 30.04456], [48.43384, 30.08233], [48.38869, 30.11062], [48.38714, 30.13485], [48.41671, 30.17254], [48.41117, 30.19846], [48.26393, 30.3408], [48.24385, 30.33846], [48.21279, 30.31644], [48.19425, 30.32796], [48.18321, 30.39703], [48.14585, 30.44133], [48.02443, 30.4789], [48.03221, 30.9967], [47.68219, 31.00004], [47.6804, 31.39086], [47.86337, 31.78422], [47.64771, 32.07666], [47.52474, 32.15972], [47.57144, 32.20583], [47.37529, 32.47808], [47.17218, 32.45393], [46.46788, 32.91992], [46.32298, 32.9731], [46.17198, 32.95612], [46.09103, 32.98354], [46.15175, 33.07229], [46.03966, 33.09577], [46.05367, 33.13097], [46.11905, 33.11924], [46.20623, 33.20395], [45.99919, 33.5082], [45.86687, 33.49263], [45.96183, 33.55751], [45.89801, 33.63661], [45.77814, 33.60938], [45.50261, 33.94968], [45.42789, 33.9458], [45.41077, 33.97421], [45.47264, 34.03099], [45.56176, 34.15088], [45.58667, 34.30147], [45.53552, 34.35148], [45.49171, 34.3439], [45.46697, 34.38221], [45.43879, 34.45949], [45.51883, 34.47692], [45.53219, 34.60441], [45.59074, 34.55558], [45.60224, 34.55057], [45.73923, 34.54416], [45.70031, 34.69277], [45.65672, 34.7222], [45.68284, 34.76624], [45.70031, 34.82322], [45.73641, 34.83975], [45.79682, 34.85133], [45.78904, 34.91135], [45.86532, 34.89858], [45.89477, 34.95805], [45.87864, 35.03441], [45.92173, 35.0465], [45.92203, 35.09538], [45.93108, 35.08148], [45.94756, 35.09188], [46.06508, 35.03699], [46.07747, 35.0838], [46.11763, 35.07551], [46.19116, 35.11097], [46.15642, 35.1268], [46.16229, 35.16984], [46.19738, 35.18536], [46.18457, 35.22561], [46.11367, 35.23729], [46.15474, 35.2883], [46.13152, 35.32548], [46.05358, 35.38568], [45.98453, 35.49848], [46.01518, 35.52012], [45.97584, 35.58132], [46.03028, 35.57416], [46.01307, 35.59756], [46.0165, 35.61501], [45.99452, 35.63574], [46.0117, 35.65059], [46.01631, 35.69139], [46.23736, 35.71414], [46.34166, 35.78363], [46.32921, 35.82655], [46.17198, 35.8013], [46.08325, 35.8581], [45.94711, 35.82218], [45.89784, 35.83708], [45.81442, 35.82107], [45.76145, 35.79898], [45.6645, 35.92872], [45.60018, 35.96069], [45.55245, 35.99943], [45.46594, 36.00042], [45.38275, 35.97156], [45.33916, 35.99424], [45.37652, 36.06222], [45.37312, 36.09917], [45.32235, 36.17383], [45.30038, 36.27769], [45.26261, 36.3001], [45.27394, 36.35846], [45.23953, 36.43257], [45.11811, 36.40751], [45.00759, 36.5402], [45.06985, 36.62645], [45.06985, 36.6814], [45.01537, 36.75128], [44.84725, 36.77622], [44.83479, 36.81362], [44.90173, 36.86096], [44.91199, 36.91468], [44.89862, 37.01897], [44.81611, 37.04383], [44.75229, 37.11958], [44.78319, 37.1431], [44.76698, 37.16162], [44.63179, 37.19229], [44.42631, 37.05825], [44.38117, 37.05825], [44.35315, 37.04955], [44.35937, 37.02843], [44.30645, 36.97373], [44.25975, 36.98119], [44.18503, 37.09551], [44.22239, 37.15756], [44.27998, 37.16501], [44.2613, 37.25055], [44.13521, 37.32486], [44.02002, 37.33229], [43.90949, 37.22453], [43.84878, 37.22205], [43.82699, 37.19477], [43.8052, 37.22825], [43.7009, 37.23692], [43.63085, 37.21957], [43.56702, 37.25675], [43.50787, 37.24436], [43.33508, 37.33105], [43.30083, 37.30629], [43.11403, 37.37436], [42.93705, 37.32015], [42.78887, 37.38615]]]] } },
23308 { type: "Feature", properties: { iso1A2: "IR", iso1A3: "IRN", iso1N3: "364", wikidata: "Q794", nameEn: "Iran", groups: ["034", "142", "UN"], callingCodes: ["98"] }, geometry: { type: "MultiPolygon", coordinates: [[[[44.96746, 39.42998], [44.88916, 39.59653], [44.81043, 39.62677], [44.71806, 39.71124], [44.65422, 39.72163], [44.6137, 39.78393], [44.47298, 39.68788], [44.48111, 39.61579], [44.41849, 39.56659], [44.42832, 39.4131], [44.37921, 39.4131], [44.29818, 39.378], [44.22452, 39.4169], [44.03667, 39.39223], [44.1043, 39.19842], [44.20946, 39.13975], [44.18863, 38.93881], [44.30322, 38.81581], [44.26155, 38.71427], [44.28065, 38.6465], [44.32058, 38.62752], [44.3207, 38.49799], [44.3119, 38.37887], [44.38309, 38.36117], [44.44386, 38.38295], [44.50115, 38.33939], [44.42476, 38.25763], [44.22509, 37.88859], [44.3883, 37.85433], [44.45948, 37.77065], [44.55498, 37.783], [44.62096, 37.71985], [44.56887, 37.6429], [44.61401, 37.60165], [44.58449, 37.45018], [44.81021, 37.2915], [44.75986, 37.21549], [44.7868, 37.16644], [44.78319, 37.1431], [44.75229, 37.11958], [44.81611, 37.04383], [44.89862, 37.01897], [44.91199, 36.91468], [44.90173, 36.86096], [44.83479, 36.81362], [44.84725, 36.77622], [45.01537, 36.75128], [45.06985, 36.6814], [45.06985, 36.62645], [45.00759, 36.5402], [45.11811, 36.40751], [45.23953, 36.43257], [45.27394, 36.35846], [45.26261, 36.3001], [45.30038, 36.27769], [45.32235, 36.17383], [45.37312, 36.09917], [45.37652, 36.06222], [45.33916, 35.99424], [45.38275, 35.97156], [45.46594, 36.00042], [45.55245, 35.99943], [45.60018, 35.96069], [45.6645, 35.92872], [45.76145, 35.79898], [45.81442, 35.82107], [45.89784, 35.83708], [45.94711, 35.82218], [46.08325, 35.8581], [46.17198, 35.8013], [46.32921, 35.82655], [46.34166, 35.78363], [46.23736, 35.71414], [46.01631, 35.69139], [46.0117, 35.65059], [45.99452, 35.63574], [46.0165, 35.61501], [46.01307, 35.59756], [46.03028, 35.57416], [45.97584, 35.58132], [46.01518, 35.52012], [45.98453, 35.49848], [46.05358, 35.38568], [46.13152, 35.32548], [46.15474, 35.2883], [46.11367, 35.23729], [46.18457, 35.22561], [46.19738, 35.18536], [46.16229, 35.16984], [46.15642, 35.1268], [46.19116, 35.11097], [46.11763, 35.07551], [46.07747, 35.0838], [46.06508, 35.03699], [45.94756, 35.09188], [45.93108, 35.08148], [45.92203, 35.09538], [45.92173, 35.0465], [45.87864, 35.03441], [45.89477, 34.95805], [45.86532, 34.89858], [45.78904, 34.91135], [45.79682, 34.85133], [45.73641, 34.83975], [45.70031, 34.82322], [45.68284, 34.76624], [45.65672, 34.7222], [45.70031, 34.69277], [45.73923, 34.54416], [45.60224, 34.55057], [45.59074, 34.55558], [45.53219, 34.60441], [45.51883, 34.47692], [45.43879, 34.45949], [45.46697, 34.38221], [45.49171, 34.3439], [45.53552, 34.35148], [45.58667, 34.30147], [45.56176, 34.15088], [45.47264, 34.03099], [45.41077, 33.97421], [45.42789, 33.9458], [45.50261, 33.94968], [45.77814, 33.60938], [45.89801, 33.63661], [45.96183, 33.55751], [45.86687, 33.49263], [45.99919, 33.5082], [46.20623, 33.20395], [46.11905, 33.11924], [46.05367, 33.13097], [46.03966, 33.09577], [46.15175, 33.07229], [46.09103, 32.98354], [46.17198, 32.95612], [46.32298, 32.9731], [46.46788, 32.91992], [47.17218, 32.45393], [47.37529, 32.47808], [47.57144, 32.20583], [47.52474, 32.15972], [47.64771, 32.07666], [47.86337, 31.78422], [47.6804, 31.39086], [47.68219, 31.00004], [48.03221, 30.9967], [48.02443, 30.4789], [48.14585, 30.44133], [48.18321, 30.39703], [48.19425, 30.32796], [48.21279, 30.31644], [48.24385, 30.33846], [48.26393, 30.3408], [48.41117, 30.19846], [48.41671, 30.17254], [48.38714, 30.13485], [48.38869, 30.11062], [48.43384, 30.08233], [48.4494, 30.04456], [48.44785, 30.00148], [48.51011, 29.96238], [48.61441, 29.93675], [48.83867, 29.78572], [49.98877, 27.87827], [50.37726, 27.89227], [54.39838, 25.68383], [55.14145, 25.62624], [55.81777, 26.18798], [56.2644, 26.58649], [56.68954, 26.76645], [56.79239, 26.41236], [56.82555, 25.7713], [56.86325, 25.03856], [61.46682, 24.57869], [61.6433, 25.27541], [61.683, 25.66638], [61.83968, 25.7538], [61.83831, 26.07249], [61.89391, 26.26251], [62.05117, 26.31647], [62.21304, 26.26601], [62.31484, 26.528], [62.77352, 26.64099], [63.1889, 26.65072], [63.18688, 26.83844], [63.25005, 26.84212], [63.25005, 27.08692], [63.32283, 27.14437], [63.19649, 27.25674], [62.80604, 27.22412], [62.79684, 27.34381], [62.84905, 27.47627], [62.7638, 28.02992], [62.79412, 28.28108], [62.59499, 28.24842], [62.40259, 28.42703], [61.93581, 28.55284], [61.65978, 28.77937], [61.53765, 29.00507], [61.31508, 29.38903], [60.87231, 29.86514], [61.80829, 30.84224], [61.78268, 30.92724], [61.8335, 30.97669], [61.83257, 31.0452], [61.80957, 31.12576], [61.80569, 31.16167], [61.70929, 31.37391], [60.84541, 31.49561], [60.86191, 32.22565], [60.56485, 33.12944], [60.88908, 33.50219], [60.91133, 33.55596], [60.69573, 33.56054], [60.57762, 33.59772], [60.5485, 33.73422], [60.5838, 33.80793], [60.50209, 34.13992], [60.66502, 34.31539], [60.91321, 34.30411], [60.72316, 34.52857], [60.99922, 34.63064], [61.00197, 34.70631], [61.06926, 34.82139], [61.12831, 35.09938], [61.0991, 35.27845], [61.18187, 35.30249], [61.27371, 35.61482], [61.22719, 35.67038], [61.26152, 35.80749], [61.22444, 35.92879], [61.12007, 35.95992], [61.22719, 36.12759], [61.1393, 36.38782], [61.18187, 36.55348], [61.14516, 36.64644], [60.34767, 36.63214], [60.00768, 37.04102], [59.74678, 37.12499], [59.55178, 37.13594], [59.39385, 37.34257], [59.39797, 37.47892], [59.33507, 37.53146], [59.22905, 37.51161], [58.9338, 37.67374], [58.6921, 37.64548], [58.5479, 37.70526], [58.47786, 37.6433], [58.39959, 37.63134], [58.22999, 37.6856], [58.21399, 37.77281], [57.79534, 37.89299], [57.35042, 37.98546], [57.37236, 38.09321], [57.21169, 38.28965], [57.03453, 38.18717], [56.73928, 38.27887], [56.62255, 38.24005], [56.43303, 38.26054], [56.32454, 38.18502], [56.33278, 38.08132], [55.97847, 38.08024], [55.76561, 38.12238], [55.44152, 38.08564], [55.13412, 37.94705], [54.851, 37.75739], [54.77684, 37.62264], [54.81804, 37.61285], [54.77822, 37.51597], [54.67247, 37.43532], [54.58664, 37.45809], [54.36211, 37.34912], [54.24565, 37.32047], [53.89734, 37.3464], [48.88288, 38.43975], [48.84969, 38.45015], [48.81072, 38.44853], [48.78979, 38.45026], [48.70001, 38.40564], [48.62217, 38.40198], [48.58793, 38.45076], [48.45084, 38.61013], [48.3146, 38.59958], [48.24773, 38.71883], [48.02581, 38.82705], [48.01409, 38.90333], [48.07734, 38.91616], [48.08627, 38.94434], [48.28437, 38.97186], [48.33884, 39.03022], [48.31239, 39.09278], [48.15361, 39.19419], [48.12404, 39.25208], [48.15984, 39.30028], [48.37385, 39.37584], [48.34264, 39.42935], [47.98977, 39.70999], [47.84774, 39.66285], [47.50099, 39.49615], [47.38978, 39.45999], [47.31301, 39.37492], [47.05927, 39.24846], [47.05771, 39.20143], [46.95341, 39.13505], [46.92539, 39.16644], [46.83822, 39.13143], [46.75752, 39.03231], [46.53497, 38.86548], [46.34059, 38.92076], [46.20601, 38.85262], [46.14785, 38.84206], [46.06766, 38.87861], [46.00228, 38.87376], [45.94624, 38.89072], [45.90266, 38.87739], [45.83883, 38.90768], [45.65172, 38.95199], [45.6155, 38.94304], [45.6131, 38.964], [45.44966, 38.99243], [45.44811, 39.04927], [45.40452, 39.07224], [45.40148, 39.09007], [45.30489, 39.18333], [45.16168, 39.21952], [45.08751, 39.35052], [45.05932, 39.36435], [44.96746, 39.42998]]]] } },
23309 { type: "Feature", properties: { iso1A2: "IS", iso1A3: "ISL", iso1N3: "352", wikidata: "Q189", nameEn: "Iceland", groups: ["154", "150", "UN"], callingCodes: ["354"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-33.15676, 62.62995], [-8.25539, 63.0423], [-15.70914, 69.67442], [-33.15676, 62.62995]]]] } },
23310 { type: "Feature", properties: { iso1A2: "IT", iso1A3: "ITA", iso1N3: "380", wikidata: "Q38", nameEn: "Italy", groups: ["EU", "039", "150", "UN"], callingCodes: ["39"] }, geometry: { type: "MultiPolygon", coordinates: [[[[8.95861, 45.96485], [8.97604, 45.96151], [8.97741, 45.98317], [8.96668, 45.98436], [8.95861, 45.96485]]], [[[7.63035, 43.57419], [9.56115, 43.20816], [10.09675, 41.44089], [7.60802, 41.05927], [7.89009, 38.19924], [11.2718, 37.6713], [12.13667, 34.20326], [14.02721, 36.53141], [17.67657, 35.68918], [18.83516, 40.36999], [16.15283, 42.18525], [13.12821, 44.48877], [13.05142, 45.33128], [13.45644, 45.59464], [13.6076, 45.64761], [13.7198, 45.59352], [13.74587, 45.59811], [13.78445, 45.5825], [13.84106, 45.58185], [13.86771, 45.59898], [13.8695, 45.60835], [13.9191, 45.6322], [13.87933, 45.65207], [13.83422, 45.68703], [13.83332, 45.70855], [13.8235, 45.7176], [13.66986, 45.79955], [13.59784, 45.8072], [13.58858, 45.83503], [13.57563, 45.8425], [13.58644, 45.88173], [13.59565, 45.89446], [13.60857, 45.89907], [13.61931, 45.91782], [13.63815, 45.93607], [13.6329, 45.94894], [13.64307, 45.98326], [13.63458, 45.98947], [13.62074, 45.98388], [13.58903, 45.99009], [13.56759, 45.96991], [13.52963, 45.96588], [13.50104, 45.98078], [13.47474, 46.00546], [13.49702, 46.01832], [13.50998, 46.04498], [13.49568, 46.04839], [13.50104, 46.05986], [13.57072, 46.09022], [13.64053, 46.13587], [13.66472, 46.17392], [13.64451, 46.18966], [13.56682, 46.18703], [13.56114, 46.2054], [13.47587, 46.22725], [13.42218, 46.20758], [13.37671, 46.29668], [13.44808, 46.33507], [13.43418, 46.35992], [13.47019, 46.3621], [13.5763, 46.40915], [13.5763, 46.42613], [13.59777, 46.44137], [13.68684, 46.43881], [13.7148, 46.5222], [13.64088, 46.53438], [13.27627, 46.56059], [12.94445, 46.60401], [12.59992, 46.6595], [12.38708, 46.71529], [12.27591, 46.88651], [12.2006, 46.88854], [12.11675, 47.01241], [12.21781, 47.03996], [12.19254, 47.09331], [11.74789, 46.98484], [11.50739, 47.00644], [11.33355, 46.99862], [11.10618, 46.92966], [11.00764, 46.76896], [10.72974, 46.78972], [10.75753, 46.82258], [10.66405, 46.87614], [10.54783, 46.84505], [10.47197, 46.85698], [10.38659, 46.67847], [10.40475, 46.63671], [10.44686, 46.64162], [10.49375, 46.62049], [10.46136, 46.53164], [10.25309, 46.57432], [10.23674, 46.63484], [10.10307, 46.61003], [10.03715, 46.44479], [10.165, 46.41051], [10.10506, 46.3372], [10.17862, 46.25626], [10.14439, 46.22992], [10.07055, 46.21668], [9.95249, 46.38045], [9.73086, 46.35071], [9.71273, 46.29266], [9.57015, 46.2958], [9.46117, 46.37481], [9.45936, 46.50873], [9.40487, 46.46621], [9.36128, 46.5081], [9.28136, 46.49685], [9.25502, 46.43743], [9.29226, 46.32717], [9.24503, 46.23616], [9.01618, 46.04928], [8.99257, 45.9698], [9.09065, 45.89906], [9.06642, 45.8761], [9.04546, 45.84968], [9.04059, 45.8464], [9.03505, 45.83976], [9.03793, 45.83548], [9.03279, 45.82865], [9.0298, 45.82127], [9.00324, 45.82055], [8.99663, 45.83466], [8.9621, 45.83707], [8.94737, 45.84285], [8.91129, 45.8388], [8.93504, 45.86245], [8.94372, 45.86587], [8.93649, 45.86775], [8.88904, 45.95465], [8.86688, 45.96135], [8.85121, 45.97239], [8.8319, 45.9879], [8.79362, 45.99207], [8.78585, 45.98973], [8.79414, 46.00913], [8.85617, 46.0748], [8.80778, 46.10085], [8.75697, 46.10395], [8.62242, 46.12112], [8.45032, 46.26869], [8.46317, 46.43712], [8.42464, 46.46367], [8.30648, 46.41587], [8.31162, 46.38044], [8.08814, 46.26692], [8.16866, 46.17817], [8.11383, 46.11577], [8.02906, 46.10331], [7.98881, 45.99867], [7.9049, 45.99945], [7.85949, 45.91485], [7.56343, 45.97421], [7.10685, 45.85653], [7.04151, 45.92435], [6.95315, 45.85163], [6.80785, 45.83265], [6.80785, 45.71864], [6.98948, 45.63869], [7.00037, 45.509], [7.18019, 45.40071], [7.10572, 45.32924], [7.13115, 45.25386], [7.07074, 45.21228], [6.96706, 45.20841], [6.85144, 45.13226], [6.7697, 45.16044], [6.62803, 45.11175], [6.66981, 45.02324], [6.74791, 45.01939], [6.74519, 44.93661], [6.75518, 44.89915], [6.90774, 44.84322], [6.93499, 44.8664], [7.02217, 44.82519], [7.00401, 44.78782], [7.07484, 44.68073], [7.00582, 44.69364], [6.95133, 44.66264], [6.96042, 44.62129], [6.85507, 44.53072], [6.86233, 44.49834], [6.94504, 44.43112], [6.88784, 44.42043], [6.89171, 44.36637], [6.98221, 44.28289], [7.00764, 44.23736], [7.16929, 44.20352], [7.27827, 44.1462], [7.34547, 44.14359], [7.36364, 44.11882], [7.62155, 44.14881], [7.63245, 44.17877], [7.68694, 44.17487], [7.66878, 44.12795], [7.72508, 44.07578], [7.6597, 44.03009], [7.66848, 43.99943], [7.65266, 43.9763], [7.60771, 43.95772], [7.56858, 43.94506], [7.56075, 43.89932], [7.51162, 43.88301], [7.49355, 43.86551], [7.50423, 43.84345], [7.53006, 43.78405], [7.63035, 43.57419]], [[12.45181, 41.90056], [12.44834, 41.90095], [12.44582, 41.90194], [12.44815, 41.90326], [12.44984, 41.90545], [12.45091, 41.90625], [12.45543, 41.90738], [12.45561, 41.90629], [12.45762, 41.9058], [12.45755, 41.9033], [12.45826, 41.90281], [12.45834, 41.90174], [12.4577, 41.90115], [12.45691, 41.90125], [12.45626, 41.90172], [12.45435, 41.90143], [12.45446, 41.90028], [12.45181, 41.90056]], [[12.45648, 43.89369], [12.44184, 43.90498], [12.41641, 43.89991], [12.40935, 43.9024], [12.41233, 43.90956], [12.40733, 43.92379], [12.41551, 43.92984], [12.41165, 43.93769], [12.40506, 43.94325], [12.40415, 43.95485], [12.41414, 43.95273], [12.42005, 43.9578], [12.43662, 43.95698], [12.44684, 43.96597], [12.46205, 43.97463], [12.47853, 43.98052], [12.49406, 43.98492], [12.50678, 43.99113], [12.51463, 43.99122], [12.5154, 43.98508], [12.51064, 43.98165], [12.51109, 43.97201], [12.50622, 43.97131], [12.50875, 43.96198], [12.50655, 43.95796], [12.51427, 43.94897], [12.51553, 43.94096], [12.50496, 43.93017], [12.50269, 43.92363], [12.49724, 43.92248], [12.49247, 43.91774], [12.49429, 43.90973], [12.48771, 43.89706], [12.45648, 43.89369]]]] } },
23311 { type: "Feature", properties: { iso1A2: "JE", iso1A3: "JEY", iso1N3: "832", wikidata: "Q785", nameEn: "Bailiwick of Jersey", country: "GB", groups: ["830", "Q185086", "154", "150", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["44 01534"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.00491, 48.86706], [-1.83944, 49.23037], [-2.09454, 49.46288], [-2.65349, 49.15373], [-2.00491, 48.86706]]]] } },
23312 { type: "Feature", properties: { iso1A2: "JM", iso1A3: "JAM", iso1N3: "388", wikidata: "Q766", nameEn: "Jamaica", aliases: ["JA"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", callingCodes: ["1 876", "1 658"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-74.09729, 17.36817], [-78.9741, 19.59515], [-78.34606, 16.57862], [-74.09729, 17.36817]]]] } },
23313 { type: "Feature", properties: { iso1A2: "JO", iso1A3: "JOR", iso1N3: "400", wikidata: "Q810", nameEn: "Jordan", groups: ["145", "142", "UN"], callingCodes: ["962"] }, geometry: { type: "MultiPolygon", coordinates: [[[[39.04251, 32.30203], [38.98762, 32.47694], [39.08202, 32.50304], [38.79171, 33.37328], [36.83946, 32.31293], [36.40959, 32.37908], [36.23948, 32.50108], [36.20875, 32.49529], [36.20379, 32.52751], [36.08074, 32.51463], [36.02239, 32.65911], [35.96633, 32.66237], [35.93307, 32.71966], [35.88405, 32.71321], [35.75983, 32.74803], [35.68467, 32.70715], [35.66527, 32.681], [35.61669, 32.67999], [35.59813, 32.65159], [35.56614, 32.64393], [35.57485, 32.48669], [35.55494, 32.42687], [35.55807, 32.38674], [35.57111, 32.21877], [35.52012, 32.04076], [35.54375, 31.96587], [35.52758, 31.9131], [35.55941, 31.76535], [35.47672, 31.49578], [35.40316, 31.25535], [35.43658, 31.12444], [35.41371, 30.95565], [35.33984, 30.8802], [35.33456, 30.81224], [35.29311, 30.71365], [35.21379, 30.60401], [35.19595, 30.50297], [35.16218, 30.43535], [35.19183, 30.34636], [35.14108, 30.07374], [35.02147, 29.66343], [34.98207, 29.58147], [34.97718, 29.54294], [34.92298, 29.45305], [34.8812, 29.36878], [36.07081, 29.18469], [36.50005, 29.49696], [36.75083, 29.86903], [37.4971, 29.99949], [37.66395, 30.33245], [37.99354, 30.49998], [36.99791, 31.50081], [38.99233, 31.99721], [39.29903, 32.23259], [39.26157, 32.35555], [39.04251, 32.30203]]]] } },
23314 { type: "Feature", properties: { iso1A2: "JP", iso1A3: "JPN", iso1N3: "392", wikidata: "Q17", nameEn: "Japan", groups: ["030", "142", "UN"], driveSide: "left", callingCodes: ["81"] }, geometry: { type: "MultiPolygon", coordinates: [[[[145.82361, 43.38904], [145.23667, 43.76813], [145.82343, 44.571], [140.9182, 45.92937], [133.61399, 37.41], [129.2669, 34.87122], [122.26612, 25.98197], [123.92912, 17.8782], [155.16731, 23.60141], [145.82361, 43.38904]]]] } },
23315 { type: "Feature", properties: { iso1A2: "KE", iso1A3: "KEN", iso1N3: "404", wikidata: "Q114", nameEn: "Kenya", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["254"] }, geometry: { type: "MultiPolygon", coordinates: [[[[35.9419, 4.61933], [35.51424, 4.61643], [35.42366, 4.76969], [35.47843, 4.91872], [35.30992, 4.90402], [35.34151, 5.02364], [34.47601, 4.72162], [33.9873, 4.23316], [34.06046, 4.15235], [34.15429, 3.80464], [34.45815, 3.67385], [34.44922, 3.51627], [34.39112, 3.48802], [34.41794, 3.44342], [34.40006, 3.37949], [34.45815, 3.18319], [34.56242, 3.11478], [34.60114, 2.93034], [34.65774, 2.8753], [34.73967, 2.85447], [34.78137, 2.76223], [34.77244, 2.70272], [34.95267, 2.47209], [34.90947, 2.42447], [34.98692, 1.97348], [34.9899, 1.6668], [34.92734, 1.56109], [34.87819, 1.5596], [34.7918, 1.36752], [34.82606, 1.30944], [34.82606, 1.26626], [34.80223, 1.22754], [34.67562, 1.21265], [34.58029, 1.14712], [34.57427, 1.09868], [34.52369, 1.10692], [34.43349, 0.85254], [34.40041, 0.80266], [34.31516, 0.75693], [34.27345, 0.63182], [34.20196, 0.62289], [34.13493, 0.58118], [34.11408, 0.48884], [34.08727, 0.44713], [34.10067, 0.36372], [33.90936, 0.10581], [33.98449, -0.13079], [33.9264, -0.54188], [33.93107, -0.99298], [34.02286, -1.00779], [34.03084, -1.05101], [34.0824, -1.02264], [37.67199, -3.06222], [37.71745, -3.304], [37.5903, -3.42735], [37.63099, -3.50723], [37.75036, -3.54243], [37.81321, -3.69179], [39.21631, -4.67835], [39.44306, -4.93877], [39.62121, -4.68136], [41.75542, -1.85308], [41.56362, -1.66375], [41.56, -1.59812], [41.00099, -0.83068], [40.98767, 2.82959], [41.31368, 3.14314], [41.89488, 3.97375], [41.1754, 3.94079], [40.77498, 4.27683], [39.86043, 3.86974], [39.76808, 3.67058], [39.58339, 3.47434], [39.55132, 3.39634], [39.51551, 3.40895], [39.49444, 3.45521], [39.19954, 3.47834], [39.07736, 3.5267], [38.91938, 3.51198], [38.52336, 3.62551], [38.45812, 3.60445], [38.14168, 3.62487], [37.07724, 4.33503], [36.84474, 4.44518], [36.03924, 4.44406], [35.95449, 4.53244], [35.9419, 4.61933]]]] } },
23316 { type: "Feature", properties: { iso1A2: "KG", iso1A3: "KGZ", iso1N3: "417", wikidata: "Q813", nameEn: "Kyrgyzstan", groups: ["143", "142", "UN"], callingCodes: ["996"] }, geometry: { type: "MultiPolygon", coordinates: [[[[74.88756, 42.98612], [74.75, 42.99029], [74.70331, 43.02519], [74.64615, 43.05881], [74.57491, 43.13702], [74.22489, 43.24657], [73.55634, 43.03071], [73.50992, 42.82356], [73.44393, 42.43098], [71.88792, 42.83578], [71.62405, 42.76613], [71.53272, 42.8014], [71.2724, 42.77853], [71.22785, 42.69248], [71.17807, 42.67381], [71.15232, 42.60486], [70.97717, 42.50147], [70.85973, 42.30188], [70.94483, 42.26238], [71.13263, 42.28356], [71.28719, 42.18033], [70.69777, 41.92554], [70.17682, 41.5455], [70.48909, 41.40335], [70.67586, 41.47953], [70.78572, 41.36419], [70.77885, 41.24813], [70.86263, 41.23833], [70.9615, 41.16393], [71.02193, 41.19494], [71.11806, 41.15359], [71.25813, 41.18796], [71.27187, 41.11015], [71.34877, 41.16807], [71.40198, 41.09436], [71.46148, 41.13958], [71.43814, 41.19644], [71.46688, 41.31883], [71.57227, 41.29175], [71.6787, 41.42111], [71.65914, 41.49599], [71.73054, 41.54713], [71.71132, 41.43012], [71.76625, 41.4466], [71.83914, 41.3546], [71.91457, 41.2982], [71.85964, 41.19081], [72.07249, 41.11739], [72.10745, 41.15483], [72.16433, 41.16483], [72.17594, 41.15522], [72.14864, 41.13363], [72.1792, 41.10621], [72.21061, 41.05607], [72.17594, 41.02377], [72.18339, 40.99571], [72.324, 41.03381], [72.34026, 41.04539], [72.34757, 41.06104], [72.36138, 41.04384], [72.38511, 41.02785], [72.45206, 41.03018], [72.48742, 40.97136], [72.55109, 40.96046], [72.59136, 40.86947], [72.68157, 40.84942], [72.84291, 40.85512], [72.94454, 40.8094], [73.01869, 40.84681], [73.13267, 40.83512], [73.13412, 40.79122], [73.0612, 40.76678], [72.99133, 40.76457], [72.93296, 40.73089], [72.8722, 40.71111], [72.85372, 40.7116], [72.84754, 40.67229], [72.80137, 40.67856], [72.74866, 40.60873], [72.74894, 40.59592], [72.75982, 40.57273], [72.74862, 40.57131], [72.74768, 40.58051], [72.73995, 40.58409], [72.69579, 40.59778], [72.66713, 40.59076], [72.66713, 40.5219], [72.47795, 40.5532], [72.40517, 40.61917], [72.34406, 40.60144], [72.41714, 40.55736], [72.38384, 40.51535], [72.41513, 40.50856], [72.44191, 40.48222], [72.40346, 40.4007], [72.24368, 40.46091], [72.18648, 40.49893], [71.96401, 40.31907], [72.05464, 40.27586], [71.85002, 40.25647], [71.82646, 40.21872], [71.73054, 40.14818], [71.71719, 40.17886], [71.69621, 40.18492], [71.70569, 40.20391], [71.68386, 40.26984], [71.61931, 40.26775], [71.61725, 40.20615], [71.51549, 40.22986], [71.51215, 40.26943], [71.4246, 40.28619], [71.36663, 40.31593], [71.13042, 40.34106], [71.05901, 40.28765], [70.95789, 40.28761], [70.9818, 40.22392], [70.80495, 40.16813], [70.7928, 40.12797], [70.65827, 40.0981], [70.65946, 39.9878], [70.58912, 39.95211], [70.55033, 39.96619], [70.47557, 39.93216], [70.57384, 39.99394], [70.58297, 40.00891], [70.01283, 40.23288], [69.67001, 40.10639], [69.64704, 40.12165], [69.57615, 40.10524], [69.55555, 40.12296], [69.53794, 40.11833], [69.53855, 40.0887], [69.5057, 40.03277], [69.53615, 39.93991], [69.43557, 39.92877], [69.43134, 39.98431], [69.35649, 40.01994], [69.26938, 39.8127], [69.3594, 39.52516], [69.68677, 39.59281], [69.87491, 39.53882], [70.11111, 39.58223], [70.2869, 39.53141], [70.44757, 39.60128], [70.64087, 39.58792], [70.7854, 39.38933], [71.06418, 39.41586], [71.08752, 39.50704], [71.49814, 39.61397], [71.55856, 39.57588], [71.5517, 39.45722], [71.62688, 39.44056], [71.76816, 39.45456], [71.80164, 39.40631], [71.7522, 39.32031], [71.79202, 39.27355], [71.90601, 39.27674], [72.04059, 39.36704], [72.09689, 39.26823], [72.17242, 39.2661], [72.23834, 39.17248], [72.33173, 39.33093], [72.62027, 39.39696], [72.85934, 39.35116], [73.18454, 39.35536], [73.31912, 39.38615], [73.45096, 39.46677], [73.59831, 39.46425], [73.87018, 39.47879], [73.94683, 39.60733], [73.92354, 39.69565], [73.9051, 39.75073], [73.83006, 39.76136], [73.97049, 40.04378], [74.25533, 40.13191], [74.35063, 40.09742], [74.69875, 40.34668], [74.85996, 40.32857], [74.78168, 40.44886], [74.82013, 40.52197], [75.08243, 40.43945], [75.22834, 40.45382], [75.5854, 40.66874], [75.69663, 40.28642], [75.91361, 40.2948], [75.96168, 40.38064], [76.33659, 40.3482], [76.5261, 40.46114], [76.75681, 40.95354], [76.99302, 41.0696], [77.28004, 41.0033], [77.3693, 41.0375], [77.52723, 41.00227], [77.76206, 41.01574], [77.81287, 41.14307], [78.12873, 41.23091], [78.15757, 41.38565], [78.3732, 41.39603], [79.92977, 42.04113], [80.17842, 42.03211], [80.17807, 42.21166], [79.97364, 42.42816], [79.52921, 42.44778], [79.19763, 42.804], [78.91502, 42.76839], [78.48469, 42.89649], [75.82823, 42.94848], [75.72174, 42.79672], [75.29966, 42.86183], [75.22619, 42.85528], [74.88756, 42.98612]], [[70.74189, 39.86319], [70.63105, 39.77923], [70.59667, 39.83542], [70.54998, 39.85137], [70.52631, 39.86989], [70.53651, 39.89155], [70.74189, 39.86319]], [[71.86463, 39.98598], [71.84316, 39.95582], [71.7504, 39.93701], [71.71511, 39.96348], [71.78838, 40.01404], [71.86463, 39.98598]], [[71.21139, 40.03369], [71.1427, 39.95026], [71.23067, 39.93581], [71.16101, 39.88423], [71.10531, 39.91354], [71.04979, 39.89808], [71.10501, 39.95568], [71.09063, 39.99], [71.11668, 39.99291], [71.11037, 40.01984], [71.01035, 40.05481], [71.00236, 40.18154], [71.06305, 40.1771], [71.12218, 40.03052], [71.21139, 40.03369]]]] } },
23317 { type: "Feature", properties: { iso1A2: "KH", iso1A3: "KHM", iso1N3: "116", wikidata: "Q424", nameEn: "Cambodia", groups: ["035", "142", "UN"], callingCodes: ["855"] }, geometry: { type: "MultiPolygon", coordinates: [[[[105.87328, 11.55953], [105.81645, 11.56876], [105.80867, 11.60536], [105.8507, 11.66635], [105.88962, 11.67854], [105.95188, 11.63738], [106.00792, 11.7197], [106.02038, 11.77457], [106.06708, 11.77761], [106.13158, 11.73283], [106.18539, 11.75171], [106.26478, 11.72122], [106.30525, 11.67549], [106.37219, 11.69836], [106.44691, 11.66787], [106.45158, 11.68616], [106.41577, 11.76999], [106.44535, 11.8279], [106.44068, 11.86294], [106.4687, 11.86751], [106.4111, 11.97413], [106.70687, 11.96956], [106.79405, 12.0807], [106.92325, 12.06548], [106.99953, 12.08983], [107.15831, 12.27547], [107.34511, 12.33327], [107.42917, 12.24657], [107.4463, 12.29373], [107.55059, 12.36824], [107.5755, 12.52177], [107.55993, 12.7982], [107.49611, 12.88926], [107.49144, 13.01215], [107.62843, 13.3668], [107.61909, 13.52577], [107.53503, 13.73908], [107.45252, 13.78897], [107.46498, 13.91593], [107.44318, 13.99751], [107.38247, 13.99147], [107.35757, 14.02319], [107.37158, 14.07906], [107.33577, 14.11832], [107.40427, 14.24509], [107.39493, 14.32655], [107.44941, 14.41552], [107.48521, 14.40346], [107.52569, 14.54665], [107.52102, 14.59034], [107.55371, 14.628], [107.54361, 14.69092], [107.47238, 14.61523], [107.44435, 14.52785], [107.37897, 14.54443], [107.3276, 14.58812], [107.29803, 14.58963], [107.26534, 14.54292], [107.256, 14.48716], [107.21241, 14.48716], [107.17038, 14.41782], [107.09722, 14.3937], [107.03962, 14.45099], [107.04585, 14.41782], [106.98825, 14.36806], [106.9649, 14.3198], [106.90574, 14.33639], [106.8497, 14.29416], [106.80767, 14.31226], [106.73762, 14.42687], [106.63333, 14.44194], [106.59908, 14.50977], [106.57106, 14.50525], [106.54148, 14.59565], [106.50723, 14.58963], [106.45898, 14.55045], [106.47766, 14.50977], [106.43874, 14.52032], [106.40916, 14.45249], [106.32355, 14.44043], [106.25194, 14.48415], [106.21302, 14.36203], [106.00131, 14.36957], [105.99509, 14.32734], [106.02311, 14.30623], [106.04801, 14.20363], [106.10872, 14.18401], [106.11962, 14.11307], [106.18656, 14.06324], [106.16632, 14.01794], [106.10094, 13.98471], [106.10405, 13.9137], [105.90791, 13.92881], [105.78182, 14.02247], [105.78338, 14.08438], [105.5561, 14.15684], [105.44869, 14.10703], [105.36775, 14.09948], [105.2759, 14.17496], [105.20894, 14.34967], [105.17748, 14.34432], [105.14012, 14.23873], [105.08408, 14.20402], [105.02804, 14.23722], [104.97667, 14.38806], [104.69335, 14.42726], [104.55014, 14.36091], [104.27616, 14.39861], [103.93836, 14.3398], [103.70175, 14.38052], [103.71109, 14.4348], [103.53518, 14.42575], [103.39353, 14.35639], [103.16469, 14.33075], [102.93275, 14.19044], [102.91251, 14.01531], [102.77864, 13.93374], [102.72727, 13.77806], [102.56848, 13.69366], [102.5481, 13.6589], [102.58635, 13.6286], [102.62483, 13.60883], [102.57573, 13.60461], [102.5358, 13.56933], [102.44601, 13.5637], [102.36859, 13.57488], [102.33828, 13.55613], [102.361, 13.50551], [102.35563, 13.47307], [102.35692, 13.38274], [102.34611, 13.35618], [102.36001, 13.31142], [102.36146, 13.26006], [102.43422, 13.09061], [102.46011, 13.08057], [102.52275, 12.99813], [102.48694, 12.97537], [102.49335, 12.92711], [102.53053, 12.77506], [102.4994, 12.71736], [102.51963, 12.66117], [102.57567, 12.65358], [102.7796, 12.43781], [102.78116, 12.40284], [102.73134, 12.37091], [102.70176, 12.1686], [102.77026, 12.06815], [102.78427, 11.98746], [102.83957, 11.8519], [102.90973, 11.75613], [102.91449, 11.65512], [102.52395, 11.25257], [102.47649, 9.66162], [103.99198, 10.48391], [104.43778, 10.42386], [104.47963, 10.43046], [104.49869, 10.4057], [104.59018, 10.53073], [104.87933, 10.52833], [104.95094, 10.64003], [105.09571, 10.72722], [105.02722, 10.89236], [105.08326, 10.95656], [105.11449, 10.96332], [105.34011, 10.86179], [105.42884, 10.96878], [105.50045, 10.94586], [105.77751, 11.03671], [105.86376, 10.89839], [105.84603, 10.85873], [105.93403, 10.83853], [105.94535, 10.9168], [106.06708, 10.8098], [106.18539, 10.79451], [106.14301, 10.98176], [106.20095, 10.97795], [106.1757, 11.07301], [106.1527, 11.10476], [106.10444, 11.07879], [105.86782, 11.28343], [105.88962, 11.43605], [105.87328, 11.55953]]]] } },
23318 { type: "Feature", properties: { iso1A2: "KI", iso1A3: "KIR", iso1N3: "296", wikidata: "Q710", nameEn: "Kiribati", groups: ["057", "009", "UN"], driveSide: "left", callingCodes: ["686"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169, 3.9], [169, -3.5], [178, -3.5], [178, 3.9], [169, 3.9]]], [[[-161.06795, 5.2462], [-158.12991, -1.86122], [-175.33482, -1.40631], [-175.31804, -7.54825], [-156.50903, -7.4975], [-156.48634, -15.52824], [-135.59706, -4.70473], [-161.06795, 5.2462]]]] } },
23319 { type: "Feature", properties: { iso1A2: "KM", iso1A3: "COM", iso1N3: "174", wikidata: "Q970", nameEn: "Comoros", groups: ["014", "202", "002", "UN"], callingCodes: ["269"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.63904, -10.02522], [43.28731, -13.97126], [45.4971, -11.75965], [42.63904, -10.02522]]]] } },
23320 { type: "Feature", properties: { iso1A2: "KN", iso1A3: "KNA", iso1N3: "659", wikidata: "Q763", nameEn: "St. Kitts and Nevis", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 869"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.29333, 17.43155], [-62.76692, 17.64353], [-63.09677, 17.21372], [-62.63813, 16.65446], [-62.29333, 17.43155]]]] } },
23321 { type: "Feature", properties: { iso1A2: "KP", iso1A3: "PRK", iso1N3: "408", wikidata: "Q423", nameEn: "North Korea", groups: ["030", "142", "UN"], callingCodes: ["850"] }, geometry: { type: "MultiPolygon", coordinates: [[[[130.26095, 42.9027], [130.09764, 42.91425], [130.12957, 42.98361], [129.96409, 42.97306], [129.95082, 43.01051], [129.8865, 43.00395], [129.85261, 42.96494], [129.83277, 42.86746], [129.80719, 42.79218], [129.7835, 42.76521], [129.77183, 42.69435], [129.75294, 42.59409], [129.72541, 42.43739], [129.60482, 42.44461], [129.54701, 42.37254], [129.42882, 42.44702], [129.28541, 42.41574], [129.22423, 42.3553], [129.22285, 42.26491], [129.15178, 42.17224], [128.96068, 42.06657], [128.94007, 42.03537], [128.04487, 42.01769], [128.15119, 41.74568], [128.30716, 41.60322], [128.20061, 41.40895], [128.18546, 41.41279], [128.12967, 41.37931], [128.03311, 41.39232], [128.02633, 41.42103], [127.92943, 41.44291], [127.29712, 41.49473], [127.17841, 41.59714], [126.90729, 41.79955], [126.60631, 41.65565], [126.53189, 41.35206], [126.242, 41.15454], [126.00335, 40.92835], [125.76869, 40.87908], [125.71172, 40.85223], [124.86913, 40.45387], [124.40719, 40.13655], [124.38556, 40.11047], [124.3322, 40.05573], [124.37089, 40.03004], [124.35029, 39.95639], [124.23201, 39.9248], [124.17532, 39.8232], [123.90497, 38.79949], [123.85601, 37.49093], [124.67666, 38.05679], [124.84224, 37.977], [124.87921, 37.80827], [125.06408, 37.66334], [125.37112, 37.62643], [125.81159, 37.72949], [126.13074, 37.70512], [126.18776, 37.74728], [126.19097, 37.81462], [126.24402, 37.83113], [126.43239, 37.84095], [126.46818, 37.80873], [126.56709, 37.76857], [126.59918, 37.76364], [126.66067, 37.7897], [126.68793, 37.83728], [126.68793, 37.9175], [126.67023, 37.95852], [126.84961, 38.0344], [126.88106, 38.10246], [126.95887, 38.1347], [126.95338, 38.17735], [127.04479, 38.25518], [127.15749, 38.30722], [127.38727, 38.33227], [127.49672, 38.30647], [127.55013, 38.32257], [128.02917, 38.31861], [128.27652, 38.41657], [128.31105, 38.58462], [128.37487, 38.62345], [128.65655, 38.61914], [131.95041, 41.5445], [130.65022, 42.32281], [130.66367, 42.38024], [130.64181, 42.41422], [130.60805, 42.4317], [130.56835, 42.43281], [130.55143, 42.52158], [130.50123, 42.61636], [130.44361, 42.54849], [130.41826, 42.6011], [130.2385, 42.71127], [130.23068, 42.80125], [130.26095, 42.9027]]]] } },
23322 { type: "Feature", properties: { iso1A2: "KR", iso1A3: "KOR", iso1N3: "410", wikidata: "Q884", nameEn: "South Korea", groups: ["030", "142", "UN"], callingCodes: ["82"] }, geometry: { type: "MultiPolygon", coordinates: [[[[133.11729, 37.53115], [128.65655, 38.61914], [128.37487, 38.62345], [128.31105, 38.58462], [128.27652, 38.41657], [128.02917, 38.31861], [127.55013, 38.32257], [127.49672, 38.30647], [127.38727, 38.33227], [127.15749, 38.30722], [127.04479, 38.25518], [126.95338, 38.17735], [126.95887, 38.1347], [126.88106, 38.10246], [126.84961, 38.0344], [126.67023, 37.95852], [126.68793, 37.9175], [126.68793, 37.83728], [126.66067, 37.7897], [126.59918, 37.76364], [126.56709, 37.76857], [126.46818, 37.80873], [126.43239, 37.84095], [126.24402, 37.83113], [126.19097, 37.81462], [126.18776, 37.74728], [126.13074, 37.70512], [125.81159, 37.72949], [125.37112, 37.62643], [125.06408, 37.66334], [124.87921, 37.80827], [124.84224, 37.977], [124.67666, 38.05679], [123.85601, 37.49093], [122.80525, 33.30571], [125.99728, 32.63328], [129.2669, 34.87122], [133.11729, 37.53115]]]] } },
23323 { type: "Feature", properties: { iso1A2: "KW", iso1A3: "KWT", iso1N3: "414", wikidata: "Q817", nameEn: "Kuwait", groups: ["145", "142", "UN"], callingCodes: ["965"] }, geometry: { type: "MultiPolygon", coordinates: [[[[49.00421, 28.81495], [48.59531, 29.66815], [48.40479, 29.85763], [48.17332, 30.02448], [48.06782, 30.02906], [48.01114, 29.98906], [47.7095, 30.10453], [47.37192, 30.10421], [47.15166, 30.01044], [46.89695, 29.50584], [46.5527, 29.10283], [47.46202, 29.0014], [47.58376, 28.83382], [47.59863, 28.66798], [47.70561, 28.5221], [48.42991, 28.53628], [49.00421, 28.81495]]]] } },
23324 { type: "Feature", properties: { iso1A2: "KY", iso1A3: "CYM", iso1N3: "136", wikidata: "Q5785", nameEn: "Cayman Islands", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 345"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-82.11509, 19.60401], [-80.36068, 18.11751], [-79.32727, 20.06742], [-82.11509, 19.60401]]]] } },
23325 { type: "Feature", properties: { iso1A2: "KZ", iso1A3: "KAZ", iso1N3: "398", wikidata: "Q232", nameEn: "Kazakhstan", groups: ["143", "142", "UN"], callingCodes: ["7"] }, geometry: { type: "MultiPolygon", coordinates: [[[[68.90865, 55.38148], [68.19206, 55.18823], [68.26661, 55.09226], [68.21308, 54.98645], [65.20174, 54.55216], [65.24663, 54.35721], [65.11033, 54.33028], [64.97216, 54.4212], [63.97686, 54.29763], [64.02715, 54.22679], [63.91224, 54.20013], [63.80604, 54.27079], [62.58651, 54.05871], [62.56876, 53.94047], [62.45931, 53.90737], [62.38535, 54.03961], [62.00966, 54.04134], [62.03913, 53.94768], [61.65318, 54.02445], [61.56941, 53.95703], [61.47603, 54.08048], [61.3706, 54.08464], [61.26863, 53.92797], [60.99796, 53.93699], [61.14283, 53.90063], [61.22574, 53.80268], [60.90626, 53.62937], [61.55706, 53.57144], [61.57185, 53.50112], [61.37957, 53.45887], [61.29082, 53.50992], [61.14291, 53.41481], [61.19024, 53.30536], [62.14574, 53.09626], [62.12799, 52.99133], [62.0422, 52.96105], [61.23462, 53.03227], [61.05842, 52.92217], [60.71989, 52.75923], [60.71693, 52.66245], [60.84118, 52.63912], [60.84709, 52.52228], [60.98021, 52.50068], [61.05417, 52.35096], [60.78201, 52.22067], [60.72581, 52.15538], [60.48915, 52.15175], [60.19925, 51.99173], [59.99809, 51.98263], [60.09867, 51.87135], [60.50986, 51.7964], [60.36787, 51.66815], [60.5424, 51.61675], [60.92401, 51.61124], [60.95655, 51.48615], [61.50677, 51.40687], [61.55114, 51.32746], [61.6813, 51.25716], [61.56889, 51.23679], [61.4431, 50.80679], [60.81833, 50.6629], [60.31914, 50.67705], [60.17262, 50.83312], [60.01288, 50.8163], [59.81172, 50.54451], [59.51886, 50.49937], [59.48928, 50.64216], [58.87974, 50.70852], [58.3208, 51.15151], [57.75578, 51.13852], [57.74986, 50.93017], [57.44221, 50.88354], [57.17302, 51.11253], [56.17906, 50.93204], [56.11398, 50.7471], [55.67774, 50.54508], [54.72067, 51.03261], [54.56685, 51.01958], [54.71476, 50.61214], [54.55797, 50.52006], [54.41894, 50.61214], [54.46331, 50.85554], [54.12248, 51.11542], [53.69299, 51.23466], [53.46165, 51.49445], [52.54329, 51.48444], [52.36119, 51.74161], [51.8246, 51.67916], [51.77431, 51.49536], [51.301, 51.48799], [51.26254, 51.68466], [50.59695, 51.61859], [50.26859, 51.28677], [49.97277, 51.2405], [49.76866, 51.11067], [49.39001, 51.09396], [49.41959, 50.85927], [49.12673, 50.78639], [48.86936, 50.61589], [48.57946, 50.63278], [48.90782, 50.02281], [48.68352, 49.89546], [48.42564, 49.82283], [48.24519, 49.86099], [48.10044, 50.09242], [47.58551, 50.47867], [47.30448, 50.30894], [47.34589, 50.09308], [47.18319, 49.93721], [46.9078, 49.86707], [46.78398, 49.34026], [47.04658, 49.19834], [47.00857, 49.04921], [46.78392, 48.95352], [46.49011, 48.43019], [47.11516, 48.27188], [47.12107, 47.83687], [47.38731, 47.68176], [47.41689, 47.83687], [47.64973, 47.76559], [48.15348, 47.74545], [48.45173, 47.40818], [48.52326, 47.4102], [49.01136, 46.72716], [48.51142, 46.69268], [48.54988, 46.56267], [49.16518, 46.38542], [49.32259, 46.26944], [49.88945, 46.04554], [49.2134, 44.84989], [52.26048, 41.69249], [52.47884, 41.78034], [52.97575, 42.1308], [54.20635, 42.38477], [54.95182, 41.92424], [55.45471, 41.25609], [56.00314, 41.32584], [55.97584, 44.99322], [55.97584, 44.99328], [55.97584, 44.99338], [55.97584, 44.99343], [55.97584, 44.99348], [55.97584, 44.99353], [55.97584, 44.99359], [55.97584, 44.99369], [55.97584, 44.99374], [55.97584, 44.99384], [55.97584, 44.9939], [55.97584, 44.994], [55.97584, 44.99405], [55.97584, 44.99415], [55.97584, 44.99421], [55.97584, 44.99426], [55.97584, 44.99431], [55.97584, 44.99436], [55.97584, 44.99441], [55.97594, 44.99446], [55.97605, 44.99452], [55.97605, 44.99457], [55.97605, 44.99462], [55.97605, 44.99467], [55.97605, 44.99477], [55.97615, 44.99477], [55.97615, 44.99483], [55.97615, 44.99493], [55.97615, 44.99498], [55.97615, 44.99503], [55.97615, 44.99508], [55.97625, 44.99514], [55.97636, 44.99519], [55.97636, 44.99524], [55.97646, 44.99529], [55.97646, 44.99534], [55.97656, 44.99539], [55.97667, 44.99545], [55.97677, 44.9955], [55.97677, 44.99555], [55.97677, 44.9956], [55.97687, 44.9956], [55.97698, 44.99565], [55.97698, 44.9957], [55.97708, 44.99576], [55.97718, 44.99581], [55.97729, 44.99586], [55.97739, 44.99586], [55.97739, 44.99591], [55.97749, 44.99591], [55.9776, 44.99591], [55.9777, 44.99596], [55.9777, 44.99601], [55.9778, 44.99607], [55.97791, 44.99607], [55.97801, 44.99607], [55.97801, 44.99612], [55.97811, 44.99617], [55.97822, 44.99617], [55.97832, 44.99622], [55.97842, 44.99622], [58.59711, 45.58671], [61.01475, 44.41383], [62.01711, 43.51008], [63.34656, 43.64003], [64.53885, 43.56941], [64.96464, 43.74748], [65.18666, 43.48835], [65.53277, 43.31856], [65.85194, 42.85481], [66.09482, 42.93426], [66.00546, 41.94455], [66.53302, 41.87388], [66.69129, 41.1311], [67.9644, 41.14611], [67.98511, 41.02794], [68.08273, 41.08148], [68.1271, 41.0324], [67.96736, 40.83798], [68.49983, 40.56437], [68.63, 40.59358], [68.58444, 40.91447], [68.49983, 40.99669], [68.62221, 41.03019], [68.65662, 40.93861], [68.73945, 40.96989], [68.7217, 41.05025], [69.01308, 41.22804], [69.05006, 41.36183], [69.15137, 41.43078], [69.17701, 41.43769], [69.18528, 41.45175], [69.20439, 41.45391], [69.22671, 41.46298], [69.23332, 41.45847], [69.25059, 41.46693], [69.29778, 41.43673], [69.35554, 41.47211], [69.37468, 41.46555], [69.45081, 41.46246], [69.39485, 41.51518], [69.45751, 41.56863], [69.49545, 41.545], [70.94483, 42.26238], [70.85973, 42.30188], [70.97717, 42.50147], [71.15232, 42.60486], [71.17807, 42.67381], [71.22785, 42.69248], [71.2724, 42.77853], [71.53272, 42.8014], [71.62405, 42.76613], [71.88792, 42.83578], [73.44393, 42.43098], [73.50992, 42.82356], [73.55634, 43.03071], [74.22489, 43.24657], [74.57491, 43.13702], [74.64615, 43.05881], [74.70331, 43.02519], [74.75, 42.99029], [74.88756, 42.98612], [75.22619, 42.85528], [75.29966, 42.86183], [75.72174, 42.79672], [75.82823, 42.94848], [78.48469, 42.89649], [78.91502, 42.76839], [79.19763, 42.804], [79.52921, 42.44778], [79.97364, 42.42816], [80.17807, 42.21166], [80.26841, 42.23797], [80.16892, 42.61137], [80.26886, 42.8366], [80.38169, 42.83142], [80.58999, 42.9011], [80.3735, 43.01557], [80.62913, 43.141], [80.78817, 43.14235], [80.77771, 43.30065], [80.69718, 43.32589], [80.75156, 43.44948], [80.40031, 44.10986], [80.40229, 44.23319], [80.38384, 44.63073], [79.8987, 44.89957], [80.11169, 45.03352], [81.73278, 45.3504], [82.51374, 45.1755], [82.58474, 45.40027], [82.21792, 45.56619], [83.04622, 47.19053], [83.92184, 46.98912], [84.73077, 47.01394], [84.93995, 46.87399], [85.22443, 47.04816], [85.54294, 47.06171], [85.69696, 47.2898], [85.61067, 47.49753], [85.5169, 48.05493], [85.73581, 48.3939], [86.38069, 48.46064], [86.75343, 48.70331], [86.73568, 48.99918], [86.87238, 49.12432], [87.28386, 49.11626], [87.31465, 49.23603], [87.03071, 49.25142], [86.82606, 49.51796], [86.61307, 49.60239], [86.79056, 49.74787], [86.63674, 49.80136], [86.18709, 49.50259], [85.24047, 49.60239], [84.99198, 50.06793], [84.29385, 50.27257], [83.8442, 50.87375], [83.14607, 51.00796], [82.55443, 50.75412], [81.94999, 50.79307], [81.46581, 50.77658], [81.41248, 50.97524], [81.06091, 50.94833], [81.16999, 51.15662], [80.80318, 51.28262], [80.44819, 51.20855], [80.4127, 50.95581], [80.08138, 50.77658], [79.11255, 52.01171], [77.90383, 53.29807], [76.54243, 53.99329], [76.44076, 54.16017], [76.82266, 54.1798], [76.91052, 54.4677], [75.3668, 54.07439], [75.43398, 53.98652], [75.07405, 53.80831], [73.39218, 53.44623], [73.25412, 53.61532], [73.68921, 53.86522], [73.74778, 54.07194], [73.37963, 53.96132], [72.71026, 54.1161], [72.43415, 53.92685], [72.17477, 54.36303], [71.96141, 54.17736], [71.10379, 54.13326], [71.08706, 54.33376], [71.24185, 54.64965], [71.08288, 54.71253], [70.96009, 55.10558], [70.76493, 55.3027], [70.19179, 55.1476], [69.74917, 55.35545], [69.34224, 55.36344], [68.90865, 55.38148]]]] } },
23326 { type: "Feature", properties: { iso1A2: "LA", iso1A3: "LAO", iso1N3: "418", wikidata: "Q819", nameEn: "Laos", groups: ["035", "142", "UN"], callingCodes: ["856"] }, geometry: { type: "MultiPolygon", coordinates: [[[[102.1245, 22.43372], [102.03633, 22.46164], [101.98487, 22.42766], [101.91344, 22.44417], [101.90714, 22.38688], [101.86828, 22.38397], [101.7685, 22.50337], [101.68973, 22.46843], [101.61306, 22.27515], [101.56789, 22.28876], [101.53638, 22.24794], [101.60675, 22.13513], [101.57525, 22.13026], [101.62566, 21.96574], [101.7791, 21.83019], [101.74555, 21.72852], [101.83257, 21.61562], [101.80001, 21.57461], [101.7475, 21.5873], [101.7727, 21.51794], [101.74224, 21.48276], [101.74014, 21.30967], [101.84412, 21.25291], [101.83887, 21.20983], [101.76745, 21.21571], [101.79266, 21.19025], [101.7622, 21.14813], [101.70548, 21.14911], [101.66977, 21.20004], [101.60886, 21.17947], [101.59491, 21.18621], [101.6068, 21.23329], [101.54563, 21.25668], [101.29326, 21.17254], [101.2229, 21.23271], [101.26912, 21.36482], [101.19349, 21.41959], [101.2124, 21.56422], [101.15156, 21.56129], [101.16198, 21.52808], [101.00234, 21.39612], [100.80173, 21.2934], [100.72716, 21.31786], [100.63578, 21.05639], [100.55281, 21.02796], [100.50974, 20.88574], [100.64628, 20.88279], [100.60112, 20.8347], [100.51079, 20.82194], [100.36375, 20.82783], [100.1957, 20.68247], [100.08404, 20.36626], [100.09999, 20.31614], [100.09337, 20.26293], [100.11785, 20.24787], [100.1712, 20.24324], [100.16668, 20.2986], [100.22076, 20.31598], [100.25769, 20.3992], [100.33383, 20.4028], [100.37439, 20.35156], [100.41473, 20.25625], [100.44992, 20.23644], [100.4537, 20.19971], [100.47567, 20.19133], [100.51052, 20.14928], [100.55218, 20.17741], [100.58808, 20.15791], [100.5094, 19.87904], [100.398, 19.75047], [100.49604, 19.53504], [100.58219, 19.49164], [100.64606, 19.55884], [100.77231, 19.48324], [100.90302, 19.61901], [101.08928, 19.59748], [101.26545, 19.59242], [101.26991, 19.48324], [101.21347, 19.46223], [101.20604, 19.35296], [101.24911, 19.33334], [101.261, 19.12717], [101.35606, 19.04716], [101.25803, 18.89545], [101.22832, 18.73377], [101.27585, 18.68875], [101.06047, 18.43247], [101.18227, 18.34367], [101.15108, 18.25624], [101.19118, 18.2125], [101.1793, 18.0544], [101.02185, 17.87637], [100.96541, 17.57926], [101.15108, 17.47586], [101.44667, 17.7392], [101.72294, 17.92867], [101.78087, 18.07559], [101.88485, 18.02474], [102.11359, 18.21532], [102.45523, 17.97106], [102.59234, 17.96127], [102.60971, 17.95411], [102.61432, 17.92273], [102.5896, 17.84889], [102.59485, 17.83537], [102.68194, 17.80151], [102.69946, 17.81686], [102.67543, 17.84529], [102.68538, 17.86653], [102.75954, 17.89561], [102.79044, 17.93612], [102.81988, 17.94233], [102.86323, 17.97531], [102.95812, 18.0054], [102.9912, 17.9949], [103.01998, 17.97095], [103.0566, 18.00144], [103.07823, 18.03833], [103.07343, 18.12351], [103.1493, 18.17799], [103.14994, 18.23172], [103.17093, 18.2618], [103.29757, 18.30475], [103.23818, 18.34875], [103.24779, 18.37807], [103.30977, 18.4341], [103.41044, 18.4486], [103.47773, 18.42841], [103.60957, 18.40528], [103.699, 18.34125], [103.82449, 18.33979], [103.85642, 18.28666], [103.93916, 18.33914], [103.97725, 18.33631], [104.06533, 18.21656], [104.10927, 18.10826], [104.21776, 17.99335], [104.2757, 17.86139], [104.35432, 17.82871], [104.45404, 17.66788], [104.69867, 17.53038], [104.80061, 17.39367], [104.80716, 17.19025], [104.73712, 17.01404], [104.7373, 16.91125], [104.76442, 16.84752], [104.7397, 16.81005], [104.76099, 16.69302], [104.73349, 16.565], [104.88057, 16.37311], [105.00262, 16.25627], [105.06204, 16.09792], [105.42001, 16.00657], [105.38508, 15.987], [105.34115, 15.92737], [105.37959, 15.84074], [105.42285, 15.76971], [105.46573, 15.74742], [105.61756, 15.68792], [105.60446, 15.53301], [105.58191, 15.41031], [105.47635, 15.3796], [105.4692, 15.33709], [105.50662, 15.32054], [105.58043, 15.32724], [105.46661, 15.13132], [105.61162, 15.00037], [105.5121, 14.80802], [105.53864, 14.55731], [105.43783, 14.43865], [105.20894, 14.34967], [105.2759, 14.17496], [105.36775, 14.09948], [105.44869, 14.10703], [105.5561, 14.15684], [105.78338, 14.08438], [105.78182, 14.02247], [105.90791, 13.92881], [106.10405, 13.9137], [106.10094, 13.98471], [106.16632, 14.01794], [106.18656, 14.06324], [106.11962, 14.11307], [106.10872, 14.18401], [106.04801, 14.20363], [106.02311, 14.30623], [105.99509, 14.32734], [106.00131, 14.36957], [106.21302, 14.36203], [106.25194, 14.48415], [106.32355, 14.44043], [106.40916, 14.45249], [106.43874, 14.52032], [106.47766, 14.50977], [106.45898, 14.55045], [106.50723, 14.58963], [106.54148, 14.59565], [106.57106, 14.50525], [106.59908, 14.50977], [106.63333, 14.44194], [106.73762, 14.42687], [106.80767, 14.31226], [106.8497, 14.29416], [106.90574, 14.33639], [106.9649, 14.3198], [106.98825, 14.36806], [107.04585, 14.41782], [107.03962, 14.45099], [107.09722, 14.3937], [107.17038, 14.41782], [107.21241, 14.48716], [107.256, 14.48716], [107.26534, 14.54292], [107.29803, 14.58963], [107.3276, 14.58812], [107.37897, 14.54443], [107.44435, 14.52785], [107.47238, 14.61523], [107.54361, 14.69092], [107.51579, 14.79282], [107.59285, 14.87795], [107.48277, 14.93751], [107.46516, 15.00982], [107.61486, 15.0566], [107.61926, 15.13949], [107.58844, 15.20111], [107.62587, 15.2266], [107.60605, 15.37524], [107.62367, 15.42193], [107.53341, 15.40496], [107.50699, 15.48771], [107.3815, 15.49832], [107.34408, 15.62345], [107.27583, 15.62769], [107.27143, 15.71459], [107.21859, 15.74638], [107.21419, 15.83747], [107.34188, 15.89464], [107.39471, 15.88829], [107.46296, 16.01106], [107.44975, 16.08511], [107.33968, 16.05549], [107.25822, 16.13587], [107.14595, 16.17816], [107.15035, 16.26271], [107.09091, 16.3092], [107.02597, 16.31132], [106.97385, 16.30204], [106.96638, 16.34938], [106.88067, 16.43594], [106.88727, 16.52671], [106.84104, 16.55415], [106.74418, 16.41904], [106.65832, 16.47816], [106.66052, 16.56892], [106.61477, 16.60713], [106.58267, 16.6012], [106.59013, 16.62259], [106.55485, 16.68704], [106.55265, 16.86831], [106.52183, 16.87884], [106.51963, 16.92097], [106.54824, 16.92729], [106.55045, 17.0031], [106.50862, 16.9673], [106.43597, 17.01362], [106.31929, 17.20509], [106.29287, 17.3018], [106.24444, 17.24714], [106.18991, 17.28227], [106.09019, 17.36399], [105.85744, 17.63221], [105.76612, 17.67147], [105.60381, 17.89356], [105.64784, 17.96687], [105.46292, 18.22008], [105.38366, 18.15315], [105.15942, 18.38691], [105.10408, 18.43533], [105.1327, 18.58355], [105.19654, 18.64196], [105.12829, 18.70453], [104.64617, 18.85668], [104.5361, 18.97747], [103.87125, 19.31854], [104.06058, 19.43484], [104.10832, 19.51575], [104.05617, 19.61743], [104.06498, 19.66926], [104.23229, 19.70242], [104.41281, 19.70035], [104.53169, 19.61743], [104.64837, 19.62365], [104.68359, 19.72729], [104.8355, 19.80395], [104.8465, 19.91783], [104.9874, 20.09573], [104.91695, 20.15567], [104.86852, 20.14121], [104.61315, 20.24452], [104.62195, 20.36633], [104.72102, 20.40554], [104.66158, 20.47774], [104.47886, 20.37459], [104.40621, 20.3849], [104.38199, 20.47155], [104.63957, 20.6653], [104.27412, 20.91433], [104.11121, 20.96779], [103.98024, 20.91531], [103.82282, 20.8732], [103.73478, 20.6669], [103.68633, 20.66324], [103.45737, 20.82382], [103.38032, 20.79501], [103.21497, 20.89832], [103.12055, 20.89994], [103.03469, 21.05821], [102.97745, 21.05821], [102.89825, 21.24707], [102.80794, 21.25736], [102.88939, 21.3107], [102.94223, 21.46034], [102.86297, 21.4255], [102.98846, 21.58936], [102.97965, 21.74076], [102.86077, 21.71213], [102.85637, 21.84501], [102.81894, 21.83888], [102.82115, 21.73667], [102.74189, 21.66713], [102.67145, 21.65894], [102.62301, 21.91447], [102.49092, 21.99002], [102.51734, 22.02676], [102.18712, 22.30403], [102.14099, 22.40092], [102.1245, 22.43372]]]] } },
23327 { type: "Feature", properties: { iso1A2: "LB", iso1A3: "LBN", iso1N3: "422", wikidata: "Q822", nameEn: "Lebanon", aliases: ["RL"], groups: ["145", "142", "UN"], callingCodes: ["961"] }, geometry: { type: "MultiPolygon", coordinates: [[[[35.94816, 33.47886], [35.94465, 33.52774], [36.05723, 33.57904], [35.9341, 33.6596], [36.06778, 33.82927], [36.14517, 33.85118], [36.3967, 33.83365], [36.38263, 33.86579], [36.28589, 33.91981], [36.41078, 34.05253], [36.50576, 34.05982], [36.5128, 34.09916], [36.62537, 34.20251], [36.59195, 34.2316], [36.58667, 34.27667], [36.60778, 34.31009], [36.56556, 34.31881], [36.53039, 34.3798], [36.55853, 34.41609], [36.46179, 34.46541], [36.4442, 34.50165], [36.34745, 34.5002], [36.3369, 34.52629], [36.39846, 34.55672], [36.41429, 34.61175], [36.45299, 34.59438], [36.46003, 34.6378], [36.42941, 34.62505], [36.35384, 34.65447], [36.35135, 34.68516], [36.32399, 34.69334], [36.29165, 34.62991], [35.98718, 34.64977], [35.97386, 34.63322], [35.48515, 34.70851], [34.78515, 33.20368], [35.10645, 33.09318], [35.1924, 33.08743], [35.31429, 33.10515], [35.35223, 33.05617], [35.43059, 33.06659], [35.448, 33.09264], [35.50272, 33.09056], [35.50335, 33.114], [35.52573, 33.11921], [35.54228, 33.19865], [35.5362, 33.23196], [35.54808, 33.236], [35.54544, 33.25513], [35.55555, 33.25844], [35.56523, 33.28969], [35.58326, 33.28381], [35.58502, 33.26653], [35.62283, 33.24226], [35.62019, 33.27278], [35.77477, 33.33609], [35.81324, 33.36354], [35.82577, 33.40479], [35.88668, 33.43183], [35.94816, 33.47886]]]] } },
23328 { type: "Feature", properties: { iso1A2: "LC", iso1A3: "LCA", iso1N3: "662", wikidata: "Q760", nameEn: "St. Lucia", aliases: ["WL"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 758"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-59.95997, 14.20285], [-61.69315, 14.26451], [-59.94058, 12.34011], [-59.95997, 14.20285]]]] } },
23329 { type: "Feature", properties: { iso1A2: "LI", iso1A3: "LIE", iso1N3: "438", wikidata: "Q347", nameEn: "Liechtenstein", aliases: ["FL"], groups: ["155", "150", "UN"], callingCodes: ["423"] }, geometry: { type: "MultiPolygon", coordinates: [[[[9.60717, 47.06091], [9.61216, 47.07732], [9.63395, 47.08443], [9.62623, 47.14685], [9.56539, 47.17124], [9.58264, 47.20673], [9.56981, 47.21926], [9.55176, 47.22585], [9.56766, 47.24281], [9.53116, 47.27029], [9.52406, 47.24959], [9.50318, 47.22153], [9.4891, 47.19346], [9.48774, 47.17402], [9.51044, 47.13727], [9.52089, 47.10019], [9.51362, 47.08505], [9.47139, 47.06402], [9.47548, 47.05257], [9.54041, 47.06495], [9.55721, 47.04762], [9.60717, 47.06091]]]] } },
23330 { type: "Feature", properties: { iso1A2: "LK", iso1A3: "LKA", iso1N3: "144", wikidata: "Q854", nameEn: "Sri Lanka", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["94"] }, geometry: { type: "MultiPolygon", coordinates: [[[[76.59015, 5.591], [85.15017, 5.21497], [80.48418, 10.20786], [79.42124, 9.80115], [79.50447, 8.91876], [76.59015, 5.591]]]] } },
23331 { type: "Feature", properties: { iso1A2: "LR", iso1A3: "LBR", iso1N3: "430", wikidata: "Q1014", nameEn: "Liberia", groups: ["011", "202", "002", "UN"], callingCodes: ["231"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-8.47114, 7.55676], [-8.55874, 7.62525], [-8.55874, 7.70167], [-8.67814, 7.69428], [-8.72789, 7.51429], [-8.8448, 7.35149], [-8.85724, 7.26019], [-8.93435, 7.2824], [-9.09107, 7.1985], [-9.18311, 7.30461], [-9.20798, 7.38109], [-9.305, 7.42056], [-9.41943, 7.41809], [-9.48161, 7.37122], [-9.37465, 7.62032], [-9.35724, 7.74111], [-9.44928, 7.9284], [-9.41445, 8.02448], [-9.50898, 8.18455], [-9.47415, 8.35195], [-9.77763, 8.54633], [-10.05873, 8.42578], [-10.05375, 8.50697], [-10.14579, 8.52665], [-10.203, 8.47991], [-10.27575, 8.48711], [-10.30084, 8.30008], [-10.31635, 8.28554], [-10.29839, 8.21283], [-10.35227, 8.15223], [-10.45023, 8.15627], [-10.51554, 8.1393], [-10.57523, 8.04829], [-10.60492, 8.04072], [-10.60422, 7.7739], [-11.29417, 7.21576], [-11.4027, 6.97746], [-11.50429, 6.92704], [-12.15048, 6.15992], [-7.52774, 3.7105], [-7.53259, 4.35145], [-7.59349, 4.8909], [-7.53876, 4.94294], [-7.55369, 5.08667], [-7.48901, 5.14118], [-7.46165, 5.26256], [-7.36463, 5.32944], [-7.43428, 5.42355], [-7.37209, 5.61173], [-7.43926, 5.74787], [-7.43677, 5.84687], [-7.46165, 5.84934], [-7.48155, 5.80974], [-7.67309, 5.94337], [-7.70294, 5.90625], [-7.78254, 5.99037], [-7.79747, 6.07696], [-7.8497, 6.08932], [-7.83478, 6.20309], [-7.90692, 6.27728], [-8.00642, 6.31684], [-8.17557, 6.28222], [-8.3298, 6.36381], [-8.38453, 6.35887], [-8.45666, 6.49977], [-8.48652, 6.43797], [-8.59456, 6.50612], [-8.31736, 6.82837], [-8.29249, 7.1691], [-8.37458, 7.25794], [-8.41935, 7.51203], [-8.47114, 7.55676]]]] } },
23332 { type: "Feature", properties: { iso1A2: "LS", iso1A3: "LSO", iso1N3: "426", wikidata: "Q1013", nameEn: "Lesotho", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["266"] }, geometry: { type: "MultiPolygon", coordinates: [[[[29.33204, -29.45598], [29.44883, -29.3772], [29.40524, -29.21246], [28.68043, -28.58744], [28.65091, -28.57025], [28.40612, -28.6215], [28.30518, -28.69531], [28.2348, -28.69471], [28.1317, -28.7293], [28.02503, -28.85991], [27.98675, -28.8787], [27.9392, -28.84864], [27.88933, -28.88156], [27.8907, -28.91612], [27.75458, -28.89839], [27.55974, -29.18954], [27.5158, -29.2261], [27.54258, -29.25575], [27.48679, -29.29349], [27.45125, -29.29708], [27.47254, -29.31968], [27.4358, -29.33465], [27.33464, -29.48161], [27.01016, -29.65439], [27.09489, -29.72796], [27.22719, -30.00718], [27.29603, -30.05473], [27.32555, -30.14785], [27.40778, -30.14577], [27.37293, -30.19401], [27.36649, -30.27246], [27.38108, -30.33456], [27.45452, -30.32239], [27.56901, -30.42504], [27.56781, -30.44562], [27.62137, -30.50509], [27.6521, -30.51707], [27.67819, -30.53437], [27.69467, -30.55862], [27.74814, -30.60635], [28.12073, -30.68072], [28.2319, -30.28476], [28.399, -30.1592], [28.68627, -30.12885], [28.80222, -30.10579], [28.9338, -30.05072], [29.16548, -29.91706], [29.12553, -29.76266], [29.28545, -29.58456], [29.33204, -29.45598]]]] } },
23333 { type: "Feature", properties: { iso1A2: "LT", iso1A3: "LTU", iso1N3: "440", wikidata: "Q37", nameEn: "Lithuania", groups: ["EU", "154", "150", "UN"], callingCodes: ["370"] }, geometry: { type: "MultiPolygon", coordinates: [[[[24.89005, 56.46666], [24.83686, 56.41565], [24.70022, 56.40483], [24.57353, 56.31525], [24.58143, 56.29125], [24.42746, 56.26522], [24.32334, 56.30226], [24.13139, 56.24881], [24.02657, 56.3231], [23.75726, 56.37282], [23.49803, 56.34307], [23.40486, 56.37689], [23.31606, 56.3827], [23.17312, 56.36795], [23.09531, 56.30511], [22.96988, 56.41213], [22.83048, 56.367], [22.69354, 56.36284], [22.56441, 56.39305], [22.3361, 56.4016], [22.09728, 56.42851], [22.00548, 56.41508], [21.74558, 56.33181], [21.57888, 56.31406], [21.49736, 56.29106], [21.24644, 56.16917], [21.15016, 56.07818], [20.68447, 56.04073], [20.60454, 55.40986], [20.95181, 55.27994], [21.26425, 55.24456], [21.35465, 55.28427], [21.38446, 55.29348], [21.46766, 55.21115], [21.51095, 55.18507], [21.55605, 55.20311], [21.64954, 55.1791], [21.85521, 55.09493], [21.96505, 55.07353], [21.99543, 55.08691], [22.03984, 55.07888], [22.02582, 55.05078], [22.06087, 55.02935], [22.11697, 55.02131], [22.14267, 55.05345], [22.31562, 55.0655], [22.47688, 55.04408], [22.58907, 55.07085], [22.60075, 55.01863], [22.65451, 54.97037], [22.68723, 54.9811], [22.76422, 54.92521], [22.85083, 54.88711], [22.87317, 54.79492], [22.73631, 54.72952], [22.73397, 54.66604], [22.75467, 54.6483], [22.74225, 54.64339], [22.7522, 54.63525], [22.68021, 54.58486], [22.71293, 54.56454], [22.67788, 54.532], [22.70208, 54.45312], [22.7253, 54.41732], [22.79705, 54.36264], [22.83756, 54.40827], [23.00584, 54.38514], [22.99649, 54.35927], [23.05726, 54.34565], [23.04323, 54.31567], [23.104, 54.29794], [23.13905, 54.31567], [23.15526, 54.31076], [23.15938, 54.29894], [23.24656, 54.25701], [23.3494, 54.25155], [23.39525, 54.21672], [23.42418, 54.17911], [23.45223, 54.17775], [23.49196, 54.14764], [23.52702, 54.04622], [23.48261, 53.98855], [23.51284, 53.95052], [23.61677, 53.92691], [23.71726, 53.93379], [23.80543, 53.89558], [23.81309, 53.94205], [23.95098, 53.9613], [23.98837, 53.92554], [24.19638, 53.96405], [24.34128, 53.90076], [24.44411, 53.90076], [24.62275, 54.00217], [24.69652, 54.01901], [24.69185, 53.96543], [24.74279, 53.96663], [24.85311, 54.02862], [24.77131, 54.11091], [24.96894, 54.17589], [24.991, 54.14241], [25.0728, 54.13419], [25.19199, 54.219], [25.22705, 54.26271], [25.35559, 54.26544], [25.509, 54.30267], [25.56823, 54.25212], [25.51452, 54.17799], [25.54724, 54.14925], [25.64875, 54.1259], [25.71084, 54.16704], [25.78563, 54.15747], [25.78553, 54.23327], [25.68513, 54.31727], [25.55425, 54.31591], [25.5376, 54.33158], [25.63371, 54.42075], [25.62203, 54.4656], [25.64813, 54.48704], [25.68045, 54.5321], [25.75977, 54.57252], [25.74122, 54.80108], [25.89462, 54.93438], [25.99129, 54.95705], [26.05907, 54.94631], [26.13386, 54.98924], [26.20397, 54.99729], [26.26941, 55.08032], [26.23202, 55.10439], [26.30628, 55.12536], [26.35121, 55.1525], [26.46249, 55.12814], [26.51481, 55.16051], [26.54753, 55.14181], [26.69243, 55.16718], [26.68075, 55.19787], [26.72983, 55.21788], [26.73017, 55.24226], [26.835, 55.28182], [26.83266, 55.30444], [26.80929, 55.31642], [26.6714, 55.33902], [26.5709, 55.32572], [26.44937, 55.34832], [26.5522, 55.40277], [26.55094, 55.5093], [26.63167, 55.57887], [26.63231, 55.67968], [26.58248, 55.6754], [26.46661, 55.70375], [26.39561, 55.71156], [26.18509, 55.86813], [26.03815, 55.95884], [25.90047, 56.0013], [25.85893, 56.00188], [25.81773, 56.05444], [25.69246, 56.08892], [25.68588, 56.14725], [25.53621, 56.16663], [25.39751, 56.15707], [25.23099, 56.19147], [25.09325, 56.1878], [25.05762, 56.26742], [24.89005, 56.46666]]]] } },
23334 { type: "Feature", properties: { iso1A2: "LU", iso1A3: "LUX", iso1N3: "442", wikidata: "Q32", nameEn: "Luxembourg", groups: ["EU", "155", "150", "UN"], callingCodes: ["352"] }, geometry: { type: "MultiPolygon", coordinates: [[[[6.1379, 50.12964], [6.1137, 50.13668], [6.12028, 50.16374], [6.08577, 50.17246], [6.06406, 50.15344], [6.03093, 50.16362], [6.02488, 50.18283], [5.96453, 50.17259], [5.95929, 50.13295], [5.89488, 50.11476], [5.8857, 50.07824], [5.85474, 50.06342], [5.86904, 50.04614], [5.8551, 50.02683], [5.81866, 50.01286], [5.82331, 49.99662], [5.83968, 49.9892], [5.83467, 49.97823], [5.81163, 49.97142], [5.80833, 49.96451], [5.77291, 49.96056], [5.77314, 49.93646], [5.73621, 49.89796], [5.78415, 49.87922], [5.75269, 49.8711], [5.75861, 49.85631], [5.74567, 49.85368], [5.75884, 49.84811], [5.74953, 49.84709], [5.74975, 49.83933], [5.74076, 49.83823], [5.7404, 49.83452], [5.74844, 49.82435], [5.74364, 49.82058], [5.74953, 49.81428], [5.75409, 49.79239], [5.78871, 49.7962], [5.82245, 49.75048], [5.83149, 49.74729], [5.82562, 49.72395], [5.84193, 49.72161], [5.86503, 49.72739], [5.88677, 49.70951], [5.86527, 49.69291], [5.86175, 49.67862], [5.9069, 49.66377], [5.90164, 49.6511], [5.90599, 49.63853], [5.88552, 49.63507], [5.88393, 49.62802], [5.87609, 49.62047], [5.8762, 49.60898], [5.84826, 49.5969], [5.84971, 49.58674], [5.86986, 49.58756], [5.87256, 49.57539], [5.8424, 49.56082], [5.84692, 49.55663], [5.84143, 49.5533], [5.81838, 49.54777], [5.80871, 49.5425], [5.81664, 49.53775], [5.83648, 49.5425], [5.84466, 49.53027], [5.83467, 49.52717], [5.83389, 49.52152], [5.86571, 49.50015], [5.94128, 49.50034], [5.94224, 49.49608], [5.96876, 49.49053], [5.97693, 49.45513], [6.02648, 49.45451], [6.02743, 49.44845], [6.04176, 49.44801], [6.05553, 49.46663], [6.07887, 49.46399], [6.08373, 49.45594], [6.10072, 49.45268], [6.09845, 49.46351], [6.10325, 49.4707], [6.12346, 49.4735], [6.12814, 49.49365], [6.14321, 49.48796], [6.16115, 49.49297], [6.15366, 49.50226], [6.17386, 49.50934], [6.19543, 49.50536], [6.2409, 49.51408], [6.25029, 49.50609], [6.27875, 49.503], [6.28818, 49.48465], [6.3687, 49.4593], [6.36778, 49.46937], [6.36907, 49.48931], [6.36788, 49.50377], [6.35666, 49.52931], [6.38072, 49.55171], [6.38228, 49.55855], [6.35825, 49.57053], [6.36676, 49.57813], [6.38024, 49.57593], [6.38342, 49.5799], [6.37464, 49.58886], [6.385, 49.59946], [6.39822, 49.60081], [6.41861, 49.61723], [6.4413, 49.65722], [6.43768, 49.66021], [6.42726, 49.66078], [6.42937, 49.66857], [6.44654, 49.67799], [6.46048, 49.69092], [6.48014, 49.69767], [6.49785, 49.71118], [6.50647, 49.71353], [6.5042, 49.71808], [6.49694, 49.72205], [6.49535, 49.72645], [6.50261, 49.72718], [6.51397, 49.72058], [6.51805, 49.72425], [6.50193, 49.73291], [6.50174, 49.75292], [6.51646, 49.75961], [6.51828, 49.76855], [6.51056, 49.77515], [6.51669, 49.78336], [6.50534, 49.78952], [6.52169, 49.79787], [6.53122, 49.80666], [6.52121, 49.81338], [6.51215, 49.80124], [6.50647, 49.80916], [6.48718, 49.81267], [6.47111, 49.82263], [6.45425, 49.81164], [6.44131, 49.81443], [6.42905, 49.81091], [6.42521, 49.81591], [6.40022, 49.82029], [6.36576, 49.85032], [6.34267, 49.84974], [6.33585, 49.83785], [6.32098, 49.83728], [6.32303, 49.85133], [6.30963, 49.87021], [6.29692, 49.86685], [6.28874, 49.87592], [6.26146, 49.88203], [6.23496, 49.89972], [6.22926, 49.92096], [6.21882, 49.92403], [6.22608, 49.929], [6.22094, 49.94955], [6.19856, 49.95053], [6.19089, 49.96991], [6.18045, 49.96611], [6.18554, 49.95622], [6.17872, 49.9537], [6.16466, 49.97086], [6.1701, 49.98518], [6.14147, 49.99563], [6.14948, 50.00908], [6.13806, 50.01056], [6.1295, 50.01849], [6.13273, 50.02019], [6.13794, 50.01466], [6.14666, 50.02207], [6.13044, 50.02929], [6.13458, 50.04141], [6.11274, 50.05916], [6.12055, 50.09171], [6.1379, 50.12964]]]] } },
23335 { type: "Feature", properties: { iso1A2: "LV", iso1A3: "LVA", iso1N3: "428", wikidata: "Q211", nameEn: "Latvia", groups: ["EU", "154", "150", "UN"], callingCodes: ["371"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.34698, 57.52242], [26.90364, 57.62823], [26.54675, 57.51813], [26.46527, 57.56885], [26.29253, 57.59244], [26.1866, 57.6849], [26.2029, 57.7206], [26.08098, 57.76619], [26.0543, 57.76105], [26.03332, 57.7718], [26.02415, 57.76865], [26.02069, 57.77169], [26.0266, 57.77441], [26.027, 57.78158], [26.02456, 57.78342], [26.0324, 57.79037], [26.05949, 57.84744], [25.73499, 57.90193], [25.29581, 58.08288], [25.28237, 57.98539], [25.19484, 58.0831], [24.3579, 57.87471], [24.26221, 57.91787], [23.20055, 57.56697], [22.80496, 57.87798], [19.84909, 57.57876], [19.64795, 57.06466], [20.68447, 56.04073], [21.15016, 56.07818], [21.24644, 56.16917], [21.49736, 56.29106], [21.57888, 56.31406], [21.74558, 56.33181], [22.00548, 56.41508], [22.09728, 56.42851], [22.3361, 56.4016], [22.56441, 56.39305], [22.69354, 56.36284], [22.83048, 56.367], [22.96988, 56.41213], [23.09531, 56.30511], [23.17312, 56.36795], [23.31606, 56.3827], [23.40486, 56.37689], [23.49803, 56.34307], [23.75726, 56.37282], [24.02657, 56.3231], [24.13139, 56.24881], [24.32334, 56.30226], [24.42746, 56.26522], [24.58143, 56.29125], [24.57353, 56.31525], [24.70022, 56.40483], [24.83686, 56.41565], [24.89005, 56.46666], [25.05762, 56.26742], [25.09325, 56.1878], [25.23099, 56.19147], [25.39751, 56.15707], [25.53621, 56.16663], [25.68588, 56.14725], [25.69246, 56.08892], [25.81773, 56.05444], [25.85893, 56.00188], [25.90047, 56.0013], [26.03815, 55.95884], [26.18509, 55.86813], [26.39561, 55.71156], [26.46661, 55.70375], [26.58248, 55.6754], [26.63231, 55.67968], [26.64888, 55.70515], [26.71802, 55.70645], [26.76872, 55.67658], [26.87448, 55.7172], [26.97153, 55.8102], [27.1559, 55.85032], [27.27804, 55.78299], [27.3541, 55.8089], [27.61683, 55.78558], [27.63065, 55.89687], [27.97865, 56.11849], [28.15217, 56.16964], [28.23716, 56.27588], [28.16599, 56.37806], [28.19057, 56.44637], [28.10069, 56.524], [28.13526, 56.57989], [28.04768, 56.59004], [27.86101, 56.88204], [27.66511, 56.83921], [27.86101, 57.29402], [27.52453, 57.42826], [27.56832, 57.53728], [27.34698, 57.52242]]]] } },
23336 { type: "Feature", properties: { iso1A2: "LY", iso1A3: "LBY", iso1N3: "434", wikidata: "Q1016", nameEn: "Libya", groups: ["015", "002", "UN"], callingCodes: ["218"] }, geometry: { type: "MultiPolygon", coordinates: [[[[26.92891, 33.39516], [11.58941, 33.36891], [11.55852, 33.1409], [11.51549, 33.09826], [11.46037, 32.6307], [11.57828, 32.48013], [11.53898, 32.4138], [11.04234, 32.2145], [10.7315, 31.97235], [10.62788, 31.96629], [10.48497, 31.72956], [10.31364, 31.72648], [10.12239, 31.42098], [10.29516, 30.90337], [9.88152, 30.34074], [9.76848, 30.34366], [9.55544, 30.23971], [9.3876, 30.16738], [9.78136, 29.40961], [9.89569, 26.57696], [9.51696, 26.39148], [9.38834, 26.19288], [10.03146, 25.35635], [10.02432, 24.98124], [10.33159, 24.5465], [10.85323, 24.5595], [11.41061, 24.21456], [11.62498, 24.26669], [11.96886, 23.51735], [13.5631, 23.16574], [14.22918, 22.61719], [14.99751, 23.00539], [15.99566, 23.49639], [23.99539, 19.49944], [23.99715, 20.00038], [24.99794, 19.99661], [24.99885, 21.99535], [24.99968, 29.24574], [24.71117, 30.17441], [25.01077, 30.73861], [24.8458, 31.39877], [26.92891, 33.39516]]]] } },
23337 { type: "Feature", properties: { iso1A2: "MA", iso1A3: "MAR", iso1N3: "504", wikidata: "Q1028", nameEn: "Morocco", groups: ["015", "002", "UN"], callingCodes: ["212"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-2.27707, 35.35051], [-5.10878, 36.05227], [-7.2725, 35.73269], [-14.43883, 27.02969], [-17.27295, 21.93519], [-17.21511, 21.34226], [-17.02707, 21.34022], [-16.9978, 21.36239], [-16.44269, 21.39745], [-14.78487, 21.36587], [-14.47329, 21.63839], [-14.48112, 22.00886], [-14.1291, 22.41636], [-14.10361, 22.75501], [-13.75627, 23.77231], [-13.00628, 24.01923], [-12.92147, 24.39502], [-12.12281, 25.13682], [-12.06001, 26.04442], [-11.62052, 26.05229], [-11.38635, 26.611], [-11.23622, 26.72023], [-11.35695, 26.8505], [-10.68417, 26.90984], [-9.81998, 26.71379], [-9.56957, 26.90042], [-9.08698, 26.98639], [-8.71787, 26.9898], [-8.77527, 27.66663], [-8.66879, 27.6666], [-8.6715, 28.71194], [-7.61585, 29.36252], [-6.95824, 29.50924], [-6.78351, 29.44634], [-6.69965, 29.51623], [-5.75616, 29.61407], [-5.72121, 29.52322], [-5.58831, 29.48103], [-5.21671, 29.95253], [-4.6058, 30.28343], [-4.31774, 30.53229], [-3.64735, 30.67539], [-3.65418, 30.85566], [-3.54944, 31.0503], [-3.77103, 31.14984], [-3.77647, 31.31912], [-3.66386, 31.39202], [-3.66314, 31.6339], [-2.82784, 31.79459], [-2.93873, 32.06557], [-2.46166, 32.16603], [-1.22829, 32.07832], [-1.15735, 32.12096], [-1.24453, 32.1917], [-1.24998, 32.32993], [-0.9912, 32.52467], [-1.37794, 32.73628], [-1.54244, 32.95499], [-1.46249, 33.0499], [-1.67067, 33.27084], [-1.59508, 33.59929], [-1.73494, 33.71721], [-1.64666, 34.10405], [-1.78042, 34.39018], [-1.69788, 34.48056], [-1.84569, 34.61907], [-1.73707, 34.74226], [-1.97469, 34.886], [-1.97833, 34.93218], [-2.04734, 34.93218], [-2.21445, 35.04378], [-2.21248, 35.08532], [-2.27707, 35.35051]], [[-2.91909, 35.33927], [-2.92272, 35.27509], [-2.93893, 35.26737], [-2.95065, 35.26576], [-2.95431, 35.2728], [-2.96516, 35.27967], [-2.96826, 35.28296], [-2.96507, 35.28801], [-2.97035, 35.28852], [-2.96978, 35.29459], [-2.96648, 35.30475], [-2.96038, 35.31609], [-2.91909, 35.33927]], [[-3.90602, 35.21494], [-3.89343, 35.22728], [-3.88372, 35.20767], [-3.90602, 35.21494]], [[-4.30191, 35.17419], [-4.29436, 35.17149], [-4.30112, 35.17058], [-4.30191, 35.17419]], [[-2.40316, 35.16893], [-2.45965, 35.16527], [-2.43262, 35.20652], [-2.40316, 35.16893]], [[-5.38491, 35.92591], [-5.21179, 35.90091], [-5.34379, 35.8711], [-5.35844, 35.87375], [-5.37338, 35.88417], [-5.38491, 35.92591]]]] } },
23338 { type: "Feature", properties: { iso1A2: "MC", iso1A3: "MCO", iso1N3: "492", wikidata: "Q235", nameEn: "Monaco", groups: ["155", "150", "UN"], callingCodes: ["377"] }, geometry: { type: "MultiPolygon", coordinates: [[[[7.47823, 43.73341], [7.4379, 43.74963], [7.4389, 43.75151], [7.43708, 43.75197], [7.43624, 43.75014], [7.43013, 43.74895], [7.42809, 43.74396], [7.42443, 43.74087], [7.42299, 43.74176], [7.42062, 43.73977], [7.41233, 43.73439], [7.41298, 43.73311], [7.41291, 43.73168], [7.41113, 43.73156], [7.40903, 43.7296], [7.42422, 43.72209], [7.47823, 43.73341]]]] } },
23339 { type: "Feature", properties: { iso1A2: "MD", iso1A3: "MDA", iso1N3: "498", wikidata: "Q217", nameEn: "Moldova", groups: ["151", "150", "UN"], callingCodes: ["373"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.74422, 48.45926], [27.6658, 48.44034], [27.59027, 48.46311], [27.5889, 48.49224], [27.46942, 48.454], [27.44333, 48.41209], [27.37741, 48.41026], [27.37604, 48.44398], [27.32159, 48.4434], [27.27855, 48.37534], [27.13434, 48.37288], [27.08078, 48.43214], [27.0231, 48.42485], [27.03821, 48.37653], [26.93384, 48.36558], [26.85556, 48.41095], [26.71274, 48.40388], [26.82809, 48.31629], [26.79239, 48.29071], [26.6839, 48.35828], [26.62823, 48.25804], [26.81161, 48.25049], [26.87708, 48.19919], [26.94265, 48.1969], [26.98042, 48.15752], [26.96119, 48.13003], [27.04118, 48.12522], [27.02985, 48.09083], [27.15622, 47.98538], [27.1618, 47.92391], [27.29069, 47.73722], [27.25519, 47.71366], [27.32202, 47.64009], [27.3979, 47.59473], [27.47942, 47.48113], [27.55731, 47.46637], [27.60263, 47.32507], [27.68706, 47.28962], [27.73172, 47.29248], [27.81892, 47.1381], [28.09095, 46.97621], [28.12173, 46.82283], [28.24808, 46.64305], [28.22281, 46.50481], [28.25769, 46.43334], [28.18902, 46.35283], [28.19864, 46.31869], [28.10937, 46.22852], [28.13684, 46.18099], [28.08612, 46.01105], [28.13111, 45.92819], [28.16568, 45.6421], [28.08927, 45.6051], [28.18741, 45.47358], [28.21139, 45.46895], [28.30201, 45.54744], [28.41836, 45.51715], [28.43072, 45.48538], [28.51449, 45.49982], [28.49252, 45.56716], [28.54196, 45.58062], [28.51587, 45.6613], [28.47879, 45.66994], [28.52823, 45.73803], [28.70401, 45.78019], [28.69852, 45.81753], [28.78503, 45.83475], [28.74383, 45.96664], [28.98004, 46.00385], [29.00613, 46.04962], [28.94643, 46.09176], [29.06656, 46.19716], [28.94953, 46.25852], [28.98478, 46.31803], [29.004, 46.31495], [28.9306, 46.45699], [29.01241, 46.46177], [29.02409, 46.49582], [29.23547, 46.55435], [29.24886, 46.37912], [29.35357, 46.49505], [29.49914, 46.45889], [29.5939, 46.35472], [29.6763, 46.36041], [29.66359, 46.4215], [29.74496, 46.45605], [29.88329, 46.35851], [29.94114, 46.40114], [30.09103, 46.38694], [30.16794, 46.40967], [30.02511, 46.45132], [29.88916, 46.54302], [29.94409, 46.56002], [29.9743, 46.75325], [29.94522, 46.80055], [29.98814, 46.82358], [29.87405, 46.88199], [29.75458, 46.8604], [29.72986, 46.92234], [29.57056, 46.94766], [29.62137, 47.05069], [29.61038, 47.09932], [29.53044, 47.07851], [29.49732, 47.12878], [29.57696, 47.13581], [29.54996, 47.24962], [29.59665, 47.25521], [29.5733, 47.36508], [29.48678, 47.36043], [29.47854, 47.30366], [29.39889, 47.30179], [29.3261, 47.44664], [29.18603, 47.43387], [29.11743, 47.55001], [29.22414, 47.60012], [29.22242, 47.73607], [29.27255, 47.79953], [29.20663, 47.80367], [29.27804, 47.88893], [29.19839, 47.89261], [29.1723, 47.99013], [28.9306, 47.96255], [28.8414, 48.03392], [28.85232, 48.12506], [28.69896, 48.13106], [28.53921, 48.17453], [28.48428, 48.0737], [28.42454, 48.12047], [28.43701, 48.15832], [28.38712, 48.17567], [28.34009, 48.13147], [28.30609, 48.14018], [28.30586, 48.1597], [28.34912, 48.1787], [28.36996, 48.20543], [28.35519, 48.24957], [28.32508, 48.23384], [28.2856, 48.23202], [28.19314, 48.20749], [28.17666, 48.25963], [28.07504, 48.23494], [28.09873, 48.3124], [28.04527, 48.32661], [27.95883, 48.32368], [27.88391, 48.36699], [27.87533, 48.4037], [27.81902, 48.41874], [27.79225, 48.44244], [27.74422, 48.45926]]]] } },
23340 { type: "Feature", properties: { iso1A2: "ME", iso1A3: "MNE", iso1N3: "499", wikidata: "Q236", nameEn: "Montenegro", groups: ["039", "150", "UN"], callingCodes: ["382"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.22807, 43.5264], [19.15685, 43.53943], [19.13933, 43.5282], [19.04934, 43.50384], [19.01078, 43.55806], [18.91379, 43.50299], [18.95469, 43.49367], [18.96053, 43.45042], [19.01078, 43.43854], [19.04071, 43.397], [19.08673, 43.31453], [19.08206, 43.29668], [19.04233, 43.30008], [19.00844, 43.24988], [18.95001, 43.29327], [18.95819, 43.32899], [18.90911, 43.36383], [18.83912, 43.34795], [18.84794, 43.33735], [18.85342, 43.32426], [18.76538, 43.29838], [18.6976, 43.25243], [18.71747, 43.2286], [18.66605, 43.2056], [18.64735, 43.14766], [18.66254, 43.03928], [18.52232, 43.01451], [18.49076, 42.95553], [18.49661, 42.89306], [18.4935, 42.86433], [18.47633, 42.85829], [18.45921, 42.81682], [18.47324, 42.74992], [18.56789, 42.72074], [18.55221, 42.69045], [18.54603, 42.69171], [18.54841, 42.68328], [18.57373, 42.64429], [18.52232, 42.62279], [18.55504, 42.58409], [18.53751, 42.57376], [18.49778, 42.58409], [18.43735, 42.55921], [18.44307, 42.51077], [18.43588, 42.48556], [18.52152, 42.42302], [18.54128, 42.39171], [18.45131, 42.21682], [19.26406, 41.74971], [19.37597, 41.84849], [19.37451, 41.8842], [19.33812, 41.90669], [19.34601, 41.95675], [19.37691, 41.96977], [19.36867, 42.02564], [19.37548, 42.06835], [19.40687, 42.10024], [19.28623, 42.17745], [19.42, 42.33019], [19.42352, 42.36546], [19.4836, 42.40831], [19.65972, 42.62774], [19.73244, 42.66299], [19.77375, 42.58517], [19.74731, 42.57422], [19.76549, 42.50237], [19.82333, 42.46581], [19.9324, 42.51699], [20.00842, 42.5109], [20.01834, 42.54622], [20.07761, 42.55582], [20.0969, 42.65559], [20.02915, 42.71147], [20.02088, 42.74789], [20.04898, 42.77701], [20.2539, 42.76245], [20.27869, 42.81945], [20.35692, 42.8335], [20.34528, 42.90676], [20.16415, 42.97177], [20.14896, 42.99058], [20.12325, 42.96237], [20.05431, 42.99571], [20.04729, 43.02732], [19.98887, 43.0538], [19.96549, 43.11098], [19.92576, 43.08539], [19.79255, 43.11951], [19.76918, 43.16044], [19.64063, 43.19027], [19.62661, 43.2286], [19.54598, 43.25158], [19.52962, 43.31623], [19.48171, 43.32644], [19.44315, 43.38846], [19.22229, 43.47926], [19.22807, 43.5264]]]] } },
23341 { type: "Feature", properties: { iso1A2: "MF", iso1A3: "MAF", iso1N3: "663", wikidata: "Q126125", nameEn: "Saint-Martin", country: "FR", groups: ["Q3320166", "EU", "029", "003", "419", "019", "UN"], callingCodes: ["590"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.93924, 18.02904], [-62.62718, 18.26185], [-63.35989, 18.06012], [-63.33064, 17.9615], [-63.13502, 18.05445], [-63.11042, 18.05339], [-63.09686, 18.04608], [-63.07759, 18.04943], [-63.0579, 18.06614], [-63.04039, 18.05619], [-63.02323, 18.05757], [-62.93924, 18.02904]]]] } },
23342 { type: "Feature", properties: { iso1A2: "MG", iso1A3: "MDG", iso1N3: "450", wikidata: "Q1019", nameEn: "Madagascar", aliases: ["RM"], groups: ["014", "202", "002", "UN"], callingCodes: ["261"] }, geometry: { type: "MultiPolygon", coordinates: [[[[51.93891, -10.85085], [45.84651, -12.77177], [42.14681, -19.63341], [45.80092, -33.00974], [51.93891, -10.85085]]]] } },
23343 { type: "Feature", properties: { iso1A2: "MH", iso1A3: "MHL", iso1N3: "584", wikidata: "Q709", nameEn: "Marshall Islands", groups: ["057", "009", "UN"], roadSpeedUnit: "mph", callingCodes: ["692"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169, 3.9], [173.53711, 5.70687], [169.29099, 15.77133], [159.04653, 10.59067], [169, 3.9]]]] } },
23344 { type: "Feature", properties: { iso1A2: "MK", iso1A3: "MKD", iso1N3: "807", wikidata: "Q221", nameEn: "North Macedonia", groups: ["039", "150", "UN"], callingCodes: ["389"] }, geometry: { type: "MultiPolygon", coordinates: [[[[22.34773, 42.31725], [22.29275, 42.34913], [22.29605, 42.37477], [22.16384, 42.32103], [22.02908, 42.29848], [21.94405, 42.34669], [21.91595, 42.30392], [21.84654, 42.3247], [21.77176, 42.2648], [21.70111, 42.23789], [21.58992, 42.25915], [21.52145, 42.24465], [21.50823, 42.27156], [21.43882, 42.2789], [21.43882, 42.23609], [21.38428, 42.24465], [21.30496, 42.1418], [21.29913, 42.13954], [21.31983, 42.10993], [21.22728, 42.08909], [21.16614, 42.19815], [21.11491, 42.20794], [20.75464, 42.05229], [20.76786, 41.91839], [20.68523, 41.85318], [20.59524, 41.8818], [20.55976, 41.87068], [20.57144, 41.7897], [20.53405, 41.78099], [20.51301, 41.72433], [20.52937, 41.69292], [20.51769, 41.65975], [20.55508, 41.58113], [20.52103, 41.56473], [20.45809, 41.5549], [20.45331, 41.51436], [20.49039, 41.49277], [20.51301, 41.442], [20.55976, 41.4087], [20.52119, 41.34381], [20.49432, 41.33679], [20.51068, 41.2323], [20.59715, 41.13644], [20.58546, 41.11179], [20.59832, 41.09066], [20.63454, 41.0889], [20.65558, 41.08009], [20.71634, 40.91781], [20.73504, 40.9081], [20.81567, 40.89662], [20.83671, 40.92752], [20.94305, 40.92399], [20.97693, 40.90103], [20.97887, 40.85475], [21.15262, 40.85546], [21.21105, 40.8855], [21.25779, 40.86165], [21.35595, 40.87578], [21.41555, 40.9173], [21.53007, 40.90759], [21.57448, 40.86076], [21.69601, 40.9429], [21.7556, 40.92525], [21.91102, 41.04786], [21.90869, 41.09191], [22.06527, 41.15617], [22.1424, 41.12449], [22.17629, 41.15969], [22.26744, 41.16409], [22.42285, 41.11921], [22.5549, 41.13065], [22.58295, 41.11568], [22.62852, 41.14385], [22.65306, 41.18168], [22.71266, 41.13945], [22.74538, 41.16321], [22.76408, 41.32225], [22.81199, 41.3398], [22.93334, 41.34104], [22.96331, 41.35782], [22.95513, 41.63265], [23.03342, 41.71034], [23.01239, 41.76527], [22.96682, 41.77137], [22.90254, 41.87587], [22.86749, 42.02275], [22.67701, 42.06614], [22.51224, 42.15457], [22.50289, 42.19527], [22.47251, 42.20393], [22.38136, 42.30339], [22.34773, 42.31725]]]] } },
23345 { type: "Feature", properties: { iso1A2: "ML", iso1A3: "MLI", iso1N3: "466", wikidata: "Q912", nameEn: "Mali", groups: ["011", "202", "002", "UN"], callingCodes: ["223"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-4.83423, 24.99935], [-6.57191, 25.0002], [-5.60725, 16.49919], [-5.33435, 16.33354], [-5.50165, 15.50061], [-9.32979, 15.50032], [-9.31106, 15.69412], [-9.33314, 15.7044], [-9.44673, 15.60553], [-9.40447, 15.4396], [-10.71721, 15.4223], [-10.90932, 15.11001], [-11.43483, 15.62339], [-11.70705, 15.51558], [-11.94903, 14.76143], [-12.23936, 14.76324], [-11.93043, 13.84505], [-12.06897, 13.71049], [-11.83345, 13.33333], [-11.63025, 13.39174], [-11.39935, 12.97808], [-11.37536, 12.40788], [-11.50006, 12.17826], [-11.24136, 12.01286], [-10.99758, 12.24634], [-10.80355, 12.1053], [-10.71897, 11.91552], [-10.30604, 12.24634], [-9.714, 12.0226], [-9.63938, 12.18312], [-9.32097, 12.29009], [-9.38067, 12.48446], [-9.13689, 12.50875], [-8.94784, 12.34842], [-8.80854, 11.66715], [-8.40058, 11.37466], [-8.66923, 10.99397], [-8.35083, 11.06234], [-8.2667, 10.91762], [-8.32614, 10.69273], [-8.22711, 10.41722], [-8.10207, 10.44649], [-7.9578, 10.2703], [-7.97971, 10.17117], [-7.92107, 10.15577], [-7.63048, 10.46334], [-7.54462, 10.40921], [-7.52261, 10.4655], [-7.44555, 10.44602], [-7.3707, 10.24677], [-7.13331, 10.24877], [-7.0603, 10.14711], [-7.00966, 10.15794], [-6.97444, 10.21644], [-7.01186, 10.25111], [-6.93921, 10.35291], [-6.68164, 10.35074], [-6.63541, 10.66893], [-6.52974, 10.59104], [-6.42847, 10.5694], [-6.40646, 10.69922], [-6.325, 10.68624], [-6.24795, 10.74248], [-6.1731, 10.46983], [-6.18851, 10.24244], [-5.99478, 10.19694], [-5.78124, 10.43952], [-5.65135, 10.46767], [-5.51058, 10.43177], [-5.46643, 10.56074], [-5.47083, 10.75329], [-5.41579, 10.84628], [-5.49284, 11.07538], [-5.32994, 11.13371], [-5.32553, 11.21578], [-5.25949, 11.24816], [-5.25509, 11.36905], [-5.20665, 11.43811], [-5.22867, 11.60421], [-5.29251, 11.61715], [-5.26389, 11.75728], [-5.40258, 11.8327], [-5.26389, 11.84778], [-5.07897, 11.97918], [-4.72893, 12.01579], [-4.70692, 12.06746], [-4.62987, 12.06531], [-4.62546, 12.13204], [-4.54841, 12.1385], [-4.57703, 12.19875], [-4.41412, 12.31922], [-4.47356, 12.71252], [-4.238, 12.71467], [-4.21819, 12.95722], [-4.34477, 13.12927], [-3.96501, 13.49778], [-3.90558, 13.44375], [-3.96282, 13.38164], [-3.7911, 13.36665], [-3.54454, 13.1781], [-3.4313, 13.1588], [-3.43507, 13.27272], [-3.23599, 13.29035], [-3.28396, 13.5422], [-3.26407, 13.70699], [-2.88189, 13.64921], [-2.90831, 13.81174], [-2.84667, 14.05532], [-2.66175, 14.14713], [-2.47587, 14.29671], [-2.10223, 14.14878], [-1.9992, 14.19011], [-1.97945, 14.47709], [-1.68083, 14.50023], [-1.32166, 14.72774], [-1.05875, 14.7921], [-0.72004, 15.08655], [-0.24673, 15.07805], [0.06588, 14.96961], [0.23859, 15.00135], [0.72632, 14.95898], [0.96711, 14.98275], [1.31275, 15.27978], [3.01806, 15.34571], [3.03134, 15.42221], [3.50368, 15.35934], [4.19893, 16.39923], [4.21787, 17.00118], [4.26762, 17.00432], [4.26651, 19.14224], [3.36082, 18.9745], [3.12501, 19.1366], [3.24648, 19.81703], [1.20992, 20.73533], [1.15698, 21.12843], [-4.83423, 24.99935]]]] } },
23346 { type: "Feature", properties: { iso1A2: "MM", iso1A3: "MMR", iso1N3: "104", wikidata: "Q836", nameEn: "Myanmar", aliases: ["Burma", "BU"], groups: ["035", "142", "UN"], callingCodes: ["95"] }, geometry: { type: "MultiPolygon", coordinates: [[[[92.62187, 21.87037], [92.59775, 21.6092], [92.68152, 21.28454], [92.60187, 21.24615], [92.55105, 21.3856], [92.43158, 21.37025], [92.37939, 21.47764], [92.20087, 21.337], [92.17752, 21.17445], [92.26071, 21.05697], [92.47409, 20.38654], [92.61042, 13.76986], [94.6371, 13.81803], [97.63455, 9.60854], [98.12555, 9.44056], [98.33094, 9.91973], [98.47298, 9.95782], [98.52291, 9.92389], [98.55174, 9.92804], [98.7391, 10.31488], [98.81944, 10.52761], [98.77275, 10.62548], [98.78511, 10.68351], [98.86819, 10.78336], [99.0069, 10.85485], [98.99701, 10.92962], [99.02337, 10.97217], [99.06938, 10.94857], [99.32756, 11.28545], [99.31573, 11.32081], [99.39485, 11.3925], [99.47598, 11.62434], [99.5672, 11.62732], [99.64108, 11.78948], [99.64891, 11.82699], [99.53424, 12.02317], [99.56445, 12.14805], [99.47519, 12.1353], [99.409, 12.60603], [99.29254, 12.68921], [99.18905, 12.84799], [99.18748, 12.9898], [99.10646, 13.05804], [99.12225, 13.19847], [99.20617, 13.20575], [99.16695, 13.72621], [98.97356, 14.04868], [98.56762, 14.37701], [98.24874, 14.83013], [98.18821, 15.13125], [98.22, 15.21327], [98.30446, 15.30667], [98.40522, 15.25268], [98.41906, 15.27103], [98.39351, 15.34177], [98.4866, 15.39154], [98.56027, 15.33471], [98.58598, 15.46821], [98.541, 15.65406], [98.59853, 15.87197], [98.57019, 16.04578], [98.69585, 16.13353], [98.8376, 16.11706], [98.92656, 16.36425], [98.84485, 16.42354], [98.68074, 16.27068], [98.63817, 16.47424], [98.57912, 16.55983], [98.5695, 16.62826], [98.51113, 16.64503], [98.51833, 16.676], [98.51472, 16.68521], [98.51579, 16.69433], [98.51043, 16.70107], [98.49713, 16.69022], [98.50253, 16.7139], [98.46994, 16.73613], [98.53833, 16.81934], [98.49603, 16.8446], [98.52624, 16.89979], [98.39441, 17.06266], [98.34566, 17.04822], [98.10439, 17.33847], [98.11185, 17.36829], [97.91829, 17.54504], [97.76407, 17.71595], [97.66794, 17.88005], [97.73723, 17.97912], [97.60841, 18.23846], [97.64116, 18.29778], [97.56219, 18.33885], [97.50383, 18.26844], [97.34522, 18.54596], [97.36444, 18.57138], [97.5258, 18.4939], [97.76752, 18.58097], [97.73836, 18.88478], [97.66487, 18.9371], [97.73654, 18.9812], [97.73797, 19.04261], [97.83479, 19.09972], [97.84024, 19.22217], [97.78606, 19.26769], [97.84186, 19.29526], [97.78769, 19.39429], [97.88423, 19.5041], [97.84715, 19.55782], [98.04364, 19.65755], [98.03314, 19.80941], [98.13829, 19.78541], [98.24884, 19.67876], [98.51182, 19.71303], [98.56065, 19.67807], [98.83661, 19.80931], [98.98679, 19.7419], [99.0735, 20.10298], [99.20328, 20.12877], [99.416, 20.08614], [99.52943, 20.14811], [99.5569, 20.20676], [99.46077, 20.36198], [99.46008, 20.39673], [99.68255, 20.32077], [99.81096, 20.33687], [99.86383, 20.44371], [99.88211, 20.44488], [99.88451, 20.44596], [99.89168, 20.44548], [99.89301, 20.44311], [99.89692, 20.44789], [99.90499, 20.4487], [99.91616, 20.44986], [99.95721, 20.46301], [100.08404, 20.36626], [100.1957, 20.68247], [100.36375, 20.82783], [100.51079, 20.82194], [100.60112, 20.8347], [100.64628, 20.88279], [100.50974, 20.88574], [100.55281, 21.02796], [100.63578, 21.05639], [100.72716, 21.31786], [100.80173, 21.2934], [101.00234, 21.39612], [101.16198, 21.52808], [101.15156, 21.56129], [101.11744, 21.77659], [100.87265, 21.67396], [100.72143, 21.51898], [100.57861, 21.45637], [100.4811, 21.46148], [100.42892, 21.54325], [100.35201, 21.53176], [100.25863, 21.47043], [100.18447, 21.51898], [100.1625, 21.48704], [100.12542, 21.50365], [100.10757, 21.59945], [100.17486, 21.65306], [100.12679, 21.70539], [100.04956, 21.66843], [99.98654, 21.71064], [99.94003, 21.82782], [99.99084, 21.97053], [99.96612, 22.05965], [99.85351, 22.04183], [99.47585, 22.13345], [99.33166, 22.09656], [99.1552, 22.15874], [99.19176, 22.16983], [99.17318, 22.18025], [99.28771, 22.4105], [99.37972, 22.50188], [99.38247, 22.57544], [99.31243, 22.73893], [99.45654, 22.85726], [99.43537, 22.94086], [99.54218, 22.90014], [99.52214, 23.08218], [99.34127, 23.13099], [99.25741, 23.09025], [99.04601, 23.12215], [99.05975, 23.16382], [98.88597, 23.18656], [98.92515, 23.29535], [98.93958, 23.31414], [98.87573, 23.33038], [98.92104, 23.36946], [98.87683, 23.48995], [98.82877, 23.47908], [98.80294, 23.5345], [98.88396, 23.59555], [98.81775, 23.694], [98.82933, 23.72921], [98.79607, 23.77947], [98.68209, 23.80492], [98.67797, 23.9644], [98.89632, 24.10612], [98.87998, 24.15624], [98.85319, 24.13042], [98.59256, 24.08371], [98.54476, 24.13119], [98.20666, 24.11406], [98.07806, 24.07988], [98.06703, 24.08028], [98.0607, 24.07812], [98.05671, 24.07961], [98.05302, 24.07408], [98.04709, 24.07616], [97.99583, 24.04932], [97.98691, 24.03897], [97.93951, 24.01953], [97.90998, 24.02094], [97.88616, 24.00463], [97.88414, 23.99405], [97.88814, 23.98605], [97.89683, 23.98389], [97.89676, 23.97931], [97.8955, 23.97758], [97.88811, 23.97446], [97.86545, 23.97723], [97.84328, 23.97603], [97.79416, 23.95663], [97.79456, 23.94836], [97.72302, 23.89288], [97.64667, 23.84574], [97.5247, 23.94032], [97.62363, 24.00506], [97.72903, 24.12606], [97.75305, 24.16902], [97.72799, 24.18883], [97.72998, 24.2302], [97.76799, 24.26365], [97.71941, 24.29652], [97.66723, 24.30027], [97.65624, 24.33781], [97.7098, 24.35658], [97.66998, 24.45288], [97.60029, 24.4401], [97.52757, 24.43748], [97.56286, 24.54535], [97.56525, 24.72838], [97.54675, 24.74202], [97.5542, 24.74943], [97.56383, 24.75535], [97.56648, 24.76475], [97.64354, 24.79171], [97.70181, 24.84557], [97.73127, 24.83015], [97.76481, 24.8289], [97.79949, 24.85655], [97.72903, 24.91332], [97.72216, 25.08508], [97.77023, 25.11492], [97.83614, 25.2715], [97.92541, 25.20815], [98.14925, 25.41547], [98.12591, 25.50722], [98.18084, 25.56298], [98.16848, 25.62739], [98.25774, 25.6051], [98.31268, 25.55307], [98.40606, 25.61129], [98.54064, 25.85129], [98.63128, 25.79937], [98.70818, 25.86241], [98.60763, 26.01512], [98.57085, 26.11547], [98.63128, 26.15492], [98.66884, 26.09165], [98.7329, 26.17218], [98.67797, 26.24487], [98.72741, 26.36183], [98.77547, 26.61994], [98.7333, 26.85615], [98.69582, 27.56499], [98.43353, 27.67086], [98.42529, 27.55404], [98.32641, 27.51385], [98.13964, 27.9478], [98.15337, 28.12114], [97.90069, 28.3776], [97.79632, 28.33168], [97.70705, 28.5056], [97.56835, 28.55628], [97.50518, 28.49716], [97.47085, 28.2688], [97.41729, 28.29783], [97.34547, 28.21385], [97.31292, 28.06784], [97.35412, 28.06663], [97.38845, 28.01329], [97.35824, 27.87256], [97.29919, 27.92233], [96.90112, 27.62149], [96.91431, 27.45752], [97.17422, 27.14052], [97.14675, 27.09041], [96.89132, 27.17474], [96.85287, 27.2065], [96.88445, 27.25046], [96.73888, 27.36638], [96.55761, 27.29928], [96.40779, 27.29818], [96.15591, 27.24572], [96.04949, 27.19428], [95.93002, 27.04149], [95.81603, 27.01335], [95.437, 26.7083], [95.30339, 26.65372], [95.23513, 26.68499], [95.05798, 26.45408], [95.12801, 26.38397], [95.11428, 26.1019], [95.18556, 26.07338], [94.80117, 25.49359], [94.68032, 25.47003], [94.57458, 25.20318], [94.74212, 25.13606], [94.73937, 25.00545], [94.60204, 24.70889], [94.5526, 24.70764], [94.50729, 24.59281], [94.45279, 24.56656], [94.32362, 24.27692], [94.30215, 24.23752], [94.14081, 23.83333], [93.92089, 23.95812], [93.80279, 23.92549], [93.75952, 24.0003], [93.62871, 24.00922], [93.50616, 23.94432], [93.46633, 23.97067], [93.41415, 24.07854], [93.34735, 24.10151], [93.32351, 24.04468], [93.36059, 23.93176], [93.3908, 23.92925], [93.3908, 23.7622], [93.43475, 23.68299], [93.38805, 23.4728], [93.39981, 23.38828], [93.38781, 23.36139], [93.36862, 23.35426], [93.38478, 23.13698], [93.2878, 23.00464], [93.12988, 23.05772], [93.134, 22.92498], [93.09417, 22.69459], [93.134, 22.59573], [93.11477, 22.54374], [93.13537, 22.45873], [93.18206, 22.43716], [93.19991, 22.25425], [93.14224, 22.24535], [93.15734, 22.18687], [93.04885, 22.20595], [92.99255, 22.05965], [92.99804, 21.98964], [92.93899, 22.02656], [92.89504, 21.95143], [92.86208, 22.05456], [92.70416, 22.16017], [92.67532, 22.03547], [92.60949, 21.97638], [92.62187, 21.87037]]]] } },
23347 { type: "Feature", properties: { iso1A2: "MN", iso1A3: "MNG", iso1N3: "496", wikidata: "Q711", nameEn: "Mongolia", groups: ["030", "142", "UN"], callingCodes: ["976"] }, geometry: { type: "MultiPolygon", coordinates: [[[[102.14032, 51.35566], [101.5044, 51.50467], [101.39085, 51.45753], [100.61116, 51.73028], [99.89203, 51.74903], [99.75578, 51.90108], [99.27888, 51.96876], [98.87768, 52.14563], [98.74142, 51.8637], [98.33222, 51.71832], [98.22053, 51.46579], [98.05257, 51.46696], [97.83305, 51.00248], [98.01472, 50.86652], [97.9693, 50.78044], [98.06393, 50.61262], [98.31373, 50.4996], [98.29481, 50.33561], [97.85197, 49.91339], [97.76871, 49.99861], [97.56432, 49.92801], [97.56811, 49.84265], [97.24639, 49.74737], [96.97388, 49.88413], [95.80056, 50.04239], [95.74757, 49.97915], [95.02465, 49.96941], [94.97166, 50.04725], [94.6121, 50.04239], [94.49477, 50.17832], [94.39258, 50.22193], [94.30823, 50.57498], [92.99595, 50.63183], [93.01109, 50.79001], [92.44714, 50.78762], [92.07173, 50.69585], [91.86048, 50.73734], [89.59711, 49.90851], [89.70687, 49.72535], [88.82499, 49.44808], [88.42449, 49.48821], [88.17223, 49.46934], [88.15543, 49.30314], [87.98977, 49.18147], [87.81333, 49.17354], [87.88171, 48.95853], [87.73822, 48.89582], [88.0788, 48.71436], [87.96361, 48.58478], [88.58939, 48.34531], [88.58316, 48.21893], [88.8011, 48.11302], [88.93186, 48.10263], [89.0711, 47.98528], [89.55453, 48.0423], [89.76624, 47.82745], [90.06512, 47.88177], [90.10871, 47.7375], [90.33598, 47.68303], [90.48854, 47.41826], [90.48542, 47.30438], [90.76108, 46.99399], [90.84035, 46.99525], [91.03649, 46.72916], [91.0147, 46.58171], [91.07696, 46.57315], [90.89639, 46.30711], [90.99672, 46.14207], [91.03026, 46.04194], [90.70907, 45.73437], [90.65114, 45.49314], [90.89169, 45.19667], [91.64048, 45.07408], [93.51161, 44.95964], [94.10003, 44.71016], [94.71959, 44.35284], [95.01191, 44.25274], [95.39772, 44.2805], [95.32891, 44.02407], [95.52594, 43.99353], [95.89543, 43.2528], [96.35658, 42.90363], [96.37926, 42.72055], [97.1777, 42.7964], [99.50671, 42.56535], [100.33297, 42.68231], [100.84979, 42.67087], [101.80515, 42.50074], [102.07645, 42.22519], [102.72403, 42.14675], [103.92804, 41.78246], [104.52258, 41.8706], [104.51667, 41.66113], [105.0123, 41.63188], [106.76517, 42.28741], [107.24774, 42.36107], [107.29755, 42.41395], [107.49681, 42.46221], [107.57258, 42.40898], [108.84489, 42.40246], [109.00679, 42.45302], [109.452, 42.44842], [109.89402, 42.63111], [110.08401, 42.6411], [110.4327, 42.78293], [111.0149, 43.3289], [111.59087, 43.51207], [111.79758, 43.6637], [111.93776, 43.68709], [111.96289, 43.81596], [111.40498, 44.3461], [111.76275, 44.98032], [111.98695, 45.09074], [112.4164, 45.06858], [112.74662, 44.86297], [113.70918, 44.72891], [114.5166, 45.27189], [114.54801, 45.38337], [114.74612, 45.43585], [114.94546, 45.37377], [115.60329, 45.44717], [116.16989, 45.68603], [116.27366, 45.78637], [116.24012, 45.8778], [116.26678, 45.96479], [116.58612, 46.30211], [116.75551, 46.33083], [116.83166, 46.38637], [117.36609, 46.36335], [117.41782, 46.57862], [117.60748, 46.59771], [117.69554, 46.50991], [118.30534, 46.73519], [118.78747, 46.68689], [118.8337, 46.77742], [118.89974, 46.77139], [118.92616, 46.72765], [119.00541, 46.74273], [119.10448, 46.65516], [119.24978, 46.64761], [119.32827, 46.61433], [119.42827, 46.63783], [119.65265, 46.62342], [119.68127, 46.59015], [119.77373, 46.62947], [119.80455, 46.67631], [119.89261, 46.66423], [119.91242, 46.90091], [119.85518, 46.92196], [119.71209, 47.19192], [119.62403, 47.24575], [119.56019, 47.24874], [119.54918, 47.29505], [119.31964, 47.42617], [119.35892, 47.48104], [119.13995, 47.53997], [119.12343, 47.66458], [118.7564, 47.76947], [118.55766, 47.99277], [118.29654, 48.00246], [118.22677, 48.03853], [118.11009, 48.04], [118.03676, 48.00982], [117.80196, 48.01661], [117.50181, 47.77216], [117.37875, 47.63627], [116.9723, 47.87285], [116.67405, 47.89039], [116.4465, 47.83662], [116.21879, 47.88505], [115.94296, 47.67741], [115.57128, 47.91988], [115.52082, 48.15367], [115.811, 48.25699], [115.78876, 48.51781], [116.06565, 48.81716], [116.03781, 48.87014], [116.71193, 49.83813], [116.62502, 49.92919], [116.22402, 50.04477], [115.73602, 49.87688], [115.26068, 49.97367], [114.9703, 50.19254], [114.325, 50.28098], [113.20216, 49.83356], [113.02647, 49.60772], [110.64493, 49.1816], [110.39891, 49.25083], [110.24373, 49.16676], [109.51325, 49.22859], [109.18017, 49.34709], [108.53969, 49.32325], [108.27937, 49.53167], [107.95387, 49.66659], [107.96116, 49.93191], [107.36407, 49.97612], [107.1174, 50.04239], [107.00007, 50.1977], [106.80326, 50.30177], [106.58373, 50.34044], [106.51122, 50.34408], [106.49628, 50.32436], [106.47156, 50.31909], [106.07865, 50.33474], [106.05562, 50.40582], [105.32528, 50.4648], [103.70343, 50.13952], [102.71178, 50.38873], [102.32194, 50.67982], [102.14032, 51.35566]]]] } },
23348 { type: "Feature", properties: { iso1A2: "MO", iso1A3: "MAC", iso1N3: "446", wikidata: "Q14773", nameEn: "Macau", aliases: ["Macao"], country: "CN", groups: ["030", "142", "UN"], driveSide: "left", callingCodes: ["853"] }, geometry: { type: "MultiPolygon", coordinates: [[[[113.54942, 22.14519], [113.54839, 22.10909], [113.57191, 22.07696], [113.63011, 22.10782], [113.60504, 22.20464], [113.57123, 22.20416], [113.56865, 22.20973], [113.5508, 22.21672], [113.54333, 22.21688], [113.54093, 22.21314], [113.53593, 22.2137], [113.53301, 22.21235], [113.53552, 22.20607], [113.52659, 22.18271], [113.54093, 22.15497], [113.54942, 22.14519]]]] } },
23349 { type: "Feature", properties: { iso1A2: "MP", iso1A3: "MNP", iso1N3: "580", wikidata: "Q16644", nameEn: "Northern Mariana Islands", aliases: ["US-MP"], country: "US", groups: ["Q1352230", "Q153732", "057", "009", "UN"], roadSpeedUnit: "mph", callingCodes: ["1 670"] }, geometry: { type: "MultiPolygon", coordinates: [[[[135.52896, 14.32623], [152.19114, 13.63487], [145.05972, 21.28731], [135.52896, 14.32623]]]] } },
23350 { type: "Feature", properties: { iso1A2: "MQ", iso1A3: "MTQ", iso1N3: "474", wikidata: "Q17054", nameEn: "Martinique", country: "FR", groups: ["Q3320166", "EU", "029", "003", "419", "019", "UN"], callingCodes: ["596"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-59.95997, 14.20285], [-61.07821, 15.25109], [-61.69315, 14.26451], [-59.95997, 14.20285]]]] } },
23351 { type: "Feature", properties: { iso1A2: "MR", iso1A3: "MRT", iso1N3: "478", wikidata: "Q1025", nameEn: "Mauritania", groups: ["011", "202", "002", "UN"], callingCodes: ["222"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-5.60725, 16.49919], [-6.57191, 25.0002], [-4.83423, 24.99935], [-8.66674, 27.31569], [-8.66721, 25.99918], [-12.0002, 25.9986], [-12.00251, 23.4538], [-12.14969, 23.41935], [-12.36213, 23.3187], [-12.5741, 23.28975], [-13.00412, 23.02297], [-13.10753, 22.89493], [-13.15313, 22.75649], [-13.08438, 22.53866], [-13.01525, 21.33343], [-16.95474, 21.33997], [-16.99806, 21.12142], [-17.0357, 21.05368], [-17.0396, 20.9961], [-17.06781, 20.92697], [-17.0695, 20.85742], [-17.0471, 20.76408], [-17.15288, 16.07139], [-16.50854, 16.09032], [-16.48967, 16.0496], [-16.44814, 16.09753], [-16.4429, 16.20605], [-16.27016, 16.51565], [-15.6509, 16.50315], [-15.00557, 16.64997], [-14.32144, 16.61495], [-13.80075, 16.13961], [-13.43135, 16.09022], [-13.11029, 15.52116], [-12.23936, 14.76324], [-11.94903, 14.76143], [-11.70705, 15.51558], [-11.43483, 15.62339], [-10.90932, 15.11001], [-10.71721, 15.4223], [-9.40447, 15.4396], [-9.44673, 15.60553], [-9.33314, 15.7044], [-9.31106, 15.69412], [-9.32979, 15.50032], [-5.50165, 15.50061], [-5.33435, 16.33354], [-5.60725, 16.49919]]]] } },
23352 { type: "Feature", properties: { iso1A2: "MS", iso1A3: "MSR", iso1N3: "500", wikidata: "Q13353", nameEn: "Montserrat", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 664"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.91508, 16.51165], [-62.1023, 16.97277], [-62.58307, 16.68909], [-61.91508, 16.51165]]]] } },
23353 { type: "Feature", properties: { iso1A2: "MT", iso1A3: "MLT", iso1N3: "470", wikidata: "Q233", nameEn: "Malta", groups: ["EU", "039", "150", "UN"], driveSide: "left", callingCodes: ["356"] }, geometry: { type: "MultiPolygon", coordinates: [[[[15.70991, 35.79901], [14.07544, 36.41525], [13.27636, 35.20764], [15.70991, 35.79901]]]] } },
23354 { type: "Feature", properties: { iso1A2: "MU", iso1A3: "MUS", iso1N3: "480", wikidata: "Q1027", nameEn: "Mauritius", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["230"] }, geometry: { type: "MultiPolygon", coordinates: [[[[56.09755, -9.55401], [57.50644, -31.92637], [68.4673, -19.15185], [56.09755, -9.55401]]]] } },
23355 { type: "Feature", properties: { iso1A2: "MV", iso1A3: "MDV", iso1N3: "462", wikidata: "Q826", nameEn: "Maldives", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["960"] }, geometry: { type: "MultiPolygon", coordinates: [[[[71.9161, 8.55531], [72.57428, -3.7623], [76.59015, 5.591], [71.9161, 8.55531]]]] } },
23356 { type: "Feature", properties: { iso1A2: "MW", iso1A3: "MWI", iso1N3: "454", wikidata: "Q1020", nameEn: "Malawi", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["265"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.48052, -9.62442], [33.31581, -9.48554], [33.14925, -9.49322], [32.99397, -9.36712], [32.95389, -9.40138], [33.00476, -9.5133], [33.00256, -9.63053], [33.05485, -9.61316], [33.10163, -9.66525], [33.12144, -9.58929], [33.2095, -9.61099], [33.31517, -9.82364], [33.36581, -9.81063], [33.37902, -9.9104], [33.31297, -10.05133], [33.53863, -10.20148], [33.54797, -10.36077], [33.70675, -10.56896], [33.47636, -10.78465], [33.28022, -10.84428], [33.25998, -10.88862], [33.39697, -11.15296], [33.29267, -11.3789], [33.29267, -11.43536], [33.23663, -11.40637], [33.24252, -11.59302], [33.32692, -11.59248], [33.33937, -11.91252], [33.25998, -12.14242], [33.3705, -12.34931], [33.47636, -12.32498], [33.54485, -12.35996], [33.37517, -12.54085], [33.28177, -12.54692], [33.18837, -12.61377], [33.05917, -12.59554], [32.94397, -12.76868], [32.96733, -12.88251], [33.02181, -12.88707], [32.98289, -13.12671], [33.0078, -13.19492], [32.86113, -13.47292], [32.84176, -13.52794], [32.73683, -13.57682], [32.68436, -13.55769], [32.66468, -13.60019], [32.68654, -13.64268], [32.7828, -13.64805], [32.84528, -13.71576], [32.76962, -13.77224], [32.79015, -13.80755], [32.88985, -13.82956], [32.99042, -13.95689], [33.02977, -14.05022], [33.07568, -13.98447], [33.16749, -13.93992], [33.24249, -14.00019], [33.66677, -14.61306], [33.7247, -14.4989], [33.88503, -14.51652], [33.92898, -14.47929], [34.08588, -14.48893], [34.18733, -14.43823], [34.22355, -14.43607], [34.34453, -14.3985], [34.35843, -14.38652], [34.39277, -14.39467], [34.4192, -14.43191], [34.44641, -14.47746], [34.45053, -14.49873], [34.47628, -14.53363], [34.48932, -14.53646], [34.49636, -14.55091], [34.52366, -14.5667], [34.53962, -14.59776], [34.55112, -14.64494], [34.53516, -14.67782], [34.52057, -14.68263], [34.54503, -14.74672], [34.567, -14.77345], [34.61522, -14.99583], [34.57503, -15.30619], [34.43126, -15.44778], [34.44981, -15.60864], [34.25195, -15.90321], [34.43126, -16.04737], [34.40344, -16.20923], [35.04805, -16.83167], [35.13771, -16.81687], [35.17017, -16.93521], [35.04805, -17.00027], [35.0923, -17.13235], [35.3062, -17.1244], [35.27065, -16.93817], [35.30929, -16.82871], [35.27219, -16.69402], [35.14235, -16.56812], [35.25828, -16.4792], [35.30157, -16.2211], [35.43355, -16.11371], [35.52365, -16.15414], [35.70107, -16.10147], [35.80487, -16.03907], [35.85303, -15.41913], [35.78799, -15.17428], [35.91812, -14.89514], [35.87212, -14.89478], [35.86945, -14.67481], [35.5299, -14.27714], [35.47989, -14.15594], [34.86229, -13.48958], [34.60253, -13.48487], [34.37831, -12.17408], [34.46088, -12.0174], [34.70739, -12.15652], [34.82903, -12.04837], [34.57917, -11.87849], [34.64241, -11.57499], [34.96296, -11.57354], [34.91153, -11.39799], [34.79375, -11.32245], [34.63305, -11.11731], [34.61161, -11.01611], [34.67047, -10.93796], [34.65946, -10.6828], [34.57581, -10.56271], [34.51911, -10.12279], [34.54499, -10.0678], [34.03865, -9.49398], [33.95829, -9.54066], [33.9638, -9.62206], [33.93298, -9.71647], [33.76677, -9.58516], [33.48052, -9.62442]]]] } },
23357 { type: "Feature", properties: { iso1A2: "MX", iso1A3: "MEX", iso1N3: "484", wikidata: "Q96", nameEn: "Mexico", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["52"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-117.1243, 32.53427], [-118.48109, 32.5991], [-120.12904, 18.41089], [-92.37213, 14.39277], [-92.2261, 14.53423], [-92.1454, 14.6804], [-92.18161, 14.84147], [-92.1423, 14.88647], [-92.1454, 14.98143], [-92.0621, 15.07406], [-92.20983, 15.26077], [-91.73182, 16.07371], [-90.44567, 16.07573], [-90.40499, 16.40524], [-90.61212, 16.49832], [-90.69064, 16.70697], [-91.04436, 16.92175], [-91.43809, 17.25373], [-90.99199, 17.25192], [-90.98678, 17.81655], [-89.14985, 17.81563], [-89.15105, 17.95104], [-89.03839, 18.0067], [-88.8716, 17.89535], [-88.71505, 18.0707], [-88.48242, 18.49164], [-88.3268, 18.49048], [-88.29909, 18.47591], [-88.26593, 18.47617], [-88.03238, 18.41778], [-88.03165, 18.16657], [-87.90671, 18.15213], [-87.87604, 18.18313], [-87.86657, 18.19971], [-87.85693, 18.18266], [-87.84815, 18.18511], [-86.92368, 17.61462], [-85.9092, 21.8218], [-96.92418, 25.97377], [-97.13927, 25.96583], [-97.35946, 25.92189], [-97.37332, 25.83854], [-97.42511, 25.83969], [-97.45669, 25.86874], [-97.49828, 25.89877], [-97.52025, 25.88518], [-97.66511, 26.01708], [-97.95155, 26.0625], [-97.97017, 26.05232], [-98.24603, 26.07191], [-98.27075, 26.09457], [-98.30491, 26.10475], [-98.35126, 26.15129], [-99.00546, 26.3925], [-99.03053, 26.41249], [-99.08477, 26.39849], [-99.53573, 27.30926], [-99.49744, 27.43746], [-99.482, 27.47128], [-99.48045, 27.49016], [-99.50208, 27.50021], [-99.52955, 27.49747], [-99.51478, 27.55836], [-99.55409, 27.61314], [-100.50029, 28.66117], [-100.51222, 28.70679], [-100.5075, 28.74066], [-100.52313, 28.75598], [-100.59809, 28.88197], [-100.63689, 28.90812], [-100.67294, 29.09744], [-100.79696, 29.24688], [-100.87982, 29.296], [-100.94056, 29.33371], [-100.94579, 29.34523], [-100.96725, 29.3477], [-101.01128, 29.36947], [-101.05686, 29.44738], [-101.47277, 29.7744], [-102.60596, 29.8192], [-103.15787, 28.93865], [-104.37752, 29.54255], [-104.39363, 29.55396], [-104.3969, 29.57105], [-104.5171, 29.64671], [-104.77674, 30.4236], [-106.00363, 31.39181], [-106.09025, 31.40569], [-106.20346, 31.46305], [-106.23711, 31.51262], [-106.24612, 31.54193], [-106.28084, 31.56173], [-106.30305, 31.62154], [-106.33419, 31.66303], [-106.34864, 31.69663], [-106.3718, 31.71165], [-106.38003, 31.73151], [-106.41773, 31.75196], [-106.43419, 31.75478], [-106.45244, 31.76523], [-106.46726, 31.75998], [-106.47298, 31.75054], [-106.48815, 31.74769], [-106.50111, 31.75714], [-106.50962, 31.76155], [-106.51251, 31.76922], [-106.52266, 31.77509], [-106.529, 31.784], [-108.20899, 31.78534], [-108.20979, 31.33316], [-111.07523, 31.33232], [-114.82011, 32.49609], [-114.79524, 32.55731], [-114.81141, 32.55543], [-114.80584, 32.62028], [-114.76736, 32.64094], [-114.71871, 32.71894], [-115.88053, 32.63624], [-117.1243, 32.53427]]]] } },
23358 { type: "Feature", properties: { iso1A2: "MY", iso1A3: "MYS", iso1N3: "458", wikidata: "Q833", nameEn: "Malaysia" }, geometry: null },
23359 { type: "Feature", properties: { iso1A2: "MZ", iso1A3: "MOZ", iso1N3: "508", wikidata: "Q1029", nameEn: "Mozambique", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["258"] }, geometry: { type: "MultiPolygon", coordinates: [[[[40.74206, -10.25691], [40.44265, -10.4618], [40.00295, -10.80255], [39.58249, -10.96043], [39.24395, -11.17433], [38.88996, -11.16978], [38.47258, -11.4199], [38.21598, -11.27289], [37.93618, -11.26228], [37.8388, -11.3123], [37.76614, -11.53352], [37.3936, -11.68949], [36.80309, -11.56836], [36.62068, -11.72884], [36.19094, -11.70008], [36.19094, -11.57593], [35.82767, -11.41081], [35.63599, -11.55927], [34.96296, -11.57354], [34.64241, -11.57499], [34.57917, -11.87849], [34.82903, -12.04837], [34.70739, -12.15652], [34.46088, -12.0174], [34.37831, -12.17408], [34.60253, -13.48487], [34.86229, -13.48958], [35.47989, -14.15594], [35.5299, -14.27714], [35.86945, -14.67481], [35.87212, -14.89478], [35.91812, -14.89514], [35.78799, -15.17428], [35.85303, -15.41913], [35.80487, -16.03907], [35.70107, -16.10147], [35.52365, -16.15414], [35.43355, -16.11371], [35.30157, -16.2211], [35.25828, -16.4792], [35.14235, -16.56812], [35.27219, -16.69402], [35.30929, -16.82871], [35.27065, -16.93817], [35.3062, -17.1244], [35.0923, -17.13235], [35.04805, -17.00027], [35.17017, -16.93521], [35.13771, -16.81687], [35.04805, -16.83167], [34.40344, -16.20923], [34.43126, -16.04737], [34.25195, -15.90321], [34.44981, -15.60864], [34.43126, -15.44778], [34.57503, -15.30619], [34.61522, -14.99583], [34.567, -14.77345], [34.54503, -14.74672], [34.52057, -14.68263], [34.53516, -14.67782], [34.55112, -14.64494], [34.53962, -14.59776], [34.52366, -14.5667], [34.49636, -14.55091], [34.48932, -14.53646], [34.47628, -14.53363], [34.45053, -14.49873], [34.44641, -14.47746], [34.4192, -14.43191], [34.39277, -14.39467], [34.35843, -14.38652], [34.34453, -14.3985], [34.22355, -14.43607], [34.18733, -14.43823], [34.08588, -14.48893], [33.92898, -14.47929], [33.88503, -14.51652], [33.7247, -14.4989], [33.66677, -14.61306], [33.24249, -14.00019], [30.22098, -14.99447], [30.41902, -15.62269], [30.42568, -15.9962], [30.91597, -15.99924], [30.97761, -16.05848], [31.13171, -15.98019], [31.30563, -16.01193], [31.42451, -16.15154], [31.67988, -16.19595], [31.90223, -16.34388], [31.91324, -16.41569], [32.02772, -16.43892], [32.28529, -16.43892], [32.42838, -16.4727], [32.71017, -16.59932], [32.69917, -16.66893], [32.78943, -16.70267], [32.97655, -16.70689], [32.91051, -16.89446], [32.84113, -16.92259], [32.96554, -17.11971], [33.00517, -17.30477], [33.0426, -17.3468], [32.96554, -17.48964], [32.98536, -17.55891], [33.0492, -17.60298], [32.94133, -17.99705], [33.03159, -18.35054], [33.02278, -18.4696], [32.88629, -18.51344], [32.88629, -18.58023], [32.95013, -18.69079], [32.9017, -18.7992], [32.82465, -18.77419], [32.70137, -18.84712], [32.73439, -18.92628], [32.69917, -18.94293], [32.72118, -19.02204], [32.84006, -19.0262], [32.87088, -19.09279], [32.85107, -19.29238], [32.77966, -19.36098], [32.78282, -19.47513], [32.84446, -19.48343], [32.84666, -19.68462], [32.95013, -19.67219], [33.06461, -19.77787], [33.01178, -20.02007], [32.93032, -20.03868], [32.85987, -20.16686], [32.85987, -20.27841], [32.66174, -20.56106], [32.55167, -20.56312], [32.48122, -20.63319], [32.51644, -20.91929], [32.37115, -21.133], [32.48236, -21.32873], [32.41234, -21.31246], [31.38336, -22.36919], [31.30611, -22.422], [31.55779, -23.176], [31.56539, -23.47268], [31.67942, -23.60858], [31.70223, -23.72695], [31.77445, -23.90082], [31.87707, -23.95293], [31.90368, -24.18892], [31.9835, -24.29983], [32.03196, -25.10785], [32.01676, -25.38117], [31.97875, -25.46356], [32.00631, -25.65044], [31.92649, -25.84216], [31.974, -25.95387], [32.00916, -25.999], [32.08599, -26.00978], [32.10435, -26.15656], [32.07352, -26.40185], [32.13409, -26.5317], [32.13315, -26.84345], [32.19409, -26.84032], [32.22302, -26.84136], [32.29584, -26.852], [32.35222, -26.86027], [34.51034, -26.91792], [42.99868, -12.65261], [40.74206, -10.25691]]]] } },
23360 { type: "Feature", properties: { iso1A2: "NA", iso1A3: "NAM", iso1N3: "516", wikidata: "Q1030", nameEn: "Namibia", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["264"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.28743, -17.38814], [13.95896, -17.43141], [13.36212, -16.98048], [12.97145, -16.98567], [12.52111, -17.24495], [12.07076, -17.15165], [11.75063, -17.25013], [10.5065, -17.25284], [12.51595, -32.27486], [16.45332, -28.63117], [16.46592, -28.57126], [16.59922, -28.53246], [16.90446, -28.057], [17.15405, -28.08573], [17.4579, -28.68718], [18.99885, -28.89165], [19.99882, -28.42622], [19.99817, -24.76768], [19.99912, -21.99991], [20.99751, -22.00026], [20.99904, -18.31743], [21.45556, -18.31795], [23.0996, -18.00075], [23.29618, -17.99855], [23.61088, -18.4881], [24.19416, -18.01919], [24.40577, -17.95726], [24.57485, -18.07151], [24.6303, -17.9863], [24.71887, -17.9218], [24.73364, -17.89338], [24.95586, -17.79674], [25.05895, -17.84452], [25.16882, -17.78253], [25.26433, -17.79571], [25.00198, -17.58221], [24.70864, -17.49501], [24.5621, -17.52963], [24.38712, -17.46818], [24.32811, -17.49082], [24.23619, -17.47489], [23.47474, -17.62877], [21.42741, -18.02787], [21.14283, -17.94318], [18.84226, -17.80375], [18.39229, -17.38927], [14.28743, -17.38814]]]] } },
23361 { type: "Feature", properties: { iso1A2: "NC", iso1A3: "NCL", iso1N3: "540", wikidata: "Q33788", nameEn: "New Caledonia", country: "FR", groups: ["EU", "Q1451600", "054", "009", "UN"], callingCodes: ["687"] }, geometry: { type: "MultiPolygon", coordinates: [[[[159.77159, -28.41151], [174.245, -23.1974], [156.73836, -14.50464], [159.77159, -28.41151]]]] } },
23362 { type: "Feature", properties: { iso1A2: "NE", iso1A3: "NER", iso1N3: "562", wikidata: "Q1032", nameEn: "Niger", aliases: ["RN"], groups: ["011", "202", "002", "UN"], callingCodes: ["227"] }, geometry: { type: "MultiPolygon", coordinates: [[[[14.22918, 22.61719], [13.5631, 23.16574], [11.96886, 23.51735], [7.48273, 20.87258], [7.38361, 20.79165], [5.8153, 19.45101], [4.26651, 19.14224], [4.26762, 17.00432], [4.21787, 17.00118], [4.19893, 16.39923], [3.50368, 15.35934], [3.03134, 15.42221], [3.01806, 15.34571], [1.31275, 15.27978], [0.96711, 14.98275], [0.72632, 14.95898], [0.23859, 15.00135], [0.16936, 14.51654], [0.38051, 14.05575], [0.61924, 13.68491], [0.77377, 13.6866], [0.77637, 13.64442], [0.99514, 13.5668], [1.02813, 13.46635], [1.20088, 13.38951], [1.24429, 13.39373], [1.28509, 13.35488], [1.24516, 13.33968], [1.21217, 13.37853], [1.18873, 13.31771], [0.99253, 13.37515], [0.99167, 13.10727], [2.26349, 12.41915], [2.05785, 12.35539], [2.39723, 11.89473], [2.45824, 11.98672], [2.39657, 12.10952], [2.37783, 12.24804], [2.6593, 12.30631], [2.83978, 12.40585], [3.25352, 12.01467], [3.31613, 11.88495], [3.48187, 11.86092], [3.59375, 11.70269], [3.61075, 11.69181], [3.67988, 11.75429], [3.67122, 11.80865], [3.63063, 11.83042], [3.61955, 11.91847], [3.67775, 11.97599], [3.63136, 12.11826], [3.66364, 12.25884], [3.65111, 12.52223], [3.94339, 12.74979], [4.10006, 12.98862], [4.14367, 13.17189], [4.14186, 13.47586], [4.23456, 13.47725], [4.4668, 13.68286], [4.87425, 13.78], [4.9368, 13.7345], [5.07396, 13.75052], [5.21026, 13.73627], [5.27797, 13.75474], [5.35437, 13.83567], [5.52957, 13.8845], [6.15771, 13.64564], [6.27411, 13.67835], [6.43053, 13.6006], [6.69617, 13.34057], [6.94445, 12.99825], [7.0521, 13.00076], [7.12676, 13.02445], [7.22399, 13.1293], [7.39241, 13.09717], [7.81085, 13.34902], [8.07997, 13.30847], [8.25185, 13.20369], [8.41853, 13.06166], [8.49493, 13.07519], [8.60431, 13.01768], [8.64251, 12.93985], [8.97413, 12.83661], [9.65995, 12.80614], [10.00373, 13.18171], [10.19993, 13.27129], [10.46731, 13.28819], [10.66004, 13.36422], [11.4535, 13.37773], [11.88236, 13.2527], [12.04209, 13.14452], [12.16189, 13.10056], [12.19315, 13.12423], [12.47095, 13.06673], [12.58033, 13.27805], [12.6793, 13.29157], [12.87376, 13.48919], [13.05085, 13.53984], [13.19844, 13.52802], [13.33213, 13.71195], [13.6302, 13.71094], [13.47559, 14.40881], [13.48259, 14.46704], [13.68573, 14.55276], [13.67878, 14.64013], [13.809, 14.72915], [13.78991, 14.87519], [13.86301, 15.04043], [14.37425, 15.72591], [15.50373, 16.89649], [15.6032, 18.77402], [15.75098, 19.93002], [15.99632, 20.35364], [15.6721, 20.70069], [15.59841, 20.74039], [15.56004, 20.79488], [15.55382, 20.86507], [15.57248, 20.92138], [15.62515, 20.95395], [15.28332, 21.44557], [15.20213, 21.49365], [15.19692, 21.99339], [14.99751, 23.00539], [14.22918, 22.61719]]]] } },
23363 { type: "Feature", properties: { iso1A2: "NF", iso1A3: "NFK", iso1N3: "574", wikidata: "Q31057", nameEn: "Norfolk Island", country: "AU", groups: ["053", "009", "UN"], driveSide: "left", callingCodes: ["672 3"] }, geometry: { type: "MultiPolygon", coordinates: [[[[169.82316, -28.16667], [166.29505, -28.29175], [167.94076, -30.60745], [169.82316, -28.16667]]]] } },
23364 { type: "Feature", properties: { iso1A2: "NG", iso1A3: "NGA", iso1N3: "566", wikidata: "Q1033", nameEn: "Nigeria", groups: ["011", "202", "002", "UN"], callingCodes: ["234"] }, geometry: { type: "MultiPolygon", coordinates: [[[[6.15771, 13.64564], [5.52957, 13.8845], [5.35437, 13.83567], [5.27797, 13.75474], [5.21026, 13.73627], [5.07396, 13.75052], [4.9368, 13.7345], [4.87425, 13.78], [4.4668, 13.68286], [4.23456, 13.47725], [4.14186, 13.47586], [4.14367, 13.17189], [4.10006, 12.98862], [3.94339, 12.74979], [3.65111, 12.52223], [3.66364, 12.25884], [3.63136, 12.11826], [3.67775, 11.97599], [3.61955, 11.91847], [3.63063, 11.83042], [3.67122, 11.80865], [3.67988, 11.75429], [3.61075, 11.69181], [3.59375, 11.70269], [3.49175, 11.29765], [3.71505, 11.13015], [3.84243, 10.59316], [3.78292, 10.40538], [3.6844, 10.46351], [3.57275, 10.27185], [3.66908, 10.18136], [3.54429, 9.87739], [3.35383, 9.83641], [3.32099, 9.78032], [3.34726, 9.70696], [3.25093, 9.61632], [3.13928, 9.47167], [3.14147, 9.28375], [3.08017, 9.10006], [2.77907, 9.06924], [2.67523, 7.87825], [2.73095, 7.7755], [2.73405, 7.5423], [2.78668, 7.5116], [2.79442, 7.43486], [2.74489, 7.42565], [2.76965, 7.13543], [2.71702, 6.95722], [2.74024, 6.92802], [2.73405, 6.78508], [2.78823, 6.76356], [2.78204, 6.70514], [2.7325, 6.64057], [2.74334, 6.57291], [2.70464, 6.50831], [2.70566, 6.38038], [2.74181, 6.13349], [5.87055, 3.78489], [8.34397, 4.30689], [8.60302, 4.87353], [8.78027, 5.1243], [8.92029, 5.58403], [8.83687, 5.68483], [8.88156, 5.78857], [8.84209, 5.82562], [9.51757, 6.43874], [9.70674, 6.51717], [9.77824, 6.79088], [9.86314, 6.77756], [10.15135, 7.03781], [10.21466, 6.88996], [10.53639, 6.93432], [10.57214, 7.16345], [10.59746, 7.14719], [10.60789, 7.06885], [10.83727, 6.9358], [10.8179, 6.83377], [10.94302, 6.69325], [11.09644, 6.68437], [11.09495, 6.51717], [11.42041, 6.53789], [11.42264, 6.5882], [11.51499, 6.60892], [11.57755, 6.74059], [11.55818, 6.86186], [11.63117, 6.9905], [11.87396, 7.09398], [11.84864, 7.26098], [11.93205, 7.47812], [12.01844, 7.52981], [11.99908, 7.67302], [12.20909, 7.97553], [12.19271, 8.10826], [12.24782, 8.17904], [12.26123, 8.43696], [12.4489, 8.52536], [12.44146, 8.6152], [12.68722, 8.65938], [12.71701, 8.7595], [12.79, 8.75361], [12.81085, 8.91992], [12.90022, 9.11411], [12.91958, 9.33905], [12.85628, 9.36698], [13.02385, 9.49334], [13.22642, 9.57266], [13.25472, 9.76795], [13.29941, 9.8296], [13.25025, 9.86042], [13.24132, 9.91031], [13.27409, 9.93232], [13.286, 9.9822], [13.25323, 10.00127], [13.25025, 10.03647], [13.34111, 10.12299], [13.43644, 10.13326], [13.5705, 10.53183], [13.54964, 10.61236], [13.73434, 10.9255], [13.70753, 10.94451], [13.7403, 11.00593], [13.78945, 11.00154], [13.97489, 11.30258], [14.17821, 11.23831], [14.6124, 11.51283], [14.64591, 11.66166], [14.55207, 11.72001], [14.61612, 11.7798], [14.6474, 12.17466], [14.4843, 12.35223], [14.22215, 12.36533], [14.17523, 12.41916], [14.20204, 12.53405], [14.08251, 13.0797], [13.6302, 13.71094], [13.33213, 13.71195], [13.19844, 13.52802], [13.05085, 13.53984], [12.87376, 13.48919], [12.6793, 13.29157], [12.58033, 13.27805], [12.47095, 13.06673], [12.19315, 13.12423], [12.16189, 13.10056], [12.04209, 13.14452], [11.88236, 13.2527], [11.4535, 13.37773], [10.66004, 13.36422], [10.46731, 13.28819], [10.19993, 13.27129], [10.00373, 13.18171], [9.65995, 12.80614], [8.97413, 12.83661], [8.64251, 12.93985], [8.60431, 13.01768], [8.49493, 13.07519], [8.41853, 13.06166], [8.25185, 13.20369], [8.07997, 13.30847], [7.81085, 13.34902], [7.39241, 13.09717], [7.22399, 13.1293], [7.12676, 13.02445], [7.0521, 13.00076], [6.94445, 12.99825], [6.69617, 13.34057], [6.43053, 13.6006], [6.27411, 13.67835], [6.15771, 13.64564]]]] } },
23365 { type: "Feature", properties: { iso1A2: "NI", iso1A3: "NIC", iso1N3: "558", wikidata: "Q811", nameEn: "Nicaragua", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["505"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-83.13724, 15.00002], [-83.49268, 15.01158], [-83.62101, 14.89448], [-83.89551, 14.76697], [-84.10584, 14.76353], [-84.48373, 14.63249], [-84.70119, 14.68078], [-84.82596, 14.82212], [-84.90082, 14.80489], [-85.1575, 14.53934], [-85.18602, 14.24929], [-85.32149, 14.2562], [-85.45762, 14.11304], [-85.73964, 13.9698], [-85.75477, 13.8499], [-86.03458, 13.99181], [-86.00685, 14.08474], [-86.14801, 14.04317], [-86.35219, 13.77157], [-86.76812, 13.79605], [-86.71267, 13.30348], [-86.87066, 13.30641], [-86.93383, 13.18677], [-86.93197, 13.05313], [-87.03785, 12.98682], [-87.06306, 13.00892], [-87.37107, 12.98646], [-87.55124, 13.12523], [-87.7346, 13.13228], [-88.11443, 12.63306], [-86.14524, 11.09059], [-85.71223, 11.06868], [-85.60529, 11.22607], [-84.92439, 10.9497], [-84.68197, 11.07568], [-83.90838, 10.71161], [-83.66597, 10.79916], [-83.68276, 11.01562], [-82.56142, 11.91792], [-82.06974, 14.49418], [-83.04763, 15.03256], [-83.13724, 15.00002]]]] } },
23366 { type: "Feature", properties: { iso1A2: "NL", iso1A3: "NLD", iso1N3: "528", wikidata: "Q29999", nameEn: "Kingdom of the Netherlands" }, geometry: null },
23367 { type: "Feature", properties: { iso1A2: "NO", iso1A3: "NOR", iso1N3: "578", wikidata: "Q20", nameEn: "Norway" }, geometry: null },
23368 { type: "Feature", properties: { iso1A2: "NP", iso1A3: "NPL", iso1N3: "524", wikidata: "Q837", nameEn: "Nepal", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["977"] }, geometry: { type: "MultiPolygon", coordinates: [[[[88.13378, 27.88015], [87.82681, 27.95248], [87.72718, 27.80938], [87.56996, 27.84517], [87.11696, 27.84104], [87.03757, 27.94835], [86.75582, 28.04182], [86.74181, 28.10638], [86.56265, 28.09569], [86.51609, 27.96623], [86.42736, 27.91122], [86.22966, 27.9786], [86.18607, 28.17364], [86.088, 28.09264], [86.08333, 28.02121], [86.12069, 27.93047], [86.06309, 27.90021], [85.94946, 27.9401], [85.97813, 27.99023], [85.90743, 28.05144], [85.84672, 28.18187], [85.74864, 28.23126], [85.71907, 28.38064], [85.69105, 28.38475], [85.60854, 28.25045], [85.59765, 28.30529], [85.4233, 28.32996], [85.38127, 28.28336], [85.10729, 28.34092], [85.18668, 28.54076], [85.19135, 28.62825], [85.06059, 28.68562], [84.85511, 28.58041], [84.62317, 28.73887], [84.47528, 28.74023], [84.2231, 28.89571], [84.24801, 29.02783], [84.18107, 29.23451], [83.97559, 29.33091], [83.82303, 29.30513], [83.63156, 29.16249], [83.44787, 29.30513], [83.28131, 29.56813], [83.07116, 29.61957], [82.73024, 29.81695], [82.5341, 29.9735], [82.38622, 30.02608], [82.16984, 30.0692], [82.19475, 30.16884], [82.10757, 30.23745], [82.10135, 30.35439], [81.99082, 30.33423], [81.62033, 30.44703], [81.5459, 30.37688], [81.41018, 30.42153], [81.39928, 30.21862], [81.33355, 30.15303], [81.2623, 30.14596], [81.29032, 30.08806], [81.24362, 30.0126], [81.12842, 30.01395], [81.03953, 30.20059], [80.92547, 30.17193], [80.91143, 30.22173], [80.86673, 30.17321], [80.8778, 30.13384], [80.67076, 29.95732], [80.60226, 29.95732], [80.57179, 29.91422], [80.56247, 29.86661], [80.48997, 29.79566], [80.43458, 29.80466], [80.41554, 29.79451], [80.36803, 29.73865], [80.38428, 29.68513], [80.41858, 29.63581], [80.37939, 29.57098], [80.24322, 29.44299], [80.31428, 29.30784], [80.28626, 29.20327], [80.24112, 29.21414], [80.26602, 29.13938], [80.23178, 29.11626], [80.18085, 29.13649], [80.05743, 28.91479], [80.06957, 28.82763], [80.12125, 28.82346], [80.37188, 28.63371], [80.44504, 28.63098], [80.52443, 28.54897], [80.50575, 28.6706], [80.55142, 28.69182], [81.03471, 28.40054], [81.19847, 28.36284], [81.32923, 28.13521], [81.38683, 28.17638], [81.48179, 28.12148], [81.47867, 28.08303], [81.91223, 27.84995], [81.97214, 27.93322], [82.06554, 27.92222], [82.46405, 27.6716], [82.70378, 27.72122], [82.74119, 27.49838], [82.93261, 27.50328], [82.94938, 27.46036], [83.19413, 27.45632], [83.27197, 27.38309], [83.2673, 27.36235], [83.29999, 27.32778], [83.35136, 27.33885], [83.38872, 27.39276], [83.39495, 27.4798], [83.61288, 27.47013], [83.85595, 27.35797], [83.86182, 27.4241], [83.93306, 27.44939], [84.02229, 27.43836], [84.10791, 27.52399], [84.21376, 27.45218], [84.25735, 27.44941], [84.29315, 27.39], [84.62161, 27.33885], [84.69166, 27.21294], [84.64496, 27.04669], [84.793, 26.9968], [84.82913, 27.01989], [84.85754, 26.98984], [84.96687, 26.95599], [84.97186, 26.9149], [85.00536, 26.89523], [85.05592, 26.88991], [85.02635, 26.85381], [85.15883, 26.86966], [85.19291, 26.86909], [85.18046, 26.80519], [85.21159, 26.75933], [85.34302, 26.74954], [85.47752, 26.79292], [85.56471, 26.84133], [85.5757, 26.85955], [85.59461, 26.85161], [85.61621, 26.86721], [85.66239, 26.84822], [85.73483, 26.79613], [85.72315, 26.67471], [85.76907, 26.63076], [85.83126, 26.61134], [85.85126, 26.60866], [85.8492, 26.56667], [86.02729, 26.66756], [86.13596, 26.60651], [86.22513, 26.58863], [86.26235, 26.61886], [86.31564, 26.61925], [86.49726, 26.54218], [86.54258, 26.53819], [86.57073, 26.49825], [86.61313, 26.48658], [86.62686, 26.46891], [86.69124, 26.45169], [86.74025, 26.42386], [86.76797, 26.45892], [86.82898, 26.43919], [86.94543, 26.52076], [86.95912, 26.52076], [87.01559, 26.53228], [87.04691, 26.58685], [87.0707, 26.58571], [87.09147, 26.45039], [87.14751, 26.40542], [87.18863, 26.40558], [87.24682, 26.4143], [87.26587, 26.40592], [87.26568, 26.37294], [87.34568, 26.34787], [87.37314, 26.40815], [87.46566, 26.44058], [87.51571, 26.43106], [87.55274, 26.40596], [87.59175, 26.38342], [87.66803, 26.40294], [87.67893, 26.43501], [87.76004, 26.40711], [87.7918, 26.46737], [87.84193, 26.43663], [87.89085, 26.48565], [87.90115, 26.44923], [88.00895, 26.36029], [88.09414, 26.43732], [88.09963, 26.54195], [88.16452, 26.64111], [88.1659, 26.68177], [88.19107, 26.75516], [88.12302, 26.95324], [88.13422, 26.98705], [88.11719, 26.98758], [87.9887, 27.11045], [88.01587, 27.21388], [88.01646, 27.21612], [88.07277, 27.43007], [88.04008, 27.49223], [88.19107, 27.79285], [88.1973, 27.85067], [88.13378, 27.88015]]]] } },
23369 { type: "Feature", properties: { iso1A2: "NR", iso1A3: "NRU", iso1N3: "520", wikidata: "Q697", nameEn: "Nauru", groups: ["057", "009", "UN"], driveSide: "left", callingCodes: ["674"] }, geometry: { type: "MultiPolygon", coordinates: [[[[166.95155, 0.14829], [166.21778, -0.7977], [167.60042, -0.88259], [166.95155, 0.14829]]]] } },
23370 { type: "Feature", properties: { iso1A2: "NU", iso1A3: "NIU", iso1N3: "570", wikidata: "Q34020", nameEn: "Niue", country: "NZ", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["683"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-170.83899, -18.53439], [-170.82274, -20.44429], [-168.63096, -18.60489], [-170.83899, -18.53439]]]] } },
23371 { type: "Feature", properties: { iso1A2: "NZ", iso1A3: "NZL", iso1N3: "554", wikidata: "Q664", nameEn: "New Zealand" }, geometry: null },
23372 { type: "Feature", properties: { iso1A2: "OM", iso1A3: "OMN", iso1N3: "512", wikidata: "Q842", nameEn: "Oman", groups: ["145", "142", "UN"], callingCodes: ["968"] }, geometry: { type: "MultiPolygon", coordinates: [[[[56.82555, 25.7713], [56.79239, 26.41236], [56.68954, 26.76645], [56.2644, 26.58649], [55.81777, 26.18798], [56.08666, 26.05038], [56.15498, 26.06828], [56.19334, 25.9795], [56.13963, 25.82765], [56.17416, 25.77239], [56.13579, 25.73524], [56.14826, 25.66351], [56.18363, 25.65508], [56.20473, 25.61119], [56.25365, 25.60211], [56.26636, 25.60643], [56.25341, 25.61443], [56.26534, 25.62825], [56.82555, 25.7713]]], [[[56.26062, 25.33108], [56.23362, 25.31253], [56.25008, 25.28843], [56.24465, 25.27505], [56.20838, 25.25668], [56.20872, 25.24104], [56.24341, 25.22867], [56.27628, 25.23404], [56.34438, 25.26653], [56.35172, 25.30681], [56.3111, 25.30107], [56.3005, 25.31815], [56.26062, 25.33108]], [[56.28423, 25.26344], [56.27086, 25.26128], [56.2716, 25.27916], [56.28102, 25.28486], [56.29379, 25.2754], [56.28423, 25.26344]]], [[[61.45114, 22.55394], [56.86325, 25.03856], [56.3227, 24.97284], [56.34873, 24.93205], [56.30269, 24.88334], [56.20568, 24.85063], [56.20062, 24.78565], [56.13684, 24.73699], [56.06128, 24.74457], [56.03535, 24.81161], [55.97836, 24.87673], [55.97467, 24.89639], [56.05106, 24.87461], [56.05715, 24.95727], [55.96316, 25.00857], [55.90849, 24.96771], [55.85094, 24.96858], [55.81116, 24.9116], [55.81348, 24.80102], [55.83408, 24.77858], [55.83271, 24.68567], [55.76461, 24.5287], [55.83271, 24.41521], [55.83395, 24.32776], [55.80747, 24.31069], [55.79145, 24.27914], [55.76781, 24.26209], [55.75939, 24.26114], [55.75382, 24.2466], [55.75257, 24.23466], [55.76558, 24.23227], [55.77658, 24.23476], [55.83367, 24.20193], [55.95472, 24.2172], [56.01799, 24.07426], [55.8308, 24.01633], [55.73301, 24.05994], [55.48677, 23.94946], [55.57358, 23.669], [55.22634, 23.10378], [55.2137, 22.71065], [55.66469, 21.99658], [54.99756, 20.00083], [52.00311, 19.00083], [52.78009, 17.35124], [52.74267, 17.29519], [52.81185, 17.28568], [57.49095, 8.14549], [61.45114, 22.55394]]]] } },
23373 { type: "Feature", properties: { iso1A2: "PA", iso1A3: "PAN", iso1N3: "591", wikidata: "Q804", nameEn: "Panama", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["507"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-77.32389, 8.81247], [-77.58292, 9.22278], [-78.79327, 9.93766], [-82.51044, 9.65379], [-82.56507, 9.57279], [-82.61345, 9.49881], [-82.66667, 9.49746], [-82.77206, 9.59573], [-82.87919, 9.62645], [-82.84871, 9.4973], [-82.93516, 9.46741], [-82.93516, 9.07687], [-82.72126, 8.97125], [-82.88253, 8.83331], [-82.91377, 8.774], [-82.92068, 8.74832], [-82.8794, 8.6981], [-82.82739, 8.60153], [-82.83975, 8.54755], [-82.83322, 8.52464], [-82.8382, 8.48117], [-82.8679, 8.44042], [-82.93056, 8.43465], [-83.05209, 8.33394], [-82.9388, 8.26634], [-82.88641, 8.10219], [-82.89137, 8.05755], [-82.89978, 8.04083], [-82.94503, 7.93865], [-82.13751, 6.97312], [-78.06168, 7.07793], [-77.89178, 7.22681], [-77.81426, 7.48319], [-77.72157, 7.47612], [-77.72514, 7.72348], [-77.57185, 7.51147], [-77.17257, 7.97422], [-77.45064, 8.49991], [-77.32389, 8.81247]]]] } },
23374 { type: "Feature", properties: { iso1A2: "PE", iso1A3: "PER", iso1N3: "604", wikidata: "Q419", nameEn: "Peru", groups: ["005", "419", "019", "UN"], callingCodes: ["51"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-74.26675, -0.97229], [-74.42701, -0.50218], [-75.18513, -0.0308], [-75.25764, -0.11943], [-75.40192, -0.17196], [-75.61997, -0.10012], [-75.60169, -0.18708], [-75.53615, -0.19213], [-75.22862, -0.60048], [-75.22862, -0.95588], [-75.3872, -0.9374], [-75.57429, -1.55961], [-76.05203, -2.12179], [-76.6324, -2.58397], [-77.94147, -3.05454], [-78.19369, -3.36431], [-78.14324, -3.47653], [-78.22642, -3.51113], [-78.24589, -3.39907], [-78.34362, -3.38633], [-78.68394, -4.60754], [-78.85149, -4.66795], [-79.01659, -5.01481], [-79.1162, -4.97774], [-79.26248, -4.95167], [-79.59402, -4.46848], [-79.79722, -4.47558], [-80.13945, -4.29786], [-80.39256, -4.48269], [-80.46386, -4.41516], [-80.32114, -4.21323], [-80.45023, -4.20938], [-80.4822, -4.05477], [-80.46386, -4.01342], [-80.13232, -3.90317], [-80.19926, -3.68894], [-80.18741, -3.63994], [-80.19848, -3.59249], [-80.21642, -3.5888], [-80.20535, -3.51667], [-80.22629, -3.501], [-80.23651, -3.48652], [-80.24586, -3.48677], [-80.24123, -3.46124], [-80.20647, -3.431], [-80.30602, -3.39149], [-84.52388, -3.36941], [-85.71054, -21.15413], [-70.59118, -18.35072], [-70.378, -18.3495], [-70.31267, -18.31258], [-70.16394, -18.31737], [-69.96732, -18.25992], [-69.81607, -18.12582], [-69.75305, -17.94605], [-69.82868, -17.72048], [-69.79087, -17.65563], [-69.66483, -17.65083], [-69.46897, -17.4988], [-69.46863, -17.37466], [-69.62883, -17.28142], [-69.16896, -16.72233], [-69.00853, -16.66769], [-69.04027, -16.57214], [-68.98358, -16.42165], [-68.79464, -16.33272], [-68.96238, -16.194], [-69.09986, -16.22693], [-69.20291, -16.16668], [-69.40336, -15.61358], [-69.14856, -15.23478], [-69.36254, -14.94634], [-68.88135, -14.18639], [-69.05265, -13.68546], [-68.8864, -13.40792], [-68.85615, -12.87769], [-68.65044, -12.50689], [-68.98115, -11.8979], [-69.57156, -10.94555], [-69.57835, -10.94051], [-69.90896, -10.92744], [-70.38791, -11.07096], [-70.51395, -10.92249], [-70.64134, -11.0108], [-70.62487, -9.80666], [-70.55429, -9.76692], [-70.58453, -9.58303], [-70.53373, -9.42628], [-71.23394, -9.9668], [-72.14742, -9.98049], [-72.31883, -9.5184], [-72.72216, -9.41397], [-73.21498, -9.40904], [-72.92886, -9.04074], [-73.76576, -7.89884], [-73.65485, -7.77897], [-73.96938, -7.58465], [-73.77011, -7.28944], [-73.73986, -6.87919], [-73.12983, -6.43852], [-73.24579, -6.05764], [-72.83973, -5.14765], [-72.64391, -5.0391], [-71.87003, -4.51661], [-70.96814, -4.36915], [-70.77601, -4.15717], [-70.33236, -4.15214], [-70.19582, -4.3607], [-70.11305, -4.27281], [-70.00888, -4.37833], [-69.94708, -4.2431], [-70.3374, -3.79505], [-70.52393, -3.87553], [-70.71396, -3.7921], [-70.04609, -2.73906], [-70.94377, -2.23142], [-71.75223, -2.15058], [-72.92587, -2.44514], [-73.65312, -1.26222], [-74.26675, -0.97229]]]] } },
23375 { type: "Feature", properties: { iso1A2: "PF", iso1A3: "PYF", iso1N3: "258", wikidata: "Q30971", nameEn: "French Polynesia", country: "FR", groups: ["EU", "Q1451600", "061", "009", "UN"], callingCodes: ["689"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-135.59706, -4.70473], [-156.48634, -15.52824], [-156.45576, -31.75456], [-133.59543, -28.4709], [-135.59706, -4.70473]]]] } },
23376 { type: "Feature", properties: { iso1A2: "PG", iso1A3: "PNG", iso1N3: "598", wikidata: "Q691", nameEn: "Papua New Guinea", groups: ["054", "009", "UN"], driveSide: "left", callingCodes: ["675"] }, geometry: { type: "MultiPolygon", coordinates: [[[[141.03157, 2.12829], [140.99813, -6.3233], [140.85295, -6.72996], [140.90448, -6.85033], [141.01763, -6.90181], [141.01842, -9.35091], [141.88934, -9.36111], [142.19246, -9.15378], [142.48658, -9.36754], [143.29772, -9.33993], [143.87386, -9.02382], [145.2855, -9.62524], [156.73836, -14.50464], [154.74815, -7.33315], [155.60735, -6.92266], [155.69784, -6.92661], [155.92557, -6.84664], [156.03993, -6.65703], [156.03296, -6.55528], [160.43769, -4.17974], [141.03157, 2.12829]]]] } },
23377 { type: "Feature", properties: { iso1A2: "PH", iso1A3: "PHL", iso1N3: "608", wikidata: "Q928", nameEn: "Philippines", aliases: ["PI", "RP"], groups: ["035", "142", "UN"], callingCodes: ["63"] }, geometry: { type: "MultiPolygon", coordinates: [[[[129.19694, 7.84182], [121.8109, 21.77688], [120.69238, 21.52331], [118.82252, 14.67191], [115.39742, 10.92666], [116.79524, 7.43869], [117.17735, 7.52841], [117.93857, 6.89845], [117.98544, 6.27477], [119.52945, 5.35672], [118.93936, 4.09009], [118.06469, 4.16638], [121.14448, 2.12444], [129.19694, 7.84182]]]] } },
23378 { type: "Feature", properties: { iso1A2: "PK", iso1A3: "PAK", iso1N3: "586", wikidata: "Q843", nameEn: "Pakistan", groups: ["034", "142", "UN"], driveSide: "left", callingCodes: ["92"] }, geometry: { type: "MultiPolygon", coordinates: [[[[75.72737, 36.7529], [75.45562, 36.71971], [75.40481, 36.95382], [75.13839, 37.02622], [74.56453, 37.03023], [74.53739, 36.96224], [74.43389, 37.00977], [74.04856, 36.82648], [73.82685, 36.91421], [72.6323, 36.84601], [72.18135, 36.71838], [71.80267, 36.49924], [71.60491, 36.39429], [71.19505, 36.04134], [71.37969, 35.95865], [71.55273, 35.71483], [71.49917, 35.6267], [71.65435, 35.4479], [71.54294, 35.31037], [71.5541, 35.28776], [71.67495, 35.21262], [71.52938, 35.09023], [71.55273, 35.02615], [71.49917, 35.00478], [71.50329, 34.97328], [71.29472, 34.87728], [71.28356, 34.80882], [71.08718, 34.69034], [71.11602, 34.63047], [71.0089, 34.54568], [71.02401, 34.44835], [71.17662, 34.36769], [71.12815, 34.26619], [71.13078, 34.16503], [71.09453, 34.13524], [71.09307, 34.11961], [71.06933, 34.10564], [71.07345, 34.06242], [70.88119, 33.97933], [70.54336, 33.9463], [69.90203, 34.04194], [69.87307, 33.9689], [69.85671, 33.93719], [70.00503, 33.73528], [70.14236, 33.71701], [70.14785, 33.6553], [70.20141, 33.64387], [70.17062, 33.53535], [70.32775, 33.34496], [70.13686, 33.21064], [70.07369, 33.22557], [70.02563, 33.14282], [69.85259, 33.09451], [69.79766, 33.13247], [69.71526, 33.09911], [69.57656, 33.09911], [69.49004, 33.01509], [69.49854, 32.88843], [69.5436, 32.8768], [69.47082, 32.85834], [69.38018, 32.76601], [69.43649, 32.7302], [69.44747, 32.6678], [69.38155, 32.56601], [69.2868, 32.53938], [69.23599, 32.45946], [69.27932, 32.29119], [69.27032, 32.14141], [69.3225, 31.93186], [69.20577, 31.85957], [69.11514, 31.70782], [69.00939, 31.62249], [68.95995, 31.64822], [68.91078, 31.59687], [68.79997, 31.61665], [68.6956, 31.75687], [68.57475, 31.83158], [68.44222, 31.76446], [68.27605, 31.75863], [68.25614, 31.80357], [68.1655, 31.82691], [68.00071, 31.6564], [67.86887, 31.63536], [67.72056, 31.52304], [67.58323, 31.52772], [67.62374, 31.40473], [67.7748, 31.4188], [67.78854, 31.33203], [67.29964, 31.19586], [67.03323, 31.24519], [67.04147, 31.31561], [66.83273, 31.26867], [66.72561, 31.20526], [66.68166, 31.07597], [66.58175, 30.97532], [66.42645, 30.95309], [66.39194, 30.9408], [66.28413, 30.57001], [66.34869, 30.404], [66.23609, 30.06321], [66.36042, 29.9583], [66.24175, 29.85181], [65.04005, 29.53957], [64.62116, 29.58903], [64.19796, 29.50407], [64.12966, 29.39157], [63.5876, 29.50456], [62.47751, 29.40782], [60.87231, 29.86514], [61.31508, 29.38903], [61.53765, 29.00507], [61.65978, 28.77937], [61.93581, 28.55284], [62.40259, 28.42703], [62.59499, 28.24842], [62.79412, 28.28108], [62.7638, 28.02992], [62.84905, 27.47627], [62.79684, 27.34381], [62.80604, 27.22412], [63.19649, 27.25674], [63.32283, 27.14437], [63.25005, 27.08692], [63.25005, 26.84212], [63.18688, 26.83844], [63.1889, 26.65072], [62.77352, 26.64099], [62.31484, 26.528], [62.21304, 26.26601], [62.05117, 26.31647], [61.89391, 26.26251], [61.83831, 26.07249], [61.83968, 25.7538], [61.683, 25.66638], [61.6433, 25.27541], [61.46682, 24.57869], [68.11329, 23.53945], [68.20763, 23.85849], [68.39339, 23.96838], [68.74643, 23.97027], [68.7416, 24.31904], [68.90914, 24.33156], [68.97781, 24.26021], [69.07806, 24.29777], [69.19341, 24.25646], [69.29778, 24.28712], [69.59579, 24.29777], [69.73335, 24.17007], [70.03428, 24.172], [70.11712, 24.30915], [70.5667, 24.43787], [70.57906, 24.27774], [70.71502, 24.23517], [70.88393, 24.27398], [70.85784, 24.30903], [70.94985, 24.3791], [71.04461, 24.34657], [71.12838, 24.42662], [71.00341, 24.46038], [70.97594, 24.60904], [71.09405, 24.69017], [70.94002, 24.92843], [70.89148, 25.15064], [70.66695, 25.39314], [70.67382, 25.68186], [70.60378, 25.71898], [70.53649, 25.68928], [70.37444, 25.67443], [70.2687, 25.71156], [70.0985, 25.93238], [70.08193, 26.08094], [70.17532, 26.24118], [70.17532, 26.55362], [70.05584, 26.60398], [69.88555, 26.56836], [69.50904, 26.74892], [69.58519, 27.18109], [70.03136, 27.56627], [70.12502, 27.8057], [70.37307, 28.01208], [70.60927, 28.02178], [70.79054, 27.68423], [71.89921, 27.96035], [71.9244, 28.11555], [72.20329, 28.3869], [72.29495, 28.66367], [72.40402, 28.78283], [72.94272, 29.02487], [73.01337, 29.16422], [73.05886, 29.1878], [73.28094, 29.56646], [73.3962, 29.94707], [73.58665, 30.01848], [73.80299, 30.06969], [73.97225, 30.19829], [73.95736, 30.28466], [73.88993, 30.36305], [74.5616, 31.04153], [74.67971, 31.05479], [74.6852, 31.12771], [74.60006, 31.13711], [74.60281, 31.10419], [74.56023, 31.08303], [74.51629, 31.13829], [74.53223, 31.30321], [74.59773, 31.4136], [74.64713, 31.45605], [74.59319, 31.50197], [74.61517, 31.55698], [74.57498, 31.60382], [74.47771, 31.72227], [74.58907, 31.87824], [74.79919, 31.95983], [74.86236, 32.04485], [74.9269, 32.0658], [75.00793, 32.03786], [75.25649, 32.10187], [75.38046, 32.26836], [75.28259, 32.36556], [75.03265, 32.49538], [74.97634, 32.45367], [74.84725, 32.49075], [74.68362, 32.49298], [74.67431, 32.56676], [74.65251, 32.56416], [74.64424, 32.60985], [74.69542, 32.66792], [74.65345, 32.71225], [74.7113, 32.84219], [74.64675, 32.82604], [74.6289, 32.75561], [74.45312, 32.77755], [74.41467, 32.90563], [74.31227, 32.92795], [74.34875, 32.97823], [74.31854, 33.02891], [74.17571, 33.07495], [74.15374, 33.13477], [74.02144, 33.18908], [74.01366, 33.25199], [74.08782, 33.26232], [74.17983, 33.3679], [74.18121, 33.4745], [74.10115, 33.56392], [74.03576, 33.56718], [73.97367, 33.64061], [73.98968, 33.66155], [73.96423, 33.73071], [74.00891, 33.75437], [74.05898, 33.82089], [74.14001, 33.83002], [74.26086, 33.92237], [74.25262, 34.01577], [74.21554, 34.03853], [73.91341, 34.01235], [73.88732, 34.05105], [73.90677, 34.10504], [73.98208, 34.2522], [73.90517, 34.35317], [73.8475, 34.32935], [73.74862, 34.34183], [73.74999, 34.3781], [73.88732, 34.48911], [73.89419, 34.54568], [73.93951, 34.57169], [73.93401, 34.63386], [73.96423, 34.68244], [74.12897, 34.70073], [74.31239, 34.79626], [74.58083, 34.77386], [74.6663, 34.703], [75.01479, 34.64629], [75.38009, 34.55021], [75.75438, 34.51827], [76.04614, 34.67566], [76.15463, 34.6429], [76.47186, 34.78965], [76.67648, 34.76371], [76.74377, 34.84039], [76.74514, 34.92488], [76.87193, 34.96906], [76.99251, 34.93349], [77.11796, 35.05419], [76.93465, 35.39866], [76.85088, 35.39754], [76.75475, 35.52617], [76.77323, 35.66062], [76.50961, 35.8908], [76.33453, 35.84296], [76.14913, 35.82848], [76.15325, 35.9264], [75.93028, 36.13136], [76.00906, 36.17511], [76.0324, 36.41198], [75.92391, 36.56986], [75.72737, 36.7529]]]] } },
23379 { type: "Feature", properties: { iso1A2: "PL", iso1A3: "POL", iso1N3: "616", wikidata: "Q36", nameEn: "Poland", groups: ["EU", "151", "150", "UN"], callingCodes: ["48"] }, geometry: { type: "MultiPolygon", coordinates: [[[[18.57853, 55.25302], [14.20811, 54.12784], [14.22634, 53.9291], [14.20647, 53.91671], [14.18544, 53.91258], [14.20823, 53.90776], [14.21323, 53.8664], [14.27249, 53.74464], [14.26782, 53.69866], [14.2836, 53.67721], [14.27133, 53.66613], [14.28477, 53.65955], [14.2853, 53.63392], [14.31904, 53.61581], [14.30416, 53.55499], [14.3273, 53.50587], [14.35209, 53.49506], [14.4215, 53.27724], [14.44133, 53.27427], [14.45125, 53.26241], [14.40662, 53.21098], [14.37853, 53.20405], [14.36696, 53.16444], [14.38679, 53.13669], [14.35044, 53.05829], [14.25954, 53.00264], [14.14056, 52.95786], [14.15873, 52.87715], [14.12256, 52.84311], [14.13806, 52.82392], [14.22071, 52.81175], [14.61073, 52.59847], [14.6289, 52.57136], [14.60081, 52.53116], [14.63056, 52.48993], [14.54423, 52.42568], [14.55228, 52.35264], [14.56378, 52.33838], [14.58149, 52.28007], [14.70139, 52.25038], [14.71319, 52.22144], [14.68344, 52.19612], [14.70616, 52.16927], [14.67683, 52.13936], [14.6917, 52.10283], [14.72971, 52.09167], [14.76026, 52.06624], [14.71339, 52.00337], [14.70488, 51.97679], [14.7139, 51.95643], [14.71836, 51.95606], [14.72163, 51.95188], [14.7177, 51.94048], [14.70601, 51.92944], [14.6933, 51.9044], [14.6588, 51.88359], [14.59089, 51.83302], [14.60493, 51.80473], [14.64625, 51.79472], [14.66386, 51.73282], [14.69065, 51.70842], [14.75392, 51.67445], [14.75759, 51.62318], [14.7727, 51.61263], [14.71125, 51.56209], [14.73047, 51.54606], [14.72652, 51.53902], [14.73219, 51.52922], [14.94749, 51.47155], [14.9652, 51.44793], [14.96899, 51.38367], [14.98008, 51.33449], [15.04288, 51.28387], [15.01242, 51.21285], [15.0047, 51.16874], [14.99311, 51.16249], [14.99414, 51.15813], [15.00083, 51.14974], [14.99646, 51.14365], [14.99079, 51.14284], [14.99689, 51.12205], [14.98229, 51.11354], [14.97938, 51.07742], [14.95529, 51.04552], [14.92942, 50.99744], [14.89252, 50.94999], [14.89681, 50.9422], [14.81664, 50.88148], [14.82803, 50.86966], [14.99852, 50.86817], [15.01088, 50.97984], [14.96419, 50.99108], [15.02433, 51.0242], [15.03895, 51.0123], [15.06218, 51.02269], [15.10152, 51.01095], [15.11937, 50.99021], [15.16744, 51.01959], [15.1743, 50.9833], [15.2361, 50.99886], [15.27043, 50.97724], [15.2773, 50.8907], [15.36656, 50.83956], [15.3803, 50.77187], [15.43798, 50.80833], [15.73186, 50.73885], [15.81683, 50.75666], [15.87331, 50.67188], [15.97219, 50.69799], [16.0175, 50.63009], [15.98317, 50.61528], [16.02437, 50.60046], [16.10265, 50.66405], [16.20839, 50.63096], [16.23174, 50.67101], [16.33611, 50.66579], [16.44597, 50.58041], [16.34572, 50.49575], [16.31413, 50.50274], [16.19526, 50.43291], [16.21585, 50.40627], [16.22821, 50.41054], [16.28118, 50.36891], [16.30289, 50.38292], [16.36495, 50.37679], [16.3622, 50.34875], [16.39379, 50.3207], [16.42674, 50.32509], [16.56407, 50.21009], [16.55446, 50.16613], [16.63137, 50.1142], [16.7014, 50.09659], [16.8456, 50.20834], [16.98018, 50.24172], [17.00353, 50.21449], [17.02825, 50.23118], [16.99803, 50.25753], [17.02138, 50.27772], [16.99803, 50.30316], [16.94448, 50.31281], [16.90877, 50.38642], [16.85933, 50.41093], [16.89229, 50.45117], [17.1224, 50.39494], [17.14498, 50.38117], [17.19579, 50.38817], [17.19991, 50.3654], [17.27681, 50.32246], [17.34273, 50.32947], [17.34548, 50.2628], [17.3702, 50.28123], [17.58889, 50.27837], [17.67764, 50.28977], [17.69292, 50.32859], [17.74648, 50.29966], [17.72176, 50.25665], [17.76296, 50.23382], [17.70528, 50.18812], [17.59404, 50.16437], [17.66683, 50.10275], [17.6888, 50.12037], [17.7506, 50.07896], [17.77669, 50.02253], [17.86886, 49.97452], [18.00191, 50.01723], [18.04585, 50.01194], [18.04585, 50.03311], [18.00396, 50.04954], [18.03212, 50.06574], [18.07898, 50.04535], [18.10628, 50.00223], [18.20241, 49.99958], [18.21752, 49.97309], [18.27107, 49.96779], [18.27794, 49.93863], [18.31914, 49.91565], [18.33278, 49.92415], [18.33562, 49.94747], [18.41604, 49.93498], [18.53423, 49.89906], [18.54495, 49.9079], [18.54299, 49.92537], [18.57697, 49.91565], [18.57045, 49.87849], [18.60341, 49.86256], [18.57183, 49.83334], [18.61278, 49.7618], [18.61368, 49.75426], [18.62645, 49.75002], [18.62943, 49.74603], [18.62676, 49.71983], [18.69817, 49.70473], [18.72838, 49.68163], [18.80479, 49.6815], [18.84786, 49.5446], [18.84521, 49.51672], [18.94536, 49.52143], [18.97283, 49.49914], [18.9742, 49.39557], [19.18019, 49.41165], [19.25435, 49.53391], [19.36009, 49.53747], [19.37795, 49.574], [19.45348, 49.61583], [19.52626, 49.57311], [19.53313, 49.52856], [19.57845, 49.46077], [19.64162, 49.45184], [19.6375, 49.40897], [19.72127, 49.39288], [19.78581, 49.41701], [19.82237, 49.27806], [19.75286, 49.20751], [19.86409, 49.19316], [19.90529, 49.23532], [19.98494, 49.22904], [20.08238, 49.1813], [20.13738, 49.31685], [20.21977, 49.35265], [20.31453, 49.34817], [20.31728, 49.39914], [20.39939, 49.3896], [20.46422, 49.41612], [20.5631, 49.375], [20.61666, 49.41791], [20.72274, 49.41813], [20.77971, 49.35383], [20.9229, 49.29626], [20.98733, 49.30774], [21.09799, 49.37176], [21.041, 49.41791], [21.12477, 49.43666], [21.19756, 49.4054], [21.27858, 49.45988], [21.43376, 49.41433], [21.62328, 49.4447], [21.77983, 49.35443], [21.82927, 49.39467], [21.96385, 49.3437], [22.04427, 49.22136], [22.56155, 49.08865], [22.89122, 49.00725], [22.86336, 49.10513], [22.72009, 49.20288], [22.748, 49.32759], [22.69444, 49.49378], [22.64534, 49.53094], [22.78304, 49.65543], [22.80261, 49.69098], [22.83179, 49.69875], [22.99329, 49.84249], [23.28221, 50.0957], [23.67635, 50.33385], [23.71382, 50.38248], [23.79445, 50.40481], [23.99563, 50.41289], [24.03668, 50.44507], [24.07048, 50.5071], [24.0996, 50.60752], [24.0595, 50.71625], [23.95925, 50.79271], [23.99254, 50.83847], [24.0952, 50.83262], [24.14524, 50.86128], [24.04576, 50.90196], [23.92217, 51.00836], [23.90376, 51.07697], [23.80678, 51.18405], [23.63858, 51.32182], [23.69905, 51.40871], [23.62751, 51.50512], [23.56236, 51.53673], [23.57053, 51.55938], [23.53198, 51.74298], [23.62691, 51.78208], [23.61523, 51.92066], [23.68733, 51.9906], [23.64066, 52.07626], [23.61, 52.11264], [23.54314, 52.12148], [23.47859, 52.18215], [23.20071, 52.22848], [23.18196, 52.28812], [23.34141, 52.44845], [23.45112, 52.53774], [23.58296, 52.59868], [23.73615, 52.6149], [23.93763, 52.71332], [23.91805, 52.94016], [23.94689, 52.95919], [23.92184, 53.02079], [23.87548, 53.0831], [23.91393, 53.16469], [23.85657, 53.22923], [23.81995, 53.24131], [23.62004, 53.60942], [23.51284, 53.95052], [23.48261, 53.98855], [23.52702, 54.04622], [23.49196, 54.14764], [23.45223, 54.17775], [23.42418, 54.17911], [23.39525, 54.21672], [23.3494, 54.25155], [23.24656, 54.25701], [23.15938, 54.29894], [23.15526, 54.31076], [23.13905, 54.31567], [23.104, 54.29794], [23.04323, 54.31567], [23.05726, 54.34565], [22.99649, 54.35927], [23.00584, 54.38514], [22.83756, 54.40827], [22.79705, 54.36264], [21.41123, 54.32395], [20.63871, 54.3706], [19.8038, 54.44203], [19.64312, 54.45423], [18.57853, 55.25302]]]] } },
23380 { type: "Feature", properties: { iso1A2: "PM", iso1A3: "SPM", iso1N3: "666", wikidata: "Q34617", nameEn: "Saint Pierre and Miquelon", country: "FR", groups: ["EU", "Q1451600", "021", "003", "019", "UN"], callingCodes: ["508"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-56.72993, 46.65575], [-55.90758, 46.6223], [-56.27503, 47.39728], [-56.72993, 46.65575]]]] } },
23381 { type: "Feature", properties: { iso1A2: "PN", iso1A3: "PCN", iso1N3: "612", wikidata: "Q35672", nameEn: "Pitcairn Islands", country: "GB", groups: ["BOTS", "061", "009", "UN"], driveSide: "left", callingCodes: ["64"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-133.59543, -28.4709], [-122.0366, -24.55017], [-133.61511, -21.93325], [-133.59543, -28.4709]]]] } },
23382 { type: "Feature", properties: { iso1A2: "PR", iso1A3: "PRI", iso1N3: "630", wikidata: "Q1183", nameEn: "Puerto Rico", aliases: ["US-PR"], country: "US", groups: ["Q1352230", "029", "003", "419", "019", "UN"], roadSpeedUnit: "mph", callingCodes: ["1 787", "1 939"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-65.27974, 17.56928], [-65.02435, 18.73231], [-67.99519, 18.97186], [-68.23894, 17.84663], [-65.27974, 17.56928]]]] } },
23383 { type: "Feature", properties: { iso1A2: "PS", iso1A3: "PSE", iso1N3: "275", wikidata: "Q219060", nameEn: "Palestine" }, geometry: null },
23384 { type: "Feature", properties: { iso1A2: "PT", iso1A3: "PRT", iso1N3: "620", wikidata: "Q45", nameEn: "Portugal" }, geometry: null },
23385 { type: "Feature", properties: { iso1A2: "PW", iso1A3: "PLW", iso1N3: "585", wikidata: "Q695", nameEn: "Palau", groups: ["057", "009", "UN"], roadSpeedUnit: "mph", callingCodes: ["680"] }, geometry: { type: "MultiPolygon", coordinates: [[[[128.97621, 3.08804], [136.39296, 1.54187], [136.04605, 12.45908], [128.97621, 3.08804]]]] } },
23386 { type: "Feature", properties: { iso1A2: "PY", iso1A3: "PRY", iso1N3: "600", wikidata: "Q733", nameEn: "Paraguay", groups: ["005", "419", "019", "UN"], callingCodes: ["595"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-58.16225, -20.16193], [-58.23216, -19.80058], [-59.06965, -19.29148], [-60.00638, -19.2981], [-61.73723, -19.63958], [-61.93912, -20.10053], [-62.26883, -20.55311], [-62.2757, -21.06657], [-62.64455, -22.25091], [-62.51761, -22.37684], [-62.22768, -22.55807], [-61.9756, -23.0507], [-61.0782, -23.62932], [-60.99754, -23.80934], [-60.28163, -24.04436], [-60.03367, -24.00701], [-59.45482, -24.34787], [-59.33886, -24.49935], [-58.33055, -24.97099], [-58.25492, -24.92528], [-57.80821, -25.13863], [-57.57431, -25.47269], [-57.87176, -25.93604], [-58.1188, -26.16704], [-58.3198, -26.83443], [-58.65321, -27.14028], [-58.59549, -27.29973], [-58.04205, -27.2387], [-56.85337, -27.5165], [-56.18313, -27.29851], [-55.89195, -27.3467], [-55.74475, -27.44485], [-55.59094, -27.32444], [-55.62322, -27.1941], [-55.39611, -26.97679], [-55.25243, -26.93808], [-55.16948, -26.96068], [-55.06351, -26.80195], [-55.00584, -26.78754], [-54.80868, -26.55669], [-54.70732, -26.45099], [-54.69333, -26.37705], [-54.67359, -25.98607], [-54.60664, -25.9691], [-54.62063, -25.91213], [-54.59398, -25.59224], [-54.59509, -25.53696], [-54.60196, -25.48397], [-54.62033, -25.46026], [-54.4423, -25.13381], [-54.28207, -24.07305], [-54.32807, -24.01865], [-54.6238, -23.83078], [-55.02691, -23.97317], [-55.0518, -23.98666], [-55.12292, -23.99669], [-55.41784, -23.9657], [-55.44117, -23.9185], [-55.43585, -23.87157], [-55.5555, -23.28237], [-55.52288, -23.2595], [-55.5446, -23.22811], [-55.63849, -22.95122], [-55.62493, -22.62765], [-55.68742, -22.58407], [-55.6986, -22.56268], [-55.72366, -22.5519], [-55.741, -22.52018], [-55.74941, -22.46436], [-55.8331, -22.29008], [-56.23206, -22.25347], [-56.45893, -22.08072], [-56.5212, -22.11556], [-56.6508, -22.28387], [-57.98625, -22.09157], [-57.94642, -21.73799], [-57.88239, -21.6868], [-57.93492, -21.65505], [-57.84536, -20.93155], [-58.16225, -20.16193]]]] } },
23387 { type: "Feature", properties: { iso1A2: "QA", iso1A3: "QAT", iso1N3: "634", wikidata: "Q846", nameEn: "Qatar", groups: ["145", "142", "UN"], callingCodes: ["974"] }, geometry: { type: "MultiPolygon", coordinates: [[[[50.92992, 24.54396], [51.09638, 24.46907], [51.29972, 24.50747], [51.39468, 24.62785], [51.58834, 24.66608], [51.83108, 24.71675], [51.83682, 26.70231], [50.93865, 26.30758], [50.81266, 25.88946], [50.86149, 25.6965], [50.7801, 25.595], [50.80824, 25.54641], [50.57069, 25.57887], [50.8133, 24.74049], [50.92992, 24.54396]]]] } },
23388 { type: "Feature", properties: { iso1A2: "RE", iso1A3: "REU", iso1N3: "638", wikidata: "Q17070", nameEn: "R\xE9union", country: "FR", groups: ["Q3320166", "EU", "014", "202", "002", "UN"], callingCodes: ["262"] }, geometry: { type: "MultiPolygon", coordinates: [[[[53.37984, -21.23941], [56.73473, -21.9174], [56.62373, -20.2711], [53.37984, -21.23941]]]] } },
23389 { type: "Feature", properties: { iso1A2: "RO", iso1A3: "ROU", iso1N3: "642", wikidata: "Q218", nameEn: "Romania", groups: ["EU", "151", "150", "UN"], callingCodes: ["40"] }, geometry: { type: "MultiPolygon", coordinates: [[[[27.15622, 47.98538], [27.02985, 48.09083], [27.04118, 48.12522], [26.96119, 48.13003], [26.98042, 48.15752], [26.94265, 48.1969], [26.87708, 48.19919], [26.81161, 48.25049], [26.62823, 48.25804], [26.55202, 48.22445], [26.33504, 48.18418], [26.17711, 47.99246], [26.05901, 47.9897], [25.77723, 47.93919], [25.63878, 47.94924], [25.23778, 47.89403], [25.11144, 47.75203], [24.88896, 47.7234], [24.81893, 47.82031], [24.70632, 47.84428], [24.61994, 47.95062], [24.43578, 47.97131], [24.34926, 47.9244], [24.22566, 47.90231], [24.11281, 47.91487], [24.06466, 47.95317], [24.02999, 47.95087], [24.00801, 47.968], [23.98553, 47.96076], [23.96337, 47.96672], [23.94192, 47.94868], [23.89352, 47.94512], [23.8602, 47.9329], [23.80904, 47.98142], [23.75188, 47.99705], [23.66262, 47.98786], [23.63894, 48.00293], [23.5653, 48.00499], [23.52803, 48.01818], [23.4979, 47.96858], [23.33577, 48.0237], [23.27397, 48.08245], [23.15999, 48.12188], [23.1133, 48.08061], [23.08858, 48.00716], [23.0158, 47.99338], [22.92241, 48.02002], [22.94301, 47.96672], [22.89849, 47.95851], [22.77991, 47.87211], [22.76617, 47.8417], [22.67247, 47.7871], [22.46559, 47.76583], [22.41979, 47.7391], [22.31816, 47.76126], [22.00917, 47.50492], [22.03389, 47.42508], [22.01055, 47.37767], [21.94463, 47.38046], [21.78395, 47.11104], [21.648, 47.03902], [21.68645, 46.99595], [21.59581, 46.91628], [21.59307, 46.86935], [21.52028, 46.84118], [21.48935, 46.7577], [21.5151, 46.72147], [21.43926, 46.65109], [21.33214, 46.63035], [21.26929, 46.4993], [21.28061, 46.44941], [21.16872, 46.30118], [21.06572, 46.24897], [20.86797, 46.28884], [20.74574, 46.25467], [20.76085, 46.21002], [20.63863, 46.12728], [20.49718, 46.18721], [20.45377, 46.14405], [20.35573, 46.16629], [20.28324, 46.1438], [20.26068, 46.12332], [20.35862, 45.99356], [20.54818, 45.89939], [20.65645, 45.82801], [20.70069, 45.7493], [20.77416, 45.75601], [20.78446, 45.78522], [20.82364, 45.77738], [20.80361, 45.65875], [20.76798, 45.60969], [20.83321, 45.53567], [20.77217, 45.49788], [20.86026, 45.47295], [20.87948, 45.42743], [21.09894, 45.30144], [21.17612, 45.32566], [21.20392, 45.2677], [21.29398, 45.24148], [21.48278, 45.19557], [21.51299, 45.15345], [21.4505, 45.04294], [21.35855, 45.01941], [21.54938, 44.9327], [21.56328, 44.89502], [21.48202, 44.87199], [21.44013, 44.87613], [21.35643, 44.86364], [21.38802, 44.78133], [21.55007, 44.77304], [21.60019, 44.75208], [21.61942, 44.67059], [21.67504, 44.67107], [21.71692, 44.65349], [21.7795, 44.66165], [21.99364, 44.63395], [22.08016, 44.49844], [22.13234, 44.47444], [22.18315, 44.48179], [22.30844, 44.6619], [22.45301, 44.7194], [22.61917, 44.61489], [22.69196, 44.61587], [22.76749, 44.54446], [22.70981, 44.51852], [22.61368, 44.55719], [22.56493, 44.53419], [22.54021, 44.47836], [22.45436, 44.47258], [22.56012, 44.30712], [22.68166, 44.28206], [22.67173, 44.21564], [23.04988, 44.07694], [23.01674, 44.01946], [22.87873, 43.9844], [22.83753, 43.88055], [22.85314, 43.84452], [23.05288, 43.79494], [23.26772, 43.84843], [23.4507, 43.84936], [23.61687, 43.79289], [23.73978, 43.80627], [24.18149, 43.68218], [24.35364, 43.70211], [24.50264, 43.76314], [24.62281, 43.74082], [24.73542, 43.68523], [24.96682, 43.72693], [25.10718, 43.6831], [25.17144, 43.70261], [25.39528, 43.61866], [25.72792, 43.69263], [25.94911, 43.85745], [26.05584, 43.90925], [26.10115, 43.96908], [26.38764, 44.04356], [26.62712, 44.05698], [26.95141, 44.13555], [27.26845, 44.12602], [27.39757, 44.0141], [27.60834, 44.01206], [27.64542, 44.04958], [27.73468, 43.95326], [27.92008, 44.00761], [27.99558, 43.84193], [28.23293, 43.76], [29.24336, 43.70874], [30.04414, 45.08461], [29.69272, 45.19227], [29.65428, 45.25629], [29.68175, 45.26885], [29.59798, 45.38857], [29.42632, 45.44545], [29.24779, 45.43388], [28.96077, 45.33164], [28.94292, 45.28045], [28.81383, 45.3384], [28.78911, 45.24179], [28.71358, 45.22631], [28.5735, 45.24759], [28.34554, 45.32102], [28.28504, 45.43907], [28.21139, 45.46895], [28.18741, 45.47358], [28.08927, 45.6051], [28.16568, 45.6421], [28.13111, 45.92819], [28.08612, 46.01105], [28.13684, 46.18099], [28.10937, 46.22852], [28.19864, 46.31869], [28.18902, 46.35283], [28.25769, 46.43334], [28.22281, 46.50481], [28.24808, 46.64305], [28.12173, 46.82283], [28.09095, 46.97621], [27.81892, 47.1381], [27.73172, 47.29248], [27.68706, 47.28962], [27.60263, 47.32507], [27.55731, 47.46637], [27.47942, 47.48113], [27.3979, 47.59473], [27.32202, 47.64009], [27.25519, 47.71366], [27.29069, 47.73722], [27.1618, 47.92391], [27.15622, 47.98538]]]] } },
23390 { type: "Feature", properties: { iso1A2: "RS", iso1A3: "SRB", iso1N3: "688", wikidata: "Q403", nameEn: "Serbia", groups: ["039", "150", "UN"], callingCodes: ["381"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.66007, 46.19005], [19.56113, 46.16824], [19.52473, 46.1171], [19.28826, 45.99694], [19.14543, 45.9998], [19.10388, 46.04015], [19.0791, 45.96458], [19.01284, 45.96529], [18.99712, 45.93537], [18.81394, 45.91329], [18.85783, 45.85493], [18.90305, 45.71863], [18.96691, 45.66731], [18.88776, 45.57253], [18.94562, 45.53712], [19.07471, 45.53086], [19.08364, 45.48804], [18.99918, 45.49333], [18.97446, 45.37528], [19.10774, 45.29547], [19.28208, 45.23813], [19.41941, 45.23475], [19.43589, 45.17137], [19.19144, 45.17863], [19.14063, 45.12972], [19.07952, 45.14668], [19.1011, 45.01191], [19.05205, 44.97692], [19.15573, 44.95409], [19.06853, 44.89915], [19.02871, 44.92541], [18.98957, 44.90645], [19.01994, 44.85493], [19.18183, 44.92055], [19.36722, 44.88164], [19.32543, 44.74058], [19.26388, 44.65412], [19.16699, 44.52197], [19.13369, 44.52521], [19.12278, 44.50132], [19.14837, 44.45253], [19.14681, 44.41463], [19.11785, 44.40313], [19.10749, 44.39421], [19.10704, 44.38249], [19.10365, 44.37795], [19.10298, 44.36924], [19.11865, 44.36712], [19.1083, 44.3558], [19.11547, 44.34218], [19.13556, 44.338], [19.13332, 44.31492], [19.16741, 44.28648], [19.18328, 44.28383], [19.20508, 44.2917], [19.23306, 44.26097], [19.26945, 44.26957], [19.32464, 44.27185], [19.34773, 44.23244], [19.3588, 44.18353], [19.40927, 44.16722], [19.43905, 44.13088], [19.47338, 44.15034], [19.48386, 44.14332], [19.47321, 44.1193], [19.51167, 44.08158], [19.55999, 44.06894], [19.57467, 44.04716], [19.61991, 44.05254], [19.61836, 44.01464], [19.56498, 43.99922], [19.52515, 43.95573], [19.38439, 43.96611], [19.24363, 44.01502], [19.23465, 43.98764], [19.3986, 43.79668], [19.5176, 43.71403], [19.50455, 43.58385], [19.42696, 43.57987], [19.41941, 43.54056], [19.36653, 43.60921], [19.33426, 43.58833], [19.2553, 43.5938], [19.24774, 43.53061], [19.22807, 43.5264], [19.22229, 43.47926], [19.44315, 43.38846], [19.48171, 43.32644], [19.52962, 43.31623], [19.54598, 43.25158], [19.62661, 43.2286], [19.64063, 43.19027], [19.76918, 43.16044], [19.79255, 43.11951], [19.92576, 43.08539], [19.96549, 43.11098], [19.98887, 43.0538], [20.04729, 43.02732], [20.05431, 42.99571], [20.12325, 42.96237], [20.14896, 42.99058], [20.16415, 42.97177], [20.34528, 42.90676], [20.35692, 42.8335], [20.40594, 42.84853], [20.43734, 42.83157], [20.53484, 42.8885], [20.48692, 42.93208], [20.59929, 43.01067], [20.64557, 43.00826], [20.69515, 43.09641], [20.59929, 43.20492], [20.68688, 43.21335], [20.73811, 43.25068], [20.82145, 43.26769], [20.88685, 43.21697], [20.83727, 43.17842], [20.96287, 43.12416], [21.00749, 43.13984], [21.05378, 43.10707], [21.08952, 43.13471], [21.14465, 43.11089], [21.16734, 42.99694], [21.2041, 43.02277], [21.23877, 43.00848], [21.23534, 42.95523], [21.2719, 42.8994], [21.32974, 42.90424], [21.36941, 42.87397], [21.44047, 42.87276], [21.39045, 42.74888], [21.47498, 42.74695], [21.59154, 42.72643], [21.58755, 42.70418], [21.6626, 42.67813], [21.75025, 42.70125], [21.79413, 42.65923], [21.75672, 42.62695], [21.7327, 42.55041], [21.70522, 42.54176], [21.7035, 42.51899], [21.62556, 42.45106], [21.64209, 42.41081], [21.62887, 42.37664], [21.59029, 42.38042], [21.57021, 42.3647], [21.53467, 42.36809], [21.5264, 42.33634], [21.56772, 42.30946], [21.58992, 42.25915], [21.70111, 42.23789], [21.77176, 42.2648], [21.84654, 42.3247], [21.91595, 42.30392], [21.94405, 42.34669], [22.02908, 42.29848], [22.16384, 42.32103], [22.29605, 42.37477], [22.29275, 42.34913], [22.34773, 42.31725], [22.45919, 42.33822], [22.47498, 42.3915], [22.51961, 42.3991], [22.55669, 42.50144], [22.43983, 42.56851], [22.4997, 42.74144], [22.43309, 42.82057], [22.54302, 42.87774], [22.74826, 42.88701], [22.78397, 42.98253], [22.89521, 43.03625], [22.98104, 43.11199], [23.00806, 43.19279], [22.89727, 43.22417], [22.82036, 43.33665], [22.53397, 43.47225], [22.47582, 43.6558], [22.41043, 43.69566], [22.35558, 43.81281], [22.41449, 44.00514], [22.61688, 44.06534], [22.61711, 44.16938], [22.67173, 44.21564], [22.68166, 44.28206], [22.56012, 44.30712], [22.45436, 44.47258], [22.54021, 44.47836], [22.56493, 44.53419], [22.61368, 44.55719], [22.70981, 44.51852], [22.76749, 44.54446], [22.69196, 44.61587], [22.61917, 44.61489], [22.45301, 44.7194], [22.30844, 44.6619], [22.18315, 44.48179], [22.13234, 44.47444], [22.08016, 44.49844], [21.99364, 44.63395], [21.7795, 44.66165], [21.71692, 44.65349], [21.67504, 44.67107], [21.61942, 44.67059], [21.60019, 44.75208], [21.55007, 44.77304], [21.38802, 44.78133], [21.35643, 44.86364], [21.44013, 44.87613], [21.48202, 44.87199], [21.56328, 44.89502], [21.54938, 44.9327], [21.35855, 45.01941], [21.4505, 45.04294], [21.51299, 45.15345], [21.48278, 45.19557], [21.29398, 45.24148], [21.20392, 45.2677], [21.17612, 45.32566], [21.09894, 45.30144], [20.87948, 45.42743], [20.86026, 45.47295], [20.77217, 45.49788], [20.83321, 45.53567], [20.76798, 45.60969], [20.80361, 45.65875], [20.82364, 45.77738], [20.78446, 45.78522], [20.77416, 45.75601], [20.70069, 45.7493], [20.65645, 45.82801], [20.54818, 45.89939], [20.35862, 45.99356], [20.26068, 46.12332], [20.09713, 46.17315], [20.03533, 46.14509], [20.01816, 46.17696], [19.93508, 46.17553], [19.81491, 46.1313], [19.66007, 46.19005]]]] } },
23391 { type: "Feature", properties: { iso1A2: "RU", iso1A3: "RUS", iso1N3: "643", wikidata: "Q159", nameEn: "Russia" }, geometry: null },
23392 { type: "Feature", properties: { iso1A2: "RW", iso1A3: "RWA", iso1N3: "646", wikidata: "Q1037", nameEn: "Rwanda", groups: ["014", "202", "002", "UN"], callingCodes: ["250"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.47194, -1.0555], [30.35212, -1.06896], [30.16369, -1.34303], [29.912, -1.48269], [29.82657, -1.31187], [29.59061, -1.39016], [29.53062, -1.40499], [29.45038, -1.5054], [29.36322, -1.50887], [29.24323, -1.66826], [29.24458, -1.69663], [29.11847, -1.90576], [29.17562, -2.12278], [29.105, -2.27043], [29.00051, -2.29001], [28.95642, -2.37321], [28.89601, -2.37321], [28.86826, -2.41888], [28.86846, -2.44866], [28.89132, -2.47557], [28.89342, -2.49017], [28.88846, -2.50493], [28.87497, -2.50887], [28.86209, -2.5231], [28.86193, -2.53185], [28.87943, -2.55165], [28.89288, -2.55848], [28.90226, -2.62385], [28.89793, -2.66111], [28.94346, -2.69124], [29.00357, -2.70596], [29.04081, -2.7416], [29.0562, -2.58632], [29.32234, -2.6483], [29.36805, -2.82933], [29.88237, -2.75105], [29.95911, -2.33348], [30.14034, -2.43626], [30.42933, -2.31064], [30.54501, -2.41404], [30.83915, -2.35795], [30.89303, -2.08223], [30.80802, -1.91477], [30.84079, -1.64652], [30.71974, -1.43244], [30.57123, -1.33264], [30.50889, -1.16412], [30.45116, -1.10641], [30.47194, -1.0555]]]] } },
23393 { type: "Feature", properties: { iso1A2: "SA", iso1A3: "SAU", iso1N3: "682", wikidata: "Q851", nameEn: "Saudi Arabia", groups: ["145", "142", "UN"], callingCodes: ["966"] }, geometry: { type: "MultiPolygon", coordinates: [[[[40.01521, 32.05667], [39.29903, 32.23259], [38.99233, 31.99721], [36.99791, 31.50081], [37.99354, 30.49998], [37.66395, 30.33245], [37.4971, 29.99949], [36.75083, 29.86903], [36.50005, 29.49696], [36.07081, 29.18469], [34.8812, 29.36878], [34.4454, 27.91479], [37.8565, 22.00903], [39.63762, 18.37348], [40.99158, 15.81743], [42.15205, 16.40211], [42.76801, 16.40371], [42.94625, 16.39721], [42.94351, 16.49467], [42.97215, 16.51093], [43.11601, 16.53166], [43.15274, 16.67248], [43.22066, 16.65179], [43.21325, 16.74416], [43.25857, 16.75304], [43.26303, 16.79479], [43.24801, 16.80613], [43.22956, 16.80613], [43.22012, 16.83932], [43.18338, 16.84852], [43.1398, 16.90696], [43.19328, 16.94703], [43.1813, 16.98438], [43.18233, 17.02673], [43.23967, 17.03428], [43.17787, 17.14717], [43.20156, 17.25901], [43.32653, 17.31179], [43.22533, 17.38343], [43.29185, 17.53224], [43.43005, 17.56148], [43.70631, 17.35762], [44.50126, 17.47475], [46.31018, 17.20464], [46.76494, 17.29151], [47.00571, 16.94765], [47.48245, 17.10808], [47.58351, 17.50366], [48.19996, 18.20584], [49.04884, 18.59899], [52.00311, 19.00083], [54.99756, 20.00083], [55.66469, 21.99658], [55.2137, 22.71065], [55.13599, 22.63334], [52.56622, 22.94341], [51.59617, 24.12041], [51.58871, 24.27256], [51.41644, 24.39615], [51.58834, 24.66608], [51.39468, 24.62785], [51.29972, 24.50747], [51.09638, 24.46907], [50.92992, 24.54396], [50.8133, 24.74049], [50.57069, 25.57887], [50.302, 25.87592], [50.26923, 26.08243], [50.38162, 26.53976], [50.71771, 26.73086], [50.37726, 27.89227], [49.98877, 27.87827], [49.00421, 28.81495], [48.42991, 28.53628], [47.70561, 28.5221], [47.59863, 28.66798], [47.58376, 28.83382], [47.46202, 29.0014], [46.5527, 29.10283], [46.42415, 29.05947], [44.72255, 29.19736], [42.97796, 30.48295], [42.97601, 30.72204], [40.01521, 32.05667]]]] } },
23394 { type: "Feature", properties: { iso1A2: "SB", iso1A3: "SLB", iso1N3: "090", wikidata: "Q685", nameEn: "Solomon Islands", groups: ["054", "009", "UN"], driveSide: "left", callingCodes: ["677"] }, geometry: { type: "MultiPolygon", coordinates: [[[[172.71443, -12.01327], [160.43769, -4.17974], [156.03296, -6.55528], [156.03993, -6.65703], [155.92557, -6.84664], [155.69784, -6.92661], [155.60735, -6.92266], [154.74815, -7.33315], [156.73836, -14.50464], [172.71443, -12.01327]]]] } },
23395 { type: "Feature", properties: { iso1A2: "SC", iso1A3: "SYC", iso1N3: "690", wikidata: "Q1042", nameEn: "Seychelles", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["248"] }, geometry: { type: "MultiPolygon", coordinates: [[[[43.75112, -10.38913], [54.83239, -10.93575], [66.3222, 5.65313], [43.75112, -10.38913]]]] } },
23396 { type: "Feature", properties: { iso1A2: "SD", iso1A3: "SDN", iso1N3: "729", wikidata: "Q1049", nameEn: "Sudan", groups: ["015", "002", "UN"], callingCodes: ["249"] }, geometry: { type: "MultiPolygon", coordinates: [[[[37.8565, 22.00903], [34.0765, 22.00501], [33.99686, 21.76784], [33.57251, 21.72406], [33.17563, 22.00405], [24.99885, 21.99535], [24.99794, 19.99661], [23.99715, 20.00038], [23.99539, 19.49944], [23.99997, 15.69575], [23.62785, 15.7804], [23.38812, 15.69649], [23.10792, 15.71297], [22.93201, 15.55107], [22.92579, 15.47007], [22.99584, 15.40105], [22.99584, 15.22989], [22.66115, 14.86308], [22.70474, 14.69149], [22.38562, 14.58907], [22.44944, 14.24986], [22.55997, 14.23024], [22.5553, 14.11704], [22.22995, 13.96754], [22.08674, 13.77863], [22.29689, 13.3731], [22.1599, 13.19281], [22.02914, 13.13976], [21.94819, 13.05637], [21.81432, 12.81362], [21.89371, 12.68001], [21.98711, 12.63292], [22.15679, 12.66634], [22.22684, 12.74682], [22.46345, 12.61925], [22.38873, 12.45514], [22.50548, 12.16769], [22.48369, 12.02766], [22.64092, 12.07485], [22.54907, 11.64372], [22.7997, 11.40424], [22.93124, 11.41645], [22.97249, 11.21955], [22.87758, 10.91915], [23.02221, 10.69235], [23.3128, 10.45214], [23.67164, 9.86923], [23.69155, 9.67566], [24.09319, 9.66572], [24.12744, 9.73784], [24.49389, 9.79962], [24.84653, 9.80643], [24.97739, 9.9081], [25.05688, 10.06776], [25.0918, 10.33718], [25.78141, 10.42599], [25.93163, 10.38159], [25.93241, 10.17941], [26.21338, 9.91545], [26.35815, 9.57946], [26.70685, 9.48735], [27.14427, 9.62858], [27.90704, 9.61323], [28.99983, 9.67155], [29.06988, 9.74826], [29.53844, 9.75133], [29.54, 10.07949], [29.94629, 10.29245], [30.00389, 10.28633], [30.53005, 9.95992], [30.82893, 9.71451], [30.84605, 9.7498], [31.28504, 9.75287], [31.77539, 10.28939], [31.99177, 10.65065], [32.46967, 11.04662], [32.39358, 11.18207], [32.39578, 11.70208], [32.10079, 11.95203], [32.73921, 11.95203], [32.73921, 12.22757], [33.25876, 12.22111], [33.13988, 11.43248], [33.26977, 10.83632], [33.24645, 10.77913], [33.52294, 10.64382], [33.66604, 10.44254], [33.80913, 10.32994], [33.90159, 10.17179], [33.96984, 10.15446], [33.99185, 9.99623], [33.96323, 9.80972], [33.9082, 9.762], [33.87958, 9.49937], [34.10229, 9.50238], [34.08717, 9.55243], [34.13186, 9.7492], [34.20484, 9.9033], [34.22718, 10.02506], [34.32102, 10.11599], [34.34783, 10.23914], [34.2823, 10.53508], [34.4372, 10.781], [34.59062, 10.89072], [34.77383, 10.74588], [34.77532, 10.69027], [34.86618, 10.74588], [34.86916, 10.78832], [34.97491, 10.86147], [34.97789, 10.91559], [34.93172, 10.95946], [35.01215, 11.19626], [34.95704, 11.24448], [35.09556, 11.56278], [35.05832, 11.71158], [35.11492, 11.85156], [35.24302, 11.91132], [35.70476, 12.67101], [36.01458, 12.72478], [36.14268, 12.70879], [36.16651, 12.88019], [36.13374, 12.92665], [36.24545, 13.36759], [36.38993, 13.56459], [36.48824, 13.83954], [36.44653, 13.95666], [36.54376, 14.25597], [36.44337, 15.14963], [36.54276, 15.23478], [36.69761, 15.75323], [36.76371, 15.80831], [36.92193, 16.23451], [36.99777, 17.07172], [37.42694, 17.04041], [37.50967, 17.32199], [38.13362, 17.53906], [38.37133, 17.66269], [38.45916, 17.87167], [38.57727, 17.98125], [39.63762, 18.37348], [37.8565, 22.00903]]]] } },
23397 { type: "Feature", properties: { iso1A2: "SE", iso1A3: "SWE", iso1N3: "752", wikidata: "Q34", nameEn: "Sweden", groups: ["EU", "154", "150", "UN"], callingCodes: ["46"] }, geometry: { type: "MultiPolygon", coordinates: [[[[24.15791, 65.85385], [23.90497, 66.15802], [23.71339, 66.21299], [23.64982, 66.30603], [23.67591, 66.3862], [23.63776, 66.43568], [23.85959, 66.56434], [23.89488, 66.772], [23.98059, 66.79585], [23.98563, 66.84149], [23.56214, 67.17038], [23.58735, 67.20752], [23.54701, 67.25435], [23.75372, 67.29914], [23.75372, 67.43688], [23.39577, 67.46974], [23.54701, 67.59306], [23.45627, 67.85297], [23.65793, 67.9497], [23.40081, 68.05545], [23.26469, 68.15134], [23.15377, 68.14759], [23.10336, 68.26551], [22.73028, 68.40881], [22.00429, 68.50692], [21.03001, 68.88969], [20.90649, 68.89696], [20.85104, 68.93142], [20.91658, 68.96764], [20.78802, 69.03087], [20.55258, 69.06069], [20.0695, 69.04469], [20.28444, 68.93283], [20.33435, 68.80174], [20.22027, 68.67246], [19.95647, 68.55546], [20.22027, 68.48759], [19.93508, 68.35911], [18.97255, 68.52416], [18.63032, 68.50849], [18.39503, 68.58672], [18.1241, 68.53721], [18.13836, 68.20874], [17.90787, 67.96537], [17.30416, 68.11591], [16.7409, 67.91037], [16.38441, 67.52923], [16.12774, 67.52106], [16.09922, 67.4364], [16.39154, 67.21653], [16.35589, 67.06419], [15.37197, 66.48217], [15.49318, 66.28509], [15.05113, 66.15572], [14.53778, 66.12399], [14.50926, 65.31786], [13.64276, 64.58402], [14.11117, 64.46674], [14.16051, 64.18725], [13.98222, 64.00953], [13.23411, 64.09087], [12.74105, 64.02171], [12.14928, 63.59373], [12.19919, 63.47935], [11.98529, 63.27487], [12.19919, 63.00104], [12.07085, 62.6297], [12.29187, 62.25699], [12.14746, 61.7147], [12.40595, 61.57226], [12.57707, 61.56547], [12.86939, 61.35427], [12.69115, 61.06584], [12.2277, 61.02442], [12.59133, 60.50559], [12.52003, 60.13846], [12.36317, 59.99259], [12.15641, 59.8926], [11.87121, 59.86039], [11.92112, 59.69531], [11.69297, 59.59442], [11.8213, 59.24985], [11.65732, 58.90177], [11.45199, 58.89604], [11.4601, 58.99022], [11.34459, 59.11672], [11.15367, 59.07862], [11.08911, 58.98745], [10.64958, 58.89391], [10.40861, 58.38489], [12.16597, 56.60205], [12.07466, 56.29488], [12.65312, 56.04345], [12.6372, 55.91371], [12.88472, 55.63369], [12.60345, 55.42675], [12.84405, 55.13257], [14.28399, 55.1553], [14.89259, 55.5623], [15.79951, 55.54655], [19.64795, 57.06466], [19.84909, 57.57876], [20.5104, 59.15546], [19.08191, 60.19152], [19.23413, 60.61414], [20.15877, 63.06556], [24.14112, 65.39731], [24.15107, 65.81427], [24.14798, 65.83466], [24.15791, 65.85385]]]] } },
23398 { type: "Feature", properties: { iso1A2: "SG", iso1A3: "SGP", iso1N3: "702", wikidata: "Q334", nameEn: "Singapore", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["65"] }, geometry: { type: "MultiPolygon", coordinates: [[[[104.00131, 1.42405], [103.93384, 1.42926], [103.89565, 1.42841], [103.86383, 1.46288], [103.81181, 1.47953], [103.76395, 1.45183], [103.74161, 1.4502], [103.7219, 1.46108], [103.67468, 1.43166], [103.62738, 1.35255], [103.56591, 1.19719], [103.66049, 1.18825], [103.74084, 1.12902], [104.03085, 1.26954], [104.12282, 1.27714], [104.08072, 1.35998], [104.09162, 1.39694], [104.08871, 1.42015], [104.07348, 1.43322], [104.04622, 1.44691], [104.02277, 1.4438], [104.00131, 1.42405]]]] } },
23399 { type: "Feature", properties: { iso1A2: "SH", iso1A3: "SHN", iso1N3: "654", wikidata: "Q192184", nameEn: "Saint Helena, Ascension and Tristan da Cunha", country: "GB" }, geometry: null },
23400 { type: "Feature", properties: { iso1A2: "SI", iso1A3: "SVN", iso1N3: "705", wikidata: "Q215", nameEn: "Slovenia", groups: ["EU", "039", "150", "UN"], callingCodes: ["386"] }, geometry: { type: "MultiPolygon", coordinates: [[[[16.50139, 46.56684], [16.39217, 46.63673], [16.38594, 46.6549], [16.41863, 46.66238], [16.42641, 46.69228], [16.37816, 46.69975], [16.30966, 46.7787], [16.31303, 46.79838], [16.3408, 46.80641], [16.34547, 46.83836], [16.2941, 46.87137], [16.2365, 46.87775], [16.21892, 46.86961], [16.15711, 46.85434], [16.14365, 46.8547], [16.10983, 46.867], [16.05786, 46.83927], [15.99054, 46.82772], [15.99126, 46.78199], [15.98432, 46.74991], [15.99769, 46.7266], [16.02808, 46.71094], [16.04347, 46.68694], [16.04036, 46.6549], [15.99988, 46.67947], [15.98512, 46.68463], [15.94864, 46.68769], [15.87691, 46.7211], [15.8162, 46.71897], [15.78518, 46.70712], [15.76771, 46.69863], [15.73823, 46.70011], [15.72279, 46.69548], [15.69523, 46.69823], [15.67411, 46.70735], [15.6543, 46.70616], [15.6543, 46.69228], [15.6365, 46.6894], [15.63255, 46.68069], [15.62317, 46.67947], [15.59826, 46.68908], [15.54533, 46.66985], [15.55333, 46.64988], [15.54431, 46.6312], [15.46906, 46.61321], [15.45514, 46.63697], [15.41235, 46.65556], [15.23711, 46.63994], [15.14215, 46.66131], [15.01451, 46.641], [14.98024, 46.6009], [14.96002, 46.63459], [14.92283, 46.60848], [14.87129, 46.61], [14.86419, 46.59411], [14.83549, 46.56614], [14.81836, 46.51046], [14.72185, 46.49974], [14.66892, 46.44936], [14.5942, 46.43434], [14.56463, 46.37208], [14.52176, 46.42617], [14.45877, 46.41717], [14.42608, 46.44614], [14.314, 46.43327], [14.28326, 46.44315], [14.15989, 46.43327], [14.12097, 46.47724], [14.04002, 46.49117], [14.00422, 46.48474], [13.89837, 46.52331], [13.7148, 46.5222], [13.68684, 46.43881], [13.59777, 46.44137], [13.5763, 46.42613], [13.5763, 46.40915], [13.47019, 46.3621], [13.43418, 46.35992], [13.44808, 46.33507], [13.37671, 46.29668], [13.42218, 46.20758], [13.47587, 46.22725], [13.56114, 46.2054], [13.56682, 46.18703], [13.64451, 46.18966], [13.66472, 46.17392], [13.64053, 46.13587], [13.57072, 46.09022], [13.50104, 46.05986], [13.49568, 46.04839], [13.50998, 46.04498], [13.49702, 46.01832], [13.47474, 46.00546], [13.50104, 45.98078], [13.52963, 45.96588], [13.56759, 45.96991], [13.58903, 45.99009], [13.62074, 45.98388], [13.63458, 45.98947], [13.64307, 45.98326], [13.6329, 45.94894], [13.63815, 45.93607], [13.61931, 45.91782], [13.60857, 45.89907], [13.59565, 45.89446], [13.58644, 45.88173], [13.57563, 45.8425], [13.58858, 45.83503], [13.59784, 45.8072], [13.66986, 45.79955], [13.8235, 45.7176], [13.83332, 45.70855], [13.83422, 45.68703], [13.87933, 45.65207], [13.9191, 45.6322], [13.8695, 45.60835], [13.86771, 45.59898], [13.84106, 45.58185], [13.78445, 45.5825], [13.74587, 45.59811], [13.7198, 45.59352], [13.6076, 45.64761], [13.45644, 45.59464], [13.56979, 45.4895], [13.62902, 45.45898], [13.67398, 45.4436], [13.7785, 45.46787], [13.81742, 45.43729], [13.88124, 45.42637], [13.90771, 45.45149], [13.97309, 45.45258], [13.99488, 45.47551], [13.96063, 45.50825], [14.00578, 45.52352], [14.07116, 45.48752], [14.20348, 45.46896], [14.22371, 45.50388], [14.24239, 45.50607], [14.26611, 45.48239], [14.27681, 45.4902], [14.32487, 45.47142], [14.36693, 45.48642], [14.49769, 45.54424], [14.5008, 45.60852], [14.53816, 45.6205], [14.57397, 45.67165], [14.60977, 45.66403], [14.59576, 45.62812], [14.69694, 45.57366], [14.68605, 45.53006], [14.71718, 45.53442], [14.80124, 45.49515], [14.81992, 45.45913], [14.90554, 45.47769], [14.92266, 45.52788], [15.02385, 45.48533], [15.05187, 45.49079], [15.16862, 45.42309], [15.27758, 45.46678], [15.33051, 45.45258], [15.38188, 45.48752], [15.30249, 45.53224], [15.29837, 45.5841], [15.27747, 45.60504], [15.31027, 45.6303], [15.34695, 45.63382], [15.34214, 45.64702], [15.38952, 45.63682], [15.4057, 45.64727], [15.34919, 45.71623], [15.30872, 45.69014], [15.25423, 45.72275], [15.40836, 45.79491], [15.47531, 45.79802], [15.47325, 45.8253], [15.52234, 45.82195], [15.57952, 45.84953], [15.64185, 45.82915], [15.66662, 45.84085], [15.70411, 45.8465], [15.68232, 45.86819], [15.68383, 45.88867], [15.67967, 45.90455], [15.70636, 45.92116], [15.70327, 46.00015], [15.71246, 46.01196], [15.72977, 46.04682], [15.62317, 46.09103], [15.6083, 46.11992], [15.59909, 46.14761], [15.64904, 46.19229], [15.6434, 46.21396], [15.67395, 46.22478], [15.75436, 46.21969], [15.75479, 46.20336], [15.78817, 46.21719], [15.79284, 46.25811], [15.97965, 46.30652], [16.07616, 46.3463], [16.07314, 46.36458], [16.05065, 46.3833], [16.05281, 46.39141], [16.14859, 46.40547], [16.18824, 46.38282], [16.30233, 46.37837], [16.30162, 46.40437], [16.27329, 46.41467], [16.27398, 46.42875], [16.25124, 46.48067], [16.23961, 46.49653], [16.26759, 46.50566], [16.26733, 46.51505], [16.29793, 46.5121], [16.37193, 46.55008], [16.38771, 46.53608], [16.44036, 46.5171], [16.5007, 46.49644], [16.52604, 46.47831], [16.59527, 46.47524], [16.52604, 46.5051], [16.52885, 46.53303], [16.50139, 46.56684]]]] } },
23401 { type: "Feature", properties: { iso1A2: "SJ", iso1A3: "SJM", iso1N3: "744", wikidata: "Q842829", nameEn: "Svalbard and Jan Mayen", country: "NO" }, geometry: null },
23402 { type: "Feature", properties: { iso1A2: "SK", iso1A3: "SVK", iso1N3: "703", wikidata: "Q214", nameEn: "Slovakia", groups: ["EU", "151", "150", "UN"], callingCodes: ["421"] }, geometry: { type: "MultiPolygon", coordinates: [[[[19.82237, 49.27806], [19.78581, 49.41701], [19.72127, 49.39288], [19.6375, 49.40897], [19.64162, 49.45184], [19.57845, 49.46077], [19.53313, 49.52856], [19.52626, 49.57311], [19.45348, 49.61583], [19.37795, 49.574], [19.36009, 49.53747], [19.25435, 49.53391], [19.18019, 49.41165], [18.9742, 49.39557], [18.97283, 49.49914], [18.94536, 49.52143], [18.84521, 49.51672], [18.74761, 49.492], [18.67757, 49.50895], [18.6144, 49.49824], [18.57183, 49.51162], [18.53063, 49.49022], [18.54848, 49.47059], [18.44686, 49.39467], [18.4084, 49.40003], [18.4139, 49.36517], [18.36446, 49.3267], [18.18456, 49.28909], [18.15022, 49.24518], [18.1104, 49.08624], [18.06885, 49.03157], [17.91814, 49.01784], [17.87831, 48.92679], [17.77944, 48.92318], [17.73126, 48.87885], [17.7094, 48.86721], [17.5295, 48.81117], [17.45671, 48.85004], [17.3853, 48.80936], [17.29054, 48.85546], [17.19355, 48.87602], [17.11202, 48.82925], [17.00215, 48.70887], [16.93955, 48.60371], [16.94611, 48.53614], [16.85204, 48.44968], [16.8497, 48.38321], [16.83588, 48.3844], [16.83317, 48.38138], [16.84243, 48.35258], [16.90903, 48.32519], [16.89461, 48.31332], [16.97701, 48.17385], [17.02919, 48.13996], [17.05735, 48.14179], [17.09168, 48.09366], [17.07039, 48.0317], [17.16001, 48.00636], [17.23699, 48.02094], [17.71215, 47.7548], [18.02938, 47.75665], [18.29305, 47.73541], [18.56496, 47.76588], [18.66521, 47.76772], [18.74074, 47.8157], [18.8506, 47.82308], [18.76821, 47.87469], [18.76134, 47.97499], [18.82176, 48.04206], [19.01952, 48.07052], [19.23924, 48.0595], [19.28182, 48.08336], [19.47957, 48.09437], [19.52489, 48.19791], [19.63338, 48.25006], [19.92452, 48.1283], [20.24312, 48.2784], [20.29943, 48.26104], [20.5215, 48.53336], [20.83248, 48.5824], [21.11516, 48.49546], [21.44063, 48.58456], [21.6068, 48.50365], [21.67134, 48.3989], [21.72525, 48.34628], [21.8279, 48.33321], [21.83339, 48.36242], [22.14689, 48.4005], [22.16023, 48.56548], [22.21379, 48.6218], [22.34151, 48.68893], [22.42934, 48.92857], [22.48296, 48.99172], [22.54338, 49.01424], [22.56155, 49.08865], [22.04427, 49.22136], [21.96385, 49.3437], [21.82927, 49.39467], [21.77983, 49.35443], [21.62328, 49.4447], [21.43376, 49.41433], [21.27858, 49.45988], [21.19756, 49.4054], [21.12477, 49.43666], [21.041, 49.41791], [21.09799, 49.37176], [20.98733, 49.30774], [20.9229, 49.29626], [20.77971, 49.35383], [20.72274, 49.41813], [20.61666, 49.41791], [20.5631, 49.375], [20.46422, 49.41612], [20.39939, 49.3896], [20.31728, 49.39914], [20.31453, 49.34817], [20.21977, 49.35265], [20.13738, 49.31685], [20.08238, 49.1813], [19.98494, 49.22904], [19.90529, 49.23532], [19.86409, 49.19316], [19.75286, 49.20751], [19.82237, 49.27806]]]] } },
23403 { type: "Feature", properties: { iso1A2: "SL", iso1A3: "SLE", iso1N3: "694", wikidata: "Q1044", nameEn: "Sierra Leone", groups: ["011", "202", "002", "UN"], callingCodes: ["232"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-10.27575, 8.48711], [-10.37257, 8.48941], [-10.54891, 8.31174], [-10.63934, 8.35326], [-10.70565, 8.29235], [-10.61422, 8.5314], [-10.47707, 8.67669], [-10.56197, 8.81225], [-10.5783, 9.06386], [-10.74484, 9.07998], [-10.6534, 9.29919], [-11.2118, 10.00098], [-11.89624, 9.99763], [-11.91023, 9.93927], [-12.12634, 9.87203], [-12.24262, 9.92386], [-12.47254, 9.86834], [-12.76788, 9.3133], [-12.94095, 9.26335], [-13.08953, 9.0409], [-13.18586, 9.0925], [-13.29911, 9.04245], [-14.36218, 8.64107], [-12.15048, 6.15992], [-11.50429, 6.92704], [-11.4027, 6.97746], [-11.29417, 7.21576], [-10.60422, 7.7739], [-10.60492, 8.04072], [-10.57523, 8.04829], [-10.51554, 8.1393], [-10.45023, 8.15627], [-10.35227, 8.15223], [-10.29839, 8.21283], [-10.31635, 8.28554], [-10.30084, 8.30008], [-10.27575, 8.48711]]]] } },
23404 { type: "Feature", properties: { iso1A2: "SM", iso1A3: "SMR", iso1N3: "674", wikidata: "Q238", nameEn: "San Marino", groups: ["039", "150", "UN"], callingCodes: ["378"] }, geometry: { type: "MultiPolygon", coordinates: [[[[12.45648, 43.89369], [12.48771, 43.89706], [12.49429, 43.90973], [12.49247, 43.91774], [12.49724, 43.92248], [12.50269, 43.92363], [12.50496, 43.93017], [12.51553, 43.94096], [12.51427, 43.94897], [12.50655, 43.95796], [12.50875, 43.96198], [12.50622, 43.97131], [12.51109, 43.97201], [12.51064, 43.98165], [12.5154, 43.98508], [12.51463, 43.99122], [12.50678, 43.99113], [12.49406, 43.98492], [12.47853, 43.98052], [12.46205, 43.97463], [12.44684, 43.96597], [12.43662, 43.95698], [12.42005, 43.9578], [12.41414, 43.95273], [12.40415, 43.95485], [12.40506, 43.94325], [12.41165, 43.93769], [12.41551, 43.92984], [12.40733, 43.92379], [12.41233, 43.90956], [12.40935, 43.9024], [12.41641, 43.89991], [12.44184, 43.90498], [12.45648, 43.89369]]]] } },
23405 { type: "Feature", properties: { iso1A2: "SN", iso1A3: "SEN", iso1N3: "686", wikidata: "Q1041", nameEn: "Senegal", groups: ["011", "202", "002", "UN"], callingCodes: ["221"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-14.32144, 16.61495], [-15.00557, 16.64997], [-15.6509, 16.50315], [-16.27016, 16.51565], [-16.4429, 16.20605], [-16.44814, 16.09753], [-16.48967, 16.0496], [-16.50854, 16.09032], [-17.15288, 16.07139], [-18.35085, 14.63444], [-17.43598, 13.59273], [-15.47902, 13.58758], [-15.36504, 13.79313], [-14.93719, 13.80173], [-14.34721, 13.46578], [-13.8955, 13.59126], [-13.79409, 13.34472], [-14.36795, 13.23033], [-15.14917, 13.57989], [-15.26908, 13.37768], [-15.80478, 13.34832], [-15.80355, 13.16729], [-16.69343, 13.16791], [-16.74676, 13.06025], [-17.43966, 13.04579], [-17.4623, 11.92379], [-16.70562, 12.34803], [-16.38191, 12.36449], [-16.20591, 12.46157], [-15.67302, 12.42974], [-15.17582, 12.6847], [-13.70523, 12.68013], [-13.05296, 12.64003], [-13.06603, 12.49342], [-12.87336, 12.51892], [-12.35415, 12.32758], [-11.91331, 12.42008], [-11.46267, 12.44559], [-11.37536, 12.40788], [-11.39935, 12.97808], [-11.63025, 13.39174], [-11.83345, 13.33333], [-12.06897, 13.71049], [-11.93043, 13.84505], [-12.23936, 14.76324], [-13.11029, 15.52116], [-13.43135, 16.09022], [-13.80075, 16.13961], [-14.32144, 16.61495]]]] } },
23406 { type: "Feature", properties: { iso1A2: "SO", iso1A3: "SOM", iso1N3: "706", wikidata: "Q1045", nameEn: "Somalia", groups: ["014", "202", "002", "UN"], callingCodes: ["252"] }, geometry: { type: "MultiPolygon", coordinates: [[[[51.12877, 12.56479], [43.90659, 12.3823], [42.95776, 10.98533], [42.69452, 10.62672], [42.87643, 10.18441], [43.0937, 9.90579], [43.23518, 9.84605], [43.32613, 9.59205], [44.19222, 8.93028], [46.99339, 7.9989], [47.92477, 8.00111], [47.97917, 8.00124], [44.98104, 4.91821], [44.02436, 4.9451], [43.40263, 4.79289], [43.04177, 4.57923], [42.97746, 4.44032], [42.84526, 4.28357], [42.55853, 4.20518], [42.07619, 4.17667], [41.89488, 3.97375], [41.31368, 3.14314], [40.98767, 2.82959], [41.00099, -0.83068], [41.56, -1.59812], [41.56362, -1.66375], [41.75542, -1.85308], [57.49095, 8.14549], [51.12877, 12.56479]]]] } },
23407 { type: "Feature", properties: { iso1A2: "SR", iso1A3: "SUR", iso1N3: "740", wikidata: "Q730", nameEn: "Suriname", groups: ["005", "419", "019", "UN"], driveSide: "left", callingCodes: ["597"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-54.26916, 5.26909], [-54.01877, 5.52789], [-54.01074, 5.68785], [-53.7094, 6.2264], [-56.84822, 6.73257], [-57.31629, 5.33714], [-57.22536, 5.15605], [-57.37442, 5.0208], [-57.8699, 4.89394], [-58.0307, 3.95513], [-57.35891, 3.32121], [-56.70519, 2.02964], [-56.55439, 2.02003], [-56.47045, 1.95135], [-55.99278, 1.83137], [-55.89863, 1.89861], [-55.92159, 2.05236], [-56.13054, 2.27723], [-55.96292, 2.53188], [-55.71493, 2.40342], [-55.01919, 2.564], [-54.6084, 2.32856], [-54.42864, 2.42442], [-54.28534, 2.67798], [-53.9849, 3.58697], [-53.98914, 3.627], [-54.05128, 3.63557], [-54.19367, 3.84387], [-54.38444, 4.13222], [-54.4717, 4.91964], [-54.26916, 5.26909]]]] } },
23408 { type: "Feature", properties: { iso1A2: "SS", iso1A3: "SSD", iso1N3: "728", wikidata: "Q958", nameEn: "South Sudan", groups: ["014", "202", "002", "UN"], callingCodes: ["211"] }, geometry: { type: "MultiPolygon", coordinates: [[[[34.10229, 9.50238], [33.87958, 9.49937], [33.9082, 9.762], [33.96323, 9.80972], [33.99185, 9.99623], [33.96984, 10.15446], [33.90159, 10.17179], [33.80913, 10.32994], [33.66604, 10.44254], [33.52294, 10.64382], [33.24645, 10.77913], [33.26977, 10.83632], [33.13988, 11.43248], [33.25876, 12.22111], [32.73921, 12.22757], [32.73921, 11.95203], [32.10079, 11.95203], [32.39578, 11.70208], [32.39358, 11.18207], [32.46967, 11.04662], [31.99177, 10.65065], [31.77539, 10.28939], [31.28504, 9.75287], [30.84605, 9.7498], [30.82893, 9.71451], [30.53005, 9.95992], [30.00389, 10.28633], [29.94629, 10.29245], [29.54, 10.07949], [29.53844, 9.75133], [29.06988, 9.74826], [28.99983, 9.67155], [27.90704, 9.61323], [27.14427, 9.62858], [26.70685, 9.48735], [26.35815, 9.57946], [26.21338, 9.91545], [25.93241, 10.17941], [25.93163, 10.38159], [25.78141, 10.42599], [25.0918, 10.33718], [25.05688, 10.06776], [24.97739, 9.9081], [24.84653, 9.80643], [24.49389, 9.79962], [24.12744, 9.73784], [24.09319, 9.66572], [23.69155, 9.67566], [23.62179, 9.53823], [23.64981, 9.44303], [23.64358, 9.28637], [23.56263, 9.19418], [23.4848, 9.16959], [23.44744, 8.99128], [23.59065, 8.99743], [23.51905, 8.71749], [24.25691, 8.69288], [24.13238, 8.36959], [24.35965, 8.26177], [24.85156, 8.16933], [24.98855, 7.96588], [25.25319, 7.8487], [25.29214, 7.66675], [25.20649, 7.61115], [25.20337, 7.50312], [25.35281, 7.42595], [25.37461, 7.33024], [25.90076, 7.09549], [26.38022, 6.63493], [26.32729, 6.36272], [26.58259, 6.1987], [26.51721, 6.09655], [27.22705, 5.71254], [27.22705, 5.62889], [27.28621, 5.56382], [27.23017, 5.37167], [27.26886, 5.25876], [27.44012, 5.07349], [27.56656, 4.89375], [27.65462, 4.89375], [27.76469, 4.79284], [27.79551, 4.59976], [28.20719, 4.35614], [28.6651, 4.42638], [28.8126, 4.48784], [29.03054, 4.48784], [29.22207, 4.34297], [29.43341, 4.50101], [29.49726, 4.7007], [29.82087, 4.56246], [29.79666, 4.37809], [30.06964, 4.13221], [30.1621, 4.10586], [30.22374, 3.93896], [30.27658, 3.95653], [30.47691, 3.83353], [30.55396, 3.84451], [30.57378, 3.74567], [30.56277, 3.62703], [30.78512, 3.67097], [30.80713, 3.60506], [30.85997, 3.5743], [30.85153, 3.48867], [30.97601, 3.693], [31.16666, 3.79853], [31.29476, 3.8015], [31.50478, 3.67814], [31.50776, 3.63652], [31.72075, 3.74354], [31.81459, 3.82083], [31.86821, 3.78664], [31.96205, 3.6499], [31.95907, 3.57408], [32.05187, 3.589], [32.08491, 3.56287], [32.08866, 3.53543], [32.19888, 3.50867], [32.20782, 3.6053], [32.41337, 3.748], [32.72021, 3.77327], [32.89746, 3.81339], [33.02852, 3.89296], [33.18356, 3.77812], [33.51264, 3.75068], [33.9873, 4.23316], [34.47601, 4.72162], [35.34151, 5.02364], [35.30992, 4.90402], [35.47843, 4.91872], [35.42366, 4.76969], [35.51424, 4.61643], [35.9419, 4.61933], [35.82118, 4.77382], [35.81968, 5.10757], [35.8576, 5.33413], [35.50792, 5.42431], [35.29938, 5.34042], [35.31188, 5.50106], [35.13058, 5.62118], [35.12611, 5.68937], [35.00546, 5.89387], [34.96227, 6.26415], [35.01738, 6.46991], [34.87736, 6.60161], [34.77459, 6.5957], [34.65096, 6.72589], [34.53776, 6.74808], [34.53925, 6.82794], [34.47669, 6.91076], [34.35753, 6.91963], [34.19369, 7.04382], [34.19369, 7.12807], [34.01495, 7.25664], [34.03878, 7.27437], [34.02984, 7.36449], [33.87642, 7.5491], [33.71407, 7.65983], [33.44745, 7.7543], [33.32531, 7.71297], [33.24637, 7.77939], [33.04944, 7.78989], [33.0006, 7.90333], [33.08401, 8.05822], [33.18083, 8.13047], [33.1853, 8.29264], [33.19721, 8.40317], [33.3119, 8.45474], [33.54575, 8.47094], [33.66938, 8.44442], [33.71407, 8.3678], [33.87195, 8.41938], [33.89579, 8.4842], [34.01346, 8.50041], [34.14453, 8.60204], [34.14304, 9.04654], [34.10229, 9.50238]]]] } },
23409 { type: "Feature", properties: { iso1A2: "ST", iso1A3: "STP", iso1N3: "678", wikidata: "Q1039", nameEn: "S\xE3o Tom\xE9 and Principe", groups: ["017", "202", "002", "UN"], callingCodes: ["239"] }, geometry: { type: "MultiPolygon", coordinates: [[[[4.34149, 1.91417], [6.6507, -0.28606], [7.9035, 1.92304], [4.34149, 1.91417]]]] } },
23410 { type: "Feature", properties: { iso1A2: "SV", iso1A3: "SLV", iso1N3: "222", wikidata: "Q792", nameEn: "El Salvador", groups: ["013", "003", "419", "019", "UN"], callingCodes: ["503"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-89.34776, 14.43013], [-89.39028, 14.44561], [-89.57441, 14.41637], [-89.58814, 14.33165], [-89.50614, 14.26084], [-89.52397, 14.22628], [-89.61844, 14.21937], [-89.70756, 14.1537], [-89.75569, 14.07073], [-89.73251, 14.04133], [-89.76103, 14.02923], [-89.81807, 14.07073], [-89.88937, 14.0396], [-90.10505, 13.85104], [-90.11344, 13.73679], [-90.55276, 12.8866], [-88.11443, 12.63306], [-87.7346, 13.13228], [-87.55124, 13.12523], [-87.69751, 13.25228], [-87.73714, 13.32715], [-87.80177, 13.35689], [-87.84675, 13.41078], [-87.83467, 13.44655], [-87.77354, 13.45767], [-87.73841, 13.44169], [-87.72115, 13.46083], [-87.71657, 13.50577], [-87.78148, 13.52906], [-87.73106, 13.75443], [-87.68821, 13.80829], [-87.7966, 13.91353], [-88.00331, 13.86948], [-88.07641, 13.98447], [-88.23018, 13.99915], [-88.25791, 13.91108], [-88.48982, 13.86458], [-88.49738, 13.97224], [-88.70661, 14.04317], [-88.73182, 14.10919], [-88.815, 14.11652], [-88.85785, 14.17763], [-88.94608, 14.20207], [-89.04187, 14.33644], [-89.34776, 14.43013]]]] } },
23411 { type: "Feature", properties: { iso1A2: "SX", iso1A3: "SXM", iso1N3: "534", wikidata: "Q26273", nameEn: "Sint Maarten", aliases: ["NL-SX"], country: "NL", groups: ["Q1451600", "029", "003", "419", "019", "UN"], callingCodes: ["1 721"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-63.33064, 17.9615], [-63.1055, 17.86651], [-62.93924, 18.02904], [-63.02323, 18.05757], [-63.04039, 18.05619], [-63.0579, 18.06614], [-63.07759, 18.04943], [-63.09686, 18.04608], [-63.11042, 18.05339], [-63.13502, 18.05445], [-63.33064, 17.9615]]]] } },
23412 { type: "Feature", properties: { iso1A2: "SY", iso1A3: "SYR", iso1N3: "760", wikidata: "Q858", nameEn: "Syria", groups: ["145", "142", "UN"], callingCodes: ["963"] }, geometry: { type: "MultiPolygon", coordinates: [[[[42.23683, 37.2863], [42.21548, 37.28026], [42.20454, 37.28715], [42.22381, 37.30238], [42.22257, 37.31395], [42.2112, 37.32491], [42.19301, 37.31323], [42.18225, 37.28569], [42.00894, 37.17209], [41.515, 37.08084], [41.21937, 37.07665], [40.90856, 37.13147], [40.69136, 37.0996], [39.81589, 36.75538], [39.21538, 36.66834], [39.03217, 36.70911], [38.74042, 36.70629], [38.55908, 36.84429], [38.38859, 36.90064], [38.21064, 36.91842], [37.81974, 36.76055], [37.68048, 36.75065], [37.49103, 36.66904], [37.47253, 36.63243], [37.21988, 36.6736], [37.16177, 36.66069], [37.10894, 36.6704], [37.08279, 36.63495], [37.02088, 36.66422], [37.01647, 36.69512], [37.04619, 36.71101], [37.04399, 36.73483], [36.99886, 36.74012], [36.99557, 36.75997], [36.66727, 36.82901], [36.61581, 36.74629], [36.62681, 36.71189], [36.57398, 36.65186], [36.58829, 36.58295], [36.54206, 36.49539], [36.6081, 36.33772], [36.65653, 36.33861], [36.68672, 36.23677], [36.6125, 36.22592], [36.50463, 36.2419], [36.4617, 36.20461], [36.39206, 36.22088], [36.37474, 36.01163], [36.33956, 35.98687], [36.30099, 36.00985], [36.28338, 36.00273], [36.29769, 35.96086], [36.27678, 35.94839], [36.25366, 35.96264], [36.19973, 35.95195], [36.17441, 35.92076], [36.1623, 35.80925], [36.14029, 35.81015], [36.13919, 35.83692], [36.11827, 35.85923], [35.99829, 35.88242], [36.01844, 35.92403], [36.00514, 35.94113], [35.98499, 35.94107], [35.931, 35.92109], [35.51152, 36.10954], [35.48515, 34.70851], [35.97386, 34.63322], [35.98718, 34.64977], [36.29165, 34.62991], [36.32399, 34.69334], [36.35135, 34.68516], [36.35384, 34.65447], [36.42941, 34.62505], [36.46003, 34.6378], [36.45299, 34.59438], [36.41429, 34.61175], [36.39846, 34.55672], [36.3369, 34.52629], [36.34745, 34.5002], [36.4442, 34.50165], [36.46179, 34.46541], [36.55853, 34.41609], [36.53039, 34.3798], [36.56556, 34.31881], [36.60778, 34.31009], [36.58667, 34.27667], [36.59195, 34.2316], [36.62537, 34.20251], [36.5128, 34.09916], [36.50576, 34.05982], [36.41078, 34.05253], [36.28589, 33.91981], [36.38263, 33.86579], [36.3967, 33.83365], [36.14517, 33.85118], [36.06778, 33.82927], [35.9341, 33.6596], [36.05723, 33.57904], [35.94465, 33.52774], [35.94816, 33.47886], [35.88668, 33.43183], [35.82577, 33.40479], [35.81324, 33.36354], [35.77477, 33.33609], [35.813, 33.3172], [35.77513, 33.27342], [35.81295, 33.24841], [35.81647, 33.2028], [35.83846, 33.19397], [35.84285, 33.16673], [35.81911, 33.1336], [35.81911, 33.11077], [35.84802, 33.1031], [35.87188, 32.98028], [35.89298, 32.9456], [35.87012, 32.91976], [35.84021, 32.8725], [35.83758, 32.82817], [35.78745, 32.77938], [35.75983, 32.74803], [35.88405, 32.71321], [35.93307, 32.71966], [35.96633, 32.66237], [36.02239, 32.65911], [36.08074, 32.51463], [36.20379, 32.52751], [36.20875, 32.49529], [36.23948, 32.50108], [36.40959, 32.37908], [36.83946, 32.31293], [38.79171, 33.37328], [40.64314, 34.31604], [40.97676, 34.39788], [41.12388, 34.65742], [41.2345, 34.80049], [41.21654, 35.1508], [41.26569, 35.42708], [41.38184, 35.62502], [41.37027, 35.84095], [41.2564, 36.06012], [41.28864, 36.35368], [41.40058, 36.52502], [41.81736, 36.58782], [42.36697, 37.0627], [42.35724, 37.10998], [42.32313, 37.17814], [42.34735, 37.22548], [42.2824, 37.2798], [42.26039, 37.27017], [42.23683, 37.2863]]]] } },
23413 { type: "Feature", properties: { iso1A2: "SZ", iso1A3: "SWZ", iso1N3: "748", wikidata: "Q1050", nameEn: "Eswatini", aliases: ["Swaziland"], groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["268"] }, geometry: { type: "MultiPolygon", coordinates: [[[[31.86881, -25.99973], [31.4175, -25.71886], [31.31237, -25.7431], [31.13073, -25.91558], [30.95819, -26.26303], [30.78927, -26.48271], [30.81101, -26.84722], [30.88826, -26.79622], [30.97757, -26.92706], [30.96088, -27.0245], [31.15027, -27.20151], [31.49834, -27.31549], [31.97592, -27.31675], [31.97463, -27.11057], [32.00893, -26.8096], [32.09664, -26.80721], [32.13315, -26.84345], [32.13409, -26.5317], [32.07352, -26.40185], [32.10435, -26.15656], [32.08599, -26.00978], [32.00916, -25.999], [31.974, -25.95387], [31.86881, -25.99973]]]] } },
23414 { type: "Feature", properties: { iso1A2: "TA", iso1A3: "TAA", wikidata: "Q220982", nameEn: "Tristan da Cunha", aliases: ["SH-TA"], country: "GB", groups: ["SH", "BOTS", "011", "202", "002", "UN"], isoStatus: "excRes", driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["290 8", "44 20"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-13.38232, -34.07258], [-16.67337, -41.9188], [-5.88482, -41.4829], [-13.38232, -34.07258]]]] } },
23415 { type: "Feature", properties: { iso1A2: "TC", iso1A3: "TCA", iso1N3: "796", wikidata: "Q18221", nameEn: "Turks and Caicos Islands", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 649"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.70065, 25.7637], [-72.98446, 20.4801], [-69.80718, 21.35956], [-71.70065, 25.7637]]]] } },
23416 { type: "Feature", properties: { iso1A2: "TD", iso1A3: "TCD", iso1N3: "148", wikidata: "Q657", nameEn: "Chad", groups: ["017", "202", "002", "UN"], callingCodes: ["235"] }, geometry: { type: "MultiPolygon", coordinates: [[[[23.99539, 19.49944], [15.99566, 23.49639], [14.99751, 23.00539], [15.19692, 21.99339], [15.20213, 21.49365], [15.28332, 21.44557], [15.62515, 20.95395], [15.57248, 20.92138], [15.55382, 20.86507], [15.56004, 20.79488], [15.59841, 20.74039], [15.6721, 20.70069], [15.99632, 20.35364], [15.75098, 19.93002], [15.6032, 18.77402], [15.50373, 16.89649], [14.37425, 15.72591], [13.86301, 15.04043], [13.78991, 14.87519], [13.809, 14.72915], [13.67878, 14.64013], [13.68573, 14.55276], [13.48259, 14.46704], [13.47559, 14.40881], [13.6302, 13.71094], [14.08251, 13.0797], [14.46881, 13.08259], [14.56101, 12.91036], [14.55058, 12.78256], [14.83314, 12.62963], [14.90827, 12.3269], [14.89019, 12.16593], [14.96952, 12.0925], [15.00146, 12.1223], [15.0349, 12.10698], [15.05786, 12.0608], [15.04808, 11.8731], [15.11579, 11.79313], [15.06595, 11.71126], [15.13149, 11.5537], [15.0585, 11.40481], [15.10021, 11.04101], [15.04957, 11.02347], [15.09127, 10.87431], [15.06737, 10.80921], [15.15532, 10.62846], [15.14936, 10.53915], [15.23724, 10.47764], [15.30874, 10.31063], [15.50535, 10.1098], [15.68761, 9.99344], [15.41408, 9.92876], [15.24618, 9.99246], [15.14043, 9.99246], [15.05999, 9.94845], [14.95722, 9.97926], [14.80082, 9.93818], [14.4673, 10.00264], [14.20411, 10.00055], [14.1317, 9.82413], [14.01793, 9.73169], [13.97544, 9.6365], [14.37094, 9.2954], [14.35707, 9.19611], [14.83566, 8.80557], [15.09484, 8.65982], [15.20426, 8.50892], [15.50743, 7.79302], [15.59272, 7.7696], [15.56964, 7.58936], [15.49743, 7.52179], [15.73118, 7.52006], [15.79942, 7.44149], [16.40703, 7.68809], [16.41583, 7.77971], [16.58315, 7.88657], [16.59415, 7.76444], [16.658, 7.75353], [16.6668, 7.67281], [16.8143, 7.53971], [17.67288, 7.98905], [17.93926, 7.95853], [18.02731, 8.01085], [18.6085, 8.05009], [18.64153, 8.08714], [18.62612, 8.14163], [18.67455, 8.22226], [18.79783, 8.25929], [19.11044, 8.68172], [18.86388, 8.87971], [19.06421, 9.00367], [20.36748, 9.11019], [20.82979, 9.44696], [21.26348, 9.97642], [21.34934, 9.95907], [21.52766, 10.2105], [21.63553, 10.217], [21.71479, 10.29932], [21.72139, 10.64136], [22.45889, 11.00246], [22.87758, 10.91915], [22.97249, 11.21955], [22.93124, 11.41645], [22.7997, 11.40424], [22.54907, 11.64372], [22.64092, 12.07485], [22.48369, 12.02766], [22.50548, 12.16769], [22.38873, 12.45514], [22.46345, 12.61925], [22.22684, 12.74682], [22.15679, 12.66634], [21.98711, 12.63292], [21.89371, 12.68001], [21.81432, 12.81362], [21.94819, 13.05637], [22.02914, 13.13976], [22.1599, 13.19281], [22.29689, 13.3731], [22.08674, 13.77863], [22.22995, 13.96754], [22.5553, 14.11704], [22.55997, 14.23024], [22.44944, 14.24986], [22.38562, 14.58907], [22.70474, 14.69149], [22.66115, 14.86308], [22.99584, 15.22989], [22.99584, 15.40105], [22.92579, 15.47007], [22.93201, 15.55107], [23.10792, 15.71297], [23.38812, 15.69649], [23.62785, 15.7804], [23.99997, 15.69575], [23.99539, 19.49944]]]] } },
23417 { type: "Feature", properties: { iso1A2: "TF", iso1A3: "ATF", iso1N3: "260", wikidata: "Q129003", nameEn: "French Southern Territories", country: "FR", groups: ["EU", "UN"] }, geometry: null },
23418 { type: "Feature", properties: { iso1A2: "TG", iso1A3: "TGO", iso1N3: "768", wikidata: "Q945", nameEn: "Togo", groups: ["011", "202", "002", "UN"], callingCodes: ["228"] }, geometry: { type: "MultiPolygon", coordinates: [[[[0.50388, 11.01011], [-0.13493, 11.14075], [-0.14462, 11.10811], [-0.05733, 11.08628], [-0.0275, 11.11202], [-514e-5, 11.10763], [342e-5, 11.08317], [0.02395, 11.06229], [0.03355, 10.9807], [-63e-4, 10.96417], [-908e-5, 10.91644], [-0.02685, 10.8783], [-0.0228, 10.81916], [-0.07183, 10.76794], [-0.07327, 10.71845], [-0.09141, 10.7147], [-0.05945, 10.63458], [0.12886, 10.53149], [0.18846, 10.4096], [0.29453, 10.41546], [0.33028, 10.30408], [0.39584, 10.31112], [0.35293, 10.09412], [0.41371, 10.06361], [0.41252, 10.02018], [0.36366, 10.03309], [0.32075, 9.72781], [0.34816, 9.71607], [0.34816, 9.66907], [0.32313, 9.6491], [0.28261, 9.69022], [0.26712, 9.66437], [0.29334, 9.59387], [0.36008, 9.6256], [0.38153, 9.58682], [0.23851, 9.57389], [0.2409, 9.52335], [0.30406, 9.521], [0.31241, 9.50337], [0.2254, 9.47869], [0.25758, 9.42696], [0.33148, 9.44812], [0.36485, 9.49749], [0.49118, 9.48339], [0.56388, 9.40697], [0.45424, 9.04581], [0.52455, 8.87746], [0.37319, 8.75262], [0.47211, 8.59945], [0.64731, 8.48866], [0.73432, 8.29529], [0.63897, 8.25873], [0.5913, 8.19622], [0.61156, 8.18324], [0.6056, 8.13959], [0.58891, 8.12779], [0.62943, 7.85751], [0.58295, 7.62368], [0.51979, 7.58706], [0.52455, 7.45354], [0.57223, 7.39326], [0.62943, 7.41099], [0.65327, 7.31643], [0.59606, 7.01252], [0.52217, 6.9723], [0.52098, 6.94391], [0.56508, 6.92971], [0.52853, 6.82921], [0.57406, 6.80348], [0.58176, 6.76049], [0.6497, 6.73682], [0.63659, 6.63857], [0.74862, 6.56517], [0.71048, 6.53083], [0.89283, 6.33779], [0.99652, 6.33779], [1.03108, 6.24064], [1.05969, 6.22998], [1.09187, 6.17074], [1.19966, 6.17069], [1.19771, 6.11522], [1.27574, 5.93551], [1.67336, 6.02702], [1.62913, 6.24075], [1.79826, 6.28221], [1.76906, 6.43189], [1.58105, 6.68619], [1.61812, 6.74843], [1.55877, 6.99737], [1.64249, 6.99562], [1.61838, 9.0527], [1.5649, 9.16941], [1.41746, 9.3226], [1.33675, 9.54765], [1.36624, 9.5951], [1.35507, 9.99525], [0.77666, 10.37665], [0.80358, 10.71459], [0.8804, 10.803], [0.91245, 10.99597], [0.66104, 10.99964], [0.4958, 10.93269], [0.50521, 10.98035], [0.48852, 10.98561], [0.50388, 11.01011]]]] } },
23419 { type: "Feature", properties: { iso1A2: "TH", iso1A3: "THA", iso1N3: "764", wikidata: "Q869", nameEn: "Thailand", groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["66"] }, geometry: { type: "MultiPolygon", coordinates: [[[[100.08404, 20.36626], [99.95721, 20.46301], [99.91616, 20.44986], [99.90499, 20.4487], [99.89692, 20.44789], [99.89301, 20.44311], [99.89168, 20.44548], [99.88451, 20.44596], [99.88211, 20.44488], [99.86383, 20.44371], [99.81096, 20.33687], [99.68255, 20.32077], [99.46008, 20.39673], [99.46077, 20.36198], [99.5569, 20.20676], [99.52943, 20.14811], [99.416, 20.08614], [99.20328, 20.12877], [99.0735, 20.10298], [98.98679, 19.7419], [98.83661, 19.80931], [98.56065, 19.67807], [98.51182, 19.71303], [98.24884, 19.67876], [98.13829, 19.78541], [98.03314, 19.80941], [98.04364, 19.65755], [97.84715, 19.55782], [97.88423, 19.5041], [97.78769, 19.39429], [97.84186, 19.29526], [97.78606, 19.26769], [97.84024, 19.22217], [97.83479, 19.09972], [97.73797, 19.04261], [97.73654, 18.9812], [97.66487, 18.9371], [97.73836, 18.88478], [97.76752, 18.58097], [97.5258, 18.4939], [97.36444, 18.57138], [97.34522, 18.54596], [97.50383, 18.26844], [97.56219, 18.33885], [97.64116, 18.29778], [97.60841, 18.23846], [97.73723, 17.97912], [97.66794, 17.88005], [97.76407, 17.71595], [97.91829, 17.54504], [98.11185, 17.36829], [98.10439, 17.33847], [98.34566, 17.04822], [98.39441, 17.06266], [98.52624, 16.89979], [98.49603, 16.8446], [98.53833, 16.81934], [98.46994, 16.73613], [98.50253, 16.7139], [98.49713, 16.69022], [98.51043, 16.70107], [98.51579, 16.69433], [98.51472, 16.68521], [98.51833, 16.676], [98.51113, 16.64503], [98.5695, 16.62826], [98.57912, 16.55983], [98.63817, 16.47424], [98.68074, 16.27068], [98.84485, 16.42354], [98.92656, 16.36425], [98.8376, 16.11706], [98.69585, 16.13353], [98.57019, 16.04578], [98.59853, 15.87197], [98.541, 15.65406], [98.58598, 15.46821], [98.56027, 15.33471], [98.4866, 15.39154], [98.39351, 15.34177], [98.41906, 15.27103], [98.40522, 15.25268], [98.30446, 15.30667], [98.22, 15.21327], [98.18821, 15.13125], [98.24874, 14.83013], [98.56762, 14.37701], [98.97356, 14.04868], [99.16695, 13.72621], [99.20617, 13.20575], [99.12225, 13.19847], [99.10646, 13.05804], [99.18748, 12.9898], [99.18905, 12.84799], [99.29254, 12.68921], [99.409, 12.60603], [99.47519, 12.1353], [99.56445, 12.14805], [99.53424, 12.02317], [99.64891, 11.82699], [99.64108, 11.78948], [99.5672, 11.62732], [99.47598, 11.62434], [99.39485, 11.3925], [99.31573, 11.32081], [99.32756, 11.28545], [99.06938, 10.94857], [99.02337, 10.97217], [98.99701, 10.92962], [99.0069, 10.85485], [98.86819, 10.78336], [98.78511, 10.68351], [98.77275, 10.62548], [98.81944, 10.52761], [98.7391, 10.31488], [98.55174, 9.92804], [98.52291, 9.92389], [98.47298, 9.95782], [98.33094, 9.91973], [98.12555, 9.44056], [97.63455, 9.60854], [97.19814, 8.18901], [99.31854, 5.99868], [99.50117, 6.44501], [99.91873, 6.50233], [100.0756, 6.4045], [100.12, 6.42105], [100.19511, 6.72559], [100.29651, 6.68439], [100.30828, 6.66462], [100.31618, 6.66781], [100.31884, 6.66423], [100.32671, 6.66526], [100.32607, 6.65933], [100.31929, 6.65413], [100.35413, 6.54932], [100.41152, 6.52299], [100.41791, 6.5189], [100.42351, 6.51762], [100.43027, 6.52389], [100.66986, 6.45086], [100.74361, 6.50811], [100.74822, 6.46231], [100.81045, 6.45086], [100.85884, 6.24929], [101.10313, 6.25617], [101.12618, 6.19431], [101.06165, 6.14161], [101.12388, 6.11411], [101.087, 5.9193], [101.02708, 5.91013], [100.98815, 5.79464], [101.14062, 5.61613], [101.25755, 5.71065], [101.25524, 5.78633], [101.58019, 5.93534], [101.69773, 5.75881], [101.75074, 5.79091], [101.80144, 5.74505], [101.89188, 5.8386], [101.91776, 5.84269], [101.92819, 5.85511], [101.94712, 5.98421], [101.9714, 6.00575], [101.97114, 6.01992], [101.99209, 6.04075], [102.01835, 6.05407], [102.09182, 6.14161], [102.07732, 6.193], [102.08127, 6.22679], [102.09086, 6.23546], [102.46318, 7.22462], [102.47649, 9.66162], [102.52395, 11.25257], [102.91449, 11.65512], [102.90973, 11.75613], [102.83957, 11.8519], [102.78427, 11.98746], [102.77026, 12.06815], [102.70176, 12.1686], [102.73134, 12.37091], [102.78116, 12.40284], [102.7796, 12.43781], [102.57567, 12.65358], [102.51963, 12.66117], [102.4994, 12.71736], [102.53053, 12.77506], [102.49335, 12.92711], [102.48694, 12.97537], [102.52275, 12.99813], [102.46011, 13.08057], [102.43422, 13.09061], [102.36146, 13.26006], [102.36001, 13.31142], [102.34611, 13.35618], [102.35692, 13.38274], [102.35563, 13.47307], [102.361, 13.50551], [102.33828, 13.55613], [102.36859, 13.57488], [102.44601, 13.5637], [102.5358, 13.56933], [102.57573, 13.60461], [102.62483, 13.60883], [102.58635, 13.6286], [102.5481, 13.6589], [102.56848, 13.69366], [102.72727, 13.77806], [102.77864, 13.93374], [102.91251, 14.01531], [102.93275, 14.19044], [103.16469, 14.33075], [103.39353, 14.35639], [103.53518, 14.42575], [103.71109, 14.4348], [103.70175, 14.38052], [103.93836, 14.3398], [104.27616, 14.39861], [104.55014, 14.36091], [104.69335, 14.42726], [104.97667, 14.38806], [105.02804, 14.23722], [105.08408, 14.20402], [105.14012, 14.23873], [105.17748, 14.34432], [105.20894, 14.34967], [105.43783, 14.43865], [105.53864, 14.55731], [105.5121, 14.80802], [105.61162, 15.00037], [105.46661, 15.13132], [105.58043, 15.32724], [105.50662, 15.32054], [105.4692, 15.33709], [105.47635, 15.3796], [105.58191, 15.41031], [105.60446, 15.53301], [105.61756, 15.68792], [105.46573, 15.74742], [105.42285, 15.76971], [105.37959, 15.84074], [105.34115, 15.92737], [105.38508, 15.987], [105.42001, 16.00657], [105.06204, 16.09792], [105.00262, 16.25627], [104.88057, 16.37311], [104.73349, 16.565], [104.76099, 16.69302], [104.7397, 16.81005], [104.76442, 16.84752], [104.7373, 16.91125], [104.73712, 17.01404], [104.80716, 17.19025], [104.80061, 17.39367], [104.69867, 17.53038], [104.45404, 17.66788], [104.35432, 17.82871], [104.2757, 17.86139], [104.21776, 17.99335], [104.10927, 18.10826], [104.06533, 18.21656], [103.97725, 18.33631], [103.93916, 18.33914], [103.85642, 18.28666], [103.82449, 18.33979], [103.699, 18.34125], [103.60957, 18.40528], [103.47773, 18.42841], [103.41044, 18.4486], [103.30977, 18.4341], [103.24779, 18.37807], [103.23818, 18.34875], [103.29757, 18.30475], [103.17093, 18.2618], [103.14994, 18.23172], [103.1493, 18.17799], [103.07343, 18.12351], [103.07823, 18.03833], [103.0566, 18.00144], [103.01998, 17.97095], [102.9912, 17.9949], [102.95812, 18.0054], [102.86323, 17.97531], [102.81988, 17.94233], [102.79044, 17.93612], [102.75954, 17.89561], [102.68538, 17.86653], [102.67543, 17.84529], [102.69946, 17.81686], [102.68194, 17.80151], [102.59485, 17.83537], [102.5896, 17.84889], [102.61432, 17.92273], [102.60971, 17.95411], [102.59234, 17.96127], [102.45523, 17.97106], [102.11359, 18.21532], [101.88485, 18.02474], [101.78087, 18.07559], [101.72294, 17.92867], [101.44667, 17.7392], [101.15108, 17.47586], [100.96541, 17.57926], [101.02185, 17.87637], [101.1793, 18.0544], [101.19118, 18.2125], [101.15108, 18.25624], [101.18227, 18.34367], [101.06047, 18.43247], [101.27585, 18.68875], [101.22832, 18.73377], [101.25803, 18.89545], [101.35606, 19.04716], [101.261, 19.12717], [101.24911, 19.33334], [101.20604, 19.35296], [101.21347, 19.46223], [101.26991, 19.48324], [101.26545, 19.59242], [101.08928, 19.59748], [100.90302, 19.61901], [100.77231, 19.48324], [100.64606, 19.55884], [100.58219, 19.49164], [100.49604, 19.53504], [100.398, 19.75047], [100.5094, 19.87904], [100.58808, 20.15791], [100.55218, 20.17741], [100.51052, 20.14928], [100.47567, 20.19133], [100.4537, 20.19971], [100.44992, 20.23644], [100.41473, 20.25625], [100.37439, 20.35156], [100.33383, 20.4028], [100.25769, 20.3992], [100.22076, 20.31598], [100.16668, 20.2986], [100.1712, 20.24324], [100.11785, 20.24787], [100.09337, 20.26293], [100.09999, 20.31614], [100.08404, 20.36626]]]] } },
23420 { type: "Feature", properties: { iso1A2: "TJ", iso1A3: "TJK", iso1N3: "762", wikidata: "Q863", nameEn: "Tajikistan", groups: ["143", "142", "UN"], callingCodes: ["992"] }, geometry: { type: "MultiPolygon", coordinates: [[[[70.45251, 41.04438], [70.38028, 41.02014], [70.36655, 40.90296], [69.69434, 40.62615], [69.59441, 40.70181], [69.53021, 40.77621], [69.38327, 40.7918], [69.32834, 40.70233], [69.3455, 40.57988], [69.2643, 40.57506], [69.21063, 40.54469], [69.27066, 40.49274], [69.28525, 40.41894], [69.30774, 40.36102], [69.33794, 40.34819], [69.32833, 40.29794], [69.30808, 40.2821], [69.24817, 40.30357], [69.25229, 40.26362], [69.30104, 40.24502], [69.30448, 40.18774], [69.2074, 40.21488], [69.15659, 40.2162], [69.04544, 40.22904], [68.85832, 40.20885], [68.84357, 40.18604], [68.79276, 40.17555], [68.77902, 40.20492], [68.5332, 40.14826], [68.52771, 40.11676], [68.62796, 40.07789], [69.01523, 40.15771], [69.01935, 40.11466], [68.96579, 40.06949], [68.84906, 40.04952], [68.93695, 39.91167], [68.88889, 39.87163], [68.63071, 39.85265], [68.61972, 39.68905], [68.54166, 39.53929], [68.12053, 39.56317], [67.70992, 39.66156], [67.62889, 39.60234], [67.44899, 39.57799], [67.46547, 39.53564], [67.39681, 39.52505], [67.46822, 39.46146], [67.45998, 39.315], [67.36522, 39.31287], [67.33226, 39.23739], [67.67833, 39.14479], [67.68915, 39.00775], [68.09704, 39.02589], [68.19743, 38.85985], [68.06948, 38.82115], [68.12877, 38.73677], [68.05598, 38.71641], [68.0807, 38.64136], [68.05873, 38.56087], [68.11366, 38.47169], [68.06274, 38.39435], [68.13289, 38.40822], [68.40343, 38.19484], [68.27159, 37.91477], [68.12635, 37.93], [67.81566, 37.43107], [67.8474, 37.31594], [67.78329, 37.1834], [67.7803, 37.08978], [67.87917, 37.0591], [68.02194, 36.91923], [68.18542, 37.02074], [68.27605, 37.00977], [68.29253, 37.10621], [68.41201, 37.10402], [68.41888, 37.13906], [68.61851, 37.19815], [68.6798, 37.27906], [68.81438, 37.23862], [68.80889, 37.32494], [68.91189, 37.26704], [68.88168, 37.33368], [68.96407, 37.32603], [69.03274, 37.25174], [69.25152, 37.09426], [69.39529, 37.16752], [69.45022, 37.23315], [69.36645, 37.40462], [69.44954, 37.4869], [69.51888, 37.5844], [69.80041, 37.5746], [69.84435, 37.60616], [69.93362, 37.61378], [69.95971, 37.5659], [70.15015, 37.52519], [70.28243, 37.66706], [70.27694, 37.81258], [70.1863, 37.84296], [70.17206, 37.93276], [70.4898, 38.12546], [70.54673, 38.24541], [70.60407, 38.28046], [70.61526, 38.34774], [70.64966, 38.34999], [70.69189, 38.37031], [70.6761, 38.39144], [70.67438, 38.40597], [70.69807, 38.41861], [70.72485, 38.4131], [70.75455, 38.4252], [70.77132, 38.45548], [70.78581, 38.45502], [70.78702, 38.45031], [70.79766, 38.44944], [70.80521, 38.44447], [70.81697, 38.44507], [70.82538, 38.45394], [70.84376, 38.44688], [70.88719, 38.46826], [70.92728, 38.43021], [70.98693, 38.48862], [71.03545, 38.44779], [71.0556, 38.40176], [71.09542, 38.42517], [71.10592, 38.42077], [71.10957, 38.40671], [71.1451, 38.40106], [71.21291, 38.32797], [71.33114, 38.30339], [71.33869, 38.27335], [71.37803, 38.25641], [71.36444, 38.15358], [71.29878, 38.04429], [71.28922, 38.01272], [71.27622, 37.99946], [71.27278, 37.96496], [71.24969, 37.93031], [71.2809, 37.91995], [71.296, 37.93403], [71.32871, 37.88564], [71.51565, 37.95349], [71.58843, 37.92425], [71.59255, 37.79956], [71.55752, 37.78677], [71.54324, 37.77104], [71.53053, 37.76534], [71.55234, 37.73209], [71.54186, 37.69691], [71.51972, 37.61945], [71.5065, 37.60912], [71.49693, 37.53527], [71.50616, 37.50733], [71.5256, 37.47971], [71.49612, 37.4279], [71.47685, 37.40281], [71.4862, 37.33405], [71.49821, 37.31975], [71.50674, 37.31502], [71.48536, 37.26017], [71.4824, 37.24921], [71.48339, 37.23937], [71.47386, 37.2269], [71.4555, 37.21418], [71.4494, 37.18137], [71.44127, 37.11856], [71.43097, 37.05855], [71.45578, 37.03094], [71.46923, 36.99925], [71.48481, 36.93218], [71.51502, 36.89128], [71.57195, 36.74943], [71.67083, 36.67346], [71.83229, 36.68084], [72.31676, 36.98115], [72.54095, 37.00007], [72.66381, 37.02014], [72.79693, 37.22222], [73.06884, 37.31729], [73.29633, 37.46495], [73.77197, 37.4417], [73.76647, 37.33913], [73.61129, 37.27469], [73.64974, 37.23643], [73.82552, 37.22659], [73.8564, 37.26158], [74.20308, 37.34208], [74.23339, 37.41116], [74.41055, 37.3948], [74.56161, 37.37734], [74.68383, 37.3948], [74.8294, 37.3435], [74.88887, 37.23275], [75.12328, 37.31839], [75.09719, 37.37297], [75.15899, 37.41443], [75.06011, 37.52779], [74.94338, 37.55501], [74.8912, 37.67576], [75.00935, 37.77486], [74.92416, 37.83428], [74.9063, 38.03033], [74.82665, 38.07359], [74.80331, 38.19889], [74.69894, 38.22155], [74.69619, 38.42947], [74.51217, 38.47034], [74.17022, 38.65504], [73.97933, 38.52945], [73.79806, 38.61106], [73.80656, 38.66449], [73.7033, 38.84782], [73.7445, 38.93867], [73.82964, 38.91517], [73.81728, 39.04007], [73.75823, 39.023], [73.60638, 39.24534], [73.54572, 39.27567], [73.55396, 39.3543], [73.5004, 39.38402], [73.59241, 39.40843], [73.59831, 39.46425], [73.45096, 39.46677], [73.31912, 39.38615], [73.18454, 39.35536], [72.85934, 39.35116], [72.62027, 39.39696], [72.33173, 39.33093], [72.23834, 39.17248], [72.17242, 39.2661], [72.09689, 39.26823], [72.04059, 39.36704], [71.90601, 39.27674], [71.79202, 39.27355], [71.7522, 39.32031], [71.80164, 39.40631], [71.76816, 39.45456], [71.62688, 39.44056], [71.5517, 39.45722], [71.55856, 39.57588], [71.49814, 39.61397], [71.08752, 39.50704], [71.06418, 39.41586], [70.7854, 39.38933], [70.64087, 39.58792], [70.44757, 39.60128], [70.2869, 39.53141], [70.11111, 39.58223], [69.87491, 39.53882], [69.68677, 39.59281], [69.3594, 39.52516], [69.26938, 39.8127], [69.35649, 40.01994], [69.43134, 39.98431], [69.43557, 39.92877], [69.53615, 39.93991], [69.5057, 40.03277], [69.53855, 40.0887], [69.53794, 40.11833], [69.55555, 40.12296], [69.57615, 40.10524], [69.64704, 40.12165], [69.67001, 40.10639], [70.01283, 40.23288], [70.58297, 40.00891], [70.57384, 39.99394], [70.47557, 39.93216], [70.55033, 39.96619], [70.58912, 39.95211], [70.65946, 39.9878], [70.65827, 40.0981], [70.7928, 40.12797], [70.80495, 40.16813], [70.9818, 40.22392], [70.8607, 40.217], [70.62342, 40.17396], [70.56394, 40.26421], [70.57149, 40.3442], [70.37511, 40.38605], [70.32626, 40.45174], [70.49871, 40.52503], [70.80009, 40.72825], [70.45251, 41.04438]]], [[[70.68112, 40.90612], [70.6158, 40.97661], [70.56077, 41.00642], [70.54223, 40.98787], [70.57501, 40.98941], [70.6721, 40.90555], [70.68112, 40.90612]]], [[[70.74189, 39.86319], [70.53651, 39.89155], [70.52631, 39.86989], [70.54998, 39.85137], [70.59667, 39.83542], [70.63105, 39.77923], [70.74189, 39.86319]]]] } },
23421 { type: "Feature", properties: { iso1A2: "TK", iso1A3: "TKL", iso1N3: "772", wikidata: "Q36823", nameEn: "Tokelau", country: "NZ", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["690"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-168.251, -9.44289], [-174.18635, -7.80441], [-174.17993, -10.13616], [-168.251, -9.44289]]]] } },
23422 { type: "Feature", properties: { iso1A2: "TL", iso1A3: "TLS", iso1N3: "626", wikidata: "Q574", nameEn: "East Timor", aliases: ["Timor-Leste", "TP"], groups: ["035", "142", "UN"], driveSide: "left", callingCodes: ["670"] }, geometry: { type: "MultiPolygon", coordinates: [[[[124.46701, -9.13002], [124.94011, -8.85617], [124.97742, -9.08128], [125.11764, -8.96359], [125.18632, -9.03142], [125.18907, -9.16434], [125.09434, -9.19669], [125.04044, -9.17093], [124.97892, -9.19281], [125.09025, -9.46406], [125.68138, -9.85176], [127.55165, -9.05052], [127.42116, -8.22471], [125.87691, -8.31789], [125.58506, -7.95311], [124.92337, -8.75859], [124.33472, -9.11416], [124.04628, -9.22671], [124.04286, -9.34243], [124.10539, -9.41206], [124.14517, -9.42324], [124.21247, -9.36904], [124.28115, -9.42189], [124.28115, -9.50453], [124.3535, -9.48493], [124.35258, -9.43002], [124.38554, -9.3582], [124.45971, -9.30263], [124.46701, -9.13002]]]] } },
23423 { type: "Feature", properties: { iso1A2: "TM", iso1A3: "TKM", iso1N3: "795", wikidata: "Q874", nameEn: "Turkmenistan", groups: ["143", "142", "UN"], callingCodes: ["993"] }, geometry: { type: "MultiPolygon", coordinates: [[[[60.5078, 41.21694], [60.06581, 41.4363], [60.18117, 41.60082], [60.06032, 41.76287], [60.08504, 41.80997], [60.33223, 41.75058], [59.95046, 41.97966], [60.0356, 42.01028], [60.04659, 42.08982], [59.96419, 42.1428], [60.00539, 42.212], [59.94633, 42.27655], [59.4341, 42.29738], [59.2955, 42.37064], [59.17317, 42.52248], [58.93422, 42.5407], [58.6266, 42.79314], [58.57991, 42.64988], [58.27504, 42.69632], [58.14321, 42.62159], [58.29427, 42.56497], [58.51674, 42.30348], [58.40688, 42.29535], [58.3492, 42.43335], [57.99214, 42.50021], [57.90975, 42.4374], [57.92897, 42.24047], [57.84932, 42.18555], [57.6296, 42.16519], [57.30275, 42.14076], [57.03633, 41.92043], [56.96218, 41.80383], [57.03359, 41.41777], [57.13796, 41.36625], [57.03423, 41.25435], [56.00314, 41.32584], [55.45471, 41.25609], [54.95182, 41.92424], [54.20635, 42.38477], [52.97575, 42.1308], [52.47884, 41.78034], [52.26048, 41.69249], [51.7708, 40.29239], [53.89734, 37.3464], [54.24565, 37.32047], [54.36211, 37.34912], [54.58664, 37.45809], [54.67247, 37.43532], [54.77822, 37.51597], [54.81804, 37.61285], [54.77684, 37.62264], [54.851, 37.75739], [55.13412, 37.94705], [55.44152, 38.08564], [55.76561, 38.12238], [55.97847, 38.08024], [56.33278, 38.08132], [56.32454, 38.18502], [56.43303, 38.26054], [56.62255, 38.24005], [56.73928, 38.27887], [57.03453, 38.18717], [57.21169, 38.28965], [57.37236, 38.09321], [57.35042, 37.98546], [57.79534, 37.89299], [58.21399, 37.77281], [58.22999, 37.6856], [58.39959, 37.63134], [58.47786, 37.6433], [58.5479, 37.70526], [58.6921, 37.64548], [58.9338, 37.67374], [59.22905, 37.51161], [59.33507, 37.53146], [59.39797, 37.47892], [59.39385, 37.34257], [59.55178, 37.13594], [59.74678, 37.12499], [60.00768, 37.04102], [60.34767, 36.63214], [61.14516, 36.64644], [61.18187, 36.55348], [61.1393, 36.38782], [61.22719, 36.12759], [61.12007, 35.95992], [61.22444, 35.92879], [61.26152, 35.80749], [61.22719, 35.67038], [61.27371, 35.61482], [61.58742, 35.43803], [61.77693, 35.41341], [61.97743, 35.4604], [62.05709, 35.43803], [62.15871, 35.33278], [62.29191, 35.25964], [62.29878, 35.13312], [62.48006, 35.28796], [62.62288, 35.22067], [62.74098, 35.25432], [62.90853, 35.37086], [63.0898, 35.43131], [63.12276, 35.53196], [63.10079, 35.63024], [63.23262, 35.67487], [63.10318, 35.81782], [63.12276, 35.86208], [63.29579, 35.85985], [63.53475, 35.90881], [63.56496, 35.95106], [63.98519, 36.03773], [64.05385, 36.10433], [64.43288, 36.24401], [64.57295, 36.34362], [64.62514, 36.44311], [64.61141, 36.6351], [64.97945, 37.21913], [65.51778, 37.23881], [65.64263, 37.34388], [65.64137, 37.45061], [65.72274, 37.55438], [66.30993, 37.32409], [66.55743, 37.35409], [66.52303, 37.39827], [66.65761, 37.45497], [66.52852, 37.58568], [66.53676, 37.80084], [66.67684, 37.96776], [66.56697, 38.0435], [66.41042, 38.02403], [66.24013, 38.16238], [65.83913, 38.25733], [65.55873, 38.29052], [64.32576, 38.98691], [64.19086, 38.95561], [63.70778, 39.22349], [63.6913, 39.27666], [62.43337, 39.98528], [62.34273, 40.43206], [62.11751, 40.58242], [61.87856, 41.12257], [61.4446, 41.29407], [61.39732, 41.19873], [61.33199, 41.14946], [61.22212, 41.14946], [61.03261, 41.25691], [60.5078, 41.21694]]]] } },
23424 { type: "Feature", properties: { iso1A2: "TN", iso1A3: "TUN", iso1N3: "788", wikidata: "Q948", nameEn: "Tunisia", groups: ["015", "002", "UN"], callingCodes: ["216"] }, geometry: { type: "MultiPolygon", coordinates: [[[[11.2718, 37.6713], [7.89009, 38.19924], [8.59123, 37.14286], [8.64044, 36.9401], [8.62972, 36.86499], [8.67706, 36.8364], [8.57613, 36.78062], [8.46537, 36.7706], [8.47609, 36.66607], [8.16167, 36.48817], [8.18936, 36.44939], [8.40731, 36.42208], [8.2626, 35.91733], [8.26472, 35.73669], [8.35371, 35.66373], [8.36086, 35.47774], [8.30329, 35.29884], [8.47318, 35.23376], [8.3555, 35.10007], [8.30727, 34.95378], [8.25189, 34.92009], [8.29655, 34.72798], [8.20482, 34.57575], [7.86264, 34.3987], [7.81242, 34.21841], [7.74207, 34.16492], [7.66174, 34.20167], [7.52851, 34.06493], [7.54088, 33.7726], [7.73687, 33.42114], [7.83028, 33.18851], [8.11433, 33.10175], [8.1179, 33.05086], [8.31895, 32.83483], [8.35999, 32.50101], [9.07483, 32.07865], [9.55544, 30.23971], [9.76848, 30.34366], [9.88152, 30.34074], [10.29516, 30.90337], [10.12239, 31.42098], [10.31364, 31.72648], [10.48497, 31.72956], [10.62788, 31.96629], [10.7315, 31.97235], [11.04234, 32.2145], [11.53898, 32.4138], [11.57828, 32.48013], [11.46037, 32.6307], [11.51549, 33.09826], [11.55852, 33.1409], [11.58941, 33.36891], [11.2718, 37.6713]]]] } },
23425 { type: "Feature", properties: { iso1A2: "TO", iso1A3: "TON", iso1N3: "776", wikidata: "Q678", nameEn: "Tonga", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["676"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-176.74538, -22.89767], [-180, -22.90585], [-180, -24.21376], [-173.10761, -24.19665], [-173.13438, -14.94228], [-176.76826, -14.95183], [-176.74538, -22.89767]]]] } },
23426 { type: "Feature", properties: { iso1A2: "TR", iso1A3: "TUR", iso1N3: "792", wikidata: "Q43", nameEn: "Turkey", groups: ["145", "142", "UN"], callingCodes: ["90"] }, geometry: { type: "MultiPolygon", coordinates: [[[[41.54366, 41.52185], [40.89217, 41.72528], [34.8305, 42.4581], [28.32297, 41.98371], [28.02971, 41.98066], [27.91479, 41.97902], [27.83492, 41.99709], [27.81235, 41.94803], [27.69949, 41.97515], [27.55191, 41.90928], [27.52379, 41.93756], [27.45478, 41.96591], [27.27411, 42.10409], [27.22376, 42.10152], [27.19251, 42.06028], [27.08486, 42.08735], [27.03277, 42.0809], [26.95638, 42.00741], [26.79143, 41.97386], [26.62996, 41.97644], [26.56051, 41.92995], [26.57961, 41.90024], [26.53968, 41.82653], [26.36952, 41.82265], [26.33589, 41.76802], [26.32952, 41.73637], [26.35957, 41.71149], [26.47958, 41.67037], [26.5209, 41.62592], [26.59196, 41.60491], [26.59742, 41.48058], [26.61767, 41.42281], [26.62997, 41.34613], [26.5837, 41.32131], [26.5209, 41.33993], [26.39861, 41.25053], [26.32259, 41.24929], [26.31928, 41.07386], [26.3606, 41.02027], [26.33297, 40.98388], [26.35894, 40.94292], [26.32259, 40.94042], [26.28623, 40.93005], [26.29441, 40.89119], [26.26169, 40.9168], [26.20856, 40.86048], [26.21351, 40.83298], [26.15685, 40.80709], [26.12854, 40.77339], [26.12495, 40.74283], [26.08638, 40.73214], [26.0754, 40.72772], [26.03489, 40.73051], [25.94795, 40.72797], [26.04292, 40.3958], [25.61285, 40.17161], [25.94257, 39.39358], [26.43357, 39.43096], [26.70773, 39.0312], [26.61814, 38.81372], [26.21136, 38.65436], [26.32173, 38.48731], [26.24183, 38.44695], [26.21136, 38.17558], [27.05537, 37.9131], [27.16428, 37.72343], [26.99377, 37.69034], [26.95583, 37.64989], [27.14757, 37.32], [27.20312, 36.94571], [27.45627, 36.9008], [27.24613, 36.71622], [27.46117, 36.53789], [27.89482, 36.69898], [27.95037, 36.46155], [28.23708, 36.56812], [29.30783, 36.01033], [29.48192, 36.18377], [29.61002, 36.1731], [29.61805, 36.14179], [29.69611, 36.10365], [29.73302, 35.92555], [32.82353, 35.70297], [35.51152, 36.10954], [35.931, 35.92109], [35.98499, 35.94107], [36.00514, 35.94113], [36.01844, 35.92403], [35.99829, 35.88242], [36.11827, 35.85923], [36.13919, 35.83692], [36.14029, 35.81015], [36.1623, 35.80925], [36.17441, 35.92076], [36.19973, 35.95195], [36.25366, 35.96264], [36.27678, 35.94839], [36.29769, 35.96086], [36.28338, 36.00273], [36.30099, 36.00985], [36.33956, 35.98687], [36.37474, 36.01163], [36.39206, 36.22088], [36.4617, 36.20461], [36.50463, 36.2419], [36.6125, 36.22592], [36.68672, 36.23677], [36.65653, 36.33861], [36.6081, 36.33772], [36.54206, 36.49539], [36.58829, 36.58295], [36.57398, 36.65186], [36.62681, 36.71189], [36.61581, 36.74629], [36.66727, 36.82901], [36.99557, 36.75997], [36.99886, 36.74012], [37.04399, 36.73483], [37.04619, 36.71101], [37.01647, 36.69512], [37.02088, 36.66422], [37.08279, 36.63495], [37.10894, 36.6704], [37.16177, 36.66069], [37.21988, 36.6736], [37.47253, 36.63243], [37.49103, 36.66904], [37.68048, 36.75065], [37.81974, 36.76055], [38.21064, 36.91842], [38.38859, 36.90064], [38.55908, 36.84429], [38.74042, 36.70629], [39.03217, 36.70911], [39.21538, 36.66834], [39.81589, 36.75538], [40.69136, 37.0996], [40.90856, 37.13147], [41.21937, 37.07665], [41.515, 37.08084], [42.00894, 37.17209], [42.18225, 37.28569], [42.19301, 37.31323], [42.2112, 37.32491], [42.22257, 37.31395], [42.22381, 37.30238], [42.20454, 37.28715], [42.21548, 37.28026], [42.23683, 37.2863], [42.26039, 37.27017], [42.2824, 37.2798], [42.34735, 37.22548], [42.32313, 37.17814], [42.35724, 37.10998], [42.56725, 37.14878], [42.78887, 37.38615], [42.93705, 37.32015], [43.11403, 37.37436], [43.30083, 37.30629], [43.33508, 37.33105], [43.50787, 37.24436], [43.56702, 37.25675], [43.63085, 37.21957], [43.7009, 37.23692], [43.8052, 37.22825], [43.82699, 37.19477], [43.84878, 37.22205], [43.90949, 37.22453], [44.02002, 37.33229], [44.13521, 37.32486], [44.2613, 37.25055], [44.27998, 37.16501], [44.22239, 37.15756], [44.18503, 37.09551], [44.25975, 36.98119], [44.30645, 36.97373], [44.35937, 37.02843], [44.35315, 37.04955], [44.38117, 37.05825], [44.42631, 37.05825], [44.63179, 37.19229], [44.76698, 37.16162], [44.78319, 37.1431], [44.7868, 37.16644], [44.75986, 37.21549], [44.81021, 37.2915], [44.58449, 37.45018], [44.61401, 37.60165], [44.56887, 37.6429], [44.62096, 37.71985], [44.55498, 37.783], [44.45948, 37.77065], [44.3883, 37.85433], [44.22509, 37.88859], [44.42476, 38.25763], [44.50115, 38.33939], [44.44386, 38.38295], [44.38309, 38.36117], [44.3119, 38.37887], [44.3207, 38.49799], [44.32058, 38.62752], [44.28065, 38.6465], [44.26155, 38.71427], [44.30322, 38.81581], [44.18863, 38.93881], [44.20946, 39.13975], [44.1043, 39.19842], [44.03667, 39.39223], [44.22452, 39.4169], [44.29818, 39.378], [44.37921, 39.4131], [44.42832, 39.4131], [44.41849, 39.56659], [44.48111, 39.61579], [44.47298, 39.68788], [44.6137, 39.78393], [44.65422, 39.72163], [44.71806, 39.71124], [44.81043, 39.62677], [44.80977, 39.65768], [44.75779, 39.7148], [44.61845, 39.8281], [44.46635, 39.97733], [44.26973, 40.04866], [44.1778, 40.02845], [44.1057, 40.03555], [43.92307, 40.01787], [43.65688, 40.11199], [43.65221, 40.14889], [43.71136, 40.16673], [43.59928, 40.34019], [43.60862, 40.43267], [43.54791, 40.47413], [43.63664, 40.54159], [43.7425, 40.66805], [43.74872, 40.7365], [43.67712, 40.84846], [43.67712, 40.93084], [43.58683, 40.98961], [43.47319, 41.02251], [43.44984, 41.0988], [43.4717, 41.12611], [43.44973, 41.17666], [43.36118, 41.2028], [43.23096, 41.17536], [43.1945, 41.25242], [43.13373, 41.25503], [43.21707, 41.30331], [43.02956, 41.37891], [42.8785, 41.50516], [42.84899, 41.47265], [42.78995, 41.50126], [42.84471, 41.58912], [42.72794, 41.59714], [42.59202, 41.58183], [42.51772, 41.43606], [42.26387, 41.49346], [41.95134, 41.52466], [41.81939, 41.43621], [41.7124, 41.47417], [41.7148, 41.4932], [41.54366, 41.52185]]]] } },
23427 { type: "Feature", properties: { iso1A2: "TT", iso1A3: "TTO", iso1N3: "780", wikidata: "Q754", nameEn: "Trinidad and Tobago", groups: ["029", "003", "419", "019", "UN"], driveSide: "left", callingCodes: ["1 868"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-61.62505, 11.18974], [-62.08693, 10.04435], [-60.89962, 9.81445], [-60.07172, 11.77667], [-61.62505, 11.18974]]]] } },
23428 { type: "Feature", properties: { iso1A2: "TV", iso1A3: "TUV", iso1N3: "798", wikidata: "Q672", nameEn: "Tuvalu", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["688"] }, geometry: { type: "MultiPolygon", coordinates: [[[[174, -5], [174, -11.5], [179.99999, -11.5], [179.99999, -5], [174, -5]]]] } },
23429 { type: "Feature", properties: { iso1A2: "TW", iso1A3: "TWN", iso1N3: "158", wikidata: "Q865", nameEn: "Taiwan", aliases: ["RC"], groups: ["030", "142"], callingCodes: ["886"] }, geometry: { type: "MultiPolygon", coordinates: [[[[121.8109, 21.77688], [122.26612, 25.98197], [120.5128, 26.536], [120.0693, 26.3959], [119.78816, 26.2348], [119.98511, 25.37624], [119.42295, 25.0886], [118.6333, 24.46259], [118.42453, 24.54644], [118.35291, 24.51645], [118.28244, 24.51231], [118.11703, 24.39734], [120.69238, 21.52331], [121.8109, 21.77688]]]] } },
23430 { type: "Feature", properties: { iso1A2: "TZ", iso1A3: "TZA", iso1N3: "834", wikidata: "Q924", nameEn: "Tanzania", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["255"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.80408, -0.99911], [30.76635, -0.9852], [30.70631, -1.01175], [30.64166, -1.06601], [30.47194, -1.0555], [30.45116, -1.10641], [30.50889, -1.16412], [30.57123, -1.33264], [30.71974, -1.43244], [30.84079, -1.64652], [30.80802, -1.91477], [30.89303, -2.08223], [30.83915, -2.35795], [30.54501, -2.41404], [30.41789, -2.66266], [30.52747, -2.65841], [30.40662, -2.86151], [30.4987, -2.9573], [30.57926, -2.89791], [30.6675, -2.98987], [30.83823, -2.97837], [30.84165, -3.25152], [30.45915, -3.56532], [30.22042, -4.01738], [30.03323, -4.26631], [29.88172, -4.35743], [29.82885, -4.36153], [29.77289, -4.41733], [29.75109, -4.45836], [29.63827, -4.44681], [29.43673, -4.44845], [29.52552, -6.2731], [30.2567, -7.14121], [30.79243, -8.27382], [31.00796, -8.58615], [31.37533, -8.60769], [31.57147, -8.70619], [31.57147, -8.81388], [31.71158, -8.91386], [31.81587, -8.88618], [31.94663, -8.93846], [31.94196, -9.02303], [31.98866, -9.07069], [32.08206, -9.04609], [32.16146, -9.05993], [32.25486, -9.13371], [32.43543, -9.11988], [32.49147, -9.14754], [32.53661, -9.24281], [32.75611, -9.28583], [32.76233, -9.31963], [32.95389, -9.40138], [32.99397, -9.36712], [33.14925, -9.49322], [33.31581, -9.48554], [33.48052, -9.62442], [33.76677, -9.58516], [33.93298, -9.71647], [33.9638, -9.62206], [33.95829, -9.54066], [34.03865, -9.49398], [34.54499, -10.0678], [34.51911, -10.12279], [34.57581, -10.56271], [34.65946, -10.6828], [34.67047, -10.93796], [34.61161, -11.01611], [34.63305, -11.11731], [34.79375, -11.32245], [34.91153, -11.39799], [34.96296, -11.57354], [35.63599, -11.55927], [35.82767, -11.41081], [36.19094, -11.57593], [36.19094, -11.70008], [36.62068, -11.72884], [36.80309, -11.56836], [37.3936, -11.68949], [37.76614, -11.53352], [37.8388, -11.3123], [37.93618, -11.26228], [38.21598, -11.27289], [38.47258, -11.4199], [38.88996, -11.16978], [39.24395, -11.17433], [39.58249, -10.96043], [40.00295, -10.80255], [40.44265, -10.4618], [40.74206, -10.25691], [40.14328, -4.64201], [39.62121, -4.68136], [39.44306, -4.93877], [39.21631, -4.67835], [37.81321, -3.69179], [37.75036, -3.54243], [37.63099, -3.50723], [37.5903, -3.42735], [37.71745, -3.304], [37.67199, -3.06222], [34.0824, -1.02264], [34.03084, -1.05101], [34.02286, -1.00779], [33.93107, -0.99298], [30.80408, -0.99911]]]] } },
23431 { type: "Feature", properties: { iso1A2: "UA", iso1A3: "UKR", iso1N3: "804", wikidata: "Q212", nameEn: "Ukraine", groups: ["151", "150", "UN"], callingCodes: ["380"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.57318, 46.10317], [33.61467, 46.13561], [33.63854, 46.14147], [33.61517, 46.22615], [33.646, 46.23028], [33.74047, 46.18555], [33.79715, 46.20482], [33.85234, 46.19863], [33.91549, 46.15938], [34.05272, 46.10838], [34.07311, 46.11769], [34.12929, 46.10494], [34.181, 46.06804], [34.25111, 46.0532], [34.33912, 46.06114], [34.41221, 46.00245], [34.44155, 45.95995], [34.48729, 45.94267], [34.52011, 45.95097], [34.55889, 45.99347], [34.60861, 45.99347], [34.66679, 45.97136], [34.75479, 45.90705], [34.80153, 45.90047], [34.79905, 45.81009], [34.96015, 45.75634], [35.23066, 45.79231], [37.62608, 46.82615], [38.12112, 46.86078], [38.3384, 46.98085], [38.22955, 47.12069], [38.23049, 47.2324], [38.32112, 47.2585], [38.33074, 47.30508], [38.22225, 47.30788], [38.28954, 47.39255], [38.28679, 47.53552], [38.35062, 47.61631], [38.76379, 47.69346], [38.79628, 47.81109], [38.87979, 47.87719], [39.73935, 47.82876], [39.82213, 47.96396], [39.77544, 48.04206], [39.88256, 48.04482], [39.83724, 48.06501], [39.94847, 48.22811], [40.00752, 48.22445], [39.99241, 48.31768], [39.97325, 48.31399], [39.9693, 48.29904], [39.95248, 48.29972], [39.91465, 48.26743], [39.90041, 48.3049], [39.84273, 48.30947], [39.84136, 48.33321], [39.94847, 48.35055], [39.88794, 48.44226], [39.86196, 48.46633], [39.84548, 48.57821], [39.79764, 48.58668], [39.67226, 48.59368], [39.71765, 48.68673], [39.73104, 48.7325], [39.79466, 48.83739], [39.97182, 48.79398], [40.08168, 48.87443], [40.03636, 48.91957], [39.98967, 48.86901], [39.78368, 48.91596], [39.74874, 48.98675], [39.72649, 48.9754], [39.71353, 48.98959], [39.6683, 48.99454], [39.6836, 49.05121], [39.93437, 49.05709], [40.01988, 49.1761], [40.22176, 49.25683], [40.18331, 49.34996], [40.14912, 49.37681], [40.1141, 49.38798], [40.03087, 49.45452], [40.03636, 49.52321], [40.16683, 49.56865], [40.13249, 49.61672], [39.84548, 49.56064], [39.65047, 49.61761], [39.59142, 49.73758], [39.44496, 49.76067], [39.27968, 49.75976], [39.1808, 49.88911], [38.9391, 49.79524], [38.90477, 49.86787], [38.73311, 49.90238], [38.68677, 50.00904], [38.65688, 49.97176], [38.35408, 50.00664], [38.32524, 50.08866], [38.18517, 50.08161], [38.21675, 49.98104], [38.02999, 49.90592], [38.02999, 49.94482], [37.90776, 50.04194], [37.79515, 50.08425], [37.75807, 50.07896], [37.61113, 50.21976], [37.62879, 50.24481], [37.62486, 50.29966], [37.47243, 50.36277], [37.48204, 50.46079], [37.08468, 50.34935], [36.91762, 50.34963], [36.69377, 50.26982], [36.64571, 50.218], [36.56655, 50.2413], [36.58371, 50.28563], [36.47817, 50.31457], [36.30101, 50.29088], [36.20763, 50.3943], [36.06893, 50.45205], [35.8926, 50.43829], [35.80388, 50.41356], [35.73659, 50.35489], [35.61711, 50.35707], [35.58003, 50.45117], [35.47463, 50.49247], [35.39464, 50.64751], [35.48116, 50.66405], [35.47704, 50.77274], [35.41367, 50.80227], [35.39307, 50.92145], [35.32598, 50.94524], [35.40837, 51.04119], [35.31774, 51.08434], [35.20375, 51.04723], [35.12685, 51.16191], [35.14058, 51.23162], [34.97304, 51.2342], [34.82472, 51.17483], [34.6874, 51.18], [34.6613, 51.25053], [34.38802, 51.2746], [34.31661, 51.23936], [34.23009, 51.26429], [34.33446, 51.363], [34.22048, 51.4187], [34.30562, 51.5205], [34.17599, 51.63253], [34.07765, 51.67065], [34.42922, 51.72852], [34.41136, 51.82793], [34.09413, 52.00835], [34.11199, 52.14087], [34.05239, 52.20132], [33.78789, 52.37204], [33.55718, 52.30324], [33.48027, 52.31499], [33.51323, 52.35779], [33.18913, 52.3754], [32.89937, 52.2461], [32.85405, 52.27888], [32.69475, 52.25535], [32.54781, 52.32423], [32.3528, 52.32842], [32.38988, 52.24946], [32.33083, 52.23685], [32.34044, 52.1434], [32.2777, 52.10266], [32.23331, 52.08085], [32.08813, 52.03319], [31.92159, 52.05144], [31.96141, 52.08015], [31.85018, 52.11305], [31.81722, 52.09955], [31.7822, 52.11406], [31.38326, 52.12991], [31.25142, 52.04131], [31.13332, 52.1004], [30.95589, 52.07775], [30.90897, 52.00699], [30.76443, 51.89739], [30.68804, 51.82806], [30.51946, 51.59649], [30.64992, 51.35014], [30.56203, 51.25655], [30.36153, 51.33984], [30.34642, 51.42555], [30.17888, 51.51025], [29.77376, 51.4461], [29.7408, 51.53417], [29.54372, 51.48372], [29.49773, 51.39814], [29.42357, 51.4187], [29.32881, 51.37843], [29.25191, 51.49828], [29.25603, 51.57089], [29.20659, 51.56918], [29.16402, 51.64679], [29.1187, 51.65872], [28.99098, 51.56833], [28.95528, 51.59222], [28.81795, 51.55552], [28.76027, 51.48802], [28.78224, 51.45294], [28.75615, 51.41442], [28.73143, 51.46236], [28.69161, 51.44695], [28.64429, 51.5664], [28.47051, 51.59734], [28.37592, 51.54505], [28.23452, 51.66988], [28.10658, 51.57857], [27.95827, 51.56065], [27.91844, 51.61952], [27.85253, 51.62293], [27.76052, 51.47604], [27.67125, 51.50854], [27.71932, 51.60672], [27.55727, 51.63486], [27.51058, 51.5854], [27.47212, 51.61184], [27.24828, 51.60161], [27.26613, 51.65957], [27.20948, 51.66713], [27.20602, 51.77291], [26.99422, 51.76933], [26.9489, 51.73788], [26.80043, 51.75777], [26.69759, 51.82284], [26.46962, 51.80501], [26.39367, 51.87315], [26.19084, 51.86781], [26.00408, 51.92967], [25.83217, 51.92587], [25.80574, 51.94556], [25.73673, 51.91973], [25.46163, 51.92205], [25.20228, 51.97143], [24.98784, 51.91273], [24.37123, 51.88222], [24.29021, 51.80841], [24.3163, 51.75063], [24.13075, 51.66979], [23.99907, 51.58369], [23.8741, 51.59734], [23.91118, 51.63316], [23.7766, 51.66809], [23.60906, 51.62122], [23.6736, 51.50255], [23.62751, 51.50512], [23.69905, 51.40871], [23.63858, 51.32182], [23.80678, 51.18405], [23.90376, 51.07697], [23.92217, 51.00836], [24.04576, 50.90196], [24.14524, 50.86128], [24.0952, 50.83262], [23.99254, 50.83847], [23.95925, 50.79271], [24.0595, 50.71625], [24.0996, 50.60752], [24.07048, 50.5071], [24.03668, 50.44507], [23.99563, 50.41289], [23.79445, 50.40481], [23.71382, 50.38248], [23.67635, 50.33385], [23.28221, 50.0957], [22.99329, 49.84249], [22.83179, 49.69875], [22.80261, 49.69098], [22.78304, 49.65543], [22.64534, 49.53094], [22.69444, 49.49378], [22.748, 49.32759], [22.72009, 49.20288], [22.86336, 49.10513], [22.89122, 49.00725], [22.56155, 49.08865], [22.54338, 49.01424], [22.48296, 48.99172], [22.42934, 48.92857], [22.34151, 48.68893], [22.21379, 48.6218], [22.16023, 48.56548], [22.14689, 48.4005], [22.2083, 48.42534], [22.38133, 48.23726], [22.49806, 48.25189], [22.59007, 48.15121], [22.58733, 48.10813], [22.66835, 48.09162], [22.73427, 48.12005], [22.81804, 48.11363], [22.87847, 48.04665], [22.84276, 47.98602], [22.89849, 47.95851], [22.94301, 47.96672], [22.92241, 48.02002], [23.0158, 47.99338], [23.08858, 48.00716], [23.1133, 48.08061], [23.15999, 48.12188], [23.27397, 48.08245], [23.33577, 48.0237], [23.4979, 47.96858], [23.52803, 48.01818], [23.5653, 48.00499], [23.63894, 48.00293], [23.66262, 47.98786], [23.75188, 47.99705], [23.80904, 47.98142], [23.8602, 47.9329], [23.89352, 47.94512], [23.94192, 47.94868], [23.96337, 47.96672], [23.98553, 47.96076], [24.00801, 47.968], [24.02999, 47.95087], [24.06466, 47.95317], [24.11281, 47.91487], [24.22566, 47.90231], [24.34926, 47.9244], [24.43578, 47.97131], [24.61994, 47.95062], [24.70632, 47.84428], [24.81893, 47.82031], [24.88896, 47.7234], [25.11144, 47.75203], [25.23778, 47.89403], [25.63878, 47.94924], [25.77723, 47.93919], [26.05901, 47.9897], [26.17711, 47.99246], [26.33504, 48.18418], [26.55202, 48.22445], [26.62823, 48.25804], [26.6839, 48.35828], [26.79239, 48.29071], [26.82809, 48.31629], [26.71274, 48.40388], [26.85556, 48.41095], [26.93384, 48.36558], [27.03821, 48.37653], [27.0231, 48.42485], [27.08078, 48.43214], [27.13434, 48.37288], [27.27855, 48.37534], [27.32159, 48.4434], [27.37604, 48.44398], [27.37741, 48.41026], [27.44333, 48.41209], [27.46942, 48.454], [27.5889, 48.49224], [27.59027, 48.46311], [27.6658, 48.44034], [27.74422, 48.45926], [27.79225, 48.44244], [27.81902, 48.41874], [27.87533, 48.4037], [27.88391, 48.36699], [27.95883, 48.32368], [28.04527, 48.32661], [28.09873, 48.3124], [28.07504, 48.23494], [28.17666, 48.25963], [28.19314, 48.20749], [28.2856, 48.23202], [28.32508, 48.23384], [28.35519, 48.24957], [28.36996, 48.20543], [28.34912, 48.1787], [28.30586, 48.1597], [28.30609, 48.14018], [28.34009, 48.13147], [28.38712, 48.17567], [28.43701, 48.15832], [28.42454, 48.12047], [28.48428, 48.0737], [28.53921, 48.17453], [28.69896, 48.13106], [28.85232, 48.12506], [28.8414, 48.03392], [28.9306, 47.96255], [29.1723, 47.99013], [29.19839, 47.89261], [29.27804, 47.88893], [29.20663, 47.80367], [29.27255, 47.79953], [29.22242, 47.73607], [29.22414, 47.60012], [29.11743, 47.55001], [29.18603, 47.43387], [29.3261, 47.44664], [29.39889, 47.30179], [29.47854, 47.30366], [29.48678, 47.36043], [29.5733, 47.36508], [29.59665, 47.25521], [29.54996, 47.24962], [29.57696, 47.13581], [29.49732, 47.12878], [29.53044, 47.07851], [29.61038, 47.09932], [29.62137, 47.05069], [29.57056, 46.94766], [29.72986, 46.92234], [29.75458, 46.8604], [29.87405, 46.88199], [29.98814, 46.82358], [29.94522, 46.80055], [29.9743, 46.75325], [29.94409, 46.56002], [29.88916, 46.54302], [30.02511, 46.45132], [30.16794, 46.40967], [30.09103, 46.38694], [29.94114, 46.40114], [29.88329, 46.35851], [29.74496, 46.45605], [29.66359, 46.4215], [29.6763, 46.36041], [29.5939, 46.35472], [29.49914, 46.45889], [29.35357, 46.49505], [29.24886, 46.37912], [29.23547, 46.55435], [29.02409, 46.49582], [29.01241, 46.46177], [28.9306, 46.45699], [29.004, 46.31495], [28.98478, 46.31803], [28.94953, 46.25852], [29.06656, 46.19716], [28.94643, 46.09176], [29.00613, 46.04962], [28.98004, 46.00385], [28.74383, 45.96664], [28.78503, 45.83475], [28.69852, 45.81753], [28.70401, 45.78019], [28.52823, 45.73803], [28.47879, 45.66994], [28.51587, 45.6613], [28.54196, 45.58062], [28.49252, 45.56716], [28.51449, 45.49982], [28.43072, 45.48538], [28.41836, 45.51715], [28.30201, 45.54744], [28.21139, 45.46895], [28.28504, 45.43907], [28.34554, 45.32102], [28.5735, 45.24759], [28.71358, 45.22631], [28.78911, 45.24179], [28.81383, 45.3384], [28.94292, 45.28045], [28.96077, 45.33164], [29.24779, 45.43388], [29.42632, 45.44545], [29.59798, 45.38857], [29.68175, 45.26885], [29.65428, 45.25629], [29.69272, 45.19227], [30.04414, 45.08461], [31.62627, 45.50633], [33.54017, 46.0123], [33.59087, 46.06013], [33.57318, 46.10317]]]] } },
23432 { type: "Feature", properties: { iso1A2: "UG", iso1A3: "UGA", iso1N3: "800", wikidata: "Q1036", nameEn: "Uganda", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["256"] }, geometry: { type: "MultiPolygon", coordinates: [[[[33.93107, -0.99298], [33.9264, -0.54188], [33.98449, -0.13079], [33.90936, 0.10581], [34.10067, 0.36372], [34.08727, 0.44713], [34.11408, 0.48884], [34.13493, 0.58118], [34.20196, 0.62289], [34.27345, 0.63182], [34.31516, 0.75693], [34.40041, 0.80266], [34.43349, 0.85254], [34.52369, 1.10692], [34.57427, 1.09868], [34.58029, 1.14712], [34.67562, 1.21265], [34.80223, 1.22754], [34.82606, 1.26626], [34.82606, 1.30944], [34.7918, 1.36752], [34.87819, 1.5596], [34.92734, 1.56109], [34.9899, 1.6668], [34.98692, 1.97348], [34.90947, 2.42447], [34.95267, 2.47209], [34.77244, 2.70272], [34.78137, 2.76223], [34.73967, 2.85447], [34.65774, 2.8753], [34.60114, 2.93034], [34.56242, 3.11478], [34.45815, 3.18319], [34.40006, 3.37949], [34.41794, 3.44342], [34.39112, 3.48802], [34.44922, 3.51627], [34.45815, 3.67385], [34.15429, 3.80464], [34.06046, 4.15235], [33.9873, 4.23316], [33.51264, 3.75068], [33.18356, 3.77812], [33.02852, 3.89296], [32.89746, 3.81339], [32.72021, 3.77327], [32.41337, 3.748], [32.20782, 3.6053], [32.19888, 3.50867], [32.08866, 3.53543], [32.08491, 3.56287], [32.05187, 3.589], [31.95907, 3.57408], [31.96205, 3.6499], [31.86821, 3.78664], [31.81459, 3.82083], [31.72075, 3.74354], [31.50776, 3.63652], [31.50478, 3.67814], [31.29476, 3.8015], [31.16666, 3.79853], [30.97601, 3.693], [30.85153, 3.48867], [30.94081, 3.50847], [30.93486, 3.40737], [30.84251, 3.26908], [30.77101, 3.04897], [30.8574, 2.9508], [30.8857, 2.83923], [30.75612, 2.5863], [30.74271, 2.43601], [30.83059, 2.42559], [30.91102, 2.33332], [30.96911, 2.41071], [31.06593, 2.35862], [31.07934, 2.30207], [31.12104, 2.27676], [31.1985, 2.29462], [31.20148, 2.2217], [31.28042, 2.17853], [31.30127, 2.11006], [30.48503, 1.21675], [30.24671, 1.14974], [30.22139, 0.99635], [30.1484, 0.89805], [29.98307, 0.84295], [29.95477, 0.64486], [29.97413, 0.52124], [29.87284, 0.39166], [29.81922, 0.16824], [29.77454, 0.16675], [29.7224, 0.07291], [29.72687, -0.08051], [29.65091, -0.46777], [29.67474, -0.47969], [29.67176, -0.55714], [29.62708, -0.71055], [29.63006, -0.8997], [29.58388, -0.89821], [29.59061, -1.39016], [29.82657, -1.31187], [29.912, -1.48269], [30.16369, -1.34303], [30.35212, -1.06896], [30.47194, -1.0555], [30.64166, -1.06601], [30.70631, -1.01175], [30.76635, -0.9852], [30.80408, -0.99911], [33.93107, -0.99298]]]] } },
23433 { type: "Feature", properties: { iso1A2: "UM", iso1A3: "UMI", iso1N3: "581", wikidata: "Q16645", nameEn: "United States Minor Outlying Islands", country: "US" }, geometry: null },
23434 { type: "Feature", properties: { iso1A2: "UN", wikidata: "Q1065", nameEn: "United Nations", level: "unitedNations", isoStatus: "excRes" }, geometry: null },
23435 { type: "Feature", properties: { iso1A2: "US", iso1A3: "USA", iso1N3: "840", wikidata: "Q30", nameEn: "United States of America" }, geometry: null },
23436 { type: "Feature", properties: { iso1A2: "UY", iso1A3: "URY", iso1N3: "858", wikidata: "Q77", nameEn: "Uruguay", groups: ["005", "419", "019", "UN"], callingCodes: ["598"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-57.65132, -30.19229], [-57.61478, -30.25165], [-57.64859, -30.35095], [-57.89115, -30.49572], [-57.8024, -30.77193], [-57.89476, -30.95994], [-57.86729, -31.06352], [-57.9908, -31.34924], [-57.98127, -31.3872], [-58.07569, -31.44916], [-58.0023, -31.53084], [-58.00076, -31.65016], [-58.20252, -31.86966], [-58.10036, -32.25338], [-58.22362, -32.52416], [-58.1224, -32.98842], [-58.40475, -33.11777], [-58.44442, -33.84033], [-58.34425, -34.15035], [-57.83001, -34.69099], [-54.78916, -36.21945], [-52.83257, -34.01481], [-53.37138, -33.74313], [-53.39593, -33.75169], [-53.44031, -33.69344], [-53.52794, -33.68908], [-53.53459, -33.16843], [-53.1111, -32.71147], [-53.37671, -32.57005], [-53.39572, -32.58596], [-53.76024, -32.0751], [-54.17384, -31.86168], [-55.50821, -30.91349], [-55.50841, -30.9027], [-55.51862, -30.89828], [-55.52712, -30.89997], [-55.53276, -30.90218], [-55.53431, -30.89714], [-55.54572, -30.89051], [-55.55218, -30.88193], [-55.55373, -30.8732], [-55.5634, -30.8686], [-55.58866, -30.84117], [-55.87388, -31.05053], [-56.4619, -30.38457], [-56.4795, -30.3899], [-56.49267, -30.39471], [-56.90236, -30.02578], [-57.22502, -30.26121], [-57.65132, -30.19229]]]] } },
23437 { type: "Feature", properties: { iso1A2: "UZ", iso1A3: "UZB", iso1N3: "860", wikidata: "Q265", nameEn: "Uzbekistan", groups: ["143", "142", "UN"], callingCodes: ["998"] }, geometry: { type: "MultiPolygon", coordinates: [[[[65.85194, 42.85481], [65.53277, 43.31856], [65.18666, 43.48835], [64.96464, 43.74748], [64.53885, 43.56941], [63.34656, 43.64003], [62.01711, 43.51008], [61.01475, 44.41383], [58.59711, 45.58671], [55.97842, 44.99622], [55.97832, 44.99622], [55.97822, 44.99617], [55.97811, 44.99617], [55.97801, 44.99612], [55.97801, 44.99607], [55.97791, 44.99607], [55.9778, 44.99607], [55.9777, 44.99601], [55.9777, 44.99596], [55.9776, 44.99591], [55.97749, 44.99591], [55.97739, 44.99591], [55.97739, 44.99586], [55.97729, 44.99586], [55.97718, 44.99581], [55.97708, 44.99576], [55.97698, 44.9957], [55.97698, 44.99565], [55.97687, 44.9956], [55.97677, 44.9956], [55.97677, 44.99555], [55.97677, 44.9955], [55.97667, 44.99545], [55.97656, 44.99539], [55.97646, 44.99534], [55.97646, 44.99529], [55.97636, 44.99524], [55.97636, 44.99519], [55.97625, 44.99514], [55.97615, 44.99508], [55.97615, 44.99503], [55.97615, 44.99498], [55.97615, 44.99493], [55.97615, 44.99483], [55.97615, 44.99477], [55.97605, 44.99477], [55.97605, 44.99467], [55.97605, 44.99462], [55.97605, 44.99457], [55.97605, 44.99452], [55.97594, 44.99446], [55.97584, 44.99441], [55.97584, 44.99436], [55.97584, 44.99431], [55.97584, 44.99426], [55.97584, 44.99421], [55.97584, 44.99415], [55.97584, 44.99405], [55.97584, 44.994], [55.97584, 44.9939], [55.97584, 44.99384], [55.97584, 44.99374], [55.97584, 44.99369], [55.97584, 44.99359], [55.97584, 44.99353], [55.97584, 44.99348], [55.97584, 44.99343], [55.97584, 44.99338], [55.97584, 44.99328], [55.97584, 44.99322], [56.00314, 41.32584], [57.03423, 41.25435], [57.13796, 41.36625], [57.03359, 41.41777], [56.96218, 41.80383], [57.03633, 41.92043], [57.30275, 42.14076], [57.6296, 42.16519], [57.84932, 42.18555], [57.92897, 42.24047], [57.90975, 42.4374], [57.99214, 42.50021], [58.3492, 42.43335], [58.40688, 42.29535], [58.51674, 42.30348], [58.29427, 42.56497], [58.14321, 42.62159], [58.27504, 42.69632], [58.57991, 42.64988], [58.6266, 42.79314], [58.93422, 42.5407], [59.17317, 42.52248], [59.2955, 42.37064], [59.4341, 42.29738], [59.94633, 42.27655], [60.00539, 42.212], [59.96419, 42.1428], [60.04659, 42.08982], [60.0356, 42.01028], [59.95046, 41.97966], [60.33223, 41.75058], [60.08504, 41.80997], [60.06032, 41.76287], [60.18117, 41.60082], [60.06581, 41.4363], [60.5078, 41.21694], [61.03261, 41.25691], [61.22212, 41.14946], [61.33199, 41.14946], [61.39732, 41.19873], [61.4446, 41.29407], [61.87856, 41.12257], [62.11751, 40.58242], [62.34273, 40.43206], [62.43337, 39.98528], [63.6913, 39.27666], [63.70778, 39.22349], [64.19086, 38.95561], [64.32576, 38.98691], [65.55873, 38.29052], [65.83913, 38.25733], [66.24013, 38.16238], [66.41042, 38.02403], [66.56697, 38.0435], [66.67684, 37.96776], [66.53676, 37.80084], [66.52852, 37.58568], [66.65761, 37.45497], [66.52303, 37.39827], [66.55743, 37.35409], [66.64699, 37.32958], [66.95598, 37.40162], [67.08232, 37.35469], [67.13039, 37.27168], [67.2224, 37.24545], [67.2581, 37.17216], [67.51868, 37.26102], [67.78329, 37.1834], [67.8474, 37.31594], [67.81566, 37.43107], [68.12635, 37.93], [68.27159, 37.91477], [68.40343, 38.19484], [68.13289, 38.40822], [68.06274, 38.39435], [68.11366, 38.47169], [68.05873, 38.56087], [68.0807, 38.64136], [68.05598, 38.71641], [68.12877, 38.73677], [68.06948, 38.82115], [68.19743, 38.85985], [68.09704, 39.02589], [67.68915, 39.00775], [67.67833, 39.14479], [67.33226, 39.23739], [67.36522, 39.31287], [67.45998, 39.315], [67.46822, 39.46146], [67.39681, 39.52505], [67.46547, 39.53564], [67.44899, 39.57799], [67.62889, 39.60234], [67.70992, 39.66156], [68.12053, 39.56317], [68.54166, 39.53929], [68.61972, 39.68905], [68.63071, 39.85265], [68.88889, 39.87163], [68.93695, 39.91167], [68.84906, 40.04952], [68.96579, 40.06949], [69.01935, 40.11466], [69.01523, 40.15771], [68.62796, 40.07789], [68.52771, 40.11676], [68.5332, 40.14826], [68.77902, 40.20492], [68.79276, 40.17555], [68.84357, 40.18604], [68.85832, 40.20885], [69.04544, 40.22904], [69.15659, 40.2162], [69.2074, 40.21488], [69.30448, 40.18774], [69.30104, 40.24502], [69.25229, 40.26362], [69.24817, 40.30357], [69.30808, 40.2821], [69.32833, 40.29794], [69.33794, 40.34819], [69.30774, 40.36102], [69.28525, 40.41894], [69.27066, 40.49274], [69.21063, 40.54469], [69.2643, 40.57506], [69.3455, 40.57988], [69.32834, 40.70233], [69.38327, 40.7918], [69.53021, 40.77621], [69.59441, 40.70181], [69.69434, 40.62615], [70.36655, 40.90296], [70.38028, 41.02014], [70.45251, 41.04438], [70.80009, 40.72825], [70.49871, 40.52503], [70.32626, 40.45174], [70.37511, 40.38605], [70.57149, 40.3442], [70.56394, 40.26421], [70.62342, 40.17396], [70.8607, 40.217], [70.9818, 40.22392], [70.95789, 40.28761], [71.05901, 40.28765], [71.13042, 40.34106], [71.36663, 40.31593], [71.4246, 40.28619], [71.51215, 40.26943], [71.51549, 40.22986], [71.61725, 40.20615], [71.61931, 40.26775], [71.68386, 40.26984], [71.70569, 40.20391], [71.69621, 40.18492], [71.71719, 40.17886], [71.73054, 40.14818], [71.82646, 40.21872], [71.85002, 40.25647], [72.05464, 40.27586], [71.96401, 40.31907], [72.18648, 40.49893], [72.24368, 40.46091], [72.40346, 40.4007], [72.44191, 40.48222], [72.41513, 40.50856], [72.38384, 40.51535], [72.41714, 40.55736], [72.34406, 40.60144], [72.40517, 40.61917], [72.47795, 40.5532], [72.66713, 40.5219], [72.66713, 40.59076], [72.69579, 40.59778], [72.73995, 40.58409], [72.74768, 40.58051], [72.74862, 40.57131], [72.75982, 40.57273], [72.74894, 40.59592], [72.74866, 40.60873], [72.80137, 40.67856], [72.84754, 40.67229], [72.85372, 40.7116], [72.8722, 40.71111], [72.93296, 40.73089], [72.99133, 40.76457], [73.0612, 40.76678], [73.13412, 40.79122], [73.13267, 40.83512], [73.01869, 40.84681], [72.94454, 40.8094], [72.84291, 40.85512], [72.68157, 40.84942], [72.59136, 40.86947], [72.55109, 40.96046], [72.48742, 40.97136], [72.45206, 41.03018], [72.38511, 41.02785], [72.36138, 41.04384], [72.34757, 41.06104], [72.34026, 41.04539], [72.324, 41.03381], [72.18339, 40.99571], [72.17594, 41.02377], [72.21061, 41.05607], [72.1792, 41.10621], [72.14864, 41.13363], [72.17594, 41.15522], [72.16433, 41.16483], [72.10745, 41.15483], [72.07249, 41.11739], [71.85964, 41.19081], [71.91457, 41.2982], [71.83914, 41.3546], [71.76625, 41.4466], [71.71132, 41.43012], [71.73054, 41.54713], [71.65914, 41.49599], [71.6787, 41.42111], [71.57227, 41.29175], [71.46688, 41.31883], [71.43814, 41.19644], [71.46148, 41.13958], [71.40198, 41.09436], [71.34877, 41.16807], [71.27187, 41.11015], [71.25813, 41.18796], [71.11806, 41.15359], [71.02193, 41.19494], [70.9615, 41.16393], [70.86263, 41.23833], [70.77885, 41.24813], [70.78572, 41.36419], [70.67586, 41.47953], [70.48909, 41.40335], [70.17682, 41.5455], [70.69777, 41.92554], [71.28719, 42.18033], [71.13263, 42.28356], [70.94483, 42.26238], [69.49545, 41.545], [69.45751, 41.56863], [69.39485, 41.51518], [69.45081, 41.46246], [69.37468, 41.46555], [69.35554, 41.47211], [69.29778, 41.43673], [69.25059, 41.46693], [69.23332, 41.45847], [69.22671, 41.46298], [69.20439, 41.45391], [69.18528, 41.45175], [69.17701, 41.43769], [69.15137, 41.43078], [69.05006, 41.36183], [69.01308, 41.22804], [68.7217, 41.05025], [68.73945, 40.96989], [68.65662, 40.93861], [68.62221, 41.03019], [68.49983, 40.99669], [68.58444, 40.91447], [68.63, 40.59358], [68.49983, 40.56437], [67.96736, 40.83798], [68.1271, 41.0324], [68.08273, 41.08148], [67.98511, 41.02794], [67.9644, 41.14611], [66.69129, 41.1311], [66.53302, 41.87388], [66.00546, 41.94455], [66.09482, 42.93426], [65.85194, 42.85481]], [[70.68112, 40.90612], [70.6721, 40.90555], [70.57501, 40.98941], [70.54223, 40.98787], [70.56077, 41.00642], [70.6158, 40.97661], [70.68112, 40.90612]]], [[[71.21139, 40.03369], [71.12218, 40.03052], [71.06305, 40.1771], [71.00236, 40.18154], [71.01035, 40.05481], [71.11037, 40.01984], [71.11668, 39.99291], [71.09063, 39.99], [71.10501, 39.95568], [71.04979, 39.89808], [71.10531, 39.91354], [71.16101, 39.88423], [71.23067, 39.93581], [71.1427, 39.95026], [71.21139, 40.03369]]], [[[71.86463, 39.98598], [71.78838, 40.01404], [71.71511, 39.96348], [71.7504, 39.93701], [71.84316, 39.95582], [71.86463, 39.98598]]]] } },
23438 { type: "Feature", properties: { iso1A2: "VA", iso1A3: "VAT", iso1N3: "336", wikidata: "Q237", nameEn: "Vatican City", aliases: ["Holy See"], groups: ["039", "150"], callingCodes: ["379", "39 06"] }, geometry: { type: "MultiPolygon", coordinates: [[[[12.45181, 41.90056], [12.45446, 41.90028], [12.45435, 41.90143], [12.45626, 41.90172], [12.45691, 41.90125], [12.4577, 41.90115], [12.45834, 41.90174], [12.45826, 41.90281], [12.45755, 41.9033], [12.45762, 41.9058], [12.45561, 41.90629], [12.45543, 41.90738], [12.45091, 41.90625], [12.44984, 41.90545], [12.44815, 41.90326], [12.44582, 41.90194], [12.44834, 41.90095], [12.45181, 41.90056]]]] } },
23439 { type: "Feature", properties: { iso1A2: "VC", iso1A3: "VCT", iso1N3: "670", wikidata: "Q757", nameEn: "St. Vincent and the Grenadines", aliases: ["WV"], groups: ["029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", callingCodes: ["1 784"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-62.64026, 12.69984], [-59.94058, 12.34011], [-61.69315, 14.26451], [-62.64026, 12.69984]]]] } },
23440 { type: "Feature", properties: { iso1A2: "VE", iso1A3: "VEN", iso1N3: "862", wikidata: "Q717", nameEn: "Venezuela", aliases: ["YV"], groups: ["005", "419", "019", "UN"], callingCodes: ["58"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-71.22331, 13.01387], [-70.92579, 11.96275], [-71.3275, 11.85], [-71.9675, 11.65536], [-72.24983, 11.14138], [-72.4767, 11.1117], [-72.88002, 10.44309], [-72.98085, 9.85253], [-73.36905, 9.16636], [-73.02119, 9.27584], [-72.94052, 9.10663], [-72.77415, 9.10165], [-72.65474, 8.61428], [-72.4042, 8.36513], [-72.36987, 8.19976], [-72.35163, 8.01163], [-72.39137, 8.03534], [-72.47213, 7.96106], [-72.48801, 7.94329], [-72.48183, 7.92909], [-72.47042, 7.92306], [-72.45806, 7.91141], [-72.46183, 7.90682], [-72.44454, 7.86031], [-72.46763, 7.79518], [-72.47827, 7.65604], [-72.45321, 7.57232], [-72.47415, 7.48928], [-72.43132, 7.40034], [-72.19437, 7.37034], [-72.04895, 7.03837], [-71.82441, 7.04314], [-71.44118, 7.02116], [-71.42212, 7.03854], [-71.37234, 7.01588], [-71.03941, 6.98163], [-70.7596, 7.09799], [-70.10716, 6.96516], [-69.41843, 6.1072], [-67.60654, 6.2891], [-67.4625, 6.20625], [-67.43513, 5.98835], [-67.58558, 5.84537], [-67.63914, 5.64963], [-67.59141, 5.5369], [-67.83341, 5.31104], [-67.85358, 4.53249], [-67.62671, 3.74303], [-67.50067, 3.75812], [-67.30945, 3.38393], [-67.85862, 2.86727], [-67.85862, 2.79173], [-67.65696, 2.81691], [-67.21967, 2.35778], [-66.85795, 1.22998], [-66.28507, 0.74585], [-65.6727, 1.01353], [-65.50158, 0.92086], [-65.57288, 0.62856], [-65.11657, 1.12046], [-64.38932, 1.5125], [-64.34654, 1.35569], [-64.08274, 1.64792], [-64.06135, 1.94722], [-63.39827, 2.16098], [-63.39114, 2.4317], [-64.0257, 2.48156], [-64.02908, 2.79797], [-64.48379, 3.7879], [-64.84028, 4.24665], [-64.72977, 4.28931], [-64.57648, 4.12576], [-64.14512, 4.12932], [-63.99183, 3.90172], [-63.86082, 3.94796], [-63.70218, 3.91417], [-63.67099, 4.01731], [-63.50611, 3.83592], [-63.42233, 3.89995], [-63.4464, 3.9693], [-63.21111, 3.96219], [-62.98296, 3.59935], [-62.7655, 3.73099], [-62.74411, 4.03331], [-62.57656, 4.04754], [-62.44822, 4.18621], [-62.13094, 4.08309], [-61.54629, 4.2822], [-61.48569, 4.43149], [-61.29675, 4.44216], [-61.31457, 4.54167], [-61.15703, 4.49839], [-60.98303, 4.54167], [-60.86539, 4.70512], [-60.5802, 4.94312], [-60.73204, 5.20931], [-61.4041, 5.95304], [-61.15058, 6.19558], [-61.20762, 6.58174], [-61.13632, 6.70922], [-60.54873, 6.8631], [-60.39419, 6.94847], [-60.28074, 7.1162], [-60.44116, 7.20817], [-60.54098, 7.14804], [-60.63367, 7.25061], [-60.59802, 7.33194], [-60.71923, 7.55817], [-60.64793, 7.56877], [-60.51959, 7.83373], [-60.38056, 7.8302], [-60.02407, 8.04557], [-59.97059, 8.20791], [-59.83156, 8.23261], [-59.80661, 8.28906], [-59.85562, 8.35213], [-59.98508, 8.53046], [-59.54058, 8.6862], [-60.89962, 9.81445], [-62.08693, 10.04435], [-61.62505, 11.18974], [-63.73917, 11.92623], [-63.19938, 16.44103], [-67.89186, 12.4116], [-68.01417, 11.77722], [-68.33524, 11.78151], [-68.99639, 11.79035], [-71.22331, 13.01387]]]] } },
23441 { type: "Feature", properties: { iso1A2: "VG", iso1A3: "VGB", iso1N3: "092", wikidata: "Q25305", nameEn: "British Virgin Islands", country: "GB", groups: ["BOTS", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 284"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-64.47127, 17.55688], [-63.88746, 19.15706], [-65.02435, 18.73231], [-64.86027, 18.39056], [-64.64673, 18.36549], [-64.47127, 17.55688]]]] } },
23442 { type: "Feature", properties: { iso1A2: "VI", iso1A3: "VIR", iso1N3: "850", wikidata: "Q11703", nameEn: "United States Virgin Islands", aliases: ["US-VI"], country: "US", groups: ["Q1352230", "029", "003", "419", "019", "UN"], driveSide: "left", roadSpeedUnit: "mph", roadHeightUnit: "ft", callingCodes: ["1 340"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-65.02435, 18.73231], [-65.27974, 17.56928], [-64.47127, 17.55688], [-64.64673, 18.36549], [-64.86027, 18.39056], [-65.02435, 18.73231]]]] } },
23443 { type: "Feature", properties: { iso1A2: "VN", iso1A3: "VNM", iso1N3: "704", wikidata: "Q881", nameEn: "Vietnam", groups: ["035", "142", "UN"], callingCodes: ["84"] }, geometry: { type: "MultiPolygon", coordinates: [[[[108.10003, 21.47338], [108.0569, 21.53604], [108.02926, 21.54997], [107.97932, 21.54503], [107.97383, 21.53961], [107.97074, 21.54072], [107.96774, 21.53601], [107.95232, 21.5388], [107.92652, 21.58906], [107.90006, 21.5905], [107.86114, 21.65128], [107.80355, 21.66141], [107.66967, 21.60787], [107.56537, 21.61945], [107.54047, 21.5934], [107.49065, 21.59774], [107.49532, 21.62958], [107.47197, 21.6672], [107.41593, 21.64839], [107.38636, 21.59774], [107.35989, 21.60063], [107.35834, 21.6672], [107.29296, 21.74674], [107.24625, 21.7077], [107.20734, 21.71493], [107.10771, 21.79879], [107.02615, 21.81981], [107.00964, 21.85948], [107.06101, 21.88982], [107.05634, 21.92303], [106.99252, 21.95191], [106.97228, 21.92592], [106.92714, 21.93459], [106.9178, 21.97357], [106.81038, 21.97934], [106.74345, 22.00965], [106.72551, 21.97923], [106.69276, 21.96013], [106.68274, 21.99811], [106.70142, 22.02409], [106.6983, 22.15102], [106.67495, 22.1885], [106.69986, 22.22309], [106.6516, 22.33977], [106.55976, 22.34841], [106.57221, 22.37], [106.55665, 22.46498], [106.58395, 22.474], [106.61269, 22.60301], [106.65316, 22.5757], [106.71698, 22.58432], [106.72321, 22.63606], [106.76293, 22.73491], [106.82404, 22.7881], [106.83685, 22.8098], [106.81271, 22.8226], [106.78422, 22.81532], [106.71128, 22.85982], [106.71387, 22.88296], [106.6734, 22.89587], [106.6516, 22.86862], [106.60179, 22.92884], [106.55976, 22.92311], [106.51306, 22.94891], [106.49749, 22.91164], [106.34961, 22.86718], [106.27022, 22.87722], [106.19705, 22.98475], [106.00179, 22.99049], [105.99568, 22.94178], [105.90119, 22.94168], [105.8726, 22.92756], [105.72382, 23.06641], [105.57594, 23.075], [105.56037, 23.16806], [105.49966, 23.20669], [105.42805, 23.30824], [105.40782, 23.28107], [105.32376, 23.39684], [105.22569, 23.27249], [105.17276, 23.28679], [105.11672, 23.25247], [105.07002, 23.26248], [104.98712, 23.19176], [104.96532, 23.20463], [104.9486, 23.17235], [104.91435, 23.18666], [104.87992, 23.17141], [104.87382, 23.12854], [104.79478, 23.12934], [104.8334, 23.01484], [104.86765, 22.95178], [104.84942, 22.93631], [104.77114, 22.90017], [104.72755, 22.81984], [104.65283, 22.83419], [104.60457, 22.81841], [104.58122, 22.85571], [104.47225, 22.75813], [104.35593, 22.69353], [104.25683, 22.76534], [104.27084, 22.8457], [104.11384, 22.80363], [104.03734, 22.72945], [104.01088, 22.51823], [103.99247, 22.51958], [103.97384, 22.50634], [103.96783, 22.51173], [103.96352, 22.50584], [103.95191, 22.5134], [103.94513, 22.52553], [103.93286, 22.52703], [103.87904, 22.56683], [103.64506, 22.79979], [103.56255, 22.69499], [103.57812, 22.65764], [103.52675, 22.59155], [103.43646, 22.70648], [103.43179, 22.75816], [103.32282, 22.8127], [103.28079, 22.68063], [103.18895, 22.64471], [103.15782, 22.59873], [103.17961, 22.55705], [103.07843, 22.50097], [103.0722, 22.44775], [102.9321, 22.48659], [102.8636, 22.60735], [102.60675, 22.73376], [102.57095, 22.7036], [102.51802, 22.77969], [102.46665, 22.77108], [102.42618, 22.69212], [102.38415, 22.67919], [102.41061, 22.64184], [102.25339, 22.4607], [102.26428, 22.41321], [102.16621, 22.43336], [102.14099, 22.40092], [102.18712, 22.30403], [102.51734, 22.02676], [102.49092, 21.99002], [102.62301, 21.91447], [102.67145, 21.65894], [102.74189, 21.66713], [102.82115, 21.73667], [102.81894, 21.83888], [102.85637, 21.84501], [102.86077, 21.71213], [102.97965, 21.74076], [102.98846, 21.58936], [102.86297, 21.4255], [102.94223, 21.46034], [102.88939, 21.3107], [102.80794, 21.25736], [102.89825, 21.24707], [102.97745, 21.05821], [103.03469, 21.05821], [103.12055, 20.89994], [103.21497, 20.89832], [103.38032, 20.79501], [103.45737, 20.82382], [103.68633, 20.66324], [103.73478, 20.6669], [103.82282, 20.8732], [103.98024, 20.91531], [104.11121, 20.96779], [104.27412, 20.91433], [104.63957, 20.6653], [104.38199, 20.47155], [104.40621, 20.3849], [104.47886, 20.37459], [104.66158, 20.47774], [104.72102, 20.40554], [104.62195, 20.36633], [104.61315, 20.24452], [104.86852, 20.14121], [104.91695, 20.15567], [104.9874, 20.09573], [104.8465, 19.91783], [104.8355, 19.80395], [104.68359, 19.72729], [104.64837, 19.62365], [104.53169, 19.61743], [104.41281, 19.70035], [104.23229, 19.70242], [104.06498, 19.66926], [104.05617, 19.61743], [104.10832, 19.51575], [104.06058, 19.43484], [103.87125, 19.31854], [104.5361, 18.97747], [104.64617, 18.85668], [105.12829, 18.70453], [105.19654, 18.64196], [105.1327, 18.58355], [105.10408, 18.43533], [105.15942, 18.38691], [105.38366, 18.15315], [105.46292, 18.22008], [105.64784, 17.96687], [105.60381, 17.89356], [105.76612, 17.67147], [105.85744, 17.63221], [106.09019, 17.36399], [106.18991, 17.28227], [106.24444, 17.24714], [106.29287, 17.3018], [106.31929, 17.20509], [106.43597, 17.01362], [106.50862, 16.9673], [106.55045, 17.0031], [106.54824, 16.92729], [106.51963, 16.92097], [106.52183, 16.87884], [106.55265, 16.86831], [106.55485, 16.68704], [106.59013, 16.62259], [106.58267, 16.6012], [106.61477, 16.60713], [106.66052, 16.56892], [106.65832, 16.47816], [106.74418, 16.41904], [106.84104, 16.55415], [106.88727, 16.52671], [106.88067, 16.43594], [106.96638, 16.34938], [106.97385, 16.30204], [107.02597, 16.31132], [107.09091, 16.3092], [107.15035, 16.26271], [107.14595, 16.17816], [107.25822, 16.13587], [107.33968, 16.05549], [107.44975, 16.08511], [107.46296, 16.01106], [107.39471, 15.88829], [107.34188, 15.89464], [107.21419, 15.83747], [107.21859, 15.74638], [107.27143, 15.71459], [107.27583, 15.62769], [107.34408, 15.62345], [107.3815, 15.49832], [107.50699, 15.48771], [107.53341, 15.40496], [107.62367, 15.42193], [107.60605, 15.37524], [107.62587, 15.2266], [107.58844, 15.20111], [107.61926, 15.13949], [107.61486, 15.0566], [107.46516, 15.00982], [107.48277, 14.93751], [107.59285, 14.87795], [107.51579, 14.79282], [107.54361, 14.69092], [107.55371, 14.628], [107.52102, 14.59034], [107.52569, 14.54665], [107.48521, 14.40346], [107.44941, 14.41552], [107.39493, 14.32655], [107.40427, 14.24509], [107.33577, 14.11832], [107.37158, 14.07906], [107.35757, 14.02319], [107.38247, 13.99147], [107.44318, 13.99751], [107.46498, 13.91593], [107.45252, 13.78897], [107.53503, 13.73908], [107.61909, 13.52577], [107.62843, 13.3668], [107.49144, 13.01215], [107.49611, 12.88926], [107.55993, 12.7982], [107.5755, 12.52177], [107.55059, 12.36824], [107.4463, 12.29373], [107.42917, 12.24657], [107.34511, 12.33327], [107.15831, 12.27547], [106.99953, 12.08983], [106.92325, 12.06548], [106.79405, 12.0807], [106.70687, 11.96956], [106.4111, 11.97413], [106.4687, 11.86751], [106.44068, 11.86294], [106.44535, 11.8279], [106.41577, 11.76999], [106.45158, 11.68616], [106.44691, 11.66787], [106.37219, 11.69836], [106.30525, 11.67549], [106.26478, 11.72122], [106.18539, 11.75171], [106.13158, 11.73283], [106.06708, 11.77761], [106.02038, 11.77457], [106.00792, 11.7197], [105.95188, 11.63738], [105.88962, 11.67854], [105.8507, 11.66635], [105.80867, 11.60536], [105.81645, 11.56876], [105.87328, 11.55953], [105.88962, 11.43605], [105.86782, 11.28343], [106.10444, 11.07879], [106.1527, 11.10476], [106.1757, 11.07301], [106.20095, 10.97795], [106.14301, 10.98176], [106.18539, 10.79451], [106.06708, 10.8098], [105.94535, 10.9168], [105.93403, 10.83853], [105.84603, 10.85873], [105.86376, 10.89839], [105.77751, 11.03671], [105.50045, 10.94586], [105.42884, 10.96878], [105.34011, 10.86179], [105.11449, 10.96332], [105.08326, 10.95656], [105.02722, 10.89236], [105.09571, 10.72722], [104.95094, 10.64003], [104.87933, 10.52833], [104.59018, 10.53073], [104.49869, 10.4057], [104.47963, 10.43046], [104.43778, 10.42386], [103.99198, 10.48391], [102.47649, 9.66162], [104.81582, 8.03101], [109.55486, 8.10026], [111.60491, 13.57105], [108.00365, 17.98159], [108.10003, 21.47338]]]] } },
23444 { type: "Feature", properties: { iso1A2: "VU", iso1A3: "VUT", iso1N3: "548", wikidata: "Q686", nameEn: "Vanuatu", groups: ["054", "009", "UN"], callingCodes: ["678"] }, geometry: { type: "MultiPolygon", coordinates: [[[[156.73836, -14.50464], [174.245, -23.1974], [172.71443, -12.01327], [156.73836, -14.50464]]]] } },
23445 { type: "Feature", properties: { iso1A2: "WF", iso1A3: "WLF", iso1N3: "876", wikidata: "Q35555", nameEn: "Wallis and Futuna", country: "FR", groups: ["EU", "Q1451600", "061", "009", "UN"], callingCodes: ["681"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-178.66551, -14.32452], [-176.76826, -14.95183], [-175.59809, -12.61507], [-178.66551, -14.32452]]]] } },
23446 { type: "Feature", properties: { iso1A2: "WS", iso1A3: "WSM", iso1N3: "882", wikidata: "Q683", nameEn: "Samoa", groups: ["061", "009", "UN"], driveSide: "left", callingCodes: ["685"] }, geometry: { type: "MultiPolygon", coordinates: [[[[-173.74402, -14.26669], [-170.99605, -15.1275], [-171.39864, -10.21587], [-173.74402, -14.26669]]]] } },
23447 { type: "Feature", properties: { iso1A2: "XK", iso1A3: "XKX", wikidata: "Q1246", nameEn: "Kosovo", aliases: ["KV"], groups: ["039", "150"], isoStatus: "usrAssn", callingCodes: ["383"] }, geometry: { type: "MultiPolygon", coordinates: [[[[21.39045, 42.74888], [21.44047, 42.87276], [21.36941, 42.87397], [21.32974, 42.90424], [21.2719, 42.8994], [21.23534, 42.95523], [21.23877, 43.00848], [21.2041, 43.02277], [21.16734, 42.99694], [21.14465, 43.11089], [21.08952, 43.13471], [21.05378, 43.10707], [21.00749, 43.13984], [20.96287, 43.12416], [20.83727, 43.17842], [20.88685, 43.21697], [20.82145, 43.26769], [20.73811, 43.25068], [20.68688, 43.21335], [20.59929, 43.20492], [20.69515, 43.09641], [20.64557, 43.00826], [20.59929, 43.01067], [20.48692, 42.93208], [20.53484, 42.8885], [20.43734, 42.83157], [20.40594, 42.84853], [20.35692, 42.8335], [20.27869, 42.81945], [20.2539, 42.76245], [20.04898, 42.77701], [20.02088, 42.74789], [20.02915, 42.71147], [20.0969, 42.65559], [20.07761, 42.55582], [20.17127, 42.50469], [20.21797, 42.41237], [20.24399, 42.32168], [20.34479, 42.32656], [20.3819, 42.3029], [20.48857, 42.25444], [20.56955, 42.12097], [20.55633, 42.08173], [20.59434, 42.03879], [20.63069, 41.94913], [20.57946, 41.91593], [20.59524, 41.8818], [20.68523, 41.85318], [20.76786, 41.91839], [20.75464, 42.05229], [21.11491, 42.20794], [21.16614, 42.19815], [21.22728, 42.08909], [21.31983, 42.10993], [21.29913, 42.13954], [21.30496, 42.1418], [21.38428, 42.24465], [21.43882, 42.23609], [21.43882, 42.2789], [21.50823, 42.27156], [21.52145, 42.24465], [21.58992, 42.25915], [21.56772, 42.30946], [21.5264, 42.33634], [21.53467, 42.36809], [21.57021, 42.3647], [21.59029, 42.38042], [21.62887, 42.37664], [21.64209, 42.41081], [21.62556, 42.45106], [21.7035, 42.51899], [21.70522, 42.54176], [21.7327, 42.55041], [21.75672, 42.62695], [21.79413, 42.65923], [21.75025, 42.70125], [21.6626, 42.67813], [21.58755, 42.70418], [21.59154, 42.72643], [21.47498, 42.74695], [21.39045, 42.74888]]]] } },
23448 { type: "Feature", properties: { iso1A2: "YE", iso1A3: "YEM", iso1N3: "887", wikidata: "Q805", nameEn: "Yemen", groups: ["145", "142", "UN"], callingCodes: ["967"] }, geometry: { type: "MultiPolygon", coordinates: [[[[57.49095, 8.14549], [52.81185, 17.28568], [52.74267, 17.29519], [52.78009, 17.35124], [52.00311, 19.00083], [49.04884, 18.59899], [48.19996, 18.20584], [47.58351, 17.50366], [47.48245, 17.10808], [47.00571, 16.94765], [46.76494, 17.29151], [46.31018, 17.20464], [44.50126, 17.47475], [43.70631, 17.35762], [43.43005, 17.56148], [43.29185, 17.53224], [43.22533, 17.38343], [43.32653, 17.31179], [43.20156, 17.25901], [43.17787, 17.14717], [43.23967, 17.03428], [43.18233, 17.02673], [43.1813, 16.98438], [43.19328, 16.94703], [43.1398, 16.90696], [43.18338, 16.84852], [43.22012, 16.83932], [43.22956, 16.80613], [43.24801, 16.80613], [43.26303, 16.79479], [43.25857, 16.75304], [43.21325, 16.74416], [43.22066, 16.65179], [43.15274, 16.67248], [43.11601, 16.53166], [42.97215, 16.51093], [42.94351, 16.49467], [42.94625, 16.39721], [42.76801, 16.40371], [42.15205, 16.40211], [40.99158, 15.81743], [43.29075, 12.79154], [43.32909, 12.59711], [43.90659, 12.3823], [51.12877, 12.56479], [57.49095, 8.14549]]]] } },
23449 { type: "Feature", properties: { iso1A2: "YT", iso1A3: "MYT", iso1N3: "175", wikidata: "Q17063", nameEn: "Mayotte", country: "FR", groups: ["Q3320166", "EU", "014", "202", "002", "UN"], callingCodes: ["262"] }, geometry: { type: "MultiPolygon", coordinates: [[[[43.28731, -13.97126], [45.54824, -13.22353], [45.4971, -11.75965], [43.28731, -13.97126]]]] } },
23450 { type: "Feature", properties: { iso1A2: "ZA", iso1A3: "ZAF", iso1N3: "710", wikidata: "Q258", nameEn: "South Africa", groups: ["018", "202", "002", "UN"], driveSide: "left", callingCodes: ["27"] }, geometry: { type: "MultiPolygon", coordinates: [[[[31.30611, -22.422], [31.16344, -22.32599], [31.08932, -22.34884], [30.86696, -22.28907], [30.6294, -22.32599], [30.48686, -22.31368], [30.38614, -22.34533], [30.28351, -22.35587], [30.2265, -22.2961], [30.13147, -22.30841], [29.92242, -22.19408], [29.76848, -22.14128], [29.64609, -22.12917], [29.37703, -22.19581], [29.21955, -22.17771], [29.18974, -22.18599], [29.15268, -22.21399], [29.10881, -22.21202], [29.0151, -22.22907], [28.91889, -22.44299], [28.63287, -22.55887], [28.34874, -22.5694], [28.04562, -22.8394], [28.04752, -22.90243], [27.93729, -22.96194], [27.93539, -23.04941], [27.74154, -23.2137], [27.6066, -23.21894], [27.52393, -23.37952], [27.33768, -23.40917], [26.99749, -23.65486], [26.84165, -24.24885], [26.51667, -24.47219], [26.46346, -24.60358], [26.39409, -24.63468], [25.8515, -24.75727], [25.84295, -24.78661], [25.88571, -24.87802], [25.72702, -25.25503], [25.69661, -25.29284], [25.6643, -25.4491], [25.58543, -25.6343], [25.33076, -25.76616], [25.12266, -25.75931], [25.01718, -25.72507], [24.8946, -25.80723], [24.67319, -25.81749], [24.44703, -25.73021], [24.36531, -25.773], [24.18287, -25.62916], [23.9244, -25.64286], [23.47588, -25.29971], [23.03497, -25.29971], [22.86012, -25.50572], [22.70808, -25.99186], [22.56365, -26.19668], [22.41921, -26.23078], [22.21206, -26.3773], [22.06192, -26.61882], [21.90703, -26.66808], [21.83291, -26.65959], [21.77114, -26.69015], [21.7854, -26.79199], [21.69322, -26.86152], [21.37869, -26.82083], [21.13353, -26.86661], [20.87031, -26.80047], [20.68596, -26.9039], [20.63275, -26.78181], [20.61754, -26.4692], [20.86081, -26.14892], [20.64795, -25.47827], [20.29826, -24.94869], [20.03678, -24.81004], [20.02809, -24.78725], [19.99817, -24.76768], [19.99882, -28.42622], [18.99885, -28.89165], [17.4579, -28.68718], [17.15405, -28.08573], [16.90446, -28.057], [16.59922, -28.53246], [16.46592, -28.57126], [16.45332, -28.63117], [12.51595, -32.27486], [38.88176, -48.03306], [34.51034, -26.91792], [32.35222, -26.86027], [32.29584, -26.852], [32.22302, -26.84136], [32.19409, -26.84032], [32.13315, -26.84345], [32.09664, -26.80721], [32.00893, -26.8096], [31.97463, -27.11057], [31.97592, -27.31675], [31.49834, -27.31549], [31.15027, -27.20151], [30.96088, -27.0245], [30.97757, -26.92706], [30.88826, -26.79622], [30.81101, -26.84722], [30.78927, -26.48271], [30.95819, -26.26303], [31.13073, -25.91558], [31.31237, -25.7431], [31.4175, -25.71886], [31.86881, -25.99973], [31.974, -25.95387], [31.92649, -25.84216], [32.00631, -25.65044], [31.97875, -25.46356], [32.01676, -25.38117], [32.03196, -25.10785], [31.9835, -24.29983], [31.90368, -24.18892], [31.87707, -23.95293], [31.77445, -23.90082], [31.70223, -23.72695], [31.67942, -23.60858], [31.56539, -23.47268], [31.55779, -23.176], [31.30611, -22.422]], [[29.33204, -29.45598], [29.28545, -29.58456], [29.12553, -29.76266], [29.16548, -29.91706], [28.9338, -30.05072], [28.80222, -30.10579], [28.68627, -30.12885], [28.399, -30.1592], [28.2319, -30.28476], [28.12073, -30.68072], [27.74814, -30.60635], [27.69467, -30.55862], [27.67819, -30.53437], [27.6521, -30.51707], [27.62137, -30.50509], [27.56781, -30.44562], [27.56901, -30.42504], [27.45452, -30.32239], [27.38108, -30.33456], [27.36649, -30.27246], [27.37293, -30.19401], [27.40778, -30.14577], [27.32555, -30.14785], [27.29603, -30.05473], [27.22719, -30.00718], [27.09489, -29.72796], [27.01016, -29.65439], [27.33464, -29.48161], [27.4358, -29.33465], [27.47254, -29.31968], [27.45125, -29.29708], [27.48679, -29.29349], [27.54258, -29.25575], [27.5158, -29.2261], [27.55974, -29.18954], [27.75458, -28.89839], [27.8907, -28.91612], [27.88933, -28.88156], [27.9392, -28.84864], [27.98675, -28.8787], [28.02503, -28.85991], [28.1317, -28.7293], [28.2348, -28.69471], [28.30518, -28.69531], [28.40612, -28.6215], [28.65091, -28.57025], [28.68043, -28.58744], [29.40524, -29.21246], [29.44883, -29.3772], [29.33204, -29.45598]]]] } },
23451 { type: "Feature", properties: { iso1A2: "ZM", iso1A3: "ZMB", iso1N3: "894", wikidata: "Q953", nameEn: "Zambia", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["260"] }, geometry: { type: "MultiPolygon", coordinates: [[[[32.95389, -9.40138], [32.76233, -9.31963], [32.75611, -9.28583], [32.53661, -9.24281], [32.49147, -9.14754], [32.43543, -9.11988], [32.25486, -9.13371], [32.16146, -9.05993], [32.08206, -9.04609], [31.98866, -9.07069], [31.94196, -9.02303], [31.94663, -8.93846], [31.81587, -8.88618], [31.71158, -8.91386], [31.57147, -8.81388], [31.57147, -8.70619], [31.37533, -8.60769], [31.00796, -8.58615], [30.79243, -8.27382], [28.88917, -8.4831], [28.9711, -8.66935], [28.38526, -9.23393], [28.36562, -9.30091], [28.52636, -9.35379], [28.51627, -9.44726], [28.56208, -9.49122], [28.68532, -9.78], [28.62795, -9.92942], [28.65032, -10.65133], [28.37241, -11.57848], [28.48357, -11.87532], [29.18592, -12.37921], [29.4992, -12.43843], [29.48404, -12.23604], [29.8139, -12.14898], [29.81551, -13.44683], [29.65078, -13.41844], [29.60531, -13.21685], [29.01918, -13.41353], [28.33199, -12.41375], [27.59932, -12.22123], [27.21025, -11.76157], [27.22541, -11.60323], [27.04351, -11.61312], [26.88687, -12.01868], [26.01777, -11.91488], [25.33058, -11.65767], [25.34069, -11.19707], [24.42612, -11.44975], [24.34528, -11.06816], [24.00027, -10.89356], [24.02603, -11.15368], [23.98804, -12.13149], [24.06672, -12.29058], [23.90937, -12.844], [24.03339, -12.99091], [21.97988, -13.00148], [22.00323, -16.18028], [22.17217, -16.50269], [23.20038, -17.47563], [23.47474, -17.62877], [24.23619, -17.47489], [24.32811, -17.49082], [24.38712, -17.46818], [24.5621, -17.52963], [24.70864, -17.49501], [25.00198, -17.58221], [25.26433, -17.79571], [25.51646, -17.86232], [25.6827, -17.81987], [25.85738, -17.91403], [25.85892, -17.97726], [26.08925, -17.98168], [26.0908, -17.93021], [26.21601, -17.88608], [26.55918, -17.99638], [26.68403, -18.07411], [26.74314, -18.0199], [26.89926, -17.98756], [27.14196, -17.81398], [27.30736, -17.60487], [27.61377, -17.34378], [27.62795, -17.24365], [27.83141, -16.96274], [28.73725, -16.5528], [28.76199, -16.51575], [28.81454, -16.48611], [28.8501, -16.04537], [28.9243, -15.93987], [29.01298, -15.93805], [29.21955, -15.76589], [29.4437, -15.68702], [29.8317, -15.6126], [30.35574, -15.6513], [30.41902, -15.62269], [30.22098, -14.99447], [33.24249, -14.00019], [33.16749, -13.93992], [33.07568, -13.98447], [33.02977, -14.05022], [32.99042, -13.95689], [32.88985, -13.82956], [32.79015, -13.80755], [32.76962, -13.77224], [32.84528, -13.71576], [32.7828, -13.64805], [32.68654, -13.64268], [32.66468, -13.60019], [32.68436, -13.55769], [32.73683, -13.57682], [32.84176, -13.52794], [32.86113, -13.47292], [33.0078, -13.19492], [32.98289, -13.12671], [33.02181, -12.88707], [32.96733, -12.88251], [32.94397, -12.76868], [33.05917, -12.59554], [33.18837, -12.61377], [33.28177, -12.54692], [33.37517, -12.54085], [33.54485, -12.35996], [33.47636, -12.32498], [33.3705, -12.34931], [33.25998, -12.14242], [33.33937, -11.91252], [33.32692, -11.59248], [33.24252, -11.59302], [33.23663, -11.40637], [33.29267, -11.43536], [33.29267, -11.3789], [33.39697, -11.15296], [33.25998, -10.88862], [33.28022, -10.84428], [33.47636, -10.78465], [33.70675, -10.56896], [33.54797, -10.36077], [33.53863, -10.20148], [33.31297, -10.05133], [33.37902, -9.9104], [33.36581, -9.81063], [33.31517, -9.82364], [33.2095, -9.61099], [33.12144, -9.58929], [33.10163, -9.66525], [33.05485, -9.61316], [33.00256, -9.63053], [33.00476, -9.5133], [32.95389, -9.40138]]]] } },
23452 { type: "Feature", properties: { iso1A2: "ZW", iso1A3: "ZWE", iso1N3: "716", wikidata: "Q954", nameEn: "Zimbabwe", groups: ["014", "202", "002", "UN"], driveSide: "left", callingCodes: ["263"] }, geometry: { type: "MultiPolygon", coordinates: [[[[30.41902, -15.62269], [30.35574, -15.6513], [29.8317, -15.6126], [29.4437, -15.68702], [29.21955, -15.76589], [29.01298, -15.93805], [28.9243, -15.93987], [28.8501, -16.04537], [28.81454, -16.48611], [28.76199, -16.51575], [28.73725, -16.5528], [27.83141, -16.96274], [27.62795, -17.24365], [27.61377, -17.34378], [27.30736, -17.60487], [27.14196, -17.81398], [26.89926, -17.98756], [26.74314, -18.0199], [26.68403, -18.07411], [26.55918, -17.99638], [26.21601, -17.88608], [26.0908, -17.93021], [26.08925, -17.98168], [25.85892, -17.97726], [25.85738, -17.91403], [25.6827, -17.81987], [25.51646, -17.86232], [25.26433, -17.79571], [25.23909, -17.90832], [25.31799, -18.07091], [25.39972, -18.12691], [25.53465, -18.39041], [25.68859, -18.56165], [25.79217, -18.6355], [25.82353, -18.82808], [25.94326, -18.90362], [25.99837, -19.02943], [25.96226, -19.08152], [26.17227, -19.53709], [26.72246, -19.92707], [27.21278, -20.08244], [27.29831, -20.28935], [27.28865, -20.49873], [27.69361, -20.48531], [27.72972, -20.51735], [27.69171, -21.08409], [27.91407, -21.31621], [28.01669, -21.57624], [28.29416, -21.59037], [28.49942, -21.66634], [28.58114, -21.63455], [29.07763, -21.81877], [29.04023, -21.85864], [29.02191, -21.90647], [29.02191, -21.95665], [29.04108, -22.00563], [29.08495, -22.04867], [29.14501, -22.07275], [29.1974, -22.07472], [29.24648, -22.05967], [29.3533, -22.18363], [29.37703, -22.19581], [29.64609, -22.12917], [29.76848, -22.14128], [29.92242, -22.19408], [30.13147, -22.30841], [30.2265, -22.2961], [30.28351, -22.35587], [30.38614, -22.34533], [30.48686, -22.31368], [30.6294, -22.32599], [30.86696, -22.28907], [31.08932, -22.34884], [31.16344, -22.32599], [31.30611, -22.422], [31.38336, -22.36919], [32.41234, -21.31246], [32.48236, -21.32873], [32.37115, -21.133], [32.51644, -20.91929], [32.48122, -20.63319], [32.55167, -20.56312], [32.66174, -20.56106], [32.85987, -20.27841], [32.85987, -20.16686], [32.93032, -20.03868], [33.01178, -20.02007], [33.06461, -19.77787], [32.95013, -19.67219], [32.84666, -19.68462], [32.84446, -19.48343], [32.78282, -19.47513], [32.77966, -19.36098], [32.85107, -19.29238], [32.87088, -19.09279], [32.84006, -19.0262], [32.72118, -19.02204], [32.69917, -18.94293], [32.73439, -18.92628], [32.70137, -18.84712], [32.82465, -18.77419], [32.9017, -18.7992], [32.95013, -18.69079], [32.88629, -18.58023], [32.88629, -18.51344], [33.02278, -18.4696], [33.03159, -18.35054], [32.94133, -17.99705], [33.0492, -17.60298], [32.98536, -17.55891], [32.96554, -17.48964], [33.0426, -17.3468], [33.00517, -17.30477], [32.96554, -17.11971], [32.84113, -16.92259], [32.91051, -16.89446], [32.97655, -16.70689], [32.78943, -16.70267], [32.69917, -16.66893], [32.71017, -16.59932], [32.42838, -16.4727], [32.28529, -16.43892], [32.02772, -16.43892], [31.91324, -16.41569], [31.90223, -16.34388], [31.67988, -16.19595], [31.42451, -16.15154], [31.30563, -16.01193], [31.13171, -15.98019], [30.97761, -16.05848], [30.91597, -15.99924], [30.42568, -15.9962], [30.41902, -15.62269]]]] } }
23454 var borders = borders_default;
23455 var _whichPolygon = {};
23456 var _featuresByCode = {};
23457 var idFilterRegex = /(?=(?!^(and|the|of|el|la|de)$))(\b(and|the|of|el|la|de)\b)|[-_ .,'()&[\]/]/gi;
23458 function canonicalID(id2) {
23459 const s2 = id2 || "";
23460 if (s2.charAt(0) === ".") {
23461 return s2.toUpperCase();
23463 return s2.replace(idFilterRegex, "").toUpperCase();
23472 "intermediateRegion",
23480 loadDerivedDataAndCaches(borders);
23481 function loadDerivedDataAndCaches(borders2) {
23482 const identifierProps = ["iso1A2", "iso1A3", "m49", "wikidata", "emojiFlag", "ccTLD", "nameEn"];
23483 let geometryFeatures = [];
23484 for (const feature22 of borders2.features) {
23485 const props = feature22.properties;
23486 props.id = props.iso1A2 || props.m49 || props.wikidata;
23487 loadM49(feature22);
23488 loadTLD(feature22);
23489 loadIsoStatus(feature22);
23490 loadLevel(feature22);
23491 loadGroups(feature22);
23492 loadFlag(feature22);
23493 cacheFeatureByIDs(feature22);
23494 if (feature22.geometry) {
23495 geometryFeatures.push(feature22);
23498 for (const feature22 of borders2.features) {
23499 feature22.properties.groups = feature22.properties.groups.map((groupID) => {
23500 return _featuresByCode[groupID].properties.id;
23502 loadMembersForGroupsOf(feature22);
23504 for (const feature22 of borders2.features) {
23505 loadRoadSpeedUnit(feature22);
23506 loadRoadHeightUnit(feature22);
23507 loadDriveSide(feature22);
23508 loadCallingCodes(feature22);
23509 loadGroupGroups(feature22);
23511 for (const feature22 of borders2.features) {
23512 feature22.properties.groups.sort((groupID1, groupID2) => {
23513 return levels.indexOf(_featuresByCode[groupID1].properties.level) - levels.indexOf(_featuresByCode[groupID2].properties.level);
23515 if (feature22.properties.members) {
23516 feature22.properties.members.sort((id1, id2) => {
23517 const diff = levels.indexOf(_featuresByCode[id1].properties.level) - levels.indexOf(_featuresByCode[id2].properties.level);
23519 return borders2.features.indexOf(_featuresByCode[id1]) - borders2.features.indexOf(_featuresByCode[id2]);
23525 const geometryOnlyCollection = {
23526 type: "FeatureCollection",
23527 features: geometryFeatures
23529 _whichPolygon = (0, import_which_polygon.default)(geometryOnlyCollection);
23530 function loadGroups(feature22) {
23531 const props = feature22.properties;
23532 if (!props.groups) {
23535 if (feature22.geometry && props.country) {
23536 props.groups.push(props.country);
23538 if (props.m49 !== "001") {
23539 props.groups.push("001");
23542 function loadM49(feature22) {
23543 const props = feature22.properties;
23544 if (!props.m49 && props.iso1N3) {
23545 props.m49 = props.iso1N3;
23548 function loadTLD(feature22) {
23549 const props = feature22.properties;
23550 if (props.level === "unitedNations")
23552 if (!props.ccTLD && props.iso1A2) {
23553 props.ccTLD = "." + props.iso1A2.toLowerCase();
23556 function loadIsoStatus(feature22) {
23557 const props = feature22.properties;
23558 if (!props.isoStatus && props.iso1A2) {
23559 props.isoStatus = "official";
23562 function loadLevel(feature22) {
23563 const props = feature22.properties;
23566 if (!props.country) {
23567 props.level = "country";
23568 } else if (!props.iso1A2 || props.isoStatus === "official") {
23569 props.level = "territory";
23571 props.level = "subterritory";
23574 function loadGroupGroups(feature22) {
23575 const props = feature22.properties;
23576 if (feature22.geometry || !props.members)
23578 const featureLevelIndex = levels.indexOf(props.level);
23579 let sharedGroups = [];
23580 props.members.forEach((memberID, index) => {
23581 const member = _featuresByCode[memberID];
23582 const memberGroups = member.properties.groups.filter((groupID) => {
23583 return groupID !== feature22.properties.id && featureLevelIndex < levels.indexOf(_featuresByCode[groupID].properties.level);
23586 sharedGroups = memberGroups;
23588 sharedGroups = sharedGroups.filter((groupID) => memberGroups.indexOf(groupID) !== -1);
23591 props.groups = props.groups.concat(
23592 sharedGroups.filter((groupID) => props.groups.indexOf(groupID) === -1)
23594 for (const groupID of sharedGroups) {
23595 const groupFeature = _featuresByCode[groupID];
23596 if (groupFeature.properties.members.indexOf(props.id) === -1) {
23597 groupFeature.properties.members.push(props.id);
23601 function loadRoadSpeedUnit(feature22) {
23602 const props = feature22.properties;
23603 if (feature22.geometry) {
23604 if (!props.roadSpeedUnit)
23605 props.roadSpeedUnit = "km/h";
23606 } else if (props.members) {
23607 const vals = Array.from(
23609 props.members.map((id2) => {
23610 const member = _featuresByCode[id2];
23611 if (member.geometry)
23612 return member.properties.roadSpeedUnit || "km/h";
23616 if (vals.length === 1)
23617 props.roadSpeedUnit = vals[0];
23620 function loadRoadHeightUnit(feature22) {
23621 const props = feature22.properties;
23622 if (feature22.geometry) {
23623 if (!props.roadHeightUnit)
23624 props.roadHeightUnit = "m";
23625 } else if (props.members) {
23626 const vals = Array.from(
23628 props.members.map((id2) => {
23629 const member = _featuresByCode[id2];
23630 if (member.geometry)
23631 return member.properties.roadHeightUnit || "m";
23635 if (vals.length === 1)
23636 props.roadHeightUnit = vals[0];
23639 function loadDriveSide(feature22) {
23640 const props = feature22.properties;
23641 if (feature22.geometry) {
23642 if (!props.driveSide)
23643 props.driveSide = "right";
23644 } else if (props.members) {
23645 const vals = Array.from(
23647 props.members.map((id2) => {
23648 const member = _featuresByCode[id2];
23649 if (member.geometry)
23650 return member.properties.driveSide || "right";
23654 if (vals.length === 1)
23655 props.driveSide = vals[0];
23658 function loadCallingCodes(feature22) {
23659 const props = feature22.properties;
23660 if (!feature22.geometry && props.members) {
23661 props.callingCodes = Array.from(
23663 props.members.reduce((array2, id2) => {
23664 const member = _featuresByCode[id2];
23665 if (member.geometry && member.properties.callingCodes) {
23666 return array2.concat(member.properties.callingCodes);
23674 function loadFlag(feature22) {
23675 if (!feature22.properties.iso1A2)
23677 const flag = feature22.properties.iso1A2.replace(/./g, function(char) {
23678 return String.fromCodePoint(char.charCodeAt(0) + 127397);
23680 feature22.properties.emojiFlag = flag;
23682 function loadMembersForGroupsOf(feature22) {
23683 for (const groupID of feature22.properties.groups) {
23684 const groupFeature = _featuresByCode[groupID];
23685 if (!groupFeature.properties.members) {
23686 groupFeature.properties.members = [];
23688 groupFeature.properties.members.push(feature22.properties.id);
23691 function cacheFeatureByIDs(feature22) {
23693 for (const prop of identifierProps) {
23694 const id2 = feature22.properties[prop];
23699 for (const alias of feature22.properties.aliases || []) {
23702 for (const id2 of ids) {
23703 const cid = canonicalID(id2);
23704 _featuresByCode[cid] = feature22;
23708 function locArray(loc) {
23709 if (Array.isArray(loc)) {
23711 } else if (loc.coordinates) {
23712 return loc.coordinates;
23714 return loc.geometry.coordinates;
23716 function smallestFeature(loc) {
23717 const query = locArray(loc);
23718 const featureProperties = _whichPolygon(query);
23719 if (!featureProperties)
23721 return _featuresByCode[featureProperties.id];
23723 function countryFeature(loc) {
23724 const feature22 = smallestFeature(loc);
23727 const countryCode = feature22.properties.country || feature22.properties.iso1A2;
23728 return _featuresByCode[countryCode] || null;
23730 var defaultOpts = {
23735 function featureForLoc(loc, opts) {
23736 const targetLevel = opts.level || "country";
23737 const maxLevel = opts.maxLevel || "world";
23738 const withProp = opts.withProp;
23739 const targetLevelIndex = levels.indexOf(targetLevel);
23740 if (targetLevelIndex === -1)
23742 const maxLevelIndex = levels.indexOf(maxLevel);
23743 if (maxLevelIndex === -1)
23745 if (maxLevelIndex < targetLevelIndex)
23747 if (targetLevel === "country") {
23748 const fastFeature = countryFeature(loc);
23750 if (!withProp || fastFeature.properties[withProp]) {
23751 return fastFeature;
23755 const features = featuresContaining(loc);
23756 const match = features.find((feature22) => {
23757 let levelIndex = levels.indexOf(feature22.properties.level);
23758 if (feature22.properties.level === targetLevel || // if no feature exists at the target level, return the first feature at the next level up
23759 levelIndex > targetLevelIndex && levelIndex <= maxLevelIndex) {
23760 if (!withProp || feature22.properties[withProp]) {
23766 return match || null;
23768 function featureForID(id2) {
23770 if (typeof id2 === "number") {
23771 stringID = id2.toString();
23772 if (stringID.length === 1) {
23773 stringID = "00" + stringID;
23774 } else if (stringID.length === 2) {
23775 stringID = "0" + stringID;
23778 stringID = canonicalID(id2);
23780 return _featuresByCode[stringID] || null;
23782 function smallestFeaturesForBbox(bbox2) {
23783 return _whichPolygon.bbox(bbox2).map((props) => _featuresByCode[props.id]);
23785 function smallestOrMatchingFeature(query) {
23786 if (typeof query === "object") {
23787 return smallestFeature(query);
23789 return featureForID(query);
23791 function feature(query, opts = defaultOpts) {
23792 if (typeof query === "object") {
23793 return featureForLoc(query, opts);
23795 return featureForID(query);
23797 function iso1A2Code(query, opts = defaultOpts) {
23798 opts.withProp = "iso1A2";
23799 const match = feature(query, opts);
23802 return match.properties.iso1A2 || null;
23804 function propertiesForQuery(query, property) {
23805 const features = featuresContaining(query, false);
23806 return features.map((feature22) => feature22.properties[property]).filter(Boolean);
23808 function iso1A2Codes(query) {
23809 return propertiesForQuery(query, "iso1A2");
23811 function featuresContaining(query, strict) {
23812 let matchingFeatures;
23813 if (Array.isArray(query) && query.length === 4) {
23814 matchingFeatures = smallestFeaturesForBbox(query);
23816 const smallestOrMatching = smallestOrMatchingFeature(query);
23817 matchingFeatures = smallestOrMatching ? [smallestOrMatching] : [];
23819 if (!matchingFeatures.length)
23821 let returnFeatures;
23822 if (!strict || typeof query === "object") {
23823 returnFeatures = matchingFeatures.slice();
23825 returnFeatures = [];
23827 for (const feature22 of matchingFeatures) {
23828 const properties = feature22.properties;
23829 for (const groupID of properties.groups) {
23830 const groupFeature = _featuresByCode[groupID];
23831 if (returnFeatures.indexOf(groupFeature) === -1) {
23832 returnFeatures.push(groupFeature);
23836 return returnFeatures;
23838 function featuresIn(id2, strict) {
23839 const feature22 = featureForID(id2);
23844 features.push(feature22);
23846 const properties = feature22.properties;
23847 for (const memberID of properties.members || []) {
23848 features.push(_featuresByCode[memberID]);
23852 function aggregateFeature(id2) {
23853 const features = featuresIn(id2, false);
23854 if (features.length === 0)
23856 let aggregateCoordinates = [];
23857 for (const feature22 of features) {
23858 if (feature22.geometry?.type === "MultiPolygon" && feature22.geometry.coordinates) {
23859 aggregateCoordinates = aggregateCoordinates.concat(feature22.geometry.coordinates);
23864 properties: features[0].properties,
23866 type: "MultiPolygon",
23867 coordinates: aggregateCoordinates
23871 function roadSpeedUnit(query) {
23872 const feature22 = smallestOrMatchingFeature(query);
23873 return feature22 && feature22.properties.roadSpeedUnit || null;
23875 function roadHeightUnit(query) {
23876 const feature22 = smallestOrMatchingFeature(query);
23877 return feature22 && feature22.properties.roadHeightUnit || null;
23880 // node_modules/@rapideditor/location-conflation/index.mjs
23881 var import_geojson_area = __toESM(require_geojson_area(), 1);
23882 var import_circle_to_polygon = __toESM(require_circle_to_polygon(), 1);
23883 var import_polygon_clipping = __toESM(require_polygon_clipping_umd(), 1);
23884 var import_geojson_precision = __toESM(require_geojson_precision(), 1);
23885 var import_json_stringify_pretty_compact = __toESM(require_json_stringify_pretty_compact(), 1);
23886 var location_conflation_default = class {
23889 // `fc` Optional FeatureCollection of known features
23891 // Optionally pass a GeoJSON FeatureCollection of known features which we can refer to later.
23892 // Each feature must have a filename-like `id`, for example: `something.geojson`
23895 // "type": "FeatureCollection"
23898 // "type": "Feature",
23899 // "id": "philly_metro.geojson",
23900 // "properties": { … },
23901 // "geometry": { … }
23907 this._strict = true;
23908 if (fc && fc.type === "FeatureCollection" && Array.isArray(fc.features)) {
23909 fc.features.forEach((feature3) => {
23910 feature3.properties = feature3.properties || {};
23911 let props = feature3.properties;
23912 let id2 = feature3.id || props.id;
23913 if (!id2 || !/^\S+\.geojson$/i.test(id2))
23915 id2 = id2.toLowerCase();
23919 const area = import_geojson_area.default.geometry(feature3.geometry) / 1e6;
23920 props.area = Number(area.toFixed(2));
23922 this._cache[id2] = feature3;
23925 let world = _cloneDeep(feature("Q2"));
23928 coordinates: [[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]]
23931 world.properties.id = "Q2";
23932 world.properties.area = import_geojson_area.default.geometry(world.geometry) / 1e6;
23933 this._cache.Q2 = world;
23935 // validateLocation
23936 // `location` The location to validate
23938 // Pass a `location` value to validate
23940 // Returns a result like:
23942 // type: 'point', 'geojson', or 'countrycoder'
23943 // location: the queried location
23944 // id: the stable identifier for the feature
23946 // or `null` if the location is invalid
23948 validateLocation(location) {
23949 if (Array.isArray(location) && (location.length === 2 || location.length === 3)) {
23950 const lon = location[0];
23951 const lat = location[1];
23952 const radius = location[2];
23953 if (Number.isFinite(lon) && lon >= -180 && lon <= 180 && Number.isFinite(lat) && lat >= -90 && lat <= 90 && (location.length === 2 || Number.isFinite(radius) && radius > 0)) {
23954 const id2 = "[" + location.toString() + "]";
23955 return { type: "point", location, id: id2 };
23957 } else if (typeof location === "string" && /^\S+\.geojson$/i.test(location)) {
23958 const id2 = location.toLowerCase();
23959 if (this._cache[id2]) {
23960 return { type: "geojson", location, id: id2 };
23962 } else if (typeof location === "string" || typeof location === "number") {
23963 const feature3 = feature(location);
23965 const id2 = feature3.properties.wikidata;
23966 return { type: "countrycoder", location, id: id2 };
23969 if (this._strict) {
23970 throw new Error(`validateLocation: Invalid location: "${location}".`);
23976 // `location` The location to resolve
23978 // Pass a `location` value to resolve
23980 // Returns a result like:
23982 // type: 'point', 'geojson', or 'countrycoder'
23983 // location: the queried location
23984 // id: a stable identifier for the feature
23985 // feature: the resolved GeoJSON feature
23987 // or `null` if the location is invalid
23989 resolveLocation(location) {
23990 const valid = this.validateLocation(location);
23993 const id2 = valid.id;
23994 if (this._cache[id2]) {
23995 return Object.assign(valid, { feature: this._cache[id2] });
23997 if (valid.type === "point") {
23998 const lon = location[0];
23999 const lat = location[1];
24000 const radius = location[2] || 25;
24002 const PRECISION = 3;
24003 const area = Math.PI * radius * radius;
24004 const feature3 = this._cache[id2] = (0, import_geojson_precision.default)({
24007 properties: { id: id2, area: Number(area.toFixed(2)) },
24008 geometry: (0, import_circle_to_polygon.default)([lon, lat], radius * 1e3, EDGES)
24011 return Object.assign(valid, { feature: feature3 });
24012 } else if (valid.type === "geojson") {
24013 } else if (valid.type === "countrycoder") {
24014 let feature3 = _cloneDeep(feature(id2));
24015 let props = feature3.properties;
24016 if (Array.isArray(props.members)) {
24017 let aggregate = aggregateFeature(id2);
24018 aggregate.geometry.coordinates = _clip([aggregate], "UNION").geometry.coordinates;
24019 feature3.geometry = aggregate.geometry;
24022 const area = import_geojson_area.default.geometry(feature3.geometry) / 1e6;
24023 props.area = Number(area.toFixed(2));
24027 this._cache[id2] = feature3;
24028 return Object.assign(valid, { feature: feature3 });
24030 if (this._strict) {
24031 throw new Error(`resolveLocation: Couldn't resolve location "${location}".`);
24036 // validateLocationSet
24037 // `locationSet` the locationSet to validate
24039 // Pass a locationSet Object to validate like:
24041 // include: [ Array of locations ],
24042 // exclude: [ Array of locations ]
24045 // Returns a result like:
24047 // type: 'locationset'
24048 // locationSet: the queried locationSet
24049 // id: the stable identifier for the feature
24051 // or `null` if the locationSet is invalid
24053 validateLocationSet(locationSet) {
24054 locationSet = locationSet || {};
24055 const validator = this.validateLocation.bind(this);
24056 let include = (locationSet.include || []).map(validator).filter(Boolean);
24057 let exclude = (locationSet.exclude || []).map(validator).filter(Boolean);
24058 if (!include.length) {
24059 if (this._strict) {
24060 throw new Error(`validateLocationSet: LocationSet includes nothing.`);
24062 locationSet.include = ["Q2"];
24063 include = [{ type: "countrycoder", location: "Q2", id: "Q2" }];
24066 include.sort(_sortLocations);
24067 let id2 = "+[" + include.map((d2) => d2.id).join(",") + "]";
24068 if (exclude.length) {
24069 exclude.sort(_sortLocations);
24070 id2 += "-[" + exclude.map((d2) => d2.id).join(",") + "]";
24072 return { type: "locationset", locationSet, id: id2 };
24074 // resolveLocationSet
24075 // `locationSet` the locationSet to resolve
24077 // Pass a locationSet Object to validate like:
24079 // include: [ Array of locations ],
24080 // exclude: [ Array of locations ]
24083 // Returns a result like:
24085 // type: 'locationset'
24086 // locationSet: the queried locationSet
24087 // id: the stable identifier for the feature
24088 // feature: the resolved GeoJSON feature
24090 // or `null` if the locationSet is invalid
24092 resolveLocationSet(locationSet) {
24093 locationSet = locationSet || {};
24094 const valid = this.validateLocationSet(locationSet);
24097 const id2 = valid.id;
24098 if (this._cache[id2]) {
24099 return Object.assign(valid, { feature: this._cache[id2] });
24101 const resolver = this.resolveLocation.bind(this);
24102 const includes = (locationSet.include || []).map(resolver).filter(Boolean);
24103 const excludes = (locationSet.exclude || []).map(resolver).filter(Boolean);
24104 if (includes.length === 1 && excludes.length === 0) {
24105 return Object.assign(valid, { feature: includes[0].feature });
24107 const includeGeoJSON = _clip(includes.map((d2) => d2.feature), "UNION");
24108 const excludeGeoJSON = _clip(excludes.map((d2) => d2.feature), "UNION");
24109 let resultGeoJSON = excludeGeoJSON ? _clip([includeGeoJSON, excludeGeoJSON], "DIFFERENCE") : includeGeoJSON;
24110 const area = import_geojson_area.default.geometry(resultGeoJSON.geometry) / 1e6;
24111 resultGeoJSON.id = id2;
24112 resultGeoJSON.properties = { id: id2, area: Number(area.toFixed(2)) };
24113 this._cache[id2] = resultGeoJSON;
24114 return Object.assign(valid, { feature: resultGeoJSON });
24119 if (val === void 0) {
24120 return this._strict;
24122 this._strict = val;
24127 // convenience method to access the internal cache
24129 return this._cache;
24132 // convenience method to prettyStringify the given object
24133 stringify(obj, options2) {
24134 return (0, import_json_stringify_pretty_compact.default)(obj, options2);
24137 function _clip(features, which) {
24138 if (!Array.isArray(features) || !features.length)
24140 const fn = { UNION: import_polygon_clipping.default.union, DIFFERENCE: import_polygon_clipping.default.difference }[which];
24141 const args = features.map((feature3) => feature3.geometry.coordinates);
24142 const coords = fn.apply(null, args);
24147 type: whichType(coords),
24148 coordinates: coords
24151 function whichType(coords2) {
24152 const a2 = Array.isArray(coords2);
24153 const b2 = a2 && Array.isArray(coords2[0]);
24154 const c2 = b2 && Array.isArray(coords2[0][0]);
24155 const d2 = c2 && Array.isArray(coords2[0][0][0]);
24156 return d2 ? "MultiPolygon" : "Polygon";
24159 function _cloneDeep(obj) {
24160 return JSON.parse(JSON.stringify(obj));
24162 function _sortLocations(a2, b2) {
24163 const rank = { countrycoder: 1, geojson: 2, point: 3 };
24164 const aRank = rank[a2.type];
24165 const bRank = rank[b2.type];
24166 return aRank > bRank ? 1 : aRank < bRank ? -1 : a2.id.localeCompare(b2.id);
24169 // modules/core/LocationManager.js
24170 var import_which_polygon2 = __toESM(require_which_polygon());
24171 var import_geojson_area2 = __toESM(require_geojson_area());
24172 var _loco = new location_conflation_default();
24173 var LocationManager = class {
24179 this._resolved = /* @__PURE__ */ new Map();
24180 this._knownLocationSets = /* @__PURE__ */ new Map();
24181 this._locationIncludedIn = /* @__PURE__ */ new Map();
24182 this._locationExcludedIn = /* @__PURE__ */ new Map();
24183 const world = { locationSet: { include: ["Q2"] } };
24184 this._resolveLocationSet(world);
24185 this._rebuildIndex();
24188 * _validateLocationSet
24189 * Pass an Object with a `locationSet` property.
24190 * Validates the `locationSet` and sets a `locationSetID` property on the object.
24191 * To avoid so much computation we only resolve the include and exclude regions, but not the locationSet itself.
24193 * Use `_resolveLocationSet()` instead if you need to resolve geojson of locationSet, for example to render it.
24194 * Note: You need to call `_rebuildIndex()` after you're all finished validating the locationSets.
24196 * @param `obj` Object to check, it should have `locationSet` property
24198 _validateLocationSet(obj) {
24199 if (obj.locationSetID)
24202 let locationSet = obj.locationSet;
24203 if (!locationSet) {
24204 throw new Error("object missing locationSet property");
24206 if (!locationSet.include) {
24207 locationSet.include = ["Q2"];
24209 const locationSetID = _loco.validateLocationSet(locationSet).id;
24210 obj.locationSetID = locationSetID;
24211 if (this._knownLocationSets.has(locationSetID))
24214 (locationSet.include || []).forEach((location) => {
24215 const locationID = _loco.validateLocation(location).id;
24216 let geojson = this._resolved.get(locationID);
24218 geojson = _loco.resolveLocation(location).feature;
24219 this._resolved.set(locationID, geojson);
24221 area += geojson.properties.area;
24222 let s2 = this._locationIncludedIn.get(locationID);
24224 s2 = /* @__PURE__ */ new Set();
24225 this._locationIncludedIn.set(locationID, s2);
24227 s2.add(locationSetID);
24229 (locationSet.exclude || []).forEach((location) => {
24230 const locationID = _loco.validateLocation(location).id;
24231 let geojson = this._resolved.get(locationID);
24233 geojson = _loco.resolveLocation(location).feature;
24234 this._resolved.set(locationID, geojson);
24236 area -= geojson.properties.area;
24237 let s2 = this._locationExcludedIn.get(locationID);
24239 s2 = /* @__PURE__ */ new Set();
24240 this._locationExcludedIn.set(locationID, s2);
24242 s2.add(locationSetID);
24244 this._knownLocationSets.set(locationSetID, area);
24246 obj.locationSet = { include: ["Q2"] };
24247 obj.locationSetID = "+[Q2]";
24251 * _resolveLocationSet
24252 * Does everything that `_validateLocationSet()` does, but then "resolves" the locationSet into GeoJSON.
24253 * This step is a bit more computationally expensive, so really only needed if you intend to render the shape.
24255 * Note: You need to call `_rebuildIndex()` after you're all finished validating the locationSets.
24257 * @param `obj` Object to check, it should have `locationSet` property
24259 _resolveLocationSet(obj) {
24260 this._validateLocationSet(obj);
24261 if (this._resolved.has(obj.locationSetID))
24264 const result = _loco.resolveLocationSet(obj.locationSet);
24265 const locationSetID = result.id;
24266 obj.locationSetID = locationSetID;
24267 if (!result.feature.geometry.coordinates.length || !result.feature.properties.area) {
24268 throw new Error(`locationSet ${locationSetID} resolves to an empty feature.`);
24270 let geojson = JSON.parse(JSON.stringify(result.feature));
24271 geojson.id = locationSetID;
24272 geojson.properties.id = locationSetID;
24273 this._resolved.set(locationSetID, geojson);
24275 obj.locationSet = { include: ["Q2"] };
24276 obj.locationSetID = "+[Q2]";
24281 * Rebuilds the whichPolygon index with whatever features have been resolved into GeoJSON.
24284 this._wp = (0, import_which_polygon2.default)({ features: [...this._resolved.values()] });
24287 * mergeCustomGeoJSON
24288 * Accepts a FeatureCollection-like object containing custom locations
24289 * Each feature must have a filename-like `id`, for example: `something.geojson`
24291 * "type": "FeatureCollection"
24294 * "type": "Feature",
24295 * "id": "philly_metro.geojson",
24296 * "properties": { … },
24297 * "geometry": { … }
24302 * @param `fc` FeatureCollection-like Object containing custom locations
24304 mergeCustomGeoJSON(fc) {
24305 if (!fc || fc.type !== "FeatureCollection" || !Array.isArray(fc.features))
24307 fc.features.forEach((feature3) => {
24308 feature3.properties = feature3.properties || {};
24309 let props = feature3.properties;
24310 let id2 = feature3.id || props.id;
24311 if (!id2 || !/^\S+\.geojson$/i.test(id2))
24313 id2 = id2.toLowerCase();
24317 const area = import_geojson_area2.default.geometry(feature3.geometry) / 1e6;
24318 props.area = Number(area.toFixed(2));
24320 _loco._cache[id2] = feature3;
24324 * mergeLocationSets
24325 * Accepts an Array of Objects containing `locationSet` properties:
24327 * { id: 'preset1', locationSet: {…} },
24328 * { id: 'preset2', locationSet: {…} },
24331 * After validating, the Objects will be decorated with a `locationSetID` property:
24333 * { id: 'preset1', locationSet: {…}, locationSetID: '+[Q2]' },
24334 * { id: 'preset2', locationSet: {…}, locationSetID: '+[Q30]' },
24338 * @param `objects` Objects to check - they should have `locationSet` property
24339 * @return Promise resolved true (this function used to be slow/async, now it's faster and sync)
24341 mergeLocationSets(objects) {
24342 if (!Array.isArray(objects))
24343 return Promise.reject("nothing to do");
24344 objects.forEach((obj) => this._validateLocationSet(obj));
24345 this._rebuildIndex();
24346 return Promise.resolve(objects);
24350 * Returns a locationSetID for a given locationSet (fallback to `+[Q2]`, world)
24351 * (The locationSet doesn't necessarily need to be resolved to compute its `id`)
24353 * @param `locationSet` A locationSet Object, e.g. `{ include: ['us'] }`
24354 * @return String locationSetID, e.g. `+[Q30]`
24356 locationSetID(locationSet) {
24359 locationSetID = _loco.validateLocationSet(locationSet).id;
24361 locationSetID = "+[Q2]";
24363 return locationSetID;
24367 * Returns the resolved GeoJSON feature for a given locationSetID (fallback to 'world')
24368 * A GeoJSON feature:
24372 * properties: { id: '+[Q30]', area: 21817019.17, … },
24376 * @param `locationSetID` String identifier, e.g. `+[Q30]`
24377 * @return GeoJSON object (fallback to world)
24379 feature(locationSetID = "+[Q2]") {
24380 const feature3 = this._resolved.get(locationSetID);
24381 return feature3 || this._resolved.get("+[Q2]");
24385 * Find all the locationSets valid at the given location.
24386 * Results include the area (in km²) to facilitate sorting.
24388 * Object of locationSetIDs to areas (in km²)
24390 * "+[Q2]": 511207893.3958111,
24391 * "+[Q30]": 21817019.17,
24392 * "+[new_jersey.geojson]": 22390.77,
24396 * @param `loc` `[lon,lat]` location to query, e.g. `[-74.4813, 40.7967]`
24397 * @return Object of locationSetIDs valid at given location
24399 locationSetsAt(loc) {
24401 const hits = this._wp(loc, true) || [];
24403 hits.forEach((prop) => {
24404 if (prop.id[0] !== "+")
24406 const locationSetID = prop.id;
24407 const area = thiz._knownLocationSets.get(locationSetID);
24409 result[locationSetID] = area;
24412 hits.forEach((prop) => {
24413 if (prop.id[0] === "+")
24415 const locationID = prop.id;
24416 const included = thiz._locationIncludedIn.get(locationID);
24417 (included || []).forEach((locationSetID) => {
24418 const area = thiz._knownLocationSets.get(locationSetID);
24420 result[locationSetID] = area;
24424 hits.forEach((prop) => {
24425 if (prop.id[0] === "+")
24427 const locationID = prop.id;
24428 const excluded = thiz._locationExcludedIn.get(locationID);
24429 (excluded || []).forEach((locationSetID) => {
24430 delete result[locationSetID];
24435 // Direct access to the location-conflation resolver
24440 var _sharedLocationManager = new LocationManager();
24442 // node_modules/lodash-es/_freeGlobal.js
24443 var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
24444 var freeGlobal_default = freeGlobal;
24446 // node_modules/lodash-es/_root.js
24447 var freeSelf = typeof self == "object" && self && self.Object === Object && self;
24448 var root2 = freeGlobal_default || freeSelf || Function("return this")();
24449 var root_default = root2;
24451 // node_modules/lodash-es/_Symbol.js
24452 var Symbol2 = root_default.Symbol;
24453 var Symbol_default = Symbol2;
24455 // node_modules/lodash-es/_getRawTag.js
24456 var objectProto = Object.prototype;
24457 var hasOwnProperty = objectProto.hasOwnProperty;
24458 var nativeObjectToString = objectProto.toString;
24459 var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
24460 function getRawTag(value) {
24461 var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
24463 value[symToStringTag] = void 0;
24464 var unmasked = true;
24467 var result = nativeObjectToString.call(value);
24470 value[symToStringTag] = tag;
24472 delete value[symToStringTag];
24477 var getRawTag_default = getRawTag;
24479 // node_modules/lodash-es/_objectToString.js
24480 var objectProto2 = Object.prototype;
24481 var nativeObjectToString2 = objectProto2.toString;
24482 function objectToString(value) {
24483 return nativeObjectToString2.call(value);
24485 var objectToString_default = objectToString;
24487 // node_modules/lodash-es/_baseGetTag.js
24488 var nullTag = "[object Null]";
24489 var undefinedTag = "[object Undefined]";
24490 var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
24491 function baseGetTag(value) {
24492 if (value == null) {
24493 return value === void 0 ? undefinedTag : nullTag;
24495 return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
24497 var baseGetTag_default = baseGetTag;
24499 // node_modules/lodash-es/isObjectLike.js
24500 function isObjectLike(value) {
24501 return value != null && typeof value == "object";
24503 var isObjectLike_default = isObjectLike;
24505 // node_modules/lodash-es/isSymbol.js
24506 var symbolTag = "[object Symbol]";
24507 function isSymbol(value) {
24508 return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
24510 var isSymbol_default = isSymbol;
24512 // node_modules/lodash-es/_arrayMap.js
24513 function arrayMap(array2, iteratee) {
24514 var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
24515 while (++index < length) {
24516 result[index] = iteratee(array2[index], index, array2);
24520 var arrayMap_default = arrayMap;
24522 // node_modules/lodash-es/isArray.js
24523 var isArray = Array.isArray;
24524 var isArray_default = isArray;
24526 // node_modules/lodash-es/_baseToString.js
24527 var INFINITY = 1 / 0;
24528 var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
24529 var symbolToString = symbolProto ? symbolProto.toString : void 0;
24530 function baseToString(value) {
24531 if (typeof value == "string") {
24534 if (isArray_default(value)) {
24535 return arrayMap_default(value, baseToString) + "";
24537 if (isSymbol_default(value)) {
24538 return symbolToString ? symbolToString.call(value) : "";
24540 var result = value + "";
24541 return result == "0" && 1 / value == -INFINITY ? "-0" : result;
24543 var baseToString_default = baseToString;
24545 // node_modules/lodash-es/_trimmedEndIndex.js
24546 var reWhitespace = /\s/;
24547 function trimmedEndIndex(string) {
24548 var index = string.length;
24549 while (index-- && reWhitespace.test(string.charAt(index))) {
24553 var trimmedEndIndex_default = trimmedEndIndex;
24555 // node_modules/lodash-es/_baseTrim.js
24556 var reTrimStart = /^\s+/;
24557 function baseTrim(string) {
24558 return string ? string.slice(0, trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
24560 var baseTrim_default = baseTrim;
24562 // node_modules/lodash-es/isObject.js
24563 function isObject(value) {
24564 var type2 = typeof value;
24565 return value != null && (type2 == "object" || type2 == "function");
24567 var isObject_default = isObject;
24569 // node_modules/lodash-es/toNumber.js
24571 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
24572 var reIsBinary = /^0b[01]+$/i;
24573 var reIsOctal = /^0o[0-7]+$/i;
24574 var freeParseInt = parseInt;
24575 function toNumber(value) {
24576 if (typeof value == "number") {
24579 if (isSymbol_default(value)) {
24582 if (isObject_default(value)) {
24583 var other = typeof value.valueOf == "function" ? value.valueOf() : value;
24584 value = isObject_default(other) ? other + "" : other;
24586 if (typeof value != "string") {
24587 return value === 0 ? value : +value;
24589 value = baseTrim_default(value);
24590 var isBinary = reIsBinary.test(value);
24591 return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
24593 var toNumber_default = toNumber;
24595 // node_modules/lodash-es/isFunction.js
24596 var asyncTag = "[object AsyncFunction]";
24597 var funcTag = "[object Function]";
24598 var genTag = "[object GeneratorFunction]";
24599 var proxyTag = "[object Proxy]";
24600 function isFunction(value) {
24601 if (!isObject_default(value)) {
24604 var tag = baseGetTag_default(value);
24605 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
24607 var isFunction_default = isFunction;
24609 // node_modules/lodash-es/_coreJsData.js
24610 var coreJsData = root_default["__core-js_shared__"];
24611 var coreJsData_default = coreJsData;
24613 // node_modules/lodash-es/_isMasked.js
24614 var maskSrcKey = function() {
24615 var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
24616 return uid ? "Symbol(src)_1." + uid : "";
24618 function isMasked(func) {
24619 return !!maskSrcKey && maskSrcKey in func;
24621 var isMasked_default = isMasked;
24623 // node_modules/lodash-es/_toSource.js
24624 var funcProto = Function.prototype;
24625 var funcToString = funcProto.toString;
24626 function toSource(func) {
24627 if (func != null) {
24629 return funcToString.call(func);
24639 var toSource_default = toSource;
24641 // node_modules/lodash-es/_baseIsNative.js
24642 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
24643 var reIsHostCtor = /^\[object .+?Constructor\]$/;
24644 var funcProto2 = Function.prototype;
24645 var objectProto3 = Object.prototype;
24646 var funcToString2 = funcProto2.toString;
24647 var hasOwnProperty2 = objectProto3.hasOwnProperty;
24648 var reIsNative = RegExp(
24649 "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
24651 function baseIsNative(value) {
24652 if (!isObject_default(value) || isMasked_default(value)) {
24655 var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
24656 return pattern.test(toSource_default(value));
24658 var baseIsNative_default = baseIsNative;
24660 // node_modules/lodash-es/_getValue.js
24661 function getValue(object, key) {
24662 return object == null ? void 0 : object[key];
24664 var getValue_default = getValue;
24666 // node_modules/lodash-es/_getNative.js
24667 function getNative(object, key) {
24668 var value = getValue_default(object, key);
24669 return baseIsNative_default(value) ? value : void 0;
24671 var getNative_default = getNative;
24673 // node_modules/lodash-es/_WeakMap.js
24674 var WeakMap = getNative_default(root_default, "WeakMap");
24675 var WeakMap_default = WeakMap;
24677 // node_modules/lodash-es/_isIndex.js
24678 var MAX_SAFE_INTEGER = 9007199254740991;
24679 var reIsUint = /^(?:0|[1-9]\d*)$/;
24680 function isIndex(value, length) {
24681 var type2 = typeof value;
24682 length = length == null ? MAX_SAFE_INTEGER : length;
24683 return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
24685 var isIndex_default = isIndex;
24687 // node_modules/lodash-es/eq.js
24688 function eq(value, other) {
24689 return value === other || value !== value && other !== other;
24691 var eq_default = eq;
24693 // node_modules/lodash-es/isLength.js
24694 var MAX_SAFE_INTEGER2 = 9007199254740991;
24695 function isLength(value) {
24696 return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
24698 var isLength_default = isLength;
24700 // node_modules/lodash-es/isArrayLike.js
24701 function isArrayLike(value) {
24702 return value != null && isLength_default(value.length) && !isFunction_default(value);
24704 var isArrayLike_default = isArrayLike;
24706 // node_modules/lodash-es/_isPrototype.js
24707 var objectProto4 = Object.prototype;
24708 function isPrototype(value) {
24709 var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto4;
24710 return value === proto;
24712 var isPrototype_default = isPrototype;
24714 // node_modules/lodash-es/_baseTimes.js
24715 function baseTimes(n3, iteratee) {
24716 var index = -1, result = Array(n3);
24717 while (++index < n3) {
24718 result[index] = iteratee(index);
24722 var baseTimes_default = baseTimes;
24724 // node_modules/lodash-es/_baseIsArguments.js
24725 var argsTag = "[object Arguments]";
24726 function baseIsArguments(value) {
24727 return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
24729 var baseIsArguments_default = baseIsArguments;
24731 // node_modules/lodash-es/isArguments.js
24732 var objectProto5 = Object.prototype;
24733 var hasOwnProperty3 = objectProto5.hasOwnProperty;
24734 var propertyIsEnumerable = objectProto5.propertyIsEnumerable;
24735 var isArguments = baseIsArguments_default(function() {
24737 }()) ? baseIsArguments_default : function(value) {
24738 return isObjectLike_default(value) && hasOwnProperty3.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
24740 var isArguments_default = isArguments;
24742 // node_modules/lodash-es/stubFalse.js
24743 function stubFalse() {
24746 var stubFalse_default = stubFalse;
24748 // node_modules/lodash-es/isBuffer.js
24749 var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
24750 var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
24751 var moduleExports = freeModule && freeModule.exports === freeExports;
24752 var Buffer2 = moduleExports ? root_default.Buffer : void 0;
24753 var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
24754 var isBuffer = nativeIsBuffer || stubFalse_default;
24755 var isBuffer_default = isBuffer;
24757 // node_modules/lodash-es/_baseIsTypedArray.js
24758 var argsTag2 = "[object Arguments]";
24759 var arrayTag = "[object Array]";
24760 var boolTag = "[object Boolean]";
24761 var dateTag = "[object Date]";
24762 var errorTag = "[object Error]";
24763 var funcTag2 = "[object Function]";
24764 var mapTag = "[object Map]";
24765 var numberTag = "[object Number]";
24766 var objectTag = "[object Object]";
24767 var regexpTag = "[object RegExp]";
24768 var setTag = "[object Set]";
24769 var stringTag = "[object String]";
24770 var weakMapTag = "[object WeakMap]";
24771 var arrayBufferTag = "[object ArrayBuffer]";
24772 var dataViewTag = "[object DataView]";
24773 var float32Tag = "[object Float32Array]";
24774 var float64Tag = "[object Float64Array]";
24775 var int8Tag = "[object Int8Array]";
24776 var int16Tag = "[object Int16Array]";
24777 var int32Tag = "[object Int32Array]";
24778 var uint8Tag = "[object Uint8Array]";
24779 var uint8ClampedTag = "[object Uint8ClampedArray]";
24780 var uint16Tag = "[object Uint16Array]";
24781 var uint32Tag = "[object Uint32Array]";
24782 var typedArrayTags = {};
24783 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
24784 typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
24785 function baseIsTypedArray(value) {
24786 return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
24788 var baseIsTypedArray_default = baseIsTypedArray;
24790 // node_modules/lodash-es/_baseUnary.js
24791 function baseUnary(func) {
24792 return function(value) {
24793 return func(value);
24796 var baseUnary_default = baseUnary;
24798 // node_modules/lodash-es/_nodeUtil.js
24799 var freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
24800 var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
24801 var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
24802 var freeProcess = moduleExports2 && freeGlobal_default.process;
24803 var nodeUtil = function() {
24805 var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
24809 return freeProcess && freeProcess.binding && freeProcess.binding("util");
24813 var nodeUtil_default = nodeUtil;
24815 // node_modules/lodash-es/isTypedArray.js
24816 var nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
24817 var isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
24818 var isTypedArray_default = isTypedArray;
24820 // node_modules/lodash-es/_arrayLikeKeys.js
24821 var objectProto6 = Object.prototype;
24822 var hasOwnProperty4 = objectProto6.hasOwnProperty;
24823 function arrayLikeKeys(value, inherited) {
24824 var isArr = isArray_default(value), isArg = !isArr && isArguments_default(value), isBuff = !isArr && !isArg && isBuffer_default(value), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes_default(value.length, String) : [], length = result.length;
24825 for (var key in value) {
24826 if ((inherited || hasOwnProperty4.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
24827 (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
24828 isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
24829 isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
24830 isIndex_default(key, length)))) {
24836 var arrayLikeKeys_default = arrayLikeKeys;
24838 // node_modules/lodash-es/_overArg.js
24839 function overArg(func, transform2) {
24840 return function(arg) {
24841 return func(transform2(arg));
24844 var overArg_default = overArg;
24846 // node_modules/lodash-es/_nativeKeys.js
24847 var nativeKeys = overArg_default(Object.keys, Object);
24848 var nativeKeys_default = nativeKeys;
24850 // node_modules/lodash-es/_baseKeys.js
24851 var objectProto7 = Object.prototype;
24852 var hasOwnProperty5 = objectProto7.hasOwnProperty;
24853 function baseKeys(object) {
24854 if (!isPrototype_default(object)) {
24855 return nativeKeys_default(object);
24858 for (var key in Object(object)) {
24859 if (hasOwnProperty5.call(object, key) && key != "constructor") {
24865 var baseKeys_default = baseKeys;
24867 // node_modules/lodash-es/keys.js
24868 function keys(object) {
24869 return isArrayLike_default(object) ? arrayLikeKeys_default(object) : baseKeys_default(object);
24871 var keys_default = keys;
24873 // node_modules/lodash-es/_nativeCreate.js
24874 var nativeCreate = getNative_default(Object, "create");
24875 var nativeCreate_default = nativeCreate;
24877 // node_modules/lodash-es/_hashClear.js
24878 function hashClear() {
24879 this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
24882 var hashClear_default = hashClear;
24884 // node_modules/lodash-es/_hashDelete.js
24885 function hashDelete(key) {
24886 var result = this.has(key) && delete this.__data__[key];
24887 this.size -= result ? 1 : 0;
24890 var hashDelete_default = hashDelete;
24892 // node_modules/lodash-es/_hashGet.js
24893 var HASH_UNDEFINED = "__lodash_hash_undefined__";
24894 var objectProto8 = Object.prototype;
24895 var hasOwnProperty6 = objectProto8.hasOwnProperty;
24896 function hashGet(key) {
24897 var data = this.__data__;
24898 if (nativeCreate_default) {
24899 var result = data[key];
24900 return result === HASH_UNDEFINED ? void 0 : result;
24902 return hasOwnProperty6.call(data, key) ? data[key] : void 0;
24904 var hashGet_default = hashGet;
24906 // node_modules/lodash-es/_hashHas.js
24907 var objectProto9 = Object.prototype;
24908 var hasOwnProperty7 = objectProto9.hasOwnProperty;
24909 function hashHas(key) {
24910 var data = this.__data__;
24911 return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty7.call(data, key);
24913 var hashHas_default = hashHas;
24915 // node_modules/lodash-es/_hashSet.js
24916 var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
24917 function hashSet(key, value) {
24918 var data = this.__data__;
24919 this.size += this.has(key) ? 0 : 1;
24920 data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
24923 var hashSet_default = hashSet;
24925 // node_modules/lodash-es/_Hash.js
24926 function Hash(entries) {
24927 var index = -1, length = entries == null ? 0 : entries.length;
24929 while (++index < length) {
24930 var entry = entries[index];
24931 this.set(entry[0], entry[1]);
24934 Hash.prototype.clear = hashClear_default;
24935 Hash.prototype["delete"] = hashDelete_default;
24936 Hash.prototype.get = hashGet_default;
24937 Hash.prototype.has = hashHas_default;
24938 Hash.prototype.set = hashSet_default;
24939 var Hash_default = Hash;
24941 // node_modules/lodash-es/_listCacheClear.js
24942 function listCacheClear() {
24943 this.__data__ = [];
24946 var listCacheClear_default = listCacheClear;
24948 // node_modules/lodash-es/_assocIndexOf.js
24949 function assocIndexOf(array2, key) {
24950 var length = array2.length;
24952 if (eq_default(array2[length][0], key)) {
24958 var assocIndexOf_default = assocIndexOf;
24960 // node_modules/lodash-es/_listCacheDelete.js
24961 var arrayProto = Array.prototype;
24962 var splice = arrayProto.splice;
24963 function listCacheDelete(key) {
24964 var data = this.__data__, index = assocIndexOf_default(data, key);
24968 var lastIndex = data.length - 1;
24969 if (index == lastIndex) {
24972 splice.call(data, index, 1);
24977 var listCacheDelete_default = listCacheDelete;
24979 // node_modules/lodash-es/_listCacheGet.js
24980 function listCacheGet(key) {
24981 var data = this.__data__, index = assocIndexOf_default(data, key);
24982 return index < 0 ? void 0 : data[index][1];
24984 var listCacheGet_default = listCacheGet;
24986 // node_modules/lodash-es/_listCacheHas.js
24987 function listCacheHas(key) {
24988 return assocIndexOf_default(this.__data__, key) > -1;
24990 var listCacheHas_default = listCacheHas;
24992 // node_modules/lodash-es/_listCacheSet.js
24993 function listCacheSet(key, value) {
24994 var data = this.__data__, index = assocIndexOf_default(data, key);
24997 data.push([key, value]);
24999 data[index][1] = value;
25003 var listCacheSet_default = listCacheSet;
25005 // node_modules/lodash-es/_ListCache.js
25006 function ListCache(entries) {
25007 var index = -1, length = entries == null ? 0 : entries.length;
25009 while (++index < length) {
25010 var entry = entries[index];
25011 this.set(entry[0], entry[1]);
25014 ListCache.prototype.clear = listCacheClear_default;
25015 ListCache.prototype["delete"] = listCacheDelete_default;
25016 ListCache.prototype.get = listCacheGet_default;
25017 ListCache.prototype.has = listCacheHas_default;
25018 ListCache.prototype.set = listCacheSet_default;
25019 var ListCache_default = ListCache;
25021 // node_modules/lodash-es/_Map.js
25022 var Map2 = getNative_default(root_default, "Map");
25023 var Map_default = Map2;
25025 // node_modules/lodash-es/_mapCacheClear.js
25026 function mapCacheClear() {
25029 "hash": new Hash_default(),
25030 "map": new (Map_default || ListCache_default)(),
25031 "string": new Hash_default()
25034 var mapCacheClear_default = mapCacheClear;
25036 // node_modules/lodash-es/_isKeyable.js
25037 function isKeyable(value) {
25038 var type2 = typeof value;
25039 return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
25041 var isKeyable_default = isKeyable;
25043 // node_modules/lodash-es/_getMapData.js
25044 function getMapData(map2, key) {
25045 var data = map2.__data__;
25046 return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
25048 var getMapData_default = getMapData;
25050 // node_modules/lodash-es/_mapCacheDelete.js
25051 function mapCacheDelete(key) {
25052 var result = getMapData_default(this, key)["delete"](key);
25053 this.size -= result ? 1 : 0;
25056 var mapCacheDelete_default = mapCacheDelete;
25058 // node_modules/lodash-es/_mapCacheGet.js
25059 function mapCacheGet(key) {
25060 return getMapData_default(this, key).get(key);
25062 var mapCacheGet_default = mapCacheGet;
25064 // node_modules/lodash-es/_mapCacheHas.js
25065 function mapCacheHas(key) {
25066 return getMapData_default(this, key).has(key);
25068 var mapCacheHas_default = mapCacheHas;
25070 // node_modules/lodash-es/_mapCacheSet.js
25071 function mapCacheSet(key, value) {
25072 var data = getMapData_default(this, key), size = data.size;
25073 data.set(key, value);
25074 this.size += data.size == size ? 0 : 1;
25077 var mapCacheSet_default = mapCacheSet;
25079 // node_modules/lodash-es/_MapCache.js
25080 function MapCache(entries) {
25081 var index = -1, length = entries == null ? 0 : entries.length;
25083 while (++index < length) {
25084 var entry = entries[index];
25085 this.set(entry[0], entry[1]);
25088 MapCache.prototype.clear = mapCacheClear_default;
25089 MapCache.prototype["delete"] = mapCacheDelete_default;
25090 MapCache.prototype.get = mapCacheGet_default;
25091 MapCache.prototype.has = mapCacheHas_default;
25092 MapCache.prototype.set = mapCacheSet_default;
25093 var MapCache_default = MapCache;
25095 // node_modules/lodash-es/toString.js
25096 function toString(value) {
25097 return value == null ? "" : baseToString_default(value);
25099 var toString_default = toString;
25101 // node_modules/lodash-es/_arrayPush.js
25102 function arrayPush(array2, values) {
25103 var index = -1, length = values.length, offset = array2.length;
25104 while (++index < length) {
25105 array2[offset + index] = values[index];
25109 var arrayPush_default = arrayPush;
25111 // node_modules/lodash-es/_basePropertyOf.js
25112 function basePropertyOf(object) {
25113 return function(key) {
25114 return object == null ? void 0 : object[key];
25117 var basePropertyOf_default = basePropertyOf;
25119 // node_modules/lodash-es/_stackClear.js
25120 function stackClear() {
25121 this.__data__ = new ListCache_default();
25124 var stackClear_default = stackClear;
25126 // node_modules/lodash-es/_stackDelete.js
25127 function stackDelete(key) {
25128 var data = this.__data__, result = data["delete"](key);
25129 this.size = data.size;
25132 var stackDelete_default = stackDelete;
25134 // node_modules/lodash-es/_stackGet.js
25135 function stackGet(key) {
25136 return this.__data__.get(key);
25138 var stackGet_default = stackGet;
25140 // node_modules/lodash-es/_stackHas.js
25141 function stackHas(key) {
25142 return this.__data__.has(key);
25144 var stackHas_default = stackHas;
25146 // node_modules/lodash-es/_stackSet.js
25147 var LARGE_ARRAY_SIZE = 200;
25148 function stackSet(key, value) {
25149 var data = this.__data__;
25150 if (data instanceof ListCache_default) {
25151 var pairs2 = data.__data__;
25152 if (!Map_default || pairs2.length < LARGE_ARRAY_SIZE - 1) {
25153 pairs2.push([key, value]);
25154 this.size = ++data.size;
25157 data = this.__data__ = new MapCache_default(pairs2);
25159 data.set(key, value);
25160 this.size = data.size;
25163 var stackSet_default = stackSet;
25165 // node_modules/lodash-es/_Stack.js
25166 function Stack(entries) {
25167 var data = this.__data__ = new ListCache_default(entries);
25168 this.size = data.size;
25170 Stack.prototype.clear = stackClear_default;
25171 Stack.prototype["delete"] = stackDelete_default;
25172 Stack.prototype.get = stackGet_default;
25173 Stack.prototype.has = stackHas_default;
25174 Stack.prototype.set = stackSet_default;
25175 var Stack_default = Stack;
25177 // node_modules/lodash-es/_arrayFilter.js
25178 function arrayFilter(array2, predicate) {
25179 var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
25180 while (++index < length) {
25181 var value = array2[index];
25182 if (predicate(value, index, array2)) {
25183 result[resIndex++] = value;
25188 var arrayFilter_default = arrayFilter;
25190 // node_modules/lodash-es/stubArray.js
25191 function stubArray() {
25194 var stubArray_default = stubArray;
25196 // node_modules/lodash-es/_getSymbols.js
25197 var objectProto10 = Object.prototype;
25198 var propertyIsEnumerable2 = objectProto10.propertyIsEnumerable;
25199 var nativeGetSymbols = Object.getOwnPropertySymbols;
25200 var getSymbols = !nativeGetSymbols ? stubArray_default : function(object) {
25201 if (object == null) {
25204 object = Object(object);
25205 return arrayFilter_default(nativeGetSymbols(object), function(symbol) {
25206 return propertyIsEnumerable2.call(object, symbol);
25209 var getSymbols_default = getSymbols;
25211 // node_modules/lodash-es/_baseGetAllKeys.js
25212 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
25213 var result = keysFunc(object);
25214 return isArray_default(object) ? result : arrayPush_default(result, symbolsFunc(object));
25216 var baseGetAllKeys_default = baseGetAllKeys;
25218 // node_modules/lodash-es/_getAllKeys.js
25219 function getAllKeys(object) {
25220 return baseGetAllKeys_default(object, keys_default, getSymbols_default);
25222 var getAllKeys_default = getAllKeys;
25224 // node_modules/lodash-es/_DataView.js
25225 var DataView2 = getNative_default(root_default, "DataView");
25226 var DataView_default = DataView2;
25228 // node_modules/lodash-es/_Promise.js
25229 var Promise2 = getNative_default(root_default, "Promise");
25230 var Promise_default = Promise2;
25232 // node_modules/lodash-es/_Set.js
25233 var Set2 = getNative_default(root_default, "Set");
25234 var Set_default = Set2;
25236 // node_modules/lodash-es/_getTag.js
25237 var mapTag2 = "[object Map]";
25238 var objectTag2 = "[object Object]";
25239 var promiseTag = "[object Promise]";
25240 var setTag2 = "[object Set]";
25241 var weakMapTag2 = "[object WeakMap]";
25242 var dataViewTag2 = "[object DataView]";
25243 var dataViewCtorString = toSource_default(DataView_default);
25244 var mapCtorString = toSource_default(Map_default);
25245 var promiseCtorString = toSource_default(Promise_default);
25246 var setCtorString = toSource_default(Set_default);
25247 var weakMapCtorString = toSource_default(WeakMap_default);
25248 var getTag = baseGetTag_default;
25249 if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) {
25250 getTag = function(value) {
25251 var result = baseGetTag_default(value), Ctor = result == objectTag2 ? value.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : "";
25253 switch (ctorString) {
25254 case dataViewCtorString:
25255 return dataViewTag2;
25256 case mapCtorString:
25258 case promiseCtorString:
25260 case setCtorString:
25262 case weakMapCtorString:
25263 return weakMapTag2;
25269 var getTag_default = getTag;
25271 // node_modules/lodash-es/_Uint8Array.js
25272 var Uint8Array2 = root_default.Uint8Array;
25273 var Uint8Array_default = Uint8Array2;
25275 // node_modules/lodash-es/_setCacheAdd.js
25276 var HASH_UNDEFINED3 = "__lodash_hash_undefined__";
25277 function setCacheAdd(value) {
25278 this.__data__.set(value, HASH_UNDEFINED3);
25281 var setCacheAdd_default = setCacheAdd;
25283 // node_modules/lodash-es/_setCacheHas.js
25284 function setCacheHas(value) {
25285 return this.__data__.has(value);
25287 var setCacheHas_default = setCacheHas;
25289 // node_modules/lodash-es/_SetCache.js
25290 function SetCache(values) {
25291 var index = -1, length = values == null ? 0 : values.length;
25292 this.__data__ = new MapCache_default();
25293 while (++index < length) {
25294 this.add(values[index]);
25297 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default;
25298 SetCache.prototype.has = setCacheHas_default;
25299 var SetCache_default = SetCache;
25301 // node_modules/lodash-es/_arraySome.js
25302 function arraySome(array2, predicate) {
25303 var index = -1, length = array2 == null ? 0 : array2.length;
25304 while (++index < length) {
25305 if (predicate(array2[index], index, array2)) {
25311 var arraySome_default = arraySome;
25313 // node_modules/lodash-es/_cacheHas.js
25314 function cacheHas(cache, key) {
25315 return cache.has(key);
25317 var cacheHas_default = cacheHas;
25319 // node_modules/lodash-es/_equalArrays.js
25320 var COMPARE_PARTIAL_FLAG = 1;
25321 var COMPARE_UNORDERED_FLAG = 2;
25322 function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
25323 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
25324 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
25327 var arrStacked = stack.get(array2);
25328 var othStacked = stack.get(other);
25329 if (arrStacked && othStacked) {
25330 return arrStacked == other && othStacked == array2;
25332 var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0;
25333 stack.set(array2, other);
25334 stack.set(other, array2);
25335 while (++index < arrLength) {
25336 var arrValue = array2[index], othValue = other[index];
25338 var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, array2, other, stack);
25340 if (compared !== void 0) {
25348 if (!arraySome_default(other, function(othValue2, othIndex) {
25349 if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
25350 return seen.push(othIndex);
25356 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
25361 stack["delete"](array2);
25362 stack["delete"](other);
25365 var equalArrays_default = equalArrays;
25367 // node_modules/lodash-es/_mapToArray.js
25368 function mapToArray(map2) {
25369 var index = -1, result = Array(map2.size);
25370 map2.forEach(function(value, key) {
25371 result[++index] = [key, value];
25375 var mapToArray_default = mapToArray;
25377 // node_modules/lodash-es/_setToArray.js
25378 function setToArray(set3) {
25379 var index = -1, result = Array(set3.size);
25380 set3.forEach(function(value) {
25381 result[++index] = value;
25385 var setToArray_default = setToArray;
25387 // node_modules/lodash-es/_equalByTag.js
25388 var COMPARE_PARTIAL_FLAG2 = 1;
25389 var COMPARE_UNORDERED_FLAG2 = 2;
25390 var boolTag2 = "[object Boolean]";
25391 var dateTag2 = "[object Date]";
25392 var errorTag2 = "[object Error]";
25393 var mapTag3 = "[object Map]";
25394 var numberTag2 = "[object Number]";
25395 var regexpTag2 = "[object RegExp]";
25396 var setTag3 = "[object Set]";
25397 var stringTag2 = "[object String]";
25398 var symbolTag2 = "[object Symbol]";
25399 var arrayBufferTag2 = "[object ArrayBuffer]";
25400 var dataViewTag3 = "[object DataView]";
25401 var symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
25402 var symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
25403 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
25406 if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
25409 object = object.buffer;
25410 other = other.buffer;
25411 case arrayBufferTag2:
25412 if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object), new Uint8Array_default(other))) {
25419 return eq_default(+object, +other);
25421 return object.name == other.name && object.message == other.message;
25424 return object == other + "";
25426 var convert = mapToArray_default;
25428 var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
25429 convert || (convert = setToArray_default);
25430 if (object.size != other.size && !isPartial) {
25433 var stacked = stack.get(object);
25435 return stacked == other;
25437 bitmask |= COMPARE_UNORDERED_FLAG2;
25438 stack.set(object, other);
25439 var result = equalArrays_default(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
25440 stack["delete"](object);
25443 if (symbolValueOf) {
25444 return symbolValueOf.call(object) == symbolValueOf.call(other);
25449 var equalByTag_default = equalByTag;
25451 // node_modules/lodash-es/_equalObjects.js
25452 var COMPARE_PARTIAL_FLAG3 = 1;
25453 var objectProto11 = Object.prototype;
25454 var hasOwnProperty8 = objectProto11.hasOwnProperty;
25455 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
25456 var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length;
25457 if (objLength != othLength && !isPartial) {
25460 var index = objLength;
25462 var key = objProps[index];
25463 if (!(isPartial ? key in other : hasOwnProperty8.call(other, key))) {
25467 var objStacked = stack.get(object);
25468 var othStacked = stack.get(other);
25469 if (objStacked && othStacked) {
25470 return objStacked == other && othStacked == object;
25473 stack.set(object, other);
25474 stack.set(other, object);
25475 var skipCtor = isPartial;
25476 while (++index < objLength) {
25477 key = objProps[index];
25478 var objValue = object[key], othValue = other[key];
25480 var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
25482 if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
25486 skipCtor || (skipCtor = key == "constructor");
25488 if (result && !skipCtor) {
25489 var objCtor = object.constructor, othCtor = other.constructor;
25490 if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
25494 stack["delete"](object);
25495 stack["delete"](other);
25498 var equalObjects_default = equalObjects;
25500 // node_modules/lodash-es/_baseIsEqualDeep.js
25501 var COMPARE_PARTIAL_FLAG4 = 1;
25502 var argsTag3 = "[object Arguments]";
25503 var arrayTag2 = "[object Array]";
25504 var objectTag3 = "[object Object]";
25505 var objectProto12 = Object.prototype;
25506 var hasOwnProperty9 = objectProto12.hasOwnProperty;
25507 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
25508 var objIsArr = isArray_default(object), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag2 : getTag_default(object), othTag = othIsArr ? arrayTag2 : getTag_default(other);
25509 objTag = objTag == argsTag3 ? objectTag3 : objTag;
25510 othTag = othTag == argsTag3 ? objectTag3 : othTag;
25511 var objIsObj = objTag == objectTag3, othIsObj = othTag == objectTag3, isSameTag = objTag == othTag;
25512 if (isSameTag && isBuffer_default(object)) {
25513 if (!isBuffer_default(other)) {
25519 if (isSameTag && !objIsObj) {
25520 stack || (stack = new Stack_default());
25521 return objIsArr || isTypedArray_default(object) ? equalArrays_default(object, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object, other, objTag, bitmask, customizer, equalFunc, stack);
25523 if (!(bitmask & COMPARE_PARTIAL_FLAG4)) {
25524 var objIsWrapped = objIsObj && hasOwnProperty9.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty9.call(other, "__wrapped__");
25525 if (objIsWrapped || othIsWrapped) {
25526 var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
25527 stack || (stack = new Stack_default());
25528 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
25534 stack || (stack = new Stack_default());
25535 return equalObjects_default(object, other, bitmask, customizer, equalFunc, stack);
25537 var baseIsEqualDeep_default = baseIsEqualDeep;
25539 // node_modules/lodash-es/_baseIsEqual.js
25540 function baseIsEqual(value, other, bitmask, customizer, stack) {
25541 if (value === other) {
25544 if (value == null || other == null || !isObjectLike_default(value) && !isObjectLike_default(other)) {
25545 return value !== value && other !== other;
25547 return baseIsEqualDeep_default(value, other, bitmask, customizer, baseIsEqual, stack);
25549 var baseIsEqual_default = baseIsEqual;
25551 // node_modules/lodash-es/now.js
25552 var now2 = function() {
25553 return root_default.Date.now();
25555 var now_default = now2;
25557 // node_modules/lodash-es/debounce.js
25558 var FUNC_ERROR_TEXT = "Expected a function";
25559 var nativeMax = Math.max;
25560 var nativeMin = Math.min;
25561 function debounce(func, wait, options2) {
25562 var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
25563 if (typeof func != "function") {
25564 throw new TypeError(FUNC_ERROR_TEXT);
25566 wait = toNumber_default(wait) || 0;
25567 if (isObject_default(options2)) {
25568 leading = !!options2.leading;
25569 maxing = "maxWait" in options2;
25570 maxWait = maxing ? nativeMax(toNumber_default(options2.maxWait) || 0, wait) : maxWait;
25571 trailing = "trailing" in options2 ? !!options2.trailing : trailing;
25573 function invokeFunc(time) {
25574 var args = lastArgs, thisArg = lastThis;
25575 lastArgs = lastThis = void 0;
25576 lastInvokeTime = time;
25577 result = func.apply(thisArg, args);
25580 function leadingEdge(time) {
25581 lastInvokeTime = time;
25582 timerId = setTimeout(timerExpired, wait);
25583 return leading ? invokeFunc(time) : result;
25585 function remainingWait(time) {
25586 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
25587 return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
25589 function shouldInvoke(time) {
25590 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
25591 return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
25593 function timerExpired() {
25594 var time = now_default();
25595 if (shouldInvoke(time)) {
25596 return trailingEdge(time);
25598 timerId = setTimeout(timerExpired, remainingWait(time));
25600 function trailingEdge(time) {
25602 if (trailing && lastArgs) {
25603 return invokeFunc(time);
25605 lastArgs = lastThis = void 0;
25608 function cancel() {
25609 if (timerId !== void 0) {
25610 clearTimeout(timerId);
25612 lastInvokeTime = 0;
25613 lastArgs = lastCallTime = lastThis = timerId = void 0;
25616 return timerId === void 0 ? result : trailingEdge(now_default());
25618 function debounced() {
25619 var time = now_default(), isInvoking = shouldInvoke(time);
25620 lastArgs = arguments;
25622 lastCallTime = time;
25624 if (timerId === void 0) {
25625 return leadingEdge(lastCallTime);
25628 clearTimeout(timerId);
25629 timerId = setTimeout(timerExpired, wait);
25630 return invokeFunc(lastCallTime);
25633 if (timerId === void 0) {
25634 timerId = setTimeout(timerExpired, wait);
25638 debounced.cancel = cancel;
25639 debounced.flush = flush;
25642 var debounce_default = debounce;
25644 // node_modules/lodash-es/_escapeHtmlChar.js
25645 var htmlEscapes = {
25652 var escapeHtmlChar = basePropertyOf_default(htmlEscapes);
25653 var escapeHtmlChar_default = escapeHtmlChar;
25655 // node_modules/lodash-es/escape.js
25656 var reUnescapedHtml = /[&<>"']/g;
25657 var reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
25658 function escape2(string) {
25659 string = toString_default(string);
25660 return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar_default) : string;
25662 var escape_default = escape2;
25664 // node_modules/lodash-es/isEqual.js
25665 function isEqual(value, other) {
25666 return baseIsEqual_default(value, other);
25668 var isEqual_default = isEqual;
25670 // node_modules/lodash-es/isNumber.js
25671 var numberTag3 = "[object Number]";
25672 function isNumber(value) {
25673 return typeof value == "number" || isObjectLike_default(value) && baseGetTag_default(value) == numberTag3;
25675 var isNumber_default = isNumber;
25677 // node_modules/lodash-es/throttle.js
25678 var FUNC_ERROR_TEXT2 = "Expected a function";
25679 function throttle(func, wait, options2) {
25680 var leading = true, trailing = true;
25681 if (typeof func != "function") {
25682 throw new TypeError(FUNC_ERROR_TEXT2);
25684 if (isObject_default(options2)) {
25685 leading = "leading" in options2 ? !!options2.leading : leading;
25686 trailing = "trailing" in options2 ? !!options2.trailing : trailing;
25688 return debounce_default(func, wait, {
25689 "leading": leading,
25691 "trailing": trailing
25694 var throttle_default = throttle;
25696 // node_modules/lodash-es/_unescapeHtmlChar.js
25697 var htmlUnescapes = {
25704 var unescapeHtmlChar = basePropertyOf_default(htmlUnescapes);
25705 var unescapeHtmlChar_default = unescapeHtmlChar;
25707 // node_modules/lodash-es/unescape.js
25708 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
25709 var reHasEscapedHtml = RegExp(reEscapedHtml.source);
25710 function unescape2(string) {
25711 string = toString_default(string);
25712 return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar_default) : string;
25714 var unescape_default = unescape2;
25716 // modules/util/detect.js
25718 function utilDetect(refresh2) {
25719 if (_detected && !refresh2)
25722 const ua = navigator.userAgent;
25724 m2 = ua.match(/(edge)\/?\s*(\.?\d+(\.\d+)*)/i);
25726 _detected.browser = m2[1];
25727 _detected.version = m2[2];
25729 if (!_detected.browser) {
25730 m2 = ua.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i);
25732 _detected.browser = "msie";
25733 _detected.version = m2[1];
25736 if (!_detected.browser) {
25737 m2 = ua.match(/(opr)\/?\s*(\.?\d+(\.\d+)*)/i);
25739 _detected.browser = "Opera";
25740 _detected.version = m2[2];
25743 if (!_detected.browser) {
25744 m2 = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
25746 _detected.browser = m2[1];
25747 _detected.version = m2[2];
25748 m2 = ua.match(/version\/([\.\d]+)/i);
25750 _detected.version = m2[1];
25753 if (!_detected.browser) {
25754 _detected.browser = navigator.appName;
25755 _detected.version = navigator.appVersion;
25757 _detected.version = _detected.version.split(/\W/).slice(0, 2).join(".");
25758 _detected.opera = _detected.browser.toLowerCase() === "opera" && Number(_detected.version) < 15;
25759 if (_detected.browser.toLowerCase() === "msie") {
25760 _detected.ie = true;
25761 _detected.browser = "Internet Explorer";
25762 _detected.support = false;
25764 _detected.ie = false;
25765 _detected.support = true;
25767 _detected.filedrop = window.FileReader && "ondrop" in window;
25768 if (/Win/.test(ua)) {
25769 _detected.os = "win";
25770 _detected.platform = "Windows";
25771 } else if (/Mac/.test(ua)) {
25772 _detected.os = "mac";
25773 _detected.platform = "Macintosh";
25774 } else if (/X11/.test(ua) || /Linux/.test(ua)) {
25775 _detected.os = "linux";
25776 _detected.platform = "Linux";
25778 _detected.os = "win";
25779 _detected.platform = "Unknown";
25781 _detected.isMobileWebKit = (/\b(iPad|iPhone|iPod)\b/.test(ua) || // HACK: iPadOS 13+ requests desktop sites by default by using a Mac user agent,
25782 // so assume any "mac" with multitouch is actually iOS
25783 navigator.platform === "MacIntel" && "maxTouchPoints" in navigator && navigator.maxTouchPoints > 1) && /WebKit/.test(ua) && !/Edge/.test(ua) && !window.MSStream;
25784 _detected.browserLocales = Array.from(new Set(
25785 // remove duplicates
25786 [navigator.language].concat(navigator.languages || []).concat([
25787 // old property for backwards compatibility
25788 navigator.userLanguage
25791 const loc = window.top.location;
25792 let origin = loc.origin;
25794 origin = loc.protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "");
25796 _detected.host = origin + loc.pathname;
25800 // modules/util/aes.js
25801 var import_aes_js = __toESM(require_aes_js());
25802 var DEFAULT_128 = [250, 157, 60, 79, 142, 134, 229, 129, 138, 126, 210, 129, 29, 71, 160, 208];
25803 function utilAesEncrypt(text2, key) {
25804 key = key || DEFAULT_128;
25805 const textBytes = import_aes_js.default.utils.utf8.toBytes(text2);
25806 const aesCtr = new import_aes_js.default.ModeOfOperation.ctr(key);
25807 const encryptedBytes = aesCtr.encrypt(textBytes);
25808 const encryptedHex = import_aes_js.default.utils.hex.fromBytes(encryptedBytes);
25809 return encryptedHex;
25811 function utilAesDecrypt(encryptedHex, key) {
25812 key = key || DEFAULT_128;
25813 const encryptedBytes = import_aes_js.default.utils.hex.toBytes(encryptedHex);
25814 const aesCtr = new import_aes_js.default.ModeOfOperation.ctr(key);
25815 const decryptedBytes = aesCtr.decrypt(encryptedBytes);
25816 const text2 = import_aes_js.default.utils.utf8.fromBytes(decryptedBytes);
25820 // modules/util/clean_tags.js
25821 function utilCleanTags(tags) {
25823 for (var k2 in tags) {
25827 if (v2 !== void 0) {
25828 out[k2] = cleanValue(k2, v2);
25832 function cleanValue(k3, v3) {
25833 function keepSpaces(k4) {
25834 return /_hours|_times|:conditional$/.test(k4);
25836 function skip(k4) {
25837 return /^(description|note|fixme)$/.test(k4);
25841 var cleaned = v3.split(";").map(function(s2) {
25843 }).join(keepSpaces(k3) ? "; " : ";");
25844 if (k3.indexOf("website") !== -1 || k3.indexOf("email") !== -1 || cleaned.indexOf("http") === 0) {
25845 cleaned = cleaned.replace(/[\u200B-\u200F\uFEFF]/g, "");
25851 // modules/util/get_set_value.js
25852 function utilGetSetValue(selection2, value, shouldUpdate) {
25853 function setValue(value2, shouldUpdate2) {
25854 function valueNull() {
25857 function valueConstant() {
25858 if (shouldUpdate2(this.value, value2)) {
25859 this.value = value2;
25862 function valueFunction() {
25863 var x2 = value2.apply(this, arguments);
25864 if (x2 === null || x2 === void 0) {
25866 } else if (shouldUpdate2(this.value, x2)) {
25870 return value2 === null || value2 === void 0 ? valueNull : typeof value2 === "function" ? valueFunction : valueConstant;
25872 function stickyCursor(func) {
25873 const supportedTypes = ["text", "search", "url", "tel", "password"];
25874 if (!supportedTypes.includes(selection2.node()?.type)) {
25877 return function() {
25878 const cursor = { start: this.selectionStart, end: this.selectionEnd };
25879 func.apply(this, arguments);
25880 this.setSelectionRange(cursor.start, cursor.end);
25883 if (arguments.length === 1) {
25884 return selection2.property("value");
25886 if (shouldUpdate === void 0) {
25887 shouldUpdate = (a2, b2) => a2 !== b2;
25889 return selection2.each(stickyCursor(setValue(value, shouldUpdate)));
25892 // modules/util/keybinding.js
25893 function utilKeybinding(namespace) {
25894 var _keybindings = {};
25895 function testBindings(d3_event, isCapturing) {
25896 var didMatch = false;
25897 var bindings = Object.keys(_keybindings).map(function(id2) {
25898 return _keybindings[id2];
25901 for (i3 = 0; i3 < bindings.length; i3++) {
25902 binding = bindings[i3];
25903 if (!binding.event.modifiers.shiftKey)
25905 if (!!binding.capture !== isCapturing)
25907 if (matches(d3_event, binding, true)) {
25908 binding.callback(d3_event);
25915 for (i3 = 0; i3 < bindings.length; i3++) {
25916 binding = bindings[i3];
25917 if (binding.event.modifiers.shiftKey)
25919 if (!!binding.capture !== isCapturing)
25921 if (matches(d3_event, binding, false)) {
25922 binding.callback(d3_event);
25926 function matches(d3_event2, binding2, testShift) {
25927 var event = d3_event2;
25928 var isMatch = false;
25929 var tryKeyCode = true;
25930 if (event.key !== void 0) {
25931 tryKeyCode = event.key.charCodeAt(0) > 127;
25933 if (binding2.event.key === void 0) {
25935 } else if (Array.isArray(binding2.event.key)) {
25936 if (binding2.event.key.map(function(s2) {
25937 return s2.toLowerCase();
25938 }).indexOf(event.key.toLowerCase()) === -1) {
25942 if (event.key.toLowerCase() !== binding2.event.key.toLowerCase()) {
25947 if (!isMatch && (tryKeyCode || binding2.event.modifiers.altKey)) {
25948 isMatch = event.keyCode === binding2.event.keyCode;
25952 if (!(event.ctrlKey && event.altKey)) {
25953 if (event.ctrlKey !== binding2.event.modifiers.ctrlKey)
25955 if (event.altKey !== binding2.event.modifiers.altKey)
25958 if (event.metaKey !== binding2.event.modifiers.metaKey)
25960 if (testShift && event.shiftKey !== binding2.event.modifiers.shiftKey)
25965 function capture(d3_event) {
25966 testBindings(d3_event, true);
25968 function bubble(d3_event) {
25969 var tagName = select_default2(d3_event.target).node().tagName;
25970 if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
25973 testBindings(d3_event, false);
25975 function keybinding(selection2) {
25976 selection2 = selection2 || select_default2(document);
25977 selection2.on("keydown.capture." + namespace, capture, true);
25978 selection2.on("keydown.bubble." + namespace, bubble, false);
25981 keybinding.unbind = function(selection2) {
25983 selection2 = selection2 || select_default2(document);
25984 selection2.on("keydown.capture." + namespace, null);
25985 selection2.on("keydown.bubble." + namespace, null);
25988 keybinding.clear = function() {
25992 keybinding.off = function(codes, capture2) {
25993 var arr = utilArrayUniq([].concat(codes));
25994 for (var i3 = 0; i3 < arr.length; i3++) {
25995 var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
25996 delete _keybindings[id2];
26000 keybinding.on = function(codes, callback, capture2) {
26001 if (typeof callback !== "function") {
26002 return keybinding.off(codes, capture2);
26004 var arr = utilArrayUniq([].concat(codes));
26005 for (var i3 = 0; i3 < arr.length; i3++) {
26006 var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
26024 if (_keybindings[id2]) {
26025 console.warn('warning: duplicate keybinding for "' + id2 + '"');
26027 _keybindings[id2] = binding;
26028 var matches = arr[i3].toLowerCase().match(/(?:(?:[^+⇧⌃⌥⌘])+|[⇧⌃⌥⌘]|\+\+|^\+$)/g);
26029 for (var j3 = 0; j3 < matches.length; j3++) {
26030 if (matches[j3] === "++")
26032 if (matches[j3] in utilKeybinding.modifierCodes) {
26033 var prop = utilKeybinding.modifierProperties[utilKeybinding.modifierCodes[matches[j3]]];
26034 binding.event.modifiers[prop] = true;
26036 binding.event.key = utilKeybinding.keys[matches[j3]] || matches[j3];
26037 if (matches[j3] in utilKeybinding.keyCodes) {
26038 binding.event.keyCode = utilKeybinding.keyCodes[matches[j3]];
26047 utilKeybinding.modifierCodes = {
26051 // CTRL key, on Mac: ⌃
26054 // ALT key, on Mac: ⌥ (Alt)
26058 // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super)
26065 utilKeybinding.modifierProperties = {
26071 utilKeybinding.plusKeys = ["plus", "ffplus", "=", "ffequals", "\u2260", "\xB1"];
26072 utilKeybinding.minusKeys = ["_", "-", "ffminus", "dash", "\u2013", "\u2014"];
26073 utilKeybinding.keys = {
26074 // Backspace key, on Mac: ⌫ (Backspace)
26075 "\u232B": "Backspace",
26076 backspace: "Backspace",
26077 // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
26090 "pause-break": "Pause",
26091 // Caps Lock key, ⇪
26092 "\u21EA": "CapsLock",
26094 "caps-lock": "CapsLock",
26095 // Escape key, on Mac: ⎋, on Windows: Esc
26096 "\u238B": ["Escape", "Esc"],
26097 escape: ["Escape", "Esc"],
26098 esc: ["Escape", "Esc"],
26100 space: [" ", "Spacebar"],
26101 // Page-Up key, or pgup, on Mac: ↖
26102 "\u2196": "PageUp",
26104 "page-up": "PageUp",
26105 // Page-Down key, or pgdown, on Mac: ↘
26106 "\u2198": "PageDown",
26107 pgdown: "PageDown",
26108 "page-down": "PageDown",
26109 // END key, on Mac: ⇟
26112 // HOME key, on Mac: ⇞
26115 // Insert key, or ins
26118 // Delete key, on Mac: ⌦ (Delete)
26119 "\u2326": ["Delete", "Del"],
26120 del: ["Delete", "Del"],
26121 "delete": ["Delete", "Del"],
26122 // Left Arrow Key, or ←
26123 "\u2190": ["ArrowLeft", "Left"],
26124 left: ["ArrowLeft", "Left"],
26125 "arrow-left": ["ArrowLeft", "Left"],
26126 // Up Arrow Key, or ↑
26127 "\u2191": ["ArrowUp", "Up"],
26128 up: ["ArrowUp", "Up"],
26129 "arrow-up": ["ArrowUp", "Up"],
26130 // Right Arrow Key, or →
26131 "\u2192": ["ArrowRight", "Right"],
26132 right: ["ArrowRight", "Right"],
26133 "arrow-right": ["ArrowRight", "Right"],
26134 // Up Arrow Key, or ↓
26135 "\u2193": ["ArrowDown", "Down"],
26136 down: ["ArrowDown", "Down"],
26137 "arrow-down": ["ArrowDown", "Down"],
26138 // odities, stuff for backward compatibility (browsers and code):
26139 // Num-Multiply, or *
26140 "*": ["*", "Multiply"],
26141 star: ["*", "Multiply"],
26142 asterisk: ["*", "Multiply"],
26143 multiply: ["*", "Multiply"],
26146 "plus": ["+", "Add"],
26147 // Num-Subtract, or -
26148 "-": ["-", "Subtract"],
26149 subtract: ["-", "Subtract"],
26150 "dash": ["-", "Subtract"],
26157 // Period, or ., or full-stop
26160 // Slash, or /, or forward-slash
26162 "forward-slash": "/",
26163 // Tick, or `, or back-quote
26166 // Open bracket, or [
26167 "open-bracket": "[",
26168 // Back slash, or \
26169 "back-slash": "\\",
26170 // Close backet, or ]
26171 "close-bracket": "]",
26172 // Apostrophe, or Quote, or '
26213 utilKeybinding.keyCodes = {
26214 // Backspace key, on Mac: ⌫ (Backspace)
26217 // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
26231 // Caps Lock key, ⇪
26235 // Escape key, on Mac: ⎋, on Windows: Esc
26241 // Page-Up key, or pgup, on Mac: ↖
26245 // Page-Down key, or pgdown, on Mac: ↘
26249 // END key, on Mac: ⇟
26252 // HOME key, on Mac: ⇞
26255 // Insert key, or ins
26258 // Delete key, on Mac: ⌦ (Delete)
26262 // Left Arrow Key, or ←
26266 // Up Arrow Key, or ↑
26270 // Right Arrow Key, or →
26274 // Up Arrow Key, or ↓
26278 // odities, printing characters that come out wrong:
26281 // Num-Multiply, or *
26289 // Num-Subtract, or -
26292 // Vertical Bar / Pipe
26307 // Dash / Underscore key
26309 // Period, or ., or full-stop
26313 // Slash, or /, or forward-slash
26316 "forward-slash": 191,
26317 // Tick, or `, or back-quote
26321 // Open bracket, or [
26323 "open-bracket": 219,
26324 // Back slash, or \
26327 // Close backet, or ]
26329 "close-bracket": 221,
26330 // Apostrophe, or Quote, or '
26337 while (++i < 106) {
26338 utilKeybinding.keyCodes["num-" + n] = i;
26344 utilKeybinding.keyCodes[n] = i;
26349 while (++i < 136) {
26350 utilKeybinding.keyCodes["f" + n] = i;
26355 utilKeybinding.keyCodes[String.fromCharCode(i).toLowerCase()] = i;
26358 // modules/util/object.js
26359 function utilObjectOmit(obj, omitKeys) {
26360 return Object.keys(obj).reduce(function(result, key) {
26361 if (omitKeys.indexOf(key) === -1) {
26362 result[key] = obj[key];
26368 // modules/util/rebind.js
26369 function utilRebind(target, source) {
26370 var i3 = 1, n3 = arguments.length, method;
26371 while (++i3 < n3) {
26372 target[method = arguments[i3]] = d3_rebind(target, source, source[method]);
26376 function d3_rebind(target, source, method) {
26377 return function() {
26378 var value = method.apply(source, arguments);
26379 return value === source ? target : value;
26383 // modules/util/session_mutex.js
26384 function utilSessionMutex(name) {
26388 var expires = /* @__PURE__ */ new Date();
26389 expires.setSeconds(expires.getSeconds() + 5);
26390 document.cookie = name + "=1; expires=" + expires.toUTCString() + "; sameSite=strict";
26392 mutex.lock = function() {
26395 var cookie = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + name + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1");
26399 intervalID = window.setInterval(renew, 4e3);
26402 mutex.unlock = function() {
26405 document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; sameSite=strict";
26406 clearInterval(intervalID);
26409 mutex.locked = function() {
26410 return !!intervalID;
26415 // modules/util/tiler.js
26416 function utilTiler() {
26417 var _size = [256, 256];
26419 var _tileSize = 256;
26420 var _zoomExtent = [0, 20];
26421 var _translate = [_size[0] / 2, _size[1] / 2];
26423 var _skipNullIsland = false;
26424 function clamp3(num, min3, max3) {
26425 return Math.max(min3, Math.min(num, max3));
26427 function nearNullIsland(tile) {
26432 var center = Math.pow(2, z2 - 1);
26433 var width = Math.pow(2, z2 - 6);
26434 var min3 = center - width / 2;
26435 var max3 = center + width / 2 - 1;
26436 return x2 >= min3 && x2 <= max3 && y2 >= min3 && y2 <= max3;
26440 function tiler9() {
26441 var z2 = geoScaleToZoom(_scale / (2 * Math.PI), _tileSize);
26442 var z0 = clamp3(Math.round(z2), _zoomExtent[0], _zoomExtent[1]);
26444 var tileMax = Math.pow(2, z0) - 1;
26445 var log2ts = Math.log(_tileSize) * Math.LOG2E;
26446 var k2 = Math.pow(2, z2 - z0 + log2ts);
26448 (_translate[0] - _scale / 2) / k2,
26449 (_translate[1] - _scale / 2) / k2
26452 clamp3(Math.floor(-origin[0]) - _margin, tileMin, tileMax + 1),
26453 clamp3(Math.ceil(_size[0] / k2 - origin[0]) + _margin, tileMin, tileMax + 1)
26456 clamp3(Math.floor(-origin[1]) - _margin, tileMin, tileMax + 1),
26457 clamp3(Math.ceil(_size[1] / k2 - origin[1]) + _margin, tileMin, tileMax + 1)
26460 for (var i3 = 0; i3 < rows.length; i3++) {
26462 for (var j3 = 0; j3 < cols.length; j3++) {
26464 if (i3 >= _margin && i3 <= rows.length - _margin && j3 >= _margin && j3 <= cols.length - _margin) {
26465 tiles.unshift([x2, y2, z0]);
26467 tiles.push([x2, y2, z0]);
26471 tiles.translate = origin;
26475 tiler9.getTiles = function(projection2) {
26477 projection2.scale() * Math.PI - projection2.translate()[0],
26478 projection2.scale() * Math.PI - projection2.translate()[1]
26480 this.size(projection2.clipExtent()[1]).scale(projection2.scale() * 2 * Math.PI).translate(projection2.translate());
26481 var tiles = tiler9();
26482 var ts = tiles.scale;
26483 return tiles.map(function(tile) {
26484 if (_skipNullIsland && nearNullIsland(tile)) {
26487 var x2 = tile[0] * ts - origin[0];
26488 var y2 = tile[1] * ts - origin[1];
26490 id: tile.toString(),
26493 projection2.invert([x2, y2 + ts]),
26494 projection2.invert([x2 + ts, y2])
26497 }).filter(Boolean);
26499 tiler9.getGeoJSON = function(projection2) {
26500 var features = tiler9.getTiles(projection2).map(function(tile) {
26509 coordinates: [tile.extent.polygon()]
26514 type: "FeatureCollection",
26518 tiler9.tileSize = function(val) {
26519 if (!arguments.length)
26524 tiler9.zoomExtent = function(val) {
26525 if (!arguments.length)
26526 return _zoomExtent;
26530 tiler9.size = function(val) {
26531 if (!arguments.length)
26536 tiler9.scale = function(val) {
26537 if (!arguments.length)
26542 tiler9.translate = function(val) {
26543 if (!arguments.length)
26548 tiler9.margin = function(val) {
26549 if (!arguments.length)
26554 tiler9.skipNullIsland = function(val) {
26555 if (!arguments.length)
26556 return _skipNullIsland;
26557 _skipNullIsland = val;
26563 // modules/util/trigger_event.js
26564 function utilTriggerEvent(target, type2, eventProperties) {
26565 target.each(function() {
26566 var evt = document.createEvent("HTMLEvents");
26567 evt.initEvent(type2, true, true);
26568 for (var prop in eventProperties) {
26569 evt[prop] = eventProperties[prop];
26571 this.dispatchEvent(evt);
26575 // modules/core/localizer.js
26576 var _mainLocalizer = coreLocalizer();
26577 var _t = _mainLocalizer.t;
26578 function coreLocalizer() {
26579 let localizer = {};
26580 let _dataLanguages = {};
26581 let _dataLocales = {};
26582 let _localeStrings = {};
26583 let _localeCode = "en-US";
26584 let _localeCodes = ["en-US", "en"];
26585 let _languageCode = "en";
26586 let _textDirection = "ltr";
26587 let _usesMetric = false;
26588 let _languageNames = {};
26589 let _scriptNames = {};
26590 localizer.localeCode = () => _localeCode;
26591 localizer.localeCodes = () => _localeCodes;
26592 localizer.languageCode = () => _languageCode;
26593 localizer.textDirection = () => _textDirection;
26594 localizer.usesMetric = () => _usesMetric;
26595 localizer.languageNames = () => _languageNames;
26596 localizer.scriptNames = () => _scriptNames;
26597 let _preferredLocaleCodes = [];
26598 localizer.preferredLocaleCodes = function(codes) {
26599 if (!arguments.length)
26600 return _preferredLocaleCodes;
26601 if (typeof codes === "string") {
26602 _preferredLocaleCodes = codes.split(/,|;| /gi).filter(Boolean);
26604 _preferredLocaleCodes = codes;
26609 localizer.ensureLoaded = () => {
26611 return _loadPromise;
26612 let filesToFetch = [
26614 // load the list of languages
26616 // load the list of supported locales
26618 const localeDirs = {
26619 general: "locales",
26620 tagging: presetsCdnUrl + "dist/translations"
26622 let fileMap = _mainFileFetcher.fileMap();
26623 for (let scopeId in localeDirs) {
26624 const key = `locales_index_${scopeId}`;
26625 if (!fileMap[key]) {
26626 fileMap[key] = localeDirs[scopeId] + "/index.min.json";
26628 filesToFetch.push(key);
26630 return _loadPromise = Promise.all(filesToFetch.map((key) => _mainFileFetcher.get(key))).then((results) => {
26631 _dataLanguages = results[0];
26632 _dataLocales = results[1];
26633 let indexes = results.slice(2);
26634 let requestedLocales = (_preferredLocaleCodes || []).concat(utilDetect().browserLocales).concat(["en"]);
26635 _localeCodes = localesToUseFrom(requestedLocales);
26636 _localeCode = _localeCodes[0];
26637 let loadStringsPromises = [];
26638 indexes.forEach((index, i3) => {
26639 const fullCoverageIndex = _localeCodes.findIndex(function(locale2) {
26640 return index[locale2] && index[locale2].pct === 1;
26642 _localeCodes.slice(0, fullCoverageIndex + 1).forEach(function(code) {
26643 let scopeId = Object.keys(localeDirs)[i3];
26644 let directory = Object.values(localeDirs)[i3];
26646 loadStringsPromises.push(localizer.loadLocale(code, scopeId, directory));
26649 return Promise.all(loadStringsPromises);
26651 updateForCurrentLocale();
26652 }).catch((err) => console.error(err));
26654 function localesToUseFrom(requestedLocales) {
26655 let supportedLocales = _dataLocales;
26657 for (let i3 in requestedLocales) {
26658 let locale2 = requestedLocales[i3];
26659 if (supportedLocales[locale2])
26660 toUse.push(locale2);
26661 if (locale2.includes("-")) {
26662 let langPart = locale2.split("-")[0];
26663 if (supportedLocales[langPart])
26664 toUse.push(langPart);
26667 return utilArrayUniq(toUse);
26669 function updateForCurrentLocale() {
26672 _languageCode = _localeCode.split("-")[0];
26673 const currentData = _dataLocales[_localeCode] || _dataLocales[_languageCode];
26674 const hash = utilStringQs(window.location.hash);
26675 if (hash.rtl === "true") {
26676 _textDirection = "rtl";
26677 } else if (hash.rtl === "false") {
26678 _textDirection = "ltr";
26680 _textDirection = currentData && currentData.rtl ? "rtl" : "ltr";
26682 let locale2 = _localeCode;
26683 if (locale2.toLowerCase() === "en-us")
26685 _languageNames = _localeStrings.general[locale2].languageNames || _localeStrings.general[_languageCode].languageNames;
26686 _scriptNames = _localeStrings.general[locale2].scriptNames || _localeStrings.general[_languageCode].scriptNames;
26687 _usesMetric = _localeCode.slice(-3).toLowerCase() !== "-us";
26689 localizer.loadLocale = (locale2, scopeId, directory) => {
26690 if (locale2.toLowerCase() === "en-us")
26692 if (_localeStrings[scopeId] && _localeStrings[scopeId][locale2]) {
26693 return Promise.resolve(locale2);
26695 let fileMap = _mainFileFetcher.fileMap();
26696 const key = `locale_${scopeId}_${locale2}`;
26697 if (!fileMap[key]) {
26698 fileMap[key] = `${directory}/${locale2}.min.json`;
26700 return _mainFileFetcher.get(key).then((d2) => {
26701 if (!_localeStrings[scopeId])
26702 _localeStrings[scopeId] = {};
26703 _localeStrings[scopeId][locale2] = d2[locale2];
26707 localizer.pluralRule = function(number3) {
26708 return pluralRule(number3, _localeCode);
26710 function pluralRule(number3, localeCode) {
26711 const rules = "Intl" in window && Intl.PluralRules && new Intl.PluralRules(localeCode);
26713 return rules.select(number3);
26719 localizer.tInfo = function(origStringId, replacements, locale2) {
26720 let stringId = origStringId.trim();
26721 let scopeId = "general";
26722 if (stringId[0] === "_") {
26723 let split = stringId.split(".");
26724 scopeId = split[0].slice(1);
26725 stringId = split.slice(1).join(".");
26727 locale2 = locale2 || _localeCode;
26728 let path = stringId.split(".").map((s2) => s2.replace(/<TX_DOT>/g, ".")).reverse();
26729 let stringsKey = locale2;
26730 if (stringsKey.toLowerCase() === "en-us")
26732 let result = _localeStrings && _localeStrings[scopeId] && _localeStrings[scopeId][stringsKey];
26733 while (result !== void 0 && path.length) {
26734 result = result[path.pop()];
26736 if (result !== void 0) {
26737 if (replacements) {
26738 if (typeof result === "object" && Object.keys(result).length) {
26739 const number3 = Object.values(replacements).find(function(value) {
26740 return typeof value === "number";
26742 if (number3 !== void 0) {
26743 const rule = pluralRule(number3, locale2);
26744 if (result[rule]) {
26745 result = result[rule];
26747 result = Object.values(result)[0];
26751 if (typeof result === "string") {
26752 for (let key in replacements) {
26753 let value = replacements[key];
26754 if (typeof value === "number") {
26755 if (value.toLocaleString) {
26756 value = value.toLocaleString(locale2, {
26759 minimumFractionDigits: 0
26762 value = value.toString();
26765 const token = `{${key}}`;
26766 const regex = new RegExp(token, "g");
26767 result = result.replace(regex, value);
26771 if (typeof result === "string") {
26778 let index = _localeCodes.indexOf(locale2);
26779 if (index >= 0 && index < _localeCodes.length - 1) {
26780 let fallback = _localeCodes[index + 1];
26781 return localizer.tInfo(origStringId, replacements, fallback);
26783 if (replacements && "default" in replacements) {
26785 text: replacements.default,
26789 const missing = `Missing ${locale2} translation: ${origStringId}`;
26790 if (typeof console !== "undefined")
26791 console.error(missing);
26797 localizer.hasTextForStringId = function(stringId) {
26798 return !!localizer.tInfo(stringId, { default: "nothing found" }).locale;
26800 localizer.t = function(stringId, replacements, locale2) {
26801 return localizer.tInfo(stringId, replacements, locale2).text;
26803 localizer.t.html = function(stringId, replacements, locale2) {
26804 replacements = Object.assign({}, replacements);
26805 for (var k2 in replacements) {
26806 if (typeof replacements[k2] === "string") {
26807 replacements[k2] = escape_default(replacements[k2]);
26809 if (typeof replacements[k2] === "object" && typeof replacements[k2].html === "string") {
26810 replacements[k2] = replacements[k2].html;
26813 const info = localizer.tInfo(stringId, replacements, locale2);
26815 return `<span class="localized-text" lang="${info.locale || "und"}">${info.text}</span>`;
26820 localizer.t.append = function(stringId, replacements, locale2) {
26821 const ret = function(selection2) {
26822 const info = localizer.tInfo(stringId, replacements, locale2);
26823 return selection2.append("span").attr("class", "localized-text").attr("lang", info.locale || "und").text((replacements && replacements.prefix || "") + info.text + (replacements && replacements.suffix || ""));
26825 ret.stringId = stringId;
26828 localizer.languageName = (code, options2) => {
26829 if (_languageNames && _languageNames[code]) {
26830 return _languageNames[code];
26832 if (options2 && options2.localOnly)
26834 const langInfo = _dataLanguages[code];
26836 if (langInfo.nativeName) {
26837 return localizer.t("translate.language_and_code", { language: langInfo.nativeName, code });
26838 } else if (langInfo.base && langInfo.script) {
26839 const base = langInfo.base;
26840 if (_languageNames && _languageNames[base]) {
26841 const scriptCode = langInfo.script;
26842 const script = _scriptNames && _scriptNames[scriptCode] || scriptCode;
26843 return localizer.t("translate.language_and_code", { language: _languageNames[base], code: script });
26844 } else if (_dataLanguages[base] && _dataLanguages[base].nativeName) {
26845 return localizer.t("translate.language_and_code", { language: _dataLanguages[base].nativeName, code });
26851 localizer.floatFormatter = (locale2) => {
26852 if (!("Intl" in window && "NumberFormat" in Intl && "formatToParts" in Intl.NumberFormat.prototype)) {
26853 return (number3, fractionDigits) => {
26854 return fractionDigits === void 0 ? number3.toString() : number3.toFixed(fractionDigits);
26857 return (number3, fractionDigits) => number3.toLocaleString(locale2, {
26858 minimumFractionDigits: fractionDigits,
26859 maximumFractionDigits: fractionDigits === void 0 ? 20 : fractionDigits
26863 localizer.floatParser = (locale2) => {
26864 const polyfill = (string) => +string.trim();
26865 if (!("Intl" in window && "NumberFormat" in Intl))
26867 const format2 = new Intl.NumberFormat(locale2, { maximumFractionDigits: 20 });
26868 if (!("formatToParts" in format2))
26870 const parts = format2.formatToParts(-12345.6);
26871 const numerals = Array.from({ length: 10 }).map((_2, i3) => format2.format(i3));
26872 const index = new Map(numerals.map((d2, i3) => [d2, i3]));
26873 const literalPart = parts.find((d2) => d2.type === "literal");
26874 const literal = literalPart && new RegExp(`[${literalPart.value}]`, "g");
26875 const groupPart = parts.find((d2) => d2.type === "group");
26876 const group = groupPart && new RegExp(`[${groupPart.value}]`, "g");
26877 const decimalPart = parts.find((d2) => d2.type === "decimal");
26878 const decimal = decimalPart && new RegExp(`[${decimalPart.value}]`);
26879 const numeral = new RegExp(`[${numerals.join("")}]`, "g");
26880 const getIndex = (d2) => index.get(d2);
26881 return (string) => {
26882 string = string.trim();
26884 string = string.replace(literal, "");
26886 string = string.replace(group, "");
26888 string = string.replace(decimal, ".");
26889 string = string.replace(numeral, getIndex);
26890 return string ? +string : NaN;
26893 localizer.decimalPlaceCounter = (locale2) => {
26894 var literal, group, decimal;
26895 if ("Intl" in window && "NumberFormat" in Intl) {
26896 const format2 = new Intl.NumberFormat(locale2, { maximumFractionDigits: 20 });
26897 if ("formatToParts" in format2) {
26898 const parts = format2.formatToParts(-12345.6);
26899 const literalPart = parts.find((d2) => d2.type === "literal");
26900 literal = literalPart && new RegExp(`[${literalPart.value}]`, "g");
26901 const groupPart = parts.find((d2) => d2.type === "group");
26902 group = groupPart && new RegExp(`[${groupPart.value}]`, "g");
26903 const decimalPart = parts.find((d2) => d2.type === "decimal");
26904 decimal = decimalPart && new RegExp(`[${decimalPart.value}]`);
26907 return (string) => {
26908 string = string.trim();
26910 string = string.replace(literal, "");
26912 string = string.replace(group, "");
26913 const parts = string.split(decimal || ".");
26914 return parts && parts[1] && parts[1].length || 0;
26920 // modules/presets/collection.js
26921 function presetCollection(collection) {
26922 const MAXRESULTS = 50;
26925 _this.collection = collection;
26926 _this.item = (id2) => {
26929 const found = _this.collection.find((d2) => d2.id === id2);
26931 _memo[id2] = found;
26934 _this.index = (id2) => _this.collection.findIndex((d2) => d2.id === id2);
26935 _this.matchGeometry = (geometry) => {
26936 return presetCollection(
26937 _this.collection.filter((d2) => d2.matchGeometry(geometry))
26940 _this.matchAllGeometry = (geometries) => {
26941 return presetCollection(
26942 _this.collection.filter((d2) => d2 && d2.matchAllGeometry(geometries))
26945 _this.matchAnyGeometry = (geometries) => {
26946 return presetCollection(
26947 _this.collection.filter((d2) => geometries.some((geom) => d2.matchGeometry(geom)))
26950 _this.fallback = (geometry) => {
26951 let id2 = geometry;
26952 if (id2 === "vertex")
26954 return _this.item(id2);
26956 _this.search = (value, geometry, loc) => {
26959 value = value.toLowerCase().trim();
26960 function leading(a2) {
26961 const index = a2.indexOf(value);
26962 return index === 0 || a2[index - 1] === " ";
26964 function leadingStrict(a2) {
26965 const index = a2.indexOf(value);
26966 return index === 0;
26968 function sortPresets(nameProp, aliasesProp) {
26969 return function sortNames(a2, b2) {
26970 let aCompare = a2[nameProp]();
26971 let bCompare = b2[nameProp]();
26973 const findMatchingAlias = (strings) => {
26974 if (strings.some((s2) => s2 === value)) {
26975 return strings.find((s2) => s2 === value);
26977 return strings.filter((s2) => s2.includes(value)).sort((a3, b3) => a3.length - b3.length)[0];
26980 aCompare = findMatchingAlias([aCompare].concat(a2[aliasesProp]()));
26981 bCompare = findMatchingAlias([bCompare].concat(b2[aliasesProp]()));
26983 if (value === aCompare)
26985 if (value === bCompare)
26987 let i3 = b2.originalScore - a2.originalScore;
26990 i3 = aCompare.indexOf(value) - bCompare.indexOf(value);
26993 return aCompare.length - bCompare.length;
26996 let pool = _this.collection;
26997 if (Array.isArray(loc)) {
26998 const validHere = _sharedLocationManager.locationSetsAt(loc);
26999 pool = pool.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
27001 const searchable = pool.filter((a2) => a2.searchable !== false && a2.suggestion !== true);
27002 const suggestions = pool.filter((a2) => a2.suggestion === true);
27003 const leadingNames = searchable.filter((a2) => leading(a2.searchName()) || a2.searchAliases().some(leading)).sort(sortPresets("searchName", "searchAliases"));
27004 const leadingSuggestions = suggestions.filter((a2) => leadingStrict(a2.searchName())).sort(sortPresets("searchName"));
27005 const leadingNamesStripped = searchable.filter((a2) => leading(a2.searchNameStripped()) || a2.searchAliasesStripped().some(leading)).sort(sortPresets("searchNameStripped", "searchAliasesStripped"));
27006 const leadingSuggestionsStripped = suggestions.filter((a2) => leadingStrict(a2.searchNameStripped())).sort(sortPresets("searchNameStripped"));
27007 const leadingTerms = searchable.filter((a2) => (a2.terms() || []).some(leading));
27008 const leadingSuggestionTerms = suggestions.filter((a2) => (a2.terms() || []).some(leading));
27009 const leadingTagValues = searchable.filter((a2) => Object.values(a2.tags || {}).filter((val) => val !== "*").some(leading));
27010 const similarName = searchable.map((a2) => ({ preset: a2, dist: utilEditDistance(value, a2.searchName()) })).filter((a2) => a2.dist + Math.min(value.length - a2.preset.searchName().length, 0) < 3).sort((a2, b2) => a2.dist - b2.dist).map((a2) => a2.preset);
27011 const similarSuggestions = suggestions.map((a2) => ({ preset: a2, dist: utilEditDistance(value, a2.searchName()) })).filter((a2) => a2.dist + Math.min(value.length - a2.preset.searchName().length, 0) < 1).sort((a2, b2) => a2.dist - b2.dist).map((a2) => a2.preset);
27012 const similarTerms = searchable.filter((a2) => {
27013 return (a2.terms() || []).some((b2) => {
27014 return utilEditDistance(value, b2) + Math.min(value.length - b2.length, 0) < 3;
27017 let leadingTagKeyValues = [];
27018 if (value.includes("=")) {
27019 leadingTagKeyValues = searchable.filter((a2) => a2.tags && Object.keys(a2.tags).some((key) => key + "=" + a2.tags[key] === value)).concat(searchable.filter((a2) => a2.tags && Object.keys(a2.tags).some((key) => leading(key + "=" + a2.tags[key]))));
27021 let results = leadingNames.concat(
27022 leadingSuggestions,
27023 leadingNamesStripped,
27024 leadingSuggestionsStripped,
27026 leadingSuggestionTerms,
27029 similarSuggestions,
27031 leadingTagKeyValues
27032 ).slice(0, MAXRESULTS - 1);
27034 if (typeof geometry === "string") {
27035 results.push(_this.fallback(geometry));
27037 geometry.forEach((geom) => results.push(_this.fallback(geom)));
27040 return presetCollection(utilArrayUniq(results));
27045 // modules/presets/category.js
27046 function presetCategory(categoryID, category, allPresets) {
27047 let _this = Object.assign({}, category);
27049 let _searchNameStripped;
27050 _this.id = categoryID;
27051 _this.members = presetCollection(
27052 (category.members || []).map((presetID) => allPresets[presetID]).filter(Boolean)
27054 _this.geometry = _this.members.collection.reduce((acc, preset) => {
27055 for (let i3 in preset.geometry) {
27056 const geometry = preset.geometry[i3];
27057 if (acc.indexOf(geometry) === -1) {
27058 acc.push(geometry);
27063 _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
27064 _this.matchAllGeometry = (geometries) => _this.members.collection.some((preset) => preset.matchAllGeometry(geometries));
27065 _this.matchScore = () => -1;
27066 _this.name = () => _t(`_tagging.presets.categories.${categoryID}.name`, { "default": categoryID });
27067 _this.nameLabel = () => _t.append(`_tagging.presets.categories.${categoryID}.name`, { "default": categoryID });
27068 _this.terms = () => [];
27069 _this.searchName = () => {
27070 if (!_searchName) {
27071 _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
27073 return _searchName;
27075 _this.searchNameStripped = () => {
27076 if (!_searchNameStripped) {
27077 _searchNameStripped = _this.searchName();
27078 if (_searchNameStripped.normalize)
27079 _searchNameStripped = _searchNameStripped.normalize("NFD");
27080 _searchNameStripped = _searchNameStripped.replace(/[\u0300-\u036f]/g, "");
27082 return _searchNameStripped;
27084 _this.searchAliases = () => [];
27085 _this.searchAliasesStripped = () => [];
27089 // modules/presets/field.js
27090 function presetField(fieldID, field, allFields) {
27091 allFields = allFields || {};
27092 let _this = Object.assign({}, field);
27093 _this.id = fieldID;
27094 _this.safeid = utilSafeClassName(fieldID);
27095 _this.matchGeometry = (geom) => !_this.geometry || _this.geometry.indexOf(geom) !== -1;
27096 _this.matchAllGeometry = (geometries) => {
27097 return !_this.geometry || geometries.every((geom) => _this.geometry.indexOf(geom) !== -1);
27099 _this.t = (scope, options2) => _t(`_tagging.presets.fields.${fieldID}.${scope}`, options2);
27100 _this.t.html = (scope, options2) => _t.html(`_tagging.presets.fields.${fieldID}.${scope}`, options2);
27101 _this.t.append = (scope, options2) => _t.append(`_tagging.presets.fields.${fieldID}.${scope}`, options2);
27102 _this.hasTextForStringId = (scope) => _mainLocalizer.hasTextForStringId(`_tagging.presets.fields.${fieldID}.${scope}`);
27103 _this.resolveReference = (which) => {
27104 const referenceRegex = /^\{(.*)\}$/;
27105 const match = (field[which] || "").match(referenceRegex);
27107 const field2 = allFields[match[1]];
27111 console.error(`Unable to resolve referenced field: ${match[1]}`);
27115 _this.title = () => _this.overrideLabel || _this.resolveReference("label").t("label", { "default": fieldID });
27116 _this.label = () => _this.overrideLabel ? (selection2) => selection2.text(_this.overrideLabel) : _this.resolveReference("label").t.append("label", { "default": fieldID });
27117 _this.placeholder = () => _this.resolveReference("placeholder").t("placeholder", { "default": "" });
27118 _this.originalTerms = (_this.terms || []).join();
27119 _this.terms = () => _this.resolveReference("label").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
27120 _this.increment = _this.type === "number" ? _this.increment || 1 : void 0;
27124 // modules/presets/preset.js
27125 var import_lodash = __toESM(require_lodash());
27126 function presetPreset(presetID, preset, addable, allFields, allPresets) {
27127 allFields = allFields || {};
27128 allPresets = allPresets || {};
27129 let _this = Object.assign({}, preset);
27130 let _addable = addable || false;
27132 let _searchNameStripped;
27133 let _searchAliases;
27134 let _searchAliasesStripped;
27135 const referenceRegex = /^\{(.*)\}$/;
27136 _this.id = presetID;
27137 _this.safeid = utilSafeClassName(presetID);
27138 _this.originalTerms = (_this.terms || []).join();
27139 _this.originalName = _this.name || "";
27140 _this.originalAliases = (_this.aliases || []).join("\n");
27141 _this.originalScore = _this.matchScore || 1;
27142 _this.originalReference = _this.reference || {};
27143 _this.originalFields = _this.fields || [];
27144 _this.originalMoreFields = _this.moreFields || [];
27145 _this.fields = (loc) => resolveFields("fields", loc);
27146 _this.moreFields = (loc) => resolveFields("moreFields", loc);
27147 _this.tags = _this.tags || {};
27148 _this.addTags = _this.addTags || _this.tags;
27149 _this.removeTags = _this.removeTags || _this.addTags;
27150 _this.geometry = _this.geometry || [];
27151 _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
27152 _this.matchAllGeometry = (geoms) => geoms.every(_this.matchGeometry);
27153 _this.matchScore = (entityTags) => {
27154 const tags = _this.tags;
27157 for (let k2 in tags) {
27159 if (entityTags[k2] === tags[k2]) {
27160 score += _this.originalScore;
27161 } else if (tags[k2] === "*" && k2 in entityTags) {
27162 score += _this.originalScore / 2;
27167 const addTags = _this.addTags;
27168 for (let k2 in addTags) {
27169 if (!seen[k2] && entityTags[k2] === addTags[k2]) {
27170 score += _this.originalScore;
27173 if (_this.searchable === false) {
27178 _this.t = (scope, options2) => {
27179 const textID = `_tagging.presets.presets.${presetID}.${scope}`;
27180 return _t(textID, options2);
27182 _this.t.append = (scope, options2) => {
27183 const textID = `_tagging.presets.presets.${presetID}.${scope}`;
27184 return _t.append(textID, options2);
27186 function resolveReference(which) {
27187 const match = (_this[which] || "").match(referenceRegex);
27189 const preset2 = allPresets[match[1]];
27193 console.error(`Unable to resolve referenced preset: ${match[1]}`);
27197 _this.name = () => {
27198 return resolveReference("originalName").t("name", { "default": _this.originalName || presetID });
27200 _this.nameLabel = () => {
27201 return resolveReference("originalName").t.append("name", { "default": _this.originalName || presetID });
27203 _this.subtitle = () => {
27204 if (_this.suggestion) {
27205 let path = presetID.split("/");
27207 return _t("_tagging.presets.presets." + path.join("/") + ".name");
27211 _this.subtitleLabel = () => {
27212 if (_this.suggestion) {
27213 let path = presetID.split("/");
27215 return _t.append("_tagging.presets.presets." + path.join("/") + ".name");
27219 _this.aliases = () => {
27220 return resolveReference("originalName").t("aliases", { "default": _this.originalAliases }).trim().split(/\s*[\r\n]+\s*/);
27222 _this.terms = () => {
27223 return resolveReference("originalName").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
27225 _this.searchName = () => {
27226 if (!_searchName) {
27227 _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
27229 return _searchName;
27231 _this.searchNameStripped = () => {
27232 if (!_searchNameStripped) {
27233 _searchNameStripped = stripDiacritics(_this.searchName());
27235 return _searchNameStripped;
27237 _this.searchAliases = () => {
27238 if (!_searchAliases) {
27239 _searchAliases = _this.aliases().map((alias) => alias.toLowerCase());
27241 return _searchAliases;
27243 _this.searchAliasesStripped = () => {
27244 if (!_searchAliasesStripped) {
27245 _searchAliasesStripped = _this.searchAliases();
27246 _searchAliasesStripped = _searchAliasesStripped.map(stripDiacritics);
27248 return _searchAliasesStripped;
27250 _this.isFallback = () => {
27251 const tagCount = Object.keys(_this.tags).length;
27252 return tagCount === 0 || tagCount === 1 && _this.tags.hasOwnProperty("area");
27254 _this.addable = function(val) {
27255 if (!arguments.length)
27260 _this.reference = () => {
27261 const qid = _this.tags.wikidata || _this.tags["flag:wikidata"] || _this.tags["brand:wikidata"] || _this.tags["network:wikidata"] || _this.tags["operator:wikidata"];
27265 let key = _this.originalReference.key || Object.keys(utilObjectOmit(_this.tags, "name"))[0];
27266 let value = _this.originalReference.value || _this.tags[key];
27267 if (value === "*") {
27270 return { key, value };
27273 _this.unsetTags = (tags, geometry, ignoringKeys, skipFieldDefaults, loc) => {
27274 let removeTags = ignoringKeys ? utilObjectOmit(_this.removeTags, ignoringKeys) : _this.removeTags;
27275 tags = utilObjectOmit(tags, Object.keys(removeTags));
27276 if (geometry && !skipFieldDefaults) {
27277 _this.fields(loc).forEach((field) => {
27278 if (field.matchGeometry(geometry) && field.key && field.default === tags[field.key] && (!ignoringKeys || ignoringKeys.indexOf(field.key) === -1)) {
27279 delete tags[field.key];
27286 _this.setTags = (tags, geometry, skipFieldDefaults, loc) => {
27287 const addTags = _this.addTags;
27288 tags = Object.assign({}, tags);
27289 for (let k2 in addTags) {
27290 if (addTags[k2] === "*") {
27291 if (_this.tags[k2] || !tags[k2]) {
27295 tags[k2] = addTags[k2];
27298 if (!addTags.hasOwnProperty("area")) {
27300 if (geometry === "area") {
27301 let needsAreaTag = true;
27302 for (let k2 in addTags) {
27303 if (_this.geometry.indexOf("line") === -1 && k2 in osmAreaKeys || k2 in osmAreaKeysExceptions && addTags[k2] in osmAreaKeysExceptions[k2]) {
27304 needsAreaTag = false;
27308 if (needsAreaTag) {
27313 if (geometry && !skipFieldDefaults) {
27314 _this.fields(loc).forEach((field) => {
27315 if (field.matchGeometry(geometry) && field.key && !tags[field.key] && field.default) {
27316 tags[field.key] = field.default;
27322 function resolveFields(which, loc) {
27323 const fieldIDs = which === "fields" ? _this.originalFields : _this.originalMoreFields;
27325 fieldIDs.forEach((fieldID) => {
27326 const match = fieldID.match(referenceRegex);
27327 if (match !== null) {
27328 resolved = resolved.concat(inheritFields(allPresets[match[1]], which));
27329 } else if (allFields[fieldID]) {
27330 resolved.push(allFields[fieldID]);
27332 console.log(`Cannot resolve "${fieldID}" found in ${_this.id}.${which}`);
27335 if (!resolved.length) {
27336 const endIndex = _this.id.lastIndexOf("/");
27337 const parentID = endIndex && _this.id.substring(0, endIndex);
27339 let parent = allPresets[parentID];
27341 const validHere = _sharedLocationManager.locationSetsAt(loc);
27342 if (parent?.locationSetID && !validHere[parent.locationSetID]) {
27343 const candidateIDs = Object.keys(allPresets).filter((k2) => k2.startsWith(parentID));
27344 parent = allPresets[candidateIDs.find((candidateID) => {
27345 const candidate = allPresets[candidateID];
27346 return validHere[candidate.locationSetID] && (0, import_lodash.isEqual)(candidate.tags, parent.tags);
27350 resolved = inheritFields(parent, which);
27353 return utilArrayUniq(resolved);
27354 function inheritFields(parent, which2) {
27357 if (which2 === "fields") {
27358 return parent.fields().filter(shouldInherit);
27359 } else if (which2 === "moreFields") {
27360 return parent.moreFields();
27365 function shouldInherit(f3) {
27366 if (f3.key && _this.tags[f3.key] !== void 0 && // inherit anyway if multiple values are allowed or just a checkbox
27367 f3.type !== "multiCombo" && f3.type !== "semiCombo" && f3.type !== "manyCombo" && f3.type !== "check")
27372 function stripDiacritics(s2) {
27374 s2 = s2.normalize("NFD");
27375 s2 = s2.replace(/[\u0300-\u036f]/g, "");
27381 // modules/presets/index.js
27382 var _mainPresetIndex = presetIndex();
27383 function presetIndex() {
27384 const dispatch14 = dispatch_default("favoritePreset", "recentsChange");
27385 const MAXRECENTS = 30;
27386 const POINT = presetPreset("point", { name: "Point", tags: {}, geometry: ["point", "vertex"], matchScore: 0.1 });
27387 const LINE = presetPreset("line", { name: "Line", tags: {}, geometry: ["line"], matchScore: 0.1 });
27388 const AREA = presetPreset("area", { name: "Area", tags: { area: "yes" }, geometry: ["area"], matchScore: 0.1 });
27389 const RELATION = presetPreset("relation", { name: "Relation", tags: {}, geometry: ["relation"], matchScore: 0.1 });
27390 let _this = presetCollection([POINT, LINE, AREA, RELATION]);
27391 let _presets = { point: POINT, line: LINE, area: AREA, relation: RELATION };
27393 point: presetCollection([POINT]),
27394 vertex: presetCollection([POINT]),
27395 line: presetCollection([LINE]),
27396 area: presetCollection([AREA]),
27397 relation: presetCollection([RELATION])
27400 let _categories = {};
27401 let _universal = [];
27402 let _addablePresetIDs = null;
27405 let _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
27407 _this.ensureLoaded = () => {
27409 return _loadPromise;
27410 return _loadPromise = Promise.all([
27411 _mainFileFetcher.get("preset_categories"),
27412 _mainFileFetcher.get("preset_defaults"),
27413 _mainFileFetcher.get("preset_presets"),
27414 _mainFileFetcher.get("preset_fields")
27415 ]).then((vals) => {
27417 categories: vals[0],
27422 osmSetAreaKeys(_this.areaKeys());
27423 osmSetLineTags(_this.lineTags());
27424 osmSetPointTags(_this.pointTags());
27425 osmSetVertexTags(_this.vertexTags());
27428 _this.merge = (d2) => {
27429 let newLocationSets = [];
27431 Object.keys(d2.fields).forEach((fieldID) => {
27432 let f3 = d2.fields[fieldID];
27434 f3 = presetField(fieldID, f3, _fields);
27435 if (f3.locationSet)
27436 newLocationSets.push(f3);
27437 _fields[fieldID] = f3;
27439 delete _fields[fieldID];
27444 Object.keys(d2.presets).forEach((presetID) => {
27445 let p2 = d2.presets[presetID];
27447 const isAddable = !_addablePresetIDs || _addablePresetIDs.has(presetID);
27448 p2 = presetPreset(presetID, p2, isAddable, _fields, _presets);
27449 if (p2.locationSet)
27450 newLocationSets.push(p2);
27451 _presets[presetID] = p2;
27453 const existing = _presets[presetID];
27454 if (existing && !existing.isFallback()) {
27455 delete _presets[presetID];
27460 if (d2.categories) {
27461 Object.keys(d2.categories).forEach((categoryID) => {
27462 let c2 = d2.categories[categoryID];
27464 c2 = presetCategory(categoryID, c2, _presets);
27465 if (c2.locationSet)
27466 newLocationSets.push(c2);
27467 _categories[categoryID] = c2;
27469 delete _categories[categoryID];
27473 _this.collection = Object.values(_presets).concat(Object.values(_categories));
27475 Object.keys(d2.defaults).forEach((geometry) => {
27476 const def = d2.defaults[geometry];
27477 if (Array.isArray(def)) {
27478 _defaults2[geometry] = presetCollection(
27479 def.map((id2) => _presets[id2] || _categories[id2]).filter(Boolean)
27482 delete _defaults2[geometry];
27486 _universal = Object.values(_fields).filter((field) => field.universal);
27487 _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
27488 _this.collection.forEach((preset) => {
27489 (preset.geometry || []).forEach((geometry) => {
27490 let g3 = _geometryIndex[geometry];
27491 for (let key in preset.tags) {
27492 g3[key] = g3[key] || {};
27493 let value = preset.tags[key];
27494 (g3[key][value] = g3[key][value] || []).push(preset);
27498 if (d2.featureCollection && Array.isArray(d2.featureCollection.features)) {
27499 _sharedLocationManager.mergeCustomGeoJSON(d2.featureCollection);
27501 if (newLocationSets.length) {
27502 _sharedLocationManager.mergeLocationSets(newLocationSets);
27506 _this.match = (entity, resolver) => {
27507 return resolver.transient(entity, "presetMatch", () => {
27508 let geometry = entity.geometry(resolver);
27509 if (geometry === "vertex" && entity.isOnAddressLine(resolver)) {
27510 geometry = "point";
27512 const entityExtent = entity.extent(resolver);
27513 return _this.matchTags(entity.tags, geometry, entityExtent.center());
27516 _this.matchTags = (tags, geometry, loc) => {
27517 const keyIndex = _geometryIndex[geometry];
27518 let bestScore = -1;
27520 let matchCandidates = [];
27521 for (let k2 in tags) {
27522 let indexMatches = [];
27523 let valueIndex = keyIndex[k2];
27526 let keyValueMatches = valueIndex[tags[k2]];
27527 if (keyValueMatches)
27528 indexMatches.push(...keyValueMatches);
27529 let keyStarMatches = valueIndex["*"];
27530 if (keyStarMatches)
27531 indexMatches.push(...keyStarMatches);
27532 if (indexMatches.length === 0)
27534 for (let i3 = 0; i3 < indexMatches.length; i3++) {
27535 const candidate = indexMatches[i3];
27536 const score = candidate.matchScore(tags);
27537 if (score === -1) {
27540 matchCandidates.push({ score, candidate });
27541 if (score > bestScore) {
27543 bestMatch = candidate;
27547 if (bestMatch && bestMatch.locationSetID && bestMatch.locationSetID !== "+[Q2]" && Array.isArray(loc)) {
27548 const validHere = _sharedLocationManager.locationSetsAt(loc);
27549 if (!validHere[bestMatch.locationSetID]) {
27550 matchCandidates.sort((a2, b2) => a2.score < b2.score ? 1 : -1);
27551 for (let i3 = 0; i3 < matchCandidates.length; i3++) {
27552 const candidateScore = matchCandidates[i3];
27553 if (!candidateScore.candidate.locationSetID || validHere[candidateScore.candidate.locationSetID]) {
27554 bestMatch = candidateScore.candidate;
27555 bestScore = candidateScore.score;
27561 if (!bestMatch || bestMatch.isFallback()) {
27562 for (let k2 in tags) {
27563 if (/^addr:/.test(k2) && keyIndex["addr:*"] && keyIndex["addr:*"]["*"]) {
27564 bestMatch = keyIndex["addr:*"]["*"][0];
27569 return bestMatch || _this.fallback(geometry);
27571 _this.allowsVertex = (entity, resolver) => {
27572 if (entity.type !== "node")
27574 if (Object.keys(entity.tags).length === 0)
27576 return resolver.transient(entity, "vertexMatch", () => {
27577 if (entity.isOnAddressLine(resolver))
27579 const geometries = osmNodeGeometriesForTags(entity.tags);
27580 if (geometries.vertex)
27582 if (geometries.point)
27587 _this.areaKeys = () => {
27594 traffic_calming: true,
27598 const presets = _this.collection.filter((p2) => !p2.suggestion && !p2.replacement);
27599 presets.forEach((p2) => {
27600 const keys2 = p2.tags && Object.keys(p2.tags);
27601 const key = keys2 && keys2.length && keys2[0];
27606 if (p2.geometry.indexOf("area") !== -1) {
27607 areaKeys[key] = areaKeys[key] || {};
27610 presets.forEach((p2) => {
27612 for (key in p2.addTags) {
27613 const value = p2.addTags[key];
27614 if (key in areaKeys && // probably an area...
27615 p2.geometry.indexOf("line") !== -1 && // but sometimes a line
27617 areaKeys[key][value] = true;
27623 _this.lineTags = () => {
27624 return _this.collection.filter((lineTags, d2) => {
27625 if (d2.suggestion || d2.replacement || d2.searchable === false)
27627 const keys2 = d2.tags && Object.keys(d2.tags);
27628 const key = keys2 && keys2.length && keys2[0];
27631 if (d2.geometry.indexOf("line") !== -1) {
27632 lineTags[key] = lineTags[key] || [];
27633 lineTags[key].push(d2.tags);
27638 _this.pointTags = () => {
27639 return _this.collection.reduce((pointTags, d2) => {
27640 if (d2.suggestion || d2.replacement || d2.searchable === false)
27642 const keys2 = d2.tags && Object.keys(d2.tags);
27643 const key = keys2 && keys2.length && keys2[0];
27646 if (d2.geometry.indexOf("point") !== -1) {
27647 pointTags[key] = pointTags[key] || {};
27648 pointTags[key][d2.tags[key]] = true;
27653 _this.vertexTags = () => {
27654 return _this.collection.reduce((vertexTags, d2) => {
27655 if (d2.suggestion || d2.replacement || d2.searchable === false)
27657 const keys2 = d2.tags && Object.keys(d2.tags);
27658 const key = keys2 && keys2.length && keys2[0];
27661 if (d2.geometry.indexOf("vertex") !== -1) {
27662 vertexTags[key] = vertexTags[key] || {};
27663 vertexTags[key][d2.tags[key]] = true;
27668 _this.field = (id2) => _fields[id2];
27669 _this.universal = () => _universal;
27670 _this.defaults = (geometry, n3, startWithRecents, loc, extraPresets) => {
27672 if (startWithRecents) {
27673 recents = _this.recent().matchGeometry(geometry).collection.slice(0, 4);
27676 if (_addablePresetIDs) {
27677 defaults = Array.from(_addablePresetIDs).map(function(id2) {
27678 var preset = _this.item(id2);
27679 if (preset && preset.matchGeometry(geometry))
27682 }).filter(Boolean);
27684 defaults = _defaults2[geometry].collection.concat(_this.fallback(geometry));
27686 let result = presetCollection(
27687 utilArrayUniq(recents.concat(defaults).concat(extraPresets || [])).slice(0, n3 - 1)
27689 if (Array.isArray(loc)) {
27690 const validHere = _sharedLocationManager.locationSetsAt(loc);
27691 result.collection = result.collection.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
27695 _this.addablePresetIDs = function(val) {
27696 if (!arguments.length)
27697 return _addablePresetIDs;
27698 if (Array.isArray(val))
27699 val = new Set(val);
27700 _addablePresetIDs = val;
27701 if (_addablePresetIDs) {
27702 _this.collection.forEach((p2) => {
27704 p2.addable(_addablePresetIDs.has(p2.id));
27707 _this.collection.forEach((p2) => {
27714 _this.recent = () => {
27715 return presetCollection(
27716 utilArrayUniq(_this.getRecents().map((d2) => d2.preset).filter((d2) => d2.searchable !== false))
27719 function RibbonItem(preset, source) {
27721 item.preset = preset;
27722 item.source = source;
27723 item.isFavorite = () => item.source === "favorite";
27724 item.isRecent = () => item.source === "recent";
27725 item.matches = (preset2) => item.preset.id === preset2.id;
27726 item.minified = () => ({ pID: item.preset.id });
27729 function ribbonItemForMinified(d2, source) {
27730 if (d2 && d2.pID) {
27731 const preset = _this.item(d2.pID);
27734 return RibbonItem(preset, source);
27738 _this.getGenericRibbonItems = () => {
27739 return ["point", "line", "area"].map((id2) => RibbonItem(_this.item(id2), "generic"));
27741 _this.getAddable = () => {
27742 if (!_addablePresetIDs)
27744 return _addablePresetIDs.map((id2) => {
27745 const preset = _this.item(id2);
27747 return RibbonItem(preset, "addable");
27749 }).filter(Boolean);
27751 function setRecents(items) {
27753 const minifiedItems = items.map((d2) => d2.minified());
27754 corePreferences("preset_recents", JSON.stringify(minifiedItems));
27755 dispatch14.call("recentsChange");
27757 _this.getRecents = () => {
27759 _recents = (JSON.parse(corePreferences("preset_recents")) || []).reduce((acc, d2) => {
27760 let item = ribbonItemForMinified(d2, "recent");
27761 if (item && item.preset.addable())
27768 _this.addRecent = (preset, besidePreset, after) => {
27769 const recents = _this.getRecents();
27770 const beforeItem = _this.recentMatching(besidePreset);
27771 let toIndex = recents.indexOf(beforeItem);
27774 const newItem = RibbonItem(preset, "recent");
27775 recents.splice(toIndex, 0, newItem);
27776 setRecents(recents);
27778 _this.removeRecent = (preset) => {
27779 const item = _this.recentMatching(preset);
27781 let items = _this.getRecents();
27782 items.splice(items.indexOf(item), 1);
27786 _this.recentMatching = (preset) => {
27787 const items = _this.getRecents();
27788 for (let i3 in items) {
27789 if (items[i3].matches(preset)) {
27795 _this.moveItem = (items, fromIndex, toIndex) => {
27796 if (fromIndex === toIndex || fromIndex < 0 || toIndex < 0 || fromIndex >= items.length || toIndex >= items.length)
27798 items.splice(toIndex, 0, items.splice(fromIndex, 1)[0]);
27801 _this.moveRecent = (item, beforeItem) => {
27802 const recents = _this.getRecents();
27803 const fromIndex = recents.indexOf(item);
27804 const toIndex = recents.indexOf(beforeItem);
27805 const items = _this.moveItem(recents, fromIndex, toIndex);
27809 _this.setMostRecent = (preset) => {
27810 if (preset.searchable === false)
27812 let items = _this.getRecents();
27813 let item = _this.recentMatching(preset);
27815 items.splice(items.indexOf(item), 1);
27817 item = RibbonItem(preset, "recent");
27819 while (items.length >= MAXRECENTS) {
27822 items.unshift(item);
27825 function setFavorites(items) {
27826 _favorites = items;
27827 const minifiedItems = items.map((d2) => d2.minified());
27828 corePreferences("preset_favorites", JSON.stringify(minifiedItems));
27829 dispatch14.call("favoritePreset");
27831 _this.addFavorite = (preset, besidePreset, after) => {
27832 const favorites = _this.getFavorites();
27833 const beforeItem = _this.favoriteMatching(besidePreset);
27834 let toIndex = favorites.indexOf(beforeItem);
27837 const newItem = RibbonItem(preset, "favorite");
27838 favorites.splice(toIndex, 0, newItem);
27839 setFavorites(favorites);
27841 _this.toggleFavorite = (preset) => {
27842 const favs = _this.getFavorites();
27843 const favorite = _this.favoriteMatching(preset);
27845 favs.splice(favs.indexOf(favorite), 1);
27847 if (favs.length === 10) {
27850 favs.push(RibbonItem(preset, "favorite"));
27852 setFavorites(favs);
27854 _this.removeFavorite = (preset) => {
27855 const item = _this.favoriteMatching(preset);
27857 const items = _this.getFavorites();
27858 items.splice(items.indexOf(item), 1);
27859 setFavorites(items);
27862 _this.getFavorites = () => {
27864 let rawFavorites = JSON.parse(corePreferences("preset_favorites"));
27865 if (!rawFavorites) {
27867 corePreferences("preset_favorites", JSON.stringify(rawFavorites));
27869 _favorites = rawFavorites.reduce((output, d2) => {
27870 const item = ribbonItemForMinified(d2, "favorite");
27871 if (item && item.preset.addable())
27878 _this.favoriteMatching = (preset) => {
27879 const favs = _this.getFavorites();
27880 for (let index in favs) {
27881 if (favs[index].matches(preset)) {
27882 return favs[index];
27887 return utilRebind(_this, dispatch14, "on");
27890 // modules/util/util.js
27891 function utilTagText(entity) {
27892 var obj = entity && entity.tags || {};
27893 return Object.keys(obj).map(function(k2) {
27894 return k2 + "=" + obj[k2];
27897 function utilTotalExtent(array2, graph) {
27898 var extent = geoExtent();
27900 for (var i3 = 0; i3 < array2.length; i3++) {
27902 entity = typeof val === "string" ? graph.hasEntity(val) : val;
27904 extent._extend(entity.extent(graph));
27909 function utilTagDiff(oldTags, newTags) {
27911 var keys2 = utilArrayUnion(Object.keys(oldTags), Object.keys(newTags)).sort();
27912 keys2.forEach(function(k2) {
27913 var oldVal = oldTags[k2];
27914 var newVal = newTags[k2];
27915 if ((oldVal || oldVal === "") && (newVal === void 0 || newVal !== oldVal)) {
27921 display: "- " + k2 + "=" + oldVal
27924 if ((newVal || newVal === "") && (oldVal === void 0 || newVal !== oldVal)) {
27930 display: "+ " + k2 + "=" + newVal
27936 function utilEntitySelector(ids) {
27937 return ids.length ? "." + ids.join(",.") : "nothing";
27939 function utilEntityOrMemberSelector(ids, graph) {
27940 var seen = new Set(ids);
27941 ids.forEach(collectShallowDescendants);
27942 return utilEntitySelector(Array.from(seen));
27943 function collectShallowDescendants(id2) {
27944 var entity = graph.hasEntity(id2);
27945 if (!entity || entity.type !== "relation")
27947 entity.members.map(function(member) {
27949 }).forEach(function(id3) {
27954 function utilEntityOrDeepMemberSelector(ids, graph) {
27955 return utilEntitySelector(utilEntityAndDeepMemberIDs(ids, graph));
27957 function utilEntityAndDeepMemberIDs(ids, graph) {
27958 var seen = /* @__PURE__ */ new Set();
27959 ids.forEach(collectDeepDescendants);
27960 return Array.from(seen);
27961 function collectDeepDescendants(id2) {
27965 var entity = graph.hasEntity(id2);
27966 if (!entity || entity.type !== "relation")
27968 entity.members.map(function(member) {
27970 }).forEach(collectDeepDescendants);
27973 function utilDeepMemberSelector(ids, graph, skipMultipolgonMembers) {
27974 var idsSet = new Set(ids);
27975 var seen = /* @__PURE__ */ new Set();
27976 var returners = /* @__PURE__ */ new Set();
27977 ids.forEach(collectDeepDescendants);
27978 return utilEntitySelector(Array.from(returners));
27979 function collectDeepDescendants(id2) {
27983 if (!idsSet.has(id2)) {
27984 returners.add(id2);
27986 var entity = graph.hasEntity(id2);
27987 if (!entity || entity.type !== "relation")
27989 if (skipMultipolgonMembers && entity.isMultipolygon())
27991 entity.members.map(function(member) {
27993 }).forEach(collectDeepDescendants);
27996 function utilHighlightEntities(ids, highlighted, context) {
27997 context.surface().selectAll(utilEntityOrDeepMemberSelector(ids, context.graph())).classed("highlighted", highlighted);
27999 function utilGetAllNodes(ids, graph) {
28000 var seen = /* @__PURE__ */ new Set();
28001 var nodes = /* @__PURE__ */ new Set();
28002 ids.forEach(collectNodes);
28003 return Array.from(nodes);
28004 function collectNodes(id2) {
28008 var entity = graph.hasEntity(id2);
28011 if (entity.type === "node") {
28013 } else if (entity.type === "way") {
28014 entity.nodes.forEach(collectNodes);
28016 entity.members.map(function(member) {
28018 }).forEach(collectNodes);
28022 function utilDisplayName(entity) {
28023 var localizedNameKey = "name:" + _mainLocalizer.languageCode().toLowerCase();
28024 var name = entity.tags[localizedNameKey] || entity.tags.name || "";
28028 direction: entity.tags.direction,
28029 from: entity.tags.from,
28030 network: entity.tags.cycle_network || entity.tags.network,
28031 ref: entity.tags.ref,
28032 to: entity.tags.to,
28033 via: entity.tags.via
28035 var keyComponents = [];
28036 if (tags.network) {
28037 keyComponents.push("network");
28040 keyComponents.push("ref");
28042 if (entity.tags.route) {
28043 if (tags.direction) {
28044 keyComponents.push("direction");
28045 } else if (tags.from && tags.to) {
28046 keyComponents.push("from");
28047 keyComponents.push("to");
28049 keyComponents.push("via");
28053 if (keyComponents.length) {
28054 name = _t("inspector.display_name." + keyComponents.join("_"), tags);
28058 function utilDisplayNameForPath(entity) {
28059 var name = utilDisplayName(entity);
28060 var isFirefox = utilDetect().browser.toLowerCase().indexOf("firefox") > -1;
28061 var isNewChromium = Number(utilDetect().version.split(".")[0]) >= 96;
28062 if (!isFirefox && !isNewChromium && name && rtlRegex.test(name)) {
28063 name = fixRTLTextForSvg(name);
28067 function utilDisplayType(id2) {
28069 n: _t("inspector.node"),
28070 w: _t("inspector.way"),
28071 r: _t("inspector.relation")
28074 function utilDisplayLabel(entity, graphOrGeometry, verbose) {
28076 var displayName = utilDisplayName(entity);
28077 var preset = typeof graphOrGeometry === "string" ? _mainPresetIndex.matchTags(entity.tags, graphOrGeometry) : _mainPresetIndex.match(entity, graphOrGeometry);
28078 var presetName = preset && (preset.suggestion ? preset.subtitle() : preset.name());
28080 result = [presetName, displayName].filter(Boolean).join(" ");
28082 result = displayName || presetName;
28084 return result || utilDisplayType(entity.id);
28086 function utilEntityRoot(entityType) {
28093 function utilCombinedTags(entityIDs, graph) {
28095 var tagCounts = {};
28096 var allKeys = /* @__PURE__ */ new Set();
28097 var entities = entityIDs.map(function(entityID) {
28098 return graph.hasEntity(entityID);
28099 }).filter(Boolean);
28100 entities.forEach(function(entity) {
28101 var keys2 = Object.keys(entity.tags).filter(Boolean);
28102 keys2.forEach(function(key2) {
28106 entities.forEach(function(entity) {
28107 allKeys.forEach(function(key2) {
28108 var value = entity.tags[key2];
28109 if (!tags.hasOwnProperty(key2)) {
28110 tags[key2] = value;
28112 if (!Array.isArray(tags[key2])) {
28113 if (tags[key2] !== value) {
28114 tags[key2] = [tags[key2], value];
28117 if (tags[key2].indexOf(value) === -1) {
28118 tags[key2].push(value);
28122 var tagHash = key2 + "=" + value;
28123 if (!tagCounts[tagHash])
28124 tagCounts[tagHash] = 0;
28125 tagCounts[tagHash] += 1;
28128 for (var key in tags) {
28129 if (!Array.isArray(tags[key]))
28131 tags[key] = tags[key].sort(function(val12, val2) {
28133 var count2 = tagCounts[key2 + "=" + val2];
28134 var count1 = tagCounts[key2 + "=" + val12];
28135 if (count2 !== count1) {
28136 return count2 - count1;
28138 if (val2 && val12) {
28139 return val12.localeCompare(val2);
28141 return val12 ? 1 : -1;
28146 function utilStringQs(str2) {
28148 while (i3 < str2.length && (str2[i3] === "?" || str2[i3] === "#"))
28150 str2 = str2.slice(i3);
28151 return str2.split("&").reduce(function(obj, pair3) {
28152 var parts = pair3.split("=");
28153 if (parts.length === 2) {
28154 obj[parts[0]] = null === parts[1] ? "" : decodeURIComponent(parts[1]);
28159 function utilQsString(obj, noencode) {
28160 function softEncode(s2) {
28161 return encodeURIComponent(s2).replace(/(%2F|%3A|%2C|%7B|%7D)/g, decodeURIComponent);
28163 return Object.keys(obj).sort().map(function(key) {
28164 return encodeURIComponent(key) + "=" + (noencode ? softEncode(obj[key]) : encodeURIComponent(obj[key]));
28167 function utilPrefixDOMProperty(property) {
28168 var prefixes2 = ["webkit", "ms", "moz", "o"];
28170 var n3 = prefixes2.length;
28171 var s2 = document.body;
28172 if (property in s2)
28174 property = property.slice(0, 1).toUpperCase() + property.slice(1);
28175 while (++i3 < n3) {
28176 if (prefixes2[i3] + property in s2) {
28177 return prefixes2[i3] + property;
28182 function utilPrefixCSSProperty(property) {
28183 var prefixes2 = ["webkit", "ms", "Moz", "O"];
28185 var n3 = prefixes2.length;
28186 var s2 = document.body.style;
28187 if (property.toLowerCase() in s2) {
28188 return property.toLowerCase();
28190 while (++i3 < n3) {
28191 if (prefixes2[i3] + property in s2) {
28192 return "-" + prefixes2[i3].toLowerCase() + property.replace(/([A-Z])/g, "-$1").toLowerCase();
28197 var transformProperty;
28198 function utilSetTransform(el, x2, y2, scale) {
28199 var prop = transformProperty = transformProperty || utilPrefixCSSProperty("Transform");
28200 var translate = utilDetect().opera ? "translate(" + x2 + "px," + y2 + "px)" : "translate3d(" + x2 + "px," + y2 + "px,0)";
28201 return el.style(prop, translate + (scale ? " scale(" + scale + ")" : ""));
28203 function utilEditDistance(a2, b2) {
28204 a2 = (0, import_diacritics.remove)(a2.toLowerCase());
28205 b2 = (0, import_diacritics.remove)(b2.toLowerCase());
28206 if (a2.length === 0)
28208 if (b2.length === 0)
28212 for (i3 = 0; i3 <= b2.length; i3++) {
28215 for (j3 = 0; j3 <= a2.length; j3++) {
28216 matrix[0][j3] = j3;
28218 for (i3 = 1; i3 <= b2.length; i3++) {
28219 for (j3 = 1; j3 <= a2.length; j3++) {
28220 if (b2.charAt(i3 - 1) === a2.charAt(j3 - 1)) {
28221 matrix[i3][j3] = matrix[i3 - 1][j3 - 1];
28223 matrix[i3][j3] = Math.min(
28224 matrix[i3 - 1][j3 - 1] + 1,
28227 matrix[i3][j3 - 1] + 1,
28229 matrix[i3 - 1][j3] + 1
28235 return matrix[b2.length][a2.length];
28237 function utilFastMouse(container) {
28238 var rect = container.getBoundingClientRect();
28239 var rectLeft = rect.left;
28240 var rectTop = rect.top;
28241 var clientLeft = +container.clientLeft;
28242 var clientTop = +container.clientTop;
28243 return function(e3) {
28245 e3.clientX - rectLeft - clientLeft,
28246 e3.clientY - rectTop - clientTop
28250 function utilAsyncMap(inputs, func, callback) {
28251 var remaining = inputs.length;
28254 inputs.forEach(function(d2, i3) {
28255 func(d2, function done(err, data) {
28257 results[i3] = data;
28260 callback(errors, results);
28264 function utilWrap(index, length) {
28266 index += Math.ceil(-index / length) * length;
28268 return index % length;
28270 function utilFunctor(value) {
28271 if (typeof value === "function")
28273 return function() {
28277 function utilNoAuto(selection2) {
28278 var isText = selection2.size() && selection2.node().tagName.toLowerCase() === "textarea";
28279 return selection2.attr("autocomplete", "new-password").attr("autocorrect", "off").attr("autocapitalize", "off").attr("spellcheck", isText ? "true" : "false");
28281 function utilHashcode(str2) {
28283 if (str2.length === 0) {
28286 for (var i3 = 0; i3 < str2.length; i3++) {
28287 var char = str2.charCodeAt(i3);
28288 hash = (hash << 5) - hash + char;
28289 hash = hash & hash;
28293 function utilSafeClassName(str2) {
28294 return str2.toLowerCase().replace(/[^a-z0-9]+/g, "_");
28296 function utilUniqueDomId(val) {
28297 return "ideditor-" + utilSafeClassName(val.toString()) + "-" + (/* @__PURE__ */ new Date()).getTime().toString();
28299 function utilUnicodeCharsCount(str2) {
28300 return Array.from(str2).length;
28302 function utilUnicodeCharsTruncated(str2, limit) {
28303 return Array.from(str2).slice(0, limit).join("");
28305 function toNumericID(id2) {
28306 var match = id2.match(/^[cnwr](-?\d+)$/);
28308 return parseInt(match[1], 10);
28312 function compareNumericIDs(left, right) {
28313 if (isNaN(left) && isNaN(right))
28319 if (Math.sign(left) !== Math.sign(right))
28320 return -Math.sign(left);
28321 if (Math.sign(left) < 0)
28322 return Math.sign(right - left);
28323 return Math.sign(left - right);
28325 function utilCompareIDs(left, right) {
28326 return compareNumericIDs(toNumericID(left), toNumericID(right));
28328 function utilOldestID(ids) {
28329 if (ids.length === 0) {
28332 var oldestIDIndex = 0;
28333 var oldestID = toNumericID(ids[0]);
28334 for (var i3 = 1; i3 < ids.length; i3++) {
28335 var num = toNumericID(ids[i3]);
28336 if (compareNumericIDs(oldestID, num) === 1) {
28337 oldestIDIndex = i3;
28341 return ids[oldestIDIndex];
28343 function utilCleanOsmString(val, maxChars) {
28344 if (val === void 0 || val === null) {
28347 val = val.toString();
28351 val = val.normalize("NFC");
28352 return utilUnicodeCharsTruncated(val, maxChars);
28355 // modules/osm/entity.js
28356 function osmEntity(attrs) {
28357 if (this instanceof osmEntity)
28359 if (attrs && attrs.type) {
28360 return osmEntity[attrs.type].apply(this, arguments);
28361 } else if (attrs && attrs.id) {
28362 return osmEntity[osmEntity.id.type(attrs.id)].apply(this, arguments);
28364 return new osmEntity().initialize(arguments);
28366 osmEntity.id = function(type2) {
28367 return osmEntity.id.fromOSM(type2, osmEntity.id.next[type2]--);
28369 osmEntity.id.next = {
28375 osmEntity.id.fromOSM = function(type2, id2) {
28376 return type2[0] + id2;
28378 osmEntity.id.toOSM = function(id2) {
28379 var match = id2.match(/^[cnwr](-?\d+)$/);
28385 osmEntity.id.type = function(id2) {
28386 return { "c": "changeset", "n": "node", "w": "way", "r": "relation" }[id2[0]];
28388 osmEntity.key = function(entity) {
28389 return entity.id + "v" + (entity.v || 0);
28391 var _deprecatedTagValuesByKey;
28392 osmEntity.deprecatedTagValuesByKey = function(dataDeprecated) {
28393 if (!_deprecatedTagValuesByKey) {
28394 _deprecatedTagValuesByKey = {};
28395 dataDeprecated.forEach(function(d2) {
28396 var oldKeys = Object.keys(d2.old);
28397 if (oldKeys.length === 1) {
28398 var oldKey = oldKeys[0];
28399 var oldValue = d2.old[oldKey];
28400 if (oldValue !== "*") {
28401 if (!_deprecatedTagValuesByKey[oldKey]) {
28402 _deprecatedTagValuesByKey[oldKey] = [oldValue];
28404 _deprecatedTagValuesByKey[oldKey].push(oldValue);
28410 return _deprecatedTagValuesByKey;
28412 osmEntity.prototype = {
28414 initialize: function(sources) {
28415 for (var i3 = 0; i3 < sources.length; ++i3) {
28416 var source = sources[i3];
28417 for (var prop in source) {
28418 if (Object.prototype.hasOwnProperty.call(source, prop)) {
28419 if (source[prop] === void 0) {
28422 this[prop] = source[prop];
28427 if (!this.id && this.type) {
28428 this.id = osmEntity.id(this.type);
28430 if (!this.hasOwnProperty("visible")) {
28431 this.visible = true;
28434 Object.freeze(this);
28435 Object.freeze(this.tags);
28437 Object.freeze(this.loc);
28439 Object.freeze(this.nodes);
28441 Object.freeze(this.members);
28445 copy: function(resolver, copies) {
28446 if (copies[this.id])
28447 return copies[this.id];
28448 var copy2 = osmEntity(this, { id: void 0, user: void 0, version: void 0 });
28449 copies[this.id] = copy2;
28452 osmId: function() {
28453 return osmEntity.id.toOSM(this.id);
28455 isNew: function() {
28456 var osmId = osmEntity.id.toOSM(this.id);
28457 return osmId.length === 0 || osmId[0] === "-";
28459 update: function(attrs) {
28460 return osmEntity(this, attrs, { v: 1 + (this.v || 0) });
28462 mergeTags: function(tags) {
28463 var merged = Object.assign({}, this.tags);
28464 var changed = false;
28465 for (var k2 in tags) {
28466 var t1 = merged[k2];
28471 } else if (t1 !== t2) {
28473 merged[k2] = utilUnicodeCharsTruncated(
28474 utilArrayUnion(t1.split(/;\s*/), t2.split(/;\s*/)).join(";"),
28476 // avoid exceeding character limit; see also context.maxCharsForTagValue()
28480 return changed ? this.update({ tags: merged }) : this;
28482 intersects: function(extent, resolver) {
28483 return this.extent(resolver).intersects(extent);
28485 hasNonGeometryTags: function() {
28486 return Object.keys(this.tags).some(function(k2) {
28487 return k2 !== "area";
28490 hasParentRelations: function(resolver) {
28491 return resolver.parentRelations(this).length > 0;
28493 hasInterestingTags: function() {
28494 return Object.keys(this.tags).some(osmIsInterestingTag);
28496 isHighwayIntersection: function() {
28499 isDegenerate: function() {
28502 deprecatedTags: function(dataDeprecated) {
28503 var tags = this.tags;
28504 if (Object.keys(tags).length === 0)
28506 var deprecated = [];
28507 dataDeprecated.forEach(function(d2) {
28508 var oldKeys = Object.keys(d2.old);
28510 var hasExistingValues = Object.keys(d2.replace).some(function(replaceKey) {
28511 if (!tags[replaceKey] || d2.old[replaceKey])
28513 var replaceValue = d2.replace[replaceKey];
28514 if (replaceValue === "*")
28516 if (replaceValue === tags[replaceKey])
28520 if (hasExistingValues)
28523 var matchesDeprecatedTags = oldKeys.every(function(oldKey) {
28526 if (d2.old[oldKey] === "*")
28528 if (d2.old[oldKey] === tags[oldKey])
28530 var vals = tags[oldKey].split(";").filter(Boolean);
28531 if (vals.length === 0) {
28533 } else if (vals.length > 1) {
28534 return vals.indexOf(d2.old[oldKey]) !== -1;
28536 if (tags[oldKey] === d2.old[oldKey]) {
28537 if (d2.replace && d2.old[oldKey] === d2.replace[oldKey]) {
28538 var replaceKeys = Object.keys(d2.replace);
28539 return !replaceKeys.every(function(replaceKey) {
28540 return tags[replaceKey] === d2.replace[replaceKey];
28549 if (matchesDeprecatedTags) {
28550 deprecated.push(d2);
28557 // modules/osm/lanes.js
28558 function osmLanes(entity) {
28559 if (entity.type !== "way")
28561 if (!entity.tags.highway)
28563 var tags = entity.tags;
28564 var isOneWay = entity.isOneWay();
28565 var laneCount = getLaneCount(tags, isOneWay);
28566 var maxspeed = parseMaxspeed(tags);
28567 var laneDirections = parseLaneDirections(tags, isOneWay, laneCount);
28568 var forward = laneDirections.forward;
28569 var backward = laneDirections.backward;
28570 var bothways = laneDirections.bothways;
28571 var turnLanes = {};
28572 turnLanes.unspecified = parseTurnLanes(tags["turn:lanes"]);
28573 turnLanes.forward = parseTurnLanes(tags["turn:lanes:forward"]);
28574 turnLanes.backward = parseTurnLanes(tags["turn:lanes:backward"]);
28575 var maxspeedLanes = {};
28576 maxspeedLanes.unspecified = parseMaxspeedLanes(tags["maxspeed:lanes"], maxspeed);
28577 maxspeedLanes.forward = parseMaxspeedLanes(tags["maxspeed:lanes:forward"], maxspeed);
28578 maxspeedLanes.backward = parseMaxspeedLanes(tags["maxspeed:lanes:backward"], maxspeed);
28580 psvLanes.unspecified = parseMiscLanes(tags["psv:lanes"]);
28581 psvLanes.forward = parseMiscLanes(tags["psv:lanes:forward"]);
28582 psvLanes.backward = parseMiscLanes(tags["psv:lanes:backward"]);
28584 busLanes.unspecified = parseMiscLanes(tags["bus:lanes"]);
28585 busLanes.forward = parseMiscLanes(tags["bus:lanes:forward"]);
28586 busLanes.backward = parseMiscLanes(tags["bus:lanes:backward"]);
28587 var taxiLanes = {};
28588 taxiLanes.unspecified = parseMiscLanes(tags["taxi:lanes"]);
28589 taxiLanes.forward = parseMiscLanes(tags["taxi:lanes:forward"]);
28590 taxiLanes.backward = parseMiscLanes(tags["taxi:lanes:backward"]);
28592 hovLanes.unspecified = parseMiscLanes(tags["hov:lanes"]);
28593 hovLanes.forward = parseMiscLanes(tags["hov:lanes:forward"]);
28594 hovLanes.backward = parseMiscLanes(tags["hov:lanes:backward"]);
28596 hgvLanes.unspecified = parseMiscLanes(tags["hgv:lanes"]);
28597 hgvLanes.forward = parseMiscLanes(tags["hgv:lanes:forward"]);
28598 hgvLanes.backward = parseMiscLanes(tags["hgv:lanes:backward"]);
28599 var bicyclewayLanes = {};
28600 bicyclewayLanes.unspecified = parseBicycleWay(tags["bicycleway:lanes"]);
28601 bicyclewayLanes.forward = parseBicycleWay(tags["bicycleway:lanes:forward"]);
28602 bicyclewayLanes.backward = parseBicycleWay(tags["bicycleway:lanes:backward"]);
28608 mapToLanesObj(lanesObj, turnLanes, "turnLane");
28609 mapToLanesObj(lanesObj, maxspeedLanes, "maxspeed");
28610 mapToLanesObj(lanesObj, psvLanes, "psv");
28611 mapToLanesObj(lanesObj, busLanes, "bus");
28612 mapToLanesObj(lanesObj, taxiLanes, "taxi");
28613 mapToLanesObj(lanesObj, hovLanes, "hov");
28614 mapToLanesObj(lanesObj, hgvLanes, "hgv");
28615 mapToLanesObj(lanesObj, bicyclewayLanes, "bicycleway");
28636 function getLaneCount(tags, isOneWay) {
28639 count = parseInt(tags.lanes, 10);
28644 switch (tags.highway) {
28647 count = isOneWay ? 2 : 4;
28650 count = isOneWay ? 1 : 2;
28655 function parseMaxspeed(tags) {
28656 var maxspeed = tags.maxspeed;
28659 var maxspeedRegex = /^([0-9][\.0-9]+?)(?:[ ]?(?:km\/h|kmh|kph|mph|knots))?$/;
28660 if (!maxspeedRegex.test(maxspeed))
28662 return parseInt(maxspeed, 10);
28664 function parseLaneDirections(tags, isOneWay, laneCount) {
28665 var forward = parseInt(tags["lanes:forward"], 10);
28666 var backward = parseInt(tags["lanes:backward"], 10);
28667 var bothways = parseInt(tags["lanes:both_ways"], 10) > 0 ? 1 : 0;
28668 if (parseInt(tags.oneway, 10) === -1) {
28671 backward = laneCount;
28672 } else if (isOneWay) {
28673 forward = laneCount;
28676 } else if (isNaN(forward) && isNaN(backward)) {
28677 backward = Math.floor((laneCount - bothways) / 2);
28678 forward = laneCount - bothways - backward;
28679 } else if (isNaN(forward)) {
28680 if (backward > laneCount - bothways) {
28681 backward = laneCount - bothways;
28683 forward = laneCount - bothways - backward;
28684 } else if (isNaN(backward)) {
28685 if (forward > laneCount - bothways) {
28686 forward = laneCount - bothways;
28688 backward = laneCount - bothways - forward;
28696 function parseTurnLanes(tag) {
28699 var validValues = [
28712 return tag.split("|").map(function(s2) {
28715 return s2.split(";").map(function(d2) {
28716 return validValues.indexOf(d2) === -1 ? "unknown" : d2;
28720 function parseMaxspeedLanes(tag, maxspeed) {
28723 return tag.split("|").map(function(s2) {
28726 var m2 = parseInt(s2, 10);
28727 if (s2 === "" || m2 === maxspeed)
28729 return isNaN(m2) ? "unknown" : m2;
28732 function parseMiscLanes(tag) {
28735 var validValues = [
28740 return tag.split("|").map(function(s2) {
28743 return validValues.indexOf(s2) === -1 ? "unknown" : s2;
28746 function parseBicycleWay(tag) {
28749 var validValues = [
28755 return tag.split("|").map(function(s2) {
28758 return validValues.indexOf(s2) === -1 ? "unknown" : s2;
28761 function mapToLanesObj(lanesObj, data, key) {
28762 if (data.forward) {
28763 data.forward.forEach(function(l2, i3) {
28764 if (!lanesObj.forward[i3])
28765 lanesObj.forward[i3] = {};
28766 lanesObj.forward[i3][key] = l2;
28769 if (data.backward) {
28770 data.backward.forEach(function(l2, i3) {
28771 if (!lanesObj.backward[i3])
28772 lanesObj.backward[i3] = {};
28773 lanesObj.backward[i3][key] = l2;
28776 if (data.unspecified) {
28777 data.unspecified.forEach(function(l2, i3) {
28778 if (!lanesObj.unspecified[i3])
28779 lanesObj.unspecified[i3] = {};
28780 lanesObj.unspecified[i3][key] = l2;
28785 // modules/osm/way.js
28786 function osmWay() {
28787 if (!(this instanceof osmWay)) {
28788 return new osmWay().initialize(arguments);
28789 } else if (arguments.length) {
28790 this.initialize(arguments);
28793 osmEntity.way = osmWay;
28794 osmWay.prototype = Object.create(osmEntity.prototype);
28795 Object.assign(osmWay.prototype, {
28798 copy: function(resolver, copies) {
28799 if (copies[this.id])
28800 return copies[this.id];
28801 var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
28802 var nodes = this.nodes.map(function(id2) {
28803 return resolver.entity(id2).copy(resolver, copies).id;
28805 copy2 = copy2.update({ nodes });
28806 copies[this.id] = copy2;
28809 extent: function(resolver) {
28810 return resolver.transient(this, "extent", function() {
28811 var extent = geoExtent();
28812 for (var i3 = 0; i3 < this.nodes.length; i3++) {
28813 var node = resolver.hasEntity(this.nodes[i3]);
28815 extent._extend(node.extent());
28821 first: function() {
28822 return this.nodes[0];
28825 return this.nodes[this.nodes.length - 1];
28827 contains: function(node) {
28828 return this.nodes.indexOf(node) >= 0;
28830 affix: function(node) {
28831 if (this.nodes[0] === node)
28833 if (this.nodes[this.nodes.length - 1] === node)
28836 layer: function() {
28837 if (isFinite(this.tags.layer)) {
28838 return Math.max(-10, Math.min(+this.tags.layer, 10));
28840 if (this.tags.covered === "yes")
28842 if (this.tags.location === "overground")
28844 if (this.tags.location === "underground")
28846 if (this.tags.location === "underwater")
28848 if (this.tags.power === "line")
28850 if (this.tags.power === "minor_line")
28852 if (this.tags.aerialway)
28854 if (this.tags.bridge)
28856 if (this.tags.cutting)
28858 if (this.tags.tunnel)
28860 if (this.tags.waterway)
28862 if (this.tags.man_made === "pipeline")
28864 if (this.tags.boundary)
28868 // the approximate width of the line based on its tags except its `width` tag
28869 impliedLineWidthMeters: function() {
28870 var averageWidths = {
28872 // width is for single lane
28899 // width includes ties and rail bed, not just track gauge
28921 for (var key in averageWidths) {
28922 if (this.tags[key] && averageWidths[key][this.tags[key]]) {
28923 var width = averageWidths[key][this.tags[key]];
28924 if (key === "highway") {
28925 var laneCount = this.tags.lanes && parseInt(this.tags.lanes, 10);
28927 laneCount = this.isOneWay() ? 1 : 2;
28928 return width * laneCount;
28935 isOneWay: function() {
28940 "reversible": true,
28941 "alternating": true,
28945 if (values[this.tags.oneway] !== void 0) {
28946 return values[this.tags.oneway];
28948 for (var key in this.tags) {
28949 if (key in osmOneWayTags && this.tags[key] in osmOneWayTags[key]) {
28955 // Some identifier for tag that implies that this way is "sided",
28956 // i.e. the right side is the 'inside' (e.g. the right side of a
28957 // natural=cliff is lower).
28958 sidednessIdentifier: function() {
28959 for (const realKey in this.tags) {
28960 const value = this.tags[realKey];
28961 const key = osmRemoveLifecyclePrefix(realKey);
28962 if (key in osmRightSideIsInsideTags && value in osmRightSideIsInsideTags[key]) {
28963 if (osmRightSideIsInsideTags[key][value] === true) {
28966 return osmRightSideIsInsideTags[key][value];
28972 isSided: function() {
28973 if (this.tags.two_sided === "yes") {
28976 return this.sidednessIdentifier() !== null;
28978 lanes: function() {
28979 return osmLanes(this);
28981 isClosed: function() {
28982 return this.nodes.length > 1 && this.first() === this.last();
28984 isConvex: function(resolver) {
28985 if (!this.isClosed() || this.isDegenerate())
28987 var nodes = utilArrayUniq(resolver.childNodes(this));
28988 var coords = nodes.map(function(n3) {
28993 for (var i3 = 0; i3 < coords.length; i3++) {
28994 var o2 = coords[(i3 + 1) % coords.length];
28995 var a2 = coords[i3];
28996 var b2 = coords[(i3 + 2) % coords.length];
28997 var res = geoVecCross(a2, b2, o2);
28998 curr = res > 0 ? 1 : res < 0 ? -1 : 0;
29001 } else if (prev && curr !== prev) {
29008 // returns an object with the tag that implies this is an area, if any
29009 tagSuggestingArea: function() {
29010 return osmTagSuggestingArea(this.tags);
29012 isArea: function() {
29013 if (this.tags.area === "yes")
29015 if (!this.isClosed() || this.tags.area === "no")
29017 return this.tagSuggestingArea() !== null;
29019 isDegenerate: function() {
29020 return new Set(this.nodes).size < (this.isArea() ? 3 : 2);
29022 areAdjacent: function(n1, n22) {
29023 for (var i3 = 0; i3 < this.nodes.length; i3++) {
29024 if (this.nodes[i3] === n1) {
29025 if (this.nodes[i3 - 1] === n22)
29027 if (this.nodes[i3 + 1] === n22)
29033 geometry: function(graph) {
29034 return graph.transient(this, "geometry", function() {
29035 return this.isArea() ? "area" : "line";
29038 // returns an array of objects representing the segments between the nodes in this way
29039 segments: function(graph) {
29040 function segmentExtent(graph2) {
29041 var n1 = graph2.hasEntity(this.nodes[0]);
29042 var n22 = graph2.hasEntity(this.nodes[1]);
29043 return n1 && n22 && geoExtent([
29045 Math.min(n1.loc[0], n22.loc[0]),
29046 Math.min(n1.loc[1], n22.loc[1])
29049 Math.max(n1.loc[0], n22.loc[0]),
29050 Math.max(n1.loc[1], n22.loc[1])
29054 return graph.transient(this, "segments", function() {
29056 for (var i3 = 0; i3 < this.nodes.length - 1; i3++) {
29058 id: this.id + "-" + i3,
29061 nodes: [this.nodes[i3], this.nodes[i3 + 1]],
29062 extent: segmentExtent
29068 // If this way is not closed, append the beginning node to the end of the nodelist to close it.
29069 close: function() {
29070 if (this.isClosed() || !this.nodes.length)
29072 var nodes = this.nodes.slice();
29073 nodes = nodes.filter(noRepeatNodes);
29074 nodes.push(nodes[0]);
29075 return this.update({ nodes });
29077 // If this way is closed, remove any connector nodes from the end of the nodelist to unclose it.
29078 unclose: function() {
29079 if (!this.isClosed())
29081 var nodes = this.nodes.slice();
29082 var connector = this.first();
29083 var i3 = nodes.length - 1;
29084 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
29085 nodes.splice(i3, 1);
29086 i3 = nodes.length - 1;
29088 nodes = nodes.filter(noRepeatNodes);
29089 return this.update({ nodes });
29091 // Adds a node (id) in front of the node which is currently at position index.
29092 // If index is undefined, the node will be added to the end of the way for linear ways,
29093 // or just before the final connecting node for circular ways.
29094 // Consecutive duplicates are eliminated including existing ones.
29095 // Circularity is always preserved when adding a node.
29096 addNode: function(id2, index) {
29097 var nodes = this.nodes.slice();
29098 var isClosed = this.isClosed();
29099 var max3 = isClosed ? nodes.length - 1 : nodes.length;
29100 if (index === void 0) {
29103 if (index < 0 || index > max3) {
29104 throw new RangeError("index " + index + " out of range 0.." + max3);
29107 var connector = this.first();
29109 while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
29110 nodes.splice(i3, 1);
29114 i3 = nodes.length - 1;
29115 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
29116 nodes.splice(i3, 1);
29119 i3 = nodes.length - 1;
29122 nodes.splice(index, 0, id2);
29123 nodes = nodes.filter(noRepeatNodes);
29124 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29125 nodes.push(nodes[0]);
29127 return this.update({ nodes });
29129 // Replaces the node which is currently at position index with the given node (id).
29130 // Consecutive duplicates are eliminated including existing ones.
29131 // Circularity is preserved when updating a node.
29132 updateNode: function(id2, index) {
29133 var nodes = this.nodes.slice();
29134 var isClosed = this.isClosed();
29135 var max3 = nodes.length - 1;
29136 if (index === void 0 || index < 0 || index > max3) {
29137 throw new RangeError("index " + index + " out of range 0.." + max3);
29140 var connector = this.first();
29142 while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
29143 nodes.splice(i3, 1);
29147 i3 = nodes.length - 1;
29148 while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
29149 nodes.splice(i3, 1);
29152 i3 = nodes.length - 1;
29155 nodes.splice(index, 1, id2);
29156 nodes = nodes.filter(noRepeatNodes);
29157 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29158 nodes.push(nodes[0]);
29160 return this.update({ nodes });
29162 // Replaces each occurrence of node id needle with replacement.
29163 // Consecutive duplicates are eliminated including existing ones.
29164 // Circularity is preserved.
29165 replaceNode: function(needleID, replacementID) {
29166 var nodes = this.nodes.slice();
29167 var isClosed = this.isClosed();
29168 for (var i3 = 0; i3 < nodes.length; i3++) {
29169 if (nodes[i3] === needleID) {
29170 nodes[i3] = replacementID;
29173 nodes = nodes.filter(noRepeatNodes);
29174 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29175 nodes.push(nodes[0]);
29177 return this.update({ nodes });
29179 // Removes each occurrence of node id.
29180 // Consecutive duplicates are eliminated including existing ones.
29181 // Circularity is preserved.
29182 removeNode: function(id2) {
29183 var nodes = this.nodes.slice();
29184 var isClosed = this.isClosed();
29185 nodes = nodes.filter(function(node) {
29186 return node !== id2;
29187 }).filter(noRepeatNodes);
29188 if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
29189 nodes.push(nodes[0]);
29191 return this.update({ nodes });
29193 asJXON: function(changeset_id) {
29196 "@id": this.osmId(),
29197 "@version": this.version || 0,
29198 nd: this.nodes.map(function(id2) {
29199 return { keyAttributes: { ref: osmEntity.id.toOSM(id2) } };
29201 tag: Object.keys(this.tags).map(function(k2) {
29202 return { keyAttributes: { k: k2, v: this.tags[k2] } };
29206 if (changeset_id) {
29207 r2.way["@changeset"] = changeset_id;
29211 asGeoJSON: function(resolver) {
29212 return resolver.transient(this, "GeoJSON", function() {
29213 var coordinates = resolver.childNodes(this).map(function(n3) {
29216 if (this.isArea() && this.isClosed()) {
29219 coordinates: [coordinates]
29223 type: "LineString",
29229 area: function(resolver) {
29230 return resolver.transient(this, "area", function() {
29231 var nodes = resolver.childNodes(this);
29234 coordinates: [nodes.map(function(n3) {
29238 if (!this.isClosed() && nodes.length) {
29239 json.coordinates[0].push(nodes[0].loc);
29241 var area = area_default(json);
29242 if (area > 2 * Math.PI) {
29243 json.coordinates[0] = json.coordinates[0].reverse();
29244 area = area_default(json);
29246 return isNaN(area) ? 0 : area;
29250 function noRepeatNodes(node, i3, arr) {
29251 return i3 === 0 || node !== arr[i3 - 1];
29254 // modules/osm/multipolygon.js
29255 function osmOldMultipolygonOuterMemberOfRelation(entity, graph) {
29256 if (entity.type !== "relation" || !entity.isMultipolygon() || Object.keys(entity.tags).filter(osmIsInterestingTag).length > 1) {
29260 for (var memberIndex in entity.members) {
29261 var member = entity.members[memberIndex];
29262 if (!member.role || member.role === "outer") {
29265 if (member.type !== "way")
29267 if (!graph.hasEntity(member.id))
29269 outerMember = graph.entity(member.id);
29270 if (Object.keys(outerMember.tags).filter(osmIsInterestingTag).length === 0) {
29275 return outerMember;
29277 function osmIsOldMultipolygonOuterMember(entity, graph) {
29278 if (entity.type !== "way" || Object.keys(entity.tags).filter(osmIsInterestingTag).length === 0) {
29281 var parents = graph.parentRelations(entity);
29282 if (parents.length !== 1)
29284 var parent = parents[0];
29285 if (!parent.isMultipolygon() || Object.keys(parent.tags).filter(osmIsInterestingTag).length > 1) {
29288 var members = parent.members, member;
29289 for (var i3 = 0; i3 < members.length; i3++) {
29290 member = members[i3];
29291 if (member.id === entity.id && member.role && member.role !== "outer") {
29294 if (member.id !== entity.id && (!member.role || member.role === "outer")) {
29300 function osmOldMultipolygonOuterMember(entity, graph) {
29301 if (entity.type !== "way")
29303 var parents = graph.parentRelations(entity);
29304 if (parents.length !== 1)
29306 var parent = parents[0];
29307 if (!parent.isMultipolygon() || Object.keys(parent.tags).filter(osmIsInterestingTag).length > 1) {
29310 var members = parent.members, member, outerMember;
29311 for (var i3 = 0; i3 < members.length; i3++) {
29312 member = members[i3];
29313 if (!member.role || member.role === "outer") {
29316 outerMember = member;
29321 var outerEntity = graph.hasEntity(outerMember.id);
29322 if (!outerEntity || !Object.keys(outerEntity.tags).filter(osmIsInterestingTag).length) {
29325 return outerEntity;
29327 function osmJoinWays(toJoin, graph) {
29328 function resolve(member) {
29329 return graph.childNodes(graph.entity(member.id));
29331 function reverse(item2) {
29332 var action = actionReverse(item2.id, { reverseOneway: true });
29333 sequences.actions.push(action);
29334 return item2 instanceof osmWay ? action(graph).entity(item2.id) : item2;
29336 toJoin = toJoin.filter(function(member) {
29337 return member.type === "way" && graph.hasEntity(member.id);
29340 var joinAsMembers = true;
29341 for (i3 = 0; i3 < toJoin.length; i3++) {
29342 if (toJoin[i3] instanceof osmWay) {
29343 joinAsMembers = false;
29347 var sequences = [];
29348 sequences.actions = [];
29349 while (toJoin.length) {
29350 var item = toJoin.shift();
29351 var currWays = [item];
29352 var currNodes = resolve(item).slice();
29353 while (toJoin.length) {
29354 var start2 = currNodes[0];
29355 var end = currNodes[currNodes.length - 1];
29358 for (i3 = 0; i3 < toJoin.length; i3++) {
29360 nodes = resolve(item);
29361 if (joinAsMembers && currWays.length === 1 && nodes[0] !== end && nodes[nodes.length - 1] !== end && (nodes[nodes.length - 1] === start2 || nodes[0] === start2)) {
29362 currWays[0] = reverse(currWays[0]);
29363 currNodes.reverse();
29364 start2 = currNodes[0];
29365 end = currNodes[currNodes.length - 1];
29367 if (nodes[0] === end) {
29368 fn = currNodes.push;
29369 nodes = nodes.slice(1);
29371 } else if (nodes[nodes.length - 1] === end) {
29372 fn = currNodes.push;
29373 nodes = nodes.slice(0, -1).reverse();
29374 item = reverse(item);
29376 } else if (nodes[nodes.length - 1] === start2) {
29377 fn = currNodes.unshift;
29378 nodes = nodes.slice(0, -1);
29380 } else if (nodes[0] === start2) {
29381 fn = currNodes.unshift;
29382 nodes = nodes.slice(1).reverse();
29383 item = reverse(item);
29392 fn.apply(currWays, [item]);
29393 fn.apply(currNodes, nodes);
29394 toJoin.splice(i3, 1);
29396 currWays.nodes = currNodes;
29397 sequences.push(currWays);
29402 // modules/actions/add_member.js
29403 function actionAddMember(relationId, member, memberIndex, insertPair) {
29404 return function action(graph) {
29405 var relation = graph.entity(relationId);
29406 var isPTv2 = /stop|platform/.test(member.role);
29407 if ((isNaN(memberIndex) || insertPair) && member.type === "way" && !isPTv2) {
29408 graph = addWayMember(relation, graph);
29410 if (isPTv2 && isNaN(memberIndex)) {
29413 graph = graph.replace(relation.addMember(member, memberIndex));
29417 function addWayMember(relation, graph) {
29418 var groups, tempWay, insertPairIsReversed, item, i3, j3, k2;
29419 var PTv2members = [];
29421 for (i3 = 0; i3 < relation.members.length; i3++) {
29422 var m2 = relation.members[i3];
29423 if (/stop|platform/.test(m2.role)) {
29424 PTv2members.push(m2);
29429 relation = relation.update({ members });
29431 tempWay = osmWay({ id: "wTemp", nodes: insertPair.nodes });
29432 graph = graph.replace(tempWay);
29433 var tempMember = { id: tempWay.id, type: "way", role: member.role };
29434 var tempRelation = relation.replaceMember({ id: insertPair.originalID }, tempMember, true);
29435 groups = utilArrayGroupBy(tempRelation.members, "type");
29436 groups.way = groups.way || [];
29437 var originalWay = graph.entity(insertPair.originalID);
29438 var insertedWay = graph.entity(insertPair.insertedID);
29439 insertPairIsReversed = originalWay.nodes.length > 0 && insertedWay.nodes.length > 0 && insertedWay.nodes[insertedWay.nodes.length - 1] === originalWay.nodes[0] && originalWay.nodes[originalWay.nodes.length - 1] !== insertedWay.nodes[0];
29441 groups = utilArrayGroupBy(relation.members, "type");
29442 groups.way = groups.way || [];
29443 groups.way.push(member);
29445 members = withIndex(groups.way);
29446 var joined = osmJoinWays(members, graph);
29447 for (i3 = 0; i3 < joined.length; i3++) {
29448 var segment = joined[i3];
29449 var nodes = segment.nodes.slice();
29450 var startIndex = segment[0].index;
29451 for (j3 = 0; j3 < members.length; j3++) {
29452 if (members[j3].index === startIndex) {
29456 for (k2 = 0; k2 < segment.length; k2++) {
29457 item = segment[k2];
29458 var way = graph.entity(item.id);
29459 if (tempWay && item.id === tempWay.id) {
29460 var reverse = nodes[0].id !== insertPair.nodes[0] ^ insertPairIsReversed;
29463 { id: insertPair.insertedID, type: "way", role: item.role },
29464 { id: insertPair.originalID, type: "way", role: item.role }
29468 { id: insertPair.originalID, type: "way", role: item.role },
29469 { id: insertPair.insertedID, type: "way", role: item.role }
29474 if (j3 + k2 >= members.length || item.index !== members[j3 + k2].index) {
29475 moveMember(members, item.index, j3 + k2);
29478 nodes.splice(0, way.nodes.length - 1);
29482 graph = graph.remove(tempWay);
29484 var wayMembers = [];
29485 for (i3 = 0; i3 < members.length; i3++) {
29486 item = members[i3];
29487 if (item.index === -1)
29490 wayMembers.push(item.pair[0]);
29491 wayMembers.push(item.pair[1]);
29493 wayMembers.push(utilObjectOmit(item, ["index"]));
29496 var newMembers = PTv2members.concat(groups.node || [], wayMembers, groups.relation || []);
29497 return graph.replace(relation.update({ members: newMembers }));
29498 function moveMember(arr, findIndex, toIndex) {
29500 for (i4 = 0; i4 < arr.length; i4++) {
29501 if (arr[i4].index === findIndex) {
29505 var item2 = Object.assign({}, arr[i4]);
29506 arr[i4].index = -1;
29507 item2.index = toIndex;
29508 arr.splice(toIndex, 0, item2);
29510 function withIndex(arr) {
29511 var result = new Array(arr.length);
29512 for (var i4 = 0; i4 < arr.length; i4++) {
29513 result[i4] = Object.assign({}, arr[i4]);
29514 result[i4].index = i4;
29521 // modules/actions/add_midpoint.js
29522 function actionAddMidpoint(midpoint, node) {
29523 return function(graph) {
29524 graph = graph.replace(node.move(midpoint.loc));
29525 var parents = utilArrayIntersection(
29526 graph.parentWays(graph.entity(midpoint.edge[0])),
29527 graph.parentWays(graph.entity(midpoint.edge[1]))
29529 parents.forEach(function(way) {
29530 for (var i3 = 0; i3 < way.nodes.length - 1; i3++) {
29531 if (geoEdgeEqual([way.nodes[i3], way.nodes[i3 + 1]], midpoint.edge)) {
29532 graph = graph.replace(graph.entity(way.id).addNode(node.id, i3 + 1));
29541 // modules/actions/add_vertex.js
29542 function actionAddVertex(wayId, nodeId, index) {
29543 return function(graph) {
29544 return graph.replace(graph.entity(wayId).addNode(nodeId, index));
29548 // modules/actions/change_member.js
29549 function actionChangeMember(relationId, member, memberIndex) {
29550 return function(graph) {
29551 return graph.replace(graph.entity(relationId).updateMember(member, memberIndex));
29555 // modules/actions/change_preset.js
29556 function actionChangePreset(entityID, oldPreset, newPreset, skipFieldDefaults) {
29557 return function action(graph) {
29558 var entity = graph.entity(entityID);
29559 var geometry = entity.geometry(graph);
29560 var tags = entity.tags;
29561 const loc = entity.extent(graph).center();
29565 if (newPreset.addTags) {
29566 preserveKeys = preserveKeys.concat(Object.keys(newPreset.addTags));
29568 if (oldPreset && !oldPreset.id.startsWith(newPreset.id)) {
29569 newPreset.fields(loc).concat(newPreset.moreFields(loc)).filter((f3) => f3.matchGeometry(geometry)).map((f3) => f3.key).filter(Boolean).forEach((key) => preserveKeys.push(key));
29573 tags = oldPreset.unsetTags(tags, geometry, preserveKeys, false, loc);
29575 tags = newPreset.setTags(tags, geometry, skipFieldDefaults, loc);
29576 return graph.replace(entity.update({ tags }));
29580 // modules/actions/change_tags.js
29581 function actionChangeTags(entityId, tags) {
29582 return function(graph) {
29583 var entity = graph.entity(entityId);
29584 return graph.replace(entity.update({ tags }));
29588 // modules/osm/node.js
29592 northnortheast: 22,
29600 eastsoutheast: 112,
29604 southsoutheast: 157,
29608 southsouthwest: 202,
29612 westsouthwest: 247,
29616 westnorthwest: 292,
29620 northnorthwest: 337,
29623 function osmNode() {
29624 if (!(this instanceof osmNode)) {
29625 return new osmNode().initialize(arguments);
29626 } else if (arguments.length) {
29627 this.initialize(arguments);
29630 osmEntity.node = osmNode;
29631 osmNode.prototype = Object.create(osmEntity.prototype);
29632 Object.assign(osmNode.prototype, {
29635 extent: function() {
29636 return new geoExtent(this.loc);
29638 geometry: function(graph) {
29639 return graph.transient(this, "geometry", function() {
29640 return graph.isPoi(this) ? "point" : "vertex";
29643 move: function(loc) {
29644 return this.update({ loc });
29646 isDegenerate: function() {
29647 return !(Array.isArray(this.loc) && this.loc.length === 2 && this.loc[0] >= -180 && this.loc[0] <= 180 && this.loc[1] >= -90 && this.loc[1] <= 90);
29649 // Inspect tags and geometry to determine which direction(s) this node/vertex points
29650 directions: function(resolver, projection2) {
29653 if (this.isHighwayIntersection(resolver) && (this.tags.stop || "").toLowerCase() === "all") {
29656 val = (this.tags.direction || "").toLowerCase();
29657 var re3 = /:direction$/i;
29658 var keys2 = Object.keys(this.tags);
29659 for (i3 = 0; i3 < keys2.length; i3++) {
29660 if (re3.test(keys2[i3])) {
29661 val = this.tags[keys2[i3]].toLowerCase();
29668 var values = val.split(";");
29670 values.forEach(function(v2) {
29671 if (cardinal[v2] !== void 0) {
29674 if (v2 !== "" && !isNaN(+v2)) {
29678 var lookBackward = this.tags["traffic_sign:backward"] || v2 === "backward" || v2 === "both" || v2 === "all";
29679 var lookForward = this.tags["traffic_sign:forward"] || v2 === "forward" || v2 === "both" || v2 === "all";
29680 if (!lookForward && !lookBackward)
29683 resolver.parentWays(this).forEach(function(parent) {
29684 var nodes = parent.nodes;
29685 for (i3 = 0; i3 < nodes.length; i3++) {
29686 if (nodes[i3] === this.id) {
29687 if (lookForward && i3 > 0) {
29688 nodeIds[nodes[i3 - 1]] = true;
29690 if (lookBackward && i3 < nodes.length - 1) {
29691 nodeIds[nodes[i3 + 1]] = true;
29696 Object.keys(nodeIds).forEach(function(nodeId) {
29698 geoAngle(this, resolver.entity(nodeId), projection2) * (180 / Math.PI) + 90
29702 return utilArrayUniq(results);
29704 isCrossing: function() {
29705 return this.tags.highway === "crossing" || this.tags.railway && this.tags.railway.indexOf("crossing") !== -1;
29707 isEndpoint: function(resolver) {
29708 return resolver.transient(this, "isEndpoint", function() {
29710 return resolver.parentWays(this).filter(function(parent) {
29711 return !parent.isClosed() && !!parent.affix(id2);
29715 isConnected: function(resolver) {
29716 return resolver.transient(this, "isConnected", function() {
29717 var parents = resolver.parentWays(this);
29718 if (parents.length > 1) {
29719 for (var i3 in parents) {
29720 if (parents[i3].geometry(resolver) === "line" && parents[i3].hasInterestingTags())
29723 } else if (parents.length === 1) {
29724 var way = parents[0];
29725 var nodes = way.nodes.slice();
29726 if (way.isClosed()) {
29729 return nodes.indexOf(this.id) !== nodes.lastIndexOf(this.id);
29734 parentIntersectionWays: function(resolver) {
29735 return resolver.transient(this, "parentIntersectionWays", function() {
29736 return resolver.parentWays(this).filter(function(parent) {
29737 return (parent.tags.highway || parent.tags.waterway || parent.tags.railway || parent.tags.aeroway) && parent.geometry(resolver) === "line";
29741 isIntersection: function(resolver) {
29742 return this.parentIntersectionWays(resolver).length > 1;
29744 isHighwayIntersection: function(resolver) {
29745 return resolver.transient(this, "isHighwayIntersection", function() {
29746 return resolver.parentWays(this).filter(function(parent) {
29747 return parent.tags.highway && parent.geometry(resolver) === "line";
29751 isOnAddressLine: function(resolver) {
29752 return resolver.transient(this, "isOnAddressLine", function() {
29753 return resolver.parentWays(this).filter(function(parent) {
29754 return parent.tags.hasOwnProperty("addr:interpolation") && parent.geometry(resolver) === "line";
29758 asJXON: function(changeset_id) {
29761 "@id": this.osmId(),
29762 "@lon": this.loc[0],
29763 "@lat": this.loc[1],
29764 "@version": this.version || 0,
29765 tag: Object.keys(this.tags).map(function(k2) {
29766 return { keyAttributes: { k: k2, v: this.tags[k2] } };
29771 r2.node["@changeset"] = changeset_id;
29774 asGeoJSON: function() {
29777 coordinates: this.loc
29782 // modules/actions/circularize.js
29783 function actionCircularize(wayId, projection2, maxAngle) {
29784 maxAngle = (maxAngle || 20) * Math.PI / 180;
29785 var action = function(graph, t2) {
29786 if (t2 === null || !isFinite(t2))
29788 t2 = Math.min(Math.max(+t2, 0), 1);
29789 var way = graph.entity(wayId);
29790 var origNodes = {};
29791 graph.childNodes(way).forEach(function(node2) {
29792 if (!origNodes[node2.id])
29793 origNodes[node2.id] = node2;
29795 if (!way.isConvex(graph)) {
29796 graph = action.makeConvex(graph);
29798 var nodes = utilArrayUniq(graph.childNodes(way));
29799 var keyNodes = nodes.filter(function(n3) {
29800 return graph.parentWays(n3).length !== 1;
29802 var points = nodes.map(function(n3) {
29803 return projection2(n3.loc);
29805 var keyPoints = keyNodes.map(function(n3) {
29806 return projection2(n3.loc);
29808 var centroid = points.length === 2 ? geoVecInterp(points[0], points[1], 0.5) : centroid_default2(points);
29809 var radius = median(points, function(p2) {
29810 return geoVecLength(centroid, p2);
29812 var sign2 = area_default3(points) > 0 ? 1 : -1;
29813 var ids, i3, j3, k2;
29814 if (!keyNodes.length) {
29815 keyNodes = [nodes[0]];
29816 keyPoints = [points[0]];
29818 if (keyNodes.length === 1) {
29819 var index = nodes.indexOf(keyNodes[0]);
29820 var oppositeIndex = Math.floor((index + nodes.length / 2) % nodes.length);
29821 keyNodes.push(nodes[oppositeIndex]);
29822 keyPoints.push(points[oppositeIndex]);
29824 for (i3 = 0; i3 < keyPoints.length; i3++) {
29825 var nextKeyNodeIndex = (i3 + 1) % keyNodes.length;
29826 var startNode = keyNodes[i3];
29827 var endNode = keyNodes[nextKeyNodeIndex];
29828 var startNodeIndex = nodes.indexOf(startNode);
29829 var endNodeIndex = nodes.indexOf(endNode);
29830 var numberNewPoints = -1;
29831 var indexRange = endNodeIndex - startNodeIndex;
29832 var nearNodes = {};
29833 var inBetweenNodes = [];
29834 var startAngle, endAngle, totalAngle, eachAngle;
29835 var angle2, loc, node, origNode;
29836 if (indexRange < 0) {
29837 indexRange += nodes.length;
29839 var distance = geoVecLength(centroid, keyPoints[i3]) || 1e-4;
29841 centroid[0] + (keyPoints[i3][0] - centroid[0]) / distance * radius,
29842 centroid[1] + (keyPoints[i3][1] - centroid[1]) / distance * radius
29844 loc = projection2.invert(keyPoints[i3]);
29845 node = keyNodes[i3];
29846 origNode = origNodes[node.id];
29847 node = node.move(geoVecInterp(origNode.loc, loc, t2));
29848 graph = graph.replace(node);
29849 startAngle = Math.atan2(keyPoints[i3][1] - centroid[1], keyPoints[i3][0] - centroid[0]);
29850 endAngle = Math.atan2(keyPoints[nextKeyNodeIndex][1] - centroid[1], keyPoints[nextKeyNodeIndex][0] - centroid[0]);
29851 totalAngle = endAngle - startAngle;
29852 if (totalAngle * sign2 > 0) {
29853 totalAngle = -sign2 * (2 * Math.PI - Math.abs(totalAngle));
29857 eachAngle = totalAngle / (indexRange + numberNewPoints);
29858 } while (Math.abs(eachAngle) > maxAngle);
29859 for (j3 = 1; j3 < indexRange; j3++) {
29860 angle2 = startAngle + j3 * eachAngle;
29861 loc = projection2.invert([
29862 centroid[0] + Math.cos(angle2) * radius,
29863 centroid[1] + Math.sin(angle2) * radius
29865 node = nodes[(j3 + startNodeIndex) % nodes.length];
29866 origNode = origNodes[node.id];
29867 nearNodes[node.id] = angle2;
29868 node = node.move(geoVecInterp(origNode.loc, loc, t2));
29869 graph = graph.replace(node);
29871 for (j3 = 0; j3 < numberNewPoints; j3++) {
29872 angle2 = startAngle + (indexRange + j3) * eachAngle;
29873 loc = projection2.invert([
29874 centroid[0] + Math.cos(angle2) * radius,
29875 centroid[1] + Math.sin(angle2) * radius
29877 var min3 = Infinity;
29878 for (var nodeId in nearNodes) {
29879 var nearAngle = nearNodes[nodeId];
29880 var dist = Math.abs(nearAngle - angle2);
29883 origNode = origNodes[nodeId];
29886 node = osmNode({ loc: geoVecInterp(origNode.loc, loc, t2) });
29887 graph = graph.replace(node);
29888 nodes.splice(endNodeIndex + j3, 0, node);
29889 inBetweenNodes.push(node.id);
29891 if (indexRange === 1 && inBetweenNodes.length) {
29892 var startIndex1 = way.nodes.lastIndexOf(startNode.id);
29893 var endIndex1 = way.nodes.lastIndexOf(endNode.id);
29894 var wayDirection1 = endIndex1 - startIndex1;
29895 if (wayDirection1 < -1) {
29898 var parentWays = graph.parentWays(keyNodes[i3]);
29899 for (j3 = 0; j3 < parentWays.length; j3++) {
29900 var sharedWay = parentWays[j3];
29901 if (sharedWay === way)
29903 if (sharedWay.areAdjacent(startNode.id, endNode.id)) {
29904 var startIndex2 = sharedWay.nodes.lastIndexOf(startNode.id);
29905 var endIndex2 = sharedWay.nodes.lastIndexOf(endNode.id);
29906 var wayDirection2 = endIndex2 - startIndex2;
29907 var insertAt = endIndex2;
29908 if (wayDirection2 < -1) {
29911 if (wayDirection1 !== wayDirection2) {
29912 inBetweenNodes.reverse();
29913 insertAt = startIndex2;
29915 for (k2 = 0; k2 < inBetweenNodes.length; k2++) {
29916 sharedWay = sharedWay.addNode(inBetweenNodes[k2], insertAt + k2);
29918 graph = graph.replace(sharedWay);
29923 ids = nodes.map(function(n3) {
29927 way = way.update({ nodes: ids });
29928 graph = graph.replace(way);
29931 action.makeConvex = function(graph) {
29932 var way = graph.entity(wayId);
29933 var nodes = utilArrayUniq(graph.childNodes(way));
29934 var points = nodes.map(function(n3) {
29935 return projection2(n3.loc);
29937 var sign2 = area_default3(points) > 0 ? 1 : -1;
29938 var hull = hull_default(points);
29940 if (sign2 === -1) {
29944 for (i3 = 0; i3 < hull.length - 1; i3++) {
29945 var startIndex = points.indexOf(hull[i3]);
29946 var endIndex = points.indexOf(hull[i3 + 1]);
29947 var indexRange = endIndex - startIndex;
29948 if (indexRange < 0) {
29949 indexRange += nodes.length;
29951 for (j3 = 1; j3 < indexRange; j3++) {
29952 var point2 = geoVecInterp(hull[i3], hull[i3 + 1], j3 / indexRange);
29953 var node = nodes[(j3 + startIndex) % nodes.length].move(projection2.invert(point2));
29954 graph = graph.replace(node);
29959 action.disabled = function(graph) {
29960 if (!graph.entity(wayId).isClosed()) {
29961 return "not_closed";
29963 var way = graph.entity(wayId);
29964 var nodes = utilArrayUniq(graph.childNodes(way));
29965 var points = nodes.map(function(n3) {
29966 return projection2(n3.loc);
29968 var hull = hull_default(points);
29969 var epsilonAngle = Math.PI / 180;
29970 if (hull.length !== points.length || hull.length < 3) {
29973 var centroid = centroid_default2(points);
29974 var radius = geoVecLengthSquare(centroid, points[0]);
29975 var i3, actualPoint;
29976 for (i3 = 0; i3 < hull.length; i3++) {
29977 actualPoint = hull[i3];
29978 var actualDist = geoVecLengthSquare(actualPoint, centroid);
29979 var diff = Math.abs(actualDist - radius);
29980 if (diff > 0.05 * radius) {
29984 for (i3 = 0; i3 < hull.length; i3++) {
29985 actualPoint = hull[i3];
29986 var nextPoint = hull[(i3 + 1) % hull.length];
29987 var startAngle = Math.atan2(actualPoint[1] - centroid[1], actualPoint[0] - centroid[0]);
29988 var endAngle = Math.atan2(nextPoint[1] - centroid[1], nextPoint[0] - centroid[0]);
29989 var angle2 = endAngle - startAngle;
29993 if (angle2 > Math.PI) {
29994 angle2 = 2 * Math.PI - angle2;
29996 if (angle2 > maxAngle + epsilonAngle) {
30000 return "already_circular";
30002 action.transitionable = true;
30006 // modules/actions/delete_way.js
30007 function actionDeleteWay(wayID) {
30008 function canDeleteNode(node, graph) {
30009 if (graph.parentWays(node).length || graph.parentRelations(node).length)
30011 var geometries = osmNodeGeometriesForTags(node.tags);
30012 if (geometries.point)
30014 if (geometries.vertex)
30016 return !node.hasInterestingTags();
30018 var action = function(graph) {
30019 var way = graph.entity(wayID);
30020 graph.parentRelations(way).forEach(function(parent) {
30021 parent = parent.removeMembersWithID(wayID);
30022 graph = graph.replace(parent);
30023 if (parent.isDegenerate()) {
30024 graph = actionDeleteRelation(parent.id)(graph);
30027 new Set(way.nodes).forEach(function(nodeID) {
30028 graph = graph.replace(way.removeNode(nodeID));
30029 var node = graph.entity(nodeID);
30030 if (canDeleteNode(node, graph)) {
30031 graph = graph.remove(node);
30034 return graph.remove(way);
30039 // modules/actions/delete_multiple.js
30040 function actionDeleteMultiple(ids) {
30042 way: actionDeleteWay,
30043 node: actionDeleteNode,
30044 relation: actionDeleteRelation
30046 var action = function(graph) {
30047 ids.forEach(function(id2) {
30048 if (graph.hasEntity(id2)) {
30049 graph = actions[graph.entity(id2).type](id2)(graph);
30057 // modules/actions/delete_relation.js
30058 function actionDeleteRelation(relationID, allowUntaggedMembers) {
30059 function canDeleteEntity(entity, graph) {
30060 return !graph.parentWays(entity).length && !graph.parentRelations(entity).length && (!entity.hasInterestingTags() && !allowUntaggedMembers);
30062 var action = function(graph) {
30063 var relation = graph.entity(relationID);
30064 graph.parentRelations(relation).forEach(function(parent) {
30065 parent = parent.removeMembersWithID(relationID);
30066 graph = graph.replace(parent);
30067 if (parent.isDegenerate()) {
30068 graph = actionDeleteRelation(parent.id)(graph);
30071 var memberIDs = utilArrayUniq(relation.members.map(function(m2) {
30074 memberIDs.forEach(function(memberID) {
30075 graph = graph.replace(relation.removeMembersWithID(memberID));
30076 var entity = graph.entity(memberID);
30077 if (canDeleteEntity(entity, graph)) {
30078 graph = actionDeleteMultiple([memberID])(graph);
30081 return graph.remove(relation);
30086 // modules/actions/delete_node.js
30087 function actionDeleteNode(nodeId) {
30088 var action = function(graph) {
30089 var node = graph.entity(nodeId);
30090 graph.parentWays(node).forEach(function(parent) {
30091 parent = parent.removeNode(nodeId);
30092 graph = graph.replace(parent);
30093 if (parent.isDegenerate()) {
30094 graph = actionDeleteWay(parent.id)(graph);
30097 graph.parentRelations(node).forEach(function(parent) {
30098 parent = parent.removeMembersWithID(nodeId);
30099 graph = graph.replace(parent);
30100 if (parent.isDegenerate()) {
30101 graph = actionDeleteRelation(parent.id)(graph);
30104 return graph.remove(node);
30109 // modules/actions/connect.js
30110 function actionConnect(nodeIDs) {
30111 var action = function(graph) {
30117 var interestingIDs = [];
30118 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30119 node = graph.entity(nodeIDs[i3]);
30120 if (node.hasInterestingTags()) {
30121 if (!node.isNew()) {
30122 interestingIDs.push(node.id);
30126 survivor = graph.entity(utilOldestID(interestingIDs.length > 0 ? interestingIDs : nodeIDs));
30127 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30128 node = graph.entity(nodeIDs[i3]);
30129 if (node.id === survivor.id)
30131 parents = graph.parentWays(node);
30132 for (j3 = 0; j3 < parents.length; j3++) {
30133 graph = graph.replace(parents[j3].replaceNode(node.id, survivor.id));
30135 parents = graph.parentRelations(node);
30136 for (j3 = 0; j3 < parents.length; j3++) {
30137 graph = graph.replace(parents[j3].replaceMember(node, survivor));
30139 survivor = survivor.mergeTags(node.tags);
30140 graph = actionDeleteNode(node.id)(graph);
30142 graph = graph.replace(survivor);
30143 parents = graph.parentWays(survivor);
30144 for (i3 = 0; i3 < parents.length; i3++) {
30145 if (parents[i3].isDegenerate()) {
30146 graph = actionDeleteWay(parents[i3].id)(graph);
30151 action.disabled = function(graph) {
30153 var restrictionIDs = [];
30156 var relations, relation, role;
30158 survivor = graph.entity(utilOldestID(nodeIDs));
30159 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30160 node = graph.entity(nodeIDs[i3]);
30161 relations = graph.parentRelations(node);
30162 for (j3 = 0; j3 < relations.length; j3++) {
30163 relation = relations[j3];
30164 role = relation.memberById(node.id).role || "";
30165 if (relation.hasFromViaTo()) {
30166 restrictionIDs.push(relation.id);
30168 if (seen[relation.id] !== void 0 && seen[relation.id] !== role) {
30171 seen[relation.id] = role;
30175 for (i3 = 0; i3 < nodeIDs.length; i3++) {
30176 node = graph.entity(nodeIDs[i3]);
30177 var parents = graph.parentWays(node);
30178 for (j3 = 0; j3 < parents.length; j3++) {
30179 var parent = parents[j3];
30180 relations = graph.parentRelations(parent);
30181 for (k2 = 0; k2 < relations.length; k2++) {
30182 relation = relations[k2];
30183 if (relation.hasFromViaTo()) {
30184 restrictionIDs.push(relation.id);
30189 restrictionIDs = utilArrayUniq(restrictionIDs);
30190 for (i3 = 0; i3 < restrictionIDs.length; i3++) {
30191 relation = graph.entity(restrictionIDs[i3]);
30192 if (!relation.isComplete(graph))
30194 var memberWays = relation.members.filter(function(m2) {
30195 return m2.type === "way";
30196 }).map(function(m2) {
30197 return graph.entity(m2.id);
30199 memberWays = utilArrayUniq(memberWays);
30200 var f3 = relation.memberByRole("from");
30201 var t2 = relation.memberByRole("to");
30202 var isUturn = f3.id === t2.id;
30203 var nodes = { from: [], via: [], to: [], keyfrom: [], keyto: [] };
30204 for (j3 = 0; j3 < relation.members.length; j3++) {
30205 collectNodes(relation.members[j3], nodes);
30207 nodes.keyfrom = utilArrayUniq(nodes.keyfrom.filter(hasDuplicates));
30208 nodes.keyto = utilArrayUniq(nodes.keyto.filter(hasDuplicates));
30209 var filter2 = keyNodeFilter(nodes.keyfrom, nodes.keyto);
30210 nodes.from = nodes.from.filter(filter2);
30211 nodes.via = nodes.via.filter(filter2);
30212 nodes.to = nodes.to.filter(filter2);
30213 var connectFrom = false;
30214 var connectVia = false;
30215 var connectTo = false;
30216 var connectKeyFrom = false;
30217 var connectKeyTo = false;
30218 for (j3 = 0; j3 < nodeIDs.length; j3++) {
30219 var n3 = nodeIDs[j3];
30220 if (nodes.from.indexOf(n3) !== -1) {
30221 connectFrom = true;
30223 if (nodes.via.indexOf(n3) !== -1) {
30226 if (nodes.to.indexOf(n3) !== -1) {
30229 if (nodes.keyfrom.indexOf(n3) !== -1) {
30230 connectKeyFrom = true;
30232 if (nodes.keyto.indexOf(n3) !== -1) {
30233 connectKeyTo = true;
30236 if (connectFrom && connectTo && !isUturn) {
30237 return "restriction";
30239 if (connectFrom && connectVia) {
30240 return "restriction";
30242 if (connectTo && connectVia) {
30243 return "restriction";
30245 if (connectKeyFrom || connectKeyTo) {
30246 if (nodeIDs.length !== 2) {
30247 return "restriction";
30251 for (j3 = 0; j3 < memberWays.length; j3++) {
30252 way = memberWays[j3];
30253 if (way.contains(nodeIDs[0])) {
30256 if (way.contains(nodeIDs[1])) {
30262 for (j3 = 0; j3 < memberWays.length; j3++) {
30263 way = memberWays[j3];
30264 if (way.areAdjacent(n0, n1)) {
30270 return "restriction";
30274 for (j3 = 0; j3 < memberWays.length; j3++) {
30275 way = memberWays[j3].update({});
30276 for (k2 = 0; k2 < nodeIDs.length; k2++) {
30277 if (nodeIDs[k2] === survivor.id)
30279 if (way.areAdjacent(nodeIDs[k2], survivor.id)) {
30280 way = way.removeNode(nodeIDs[k2]);
30282 way = way.replaceNode(nodeIDs[k2], survivor.id);
30285 if (way.isDegenerate()) {
30286 return "restriction";
30291 function hasDuplicates(n4, i4, arr) {
30292 return arr.indexOf(n4) !== arr.lastIndexOf(n4);
30294 function keyNodeFilter(froms, tos) {
30295 return function(n4) {
30296 return froms.indexOf(n4) === -1 && tos.indexOf(n4) === -1;
30299 function collectNodes(member, collection) {
30300 var entity = graph.hasEntity(member.id);
30303 var role2 = member.role || "";
30304 if (!collection[role2]) {
30305 collection[role2] = [];
30307 if (member.type === "node") {
30308 collection[role2].push(member.id);
30309 if (role2 === "via") {
30310 collection.keyfrom.push(member.id);
30311 collection.keyto.push(member.id);
30313 } else if (member.type === "way") {
30314 collection[role2].push.apply(collection[role2], entity.nodes);
30315 if (role2 === "from" || role2 === "via") {
30316 collection.keyfrom.push(entity.first());
30317 collection.keyfrom.push(entity.last());
30319 if (role2 === "to" || role2 === "via") {
30320 collection.keyto.push(entity.first());
30321 collection.keyto.push(entity.last());
30329 // modules/actions/copy_entities.js
30330 function actionCopyEntities(ids, fromGraph) {
30332 var action = function(graph) {
30333 ids.forEach(function(id3) {
30334 fromGraph.entity(id3).copy(fromGraph, _copies);
30336 for (var id2 in _copies) {
30337 graph = graph.replace(_copies[id2]);
30341 action.copies = function() {
30347 // modules/actions/delete_member.js
30348 function actionDeleteMember(relationId, memberIndex) {
30349 return function(graph) {
30350 var relation = graph.entity(relationId).removeMember(memberIndex);
30351 graph = graph.replace(relation);
30352 if (relation.isDegenerate()) {
30353 graph = actionDeleteRelation(relation.id)(graph);
30359 // modules/actions/discard_tags.js
30360 function actionDiscardTags(difference, discardTags) {
30361 discardTags = discardTags || {};
30362 return (graph) => {
30363 difference.modified().forEach(checkTags);
30364 difference.created().forEach(checkTags);
30366 function checkTags(entity) {
30367 const keys2 = Object.keys(entity.tags);
30368 let didDiscard = false;
30370 for (let i3 = 0; i3 < keys2.length; i3++) {
30371 const k2 = keys2[i3];
30372 if (discardTags[k2] || !entity.tags[k2]) {
30375 tags[k2] = entity.tags[k2];
30379 graph = graph.replace(entity.update({ tags }));
30385 // modules/actions/disconnect.js
30386 function actionDisconnect(nodeId, newNodeId) {
30388 var disconnectableRelationTypes = {
30389 "associatedStreet": true,
30390 "enforcement": true,
30393 var action = function(graph) {
30394 var node = graph.entity(nodeId);
30395 var connections = action.connections(graph);
30396 connections.forEach(function(connection) {
30397 var way = graph.entity(connection.wayID);
30398 var newNode = osmNode({ id: newNodeId, loc: node.loc, tags: node.tags });
30399 graph = graph.replace(newNode);
30400 if (connection.index === 0 && way.isArea()) {
30401 graph = graph.replace(way.replaceNode(way.nodes[0], newNode.id));
30402 } else if (way.isClosed() && connection.index === way.nodes.length - 1) {
30403 graph = graph.replace(way.unclose().addNode(newNode.id));
30405 graph = graph.replace(way.updateNode(newNode.id, connection.index));
30410 action.connections = function(graph) {
30411 var candidates = [];
30412 var keeping = false;
30413 var parentWays = graph.parentWays(graph.entity(nodeId));
30415 for (var i3 = 0; i3 < parentWays.length; i3++) {
30416 way = parentWays[i3];
30417 if (wayIds && wayIds.indexOf(way.id) === -1) {
30421 if (way.isArea() && way.nodes[0] === nodeId) {
30422 candidates.push({ wayID: way.id, index: 0 });
30424 for (var j3 = 0; j3 < way.nodes.length; j3++) {
30425 waynode = way.nodes[j3];
30426 if (waynode === nodeId) {
30427 if (way.isClosed() && parentWays.length > 1 && wayIds && wayIds.indexOf(way.id) !== -1 && j3 === way.nodes.length - 1) {
30430 candidates.push({ wayID: way.id, index: j3 });
30435 return keeping ? candidates : candidates.slice(1);
30437 action.disabled = function(graph) {
30438 var connections = action.connections(graph);
30439 if (connections.length === 0)
30440 return "not_connected";
30441 var parentWays = graph.parentWays(graph.entity(nodeId));
30442 var seenRelationIds = {};
30443 var sharedRelation;
30444 parentWays.forEach(function(way) {
30445 var relations = graph.parentRelations(way);
30446 relations.filter((relation) => !disconnectableRelationTypes[relation.tags.type]).forEach(function(relation) {
30447 if (relation.id in seenRelationIds) {
30449 if (wayIds.indexOf(way.id) !== -1 || wayIds.indexOf(seenRelationIds[relation.id]) !== -1) {
30450 sharedRelation = relation;
30453 sharedRelation = relation;
30456 seenRelationIds[relation.id] = way.id;
30460 if (sharedRelation)
30463 action.limitWays = function(val) {
30464 if (!arguments.length)
30472 // modules/actions/extract.js
30473 function actionExtract(entityID, projection2) {
30474 var extractedNodeID;
30475 var action = function(graph) {
30476 var entity = graph.entity(entityID);
30477 if (entity.type === "node") {
30478 return extractFromNode(entity, graph);
30480 return extractFromWayOrRelation(entity, graph);
30482 function extractFromNode(node, graph) {
30483 extractedNodeID = node.id;
30484 var replacement = osmNode({ loc: node.loc });
30485 graph = graph.replace(replacement);
30486 graph = graph.parentWays(node).reduce(function(accGraph, parentWay) {
30487 return accGraph.replace(parentWay.replaceNode(entityID, replacement.id));
30489 return graph.parentRelations(node).reduce(function(accGraph, parentRel) {
30490 return accGraph.replace(parentRel.replaceMember(node, replacement));
30493 function extractFromWayOrRelation(entity, graph) {
30494 var fromGeometry = entity.geometry(graph);
30495 var keysToCopyAndRetain = ["source", "wheelchair"];
30496 var keysToRetain = ["area"];
30497 var buildingKeysToRetain = ["architect", "building", "height", "layer"];
30498 var extractedLoc = path_default(projection2).centroid(entity.asGeoJSON(graph));
30499 extractedLoc = extractedLoc && projection2.invert(extractedLoc);
30500 if (!extractedLoc || !isFinite(extractedLoc[0]) || !isFinite(extractedLoc[1])) {
30501 extractedLoc = entity.extent(graph).center();
30503 var indoorAreaValues = {
30510 var isBuilding = entity.tags.building && entity.tags.building !== "no" || entity.tags["building:part"] && entity.tags["building:part"] !== "no";
30511 var isIndoorArea = fromGeometry === "area" && entity.tags.indoor && indoorAreaValues[entity.tags.indoor];
30512 var entityTags = Object.assign({}, entity.tags);
30513 var pointTags = {};
30514 for (var key in entityTags) {
30515 if (entity.type === "relation" && key === "type") {
30518 if (keysToRetain.indexOf(key) !== -1) {
30522 if (buildingKeysToRetain.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/))
30525 if (isIndoorArea && key === "indoor") {
30528 pointTags[key] = entityTags[key];
30529 if (keysToCopyAndRetain.indexOf(key) !== -1 || key.match(/^addr:.{1,}/)) {
30531 } else if (isIndoorArea && key === "level") {
30534 delete entityTags[key];
30536 if (!isBuilding && !isIndoorArea && fromGeometry === "area") {
30537 entityTags.area = "yes";
30539 var replacement = osmNode({ loc: extractedLoc, tags: pointTags });
30540 graph = graph.replace(replacement);
30541 extractedNodeID = replacement.id;
30542 return graph.replace(entity.update({ tags: entityTags }));
30544 action.getExtractedNodeID = function() {
30545 return extractedNodeID;
30550 // modules/actions/join.js
30551 function actionJoin(ids) {
30552 function groupEntitiesByGeometry(graph) {
30553 var entities = ids.map(function(id2) {
30554 return graph.entity(id2);
30556 return Object.assign(
30558 utilArrayGroupBy(entities, function(entity) {
30559 return entity.geometry(graph);
30563 var action = function(graph) {
30564 var ways = ids.map(graph.entity, graph);
30565 var survivorID = utilOldestID(ways.map((way) => way.id));
30566 ways.sort(function(a2, b2) {
30567 var aSided = a2.isSided();
30568 var bSided = b2.isSided();
30569 return aSided && !bSided ? -1 : bSided && !aSided ? 1 : 0;
30571 var sequences = osmJoinWays(ways, graph);
30572 var joined = sequences[0];
30573 graph = sequences.actions.reduce(function(g3, action2) {
30574 return action2(g3);
30576 var survivor = graph.entity(survivorID);
30577 survivor = survivor.update({ nodes: joined.nodes.map(function(n3) {
30580 graph = graph.replace(survivor);
30581 joined.forEach(function(way) {
30582 if (way.id === survivorID)
30584 graph.parentRelations(way).forEach(function(parent) {
30585 graph = graph.replace(parent.replaceMember(way, survivor));
30587 survivor = survivor.mergeTags(way.tags);
30588 graph = graph.replace(survivor);
30589 graph = actionDeleteWay(way.id)(graph);
30591 function checkForSimpleMultipolygon() {
30592 if (!survivor.isClosed())
30594 var multipolygons = graph.parentMultipolygons(survivor).filter(function(multipolygon2) {
30595 return multipolygon2.members.length === 1;
30597 if (multipolygons.length !== 1)
30599 var multipolygon = multipolygons[0];
30600 for (var key in survivor.tags) {
30601 if (multipolygon.tags[key] && // don't collapse if tags cannot be cleanly merged
30602 multipolygon.tags[key] !== survivor.tags[key])
30605 survivor = survivor.mergeTags(multipolygon.tags);
30606 graph = graph.replace(survivor);
30607 graph = actionDeleteRelation(
30610 /* allow untagged members */
30612 var tags = Object.assign({}, survivor.tags);
30613 if (survivor.geometry(graph) !== "area") {
30617 survivor = survivor.update({ tags });
30618 graph = graph.replace(survivor);
30620 checkForSimpleMultipolygon();
30623 action.resultingWayNodesLength = function(graph) {
30624 return ids.reduce(function(count, id2) {
30625 return count + graph.entity(id2).nodes.length;
30626 }, 0) - ids.length - 1;
30628 action.disabled = function(graph) {
30629 var geometries = groupEntitiesByGeometry(graph);
30630 if (ids.length < 2 || ids.length !== geometries.line.length) {
30631 return "not_eligible";
30633 var joined = osmJoinWays(ids.map(graph.entity, graph), graph);
30634 if (joined.length > 1) {
30635 return "not_adjacent";
30638 var sortedParentRelations = function(id2) {
30639 return graph.parentRelations(graph.entity(id2)).filter((rel) => !rel.isRestriction() && !rel.isConnectivity()).sort((a2, b2) => a2.id - b2.id);
30641 var relsA = sortedParentRelations(ids[0]);
30642 for (i3 = 1; i3 < ids.length; i3++) {
30643 var relsB = sortedParentRelations(ids[i3]);
30644 if (!utilArrayIdentical(relsA, relsB)) {
30645 return "conflicting_relations";
30648 for (i3 = 0; i3 < ids.length - 1; i3++) {
30649 for (var j3 = i3 + 1; j3 < ids.length; j3++) {
30650 var path1 = graph.childNodes(graph.entity(ids[i3])).map(function(e3) {
30653 var path2 = graph.childNodes(graph.entity(ids[j3])).map(function(e3) {
30656 var intersections = geoPathIntersections(path1, path2);
30657 var common = utilArrayIntersection(
30658 joined[0].nodes.map(function(n3) {
30659 return n3.loc.toString();
30661 intersections.map(function(n3) {
30662 return n3.toString();
30665 if (common.length !== intersections.length) {
30666 return "paths_intersect";
30670 var nodeIds = joined[0].nodes.map(function(n3) {
30675 var conflicting = false;
30676 joined[0].forEach(function(way) {
30677 var parents = graph.parentRelations(way);
30678 parents.forEach(function(parent) {
30679 if ((parent.isRestriction() || parent.isConnectivity()) && parent.members.some(function(m2) {
30680 return nodeIds.indexOf(m2.id) >= 0;
30685 for (var k2 in way.tags) {
30686 if (!(k2 in tags)) {
30687 tags[k2] = way.tags[k2];
30688 } else if (tags[k2] && osmIsInterestingTag(k2) && tags[k2] !== way.tags[k2]) {
30689 conflicting = true;
30694 return relation.isRestriction() ? "restriction" : "connectivity";
30697 return "conflicting_tags";
30703 // modules/actions/merge.js
30704 function actionMerge(ids) {
30705 function groupEntitiesByGeometry(graph) {
30706 var entities = ids.map(function(id2) {
30707 return graph.entity(id2);
30709 return Object.assign(
30710 { point: [], area: [], line: [], relation: [] },
30711 utilArrayGroupBy(entities, function(entity) {
30712 return entity.geometry(graph);
30716 var action = function(graph) {
30717 var geometries = groupEntitiesByGeometry(graph);
30718 var target = geometries.area[0] || geometries.line[0];
30719 var points = geometries.point;
30720 points.forEach(function(point2) {
30721 target = target.mergeTags(point2.tags);
30722 graph = graph.replace(target);
30723 graph.parentRelations(point2).forEach(function(parent) {
30724 graph = graph.replace(parent.replaceMember(point2, target));
30726 var nodes = utilArrayUniq(graph.childNodes(target));
30727 var removeNode = point2;
30728 if (!point2.isNew()) {
30729 var inserted = false;
30730 var canBeReplaced = function(node2) {
30731 return !(graph.parentWays(node2).length > 1 || graph.parentRelations(node2).length);
30733 var replaceNode = function(node2) {
30734 graph = graph.replace(point2.update({ tags: node2.tags, loc: node2.loc }));
30735 target = target.replaceNode(node2.id, point2.id);
30736 graph = graph.replace(target);
30737 removeNode = node2;
30742 for (i3 = 0; i3 < nodes.length; i3++) {
30744 if (canBeReplaced(node) && node.isNew()) {
30749 if (!inserted && point2.hasInterestingTags()) {
30750 for (i3 = 0; i3 < nodes.length; i3++) {
30752 if (canBeReplaced(node) && !node.hasInterestingTags()) {
30758 for (i3 = 0; i3 < nodes.length; i3++) {
30760 if (canBeReplaced(node) && utilCompareIDs(point2.id, node.id) < 0) {
30768 graph = graph.remove(removeNode);
30770 if (target.tags.area === "yes") {
30771 var tags = Object.assign({}, target.tags);
30773 if (osmTagSuggestingArea(tags)) {
30774 target = target.update({ tags });
30775 graph = graph.replace(target);
30780 action.disabled = function(graph) {
30781 var geometries = groupEntitiesByGeometry(graph);
30782 if (geometries.point.length === 0 || geometries.area.length + geometries.line.length !== 1 || geometries.relation.length !== 0) {
30783 return "not_eligible";
30789 // modules/actions/merge_nodes.js
30790 function actionMergeNodes(nodeIDs, loc) {
30791 function chooseLoc(graph) {
30792 if (!nodeIDs.length)
30795 var interestingCount = 0;
30796 var interestingLoc;
30797 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
30798 var node = graph.entity(nodeIDs[i3]);
30799 if (node.hasInterestingTags()) {
30800 interestingLoc = ++interestingCount === 1 ? node.loc : null;
30802 sum = geoVecAdd(sum, node.loc);
30804 return interestingLoc || geoVecScale(sum, 1 / nodeIDs.length);
30806 var action = function(graph) {
30807 if (nodeIDs.length < 2)
30811 toLoc = chooseLoc(graph);
30813 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
30814 var node = graph.entity(nodeIDs[i3]);
30815 if (node.loc !== toLoc) {
30816 graph = graph.replace(node.move(toLoc));
30819 return actionConnect(nodeIDs)(graph);
30821 action.disabled = function(graph) {
30822 if (nodeIDs.length < 2)
30823 return "not_eligible";
30824 for (var i3 = 0; i3 < nodeIDs.length; i3++) {
30825 var entity = graph.entity(nodeIDs[i3]);
30826 if (entity.type !== "node")
30827 return "not_eligible";
30829 return actionConnect(nodeIDs).disabled(graph);
30834 // modules/osm/changeset.js
30835 function osmChangeset() {
30836 if (!(this instanceof osmChangeset)) {
30837 return new osmChangeset().initialize(arguments);
30838 } else if (arguments.length) {
30839 this.initialize(arguments);
30842 osmEntity.changeset = osmChangeset;
30843 osmChangeset.prototype = Object.create(osmEntity.prototype);
30844 Object.assign(osmChangeset.prototype, {
30846 extent: function() {
30847 return new geoExtent();
30849 geometry: function() {
30850 return "changeset";
30852 asJXON: function() {
30856 tag: Object.keys(this.tags).map(function(k2) {
30857 return { "@k": k2, "@v": this.tags[k2] };
30865 // Generate [osmChange](http://wiki.openstreetmap.org/wiki/OsmChange)
30866 // XML. Returns a string.
30867 osmChangeJXON: function(changes) {
30868 var changeset_id = this.id;
30869 function nest(x2, order) {
30871 for (var i3 = 0; i3 < x2.length; i3++) {
30872 var tagName = Object.keys(x2[i3])[0];
30873 if (!groups[tagName])
30874 groups[tagName] = [];
30875 groups[tagName].push(x2[i3][tagName]);
30878 order.forEach(function(o2) {
30880 ordered[o2] = groups[o2];
30884 function sort(changes2) {
30885 function resolve(item) {
30886 return relations.find(function(relation2) {
30887 return item.keyAttributes.type === "relation" && item.keyAttributes.ref === relation2["@id"];
30890 function isNew(item) {
30891 return !sorted[item["@id"]] && !processing.find(function(proc) {
30892 return proc["@id"] === item["@id"];
30895 var processing = [];
30897 var relations = changes2.relation;
30900 for (var i3 = 0; i3 < relations.length; i3++) {
30901 var relation = relations[i3];
30902 if (!sorted[relation["@id"]]) {
30903 processing.push(relation);
30905 while (processing.length > 0) {
30906 var next = processing[0], deps = next.member.map(resolve).filter(Boolean).filter(isNew);
30907 if (deps.length === 0) {
30908 sorted[next["@id"]] = next;
30909 processing.shift();
30911 processing = deps.concat(processing);
30915 changes2.relation = Object.values(sorted);
30918 function rep2(entity) {
30919 return entity.asJXON(changeset_id);
30924 "@generator": "iD",
30925 "create": sort(nest(changes.created.map(rep2), ["node", "way", "relation"])),
30926 "modify": nest(changes.modified.map(rep2), ["node", "way", "relation"]),
30927 "delete": Object.assign(nest(changes.deleted.map(rep2), ["relation", "way", "node"]), { "@if-unused": true })
30931 asGeoJSON: function() {
30936 // modules/osm/note.js
30937 function osmNote() {
30938 if (!(this instanceof osmNote)) {
30939 return new osmNote().initialize(arguments);
30940 } else if (arguments.length) {
30941 this.initialize(arguments);
30944 osmNote.id = function() {
30945 return osmNote.id.next--;
30947 osmNote.id.next = -1;
30948 Object.assign(osmNote.prototype, {
30950 initialize: function(sources) {
30951 for (var i3 = 0; i3 < sources.length; ++i3) {
30952 var source = sources[i3];
30953 for (var prop in source) {
30954 if (Object.prototype.hasOwnProperty.call(source, prop)) {
30955 if (source[prop] === void 0) {
30958 this[prop] = source[prop];
30964 this.id = osmNote.id().toString();
30968 extent: function() {
30969 return new geoExtent(this.loc);
30971 update: function(attrs) {
30972 return osmNote(this, attrs);
30974 isNew: function() {
30975 return this.id < 0;
30977 move: function(loc) {
30978 return this.update({ loc });
30982 // modules/osm/relation.js
30983 function osmRelation() {
30984 if (!(this instanceof osmRelation)) {
30985 return new osmRelation().initialize(arguments);
30986 } else if (arguments.length) {
30987 this.initialize(arguments);
30990 osmEntity.relation = osmRelation;
30991 osmRelation.prototype = Object.create(osmEntity.prototype);
30992 osmRelation.creationOrder = function(a2, b2) {
30993 var aId = parseInt(osmEntity.id.toOSM(a2.id), 10);
30994 var bId = parseInt(osmEntity.id.toOSM(b2.id), 10);
30995 if (aId < 0 || bId < 0)
30999 Object.assign(osmRelation.prototype, {
31002 copy: function(resolver, copies) {
31003 if (copies[this.id])
31004 return copies[this.id];
31005 var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
31006 var members = this.members.map(function(member) {
31007 return Object.assign({}, member, { id: resolver.entity(member.id).copy(resolver, copies).id });
31009 copy2 = copy2.update({ members });
31010 copies[this.id] = copy2;
31013 extent: function(resolver, memo) {
31014 return resolver.transient(this, "extent", function() {
31015 if (memo && memo[this.id])
31016 return geoExtent();
31018 memo[this.id] = true;
31019 var extent = geoExtent();
31020 for (var i3 = 0; i3 < this.members.length; i3++) {
31021 var member = resolver.hasEntity(this.members[i3].id);
31023 extent._extend(member.extent(resolver, memo));
31029 geometry: function(graph) {
31030 return graph.transient(this, "geometry", function() {
31031 return this.isMultipolygon() ? "area" : "relation";
31034 isDegenerate: function() {
31035 return this.members.length === 0;
31037 // Return an array of members, each extended with an 'index' property whose value
31038 // is the member index.
31039 indexedMembers: function() {
31040 var result = new Array(this.members.length);
31041 for (var i3 = 0; i3 < this.members.length; i3++) {
31042 result[i3] = Object.assign({}, this.members[i3], { index: i3 });
31046 // Return the first member with the given role. A copy of the member object
31047 // is returned, extended with an 'index' property whose value is the member index.
31048 memberByRole: function(role) {
31049 for (var i3 = 0; i3 < this.members.length; i3++) {
31050 if (this.members[i3].role === role) {
31051 return Object.assign({}, this.members[i3], { index: i3 });
31055 // Same as memberByRole, but returns all members with the given role
31056 membersByRole: function(role) {
31058 for (var i3 = 0; i3 < this.members.length; i3++) {
31059 if (this.members[i3].role === role) {
31060 result.push(Object.assign({}, this.members[i3], { index: i3 }));
31065 // Return the first member with the given id. A copy of the member object
31066 // is returned, extended with an 'index' property whose value is the member index.
31067 memberById: function(id2) {
31068 for (var i3 = 0; i3 < this.members.length; i3++) {
31069 if (this.members[i3].id === id2) {
31070 return Object.assign({}, this.members[i3], { index: i3 });
31074 // Return the first member with the given id and role. A copy of the member object
31075 // is returned, extended with an 'index' property whose value is the member index.
31076 memberByIdAndRole: function(id2, role) {
31077 for (var i3 = 0; i3 < this.members.length; i3++) {
31078 if (this.members[i3].id === id2 && this.members[i3].role === role) {
31079 return Object.assign({}, this.members[i3], { index: i3 });
31083 addMember: function(member, index) {
31084 var members = this.members.slice();
31085 members.splice(index === void 0 ? members.length : index, 0, member);
31086 return this.update({ members });
31088 updateMember: function(member, index) {
31089 var members = this.members.slice();
31090 members.splice(index, 1, Object.assign({}, members[index], member));
31091 return this.update({ members });
31093 removeMember: function(index) {
31094 var members = this.members.slice();
31095 members.splice(index, 1);
31096 return this.update({ members });
31098 removeMembersWithID: function(id2) {
31099 var members = this.members.filter(function(m2) {
31100 return m2.id !== id2;
31102 return this.update({ members });
31104 moveMember: function(fromIndex, toIndex) {
31105 var members = this.members.slice();
31106 members.splice(toIndex, 0, members.splice(fromIndex, 1)[0]);
31107 return this.update({ members });
31109 // Wherever a member appears with id `needle.id`, replace it with a member
31110 // with id `replacement.id`, type `replacement.type`, and the original role,
31111 // By default, adding a duplicate member (by id and role) is prevented.
31112 // Return an updated relation.
31113 replaceMember: function(needle, replacement, keepDuplicates) {
31114 if (!this.memberById(needle.id))
31117 for (var i3 = 0; i3 < this.members.length; i3++) {
31118 var member = this.members[i3];
31119 if (member.id !== needle.id) {
31120 members.push(member);
31121 } else if (keepDuplicates || !this.memberByIdAndRole(replacement.id, member.role)) {
31122 members.push({ id: replacement.id, type: replacement.type, role: member.role });
31125 return this.update({ members });
31127 asJXON: function(changeset_id) {
31130 "@id": this.osmId(),
31131 "@version": this.version || 0,
31132 member: this.members.map(function(member) {
31137 ref: osmEntity.id.toOSM(member.id)
31141 tag: Object.keys(this.tags).map(function(k2) {
31142 return { keyAttributes: { k: k2, v: this.tags[k2] } };
31146 if (changeset_id) {
31147 r2.relation["@changeset"] = changeset_id;
31151 asGeoJSON: function(resolver) {
31152 return resolver.transient(this, "GeoJSON", function() {
31153 if (this.isMultipolygon()) {
31155 type: "MultiPolygon",
31156 coordinates: this.multipolygon(resolver)
31160 type: "FeatureCollection",
31161 properties: this.tags,
31162 features: this.members.map(function(member) {
31163 return Object.assign({ role: member.role }, resolver.entity(member.id).asGeoJSON(resolver));
31169 area: function(resolver) {
31170 return resolver.transient(this, "area", function() {
31171 return area_default(this.asGeoJSON(resolver));
31174 isMultipolygon: function() {
31175 return this.tags.type === "multipolygon";
31177 isComplete: function(resolver) {
31178 for (var i3 = 0; i3 < this.members.length; i3++) {
31179 if (!resolver.hasEntity(this.members[i3].id)) {
31185 hasFromViaTo: function() {
31186 return this.members.some(function(m2) {
31187 return m2.role === "from";
31188 }) && this.members.some(function(m2) {
31189 return m2.role === "via";
31190 }) && this.members.some(function(m2) {
31191 return m2.role === "to";
31194 isRestriction: function() {
31195 return !!(this.tags.type && this.tags.type.match(/^restriction:?/));
31197 isValidRestriction: function() {
31198 if (!this.isRestriction())
31200 var froms = this.members.filter(function(m2) {
31201 return m2.role === "from";
31203 var vias = this.members.filter(function(m2) {
31204 return m2.role === "via";
31206 var tos = this.members.filter(function(m2) {
31207 return m2.role === "to";
31209 if (froms.length !== 1 && this.tags.restriction !== "no_entry")
31211 if (froms.some(function(m2) {
31212 return m2.type !== "way";
31215 if (tos.length !== 1 && this.tags.restriction !== "no_exit")
31217 if (tos.some(function(m2) {
31218 return m2.type !== "way";
31221 if (vias.length === 0)
31223 if (vias.length > 1 && vias.some(function(m2) {
31224 return m2.type !== "way";
31229 isConnectivity: function() {
31230 return !!(this.tags.type && this.tags.type.match(/^connectivity:?/));
31232 // Returns an array [A0, ... An], each Ai being an array of node arrays [Nds0, ... Ndsm],
31233 // where Nds0 is an outer ring and subsequent Ndsi's (if any i > 0) being inner rings.
31235 // This corresponds to the structure needed for rendering a multipolygon path using a
31236 // `evenodd` fill rule, as well as the structure of a GeoJSON MultiPolygon geometry.
31238 // In the case of invalid geometries, this function will still return a result which
31239 // includes the nodes of all way members, but some Nds may be unclosed and some inner
31240 // rings not matched with the intended outer ring.
31242 multipolygon: function(resolver) {
31243 var outers = this.members.filter(function(m2) {
31244 return "outer" === (m2.role || "outer");
31246 var inners = this.members.filter(function(m2) {
31247 return "inner" === m2.role;
31249 outers = osmJoinWays(outers, resolver);
31250 inners = osmJoinWays(inners, resolver);
31251 var sequenceToLineString = function(sequence) {
31252 if (sequence.nodes.length > 2 && sequence.nodes[0] !== sequence.nodes[sequence.nodes.length - 1]) {
31253 sequence.nodes.push(sequence.nodes[0]);
31255 return sequence.nodes.map(function(node) {
31259 outers = outers.map(sequenceToLineString);
31260 inners = inners.map(sequenceToLineString);
31261 var result = outers.map(function(o3) {
31262 return [area_default({ type: "Polygon", coordinates: [o3] }) > 2 * Math.PI ? o3.reverse() : o3];
31264 function findOuter(inner2) {
31266 for (o3 = 0; o3 < outers.length; o3++) {
31267 outer = outers[o3];
31268 if (geoPolygonContainsPolygon(outer, inner2)) {
31272 for (o3 = 0; o3 < outers.length; o3++) {
31273 outer = outers[o3];
31274 if (geoPolygonIntersectsPolygon(outer, inner2, false)) {
31279 for (var i3 = 0; i3 < inners.length; i3++) {
31280 var inner = inners[i3];
31281 if (area_default({ type: "Polygon", coordinates: [inner] }) < 2 * Math.PI) {
31282 inner = inner.reverse();
31284 var o2 = findOuter(inners[i3]);
31285 if (o2 !== void 0) {
31286 result[o2].push(inners[i3]);
31288 result.push([inners[i3]]);
31295 // modules/osm/qa_item.js
31296 var QAItem = class _QAItem {
31297 constructor(loc, service, itemType, id2, props) {
31299 this.service = service.title;
31300 this.itemType = itemType;
31301 this.id = id2 ? id2 : `${_QAItem.id()}`;
31302 this.update(props);
31303 if (service && typeof service.getIcon === "function") {
31304 this.icon = service.getIcon(itemType);
31308 const { loc, service, itemType, id: id2 } = this;
31309 Object.keys(props).forEach((prop) => this[prop] = props[prop]);
31311 this.service = service;
31312 this.itemType = itemType;
31316 // Generic handling for newly created QAItems
31318 return this.nextId--;
31321 QAItem.nextId = -1;
31323 // modules/actions/split.js
31324 function actionSplit(nodeIds, newWayIds) {
31325 if (typeof nodeIds === "string")
31326 nodeIds = [nodeIds];
31328 var _keepHistoryOn = "longest";
31329 var _createdWayIDs = [];
31330 function dist(graph, nA, nB) {
31331 var locA = graph.entity(nA).loc;
31332 var locB = graph.entity(nB).loc;
31333 var epsilon3 = 1e-6;
31334 return locA && locB ? geoSphericalDistance(locA, locB) : epsilon3;
31336 function splitArea(nodes, idxA, graph) {
31337 var lengths = new Array(nodes.length);
31342 function wrap2(index) {
31343 return utilWrap(index, nodes.length);
31346 for (i3 = wrap2(idxA + 1); i3 !== idxA; i3 = wrap2(i3 + 1)) {
31347 length += dist(graph, nodes[i3], nodes[wrap2(i3 - 1)]);
31348 lengths[i3] = length;
31351 for (i3 = wrap2(idxA - 1); i3 !== idxA; i3 = wrap2(i3 - 1)) {
31352 length += dist(graph, nodes[i3], nodes[wrap2(i3 + 1)]);
31353 if (length < lengths[i3]) {
31354 lengths[i3] = length;
31357 for (i3 = 0; i3 < nodes.length; i3++) {
31358 var cost = lengths[i3] / dist(graph, nodes[idxA], nodes[i3]);
31366 function totalLengthBetweenNodes(graph, nodes) {
31367 var totalLength = 0;
31368 for (var i3 = 0; i3 < nodes.length - 1; i3++) {
31369 totalLength += dist(graph, nodes[i3], nodes[i3 + 1]);
31371 return totalLength;
31373 function split(graph, nodeId, wayA, newWayId) {
31374 var wayB = osmWay({ id: newWayId, tags: wayA.tags });
31375 var origNodes = wayA.nodes.slice();
31378 var isArea = wayA.isArea();
31379 var isOuter = osmIsOldMultipolygonOuterMember(wayA, graph);
31380 if (wayA.isClosed()) {
31381 var nodes = wayA.nodes.slice(0, -1);
31382 var idxA = nodes.indexOf(nodeId);
31383 var idxB = splitArea(nodes, idxA, graph);
31385 nodesA = nodes.slice(idxA).concat(nodes.slice(0, idxB + 1));
31386 nodesB = nodes.slice(idxB, idxA + 1);
31388 nodesA = nodes.slice(idxA, idxB + 1);
31389 nodesB = nodes.slice(idxB).concat(nodes.slice(0, idxA + 1));
31392 var idx = wayA.nodes.indexOf(nodeId, 1);
31393 nodesA = wayA.nodes.slice(0, idx + 1);
31394 nodesB = wayA.nodes.slice(idx);
31396 var lengthA = totalLengthBetweenNodes(graph, nodesA);
31397 var lengthB = totalLengthBetweenNodes(graph, nodesB);
31398 if (_keepHistoryOn === "longest" && lengthB > lengthA) {
31399 wayA = wayA.update({ nodes: nodesB });
31400 wayB = wayB.update({ nodes: nodesA });
31401 var temp = lengthA;
31405 wayA = wayA.update({ nodes: nodesA });
31406 wayB = wayB.update({ nodes: nodesB });
31408 if (wayA.tags.step_count) {
31409 var stepCount = Number(wayA.tags.step_count);
31410 if (stepCount && // ensure a number
31411 isFinite(stepCount) && // ensure positive
31412 stepCount > 0 && // ensure integer
31413 Math.round(stepCount) === stepCount) {
31414 var tagsA = Object.assign({}, wayA.tags);
31415 var tagsB = Object.assign({}, wayB.tags);
31416 var ratioA = lengthA / (lengthA + lengthB);
31417 var countA = Math.round(stepCount * ratioA);
31418 tagsA.step_count = countA.toString();
31419 tagsB.step_count = (stepCount - countA).toString();
31420 wayA = wayA.update({ tags: tagsA });
31421 wayB = wayB.update({ tags: tagsB });
31424 graph = graph.replace(wayA);
31425 graph = graph.replace(wayB);
31426 graph.parentRelations(wayA).forEach(function(relation) {
31428 if (relation.hasFromViaTo()) {
31429 var f3 = relation.memberByRole("from");
31430 var v2 = relation.membersByRole("via");
31431 var t2 = relation.memberByRole("to");
31433 if (f3.id === wayA.id || t2.id === wayA.id) {
31435 if (v2.length === 1 && v2[0].type === "node") {
31436 keepB = wayB.contains(v2[0].id);
31438 for (i3 = 0; i3 < v2.length; i3++) {
31439 if (v2[i3].type === "way") {
31440 var wayVia = graph.hasEntity(v2[i3].id);
31441 if (wayVia && utilArrayIntersection(wayB.nodes, wayVia.nodes).length) {
31449 relation = relation.replaceMember(wayA, wayB);
31450 graph = graph.replace(relation);
31453 for (i3 = 0; i3 < v2.length; i3++) {
31454 if (v2[i3].type === "way" && v2[i3].id === wayA.id) {
31460 graph = actionAddMember(relation.id, member, v2[i3].index + 1)(graph);
31466 if (relation === isOuter) {
31467 graph = graph.replace(relation.mergeTags(wayA.tags));
31468 graph = graph.replace(wayA.update({ tags: {} }));
31469 graph = graph.replace(wayB.update({ tags: {} }));
31474 role: relation.memberById(wayA.id).role
31477 originalID: wayA.id,
31478 insertedID: wayB.id,
31481 graph = actionAddMember(relation.id, member, void 0, insertPair)(graph);
31484 if (!isOuter && isArea) {
31485 var multipolygon = osmRelation({
31486 tags: Object.assign({}, wayA.tags, { type: "multipolygon" }),
31488 { id: wayA.id, role: "outer", type: "way" },
31489 { id: wayB.id, role: "outer", type: "way" }
31492 graph = graph.replace(multipolygon);
31493 graph = graph.replace(wayA.update({ tags: {} }));
31494 graph = graph.replace(wayB.update({ tags: {} }));
31496 _createdWayIDs.push(wayB.id);
31499 var action = function(graph) {
31500 _createdWayIDs = [];
31501 var newWayIndex = 0;
31502 for (var i3 = 0; i3 < nodeIds.length; i3++) {
31503 var nodeId = nodeIds[i3];
31504 var candidates = action.waysForNode(nodeId, graph);
31505 for (var j3 = 0; j3 < candidates.length; j3++) {
31506 graph = split(graph, nodeId, candidates[j3], newWayIds && newWayIds[newWayIndex]);
31512 action.getCreatedWayIDs = function() {
31513 return _createdWayIDs;
31515 action.waysForNode = function(nodeId, graph) {
31516 var node = graph.entity(nodeId);
31517 var splittableParents = graph.parentWays(node).filter(isSplittable);
31519 var hasLine = splittableParents.some(function(parent) {
31520 return parent.geometry(graph) === "line";
31523 return splittableParents.filter(function(parent) {
31524 return parent.geometry(graph) === "line";
31528 return splittableParents;
31529 function isSplittable(parent) {
31530 if (_wayIDs && _wayIDs.indexOf(parent.id) === -1)
31532 if (parent.isClosed())
31534 for (var i3 = 1; i3 < parent.nodes.length - 1; i3++) {
31535 if (parent.nodes[i3] === nodeId)
31541 action.ways = function(graph) {
31542 return utilArrayUniq([].concat.apply([], nodeIds.map(function(nodeId) {
31543 return action.waysForNode(nodeId, graph);
31546 action.disabled = function(graph) {
31547 for (var i3 = 0; i3 < nodeIds.length; i3++) {
31548 var nodeId = nodeIds[i3];
31549 var candidates = action.waysForNode(nodeId, graph);
31550 if (candidates.length === 0 || _wayIDs && _wayIDs.length !== candidates.length) {
31551 return "not_eligible";
31555 action.limitWays = function(val) {
31556 if (!arguments.length)
31561 action.keepHistoryOn = function(val) {
31562 if (!arguments.length)
31563 return _keepHistoryOn;
31564 _keepHistoryOn = val;
31570 // modules/core/graph.js
31571 function coreGraph(other, mutable) {
31572 if (!(this instanceof coreGraph))
31573 return new coreGraph(other, mutable);
31574 if (other instanceof coreGraph) {
31575 var base = other.base();
31576 this.entities = Object.assign(Object.create(base.entities), other.entities);
31577 this._parentWays = Object.assign(Object.create(base.parentWays), other._parentWays);
31578 this._parentRels = Object.assign(Object.create(base.parentRels), other._parentRels);
31580 this.entities = /* @__PURE__ */ Object.create({});
31581 this._parentWays = /* @__PURE__ */ Object.create({});
31582 this._parentRels = /* @__PURE__ */ Object.create({});
31583 this.rebase(other || [], [this]);
31585 this.transients = {};
31586 this._childNodes = {};
31587 this.frozen = !mutable;
31589 coreGraph.prototype = {
31590 hasEntity: function(id2) {
31591 return this.entities[id2];
31593 entity: function(id2) {
31594 var entity = this.entities[id2];
31596 entity = this.entities.__proto__[id2];
31599 throw new Error("entity " + id2 + " not found");
31603 geometry: function(id2) {
31604 return this.entity(id2).geometry(this);
31606 transient: function(entity, key, fn) {
31607 var id2 = entity.id;
31608 var transients = this.transients[id2] || (this.transients[id2] = {});
31609 if (transients[key] !== void 0) {
31610 return transients[key];
31612 transients[key] = fn.call(entity);
31613 return transients[key];
31615 parentWays: function(entity) {
31616 var parents = this._parentWays[entity.id];
31619 parents.forEach(function(id2) {
31620 result.push(this.entity(id2));
31625 isPoi: function(entity) {
31626 var parents = this._parentWays[entity.id];
31627 return !parents || parents.size === 0;
31629 isShared: function(entity) {
31630 var parents = this._parentWays[entity.id];
31631 return parents && parents.size > 1;
31633 parentRelations: function(entity) {
31634 var parents = this._parentRels[entity.id];
31637 parents.forEach(function(id2) {
31638 result.push(this.entity(id2));
31643 parentMultipolygons: function(entity) {
31644 return this.parentRelations(entity).filter(function(relation) {
31645 return relation.isMultipolygon();
31648 childNodes: function(entity) {
31649 if (this._childNodes[entity.id])
31650 return this._childNodes[entity.id];
31654 for (var i3 = 0; i3 < entity.nodes.length; i3++) {
31655 nodes[i3] = this.entity(entity.nodes[i3]);
31658 Object.freeze(nodes);
31659 this._childNodes[entity.id] = nodes;
31660 return this._childNodes[entity.id];
31664 "entities": Object.getPrototypeOf(this.entities),
31665 "parentWays": Object.getPrototypeOf(this._parentWays),
31666 "parentRels": Object.getPrototypeOf(this._parentRels)
31669 // Unlike other graph methods, rebase mutates in place. This is because it
31670 // is used only during the history operation that merges newly downloaded
31671 // data into each state. To external consumers, it should appear as if the
31672 // graph always contained the newly downloaded data.
31673 rebase: function(entities, stack, force) {
31674 var base = this.base();
31675 var i3, j3, k2, id2;
31676 for (i3 = 0; i3 < entities.length; i3++) {
31677 var entity = entities[i3];
31678 if (!entity.visible || !force && base.entities[entity.id])
31680 base.entities[entity.id] = entity;
31681 this._updateCalculated(void 0, entity, base.parentWays, base.parentRels);
31682 if (entity.type === "way") {
31683 for (j3 = 0; j3 < entity.nodes.length; j3++) {
31684 id2 = entity.nodes[j3];
31685 for (k2 = 1; k2 < stack.length; k2++) {
31686 var ents = stack[k2].entities;
31687 if (ents.hasOwnProperty(id2) && ents[id2] === void 0) {
31694 for (i3 = 0; i3 < stack.length; i3++) {
31695 stack[i3]._updateRebased();
31698 _updateRebased: function() {
31699 var base = this.base();
31700 Object.keys(this._parentWays).forEach(function(child) {
31701 if (base.parentWays[child]) {
31702 base.parentWays[child].forEach(function(id2) {
31703 if (!this.entities.hasOwnProperty(id2)) {
31704 this._parentWays[child].add(id2);
31709 Object.keys(this._parentRels).forEach(function(child) {
31710 if (base.parentRels[child]) {
31711 base.parentRels[child].forEach(function(id2) {
31712 if (!this.entities.hasOwnProperty(id2)) {
31713 this._parentRels[child].add(id2);
31718 this.transients = {};
31720 // Updates calculated properties (parentWays, parentRels) for the specified change
31721 _updateCalculated: function(oldentity, entity, parentWays, parentRels) {
31722 parentWays = parentWays || this._parentWays;
31723 parentRels = parentRels || this._parentRels;
31724 var type2 = entity && entity.type || oldentity && oldentity.type;
31725 var removed, added, i3;
31726 if (type2 === "way") {
31727 if (oldentity && entity) {
31728 removed = utilArrayDifference(oldentity.nodes, entity.nodes);
31729 added = utilArrayDifference(entity.nodes, oldentity.nodes);
31730 } else if (oldentity) {
31731 removed = oldentity.nodes;
31733 } else if (entity) {
31735 added = entity.nodes;
31737 for (i3 = 0; i3 < removed.length; i3++) {
31738 parentWays[removed[i3]] = new Set(parentWays[removed[i3]]);
31739 parentWays[removed[i3]].delete(oldentity.id);
31741 for (i3 = 0; i3 < added.length; i3++) {
31742 parentWays[added[i3]] = new Set(parentWays[added[i3]]);
31743 parentWays[added[i3]].add(entity.id);
31745 } else if (type2 === "relation") {
31746 var oldentityMemberIDs = oldentity ? oldentity.members.map(function(m2) {
31749 var entityMemberIDs = entity ? entity.members.map(function(m2) {
31752 if (oldentity && entity) {
31753 removed = utilArrayDifference(oldentityMemberIDs, entityMemberIDs);
31754 added = utilArrayDifference(entityMemberIDs, oldentityMemberIDs);
31755 } else if (oldentity) {
31756 removed = oldentityMemberIDs;
31758 } else if (entity) {
31760 added = entityMemberIDs;
31762 for (i3 = 0; i3 < removed.length; i3++) {
31763 parentRels[removed[i3]] = new Set(parentRels[removed[i3]]);
31764 parentRels[removed[i3]].delete(oldentity.id);
31766 for (i3 = 0; i3 < added.length; i3++) {
31767 parentRels[added[i3]] = new Set(parentRels[added[i3]]);
31768 parentRels[added[i3]].add(entity.id);
31772 replace: function(entity) {
31773 if (this.entities[entity.id] === entity)
31775 return this.update(function() {
31776 this._updateCalculated(this.entities[entity.id], entity);
31777 this.entities[entity.id] = entity;
31780 remove: function(entity) {
31781 return this.update(function() {
31782 this._updateCalculated(entity, void 0);
31783 this.entities[entity.id] = void 0;
31786 revert: function(id2) {
31787 var baseEntity = this.base().entities[id2];
31788 var headEntity = this.entities[id2];
31789 if (headEntity === baseEntity)
31791 return this.update(function() {
31792 this._updateCalculated(headEntity, baseEntity);
31793 delete this.entities[id2];
31796 update: function() {
31797 var graph = this.frozen ? coreGraph(this, true) : this;
31798 for (var i3 = 0; i3 < arguments.length; i3++) {
31799 arguments[i3].call(graph, graph);
31802 graph.frozen = true;
31805 // Obliterates any existing entities
31806 load: function(entities) {
31807 var base = this.base();
31808 this.entities = Object.create(base.entities);
31809 for (var i3 in entities) {
31810 this.entities[i3] = entities[i3];
31811 this._updateCalculated(base.entities[i3], this.entities[i3]);
31817 // modules/osm/intersection.js
31818 function osmTurn(turn) {
31819 if (!(this instanceof osmTurn)) {
31820 return new osmTurn(turn);
31822 Object.assign(this, turn);
31824 function osmIntersection(graph, startVertexId, maxDistance) {
31825 maxDistance = maxDistance || 30;
31826 var vgraph = coreGraph();
31828 function memberOfRestriction(entity) {
31829 return graph.parentRelations(entity).some(function(r2) {
31830 return r2.isRestriction();
31833 function isRoad(way2) {
31834 if (way2.isArea() || way2.isDegenerate())
31838 "motorway_link": true,
31840 "trunk_link": true,
31842 "primary_link": true,
31844 "secondary_link": true,
31846 "tertiary_link": true,
31847 "residential": true,
31848 "unclassified": true,
31849 "living_street": true,
31854 return roads[way2.tags.highway];
31856 var startNode = graph.entity(startVertexId);
31857 var checkVertices = [startNode];
31860 var vertexIds = [];
31870 while (checkVertices.length) {
31871 vertex = checkVertices.pop();
31872 checkWays = graph.parentWays(vertex);
31873 var hasWays = false;
31874 for (i3 = 0; i3 < checkWays.length; i3++) {
31875 way = checkWays[i3];
31876 if (!isRoad(way) && !memberOfRestriction(way))
31880 nodes = utilArrayUniq(graph.childNodes(way));
31881 for (j3 = 0; j3 < nodes.length; j3++) {
31883 if (node === vertex)
31885 if (vertices.indexOf(node) !== -1)
31887 if (geoSphericalDistance(node.loc, startNode.loc) > maxDistance)
31889 var hasParents = false;
31890 parents = graph.parentWays(node);
31891 for (k2 = 0; k2 < parents.length; k2++) {
31892 parent = parents[k2];
31893 if (parent === way)
31895 if (ways.indexOf(parent) !== -1)
31897 if (!isRoad(parent))
31903 checkVertices.push(node);
31908 vertices.push(vertex);
31911 vertices = utilArrayUniq(vertices);
31912 ways = utilArrayUniq(ways);
31913 ways.forEach(function(way2) {
31914 graph.childNodes(way2).forEach(function(node2) {
31915 vgraph = vgraph.replace(node2);
31917 vgraph = vgraph.replace(way2);
31918 graph.parentRelations(way2).forEach(function(relation) {
31919 if (relation.isRestriction()) {
31920 if (relation.isValidRestriction(graph)) {
31921 vgraph = vgraph.replace(relation);
31922 } else if (relation.isComplete(graph)) {
31923 actions.push(actionDeleteRelation(relation.id));
31928 ways.forEach(function(w2) {
31929 var way2 = vgraph.entity(w2.id);
31930 if (way2.tags.oneway === "-1") {
31931 var action = actionReverse(way2.id, { reverseOneway: true });
31932 actions.push(action);
31933 vgraph = action(vgraph);
31936 var origCount = osmEntity.id.next.way;
31937 vertices.forEach(function(v2) {
31938 var splitAll = actionSplit([v2.id]).keepHistoryOn("first");
31939 if (!splitAll.disabled(vgraph)) {
31940 splitAll.ways(vgraph).forEach(function(way2) {
31941 var splitOne = actionSplit([v2.id]).limitWays([way2.id]).keepHistoryOn("first");
31942 actions.push(splitOne);
31943 vgraph = splitOne(vgraph);
31947 osmEntity.id.next.way = origCount;
31948 vertexIds = vertices.map(function(v2) {
31953 vertexIds.forEach(function(id2) {
31954 var vertex2 = vgraph.entity(id2);
31955 var parents2 = vgraph.parentWays(vertex2);
31956 vertices.push(vertex2);
31957 ways = ways.concat(parents2);
31959 vertices = utilArrayUniq(vertices);
31960 ways = utilArrayUniq(ways);
31961 vertexIds = vertices.map(function(v2) {
31964 wayIds = ways.map(function(w2) {
31967 function withMetadata(way2, vertexIds2) {
31968 var __oneWay = way2.isOneWay();
31969 var __first = vertexIds2.indexOf(way2.first()) !== -1;
31970 var __last = vertexIds2.indexOf(way2.last()) !== -1;
31971 var __via = __first && __last;
31972 var __from = __first && !__oneWay || __last;
31973 var __to = __first || __last && !__oneWay;
31974 return way2.update({
31984 wayIds.forEach(function(id2) {
31985 var way2 = withMetadata(vgraph.entity(id2), vertexIds);
31986 vgraph = vgraph.replace(way2);
31990 var removeWayIds = [];
31991 var removeVertexIds = [];
31994 checkVertices = vertexIds.slice();
31995 for (i3 = 0; i3 < checkVertices.length; i3++) {
31996 var vertexId = checkVertices[i3];
31997 vertex = vgraph.hasEntity(vertexId);
31999 if (vertexIds.indexOf(vertexId) !== -1) {
32000 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
32002 removeVertexIds.push(vertexId);
32005 parents = vgraph.parentWays(vertex);
32006 if (parents.length < 3) {
32007 if (vertexIds.indexOf(vertexId) !== -1) {
32008 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
32011 if (parents.length === 2) {
32012 var a2 = parents[0];
32013 var b2 = parents[1];
32014 var aIsLeaf = a2 && !a2.__via;
32015 var bIsLeaf = b2 && !b2.__via;
32016 var leaf, survivor;
32017 if (aIsLeaf && !bIsLeaf) {
32020 } else if (!aIsLeaf && bIsLeaf) {
32024 if (leaf && survivor) {
32025 survivor = withMetadata(survivor, vertexIds);
32026 vgraph = vgraph.replace(survivor).remove(leaf);
32027 removeWayIds.push(leaf.id);
32031 parents = vgraph.parentWays(vertex);
32032 if (parents.length < 2) {
32033 if (vertexIds.indexOf(vertexId) !== -1) {
32034 vertexIds.splice(vertexIds.indexOf(vertexId), 1);
32036 removeVertexIds.push(vertexId);
32039 if (parents.length < 1) {
32040 vgraph = vgraph.remove(vertex);
32043 } while (keepGoing);
32044 vertices = vertices.filter(function(vertex2) {
32045 return removeVertexIds.indexOf(vertex2.id) === -1;
32046 }).map(function(vertex2) {
32047 return vgraph.entity(vertex2.id);
32049 ways = ways.filter(function(way2) {
32050 return removeWayIds.indexOf(way2.id) === -1;
32051 }).map(function(way2) {
32052 return vgraph.entity(way2.id);
32054 var intersection = {
32060 intersection.turns = function(fromWayId, maxViaWay) {
32065 var vgraph2 = intersection.graph;
32066 var keyVertexIds = intersection.vertices.map(function(v2) {
32069 var start2 = vgraph2.entity(fromWayId);
32070 if (!start2 || !(start2.__from || start2.__via))
32072 var maxPathLength = maxViaWay * 2 + 3;
32076 function step(entity, currPath, currRestrictions, matchedRestriction) {
32077 currPath = (currPath || []).slice();
32078 if (currPath.length >= maxPathLength)
32080 currPath.push(entity.id);
32081 currRestrictions = (currRestrictions || []).slice();
32082 if (entity.type === "node") {
32083 stepNode(entity, currPath, currRestrictions);
32085 stepWay(entity, currPath, currRestrictions, matchedRestriction);
32088 function stepNode(entity, currPath, currRestrictions) {
32090 var parents2 = vgraph2.parentWays(entity);
32092 for (i4 = 0; i4 < parents2.length; i4++) {
32093 var way2 = parents2[i4];
32094 if (way2.__oneWay && way2.nodes[0] !== entity.id)
32096 if (currPath.indexOf(way2.id) !== -1 && currPath.length >= 3)
32098 var restrict = null;
32099 for (j4 = 0; j4 < currRestrictions.length; j4++) {
32100 var restriction = currRestrictions[j4];
32101 var f3 = restriction.memberByRole("from");
32102 var v2 = restriction.membersByRole("via");
32103 var t2 = restriction.memberByRole("to");
32104 var isNo = /^no_/.test(restriction.tags.restriction);
32105 var isOnly = /^only_/.test(restriction.tags.restriction);
32106 if (!(isNo || isOnly)) {
32109 var matchesFrom = f3.id === fromWayId;
32110 var matchesViaTo = false;
32111 var isAlongOnlyPath = false;
32112 if (t2.id === way2.id) {
32113 if (v2.length === 1 && v2[0].type === "node") {
32114 matchesViaTo = v2[0].id === entity.id && (matchesFrom && currPath.length === 2 || !matchesFrom && currPath.length > 2);
32117 for (k2 = 2; k2 < currPath.length; k2 += 2) {
32118 pathVias.push(currPath[k2]);
32120 var restrictionVias = [];
32121 for (k2 = 0; k2 < v2.length; k2++) {
32122 if (v2[k2].type === "way") {
32123 restrictionVias.push(v2[k2].id);
32126 var diff = utilArrayDifference(pathVias, restrictionVias);
32127 matchesViaTo = !diff.length;
32129 } else if (isOnly) {
32130 for (k2 = 0; k2 < v2.length; k2++) {
32131 if (v2[k2].type === "way" && v2[k2].id === way2.id) {
32132 isAlongOnlyPath = true;
32137 if (matchesViaTo) {
32139 restrict = { id: restriction.id, direct: matchesFrom, from: f3.id, only: true, end: true };
32141 restrict = { id: restriction.id, direct: matchesFrom, from: f3.id, no: true, end: true };
32144 if (isAlongOnlyPath) {
32145 restrict = { id: restriction.id, direct: false, from: f3.id, only: true, end: false };
32146 } else if (isOnly) {
32147 restrict = { id: restriction.id, direct: false, from: f3.id, no: true, end: true };
32150 if (restrict && restrict.direct)
32153 nextWays.push({ way: way2, restrict });
32155 nextWays.forEach(function(nextWay) {
32156 step(nextWay.way, currPath, currRestrictions, nextWay.restrict);
32159 function stepWay(entity, currPath, currRestrictions, matchedRestriction) {
32161 if (currPath.length >= 3) {
32162 var turnPath = currPath.slice();
32163 if (matchedRestriction && matchedRestriction.direct === false) {
32164 for (i4 = 0; i4 < turnPath.length; i4++) {
32165 if (turnPath[i4] === matchedRestriction.from) {
32166 turnPath = turnPath.slice(i4);
32171 var turn = pathToTurn(turnPath);
32173 if (matchedRestriction) {
32174 turn.restrictionID = matchedRestriction.id;
32175 turn.no = matchedRestriction.no;
32176 turn.only = matchedRestriction.only;
32177 turn.direct = matchedRestriction.direct;
32179 turns.push(osmTurn(turn));
32181 if (currPath[0] === currPath[2])
32184 if (matchedRestriction && matchedRestriction.end)
32186 var n1 = vgraph2.entity(entity.first());
32187 var n22 = vgraph2.entity(entity.last());
32188 var dist = geoSphericalDistance(n1.loc, n22.loc);
32189 var nextNodes = [];
32190 if (currPath.length > 1) {
32191 if (dist > maxDistance)
32196 if (!entity.__oneWay && // bidirectional..
32197 keyVertexIds.indexOf(n1.id) !== -1 && // key vertex..
32198 currPath.indexOf(n1.id) === -1) {
32199 nextNodes.push(n1);
32201 if (keyVertexIds.indexOf(n22.id) !== -1 && // key vertex..
32202 currPath.indexOf(n22.id) === -1) {
32203 nextNodes.push(n22);
32205 nextNodes.forEach(function(nextNode) {
32206 var fromRestrictions = vgraph2.parentRelations(entity).filter(function(r2) {
32207 if (!r2.isRestriction())
32209 var f3 = r2.memberByRole("from");
32210 if (!f3 || f3.id !== entity.id)
32212 var isOnly = /^only_/.test(r2.tags.restriction);
32215 var isOnlyVia = false;
32216 var v2 = r2.membersByRole("via");
32217 if (v2.length === 1 && v2[0].type === "node") {
32218 isOnlyVia = v2[0].id === nextNode.id;
32220 for (var i5 = 0; i5 < v2.length; i5++) {
32221 if (v2[i5].type !== "way")
32223 var viaWay = vgraph2.entity(v2[i5].id);
32224 if (viaWay.first() === nextNode.id || viaWay.last() === nextNode.id) {
32232 step(nextNode, currPath, currRestrictions.concat(fromRestrictions), false);
32235 function pathToTurn(path) {
32236 if (path.length < 3)
32238 var fromWayId2, fromNodeId, fromVertexId;
32239 var toWayId, toNodeId, toVertexId;
32240 var viaWayIds, viaNodeId, isUturn;
32241 fromWayId2 = path[0];
32242 toWayId = path[path.length - 1];
32243 if (path.length === 3 && fromWayId2 === toWayId) {
32244 var way2 = vgraph2.entity(fromWayId2);
32248 viaNodeId = fromVertexId = toVertexId = path[1];
32249 fromNodeId = toNodeId = adjacentNode(fromWayId2, viaNodeId);
32252 fromVertexId = path[1];
32253 fromNodeId = adjacentNode(fromWayId2, fromVertexId);
32254 toVertexId = path[path.length - 2];
32255 toNodeId = adjacentNode(toWayId, toVertexId);
32256 if (path.length === 3) {
32257 viaNodeId = path[1];
32259 viaWayIds = path.filter(function(entityId) {
32260 return entityId[0] === "w";
32262 viaWayIds = viaWayIds.slice(1, viaWayIds.length - 1);
32266 key: path.join("_"),
32268 from: { node: fromNodeId, way: fromWayId2, vertex: fromVertexId },
32269 via: { node: viaNodeId, ways: viaWayIds },
32270 to: { node: toNodeId, way: toWayId, vertex: toVertexId },
32273 function adjacentNode(wayId, affixId) {
32274 var nodes2 = vgraph2.entity(wayId).nodes;
32275 return affixId === nodes2[0] ? nodes2[1] : nodes2[nodes2.length - 2];
32279 return intersection;
32281 function osmInferRestriction(graph, turn, projection2) {
32282 var fromWay = graph.entity(turn.from.way);
32283 var fromNode = graph.entity(turn.from.node);
32284 var fromVertex = graph.entity(turn.from.vertex);
32285 var toWay = graph.entity(turn.to.way);
32286 var toNode = graph.entity(turn.to.node);
32287 var toVertex = graph.entity(turn.to.vertex);
32288 var fromOneWay = fromWay.tags.oneway === "yes";
32289 var toOneWay = toWay.tags.oneway === "yes";
32290 var angle2 = (geoAngle(fromVertex, fromNode, projection2) - geoAngle(toVertex, toNode, projection2)) * 180 / Math.PI;
32291 while (angle2 < 0) {
32294 if (fromNode === toNode) {
32295 return "no_u_turn";
32297 if ((angle2 < 23 || angle2 > 336) && fromOneWay && toOneWay) {
32298 return "no_u_turn";
32300 if ((angle2 < 40 || angle2 > 319) && fromOneWay && toOneWay && turn.from.vertex !== turn.to.vertex) {
32301 return "no_u_turn";
32303 if (angle2 < 158) {
32304 return "no_right_turn";
32306 if (angle2 > 202) {
32307 return "no_left_turn";
32309 return "no_straight_on";
32312 // modules/actions/merge_polygon.js
32313 function actionMergePolygon(ids, newRelationId) {
32314 function groupEntities(graph) {
32315 var entities = ids.map(function(id2) {
32316 return graph.entity(id2);
32318 var geometryGroups = utilArrayGroupBy(entities, function(entity) {
32319 if (entity.type === "way" && entity.isClosed()) {
32320 return "closedWay";
32321 } else if (entity.type === "relation" && entity.isMultipolygon()) {
32322 return "multipolygon";
32327 return Object.assign(
32328 { closedWay: [], multipolygon: [], other: [] },
32332 var action = function(graph) {
32333 var entities = groupEntities(graph);
32334 var polygons = entities.multipolygon.reduce(function(polygons2, m2) {
32335 return polygons2.concat(osmJoinWays(m2.members, graph));
32336 }, []).concat(entities.closedWay.map(function(d2) {
32337 var member = [{ id: d2.id }];
32338 member.nodes = graph.childNodes(d2);
32341 var contained = polygons.map(function(w2, i3) {
32342 return polygons.map(function(d2, n3) {
32345 return geoPolygonContainsPolygon(
32346 d2.nodes.map(function(n4) {
32349 w2.nodes.map(function(n4) {
32357 while (polygons.length) {
32358 extractUncontained(polygons);
32359 polygons = polygons.filter(isContained);
32360 contained = contained.filter(isContained).map(filterContained);
32362 function isContained(d2, i3) {
32363 return contained[i3].some(function(val) {
32367 function filterContained(d2) {
32368 return d2.filter(isContained);
32370 function extractUncontained(polygons2) {
32371 polygons2.forEach(function(d2, i3) {
32372 if (!isContained(d2, i3)) {
32373 d2.forEach(function(member) {
32377 role: outer ? "outer" : "inner"
32385 if (entities.multipolygon.length > 0) {
32386 var oldestID = utilOldestID(entities.multipolygon.map((entity) => entity.id));
32387 relation = entities.multipolygon.find((entity) => entity.id === oldestID);
32389 relation = osmRelation({ id: newRelationId, tags: { type: "multipolygon" } });
32391 entities.multipolygon.forEach(function(m2) {
32392 if (m2.id !== relation.id) {
32393 relation = relation.mergeTags(m2.tags);
32394 graph = graph.remove(m2);
32397 entities.closedWay.forEach(function(way) {
32398 function isThisOuter(m2) {
32399 return m2.id === way.id && m2.role !== "inner";
32401 if (members.some(isThisOuter)) {
32402 relation = relation.mergeTags(way.tags);
32403 graph = graph.replace(way.update({ tags: {} }));
32406 return graph.replace(relation.update({
32408 tags: utilObjectOmit(relation.tags, ["area"])
32411 action.disabled = function(graph) {
32412 var entities = groupEntities(graph);
32413 if (entities.other.length > 0 || entities.closedWay.length + entities.multipolygon.length < 2) {
32414 return "not_eligible";
32416 if (!entities.multipolygon.every(function(r2) {
32417 return r2.isComplete(graph);
32419 return "incomplete_relation";
32421 if (!entities.multipolygon.length) {
32422 var sharedMultipolygons = [];
32423 entities.closedWay.forEach(function(way, i3) {
32425 sharedMultipolygons = graph.parentMultipolygons(way);
32427 sharedMultipolygons = utilArrayIntersection(sharedMultipolygons, graph.parentMultipolygons(way));
32430 sharedMultipolygons = sharedMultipolygons.filter(function(relation) {
32431 return relation.members.length === entities.closedWay.length;
32433 if (sharedMultipolygons.length) {
32434 return "not_eligible";
32436 } else if (entities.closedWay.some(function(way) {
32437 return utilArrayIntersection(graph.parentMultipolygons(way), entities.multipolygon).length;
32439 return "not_eligible";
32445 // modules/actions/merge_remote_changes.js
32446 var import_fast_deep_equal = __toESM(require_fast_deep_equal());
32448 // node_modules/node-diff3/index.mjs
32449 function LCS(buffer1, buffer2) {
32450 let equivalenceClasses = {};
32451 for (let j3 = 0; j3 < buffer2.length; j3++) {
32452 const item = buffer2[j3];
32453 if (equivalenceClasses[item]) {
32454 equivalenceClasses[item].push(j3);
32456 equivalenceClasses[item] = [j3];
32459 const NULLRESULT = { buffer1index: -1, buffer2index: -1, chain: null };
32460 let candidates = [NULLRESULT];
32461 for (let i3 = 0; i3 < buffer1.length; i3++) {
32462 const item = buffer1[i3];
32463 const buffer2indices = equivalenceClasses[item] || [];
32465 let c2 = candidates[0];
32466 for (let jx = 0; jx < buffer2indices.length; jx++) {
32467 const j3 = buffer2indices[jx];
32469 for (s2 = r2; s2 < candidates.length; s2++) {
32470 if (candidates[s2].buffer2index < j3 && (s2 === candidates.length - 1 || candidates[s2 + 1].buffer2index > j3)) {
32474 if (s2 < candidates.length) {
32475 const newCandidate = { buffer1index: i3, buffer2index: j3, chain: candidates[s2] };
32476 if (r2 === candidates.length) {
32477 candidates.push(c2);
32479 candidates[r2] = c2;
32483 if (r2 === candidates.length) {
32488 candidates[r2] = c2;
32490 return candidates[candidates.length - 1];
32492 function diffIndices(buffer1, buffer2) {
32493 const lcs = LCS(buffer1, buffer2);
32495 let tail1 = buffer1.length;
32496 let tail2 = buffer2.length;
32497 for (let candidate = lcs; candidate !== null; candidate = candidate.chain) {
32498 const mismatchLength1 = tail1 - candidate.buffer1index - 1;
32499 const mismatchLength2 = tail2 - candidate.buffer2index - 1;
32500 tail1 = candidate.buffer1index;
32501 tail2 = candidate.buffer2index;
32502 if (mismatchLength1 || mismatchLength2) {
32504 buffer1: [tail1 + 1, mismatchLength1],
32505 buffer1Content: buffer1.slice(tail1 + 1, tail1 + 1 + mismatchLength1),
32506 buffer2: [tail2 + 1, mismatchLength2],
32507 buffer2Content: buffer2.slice(tail2 + 1, tail2 + 1 + mismatchLength2)
32514 function diff3MergeRegions(a2, o2, b2) {
32516 function addHunk(h2, ab) {
32519 oStart: h2.buffer1[0],
32520 oLength: h2.buffer1[1],
32521 // length of o to remove
32522 abStart: h2.buffer2[0],
32523 abLength: h2.buffer2[1]
32524 // length of a/b to insert
32525 // abContent: (ab === 'a' ? a : b).slice(h.buffer2[0], h.buffer2[0] + h.buffer2[1])
32528 diffIndices(o2, a2).forEach((item) => addHunk(item, "a"));
32529 diffIndices(o2, b2).forEach((item) => addHunk(item, "b"));
32530 hunks.sort((x2, y2) => x2.oStart - y2.oStart);
32532 let currOffset = 0;
32533 function advanceTo(endOffset) {
32534 if (endOffset > currOffset) {
32538 bufferStart: currOffset,
32539 bufferLength: endOffset - currOffset,
32540 bufferContent: o2.slice(currOffset, endOffset)
32542 currOffset = endOffset;
32545 while (hunks.length) {
32546 let hunk = hunks.shift();
32547 let regionStart = hunk.oStart;
32548 let regionEnd = hunk.oStart + hunk.oLength;
32549 let regionHunks = [hunk];
32550 advanceTo(regionStart);
32551 while (hunks.length) {
32552 const nextHunk = hunks[0];
32553 const nextHunkStart = nextHunk.oStart;
32554 if (nextHunkStart > regionEnd)
32556 regionEnd = Math.max(regionEnd, nextHunkStart + nextHunk.oLength);
32557 regionHunks.push(hunks.shift());
32559 if (regionHunks.length === 1) {
32560 if (hunk.abLength > 0) {
32561 const buffer = hunk.ab === "a" ? a2 : b2;
32565 bufferStart: hunk.abStart,
32566 bufferLength: hunk.abLength,
32567 bufferContent: buffer.slice(hunk.abStart, hunk.abStart + hunk.abLength)
32572 a: [a2.length, -1, o2.length, -1],
32573 b: [b2.length, -1, o2.length, -1]
32575 while (regionHunks.length) {
32576 hunk = regionHunks.shift();
32577 const oStart = hunk.oStart;
32578 const oEnd = oStart + hunk.oLength;
32579 const abStart = hunk.abStart;
32580 const abEnd = abStart + hunk.abLength;
32581 let b3 = bounds[hunk.ab];
32582 b3[0] = Math.min(abStart, b3[0]);
32583 b3[1] = Math.max(abEnd, b3[1]);
32584 b3[2] = Math.min(oStart, b3[2]);
32585 b3[3] = Math.max(oEnd, b3[3]);
32587 const aStart = bounds.a[0] + (regionStart - bounds.a[2]);
32588 const aEnd = bounds.a[1] + (regionEnd - bounds.a[3]);
32589 const bStart = bounds.b[0] + (regionStart - bounds.b[2]);
32590 const bEnd = bounds.b[1] + (regionEnd - bounds.b[3]);
32594 aLength: aEnd - aStart,
32595 aContent: a2.slice(aStart, aEnd),
32596 oStart: regionStart,
32597 oLength: regionEnd - regionStart,
32598 oContent: o2.slice(regionStart, regionEnd),
32600 bLength: bEnd - bStart,
32601 bContent: b2.slice(bStart, bEnd)
32603 results.push(result);
32605 currOffset = regionEnd;
32607 advanceTo(o2.length);
32610 function diff3Merge(a2, o2, b2, options2) {
32612 excludeFalseConflicts: true,
32613 stringSeparator: /\s+/
32615 options2 = Object.assign(defaults, options2);
32616 if (typeof a2 === "string")
32617 a2 = a2.split(options2.stringSeparator);
32618 if (typeof o2 === "string")
32619 o2 = o2.split(options2.stringSeparator);
32620 if (typeof b2 === "string")
32621 b2 = b2.split(options2.stringSeparator);
32623 const regions = diff3MergeRegions(a2, o2, b2);
32625 function flushOk() {
32626 if (okBuffer.length) {
32627 results.push({ ok: okBuffer });
32631 function isFalseConflict(a3, b3) {
32632 if (a3.length !== b3.length)
32634 for (let i3 = 0; i3 < a3.length; i3++) {
32635 if (a3[i3] !== b3[i3])
32640 regions.forEach((region) => {
32641 if (region.stable) {
32642 okBuffer.push(...region.bufferContent);
32644 if (options2.excludeFalseConflicts && isFalseConflict(region.aContent, region.bContent)) {
32645 okBuffer.push(...region.aContent);
32650 a: region.aContent,
32651 aIndex: region.aStart,
32652 o: region.oContent,
32653 oIndex: region.oStart,
32654 b: region.bContent,
32655 bIndex: region.bStart
32665 // modules/actions/merge_remote_changes.js
32666 var import_lodash2 = __toESM(require_lodash());
32667 function actionMergeRemoteChanges(id2, localGraph, remoteGraph, discardTags, formatUser) {
32668 discardTags = discardTags || {};
32669 var _option = "safe";
32670 var _conflicts = [];
32671 function user(d2) {
32672 return typeof formatUser === "function" ? formatUser(d2) : (0, import_lodash2.escape)(d2);
32674 function mergeLocation(remote, target) {
32675 function pointEqual(a2, b2) {
32676 var epsilon3 = 1e-6;
32677 return Math.abs(a2[0] - b2[0]) < epsilon3 && Math.abs(a2[1] - b2[1]) < epsilon3;
32679 if (_option === "force_local" || pointEqual(target.loc, remote.loc)) {
32682 if (_option === "force_remote") {
32683 return target.update({ loc: remote.loc });
32685 _conflicts.push(_t.html("merge_remote_changes.conflict.location", { user: { html: user(remote.user) } }));
32688 function mergeNodes(base, remote, target) {
32689 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.nodes, remote.nodes)) {
32692 if (_option === "force_remote") {
32693 return target.update({ nodes: remote.nodes });
32695 var ccount = _conflicts.length;
32696 var o2 = base.nodes || [];
32697 var a2 = target.nodes || [];
32698 var b2 = remote.nodes || [];
32700 var hunks = diff3Merge(a2, o2, b2, { excludeFalseConflicts: true });
32701 for (var i3 = 0; i3 < hunks.length; i3++) {
32702 var hunk = hunks[i3];
32704 nodes.push.apply(nodes, hunk.ok);
32706 var c2 = hunk.conflict;
32707 if ((0, import_fast_deep_equal.default)(c2.o, c2.a)) {
32708 nodes.push.apply(nodes, c2.b);
32709 } else if ((0, import_fast_deep_equal.default)(c2.o, c2.b)) {
32710 nodes.push.apply(nodes, c2.a);
32712 _conflicts.push(_t.html("merge_remote_changes.conflict.nodelist", { user: { html: user(remote.user) } }));
32717 return _conflicts.length === ccount ? target.update({ nodes }) : target;
32719 function mergeChildren(targetWay, children2, updates, graph) {
32720 function isUsed(node2, targetWay2) {
32721 var hasInterestingParent = graph.parentWays(node2).some(function(way) {
32722 return way.id !== targetWay2.id;
32724 return node2.hasInterestingTags() || hasInterestingParent || graph.parentRelations(node2).length > 0;
32726 var ccount = _conflicts.length;
32727 for (var i3 = 0; i3 < children2.length; i3++) {
32728 var id3 = children2[i3];
32729 var node = graph.hasEntity(id3);
32730 if (targetWay.nodes.indexOf(id3) === -1) {
32731 if (node && !isUsed(node, targetWay)) {
32732 updates.removeIds.push(id3);
32736 var local = localGraph.hasEntity(id3);
32737 var remote = remoteGraph.hasEntity(id3);
32739 if (_option === "force_remote" && remote && remote.visible) {
32740 updates.replacements.push(remote);
32741 } else if (_option === "force_local" && local) {
32742 target = osmEntity(local);
32744 target = target.update({ version: remote.version });
32746 updates.replacements.push(target);
32747 } else if (_option === "safe" && local && remote && local.version !== remote.version) {
32748 target = osmEntity(local, { version: remote.version });
32749 if (remote.visible) {
32750 target = mergeLocation(remote, target);
32752 _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
32754 if (_conflicts.length !== ccount)
32756 updates.replacements.push(target);
32761 function updateChildren(updates, graph) {
32762 for (var i3 = 0; i3 < updates.replacements.length; i3++) {
32763 graph = graph.replace(updates.replacements[i3]);
32765 if (updates.removeIds.length) {
32766 graph = actionDeleteMultiple(updates.removeIds)(graph);
32770 function mergeMembers(remote, target) {
32771 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.members, remote.members)) {
32774 if (_option === "force_remote") {
32775 return target.update({ members: remote.members });
32777 _conflicts.push(_t.html("merge_remote_changes.conflict.memberlist", { user: { html: user(remote.user) } }));
32780 function mergeTags(base, remote, target) {
32781 if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.tags, remote.tags)) {
32784 if (_option === "force_remote") {
32785 return target.update({ tags: remote.tags });
32787 var ccount = _conflicts.length;
32788 var o2 = base.tags || {};
32789 var a2 = target.tags || {};
32790 var b2 = remote.tags || {};
32791 var keys2 = utilArrayUnion(utilArrayUnion(Object.keys(o2), Object.keys(a2)), Object.keys(b2)).filter(function(k3) {
32792 return !discardTags[k3];
32794 var tags = Object.assign({}, a2);
32795 var changed = false;
32796 for (var i3 = 0; i3 < keys2.length; i3++) {
32797 var k2 = keys2[i3];
32798 if (o2[k2] !== b2[k2] && a2[k2] !== b2[k2]) {
32799 if (o2[k2] !== a2[k2]) {
32800 _conflicts.push(_t.html(
32801 "merge_remote_changes.conflict.tags",
32802 { tag: k2, local: a2[k2], remote: b2[k2], user: { html: user(remote.user) } }
32805 if (b2.hasOwnProperty(k2)) {
32814 return changed && _conflicts.length === ccount ? target.update({ tags }) : target;
32816 var action = function(graph) {
32817 var updates = { replacements: [], removeIds: [] };
32818 var base = graph.base().entities[id2];
32819 var local = localGraph.entity(id2);
32820 var remote = remoteGraph.entity(id2);
32821 var target = osmEntity(local, { version: remote.version });
32822 if (!remote.visible) {
32823 if (_option === "force_remote") {
32824 return actionDeleteMultiple([id2])(graph);
32825 } else if (_option === "force_local") {
32826 if (target.type === "way") {
32827 target = mergeChildren(target, utilArrayUniq(local.nodes), updates, graph);
32828 graph = updateChildren(updates, graph);
32830 return graph.replace(target);
32832 _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
32836 if (target.type === "node") {
32837 target = mergeLocation(remote, target);
32838 } else if (target.type === "way") {
32839 graph.rebase(remoteGraph.childNodes(remote), [graph], false);
32840 target = mergeNodes(base, remote, target);
32841 target = mergeChildren(target, utilArrayUnion(local.nodes, remote.nodes), updates, graph);
32842 } else if (target.type === "relation") {
32843 target = mergeMembers(remote, target);
32845 target = mergeTags(base, remote, target);
32846 if (!_conflicts.length) {
32847 graph = updateChildren(updates, graph).replace(target);
32851 action.withOption = function(opt) {
32855 action.conflicts = function() {
32861 // modules/actions/move.js
32862 function actionMove(moveIDs, tryDelta, projection2, cache) {
32863 var _delta = tryDelta;
32864 function setupCache(graph) {
32865 function canMove(nodeID) {
32866 if (moveIDs.indexOf(nodeID) !== -1)
32868 var parents = graph.parentWays(graph.entity(nodeID));
32869 if (parents.length < 3)
32871 var parentsMoving = parents.every(function(way) {
32872 return cache.moving[way.id];
32874 if (!parentsMoving)
32875 delete cache.moving[nodeID];
32876 return parentsMoving;
32878 function cacheEntities(ids) {
32879 for (var i3 = 0; i3 < ids.length; i3++) {
32881 if (cache.moving[id2])
32883 cache.moving[id2] = true;
32884 var entity = graph.hasEntity(id2);
32887 if (entity.type === "node") {
32888 cache.nodes.push(id2);
32889 cache.startLoc[id2] = entity.loc;
32890 } else if (entity.type === "way") {
32891 cache.ways.push(id2);
32892 cacheEntities(entity.nodes);
32894 cacheEntities(entity.members.map(function(member) {
32900 function cacheIntersections(ids) {
32901 function isEndpoint(way2, id3) {
32902 return !way2.isClosed() && !!way2.affix(id3);
32904 for (var i3 = 0; i3 < ids.length; i3++) {
32906 var childNodes = graph.childNodes(graph.entity(id2));
32907 for (var j3 = 0; j3 < childNodes.length; j3++) {
32908 var node = childNodes[j3];
32909 var parents = graph.parentWays(node);
32910 if (parents.length !== 2)
32912 var moved = graph.entity(id2);
32913 var unmoved = null;
32914 for (var k2 = 0; k2 < parents.length; k2++) {
32915 var way = parents[k2];
32916 if (!cache.moving[way.id]) {
32923 if (utilArrayIntersection(moved.nodes, unmoved.nodes).length > 2)
32925 if (moved.isArea() || unmoved.isArea())
32927 cache.intersections.push({
32930 unmovedId: unmoved.id,
32931 movedIsEP: isEndpoint(moved, node.id),
32932 unmovedIsEP: isEndpoint(unmoved, node.id)
32942 cache.intersections = [];
32943 cache.replacedVertex = {};
32944 cache.startLoc = {};
32947 cacheEntities(moveIDs);
32948 cacheIntersections(cache.ways);
32949 cache.nodes = cache.nodes.filter(canMove);
32953 function replaceMovedVertex(nodeId, wayId, graph, delta) {
32954 var way = graph.entity(wayId);
32955 var moved = graph.entity(nodeId);
32956 var movedIndex = way.nodes.indexOf(nodeId);
32957 var len, prevIndex, nextIndex;
32958 if (way.isClosed()) {
32959 len = way.nodes.length - 1;
32960 prevIndex = (movedIndex + len - 1) % len;
32961 nextIndex = (movedIndex + len + 1) % len;
32963 len = way.nodes.length;
32964 prevIndex = movedIndex - 1;
32965 nextIndex = movedIndex + 1;
32967 var prev = graph.hasEntity(way.nodes[prevIndex]);
32968 var next = graph.hasEntity(way.nodes[nextIndex]);
32969 if (!prev || !next)
32971 var key = wayId + "_" + nodeId;
32972 var orig = cache.replacedVertex[key];
32975 cache.replacedVertex[key] = orig;
32976 cache.startLoc[orig.id] = cache.startLoc[nodeId];
32980 start2 = projection2(cache.startLoc[nodeId]);
32981 end = projection2.invert(geoVecAdd(start2, delta));
32983 end = cache.startLoc[nodeId];
32985 orig = orig.move(end);
32986 var angle2 = Math.abs(geoAngle(orig, prev, projection2) - geoAngle(orig, next, projection2)) * 180 / Math.PI;
32987 if (angle2 > 175 && angle2 < 185)
32989 var p1 = [prev.loc, orig.loc, moved.loc, next.loc].map(projection2);
32990 var p2 = [prev.loc, moved.loc, orig.loc, next.loc].map(projection2);
32991 var d1 = geoPathLength(p1);
32992 var d2 = geoPathLength(p2);
32993 var insertAt = d1 <= d2 ? movedIndex : nextIndex;
32994 if (way.isClosed() && insertAt === 0)
32996 way = way.addNode(orig.id, insertAt);
32997 return graph.replace(orig).replace(way);
32999 function removeDuplicateVertices(wayId, graph) {
33000 var way = graph.entity(wayId);
33001 var epsilon3 = 1e-6;
33003 function isInteresting(node, graph2) {
33004 return graph2.parentWays(node).length > 1 || graph2.parentRelations(node).length || node.hasInterestingTags();
33006 for (var i3 = 0; i3 < way.nodes.length; i3++) {
33007 curr = graph.entity(way.nodes[i3]);
33008 if (prev && curr && geoVecEqual(prev.loc, curr.loc, epsilon3)) {
33009 if (!isInteresting(prev, graph)) {
33010 way = way.removeNode(prev.id);
33011 graph = graph.replace(way).remove(prev);
33012 } else if (!isInteresting(curr, graph)) {
33013 way = way.removeNode(curr.id);
33014 graph = graph.replace(way).remove(curr);
33021 function unZorroIntersection(intersection, graph) {
33022 var vertex = graph.entity(intersection.nodeId);
33023 var way1 = graph.entity(intersection.movedId);
33024 var way2 = graph.entity(intersection.unmovedId);
33025 var isEP1 = intersection.movedIsEP;
33026 var isEP2 = intersection.unmovedIsEP;
33027 if (isEP1 && isEP2)
33029 var nodes1 = graph.childNodes(way1).filter(function(n3) {
33030 return n3 !== vertex;
33032 var nodes2 = graph.childNodes(way2).filter(function(n3) {
33033 return n3 !== vertex;
33035 if (way1.isClosed() && way1.first() === vertex.id)
33036 nodes1.push(nodes1[0]);
33037 if (way2.isClosed() && way2.first() === vertex.id)
33038 nodes2.push(nodes2[0]);
33039 var edge1 = !isEP1 && geoChooseEdge(nodes1, projection2(vertex.loc), projection2);
33040 var edge2 = !isEP2 && geoChooseEdge(nodes2, projection2(vertex.loc), projection2);
33042 if (!isEP1 && !isEP2) {
33043 var epsilon3 = 1e-6, maxIter = 10;
33044 for (var i3 = 0; i3 < maxIter; i3++) {
33045 loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);
33046 edge1 = geoChooseEdge(nodes1, projection2(loc), projection2);
33047 edge2 = geoChooseEdge(nodes2, projection2(loc), projection2);
33048 if (Math.abs(edge1.distance - edge2.distance) < epsilon3)
33051 } else if (!isEP1) {
33056 graph = graph.replace(vertex.move(loc));
33057 if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {
33058 way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);
33059 graph = graph.replace(way1);
33061 if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {
33062 way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);
33063 graph = graph.replace(way2);
33067 function cleanupIntersections(graph) {
33068 for (var i3 = 0; i3 < cache.intersections.length; i3++) {
33069 var obj = cache.intersections[i3];
33070 graph = replaceMovedVertex(obj.nodeId, obj.movedId, graph, _delta);
33071 graph = replaceMovedVertex(obj.nodeId, obj.unmovedId, graph, null);
33072 graph = unZorroIntersection(obj, graph);
33073 graph = removeDuplicateVertices(obj.movedId, graph);
33074 graph = removeDuplicateVertices(obj.unmovedId, graph);
33078 function limitDelta(graph) {
33079 function moveNode(loc) {
33080 return geoVecAdd(projection2(loc), _delta);
33082 for (var i3 = 0; i3 < cache.intersections.length; i3++) {
33083 var obj = cache.intersections[i3];
33084 if (obj.movedIsEP && obj.unmovedIsEP)
33086 if (!obj.movedIsEP)
33088 var node = graph.entity(obj.nodeId);
33089 var start2 = projection2(node.loc);
33090 var end = geoVecAdd(start2, _delta);
33091 var movedNodes = graph.childNodes(graph.entity(obj.movedId));
33092 var movedPath = movedNodes.map(function(n3) {
33093 return moveNode(n3.loc);
33095 var unmovedNodes = graph.childNodes(graph.entity(obj.unmovedId));
33096 var unmovedPath = unmovedNodes.map(function(n3) {
33097 return projection2(n3.loc);
33099 var hits = geoPathIntersections(movedPath, unmovedPath);
33100 for (var j3 = 0; i3 < hits.length; i3++) {
33101 if (geoVecEqual(hits[j3], end))
33103 var edge = geoChooseEdge(unmovedNodes, end, projection2);
33104 _delta = geoVecSubtract(projection2(edge.loc), start2);
33108 var action = function(graph) {
33109 if (_delta[0] === 0 && _delta[1] === 0)
33112 if (cache.intersections.length) {
33115 for (var i3 = 0; i3 < cache.nodes.length; i3++) {
33116 var node = graph.entity(cache.nodes[i3]);
33117 var start2 = projection2(node.loc);
33118 var end = geoVecAdd(start2, _delta);
33119 graph = graph.replace(node.move(projection2.invert(end)));
33121 if (cache.intersections.length) {
33122 graph = cleanupIntersections(graph);
33126 action.delta = function() {
33132 // modules/actions/move_member.js
33133 function actionMoveMember(relationId, fromIndex, toIndex) {
33134 return function(graph) {
33135 return graph.replace(graph.entity(relationId).moveMember(fromIndex, toIndex));
33139 // modules/actions/move_node.js
33140 function actionMoveNode(nodeID, toLoc) {
33141 var action = function(graph, t2) {
33142 if (t2 === null || !isFinite(t2))
33144 t2 = Math.min(Math.max(+t2, 0), 1);
33145 var node = graph.entity(nodeID);
33146 return graph.replace(
33147 node.move(geoVecInterp(node.loc, toLoc, t2))
33150 action.transitionable = true;
33154 // modules/actions/noop.js
33155 function actionNoop() {
33156 return function(graph) {
33161 // modules/actions/orthogonalize.js
33162 function actionOrthogonalize(wayID, projection2, vertexID, degThresh, ep) {
33163 var epsilon3 = ep || 1e-4;
33164 var threshold = degThresh || 13;
33165 var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
33166 var upperThreshold = Math.cos(threshold * Math.PI / 180);
33167 var action = function(graph, t2) {
33168 if (t2 === null || !isFinite(t2))
33170 t2 = Math.min(Math.max(+t2, 0), 1);
33171 var way = graph.entity(wayID);
33172 way = way.removeNode("");
33173 if (way.tags.nonsquare) {
33174 var tags = Object.assign({}, way.tags);
33175 delete tags.nonsquare;
33176 way = way.update({ tags });
33178 graph = graph.replace(way);
33179 var isClosed = way.isClosed();
33180 var nodes = graph.childNodes(way).slice();
33183 if (vertexID !== void 0) {
33184 nodes = nodeSubset(nodes, vertexID, isClosed);
33185 if (nodes.length !== 3)
33188 var nodeCount = {};
33190 var corner = { i: 0, dotp: 1 };
33191 var node, point2, loc, score, motions, i3, j3;
33192 for (i3 = 0; i3 < nodes.length; i3++) {
33194 nodeCount[node.id] = (nodeCount[node.id] || 0) + 1;
33195 points.push({ id: node.id, coord: projection2(node.loc) });
33197 if (points.length === 3) {
33198 for (i3 = 0; i3 < 1e3; i3++) {
33199 motions = points.map(calcMotion);
33200 points[corner.i].coord = geoVecAdd(points[corner.i].coord, motions[corner.i]);
33201 score = corner.dotp;
33202 if (score < epsilon3) {
33206 node = graph.entity(nodes[corner.i].id);
33207 loc = projection2.invert(points[corner.i].coord);
33208 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
33210 var straights = [];
33211 var simplified = [];
33212 for (i3 = 0; i3 < points.length; i3++) {
33213 point2 = points[i3];
33215 if (isClosed || i3 > 0 && i3 < points.length - 1) {
33216 var a2 = points[(i3 - 1 + points.length) % points.length];
33217 var b2 = points[(i3 + 1) % points.length];
33218 dotp = Math.abs(geoOrthoNormalizedDotProduct(a2.coord, b2.coord, point2.coord));
33220 if (dotp > upperThreshold) {
33221 straights.push(point2);
33223 simplified.push(point2);
33226 var bestPoints = clonePoints(simplified);
33227 var originalPoints = clonePoints(simplified);
33229 for (i3 = 0; i3 < 1e3; i3++) {
33230 motions = simplified.map(calcMotion);
33231 for (j3 = 0; j3 < motions.length; j3++) {
33232 simplified[j3].coord = geoVecAdd(simplified[j3].coord, motions[j3]);
33234 var newScore = geoOrthoCalcScore(simplified, isClosed, epsilon3, threshold);
33235 if (newScore < score) {
33236 bestPoints = clonePoints(simplified);
33239 if (score < epsilon3) {
33243 var bestCoords = bestPoints.map(function(p2) {
33247 bestCoords.push(bestCoords[0]);
33248 for (i3 = 0; i3 < bestPoints.length; i3++) {
33249 point2 = bestPoints[i3];
33250 if (!geoVecEqual(originalPoints[i3].coord, point2.coord)) {
33251 node = graph.entity(point2.id);
33252 loc = projection2.invert(point2.coord);
33253 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
33256 for (i3 = 0; i3 < straights.length; i3++) {
33257 point2 = straights[i3];
33258 if (nodeCount[point2.id] > 1)
33260 node = graph.entity(point2.id);
33261 if (t2 === 1 && graph.parentWays(node).length === 1 && graph.parentRelations(node).length === 0 && !node.hasInterestingTags()) {
33262 graph = actionDeleteNode(node.id)(graph);
33264 var choice = geoVecProject(point2.coord, bestCoords);
33266 loc = projection2.invert(choice.target);
33267 graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
33273 function clonePoints(array2) {
33274 return array2.map(function(p2) {
33275 return { id: p2.id, coord: [p2.coord[0], p2.coord[1]] };
33278 function calcMotion(point3, i4, array2) {
33279 if (!isClosed && (i4 === 0 || i4 === array2.length - 1))
33281 if (nodeCount[array2[i4].id] > 1)
33283 var a3 = array2[(i4 - 1 + array2.length) % array2.length].coord;
33284 var origin = point3.coord;
33285 var b3 = array2[(i4 + 1) % array2.length].coord;
33286 var p2 = geoVecSubtract(a3, origin);
33287 var q2 = geoVecSubtract(b3, origin);
33288 var scale = 2 * Math.min(geoVecLength(p2), geoVecLength(q2));
33289 p2 = geoVecNormalize(p2);
33290 q2 = geoVecNormalize(q2);
33291 var dotp2 = p2[0] * q2[0] + p2[1] * q2[1];
33292 var val = Math.abs(dotp2);
33293 if (val < lowerThreshold) {
33296 var vec = geoVecNormalize(geoVecAdd(p2, q2));
33297 return geoVecScale(vec, 0.1 * dotp2 * scale);
33302 function nodeSubset(nodes, vertexID2, isClosed) {
33303 var first = isClosed ? 0 : 1;
33304 var last = isClosed ? nodes.length : nodes.length - 1;
33305 for (var i3 = first; i3 < last; i3++) {
33306 if (nodes[i3].id === vertexID2) {
33308 nodes[(i3 - 1 + nodes.length) % nodes.length],
33310 nodes[(i3 + 1) % nodes.length]
33316 action.disabled = function(graph) {
33317 var way = graph.entity(wayID);
33318 way = way.removeNode("");
33319 graph = graph.replace(way);
33320 var isClosed = way.isClosed();
33321 var nodes = graph.childNodes(way).slice();
33324 var allowStraightAngles = false;
33325 if (vertexID !== void 0) {
33326 allowStraightAngles = true;
33327 nodes = nodeSubset(nodes, vertexID, isClosed);
33328 if (nodes.length !== 3)
33329 return "end_vertex";
33331 var coords = nodes.map(function(n3) {
33332 return projection2(n3.loc);
33334 var score = geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles);
33335 if (score === null) {
33336 return "not_squarish";
33337 } else if (score === 0) {
33338 return "square_enough";
33343 action.transitionable = true;
33347 // modules/actions/restrict_turn.js
33348 function actionRestrictTurn(turn, restrictionType, restrictionID) {
33349 return function(graph) {
33350 var fromWay = graph.entity(turn.from.way);
33351 var toWay = graph.entity(turn.to.way);
33352 var viaNode = turn.via.node && graph.entity(turn.via.node);
33353 var viaWays = turn.via.ways && turn.via.ways.map(function(id2) {
33354 return graph.entity(id2);
33357 members.push({ id: fromWay.id, type: "way", role: "from" });
33359 members.push({ id: viaNode.id, type: "node", role: "via" });
33360 } else if (viaWays) {
33361 viaWays.forEach(function(viaWay) {
33362 members.push({ id: viaWay.id, type: "way", role: "via" });
33365 members.push({ id: toWay.id, type: "way", role: "to" });
33366 return graph.replace(osmRelation({
33369 type: "restriction",
33370 restriction: restrictionType
33377 // modules/actions/revert.js
33378 function actionRevert(id2) {
33379 var action = function(graph) {
33380 var entity = graph.hasEntity(id2), base = graph.base().entities[id2];
33381 if (entity && !base) {
33382 if (entity.type === "node") {
33383 graph.parentWays(entity).forEach(function(parent) {
33384 parent = parent.removeNode(id2);
33385 graph = graph.replace(parent);
33386 if (parent.isDegenerate()) {
33387 graph = actionDeleteWay(parent.id)(graph);
33391 graph.parentRelations(entity).forEach(function(parent) {
33392 parent = parent.removeMembersWithID(id2);
33393 graph = graph.replace(parent);
33394 if (parent.isDegenerate()) {
33395 graph = actionDeleteRelation(parent.id)(graph);
33399 return graph.revert(id2);
33404 // modules/actions/rotate.js
33405 function actionRotate(rotateIds, pivot, angle2, projection2) {
33406 var action = function(graph) {
33407 return graph.update(function(graph2) {
33408 utilGetAllNodes(rotateIds, graph2).forEach(function(node) {
33409 var point2 = geoRotate([projection2(node.loc)], angle2, pivot)[0];
33410 graph2 = graph2.replace(node.move(projection2.invert(point2)));
33417 // modules/actions/scale.js
33418 function actionScale(ids, pivotLoc, scaleFactor, projection2) {
33419 return function(graph) {
33420 return graph.update(function(graph2) {
33421 let point2, radial;
33422 utilGetAllNodes(ids, graph2).forEach(function(node) {
33423 point2 = projection2(node.loc);
33425 point2[0] - pivotLoc[0],
33426 point2[1] - pivotLoc[1]
33429 pivotLoc[0] + scaleFactor * radial[0],
33430 pivotLoc[1] + scaleFactor * radial[1]
33432 graph2 = graph2.replace(node.move(projection2.invert(point2)));
33438 // modules/actions/straighten_nodes.js
33439 function actionStraightenNodes(nodeIDs, projection2) {
33440 function positionAlongWay(a2, o2, b2) {
33441 return geoVecDot(a2, b2, o2) / geoVecDot(b2, b2, o2);
33443 function getEndpoints(points) {
33444 var ssr = geoGetSmallestSurroundingRectangle(points);
33445 var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
33446 var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
33447 var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
33448 var q2 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
33449 var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q2);
33455 var action = function(graph, t2) {
33456 if (t2 === null || !isFinite(t2))
33458 t2 = Math.min(Math.max(+t2, 0), 1);
33459 var nodes = nodeIDs.map(function(id2) {
33460 return graph.entity(id2);
33462 var points = nodes.map(function(n3) {
33463 return projection2(n3.loc);
33465 var endpoints = getEndpoints(points);
33466 var startPoint = endpoints[0];
33467 var endPoint = endpoints[1];
33468 for (var i3 = 0; i3 < points.length; i3++) {
33469 var node = nodes[i3];
33470 var point2 = points[i3];
33471 var u2 = positionAlongWay(point2, startPoint, endPoint);
33472 var point22 = geoVecInterp(startPoint, endPoint, u2);
33473 var loc2 = projection2.invert(point22);
33474 graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
33478 action.disabled = function(graph) {
33479 var nodes = nodeIDs.map(function(id2) {
33480 return graph.entity(id2);
33482 var points = nodes.map(function(n3) {
33483 return projection2(n3.loc);
33485 var endpoints = getEndpoints(points);
33486 var startPoint = endpoints[0];
33487 var endPoint = endpoints[1];
33488 var maxDistance = 0;
33489 for (var i3 = 0; i3 < points.length; i3++) {
33490 var point2 = points[i3];
33491 var u2 = positionAlongWay(point2, startPoint, endPoint);
33492 var p2 = geoVecInterp(startPoint, endPoint, u2);
33493 var dist = geoVecLength(p2, point2);
33494 if (!isNaN(dist) && dist > maxDistance) {
33495 maxDistance = dist;
33498 if (maxDistance < 1e-4) {
33499 return "straight_enough";
33502 action.transitionable = true;
33506 // modules/actions/straighten_way.js
33507 function actionStraightenWay(selectedIDs, projection2) {
33508 function positionAlongWay(a2, o2, b2) {
33509 return geoVecDot(a2, b2, o2) / geoVecDot(b2, b2, o2);
33511 function allNodes(graph) {
33513 var startNodes = [];
33515 var remainingWays = [];
33516 var selectedWays = selectedIDs.filter(function(w2) {
33517 return graph.entity(w2).type === "way";
33519 var selectedNodes = selectedIDs.filter(function(n3) {
33520 return graph.entity(n3).type === "node";
33522 for (var i3 = 0; i3 < selectedWays.length; i3++) {
33523 var way = graph.entity(selectedWays[i3]);
33524 nodes = way.nodes.slice(0);
33525 remainingWays.push(nodes);
33526 startNodes.push(nodes[0]);
33527 endNodes.push(nodes[nodes.length - 1]);
33529 startNodes = startNodes.filter(function(n3) {
33530 return startNodes.indexOf(n3) === startNodes.lastIndexOf(n3);
33532 endNodes = endNodes.filter(function(n3) {
33533 return endNodes.indexOf(n3) === endNodes.lastIndexOf(n3);
33535 var currNode = utilArrayDifference(startNodes, endNodes).concat(utilArrayDifference(endNodes, startNodes))[0];
33538 var getNextWay = function(currNode2, remainingWays2) {
33539 return remainingWays2.filter(function(way2) {
33540 return way2[0] === currNode2 || way2[way2.length - 1] === currNode2;
33543 while (remainingWays.length) {
33544 nextWay = getNextWay(currNode, remainingWays);
33545 remainingWays = utilArrayDifference(remainingWays, [nextWay]);
33546 if (nextWay[0] !== currNode) {
33549 nodes = nodes.concat(nextWay);
33550 currNode = nodes[nodes.length - 1];
33552 if (selectedNodes.length === 2) {
33553 var startNodeIdx = nodes.indexOf(selectedNodes[0]);
33554 var endNodeIdx = nodes.indexOf(selectedNodes[1]);
33555 var sortedStartEnd = [startNodeIdx, endNodeIdx];
33556 sortedStartEnd.sort(function(a2, b2) {
33559 nodes = nodes.slice(sortedStartEnd[0], sortedStartEnd[1] + 1);
33561 return nodes.map(function(n3) {
33562 return graph.entity(n3);
33565 function shouldKeepNode(node, graph) {
33566 return graph.parentWays(node).length > 1 || graph.parentRelations(node).length || node.hasInterestingTags();
33568 var action = function(graph, t2) {
33569 if (t2 === null || !isFinite(t2))
33571 t2 = Math.min(Math.max(+t2, 0), 1);
33572 var nodes = allNodes(graph);
33573 var points = nodes.map(function(n3) {
33574 return projection2(n3.loc);
33576 var startPoint = points[0];
33577 var endPoint = points[points.length - 1];
33580 for (i3 = 1; i3 < points.length - 1; i3++) {
33581 var node = nodes[i3];
33582 var point2 = points[i3];
33583 if (t2 < 1 || shouldKeepNode(node, graph)) {
33584 var u2 = positionAlongWay(point2, startPoint, endPoint);
33585 var p2 = geoVecInterp(startPoint, endPoint, u2);
33586 var loc2 = projection2.invert(p2);
33587 graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
33589 if (toDelete.indexOf(node) === -1) {
33590 toDelete.push(node);
33594 for (i3 = 0; i3 < toDelete.length; i3++) {
33595 graph = actionDeleteNode(toDelete[i3].id)(graph);
33599 action.disabled = function(graph) {
33600 var nodes = allNodes(graph);
33601 var points = nodes.map(function(n3) {
33602 return projection2(n3.loc);
33604 var startPoint = points[0];
33605 var endPoint = points[points.length - 1];
33606 var threshold = 0.2 * geoVecLength(startPoint, endPoint);
33608 if (threshold === 0) {
33609 return "too_bendy";
33611 var maxDistance = 0;
33612 for (i3 = 1; i3 < points.length - 1; i3++) {
33613 var point2 = points[i3];
33614 var u2 = positionAlongWay(point2, startPoint, endPoint);
33615 var p2 = geoVecInterp(startPoint, endPoint, u2);
33616 var dist = geoVecLength(p2, point2);
33617 if (isNaN(dist) || dist > threshold) {
33618 return "too_bendy";
33619 } else if (dist > maxDistance) {
33620 maxDistance = dist;
33623 var keepingAllNodes = nodes.every(function(node, i4) {
33624 return i4 === 0 || i4 === nodes.length - 1 || shouldKeepNode(node, graph);
33626 if (maxDistance < 1e-4 && // Allow straightening even if already straight in order to remove extraneous nodes
33628 return "straight_enough";
33631 action.transitionable = true;
33635 // modules/actions/unrestrict_turn.js
33636 function actionUnrestrictTurn(turn) {
33637 return function(graph) {
33638 return actionDeleteRelation(turn.restrictionID)(graph);
33642 // modules/actions/reflect.js
33643 function actionReflect(reflectIds, projection2) {
33644 var _useLongAxis = true;
33645 var action = function(graph, t2) {
33646 if (t2 === null || !isFinite(t2))
33648 t2 = Math.min(Math.max(+t2, 0), 1);
33649 var nodes = utilGetAllNodes(reflectIds, graph);
33650 var points = nodes.map(function(n3) {
33651 return projection2(n3.loc);
33653 var ssr = geoGetSmallestSurroundingRectangle(points);
33654 var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
33655 var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
33656 var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
33657 var q2 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
33659 var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q2);
33660 if (_useLongAxis && isLong || !_useLongAxis && !isLong) {
33667 var dx = q3[0] - p3[0];
33668 var dy = q3[1] - p3[1];
33669 var a2 = (dx * dx - dy * dy) / (dx * dx + dy * dy);
33670 var b2 = 2 * dx * dy / (dx * dx + dy * dy);
33671 for (var i3 = 0; i3 < nodes.length; i3++) {
33672 var node = nodes[i3];
33673 var c2 = projection2(node.loc);
33675 a2 * (c2[0] - p3[0]) + b2 * (c2[1] - p3[1]) + p3[0],
33676 b2 * (c2[0] - p3[0]) - a2 * (c2[1] - p3[1]) + p3[1]
33678 var loc2 = projection2.invert(c22);
33679 node = node.move(geoVecInterp(node.loc, loc2, t2));
33680 graph = graph.replace(node);
33684 action.useLongAxis = function(val) {
33685 if (!arguments.length)
33686 return _useLongAxis;
33687 _useLongAxis = val;
33690 action.transitionable = true;
33694 // modules/actions/upgrade_tags.js
33695 function actionUpgradeTags(entityId, oldTags, replaceTags) {
33696 return function(graph) {
33697 var entity = graph.entity(entityId);
33698 var tags = Object.assign({}, entity.tags);
33701 for (var oldTagKey in oldTags) {
33702 if (!(oldTagKey in tags))
33704 if (oldTags[oldTagKey] === "*") {
33705 transferValue = tags[oldTagKey];
33706 delete tags[oldTagKey];
33707 } else if (oldTags[oldTagKey] === tags[oldTagKey]) {
33708 delete tags[oldTagKey];
33710 var vals = tags[oldTagKey].split(";").filter(Boolean);
33711 var oldIndex = vals.indexOf(oldTags[oldTagKey]);
33712 if (vals.length === 1 || oldIndex === -1) {
33713 delete tags[oldTagKey];
33715 if (replaceTags && replaceTags[oldTagKey]) {
33716 semiIndex = oldIndex;
33718 vals.splice(oldIndex, 1);
33719 tags[oldTagKey] = vals.join(";");
33724 for (var replaceKey in replaceTags) {
33725 var replaceValue = replaceTags[replaceKey];
33726 if (replaceValue === "*") {
33727 if (tags[replaceKey] && tags[replaceKey] !== "no") {
33730 tags[replaceKey] = "yes";
33732 } else if (replaceValue === "$1") {
33733 tags[replaceKey] = transferValue;
33735 if (tags[replaceKey] && oldTags[replaceKey] && semiIndex !== void 0) {
33736 var existingVals = tags[replaceKey].split(";").filter(Boolean);
33737 if (existingVals.indexOf(replaceValue) === -1) {
33738 existingVals.splice(semiIndex, 0, replaceValue);
33739 tags[replaceKey] = existingVals.join(";");
33742 tags[replaceKey] = replaceValue;
33747 return graph.replace(entity.update({ tags }));
33751 // modules/behavior/edit.js
33752 function behaviorEdit(context) {
33753 function behavior() {
33754 context.map().minzoom(context.minEditableZoom());
33756 behavior.off = function() {
33757 context.map().minzoom(0);
33762 // modules/behavior/hover.js
33763 function behaviorHover(context) {
33764 var dispatch14 = dispatch_default("hover");
33765 var _selection = select_default2(null);
33766 var _newNodeId = null;
33767 var _initialNodeID = null;
33771 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
33772 function keydown(d3_event) {
33773 if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
33774 _selection.selectAll(".hover").classed("hover-suppressed", true).classed("hover", false);
33775 _selection.classed("hover-disabled", true);
33776 dispatch14.call("hover", this, null);
33779 function keyup(d3_event) {
33780 if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
33781 _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false).classed("hover", true);
33782 _selection.classed("hover-disabled", false);
33783 dispatch14.call("hover", this, _targets);
33786 function behavior(selection2) {
33787 _selection = selection2;
33789 if (_initialNodeID) {
33790 _newNodeId = _initialNodeID;
33791 _initialNodeID = null;
33795 _selection.on(_pointerPrefix + "over.hover", pointerover).on(_pointerPrefix + "out.hover", pointerout).on(_pointerPrefix + "down.hover", pointerover);
33796 select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", pointerout, true).on("keydown.hover", keydown).on("keyup.hover", keyup);
33797 function eventTarget(d3_event) {
33798 var datum2 = d3_event.target && d3_event.target.__data__;
33799 if (typeof datum2 !== "object")
33801 if (!(datum2 instanceof osmEntity) && datum2.properties && datum2.properties.entity instanceof osmEntity) {
33802 return datum2.properties.entity;
33806 function pointerover(d3_event) {
33807 if (context.mode().id.indexOf("drag") === -1 && (!d3_event.pointerType || d3_event.pointerType === "mouse") && d3_event.buttons)
33809 var target = eventTarget(d3_event);
33810 if (target && _targets.indexOf(target) === -1) {
33811 _targets.push(target);
33812 updateHover(d3_event, _targets);
33815 function pointerout(d3_event) {
33816 var target = eventTarget(d3_event);
33817 var index = _targets.indexOf(target);
33818 if (index !== -1) {
33819 _targets.splice(index);
33820 updateHover(d3_event, _targets);
33823 function allowsVertex(d2) {
33824 return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
33826 function modeAllowsHover(target) {
33827 var mode = context.mode();
33828 if (mode.id === "add-point") {
33829 return mode.preset.matchGeometry("vertex") || target.type !== "way" && target.geometry(context.graph()) !== "vertex";
33833 function updateHover(d3_event, targets) {
33834 _selection.selectAll(".hover").classed("hover", false);
33835 _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false);
33836 var mode = context.mode();
33837 if (!_newNodeId && (mode.id === "draw-line" || mode.id === "draw-area")) {
33838 var node = targets.find(function(target) {
33839 return target instanceof osmEntity && target.type === "node";
33841 _newNodeId = node && node.id;
33843 targets = targets.filter(function(datum3) {
33844 if (datum3 instanceof osmEntity) {
33845 return datum3.id !== _newNodeId && (datum3.type !== "node" || !_ignoreVertex || allowsVertex(datum3)) && modeAllowsHover(datum3);
33850 for (var i3 in targets) {
33851 var datum2 = targets[i3];
33852 if (datum2.__featurehash__) {
33853 selector += ", .data" + datum2.__featurehash__;
33854 } else if (datum2 instanceof QAItem) {
33855 selector += ", ." + datum2.service + ".itemId-" + datum2.id;
33856 } else if (datum2 instanceof osmNote) {
33857 selector += ", .note-" + datum2.id;
33858 } else if (datum2 instanceof osmEntity) {
33859 selector += ", ." + datum2.id;
33860 if (datum2.type === "relation") {
33861 for (var j3 in datum2.members) {
33862 selector += ", ." + datum2.members[j3].id;
33867 var suppressed = _altDisables && d3_event && d3_event.altKey;
33868 if (selector.trim().length) {
33869 selector = selector.slice(1);
33870 _selection.selectAll(selector).classed(suppressed ? "hover-suppressed" : "hover", true);
33872 dispatch14.call("hover", this, !suppressed && targets);
33875 behavior.off = function(selection2) {
33876 selection2.selectAll(".hover").classed("hover", false);
33877 selection2.selectAll(".hover-suppressed").classed("hover-suppressed", false);
33878 selection2.classed("hover-disabled", false);
33879 selection2.on(_pointerPrefix + "over.hover", null).on(_pointerPrefix + "out.hover", null).on(_pointerPrefix + "down.hover", null);
33880 select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", null, true).on("keydown.hover", null).on("keyup.hover", null);
33882 behavior.altDisables = function(val) {
33883 if (!arguments.length)
33884 return _altDisables;
33885 _altDisables = val;
33888 behavior.ignoreVertex = function(val) {
33889 if (!arguments.length)
33890 return _ignoreVertex;
33891 _ignoreVertex = val;
33894 behavior.initialNodeID = function(nodeId) {
33895 _initialNodeID = nodeId;
33898 return utilRebind(behavior, dispatch14, "on");
33901 // modules/behavior/draw.js
33902 var _disableSpace = false;
33903 var _lastSpace = null;
33904 function behaviorDraw(context) {
33905 var dispatch14 = dispatch_default(
33916 var keybinding = utilKeybinding("draw");
33917 var _hover = behaviorHover(context).altDisables(true).ignoreVertex(true).on("hover", context.ui().sidebar.hover);
33918 var _edit = behaviorEdit(context);
33919 var _closeTolerance = 4;
33920 var _tolerance = 12;
33921 var _mouseLeave = false;
33922 var _lastMouse = null;
33923 var _lastPointerUpEvent;
33925 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
33926 function datum2(d3_event) {
33927 var mode = context.mode();
33928 var isNote = mode && mode.id.indexOf("note") !== -1;
33929 if (d3_event.altKey || isNote)
33932 if (d3_event.type === "keydown") {
33933 element = _lastMouse && _lastMouse.target;
33935 element = d3_event.target;
33937 var d2 = element.__data__;
33938 return d2 && d2.properties && d2.properties.target ? d2 : {};
33940 function pointerdown(d3_event) {
33943 var pointerLocGetter = utilFastMouse(this);
33945 id: d3_event.pointerId || "mouse",
33947 downTime: +/* @__PURE__ */ new Date(),
33948 downLoc: pointerLocGetter(d3_event)
33950 dispatch14.call("down", this, d3_event, datum2(d3_event));
33952 function pointerup(d3_event) {
33953 if (!_downPointer || _downPointer.id !== (d3_event.pointerId || "mouse"))
33955 var downPointer = _downPointer;
33956 _downPointer = null;
33957 _lastPointerUpEvent = d3_event;
33958 if (downPointer.isCancelled)
33960 var t2 = +/* @__PURE__ */ new Date();
33961 var p2 = downPointer.pointerLocGetter(d3_event);
33962 var dist = geoVecLength(downPointer.downLoc, p2);
33963 if (dist < _closeTolerance || dist < _tolerance && t2 - downPointer.downTime < 500) {
33964 select_default2(window).on("click.draw-block", function() {
33965 d3_event.stopPropagation();
33967 context.map().dblclickZoomEnable(false);
33968 window.setTimeout(function() {
33969 context.map().dblclickZoomEnable(true);
33970 select_default2(window).on("click.draw-block", null);
33972 click(d3_event, p2);
33975 function pointermove(d3_event) {
33976 if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse") && !_downPointer.isCancelled) {
33977 var p2 = _downPointer.pointerLocGetter(d3_event);
33978 var dist = geoVecLength(_downPointer.downLoc, p2);
33979 if (dist >= _closeTolerance) {
33980 _downPointer.isCancelled = true;
33981 dispatch14.call("downcancel", this);
33984 if (d3_event.pointerType && d3_event.pointerType !== "mouse" || d3_event.buttons || _downPointer)
33986 if (_lastPointerUpEvent && _lastPointerUpEvent.pointerType !== "mouse" && d3_event.timeStamp - _lastPointerUpEvent.timeStamp < 100)
33988 _lastMouse = d3_event;
33989 dispatch14.call("move", this, d3_event, datum2(d3_event));
33991 function pointercancel(d3_event) {
33992 if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse")) {
33993 if (!_downPointer.isCancelled) {
33994 dispatch14.call("downcancel", this);
33996 _downPointer = null;
33999 function mouseenter() {
34000 _mouseLeave = false;
34002 function mouseleave() {
34003 _mouseLeave = true;
34005 function allowsVertex(d2) {
34006 return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
34008 function click(d3_event, loc) {
34009 var d2 = datum2(d3_event);
34010 var target = d2 && d2.properties && d2.properties.entity;
34011 var mode = context.mode();
34012 if (target && target.type === "node" && allowsVertex(target)) {
34013 dispatch14.call("clickNode", this, target, d2);
34015 } else if (target && target.type === "way" && (mode.id !== "add-point" || mode.preset.matchGeometry("vertex"))) {
34016 var choice = geoChooseEdge(
34017 context.graph().childNodes(target),
34019 context.projection,
34023 var edge = [target.nodes[choice.index - 1], target.nodes[choice.index]];
34024 dispatch14.call("clickWay", this, choice.loc, edge, d2);
34027 } else if (mode.id !== "add-point" || mode.preset.matchGeometry("point")) {
34028 var locLatLng = context.projection.invert(loc);
34029 dispatch14.call("click", this, locLatLng, d2);
34032 function space(d3_event) {
34033 d3_event.preventDefault();
34034 d3_event.stopPropagation();
34035 var currSpace = context.map().mouse();
34036 if (_disableSpace && _lastSpace) {
34037 var dist = geoVecLength(_lastSpace, currSpace);
34038 if (dist > _tolerance) {
34039 _disableSpace = false;
34042 if (_disableSpace || _mouseLeave || !_lastMouse)
34044 _lastSpace = currSpace;
34045 _disableSpace = true;
34046 select_default2(window).on("keyup.space-block", function() {
34047 d3_event.preventDefault();
34048 d3_event.stopPropagation();
34049 _disableSpace = false;
34050 select_default2(window).on("keyup.space-block", null);
34052 var loc = context.map().mouse() || // or the map center if the mouse has never entered the map
34053 context.projection(context.map().center());
34054 click(d3_event, loc);
34056 function backspace(d3_event) {
34057 d3_event.preventDefault();
34058 dispatch14.call("undo");
34060 function del(d3_event) {
34061 d3_event.preventDefault();
34062 dispatch14.call("cancel");
34064 function ret(d3_event) {
34065 d3_event.preventDefault();
34066 dispatch14.call("finish");
34068 function behavior(selection2) {
34069 context.install(_hover);
34070 context.install(_edit);
34071 _downPointer = null;
34072 keybinding.on("\u232B", backspace).on("\u2326", del).on("\u238B", ret).on("\u21A9", ret).on("space", space).on("\u2325space", space);
34073 selection2.on("mouseenter.draw", mouseenter).on("mouseleave.draw", mouseleave).on(_pointerPrefix + "down.draw", pointerdown).on(_pointerPrefix + "move.draw", pointermove);
34074 select_default2(window).on(_pointerPrefix + "up.draw", pointerup, true).on("pointercancel.draw", pointercancel, true);
34075 select_default2(document).call(keybinding);
34078 behavior.off = function(selection2) {
34079 context.ui().sidebar.hover.cancel();
34080 context.uninstall(_hover);
34081 context.uninstall(_edit);
34082 selection2.on("mouseenter.draw", null).on("mouseleave.draw", null).on(_pointerPrefix + "down.draw", null).on(_pointerPrefix + "move.draw", null);
34083 select_default2(window).on(_pointerPrefix + "up.draw", null).on("pointercancel.draw", null);
34084 select_default2(document).call(keybinding.unbind);
34086 behavior.hover = function() {
34089 return utilRebind(behavior, dispatch14, "on");
34092 // modules/behavior/breathe.js
34093 var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
34095 // node_modules/d3-scale/src/init.js
34096 function initRange(domain2, range3) {
34097 switch (arguments.length) {
34101 this.range(domain2);
34104 this.range(range3).domain(domain2);
34110 // node_modules/d3-scale/src/constant.js
34111 function constants(x2) {
34112 return function() {
34117 // node_modules/d3-scale/src/number.js
34118 function number2(x2) {
34122 // node_modules/d3-scale/src/continuous.js
34124 function identity3(x2) {
34127 function normalize(a2, b2) {
34128 return (b2 -= a2 = +a2) ? function(x2) {
34129 return (x2 - a2) / b2;
34130 } : constants(isNaN(b2) ? NaN : 0.5);
34132 function clamper(a2, b2) {
34135 t2 = a2, a2 = b2, b2 = t2;
34136 return function(x2) {
34137 return Math.max(a2, Math.min(b2, x2));
34140 function bimap(domain2, range3, interpolate) {
34141 var d0 = domain2[0], d1 = domain2[1], r0 = range3[0], r1 = range3[1];
34143 d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
34145 d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
34146 return function(x2) {
34150 function polymap(domain2, range3, interpolate) {
34151 var j3 = Math.min(domain2.length, range3.length) - 1, d2 = new Array(j3), r2 = new Array(j3), i3 = -1;
34152 if (domain2[j3] < domain2[0]) {
34153 domain2 = domain2.slice().reverse();
34154 range3 = range3.slice().reverse();
34156 while (++i3 < j3) {
34157 d2[i3] = normalize(domain2[i3], domain2[i3 + 1]);
34158 r2[i3] = interpolate(range3[i3], range3[i3 + 1]);
34160 return function(x2) {
34161 var i4 = bisect_default(domain2, x2, 1, j3) - 1;
34162 return r2[i4](d2[i4](x2));
34165 function copy(source, target) {
34166 return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
34168 function transformer2() {
34169 var domain2 = unit, range3 = unit, interpolate = value_default, transform2, untransform, unknown, clamp3 = identity3, piecewise, output, input;
34170 function rescale() {
34171 var n3 = Math.min(domain2.length, range3.length);
34172 if (clamp3 !== identity3)
34173 clamp3 = clamper(domain2[0], domain2[n3 - 1]);
34174 piecewise = n3 > 2 ? polymap : bimap;
34175 output = input = null;
34178 function scale(x2) {
34179 return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain2.map(transform2), range3, interpolate)))(transform2(clamp3(x2)));
34181 scale.invert = function(y2) {
34182 return clamp3(untransform((input || (input = piecewise(range3, domain2.map(transform2), number_default)))(y2)));
34184 scale.domain = function(_2) {
34185 return arguments.length ? (domain2 = Array.from(_2, number2), rescale()) : domain2.slice();
34187 scale.range = function(_2) {
34188 return arguments.length ? (range3 = Array.from(_2), rescale()) : range3.slice();
34190 scale.rangeRound = function(_2) {
34191 return range3 = Array.from(_2), interpolate = round_default, rescale();
34193 scale.clamp = function(_2) {
34194 return arguments.length ? (clamp3 = _2 ? true : identity3, rescale()) : clamp3 !== identity3;
34196 scale.interpolate = function(_2) {
34197 return arguments.length ? (interpolate = _2, rescale()) : interpolate;
34199 scale.unknown = function(_2) {
34200 return arguments.length ? (unknown = _2, scale) : unknown;
34202 return function(t2, u2) {
34203 transform2 = t2, untransform = u2;
34207 function continuous() {
34208 return transformer2()(identity3, identity3);
34211 // node_modules/d3-format/src/formatDecimal.js
34212 function formatDecimal_default(x2) {
34213 return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
34215 function formatDecimalParts(x2, p2) {
34216 if ((i3 = (x2 = p2 ? x2.toExponential(p2 - 1) : x2.toExponential()).indexOf("e")) < 0)
34218 var i3, coefficient = x2.slice(0, i3);
34220 coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
34225 // node_modules/d3-format/src/exponent.js
34226 function exponent_default(x2) {
34227 return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
34230 // node_modules/d3-format/src/formatGroup.js
34231 function formatGroup_default(grouping, thousands) {
34232 return function(value, width) {
34233 var i3 = value.length, t2 = [], j3 = 0, g3 = grouping[0], length = 0;
34234 while (i3 > 0 && g3 > 0) {
34235 if (length + g3 + 1 > width)
34236 g3 = Math.max(1, width - length);
34237 t2.push(value.substring(i3 -= g3, i3 + g3));
34238 if ((length += g3 + 1) > width)
34240 g3 = grouping[j3 = (j3 + 1) % grouping.length];
34242 return t2.reverse().join(thousands);
34246 // node_modules/d3-format/src/formatNumerals.js
34247 function formatNumerals_default(numerals) {
34248 return function(value) {
34249 return value.replace(/[0-9]/g, function(i3) {
34250 return numerals[+i3];
34255 // node_modules/d3-format/src/formatSpecifier.js
34256 var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
34257 function formatSpecifier(specifier) {
34258 if (!(match = re.exec(specifier)))
34259 throw new Error("invalid format: " + specifier);
34261 return new FormatSpecifier({
34269 precision: match[8] && match[8].slice(1),
34274 formatSpecifier.prototype = FormatSpecifier.prototype;
34275 function FormatSpecifier(specifier) {
34276 this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
34277 this.align = specifier.align === void 0 ? ">" : specifier.align + "";
34278 this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
34279 this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
34280 this.zero = !!specifier.zero;
34281 this.width = specifier.width === void 0 ? void 0 : +specifier.width;
34282 this.comma = !!specifier.comma;
34283 this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
34284 this.trim = !!specifier.trim;
34285 this.type = specifier.type === void 0 ? "" : specifier.type + "";
34287 FormatSpecifier.prototype.toString = function() {
34288 return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
34291 // node_modules/d3-format/src/formatTrim.js
34292 function formatTrim_default(s2) {
34294 for (var n3 = s2.length, i3 = 1, i0 = -1, i1; i3 < n3; ++i3) {
34312 return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
34315 // node_modules/d3-format/src/formatPrefixAuto.js
34316 var prefixExponent;
34317 function formatPrefixAuto_default(x2, p2) {
34318 var d2 = formatDecimalParts(x2, p2);
34321 var coefficient = d2[0], exponent = d2[1], i3 = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n3 = coefficient.length;
34322 return i3 === n3 ? coefficient : i3 > n3 ? coefficient + new Array(i3 - n3 + 1).join("0") : i3 > 0 ? coefficient.slice(0, i3) + "." + coefficient.slice(i3) : "0." + new Array(1 - i3).join("0") + formatDecimalParts(x2, Math.max(0, p2 + i3 - 1))[0];
34325 // node_modules/d3-format/src/formatRounded.js
34326 function formatRounded_default(x2, p2) {
34327 var d2 = formatDecimalParts(x2, p2);
34330 var coefficient = d2[0], exponent = d2[1];
34331 return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
34334 // node_modules/d3-format/src/formatTypes.js
34335 var formatTypes_default = {
34336 "%": (x2, p2) => (x2 * 100).toFixed(p2),
34337 "b": (x2) => Math.round(x2).toString(2),
34338 "c": (x2) => x2 + "",
34339 "d": formatDecimal_default,
34340 "e": (x2, p2) => x2.toExponential(p2),
34341 "f": (x2, p2) => x2.toFixed(p2),
34342 "g": (x2, p2) => x2.toPrecision(p2),
34343 "o": (x2) => Math.round(x2).toString(8),
34344 "p": (x2, p2) => formatRounded_default(x2 * 100, p2),
34345 "r": formatRounded_default,
34346 "s": formatPrefixAuto_default,
34347 "X": (x2) => Math.round(x2).toString(16).toUpperCase(),
34348 "x": (x2) => Math.round(x2).toString(16)
34351 // node_modules/d3-format/src/identity.js
34352 function identity_default3(x2) {
34356 // node_modules/d3-format/src/locale.js
34357 var map = Array.prototype.map;
34358 var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
34359 function locale_default(locale2) {
34360 var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity_default3 : formatGroup_default(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity_default3 : formatNumerals_default(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "\u2212" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
34361 function newFormat(specifier) {
34362 specifier = formatSpecifier(specifier);
34363 var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision2 = specifier.precision, trim = specifier.trim, type2 = specifier.type;
34365 comma = true, type2 = "g";
34366 else if (!formatTypes_default[type2])
34367 precision2 === void 0 && (precision2 = 12), trim = true, type2 = "g";
34368 if (zero3 || fill === "0" && align === "=")
34369 zero3 = true, fill = "0", align = "=";
34370 var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "";
34371 var formatType = formatTypes_default[type2], maybeSuffix = /[defgprs%]/.test(type2);
34372 precision2 = precision2 === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision2)) : Math.max(0, Math.min(20, precision2));
34373 function format2(value) {
34374 var valuePrefix = prefix, valueSuffix = suffix, i3, n3, c2;
34375 if (type2 === "c") {
34376 valueSuffix = formatType(value) + valueSuffix;
34380 var valueNegative = value < 0 || 1 / value < 0;
34381 value = isNaN(value) ? nan : formatType(Math.abs(value), precision2);
34383 value = formatTrim_default(value);
34384 if (valueNegative && +value === 0 && sign2 !== "+")
34385 valueNegative = false;
34386 valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
34387 valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
34389 i3 = -1, n3 = value.length;
34390 while (++i3 < n3) {
34391 if (c2 = value.charCodeAt(i3), 48 > c2 || c2 > 57) {
34392 valueSuffix = (c2 === 46 ? decimal + value.slice(i3 + 1) : value.slice(i3)) + valueSuffix;
34393 value = value.slice(0, i3);
34399 if (comma && !zero3)
34400 value = group(value, Infinity);
34401 var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : "";
34402 if (comma && zero3)
34403 value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
34406 value = valuePrefix + value + valueSuffix + padding;
34409 value = valuePrefix + padding + value + valueSuffix;
34412 value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
34415 value = padding + valuePrefix + value + valueSuffix;
34418 return numerals(value);
34420 format2.toString = function() {
34421 return specifier + "";
34425 function formatPrefix2(specifier, value) {
34426 var f3 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e3), prefix = prefixes[8 + e3 / 3];
34427 return function(value2) {
34428 return f3(k2 * value2) + prefix;
34433 formatPrefix: formatPrefix2
34437 // node_modules/d3-format/src/defaultLocale.js
34444 currency: ["$", ""]
34446 function defaultLocale(definition) {
34447 locale = locale_default(definition);
34448 format = locale.format;
34449 formatPrefix = locale.formatPrefix;
34453 // node_modules/d3-format/src/precisionFixed.js
34454 function precisionFixed_default(step) {
34455 return Math.max(0, -exponent_default(Math.abs(step)));
34458 // node_modules/d3-format/src/precisionPrefix.js
34459 function precisionPrefix_default(step, value) {
34460 return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
34463 // node_modules/d3-format/src/precisionRound.js
34464 function precisionRound_default(step, max3) {
34465 step = Math.abs(step), max3 = Math.abs(max3) - step;
34466 return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
34469 // node_modules/d3-scale/src/tickFormat.js
34470 function tickFormat(start2, stop, count, specifier) {
34471 var step = tickStep(start2, stop, count), precision2;
34472 specifier = formatSpecifier(specifier == null ? ",f" : specifier);
34473 switch (specifier.type) {
34475 var value = Math.max(Math.abs(start2), Math.abs(stop));
34476 if (specifier.precision == null && !isNaN(precision2 = precisionPrefix_default(step, value)))
34477 specifier.precision = precision2;
34478 return formatPrefix(specifier, value);
34485 if (specifier.precision == null && !isNaN(precision2 = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop)))))
34486 specifier.precision = precision2 - (specifier.type === "e");
34491 if (specifier.precision == null && !isNaN(precision2 = precisionFixed_default(step)))
34492 specifier.precision = precision2 - (specifier.type === "%") * 2;
34496 return format(specifier);
34499 // node_modules/d3-scale/src/linear.js
34500 function linearish(scale) {
34501 var domain2 = scale.domain;
34502 scale.ticks = function(count) {
34503 var d2 = domain2();
34504 return ticks(d2[0], d2[d2.length - 1], count == null ? 10 : count);
34506 scale.tickFormat = function(count, specifier) {
34507 var d2 = domain2();
34508 return tickFormat(d2[0], d2[d2.length - 1], count == null ? 10 : count, specifier);
34510 scale.nice = function(count) {
34513 var d2 = domain2();
34515 var i1 = d2.length - 1;
34516 var start2 = d2[i0];
34521 if (stop < start2) {
34522 step = start2, start2 = stop, stop = step;
34523 step = i0, i0 = i1, i1 = step;
34525 while (maxIter-- > 0) {
34526 step = tickIncrement(start2, stop, count);
34527 if (step === prestep) {
34530 return domain2(d2);
34531 } else if (step > 0) {
34532 start2 = Math.floor(start2 / step) * step;
34533 stop = Math.ceil(stop / step) * step;
34534 } else if (step < 0) {
34535 start2 = Math.ceil(start2 * step) / step;
34536 stop = Math.floor(stop * step) / step;
34546 function linear3() {
34547 var scale = continuous();
34548 scale.copy = function() {
34549 return copy(scale, linear3());
34551 initRange.apply(scale, arguments);
34552 return linearish(scale);
34555 // node_modules/d3-scale/src/quantize.js
34556 function quantize() {
34557 var x05 = 0, x12 = 1, n3 = 1, domain2 = [0.5], range3 = [0, 1], unknown;
34558 function scale(x2) {
34559 return x2 != null && x2 <= x2 ? range3[bisect_default(domain2, x2, 0, n3)] : unknown;
34561 function rescale() {
34563 domain2 = new Array(n3);
34565 domain2[i3] = ((i3 + 1) * x12 - (i3 - n3) * x05) / (n3 + 1);
34568 scale.domain = function(_2) {
34569 return arguments.length ? ([x05, x12] = _2, x05 = +x05, x12 = +x12, rescale()) : [x05, x12];
34571 scale.range = function(_2) {
34572 return arguments.length ? (n3 = (range3 = Array.from(_2)).length - 1, rescale()) : range3.slice();
34574 scale.invertExtent = function(y2) {
34575 var i3 = range3.indexOf(y2);
34576 return i3 < 0 ? [NaN, NaN] : i3 < 1 ? [x05, domain2[0]] : i3 >= n3 ? [domain2[n3 - 1], x12] : [domain2[i3 - 1], domain2[i3]];
34578 scale.unknown = function(_2) {
34579 return arguments.length ? (unknown = _2, scale) : scale;
34581 scale.thresholds = function() {
34582 return domain2.slice();
34584 scale.copy = function() {
34585 return quantize().domain([x05, x12]).range(range3).unknown(unknown);
34587 return initRange.apply(linearish(scale), arguments);
34590 // modules/behavior/breathe.js
34591 function behaviorBreathe() {
34592 var duration = 800;
34594 var selector = ".selected.shadow, .selected .shadow";
34595 var _selected = select_default2(null);
34600 function ratchetyInterpolator(a2, b2, steps2, units) {
34603 var sample = quantize().domain([0, 1]).range(quantize_default(number_default(a2, b2), steps2));
34604 return function(t2) {
34605 return String(sample(t2)) + (units || "");
34608 function reset(selection2) {
34609 selection2.style("stroke-opacity", null).style("stroke-width", null).style("fill-opacity", null).style("r", null);
34611 function setAnimationParams(transition2, fromTo) {
34612 var toFrom = fromTo === "from" ? "to" : "from";
34613 transition2.styleTween("stroke-opacity", function(d2) {
34614 return ratchetyInterpolator(
34615 _params[d2.id][toFrom].opacity,
34616 _params[d2.id][fromTo].opacity,
34619 }).styleTween("stroke-width", function(d2) {
34620 return ratchetyInterpolator(
34621 _params[d2.id][toFrom].width,
34622 _params[d2.id][fromTo].width,
34626 }).styleTween("fill-opacity", function(d2) {
34627 return ratchetyInterpolator(
34628 _params[d2.id][toFrom].opacity,
34629 _params[d2.id][fromTo].opacity,
34632 }).styleTween("r", function(d2) {
34633 return ratchetyInterpolator(
34634 _params[d2.id][toFrom].width,
34635 _params[d2.id][fromTo].width,
34641 function calcAnimationParams(selection2) {
34642 selection2.call(reset).each(function(d2) {
34643 var s2 = select_default2(this);
34644 var tag = s2.node().tagName;
34645 var p2 = { "from": {}, "to": {} };
34648 if (tag === "circle") {
34649 opacity = Number(s2.style("fill-opacity") || 0.5);
34650 width = Number(s2.style("r") || 15.5);
34652 opacity = Number(s2.style("stroke-opacity") || 0.7);
34653 width = Number(s2.style("stroke-width") || 10);
34656 p2.from.opacity = opacity * 0.6;
34657 p2.to.opacity = opacity * 1.25;
34658 p2.from.width = width * 0.7;
34659 p2.to.width = width * (tag === "circle" ? 1.5 : 1);
34660 _params[d2.id] = p2;
34663 function run(surface, fromTo) {
34664 var toFrom = fromTo === "from" ? "to" : "from";
34665 var currSelected = surface.selectAll(selector);
34666 var currClassed = surface.attr("class");
34667 if (_done || currSelected.empty()) {
34668 _selected.call(reset);
34669 _selected = select_default2(null);
34672 if (!(0, import_fast_deep_equal2.default)(currSelected.data(), _selected.data()) || currClassed !== _classed) {
34673 _selected.call(reset);
34674 _classed = currClassed;
34675 _selected = currSelected.call(calcAnimationParams);
34677 var didCallNextRun = false;
34678 _selected.transition().duration(duration).call(setAnimationParams, fromTo).on("end", function() {
34679 if (!didCallNextRun) {
34680 surface.call(run, toFrom);
34681 didCallNextRun = true;
34683 if (!select_default2(this).classed("selected")) {
34684 reset(select_default2(this));
34688 function behavior(surface) {
34690 _timer = timer(function() {
34691 if (surface.selectAll(selector).empty()) {
34694 surface.call(run, "from");
34699 behavior.restartIfNeeded = function(surface) {
34700 if (_selected.empty()) {
34701 surface.call(run, "from");
34707 behavior.off = function() {
34712 _selected.interrupt().call(reset);
34717 // modules/behavior/operation.js
34718 function behaviorOperation(context) {
34720 function keypress(d3_event) {
34721 if (!context.map().withinEditableZoom())
34723 if (_operation.availableForKeypress && !_operation.availableForKeypress())
34725 d3_event.preventDefault();
34726 var disabled = _operation.disabled();
34728 context.ui().flash.duration(4e3).iconName("#iD-operation-" + _operation.id).iconClass("operation disabled").label(_operation.tooltip())();
34730 context.ui().flash.duration(2e3).iconName("#iD-operation-" + _operation.id).iconClass("operation").label(_operation.annotation() || _operation.title)();
34731 if (_operation.point)
34732 _operation.point(null);
34736 function behavior() {
34737 if (_operation && _operation.available()) {
34738 context.keybinding().on(_operation.keys, keypress);
34742 behavior.off = function() {
34743 context.keybinding().off(_operation.keys);
34745 behavior.which = function(_2) {
34746 if (!arguments.length)
34754 // modules/operations/circularize.js
34755 function operationCircularize(context, selectedIDs) {
34757 var _actions = selectedIDs.map(getAction).filter(Boolean);
34758 var _amount = _actions.length === 1 ? "single" : "multiple";
34759 var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
34762 function getAction(entityID) {
34763 var entity = context.entity(entityID);
34764 if (entity.type !== "way" || new Set(entity.nodes).size <= 1)
34767 _extent = entity.extent(context.graph());
34769 _extent = _extent.extend(entity.extent(context.graph()));
34771 return actionCircularize(entityID, context.projection);
34773 var operation = function() {
34774 if (!_actions.length)
34776 var combinedAction = function(graph, t2) {
34777 _actions.forEach(function(action) {
34778 if (!action.disabled(graph)) {
34779 graph = action(graph, t2);
34784 combinedAction.transitionable = true;
34785 context.perform(combinedAction, operation.annotation());
34786 window.setTimeout(function() {
34787 context.validator().validate();
34790 operation.available = function() {
34791 return _actions.length && selectedIDs.length === _actions.length;
34793 operation.disabled = function() {
34794 if (!_actions.length)
34796 var actionDisableds = _actions.map(function(action) {
34797 return action.disabled(context.graph());
34798 }).filter(Boolean);
34799 if (actionDisableds.length === _actions.length) {
34800 if (new Set(actionDisableds).size > 1) {
34801 return "multiple_blockers";
34803 return actionDisableds[0];
34804 } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
34805 return "too_large";
34806 } else if (someMissing()) {
34807 return "not_downloaded";
34808 } else if (selectedIDs.some(context.hasHiddenConnections)) {
34809 return "connected_to_hidden";
34812 function someMissing() {
34813 if (context.inIntro())
34815 var osm = context.connection();
34817 var missing = _coords.filter(function(loc) {
34818 return !osm.isDataLoaded(loc);
34820 if (missing.length) {
34821 missing.forEach(function(loc) {
34822 context.loadTileAtLoc(loc);
34830 operation.tooltip = function() {
34831 var disable = operation.disabled();
34832 return disable ? _t.append("operations.circularize." + disable + "." + _amount) : _t.append("operations.circularize.description." + _amount);
34834 operation.annotation = function() {
34835 return _t("operations.circularize.annotation.feature", { n: _actions.length });
34837 operation.id = "circularize";
34838 operation.keys = [_t("operations.circularize.key")];
34839 operation.title = _t.append("operations.circularize.title");
34840 operation.behavior = behaviorOperation(context).which(operation);
34844 // modules/ui/cmd.js
34845 var uiCmd = function(code) {
34846 var detected = utilDetect();
34847 if (detected.os === "mac") {
34850 if (detected.os === "win") {
34851 if (code === "\u2318\u21E7Z")
34854 var result = "", replacements = {
34858 "\u232B": "Backspace",
34861 for (var i3 = 0; i3 < code.length; i3++) {
34862 if (code[i3] in replacements) {
34863 result += replacements[code[i3]] + (i3 < code.length - 1 ? "+" : "");
34865 result += code[i3];
34870 uiCmd.display = function(code) {
34871 if (code.length !== 1)
34873 var detected = utilDetect();
34874 var mac = detected.os === "mac";
34875 var replacements = {
34876 "\u2318": mac ? "\u2318 " + _t("shortcuts.key.cmd") : _t("shortcuts.key.ctrl"),
34877 "\u21E7": mac ? "\u21E7 " + _t("shortcuts.key.shift") : _t("shortcuts.key.shift"),
34878 "\u2325": mac ? "\u2325 " + _t("shortcuts.key.option") : _t("shortcuts.key.alt"),
34879 "\u2303": mac ? "\u2303 " + _t("shortcuts.key.ctrl") : _t("shortcuts.key.ctrl"),
34880 "\u232B": mac ? "\u232B " + _t("shortcuts.key.delete") : _t("shortcuts.key.backspace"),
34881 "\u2326": mac ? "\u2326 " + _t("shortcuts.key.del") : _t("shortcuts.key.del"),
34882 "\u2196": mac ? "\u2196 " + _t("shortcuts.key.pgup") : _t("shortcuts.key.pgup"),
34883 "\u2198": mac ? "\u2198 " + _t("shortcuts.key.pgdn") : _t("shortcuts.key.pgdn"),
34884 "\u21DE": mac ? "\u21DE " + _t("shortcuts.key.home") : _t("shortcuts.key.home"),
34885 "\u21DF": mac ? "\u21DF " + _t("shortcuts.key.end") : _t("shortcuts.key.end"),
34886 "\u21B5": mac ? "\u23CE " + _t("shortcuts.key.return") : _t("shortcuts.key.enter"),
34887 "\u238B": mac ? "\u238B " + _t("shortcuts.key.esc") : _t("shortcuts.key.esc"),
34888 "\u2630": mac ? "\u2630 " + _t("shortcuts.key.menu") : _t("shortcuts.key.menu")
34890 return replacements[code] || code;
34893 // modules/operations/delete.js
34894 function operationDelete(context, selectedIDs) {
34895 var multi = selectedIDs.length === 1 ? "single" : "multiple";
34896 var action = actionDeleteMultiple(selectedIDs);
34897 var nodes = utilGetAllNodes(selectedIDs, context.graph());
34898 var coords = nodes.map(function(n3) {
34901 var extent = utilTotalExtent(selectedIDs, context.graph());
34902 var operation = function() {
34903 var nextSelectedID;
34904 var nextSelectedLoc;
34905 if (selectedIDs.length === 1) {
34906 var id2 = selectedIDs[0];
34907 var entity = context.entity(id2);
34908 var geometry = entity.geometry(context.graph());
34909 var parents = context.graph().parentWays(entity);
34910 var parent = parents[0];
34911 if (geometry === "vertex") {
34912 var nodes2 = parent.nodes;
34913 var i3 = nodes2.indexOf(id2);
34916 } else if (i3 === nodes2.length - 1) {
34919 var a2 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 - 1]).loc);
34920 var b2 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 + 1]).loc);
34921 i3 = a2 < b2 ? i3 - 1 : i3 + 1;
34923 nextSelectedID = nodes2[i3];
34924 nextSelectedLoc = context.entity(nextSelectedID).loc;
34927 context.perform(action, operation.annotation());
34928 context.validator().validate();
34929 if (nextSelectedID && nextSelectedLoc) {
34930 if (context.hasEntity(nextSelectedID)) {
34931 context.enter(modeSelect(context, [nextSelectedID]).follow(true));
34933 context.map().centerEase(nextSelectedLoc);
34934 context.enter(modeBrowse(context));
34937 context.enter(modeBrowse(context));
34940 operation.available = function() {
34943 operation.disabled = function() {
34944 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
34945 return "too_large";
34946 } else if (someMissing()) {
34947 return "not_downloaded";
34948 } else if (selectedIDs.some(context.hasHiddenConnections)) {
34949 return "connected_to_hidden";
34950 } else if (selectedIDs.some(protectedMember)) {
34951 return "part_of_relation";
34952 } else if (selectedIDs.some(incompleteRelation)) {
34953 return "incomplete_relation";
34954 } else if (selectedIDs.some(hasWikidataTag)) {
34955 return "has_wikidata_tag";
34958 function someMissing() {
34959 if (context.inIntro())
34961 var osm = context.connection();
34963 var missing = coords.filter(function(loc) {
34964 return !osm.isDataLoaded(loc);
34966 if (missing.length) {
34967 missing.forEach(function(loc) {
34968 context.loadTileAtLoc(loc);
34975 function hasWikidataTag(id2) {
34976 var entity = context.entity(id2);
34977 return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
34979 function incompleteRelation(id2) {
34980 var entity = context.entity(id2);
34981 return entity.type === "relation" && !entity.isComplete(context.graph());
34983 function protectedMember(id2) {
34984 var entity = context.entity(id2);
34985 if (entity.type !== "way")
34987 var parents = context.graph().parentRelations(entity);
34988 for (var i3 = 0; i3 < parents.length; i3++) {
34989 var parent = parents[i3];
34990 var type2 = parent.tags.type;
34991 var role = parent.memberById(id2).role || "outer";
34992 if (type2 === "route" || type2 === "boundary" || type2 === "multipolygon" && role === "outer") {
34999 operation.tooltip = function() {
35000 var disable = operation.disabled();
35001 return disable ? _t.append("operations.delete." + disable + "." + multi) : _t.append("operations.delete.description." + multi);
35003 operation.annotation = function() {
35004 return selectedIDs.length === 1 ? _t("operations.delete.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.delete.annotation.feature", { n: selectedIDs.length });
35006 operation.id = "delete";
35007 operation.keys = [uiCmd("\u2318\u232B"), uiCmd("\u2318\u2326"), uiCmd("\u2326")];
35008 operation.title = _t.append("operations.delete.title");
35009 operation.behavior = behaviorOperation(context).which(operation);
35013 // modules/operations/orthogonalize.js
35014 function operationOrthogonalize(context, selectedIDs) {
35017 var _actions = selectedIDs.map(chooseAction).filter(Boolean);
35018 var _amount = _actions.length === 1 ? "single" : "multiple";
35019 var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
35022 function chooseAction(entityID) {
35023 var entity = context.entity(entityID);
35024 var geometry = entity.geometry(context.graph());
35026 _extent = entity.extent(context.graph());
35028 _extent = _extent.extend(entity.extent(context.graph()));
35030 if (entity.type === "way" && new Set(entity.nodes).size > 2) {
35031 if (_type && _type !== "feature")
35034 return actionOrthogonalize(entityID, context.projection);
35035 } else if (geometry === "vertex") {
35036 if (_type && _type !== "corner")
35039 var graph = context.graph();
35040 var parents = graph.parentWays(entity);
35041 if (parents.length === 1) {
35042 var way = parents[0];
35043 if (way.nodes.indexOf(entityID) !== -1) {
35044 return actionOrthogonalize(way.id, context.projection, entityID);
35050 var operation = function() {
35051 if (!_actions.length)
35053 var combinedAction = function(graph, t2) {
35054 _actions.forEach(function(action) {
35055 if (!action.disabled(graph)) {
35056 graph = action(graph, t2);
35061 combinedAction.transitionable = true;
35062 context.perform(combinedAction, operation.annotation());
35063 window.setTimeout(function() {
35064 context.validator().validate();
35067 operation.available = function() {
35068 return _actions.length && selectedIDs.length === _actions.length;
35070 operation.disabled = function() {
35071 if (!_actions.length)
35073 var actionDisableds = _actions.map(function(action) {
35074 return action.disabled(context.graph());
35075 }).filter(Boolean);
35076 if (actionDisableds.length === _actions.length) {
35077 if (new Set(actionDisableds).size > 1) {
35078 return "multiple_blockers";
35080 return actionDisableds[0];
35081 } else if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
35082 return "too_large";
35083 } else if (someMissing()) {
35084 return "not_downloaded";
35085 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35086 return "connected_to_hidden";
35089 function someMissing() {
35090 if (context.inIntro())
35092 var osm = context.connection();
35094 var missing = _coords.filter(function(loc) {
35095 return !osm.isDataLoaded(loc);
35097 if (missing.length) {
35098 missing.forEach(function(loc) {
35099 context.loadTileAtLoc(loc);
35107 operation.tooltip = function() {
35108 var disable = operation.disabled();
35109 return disable ? _t.append("operations.orthogonalize." + disable + "." + _amount) : _t.append("operations.orthogonalize.description." + _type + "." + _amount);
35111 operation.annotation = function() {
35112 return _t("operations.orthogonalize.annotation." + _type, { n: _actions.length });
35114 operation.id = "orthogonalize";
35115 operation.keys = [_t("operations.orthogonalize.key")];
35116 operation.title = _t.append("operations.orthogonalize.title");
35117 operation.behavior = behaviorOperation(context).which(operation);
35121 // modules/operations/reflect.js
35122 function operationReflectShort(context, selectedIDs) {
35123 return operationReflect(context, selectedIDs, "short");
35125 function operationReflectLong(context, selectedIDs) {
35126 return operationReflect(context, selectedIDs, "long");
35128 function operationReflect(context, selectedIDs, axis) {
35129 axis = axis || "long";
35130 var multi = selectedIDs.length === 1 ? "single" : "multiple";
35131 var nodes = utilGetAllNodes(selectedIDs, context.graph());
35132 var coords = nodes.map(function(n3) {
35135 var extent = utilTotalExtent(selectedIDs, context.graph());
35136 var operation = function() {
35137 var action = actionReflect(selectedIDs, context.projection).useLongAxis(Boolean(axis === "long"));
35138 context.perform(action, operation.annotation());
35139 window.setTimeout(function() {
35140 context.validator().validate();
35143 operation.available = function() {
35144 return nodes.length >= 3;
35146 operation.disabled = function() {
35147 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
35148 return "too_large";
35149 } else if (someMissing()) {
35150 return "not_downloaded";
35151 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35152 return "connected_to_hidden";
35153 } else if (selectedIDs.some(incompleteRelation)) {
35154 return "incomplete_relation";
35157 function someMissing() {
35158 if (context.inIntro())
35160 var osm = context.connection();
35162 var missing = coords.filter(function(loc) {
35163 return !osm.isDataLoaded(loc);
35165 if (missing.length) {
35166 missing.forEach(function(loc) {
35167 context.loadTileAtLoc(loc);
35174 function incompleteRelation(id2) {
35175 var entity = context.entity(id2);
35176 return entity.type === "relation" && !entity.isComplete(context.graph());
35179 operation.tooltip = function() {
35180 var disable = operation.disabled();
35181 return disable ? _t.append("operations.reflect." + disable + "." + multi) : _t.append("operations.reflect.description." + axis + "." + multi);
35183 operation.annotation = function() {
35184 return _t("operations.reflect.annotation." + axis + ".feature", { n: selectedIDs.length });
35186 operation.id = "reflect-" + axis;
35187 operation.keys = [_t("operations.reflect.key." + axis)];
35188 operation.title = _t.append("operations.reflect.title." + axis);
35189 operation.behavior = behaviorOperation(context).which(operation);
35193 // modules/operations/move.js
35194 function operationMove(context, selectedIDs) {
35195 var multi = selectedIDs.length === 1 ? "single" : "multiple";
35196 var nodes = utilGetAllNodes(selectedIDs, context.graph());
35197 var coords = nodes.map(function(n3) {
35200 var extent = utilTotalExtent(selectedIDs, context.graph());
35201 var operation = function() {
35202 context.enter(modeMove(context, selectedIDs));
35204 operation.available = function() {
35205 return selectedIDs.length > 0;
35207 operation.disabled = function() {
35208 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
35209 return "too_large";
35210 } else if (someMissing()) {
35211 return "not_downloaded";
35212 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35213 return "connected_to_hidden";
35214 } else if (selectedIDs.some(incompleteRelation)) {
35215 return "incomplete_relation";
35218 function someMissing() {
35219 if (context.inIntro())
35221 var osm = context.connection();
35223 var missing = coords.filter(function(loc) {
35224 return !osm.isDataLoaded(loc);
35226 if (missing.length) {
35227 missing.forEach(function(loc) {
35228 context.loadTileAtLoc(loc);
35235 function incompleteRelation(id2) {
35236 var entity = context.entity(id2);
35237 return entity.type === "relation" && !entity.isComplete(context.graph());
35240 operation.tooltip = function() {
35241 var disable = operation.disabled();
35242 return disable ? _t.append("operations.move." + disable + "." + multi) : _t.append("operations.move.description." + multi);
35244 operation.annotation = function() {
35245 return selectedIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.move.annotation.feature", { n: selectedIDs.length });
35247 operation.id = "move";
35248 operation.keys = [_t("operations.move.key")];
35249 operation.title = _t.append("operations.move.title");
35250 operation.behavior = behaviorOperation(context).which(operation);
35251 operation.mouseOnly = true;
35255 // modules/modes/rotate.js
35256 function modeRotate(context, entityIDs) {
35257 var _tolerancePx = 4;
35262 var keybinding = utilKeybinding("rotate");
35264 behaviorEdit(context),
35265 operationCircularize(context, entityIDs).behavior,
35266 operationDelete(context, entityIDs).behavior,
35267 operationMove(context, entityIDs).behavior,
35268 operationOrthogonalize(context, entityIDs).behavior,
35269 operationReflectLong(context, entityIDs).behavior,
35270 operationReflectShort(context, entityIDs).behavior
35272 var annotation = entityIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.rotate.annotation.feature", { n: entityIDs.length });
35275 var _prevTransform;
35277 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
35278 function doRotate(d3_event) {
35280 if (context.graph() !== _prevGraph) {
35281 fn = context.perform;
35283 fn = context.replace;
35285 var projection2 = context.projection;
35286 var currTransform = projection2.transform();
35287 if (!_prevTransform || currTransform.k !== _prevTransform.k || currTransform.x !== _prevTransform.x || currTransform.y !== _prevTransform.y) {
35288 var nodes = utilGetAllNodes(entityIDs, context.graph());
35289 var points = nodes.map(function(n3) {
35290 return projection2(n3.loc);
35292 _pivot = getPivot(points);
35293 _prevAngle = void 0;
35295 var currMouse = context.map().mouse(d3_event);
35296 var currAngle = Math.atan2(currMouse[1] - _pivot[1], currMouse[0] - _pivot[0]);
35297 if (typeof _prevAngle === "undefined")
35298 _prevAngle = currAngle;
35299 var delta = currAngle - _prevAngle;
35300 fn(actionRotate(entityIDs, _pivot, delta, projection2));
35301 _prevTransform = currTransform;
35302 _prevAngle = currAngle;
35303 _prevGraph = context.graph();
35305 function getPivot(points) {
35307 if (points.length === 1) {
35308 _pivot2 = points[0];
35309 } else if (points.length === 2) {
35310 _pivot2 = geoVecInterp(points[0], points[1], 0.5);
35312 var polygonHull = hull_default(points);
35313 if (polygonHull.length === 2) {
35314 _pivot2 = geoVecInterp(points[0], points[1], 0.5);
35316 _pivot2 = centroid_default2(hull_default(points));
35321 function finish(d3_event) {
35322 d3_event.stopPropagation();
35323 context.replace(actionNoop(), annotation);
35324 context.enter(modeSelect(context, entityIDs));
35326 function cancel() {
35329 context.enter(modeSelect(context, entityIDs));
35331 function undone() {
35332 context.enter(modeBrowse(context));
35334 mode.enter = function() {
35336 context.features().forceVisible(entityIDs);
35337 behaviors.forEach(context.install);
35339 context.surface().on(_pointerPrefix + "down.modeRotate", function(d3_event) {
35340 downEvent = d3_event;
35342 select_default2(window).on(_pointerPrefix + "move.modeRotate", doRotate, true).on(_pointerPrefix + "up.modeRotate", function(d3_event) {
35345 var mapNode = context.container().select(".main-map").node();
35346 var pointGetter = utilFastMouse(mapNode);
35347 var p1 = pointGetter(downEvent);
35348 var p2 = pointGetter(d3_event);
35349 var dist = geoVecLength(p1, p2);
35350 if (dist <= _tolerancePx)
35354 context.history().on("undone.modeRotate", undone);
35355 keybinding.on("\u238B", cancel).on("\u21A9", finish);
35356 select_default2(document).call(keybinding);
35358 mode.exit = function() {
35359 behaviors.forEach(context.uninstall);
35360 context.surface().on(_pointerPrefix + "down.modeRotate", null);
35361 select_default2(window).on(_pointerPrefix + "move.modeRotate", null, true).on(_pointerPrefix + "up.modeRotate", null, true);
35362 context.history().on("undone.modeRotate", null);
35363 select_default2(document).call(keybinding.unbind);
35364 context.features().forceVisible([]);
35366 mode.selectedIDs = function() {
35367 if (!arguments.length)
35374 // modules/operations/rotate.js
35375 function operationRotate(context, selectedIDs) {
35376 var multi = selectedIDs.length === 1 ? "single" : "multiple";
35377 var nodes = utilGetAllNodes(selectedIDs, context.graph());
35378 var coords = nodes.map(function(n3) {
35381 var extent = utilTotalExtent(selectedIDs, context.graph());
35382 var operation = function() {
35383 context.enter(modeRotate(context, selectedIDs));
35385 operation.available = function() {
35386 return nodes.length >= 2;
35388 operation.disabled = function() {
35389 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
35390 return "too_large";
35391 } else if (someMissing()) {
35392 return "not_downloaded";
35393 } else if (selectedIDs.some(context.hasHiddenConnections)) {
35394 return "connected_to_hidden";
35395 } else if (selectedIDs.some(incompleteRelation)) {
35396 return "incomplete_relation";
35399 function someMissing() {
35400 if (context.inIntro())
35402 var osm = context.connection();
35404 var missing = coords.filter(function(loc) {
35405 return !osm.isDataLoaded(loc);
35407 if (missing.length) {
35408 missing.forEach(function(loc) {
35409 context.loadTileAtLoc(loc);
35416 function incompleteRelation(id2) {
35417 var entity = context.entity(id2);
35418 return entity.type === "relation" && !entity.isComplete(context.graph());
35421 operation.tooltip = function() {
35422 var disable = operation.disabled();
35423 return disable ? _t.append("operations.rotate." + disable + "." + multi) : _t.append("operations.rotate.description." + multi);
35425 operation.annotation = function() {
35426 return selectedIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.rotate.annotation.feature", { n: selectedIDs.length });
35428 operation.id = "rotate";
35429 operation.keys = [_t("operations.rotate.key")];
35430 operation.title = _t.append("operations.rotate.title");
35431 operation.behavior = behaviorOperation(context).which(operation);
35432 operation.mouseOnly = true;
35436 // modules/modes/move.js
35437 function modeMove(context, entityIDs, baseGraph) {
35438 var _tolerancePx = 4;
35443 var keybinding = utilKeybinding("move");
35445 behaviorEdit(context),
35446 operationCircularize(context, entityIDs).behavior,
35447 operationDelete(context, entityIDs).behavior,
35448 operationOrthogonalize(context, entityIDs).behavior,
35449 operationReflectLong(context, entityIDs).behavior,
35450 operationReflectShort(context, entityIDs).behavior,
35451 operationRotate(context, entityIDs).behavior
35453 var annotation = entityIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.move.annotation.feature", { n: entityIDs.length });
35457 var _nudgeInterval;
35458 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
35459 function doMove(nudge) {
35460 nudge = nudge || [0, 0];
35462 if (_prevGraph !== context.graph()) {
35464 _origin = context.map().mouseCoordinates();
35465 fn = context.perform;
35467 fn = context.overwrite;
35469 var currMouse = context.map().mouse();
35470 var origMouse = context.projection(_origin);
35471 var delta = geoVecSubtract(geoVecSubtract(currMouse, origMouse), nudge);
35472 fn(actionMove(entityIDs, delta, context.projection, _cache4));
35473 _prevGraph = context.graph();
35475 function startNudge(nudge) {
35476 if (_nudgeInterval)
35477 window.clearInterval(_nudgeInterval);
35478 _nudgeInterval = window.setInterval(function() {
35479 context.map().pan(nudge);
35483 function stopNudge() {
35484 if (_nudgeInterval) {
35485 window.clearInterval(_nudgeInterval);
35486 _nudgeInterval = null;
35491 var nudge = geoViewportEdge(context.map().mouse(), context.map().dimensions());
35498 function finish(d3_event) {
35499 d3_event.stopPropagation();
35500 context.replace(actionNoop(), annotation);
35501 context.enter(modeSelect(context, entityIDs));
35504 function cancel() {
35506 while (context.graph() !== baseGraph)
35508 context.enter(modeBrowse(context));
35512 context.enter(modeSelect(context, entityIDs));
35516 function undone() {
35517 context.enter(modeBrowse(context));
35519 mode.enter = function() {
35520 _origin = context.map().mouseCoordinates();
35523 context.features().forceVisible(entityIDs);
35524 behaviors.forEach(context.install);
35526 context.surface().on(_pointerPrefix + "down.modeMove", function(d3_event) {
35527 downEvent = d3_event;
35529 select_default2(window).on(_pointerPrefix + "move.modeMove", move, true).on(_pointerPrefix + "up.modeMove", function(d3_event) {
35532 var mapNode = context.container().select(".main-map").node();
35533 var pointGetter = utilFastMouse(mapNode);
35534 var p1 = pointGetter(downEvent);
35535 var p2 = pointGetter(d3_event);
35536 var dist = geoVecLength(p1, p2);
35537 if (dist <= _tolerancePx)
35541 context.history().on("undone.modeMove", undone);
35542 keybinding.on("\u238B", cancel).on("\u21A9", finish);
35543 select_default2(document).call(keybinding);
35545 mode.exit = function() {
35547 behaviors.forEach(function(behavior) {
35548 context.uninstall(behavior);
35550 context.surface().on(_pointerPrefix + "down.modeMove", null);
35551 select_default2(window).on(_pointerPrefix + "move.modeMove", null, true).on(_pointerPrefix + "up.modeMove", null, true);
35552 context.history().on("undone.modeMove", null);
35553 select_default2(document).call(keybinding.unbind);
35554 context.features().forceVisible([]);
35556 mode.selectedIDs = function() {
35557 if (!arguments.length)
35564 // modules/behavior/paste.js
35565 function behaviorPaste(context) {
35566 function doPaste(d3_event) {
35567 if (!context.map().withinEditableZoom())
35569 d3_event.preventDefault();
35570 var baseGraph = context.graph();
35571 var mouse = context.map().mouse();
35572 var projection2 = context.projection;
35573 var viewport = geoExtent(projection2.clipExtent()).polygon();
35574 if (!geoPointInPolygon(mouse, viewport))
35576 var oldIDs = context.copyIDs();
35577 if (!oldIDs.length)
35579 var extent = geoExtent();
35580 var oldGraph = context.copyGraph();
35582 var action = actionCopyEntities(oldIDs, oldGraph);
35583 context.perform(action);
35584 var copies = action.copies();
35585 var originals = /* @__PURE__ */ new Set();
35586 Object.values(copies).forEach(function(entity) {
35587 originals.add(entity.id);
35589 for (var id2 in copies) {
35590 var oldEntity = oldGraph.entity(id2);
35591 var newEntity = copies[id2];
35592 extent._extend(oldEntity.extent(oldGraph));
35593 var parents = context.graph().parentWays(newEntity);
35594 var parentCopied = parents.some(function(parent) {
35595 return originals.has(parent.id);
35597 if (!parentCopied) {
35598 newIDs.push(newEntity.id);
35601 var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
35602 var delta = geoVecSubtract(mouse, copyPoint);
35603 context.perform(actionMove(newIDs, delta, projection2));
35604 context.enter(modeMove(context, newIDs, baseGraph));
35606 function behavior() {
35607 context.keybinding().on(uiCmd("\u2318V"), doPaste);
35610 behavior.off = function() {
35611 context.keybinding().off(uiCmd("\u2318V"));
35616 // modules/behavior/drag.js
35617 function behaviorDrag() {
35618 var dispatch14 = dispatch_default("start", "move", "end");
35619 var _tolerancePx = 1;
35620 var _penTolerancePx = 4;
35621 var _origin = null;
35622 var _selector = "";
35627 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
35628 var d3_event_userSelectProperty = utilPrefixCSSProperty("UserSelect");
35629 var d3_event_userSelectSuppress = function() {
35630 var selection2 = selection_default();
35631 var select = selection2.style(d3_event_userSelectProperty);
35632 selection2.style(d3_event_userSelectProperty, "none");
35633 return function() {
35634 selection2.style(d3_event_userSelectProperty, select);
35637 function pointerdown(d3_event) {
35640 _pointerId = d3_event.pointerId || "mouse";
35641 _targetNode = this;
35642 var pointerLocGetter = utilFastMouse(_surface || _targetNode.parentNode);
35644 var startOrigin = pointerLocGetter(d3_event);
35645 var started = false;
35646 var selectEnable = d3_event_userSelectSuppress();
35647 select_default2(window).on(_pointerPrefix + "move.drag", pointermove).on(_pointerPrefix + "up.drag pointercancel.drag", pointerup, true);
35649 offset = _origin.call(_targetNode, _targetEntity);
35650 offset = [offset[0] - startOrigin[0], offset[1] - startOrigin[1]];
35654 d3_event.stopPropagation();
35655 function pointermove(d3_event2) {
35656 if (_pointerId !== (d3_event2.pointerId || "mouse"))
35658 var p2 = pointerLocGetter(d3_event2);
35660 var dist = geoVecLength(startOrigin, p2);
35661 var tolerance = d3_event2.pointerType === "pen" ? _penTolerancePx : _tolerancePx;
35662 if (dist < tolerance)
35665 dispatch14.call("start", this, d3_event2, _targetEntity);
35668 d3_event2.stopPropagation();
35669 d3_event2.preventDefault();
35670 var dx = p2[0] - startOrigin[0];
35671 var dy = p2[1] - startOrigin[1];
35672 dispatch14.call("move", this, d3_event2, _targetEntity, [p2[0] + offset[0], p2[1] + offset[1]], [dx, dy]);
35675 function pointerup(d3_event2) {
35676 if (_pointerId !== (d3_event2.pointerId || "mouse"))
35680 dispatch14.call("end", this, d3_event2, _targetEntity);
35681 d3_event2.preventDefault();
35683 select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
35687 function behavior(selection2) {
35688 var matchesSelector = utilPrefixDOMProperty("matchesSelector");
35689 var delegate = pointerdown;
35691 delegate = function(d3_event) {
35693 var target = d3_event.target;
35694 for (; target && target !== root3; target = target.parentNode) {
35695 var datum2 = target.__data__;
35696 _targetEntity = datum2 instanceof osmNote ? datum2 : datum2 && datum2.properties && datum2.properties.entity;
35697 if (_targetEntity && target[matchesSelector](_selector)) {
35698 return pointerdown.call(target, d3_event);
35703 selection2.on(_pointerPrefix + "down.drag" + _selector, delegate);
35705 behavior.off = function(selection2) {
35706 selection2.on(_pointerPrefix + "down.drag" + _selector, null);
35708 behavior.selector = function(_2) {
35709 if (!arguments.length)
35714 behavior.origin = function(_2) {
35715 if (!arguments.length)
35720 behavior.cancel = function() {
35721 select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
35724 behavior.targetNode = function(_2) {
35725 if (!arguments.length)
35726 return _targetNode;
35730 behavior.targetEntity = function(_2) {
35731 if (!arguments.length)
35732 return _targetEntity;
35733 _targetEntity = _2;
35736 behavior.surface = function(_2) {
35737 if (!arguments.length)
35742 return utilRebind(behavior, dispatch14, "on");
35745 // modules/modes/drag_node.js
35746 function modeDragNode(context) {
35751 var hover = behaviorHover(context).altDisables(true).on("hover", context.ui().sidebar.hover);
35752 var edit2 = behaviorEdit(context);
35753 var _nudgeInterval;
35754 var _restoreSelectedIDs = [];
35755 var _wasMidpoint = false;
35756 var _isCancelled = false;
35760 function startNudge(d3_event, entity, nudge) {
35761 if (_nudgeInterval)
35762 window.clearInterval(_nudgeInterval);
35763 _nudgeInterval = window.setInterval(function() {
35764 context.map().pan(nudge);
35765 doMove(d3_event, entity, nudge);
35768 function stopNudge() {
35769 if (_nudgeInterval) {
35770 window.clearInterval(_nudgeInterval);
35771 _nudgeInterval = null;
35774 function moveAnnotation(entity) {
35775 return _t("operations.move.annotation." + entity.geometry(context.graph()));
35777 function connectAnnotation(nodeEntity, targetEntity) {
35778 var nodeGeometry = nodeEntity.geometry(context.graph());
35779 var targetGeometry = targetEntity.geometry(context.graph());
35780 if (nodeGeometry === "vertex" && targetGeometry === "vertex") {
35781 var nodeParentWayIDs = context.graph().parentWays(nodeEntity);
35782 var targetParentWayIDs = context.graph().parentWays(targetEntity);
35783 var sharedParentWays = utilArrayIntersection(nodeParentWayIDs, targetParentWayIDs);
35784 if (sharedParentWays.length !== 0) {
35785 if (sharedParentWays[0].areAdjacent(nodeEntity.id, targetEntity.id)) {
35786 return _t("operations.connect.annotation.from_vertex.to_adjacent_vertex");
35788 return _t("operations.connect.annotation.from_vertex.to_sibling_vertex");
35791 return _t("operations.connect.annotation.from_" + nodeGeometry + ".to_" + targetGeometry);
35793 function shouldSnapToNode(target) {
35794 if (!_activeEntity)
35796 return _activeEntity.geometry(context.graph()) !== "vertex" || (target.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(target, context.graph()));
35798 function origin(entity) {
35799 return context.projection(entity.loc);
35801 function keydown(d3_event) {
35802 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
35803 if (context.surface().classed("nope")) {
35804 context.surface().classed("nope-suppressed", true);
35806 context.surface().classed("nope", false).classed("nope-disabled", true);
35809 function keyup(d3_event) {
35810 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
35811 if (context.surface().classed("nope-suppressed")) {
35812 context.surface().classed("nope", true);
35814 context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
35817 function start2(d3_event, entity) {
35818 _wasMidpoint = entity.type === "midpoint";
35819 var hasHidden = context.features().hasHiddenConnections(entity, context.graph());
35820 _isCancelled = !context.editable() || d3_event.shiftKey || hasHidden;
35821 if (_isCancelled) {
35823 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("modes.drag_node.connected_to_hidden"))();
35825 return drag.cancel();
35827 if (_wasMidpoint) {
35828 var midpoint = entity;
35829 entity = osmNode();
35830 context.perform(actionAddMidpoint(midpoint, entity));
35831 entity = context.entity(entity.id);
35832 var vertex = context.surface().selectAll("." + entity.id);
35833 drag.targetNode(vertex.node()).targetEntity(entity);
35835 context.perform(actionNoop());
35837 _activeEntity = entity;
35838 _startLoc = entity.loc;
35839 hover.ignoreVertex(entity.geometry(context.graph()) === "vertex");
35840 context.surface().selectAll("." + _activeEntity.id).classed("active", true);
35841 context.enter(mode);
35843 function datum2(d3_event) {
35844 if (!d3_event || d3_event.altKey) {
35847 var d2 = d3_event.target.__data__;
35848 return d2 && d2.properties && d2.properties.target ? d2 : {};
35851 function doMove(d3_event, entity, nudge) {
35852 nudge = nudge || [0, 0];
35853 var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
35854 var currMouse = geoVecSubtract(currPoint, nudge);
35855 var loc = context.projection.invert(currMouse);
35857 if (!_nudgeInterval) {
35858 var d2 = datum2(d3_event);
35859 target = d2 && d2.properties && d2.properties.entity;
35860 var targetLoc = target && target.loc;
35861 var targetNodes = d2 && d2.properties && d2.properties.nodes;
35863 if (shouldSnapToNode(target)) {
35866 } else if (targetNodes) {
35867 edge = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, end.id);
35874 actionMoveNode(entity.id, loc)
35876 var isInvalid = false;
35878 isInvalid = hasRelationConflict(entity, target, edge, context.graph());
35881 isInvalid = hasInvalidGeometry(entity, context.graph());
35883 var nope = context.surface().classed("nope");
35884 if (isInvalid === "relation" || isInvalid === "restriction") {
35886 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(
35887 "operations.connect." + isInvalid,
35888 { relation: _mainPresetIndex.item("type/restriction").name() }
35891 } else if (isInvalid) {
35892 var errorID = isInvalid === "line" ? "lines" : "areas";
35893 context.ui().flash.duration(3e3).iconName("#iD-icon-no").label(_t.append("self_intersection.error." + errorID))();
35896 context.ui().flash.duration(1).label("")();
35899 var nopeDisabled = context.surface().classed("nope-disabled");
35900 if (nopeDisabled) {
35901 context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
35903 context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
35907 function hasRelationConflict(entity, target, edge, graph) {
35908 var testGraph = graph.update();
35910 var midpoint = osmNode();
35911 var action = actionAddMidpoint({
35913 edge: [target.nodes[edge.index - 1], target.nodes[edge.index]]
35915 testGraph = action(testGraph);
35918 var ids = [entity.id, target.id];
35919 return actionConnect(ids).disabled(testGraph);
35921 function hasInvalidGeometry(entity, graph) {
35922 var parents = graph.parentWays(entity);
35924 for (i3 = 0; i3 < parents.length; i3++) {
35925 var parent = parents[i3];
35927 var activeIndex = null;
35928 var relations = graph.parentRelations(parent);
35929 for (j3 = 0; j3 < relations.length; j3++) {
35930 if (!relations[j3].isMultipolygon())
35932 var rings = osmJoinWays(relations[j3].members, graph);
35933 for (k2 = 0; k2 < rings.length; k2++) {
35934 nodes = rings[k2].nodes;
35935 if (nodes.find(function(n3) {
35936 return n3.id === entity.id;
35939 if (geoHasSelfIntersections(nodes, entity.id)) {
35940 return "multipolygonMember";
35943 rings[k2].coords = nodes.map(function(n3) {
35947 for (k2 = 0; k2 < rings.length; k2++) {
35948 if (k2 === activeIndex)
35950 if (geoHasLineIntersections(rings[activeIndex].nodes, rings[k2].nodes, entity.id)) {
35951 return "multipolygonRing";
35955 if (activeIndex === null) {
35956 nodes = parent.nodes.map(function(nodeID) {
35957 return graph.entity(nodeID);
35959 if (nodes.length && geoHasSelfIntersections(nodes, entity.id)) {
35960 return parent.geometry(graph);
35966 function move(d3_event, entity, point2) {
35969 d3_event.stopPropagation();
35970 context.surface().classed("nope-disabled", d3_event.altKey);
35971 _lastLoc = context.projection.invert(point2);
35972 doMove(d3_event, entity);
35973 var nudge = geoViewportEdge(point2, context.map().dimensions());
35975 startNudge(d3_event, entity, nudge);
35980 function end(d3_event, entity) {
35983 var wasPoint = entity.geometry(context.graph()) === "point";
35984 var d2 = datum2(d3_event);
35985 var nope = d2 && d2.properties && d2.properties.nope || context.surface().classed("nope");
35986 var target = d2 && d2.properties && d2.properties.entity;
35989 _actionBounceBack(entity.id, _startLoc)
35991 } else if (target && target.type === "way") {
35992 var choice = geoChooseEdge(context.graph().childNodes(target), context.map().mouse(), context.projection, entity.id);
35994 actionAddMidpoint({
35996 edge: [target.nodes[choice.index - 1], target.nodes[choice.index]]
35998 connectAnnotation(entity, target)
36000 } else if (target && target.type === "node" && shouldSnapToNode(target)) {
36002 actionConnect([target.id, entity.id]),
36003 connectAnnotation(entity, target)
36005 } else if (_wasMidpoint) {
36008 _t("operations.add.annotation.vertex")
36013 moveAnnotation(entity)
36017 context.enter(modeSelect(context, [entity.id]));
36019 var reselection = _restoreSelectedIDs.filter(function(id2) {
36020 return context.graph().hasEntity(id2);
36022 if (reselection.length) {
36023 context.enter(modeSelect(context, reselection));
36025 context.enter(modeBrowse(context));
36029 function _actionBounceBack(nodeID, toLoc) {
36030 var moveNode = actionMoveNode(nodeID, toLoc);
36031 var action = function(graph, t2) {
36034 return moveNode(graph, t2);
36036 action.transitionable = true;
36039 function cancel() {
36041 context.enter(modeBrowse(context));
36043 var drag = behaviorDrag().selector(".layer-touch.points .target").surface(context.container().select(".main-map").node()).origin(origin).on("start", start2).on("move", move).on("end", end);
36044 mode.enter = function() {
36045 context.install(hover);
36046 context.install(edit2);
36047 select_default2(window).on("keydown.dragNode", keydown).on("keyup.dragNode", keyup);
36048 context.history().on("undone.drag-node", cancel);
36050 mode.exit = function() {
36051 context.ui().sidebar.hover.cancel();
36052 context.uninstall(hover);
36053 context.uninstall(edit2);
36054 select_default2(window).on("keydown.dragNode", null).on("keyup.dragNode", null);
36055 context.history().on("undone.drag-node", null);
36056 _activeEntity = null;
36057 context.surface().classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false).selectAll(".active").classed("active", false);
36060 mode.selectedIDs = function() {
36061 if (!arguments.length)
36062 return _activeEntity ? [_activeEntity.id] : [];
36065 mode.activeID = function() {
36066 if (!arguments.length)
36067 return _activeEntity && _activeEntity.id;
36070 mode.restoreSelectedIDs = function(_2) {
36071 if (!arguments.length)
36072 return _restoreSelectedIDs;
36073 _restoreSelectedIDs = _2;
36076 mode.behavior = drag;
36080 // modules/services/keepRight.js
36081 var import_rbush = __toESM(require_rbush_min());
36083 // node_modules/d3-fetch/src/text.js
36084 function responseText(response) {
36086 throw new Error(response.status + " " + response.statusText);
36087 return response.text();
36089 function text_default3(input, init2) {
36090 return fetch(input, init2).then(responseText);
36093 // node_modules/d3-fetch/src/json.js
36094 function responseJson(response) {
36096 throw new Error(response.status + " " + response.statusText);
36097 if (response.status === 204 || response.status === 205)
36099 return response.json();
36101 function json_default(input, init2) {
36102 return fetch(input, init2).then(responseJson);
36105 // node_modules/d3-fetch/src/xml.js
36106 function parser(type2) {
36107 return (input, init2) => text_default3(input, init2).then((text2) => new DOMParser().parseFromString(text2, type2));
36109 var xml_default = parser("application/xml");
36110 var html = parser("text/html");
36111 var svg = parser("image/svg+xml");
36113 // modules/services/keepRight.js
36114 var tiler = utilTiler();
36115 var dispatch2 = dispatch_default("loaded");
36116 var _tileZoom = 14;
36117 var _krUrlRoot = "https://www.keepright.at";
36118 var _krData = { errorTypes: {}, localizeStrings: {} };
36121 // no 20 - multiple node on same spot - these are mostly boundaries overlapping roads
36194 function abortRequest(controller) {
36196 controller.abort();
36199 function abortUnwantedRequests(cache, tiles) {
36200 Object.keys(cache.inflightTile).forEach((k2) => {
36201 const wanted = tiles.find((tile) => k2 === tile.id);
36203 abortRequest(cache.inflightTile[k2]);
36204 delete cache.inflightTile[k2];
36208 function encodeIssueRtree(d2) {
36209 return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
36211 function updateRtree(item, replace) {
36212 _cache.rtree.remove(item, (a2, b2) => a2.data.id === b2.data.id);
36214 _cache.rtree.insert(item);
36217 function tokenReplacements(d2) {
36218 if (!(d2 instanceof QAItem))
36220 const replacements = {};
36221 const issueTemplate = _krData.errorTypes[d2.whichType];
36222 if (!issueTemplate) {
36223 console.log("No Template: ", d2.whichType);
36224 console.log(" ", d2.description);
36227 if (!issueTemplate.regex)
36229 const errorRegex = new RegExp(issueTemplate.regex, "i");
36230 const errorMatch = errorRegex.exec(d2.description);
36232 console.log("Unmatched: ", d2.whichType);
36233 console.log(" ", d2.description);
36234 console.log(" ", errorRegex);
36237 for (let i3 = 1; i3 < errorMatch.length; i3++) {
36238 let capture = errorMatch[i3];
36240 idType = "IDs" in issueTemplate ? issueTemplate.IDs[i3 - 1] : "";
36241 if (idType && capture) {
36242 capture = parseError(capture, idType);
36244 const compare = capture.toLowerCase();
36245 if (_krData.localizeStrings[compare]) {
36246 capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare]);
36248 capture = unescape_default(capture);
36251 replacements["var" + i3] = capture;
36253 return replacements;
36255 function parseError(capture, idType) {
36256 const compare = capture.toLowerCase();
36257 if (_krData.localizeStrings[compare]) {
36258 capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare]);
36262 capture = linkErrorObject2(capture);
36265 capture = linkURL(capture);
36270 capture = linkEntity2(idType + capture);
36273 capture = parse20(capture);
36276 capture = parse211(capture);
36279 capture = parse231(capture);
36282 capture = parse294(capture);
36285 capture = parse370(capture);
36289 function linkErrorObject2(d2) {
36290 return { html: `<a class="error_object_link">${d2}</a>` };
36292 function linkEntity2(d2) {
36293 return { html: `<a class="error_entity_link">${d2}</a>` };
36295 function linkURL(d2) {
36296 return { html: `<a class="kr_external_link" target="_blank" href="${d2}">${d2}</a>` };
36298 function parse211(capture2) {
36300 const items = capture2.split(", ");
36301 items.forEach((item) => {
36302 let id2 = linkEntity2("n" + item.slice(1));
36305 return newList.join(", ");
36307 function parse231(capture2) {
36309 const items = capture2.split("),");
36310 items.forEach((item) => {
36311 const match = item.match(/\#(\d+)\((.+)\)?/);
36312 if (match !== null && match.length > 2) {
36314 linkEntity2("w" + match[1]) + " " + _t("QA.keepRight.errorTypes.231.layer", { layer: match[2] })
36318 return newList.join(", ");
36320 function parse294(capture2) {
36322 const items = capture2.split(",");
36323 items.forEach((item) => {
36324 item = item.split(" ");
36325 const role = `"${item[0]}"`;
36326 const idType2 = item[1].slice(0, 1);
36327 let id2 = item[2].slice(1);
36328 id2 = linkEntity2(idType2 + id2);
36329 newList.push(`${role} ${item[1]} ${id2}`);
36331 return newList.join(", ");
36333 function parse370(capture2) {
36336 const match = capture2.match(/\(including the name (\'.+\')\)/);
36337 if (match && match.length) {
36338 return _t("QA.keepRight.errorTypes.370.including_the_name", { name: match[1] });
36342 function parse20(capture2) {
36344 const items = capture2.split(",");
36345 items.forEach((item) => {
36346 const id2 = linkEntity2("n" + item.slice(1));
36349 return newList.join(", ");
36352 var keepRight_default = {
36353 title: "keepRight",
36355 _mainFileFetcher.get("keepRight").then((d2) => _krData = d2);
36359 this.event = utilRebind(this, dispatch2, "on");
36363 Object.values(_cache.inflightTile).forEach(abortRequest);
36371 rtree: new import_rbush.default()
36374 // KeepRight API: http://osm.mueschelsoft.de/keepright/interfacing.php
36375 loadIssues(projection2) {
36380 const tiles = tiler.zoomExtent([_tileZoom, _tileZoom]).getTiles(projection2);
36381 abortUnwantedRequests(_cache, tiles);
36382 tiles.forEach((tile) => {
36383 if (_cache.loadedTile[tile.id] || _cache.inflightTile[tile.id])
36385 const [left, top, right, bottom] = tile.extent.rectangle();
36386 const params = Object.assign({}, options2, { left, bottom, right, top });
36387 const url = `${_krUrlRoot}/export.php?` + utilQsString(params);
36388 const controller = new AbortController();
36389 _cache.inflightTile[tile.id] = controller;
36390 json_default(url, { signal: controller.signal }).then((data) => {
36391 delete _cache.inflightTile[tile.id];
36392 _cache.loadedTile[tile.id] = true;
36393 if (!data || !data.features || !data.features.length) {
36394 throw new Error("No Data");
36396 data.features.forEach((feature3) => {
36399 error_type: itemType,
36402 object_id: objectId,
36403 object_type: objectType,
36409 geometry: { coordinates: loc },
36410 properties: { description = "" }
36412 const issueTemplate = _krData.errorTypes[itemType];
36413 const parentIssueType = (Math.floor(itemType / 10) * 10).toString();
36414 const whichType = issueTemplate ? itemType : parentIssueType;
36415 const whichTemplate = _krData.errorTypes[whichType];
36416 switch (whichType) {
36418 description = `This feature has a FIXME tag: ${description}`;
36422 description = description.replace("A turn-", "This turn-");
36429 description = `This turn-restriction~${description}`;
36432 description = "This highway is missing a maxspeed tag";
36437 description = `This feature~${description}`;
36440 let coincident = false;
36442 let delta = coincident ? [1e-5, 0] : [0, 1e-5];
36443 loc = geoVecAdd(loc, delta);
36444 let bbox2 = geoExtent(loc).bbox();
36445 coincident = _cache.rtree.search(bbox2).length;
36446 } while (coincident);
36447 let d2 = new QAItem(loc, this, itemType, id2, {
36452 severity: whichTemplate.severity || "error",
36458 d2.replacements = tokenReplacements(d2);
36459 _cache.data[id2] = d2;
36460 _cache.rtree.insert(encodeIssueRtree(d2));
36462 dispatch2.call("loaded");
36464 delete _cache.inflightTile[tile.id];
36465 _cache.loadedTile[tile.id] = true;
36469 postUpdate(d2, callback) {
36470 if (_cache.inflightPost[d2.id]) {
36471 return callback({ message: "Error update already inflight", status: -2 }, d2);
36473 const params = { schema: d2.schema, id: d2.id };
36474 if (d2.newStatus) {
36475 params.st = d2.newStatus;
36477 if (d2.newComment !== void 0) {
36478 params.co = d2.newComment;
36480 const url = `${_krUrlRoot}/comment.php?` + utilQsString(params);
36481 const controller = new AbortController();
36482 _cache.inflightPost[d2.id] = controller;
36483 json_default(url, { signal: controller.signal }).finally(() => {
36484 delete _cache.inflightPost[d2.id];
36485 if (d2.newStatus === "ignore") {
36486 this.removeItem(d2);
36487 } else if (d2.newStatus === "ignore_t") {
36488 this.removeItem(d2);
36489 _cache.closed[`${d2.schema}:${d2.id}`] = true;
36491 d2 = this.replaceItem(d2.update({
36492 comment: d2.newComment,
36493 newComment: void 0,
36498 callback(null, d2);
36501 // Get all cached QAItems covering the viewport
36502 getItems(projection2) {
36503 const viewport = projection2.clipExtent();
36504 const min3 = [viewport[0][0], viewport[1][1]];
36505 const max3 = [viewport[1][0], viewport[0][1]];
36506 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
36507 return _cache.rtree.search(bbox2).map((d2) => d2.data);
36509 // Get a QAItem from cache
36510 // NOTE: Don't change method name until UI v3 is merged
36512 return _cache.data[id2];
36514 // Replace a single QAItem in the cache
36515 replaceItem(item) {
36516 if (!(item instanceof QAItem) || !item.id)
36518 _cache.data[item.id] = item;
36519 updateRtree(encodeIssueRtree(item), true);
36522 // Remove a single QAItem from the cache
36524 if (!(item instanceof QAItem) || !item.id)
36526 delete _cache.data[item.id];
36527 updateRtree(encodeIssueRtree(item), false);
36530 return `${_krUrlRoot}/report_map.php?schema=${item.schema}&error=${item.id}`;
36532 // Get an array of issues closed during this session.
36533 // Used to populate `closed:keepright` changeset tag
36535 return Object.keys(_cache.closed).sort();
36539 // modules/services/improveOSM.js
36540 var import_rbush2 = __toESM(require_rbush_min());
36541 var tiler2 = utilTiler();
36542 var dispatch3 = dispatch_default("loaded");
36543 var _tileZoom2 = 14;
36544 var _impOsmUrls = {
36545 ow: "https://grab.community.improve-osm.org/directionOfFlowService",
36546 mr: "https://grab.community.improve-osm.org/missingGeoService",
36547 tr: "https://grab.community.improve-osm.org/turnRestrictionService"
36549 var _impOsmData = { icons: {} };
36551 function abortRequest2(i3) {
36552 Object.values(i3).forEach((controller) => {
36554 controller.abort();
36558 function abortUnwantedRequests2(cache, tiles) {
36559 Object.keys(cache.inflightTile).forEach((k2) => {
36560 const wanted = tiles.find((tile) => k2 === tile.id);
36562 abortRequest2(cache.inflightTile[k2]);
36563 delete cache.inflightTile[k2];
36567 function encodeIssueRtree2(d2) {
36568 return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
36570 function updateRtree2(item, replace) {
36571 _cache2.rtree.remove(item, (a2, b2) => a2.data.id === b2.data.id);
36573 _cache2.rtree.insert(item);
36576 function linkErrorObject(d2) {
36577 return { html: `<a class="error_object_link">${d2}</a>` };
36579 function linkEntity(d2) {
36580 return { html: `<a class="error_entity_link">${d2}</a>` };
36582 function pointAverage(points) {
36583 if (points.length) {
36584 const sum = points.reduce(
36585 (acc, point2) => geoVecAdd(acc, [point2.lon, point2.lat]),
36588 return geoVecScale(sum, 1 / points.length);
36593 function relativeBearing(p1, p2) {
36594 let angle2 = Math.atan2(p2.lon - p1.lon, p2.lat - p1.lat);
36596 angle2 += 2 * Math.PI;
36598 return angle2 * 180 / Math.PI;
36600 function cardinalDirection(bearing) {
36601 const dir = 45 * Math.round(bearing / 45);
36613 return _t(`QA.improveOSM.directions.${compass[dir]}`);
36615 function preventCoincident(loc, bumpUp) {
36616 let coincident = false;
36618 let delta = coincident ? [1e-5, 0] : bumpUp ? [0, 1e-5] : [0, 0];
36619 loc = geoVecAdd(loc, delta);
36620 let bbox2 = geoExtent(loc).bbox();
36621 coincident = _cache2.rtree.search(bbox2).length;
36622 } while (coincident);
36625 var improveOSM_default = {
36626 title: "improveOSM",
36628 _mainFileFetcher.get("qa_data").then((d2) => _impOsmData = d2.improveOSM);
36632 this.event = utilRebind(this, dispatch3, "on");
36636 Object.values(_cache2.inflightTile).forEach(abortRequest2);
36644 rtree: new import_rbush2.default()
36647 loadIssues(projection2) {
36652 // Use a high zoom so that clusters aren't returned
36654 const tiles = tiler2.zoomExtent([_tileZoom2, _tileZoom2]).getTiles(projection2);
36655 abortUnwantedRequests2(_cache2, tiles);
36656 tiles.forEach((tile) => {
36657 if (_cache2.loadedTile[tile.id] || _cache2.inflightTile[tile.id])
36659 const [east, north, west, south] = tile.extent.rectangle();
36660 const params = Object.assign({}, options2, { east, south, west, north });
36661 const requests = {};
36662 Object.keys(_impOsmUrls).forEach((k2) => {
36663 const kParams = Object.assign(
36666 k2 === "mr" ? { type: "PARKING,ROAD,BOTH,PATH" } : { confidenceLevel: "C1" }
36668 const url = `${_impOsmUrls[k2]}/search?` + utilQsString(kParams);
36669 const controller = new AbortController();
36670 requests[k2] = controller;
36671 json_default(url, { signal: controller.signal }).then((data) => {
36672 delete _cache2.inflightTile[tile.id][k2];
36673 if (!Object.keys(_cache2.inflightTile[tile.id]).length) {
36674 delete _cache2.inflightTile[tile.id];
36675 _cache2.loadedTile[tile.id] = true;
36677 if (data.roadSegments) {
36678 data.roadSegments.forEach((feature3) => {
36679 const { points, wayId, fromNodeId, toNodeId } = feature3;
36680 const itemId = `${wayId}${fromNodeId}${toNodeId}`;
36681 let mid = points.length / 2;
36683 if (mid % 1 === 0) {
36684 loc = pointAverage([points[mid - 1], points[mid]]);
36686 mid = points[Math.floor(mid)];
36687 loc = [mid.lon, mid.lat];
36689 loc = preventCoincident(loc, false);
36690 let d2 = new QAItem(loc, this, k2, itemId, {
36692 // used as a category
36694 // used to post changes
36702 d2.replacements = {
36703 percentage: feature3.percentOfTrips,
36704 num_trips: feature3.numberOfTrips,
36705 highway: linkErrorObject(_t("QA.keepRight.error_parts.highway")),
36706 from_node: linkEntity("n" + feature3.fromNodeId),
36707 to_node: linkEntity("n" + feature3.toNodeId)
36709 _cache2.data[d2.id] = d2;
36710 _cache2.rtree.insert(encodeIssueRtree2(d2));
36714 data.tiles.forEach((feature3) => {
36715 const { type: type2, x: x2, y: y2, numberOfTrips } = feature3;
36716 const geoType = type2.toLowerCase();
36717 const itemId = `${geoType}${x2}${y2}${numberOfTrips}`;
36718 let loc = pointAverage(feature3.points);
36719 loc = preventCoincident(loc, false);
36720 let d2 = new QAItem(loc, this, `${k2}-${geoType}`, itemId, {
36722 identifier: { x: x2, y: y2 }
36724 d2.replacements = {
36725 num_trips: numberOfTrips,
36726 geometry_type: _t(`QA.improveOSM.geometry_types.${geoType}`)
36728 if (numberOfTrips === -1) {
36729 d2.desc = _t("QA.improveOSM.error_types.mr.description_alt", d2.replacements);
36731 _cache2.data[d2.id] = d2;
36732 _cache2.rtree.insert(encodeIssueRtree2(d2));
36735 if (data.entities) {
36736 data.entities.forEach((feature3) => {
36737 const { point: point2, id: id2, segments, numberOfPasses, turnType } = feature3;
36738 const itemId = `${id2.replace(/[,:+#]/g, "_")}`;
36739 const loc = preventCoincident([point2.lon, point2.lat], true);
36740 const ids = id2.split(",");
36741 const from_way = ids[0];
36742 const via_node = ids[3];
36743 const to_way = ids[2].split(":")[1];
36744 let d2 = new QAItem(loc, this, k2, itemId, {
36747 objectId: via_node,
36750 const [p1, p2] = segments[0].points;
36751 const dir_of_travel = cardinalDirection(relativeBearing(p1, p2));
36752 d2.replacements = {
36753 num_passed: numberOfPasses,
36754 num_trips: segments[0].numberOfTrips,
36755 turn_restriction: turnType.toLowerCase(),
36756 from_way: linkEntity("w" + from_way),
36757 to_way: linkEntity("w" + to_way),
36758 travel_direction: dir_of_travel,
36759 junction: linkErrorObject(_t("QA.keepRight.error_parts.this_node"))
36761 _cache2.data[d2.id] = d2;
36762 _cache2.rtree.insert(encodeIssueRtree2(d2));
36763 dispatch3.call("loaded");
36767 delete _cache2.inflightTile[tile.id][k2];
36768 if (!Object.keys(_cache2.inflightTile[tile.id]).length) {
36769 delete _cache2.inflightTile[tile.id];
36770 _cache2.loadedTile[tile.id] = true;
36774 _cache2.inflightTile[tile.id] = requests;
36777 getComments(item) {
36778 if (item.comments) {
36779 return Promise.resolve(item);
36781 const key = item.issueKey;
36783 if (key === "ow") {
36784 qParams = item.identifier;
36785 } else if (key === "mr") {
36786 qParams.tileX = item.identifier.x;
36787 qParams.tileY = item.identifier.y;
36788 } else if (key === "tr") {
36789 qParams.targetId = item.identifier;
36791 const url = `${_impOsmUrls[key]}/retrieveComments?` + utilQsString(qParams);
36792 const cacheComments = (data) => {
36793 item.comments = data.comments ? data.comments.reverse() : [];
36794 this.replaceItem(item);
36796 return json_default(url).then(cacheComments).then(() => item);
36798 postUpdate(d2, callback) {
36799 if (!osm_default.authenticated()) {
36800 return callback({ message: "Not Authenticated", status: -3 }, d2);
36802 if (_cache2.inflightPost[d2.id]) {
36803 return callback({ message: "Error update already inflight", status: -2 }, d2);
36805 osm_default.userDetails(sendPayload.bind(this));
36806 function sendPayload(err, user) {
36808 return callback(err, d2);
36810 const key = d2.issueKey;
36811 const url = `${_impOsmUrls[key]}/comment`;
36813 username: user.display_name,
36814 targetIds: [d2.identifier]
36816 if (d2.newStatus) {
36817 payload.status = d2.newStatus;
36818 payload.text = "status changed";
36820 if (d2.newComment) {
36821 payload.text = d2.newComment;
36823 const controller = new AbortController();
36824 _cache2.inflightPost[d2.id] = controller;
36827 signal: controller.signal,
36828 body: JSON.stringify(payload)
36830 json_default(url, options2).then(() => {
36831 delete _cache2.inflightPost[d2.id];
36832 if (!d2.newStatus) {
36833 const now3 = /* @__PURE__ */ new Date();
36834 let comments = d2.comments ? d2.comments : [];
36836 username: payload.username,
36837 text: payload.text,
36838 timestamp: now3.getTime() / 1e3
36840 this.replaceItem(d2.update({
36845 this.removeItem(d2);
36846 if (d2.newStatus === "SOLVED") {
36847 if (!(d2.issueKey in _cache2.closed)) {
36848 _cache2.closed[d2.issueKey] = 0;
36850 _cache2.closed[d2.issueKey] += 1;
36854 callback(null, d2);
36855 }).catch((err2) => {
36856 delete _cache2.inflightPost[d2.id];
36858 callback(err2.message);
36862 // Get all cached QAItems covering the viewport
36863 getItems(projection2) {
36864 const viewport = projection2.clipExtent();
36865 const min3 = [viewport[0][0], viewport[1][1]];
36866 const max3 = [viewport[1][0], viewport[0][1]];
36867 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
36868 return _cache2.rtree.search(bbox2).map((d2) => d2.data);
36870 // Get a QAItem from cache
36871 // NOTE: Don't change method name until UI v3 is merged
36873 return _cache2.data[id2];
36875 // get the name of the icon to display for this item
36876 getIcon(itemType) {
36877 return _impOsmData.icons[itemType];
36879 // Replace a single QAItem in the cache
36880 replaceItem(issue) {
36881 if (!(issue instanceof QAItem) || !issue.id)
36883 _cache2.data[issue.id] = issue;
36884 updateRtree2(encodeIssueRtree2(issue), true);
36887 // Remove a single QAItem from the cache
36888 removeItem(issue) {
36889 if (!(issue instanceof QAItem) || !issue.id)
36891 delete _cache2.data[issue.id];
36892 updateRtree2(encodeIssueRtree2(issue), false);
36894 // Used to populate `closed:improveosm:*` changeset tags
36895 getClosedCounts() {
36896 return _cache2.closed;
36900 // modules/services/osmose.js
36901 var import_rbush3 = __toESM(require_rbush_min());
36903 // node_modules/marked/lib/marked.esm.js
36904 function _getDefaults() {
36915 langPrefix: "language-",
36922 smartypants: false,
36928 var _defaults = _getDefaults();
36929 function changeDefaults(newDefaults) {
36930 _defaults = newDefaults;
36932 var escapeTest = /[&<>"']/;
36933 var escapeReplace = new RegExp(escapeTest.source, "g");
36934 var escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
36935 var escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g");
36936 var escapeReplacements = {
36943 var getEscapeReplacement = (ch) => escapeReplacements[ch];
36944 function escape4(html2, encode) {
36946 if (escapeTest.test(html2)) {
36947 return html2.replace(escapeReplace, getEscapeReplacement);
36950 if (escapeTestNoEncode.test(html2)) {
36951 return html2.replace(escapeReplaceNoEncode, getEscapeReplacement);
36956 var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
36957 function unescape3(html2) {
36958 return html2.replace(unescapeTest, (_2, n3) => {
36959 n3 = n3.toLowerCase();
36960 if (n3 === "colon")
36962 if (n3.charAt(0) === "#") {
36963 return n3.charAt(1) === "x" ? String.fromCharCode(parseInt(n3.substring(2), 16)) : String.fromCharCode(+n3.substring(1));
36968 var caret = /(^|[^\[])\^/g;
36969 function edit(regex, opt) {
36970 regex = typeof regex === "string" ? regex : regex.source;
36973 replace: (name, val) => {
36974 val = typeof val === "object" && "source" in val ? val.source : val;
36975 val = val.replace(caret, "$1");
36976 regex = regex.replace(name, val);
36980 return new RegExp(regex, opt);
36985 var nonWordAndColonTest = /[^\w:]/g;
36986 var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
36987 function cleanUrl(sanitize, base, href) {
36991 prot = decodeURIComponent(unescape3(href)).replace(nonWordAndColonTest, "").toLowerCase();
36995 if (prot.indexOf("javascript:") === 0 || prot.indexOf("vbscript:") === 0 || prot.indexOf("data:") === 0) {
36999 if (base && !originIndependentUrl.test(href)) {
37000 href = resolveUrl(base, href);
37003 href = encodeURI(href).replace(/%25/g, "%");
37010 var justDomain = /^[^:]+:\/*[^/]*$/;
37011 var protocol = /^([^:]+:)[\s\S]*$/;
37012 var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
37013 function resolveUrl(base, href) {
37014 if (!baseUrls[" " + base]) {
37015 if (justDomain.test(base)) {
37016 baseUrls[" " + base] = base + "/";
37018 baseUrls[" " + base] = rtrim(base, "/", true);
37021 base = baseUrls[" " + base];
37022 const relativeBase = base.indexOf(":") === -1;
37023 if (href.substring(0, 2) === "//") {
37024 if (relativeBase) {
37027 return base.replace(protocol, "$1") + href;
37028 } else if (href.charAt(0) === "/") {
37029 if (relativeBase) {
37032 return base.replace(domain, "$1") + href;
37034 return base + href;
37037 var noopTest = { exec: () => null };
37038 function splitCells(tableRow, count) {
37039 const row = tableRow.replace(/\|/g, (match, offset, str2) => {
37040 let escaped = false, curr = offset;
37041 while (--curr >= 0 && str2[curr] === "\\")
37042 escaped = !escaped;
37048 }), cells = row.split(/ \|/);
37050 if (!cells[0].trim()) {
37053 if (cells.length > 0 && !cells[cells.length - 1].trim()) {
37057 if (cells.length > count) {
37058 cells.splice(count);
37060 while (cells.length < count)
37064 for (; i3 < cells.length; i3++) {
37065 cells[i3] = cells[i3].trim().replace(/\\\|/g, "|");
37069 function rtrim(str2, c2, invert) {
37070 const l2 = str2.length;
37075 while (suffLen < l2) {
37076 const currChar = str2.charAt(l2 - suffLen - 1);
37077 if (currChar === c2 && !invert) {
37079 } else if (currChar !== c2 && invert) {
37085 return str2.slice(0, l2 - suffLen);
37087 function findClosingBracket(str2, b2) {
37088 if (str2.indexOf(b2[1]) === -1) {
37091 const l2 = str2.length;
37092 let level = 0, i3 = 0;
37093 for (; i3 < l2; i3++) {
37094 if (str2[i3] === "\\") {
37096 } else if (str2[i3] === b2[0]) {
37098 } else if (str2[i3] === b2[1]) {
37107 function checkDeprecations(opt, callback) {
37108 if (!opt || opt.silent) {
37112 console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async");
37114 if (opt.sanitize || opt.sanitizer) {
37115 console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
37117 if (opt.highlight || opt.langPrefix !== "language-") {
37118 console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight.");
37121 console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`.");
37124 console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url.");
37126 if (opt.smartypants) {
37127 console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants.");
37130 console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml.");
37132 if (opt.headerIds || opt.headerPrefix) {
37133 console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`.");
37136 function outputLink(cap, link2, raw, lexer2) {
37137 const href = link2.href;
37138 const title = link2.title ? escape4(link2.title) : null;
37139 const text2 = cap[1].replace(/\\([\[\]])/g, "$1");
37140 if (cap[0].charAt(0) !== "!") {
37141 lexer2.state.inLink = true;
37148 tokens: lexer2.inlineTokens(text2)
37150 lexer2.state.inLink = false;
37158 text: escape4(text2)
37161 function indentCodeCompensation(raw, text2) {
37162 const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
37163 if (matchIndentToCode === null) {
37166 const indentToCode = matchIndentToCode[1];
37167 return text2.split("\n").map((node) => {
37168 const matchIndentInNode = node.match(/^\s+/);
37169 if (matchIndentInNode === null) {
37172 const [indentInNode] = matchIndentInNode;
37173 if (indentInNode.length >= indentToCode.length) {
37174 return node.slice(indentToCode.length);
37179 var _Tokenizer = class {
37183 constructor(options2) {
37184 this.options = options2 || _defaults;
37187 const cap = this.rules.block.newline.exec(src);
37188 if (cap && cap[0].length > 0) {
37196 const cap = this.rules.block.code.exec(src);
37198 const text2 = cap[0].replace(/^ {1,4}/gm, "");
37202 codeBlockStyle: "indented",
37203 text: !this.options.pedantic ? rtrim(text2, "\n") : text2
37208 const cap = this.rules.block.fences.exec(src);
37210 const raw = cap[0];
37211 const text2 = indentCodeCompensation(raw, cap[3] || "");
37215 lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, "$1") : cap[2],
37221 const cap = this.rules.block.heading.exec(src);
37223 let text2 = cap[2].trim();
37224 if (/#$/.test(text2)) {
37225 const trimmed = rtrim(text2, "#");
37226 if (this.options.pedantic) {
37227 text2 = trimmed.trim();
37228 } else if (!trimmed || / $/.test(trimmed)) {
37229 text2 = trimmed.trim();
37235 depth: cap[1].length,
37237 tokens: this.lexer.inline(text2)
37242 const cap = this.rules.block.hr.exec(src);
37251 const cap = this.rules.block.blockquote.exec(src);
37253 const text2 = cap[0].replace(/^ *>[ \t]?/gm, "");
37254 const top = this.lexer.state.top;
37255 this.lexer.state.top = true;
37256 const tokens = this.lexer.blockTokens(text2);
37257 this.lexer.state.top = top;
37259 type: "blockquote",
37267 let cap = this.rules.block.list.exec(src);
37269 let raw, istask, ischecked, indent2, i3, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;
37270 let bull = cap[1].trim();
37271 const isordered = bull.length > 1;
37275 ordered: isordered,
37276 start: isordered ? +bull.slice(0, -1) : "",
37280 bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
37281 if (this.options.pedantic) {
37282 bull = isordered ? bull : "[*+-]";
37284 const itemRegex = new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`);
37287 if (!(cap = itemRegex.exec(src))) {
37290 if (this.rules.block.hr.test(src)) {
37294 src = src.substring(raw.length);
37295 line = cap[2].split("\n", 1)[0].replace(/^\t+/, (t2) => " ".repeat(3 * t2.length));
37296 nextLine = src.split("\n", 1)[0];
37297 if (this.options.pedantic) {
37299 itemContents = line.trimLeft();
37301 indent2 = cap[2].search(/[^ ]/);
37302 indent2 = indent2 > 4 ? 1 : indent2;
37303 itemContents = line.slice(indent2);
37304 indent2 += cap[1].length;
37307 if (!line && /^ *$/.test(nextLine)) {
37308 raw += nextLine + "\n";
37309 src = src.substring(nextLine.length + 1);
37313 const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`);
37314 const hrRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
37315 const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}(?:\`\`\`|~~~)`);
37316 const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent2 - 1)}}#`);
37318 rawLine = src.split("\n", 1)[0];
37319 nextLine = rawLine;
37320 if (this.options.pedantic) {
37321 nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ");
37323 if (fencesBeginRegex.test(nextLine)) {
37326 if (headingBeginRegex.test(nextLine)) {
37329 if (nextBulletRegex.test(nextLine)) {
37332 if (hrRegex.test(src)) {
37335 if (nextLine.search(/[^ ]/) >= indent2 || !nextLine.trim()) {
37336 itemContents += "\n" + nextLine.slice(indent2);
37341 if (line.search(/[^ ]/) >= 4) {
37344 if (fencesBeginRegex.test(line)) {
37347 if (headingBeginRegex.test(line)) {
37350 if (hrRegex.test(line)) {
37353 itemContents += "\n" + nextLine;
37355 if (!blankLine && !nextLine.trim()) {
37358 raw += rawLine + "\n";
37359 src = src.substring(rawLine.length + 1);
37360 line = nextLine.slice(indent2);
37364 if (endsWithBlankLine) {
37366 } else if (/\n *\n *$/.test(raw)) {
37367 endsWithBlankLine = true;
37370 if (this.options.gfm) {
37371 istask = /^\[[ xX]\] /.exec(itemContents);
37373 ischecked = istask[0] !== "[ ] ";
37374 itemContents = itemContents.replace(/^\[[ xX]\] +/, "");
37381 checked: ischecked,
37387 list.items[list.items.length - 1].raw = raw.trimRight();
37388 list.items[list.items.length - 1].text = itemContents.trimRight();
37389 list.raw = list.raw.trimRight();
37390 const l2 = list.items.length;
37391 for (i3 = 0; i3 < l2; i3++) {
37392 this.lexer.state.top = false;
37393 list.items[i3].tokens = this.lexer.blockTokens(list.items[i3].text, []);
37395 const spacers = list.items[i3].tokens.filter((t2) => t2.type === "space");
37396 const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t2) => /\n.*\n/.test(t2.raw));
37397 list.loose = hasMultipleLineBreaks;
37401 for (i3 = 0; i3 < l2; i3++) {
37402 list.items[i3].loose = true;
37409 const cap = this.rules.block.html.exec(src);
37415 pre: !this.options.sanitizer && (cap[1] === "pre" || cap[1] === "script" || cap[1] === "style"),
37418 if (this.options.sanitize) {
37419 const text2 = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape4(cap[0]);
37420 const paragraph = token;
37421 paragraph.type = "paragraph";
37422 paragraph.text = text2;
37423 paragraph.tokens = this.lexer.inline(text2);
37429 const cap = this.rules.block.def.exec(src);
37431 const tag = cap[1].toLowerCase().replace(/\s+/g, " ");
37432 const href = cap[2] ? cap[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "";
37433 const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, "$1") : cap[3];
37444 const cap = this.rules.block.table.exec(src);
37449 header: splitCells(cap[1]).map((c2) => {
37450 return { text: c2 };
37452 align: cap[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
37453 rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, "").split("\n") : []
37455 if (item.header.length === item.align.length) {
37456 let l2 = item.align.length;
37457 let i3, j3, k2, row;
37458 for (i3 = 0; i3 < l2; i3++) {
37459 if (/^ *-+: *$/.test(item.align[i3])) {
37460 item.align[i3] = "right";
37461 } else if (/^ *:-+: *$/.test(item.align[i3])) {
37462 item.align[i3] = "center";
37463 } else if (/^ *:-+ *$/.test(item.align[i3])) {
37464 item.align[i3] = "left";
37466 item.align[i3] = null;
37469 l2 = item.rows.length;
37470 for (i3 = 0; i3 < l2; i3++) {
37471 item.rows[i3] = splitCells(item.rows[i3], item.header.length).map((c2) => {
37472 return { text: c2 };
37475 l2 = item.header.length;
37476 for (j3 = 0; j3 < l2; j3++) {
37477 item.header[j3].tokens = this.lexer.inline(item.header[j3].text);
37479 l2 = item.rows.length;
37480 for (j3 = 0; j3 < l2; j3++) {
37481 row = item.rows[j3];
37482 for (k2 = 0; k2 < row.length; k2++) {
37483 row[k2].tokens = this.lexer.inline(row[k2].text);
37491 const cap = this.rules.block.lheading.exec(src);
37496 depth: cap[2].charAt(0) === "=" ? 1 : 2,
37498 tokens: this.lexer.inline(cap[1])
37503 const cap = this.rules.block.paragraph.exec(src);
37505 const text2 = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
37510 tokens: this.lexer.inline(text2)
37515 const cap = this.rules.block.text.exec(src);
37521 tokens: this.lexer.inline(cap[0])
37526 const cap = this.rules.inline.escape.exec(src);
37531 text: escape4(cap[1])
37536 const cap = this.rules.inline.tag.exec(src);
37538 if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
37539 this.lexer.state.inLink = true;
37540 } else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
37541 this.lexer.state.inLink = false;
37543 if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
37544 this.lexer.state.inRawBlock = true;
37545 } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
37546 this.lexer.state.inRawBlock = false;
37549 type: this.options.sanitize ? "text" : "html",
37551 inLink: this.lexer.state.inLink,
37552 inRawBlock: this.lexer.state.inRawBlock,
37554 text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape4(cap[0]) : cap[0]
37559 const cap = this.rules.inline.link.exec(src);
37561 const trimmedUrl = cap[2].trim();
37562 if (!this.options.pedantic && /^</.test(trimmedUrl)) {
37563 if (!/>$/.test(trimmedUrl)) {
37566 const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
37567 if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
37571 const lastParenIndex = findClosingBracket(cap[2], "()");
37572 if (lastParenIndex > -1) {
37573 const start2 = cap[0].indexOf("!") === 0 ? 5 : 4;
37574 const linkLen = start2 + cap[1].length + lastParenIndex;
37575 cap[2] = cap[2].substring(0, lastParenIndex);
37576 cap[0] = cap[0].substring(0, linkLen).trim();
37582 if (this.options.pedantic) {
37583 const link2 = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
37589 title = cap[3] ? cap[3].slice(1, -1) : "";
37591 href = href.trim();
37592 if (/^</.test(href)) {
37593 if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
37594 href = href.slice(1);
37596 href = href.slice(1, -1);
37599 return outputLink(cap, {
37600 href: href ? href.replace(this.rules.inline._escapes, "$1") : href,
37601 title: title ? title.replace(this.rules.inline._escapes, "$1") : title
37602 }, cap[0], this.lexer);
37605 reflink(src, links) {
37607 if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
37608 let link2 = (cap[2] || cap[1]).replace(/\s+/g, " ");
37609 link2 = links[link2.toLowerCase()];
37611 const text2 = cap[0].charAt(0);
37618 return outputLink(cap, link2, cap[0], this.lexer);
37621 emStrong(src, maskedSrc, prevChar = "") {
37622 let match = this.rules.inline.emStrong.lDelim.exec(src);
37625 if (match[3] && prevChar.match(/[\p{L}\p{N}]/u))
37627 const nextChar = match[1] || match[2] || "";
37628 if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
37629 const lLength = [...match[0]].length - 1;
37630 let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
37631 const endReg = match[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
37632 endReg.lastIndex = 0;
37633 maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
37634 while ((match = endReg.exec(maskedSrc)) != null) {
37635 rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
37638 rLength = [...rDelim].length;
37639 if (match[3] || match[4]) {
37640 delimTotal += rLength;
37642 } else if (match[5] || match[6]) {
37643 if (lLength % 3 && !((lLength + rLength) % 3)) {
37644 midDelimTotal += rLength;
37648 delimTotal -= rLength;
37649 if (delimTotal > 0)
37651 rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
37652 const raw = [...src].slice(0, lLength + match.index + rLength + 1).join("");
37653 if (Math.min(lLength, rLength) % 2) {
37654 const text3 = raw.slice(1, -1);
37659 tokens: this.lexer.inlineTokens(text3)
37662 const text2 = raw.slice(2, -2);
37667 tokens: this.lexer.inlineTokens(text2)
37673 const cap = this.rules.inline.code.exec(src);
37675 let text2 = cap[2].replace(/\n/g, " ");
37676 const hasNonSpaceChars = /[^ ]/.test(text2);
37677 const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2);
37678 if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
37679 text2 = text2.substring(1, text2.length - 1);
37681 text2 = escape4(text2, true);
37690 const cap = this.rules.inline.br.exec(src);
37699 const cap = this.rules.inline.del.exec(src);
37705 tokens: this.lexer.inlineTokens(cap[2])
37709 autolink(src, mangle2) {
37710 const cap = this.rules.inline.autolink.exec(src);
37713 if (cap[2] === "@") {
37714 text2 = escape4(this.options.mangle ? mangle2(cap[1]) : cap[1]);
37715 href = "mailto:" + text2;
37717 text2 = escape4(cap[1]);
37735 url(src, mangle2) {
37737 if (cap = this.rules.inline.url.exec(src)) {
37739 if (cap[2] === "@") {
37740 text2 = escape4(this.options.mangle ? mangle2(cap[0]) : cap[0]);
37741 href = "mailto:" + text2;
37745 prevCapZero = cap[0];
37746 cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
37747 } while (prevCapZero !== cap[0]);
37748 text2 = escape4(cap[0]);
37749 if (cap[1] === "www.") {
37750 href = "http://" + cap[0];
37770 inlineText(src, smartypants2) {
37771 const cap = this.rules.inline.text.exec(src);
37774 if (this.lexer.state.inRawBlock) {
37775 text2 = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape4(cap[0]) : cap[0];
37777 text2 = escape4(this.options.smartypants ? smartypants2(cap[0]) : cap[0]);
37788 newline: /^(?: *(?:\n|$))+/,
37789 code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
37790 fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
37791 hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
37792 heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
37793 blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
37794 list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
37795 html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
37796 def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
37798 lheading: /^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
37799 // regex template, placeholders will be replaced according to different paragraph
37800 // interruption rules of commonmark and the original markdown spec:
37801 _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
37804 block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
37805 block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
37806 block.def = edit(block.def).replace("label", block._label).replace("title", block._title).getRegex();
37807 block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
37808 block.listItemStart = edit(/^( *)(bull) */).replace("bull", block.bullet).getRegex();
37809 block.list = edit(block.list).replace(/bull/g, block.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + block.def.source + ")").getRegex();
37810 block._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
37811 block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
37812 block.html = edit(block.html, "i").replace("comment", block._comment).replace("tag", block._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
37813 block.lheading = edit(block.lheading).replace(/bull/g, block.bullet).getRegex();
37814 block.paragraph = edit(block._paragraph).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
37815 block.blockquote = edit(block.blockquote).replace("paragraph", block.paragraph).getRegex();
37816 block.normal = { ...block };
37819 table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
37822 block.gfm.table = edit(block.gfm.table).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
37823 block.gfm.paragraph = edit(block._paragraph).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", block.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
37826 html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", block._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
37827 def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
37828 heading: /^(#{1,6})(.*)(?:\n+|$)/,
37830 lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
37831 paragraph: edit(block.normal._paragraph).replace("hr", block.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", block.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
37834 escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
37835 autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
37837 tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
37838 link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
37839 reflink: /^!?\[(label)\]\[(ref)\]/,
37840 nolink: /^!?\[(ref)\](?:\[\])?/,
37841 reflinkSearch: "reflink|nolink(?!\\()",
37843 lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,
37844 // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
37845 // | Skip orphan inside strong | Consume to delim | (1) #*** | (2) a***#, a*** | (3) #***a, ***a | (4) ***# | (5) #***# | (6) a***a
37846 rDelimAst: /^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,
37847 rDelimUnd: /^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/
37848 // ^- Not allowed for _
37850 code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
37851 br: /^( {2,}|\\)\n(?!\s*$)/,
37853 text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
37854 punctuation: /^((?![*_])[\spunctuation])/
37856 inline._punctuation = "\\p{P}$+<=>`^|~";
37857 inline.punctuation = edit(inline.punctuation, "u").replace(/punctuation/g, inline._punctuation).getRegex();
37858 inline.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
37859 inline.anyPunctuation = /\\[punct]/g;
37860 inline._escapes = /\\([punct])/g;
37861 inline._comment = edit(block._comment).replace("(?:-->|$)", "-->").getRegex();
37862 inline.emStrong.lDelim = edit(inline.emStrong.lDelim, "u").replace(/punct/g, inline._punctuation).getRegex();
37863 inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, "gu").replace(/punct/g, inline._punctuation).getRegex();
37864 inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, "gu").replace(/punct/g, inline._punctuation).getRegex();
37865 inline.anyPunctuation = edit(inline.anyPunctuation, "gu").replace(/punct/g, inline._punctuation).getRegex();
37866 inline._escapes = edit(inline._escapes, "gu").replace(/punct/g, inline._punctuation).getRegex();
37867 inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
37868 inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
37869 inline.autolink = edit(inline.autolink).replace("scheme", inline._scheme).replace("email", inline._email).getRegex();
37870 inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
37871 inline.tag = edit(inline.tag).replace("comment", inline._comment).replace("attribute", inline._attribute).getRegex();
37872 inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
37873 inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
37874 inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
37875 inline.link = edit(inline.link).replace("label", inline._label).replace("href", inline._href).replace("title", inline._title).getRegex();
37876 inline.reflink = edit(inline.reflink).replace("label", inline._label).replace("ref", block._label).getRegex();
37877 inline.nolink = edit(inline.nolink).replace("ref", block._label).getRegex();
37878 inline.reflinkSearch = edit(inline.reflinkSearch, "g").replace("reflink", inline.reflink).replace("nolink", inline.nolink).getRegex();
37879 inline.normal = { ...inline };
37880 inline.pedantic = {
37884 middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
37885 endAst: /\*\*(?!\*)/g,
37890 middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
37891 endAst: /\*(?!\*)/g,
37894 link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", inline._label).getRegex(),
37895 reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", inline._label).getRegex()
37899 escape: edit(inline.escape).replace("])", "~|])").getRegex(),
37900 _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
37901 url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
37902 _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
37903 del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
37904 text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
37906 inline.gfm.url = edit(inline.gfm.url, "i").replace("email", inline.gfm._extended_email).getRegex();
37909 br: edit(inline.br).replace("{2,}", "*").getRegex(),
37910 text: edit(inline.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
37912 function smartypants(text2) {
37913 return text2.replace(/---/g, "\u2014").replace(/--/g, "\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018").replace(/'/g, "\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201C").replace(/"/g, "\u201D").replace(/\.{3}/g, "\u2026");
37915 function mangle(text2) {
37916 let out = "", i3, ch;
37917 const l2 = text2.length;
37918 for (i3 = 0; i3 < l2; i3++) {
37919 ch = text2.charCodeAt(i3);
37920 if (Math.random() > 0.5) {
37921 ch = "x" + ch.toString(16);
37923 out += "&#" + ch + ";";
37927 var _Lexer = class __Lexer {
37933 constructor(options2) {
37935 this.tokens.links = /* @__PURE__ */ Object.create(null);
37936 this.options = options2 || _defaults;
37937 this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
37938 this.tokenizer = this.options.tokenizer;
37939 this.tokenizer.options = this.options;
37940 this.tokenizer.lexer = this;
37941 this.inlineQueue = [];
37948 block: block.normal,
37949 inline: inline.normal
37951 if (this.options.pedantic) {
37952 rules.block = block.pedantic;
37953 rules.inline = inline.pedantic;
37954 } else if (this.options.gfm) {
37955 rules.block = block.gfm;
37956 if (this.options.breaks) {
37957 rules.inline = inline.breaks;
37959 rules.inline = inline.gfm;
37962 this.tokenizer.rules = rules;
37967 static get rules() {
37974 * Static Lex Method
37976 static lex(src, options2) {
37977 const lexer2 = new __Lexer(options2);
37978 return lexer2.lex(src);
37981 * Static Lex Inline Method
37983 static lexInline(src, options2) {
37984 const lexer2 = new __Lexer(options2);
37985 return lexer2.inlineTokens(src);
37991 src = src.replace(/\r\n|\r/g, "\n");
37992 this.blockTokens(src, this.tokens);
37994 while (next = this.inlineQueue.shift()) {
37995 this.inlineTokens(next.src, next.tokens);
37997 return this.tokens;
37999 blockTokens(src, tokens = []) {
38000 if (this.options.pedantic) {
38001 src = src.replace(/\t/g, " ").replace(/^ +$/gm, "");
38003 src = src.replace(/^( *)(\t+)/gm, (_2, leading, tabs) => {
38004 return leading + " ".repeat(tabs.length);
38010 let lastParagraphClipped;
38012 if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => {
38013 if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
38014 src = src.substring(token.raw.length);
38015 tokens.push(token);
38022 if (token = this.tokenizer.space(src)) {
38023 src = src.substring(token.raw.length);
38024 if (token.raw.length === 1 && tokens.length > 0) {
38025 tokens[tokens.length - 1].raw += "\n";
38027 tokens.push(token);
38031 if (token = this.tokenizer.code(src)) {
38032 src = src.substring(token.raw.length);
38033 lastToken = tokens[tokens.length - 1];
38034 if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
38035 lastToken.raw += "\n" + token.raw;
38036 lastToken.text += "\n" + token.text;
38037 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38039 tokens.push(token);
38043 if (token = this.tokenizer.fences(src)) {
38044 src = src.substring(token.raw.length);
38045 tokens.push(token);
38048 if (token = this.tokenizer.heading(src)) {
38049 src = src.substring(token.raw.length);
38050 tokens.push(token);
38053 if (token = this.tokenizer.hr(src)) {
38054 src = src.substring(token.raw.length);
38055 tokens.push(token);
38058 if (token = this.tokenizer.blockquote(src)) {
38059 src = src.substring(token.raw.length);
38060 tokens.push(token);
38063 if (token = this.tokenizer.list(src)) {
38064 src = src.substring(token.raw.length);
38065 tokens.push(token);
38068 if (token = this.tokenizer.html(src)) {
38069 src = src.substring(token.raw.length);
38070 tokens.push(token);
38073 if (token = this.tokenizer.def(src)) {
38074 src = src.substring(token.raw.length);
38075 lastToken = tokens[tokens.length - 1];
38076 if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
38077 lastToken.raw += "\n" + token.raw;
38078 lastToken.text += "\n" + token.raw;
38079 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38080 } else if (!this.tokens.links[token.tag]) {
38081 this.tokens.links[token.tag] = {
38088 if (token = this.tokenizer.table(src)) {
38089 src = src.substring(token.raw.length);
38090 tokens.push(token);
38093 if (token = this.tokenizer.lheading(src)) {
38094 src = src.substring(token.raw.length);
38095 tokens.push(token);
38099 if (this.options.extensions && this.options.extensions.startBlock) {
38100 let startIndex = Infinity;
38101 const tempSrc = src.slice(1);
38103 this.options.extensions.startBlock.forEach((getStartIndex) => {
38104 tempStart = getStartIndex.call({ lexer: this }, tempSrc);
38105 if (typeof tempStart === "number" && tempStart >= 0) {
38106 startIndex = Math.min(startIndex, tempStart);
38109 if (startIndex < Infinity && startIndex >= 0) {
38110 cutSrc = src.substring(0, startIndex + 1);
38113 if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
38114 lastToken = tokens[tokens.length - 1];
38115 if (lastParagraphClipped && lastToken.type === "paragraph") {
38116 lastToken.raw += "\n" + token.raw;
38117 lastToken.text += "\n" + token.text;
38118 this.inlineQueue.pop();
38119 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38121 tokens.push(token);
38123 lastParagraphClipped = cutSrc.length !== src.length;
38124 src = src.substring(token.raw.length);
38127 if (token = this.tokenizer.text(src)) {
38128 src = src.substring(token.raw.length);
38129 lastToken = tokens[tokens.length - 1];
38130 if (lastToken && lastToken.type === "text") {
38131 lastToken.raw += "\n" + token.raw;
38132 lastToken.text += "\n" + token.text;
38133 this.inlineQueue.pop();
38134 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
38136 tokens.push(token);
38141 const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
38142 if (this.options.silent) {
38143 console.error(errMsg);
38146 throw new Error(errMsg);
38150 this.state.top = true;
38153 inline(src, tokens = []) {
38154 this.inlineQueue.push({ src, tokens });
38160 inlineTokens(src, tokens = []) {
38161 let token, lastToken, cutSrc;
38162 let maskedSrc = src;
38164 let keepPrevChar, prevChar;
38165 if (this.tokens.links) {
38166 const links = Object.keys(this.tokens.links);
38167 if (links.length > 0) {
38168 while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
38169 if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
38170 maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
38175 while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
38176 maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
38178 while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
38179 maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
38182 if (!keepPrevChar) {
38185 keepPrevChar = false;
38186 if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => {
38187 if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
38188 src = src.substring(token.raw.length);
38189 tokens.push(token);
38196 if (token = this.tokenizer.escape(src)) {
38197 src = src.substring(token.raw.length);
38198 tokens.push(token);
38201 if (token = this.tokenizer.tag(src)) {
38202 src = src.substring(token.raw.length);
38203 lastToken = tokens[tokens.length - 1];
38204 if (lastToken && token.type === "text" && lastToken.type === "text") {
38205 lastToken.raw += token.raw;
38206 lastToken.text += token.text;
38208 tokens.push(token);
38212 if (token = this.tokenizer.link(src)) {
38213 src = src.substring(token.raw.length);
38214 tokens.push(token);
38217 if (token = this.tokenizer.reflink(src, this.tokens.links)) {
38218 src = src.substring(token.raw.length);
38219 lastToken = tokens[tokens.length - 1];
38220 if (lastToken && token.type === "text" && lastToken.type === "text") {
38221 lastToken.raw += token.raw;
38222 lastToken.text += token.text;
38224 tokens.push(token);
38228 if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
38229 src = src.substring(token.raw.length);
38230 tokens.push(token);
38233 if (token = this.tokenizer.codespan(src)) {
38234 src = src.substring(token.raw.length);
38235 tokens.push(token);
38238 if (token = this.tokenizer.br(src)) {
38239 src = src.substring(token.raw.length);
38240 tokens.push(token);
38243 if (token = this.tokenizer.del(src)) {
38244 src = src.substring(token.raw.length);
38245 tokens.push(token);
38248 if (token = this.tokenizer.autolink(src, mangle)) {
38249 src = src.substring(token.raw.length);
38250 tokens.push(token);
38253 if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
38254 src = src.substring(token.raw.length);
38255 tokens.push(token);
38259 if (this.options.extensions && this.options.extensions.startInline) {
38260 let startIndex = Infinity;
38261 const tempSrc = src.slice(1);
38263 this.options.extensions.startInline.forEach((getStartIndex) => {
38264 tempStart = getStartIndex.call({ lexer: this }, tempSrc);
38265 if (typeof tempStart === "number" && tempStart >= 0) {
38266 startIndex = Math.min(startIndex, tempStart);
38269 if (startIndex < Infinity && startIndex >= 0) {
38270 cutSrc = src.substring(0, startIndex + 1);
38273 if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
38274 src = src.substring(token.raw.length);
38275 if (token.raw.slice(-1) !== "_") {
38276 prevChar = token.raw.slice(-1);
38278 keepPrevChar = true;
38279 lastToken = tokens[tokens.length - 1];
38280 if (lastToken && lastToken.type === "text") {
38281 lastToken.raw += token.raw;
38282 lastToken.text += token.text;
38284 tokens.push(token);
38289 const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
38290 if (this.options.silent) {
38291 console.error(errMsg);
38294 throw new Error(errMsg);
38301 var _Renderer = class {
38303 constructor(options2) {
38304 this.options = options2 || _defaults;
38306 code(code, infostring, escaped) {
38307 const lang = (infostring || "").match(/\S*/)[0];
38308 if (this.options.highlight) {
38309 const out = this.options.highlight(code, lang);
38310 if (out != null && out !== code) {
38315 code = code.replace(/\n$/, "") + "\n";
38317 return "<pre><code>" + (escaped ? code : escape4(code, true)) + "</code></pre>\n";
38319 return '<pre><code class="' + this.options.langPrefix + escape4(lang) + '">' + (escaped ? code : escape4(code, true)) + "</code></pre>\n";
38321 blockquote(quote2) {
38322 return `<blockquote>
38323 ${quote2}</blockquote>
38326 html(html2, block2) {
38329 heading(text2, level, raw, slugger) {
38330 if (this.options.headerIds) {
38331 const id2 = this.options.headerPrefix + slugger.slug(raw);
38332 return `<h${level} id="${id2}">${text2}</h${level}>
38335 return `<h${level}>${text2}</h${level}>
38339 return this.options.xhtml ? "<hr/>\n" : "<hr>\n";
38341 list(body, ordered, start2) {
38342 const type2 = ordered ? "ol" : "ul", startatt = ordered && start2 !== 1 ? ' start="' + start2 + '"' : "";
38343 return "<" + type2 + startatt + ">\n" + body + "</" + type2 + ">\n";
38345 listitem(text2, task, checked) {
38346 return `<li>${text2}</li>
38349 checkbox(checked) {
38350 return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
38353 return `<p>${text2}</p>
38356 table(header, body) {
38358 body = `<tbody>${body}</tbody>`;
38359 return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
38361 tablerow(content) {
38366 tablecell(content, flags) {
38367 const type2 = flags.header ? "th" : "td";
38368 const tag = flags.align ? `<${type2} align="${flags.align}">` : `<${type2}>`;
38369 return tag + content + `</${type2}>
38373 * span level renderer
38376 return `<strong>${text2}</strong>`;
38379 return `<em>${text2}</em>`;
38382 return `<code>${text2}</code>`;
38385 return this.options.xhtml ? "<br/>" : "<br>";
38388 return `<del>${text2}</del>`;
38390 link(href, title, text2) {
38391 href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
38392 if (href === null) {
38395 let out = '<a href="' + href + '"';
38397 out += ' title="' + title + '"';
38399 out += ">" + text2 + "</a>";
38402 image(href, title, text2) {
38403 href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
38404 if (href === null) {
38407 let out = `<img src="${href}" alt="${text2}"`;
38409 out += ` title="${title}"`;
38411 out += this.options.xhtml ? "/>" : ">";
38418 var _TextRenderer = class {
38419 // no need for block level renderers
38438 link(href, title, text2) {
38441 image(href, title, text2) {
38448 var _Slugger = class {
38454 return value.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
38457 * Finds the next safe (unique) slug to use
38459 getNextSafeSlug(originalSlug, isDryRun) {
38460 let slug = originalSlug;
38461 let occurenceAccumulator = 0;
38462 if (this.seen.hasOwnProperty(slug)) {
38463 occurenceAccumulator = this.seen[originalSlug];
38465 occurenceAccumulator++;
38466 slug = originalSlug + "-" + occurenceAccumulator;
38467 } while (this.seen.hasOwnProperty(slug));
38470 this.seen[originalSlug] = occurenceAccumulator;
38471 this.seen[slug] = 0;
38476 * Convert string to unique id
38478 slug(value, options2 = {}) {
38479 const slug = this.serialize(value);
38480 return this.getNextSafeSlug(slug, options2.dryrun);
38483 var _Parser = class __Parser {
38488 constructor(options2) {
38489 this.options = options2 || _defaults;
38490 this.options.renderer = this.options.renderer || new _Renderer();
38491 this.renderer = this.options.renderer;
38492 this.renderer.options = this.options;
38493 this.textRenderer = new _TextRenderer();
38494 this.slugger = new _Slugger();
38497 * Static Parse Method
38499 static parse(tokens, options2) {
38500 const parser3 = new __Parser(options2);
38501 return parser3.parse(tokens);
38504 * Static Parse Inline Method
38506 static parseInline(tokens, options2) {
38507 const parser3 = new __Parser(options2);
38508 return parser3.parseInline(tokens);
38513 parse(tokens, top = true) {
38514 let out = "", i3, j3, k2, l2, l3, row, cell, header, body, token, ordered, start2, loose, itemBody, item, checked, task, checkbox, ret;
38515 const l4 = tokens.length;
38516 for (i3 = 0; i3 < l4; i3++) {
38517 token = tokens[i3];
38518 if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
38519 ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
38520 if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(token.type)) {
38525 switch (token.type) {
38530 out += this.renderer.hr();
38534 out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape3(this.parseInline(token.tokens, this.textRenderer)), this.slugger);
38538 out += this.renderer.code(token.text, token.lang, !!token.escaped);
38544 l2 = token.header.length;
38545 for (j3 = 0; j3 < l2; j3++) {
38546 cell += this.renderer.tablecell(this.parseInline(token.header[j3].tokens), { header: true, align: token.align[j3] });
38548 header += this.renderer.tablerow(cell);
38550 l2 = token.rows.length;
38551 for (j3 = 0; j3 < l2; j3++) {
38552 row = token.rows[j3];
38555 for (k2 = 0; k2 < l3; k2++) {
38556 cell += this.renderer.tablecell(this.parseInline(row[k2].tokens), { header: false, align: token.align[k2] });
38558 body += this.renderer.tablerow(cell);
38560 out += this.renderer.table(header, body);
38563 case "blockquote": {
38564 body = this.parse(token.tokens);
38565 out += this.renderer.blockquote(body);
38569 ordered = token.ordered;
38570 start2 = token.start;
38571 loose = token.loose;
38572 l2 = token.items.length;
38574 for (j3 = 0; j3 < l2; j3++) {
38575 item = token.items[j3];
38576 checked = item.checked;
38580 checkbox = this.renderer.checkbox(!!checked);
38582 if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") {
38583 item.tokens[0].text = checkbox + " " + item.tokens[0].text;
38584 if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
38585 item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text;
38588 item.tokens.unshift({
38594 itemBody += checkbox;
38597 itemBody += this.parse(item.tokens, loose);
38598 body += this.renderer.listitem(itemBody, task, !!checked);
38600 out += this.renderer.list(body, ordered, start2);
38604 out += this.renderer.html(token.text, token.block);
38607 case "paragraph": {
38608 out += this.renderer.paragraph(this.parseInline(token.tokens));
38612 body = token.tokens ? this.parseInline(token.tokens) : token.text;
38613 while (i3 + 1 < l4 && tokens[i3 + 1].type === "text") {
38614 token = tokens[++i3];
38615 body += "\n" + (token.tokens ? this.parseInline(token.tokens) : token.text);
38617 out += top ? this.renderer.paragraph(body) : body;
38621 const errMsg = 'Token with "' + token.type + '" type was not found.';
38622 if (this.options.silent) {
38623 console.error(errMsg);
38626 throw new Error(errMsg);
38634 * Parse Inline Tokens
38636 parseInline(tokens, renderer) {
38637 renderer = renderer || this.renderer;
38638 let out = "", i3, token, ret;
38639 const l2 = tokens.length;
38640 for (i3 = 0; i3 < l2; i3++) {
38641 token = tokens[i3];
38642 if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
38643 ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
38644 if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(token.type)) {
38649 switch (token.type) {
38651 out += renderer.text(token.text);
38655 out += renderer.html(token.text);
38659 out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
38663 out += renderer.image(token.href, token.title, token.text);
38667 out += renderer.strong(this.parseInline(token.tokens, renderer));
38671 out += renderer.em(this.parseInline(token.tokens, renderer));
38675 out += renderer.codespan(token.text);
38679 out += renderer.br();
38683 out += renderer.del(this.parseInline(token.tokens, renderer));
38687 out += renderer.text(token.text);
38691 const errMsg = 'Token with "' + token.type + '" type was not found.';
38692 if (this.options.silent) {
38693 console.error(errMsg);
38696 throw new Error(errMsg);
38704 var _Hooks = class {
38706 constructor(options2) {
38707 this.options = options2 || _defaults;
38709 static passThroughHooks = /* @__PURE__ */ new Set([
38714 * Process markdown before marked
38716 preprocess(markdown) {
38720 * Process HTML after marked is finished
38722 postprocess(html2) {
38726 var Marked = class {
38727 defaults = _getDefaults();
38728 options = this.setOptions;
38729 parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);
38730 parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
38732 parser = _Parser.parse;
38733 Renderer = _Renderer;
38734 TextRenderer = _TextRenderer;
38736 lexer = _Lexer.lex;
38737 Tokenizer = _Tokenizer;
38738 Slugger = _Slugger;
38740 constructor(...args) {
38744 * Run callback for every token
38746 walkTokens(tokens, callback) {
38748 for (const token of tokens) {
38749 values = values.concat(callback.call(this, token));
38750 switch (token.type) {
38752 for (const cell of token.header) {
38753 values = values.concat(this.walkTokens(cell.tokens, callback));
38755 for (const row of token.rows) {
38756 for (const cell of row) {
38757 values = values.concat(this.walkTokens(cell.tokens, callback));
38763 values = values.concat(this.walkTokens(token.items, callback));
38767 if (this.defaults.extensions && this.defaults.extensions.childTokens && this.defaults.extensions.childTokens[token.type]) {
38768 this.defaults.extensions.childTokens[token.type].forEach((childTokens) => {
38769 values = values.concat(this.walkTokens(token[childTokens], callback));
38771 } else if (token.tokens) {
38772 values = values.concat(this.walkTokens(token.tokens, callback));
38780 const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
38781 args.forEach((pack) => {
38782 const opts = { ...pack };
38783 opts.async = this.defaults.async || opts.async || false;
38784 if (pack.extensions) {
38785 pack.extensions.forEach((ext) => {
38787 throw new Error("extension name required");
38789 if ("renderer" in ext) {
38790 const prevRenderer = extensions.renderers[ext.name];
38791 if (prevRenderer) {
38792 extensions.renderers[ext.name] = function(...args2) {
38793 let ret = ext.renderer.apply(this, args2);
38794 if (ret === false) {
38795 ret = prevRenderer.apply(this, args2);
38800 extensions.renderers[ext.name] = ext.renderer;
38803 if ("tokenizer" in ext) {
38804 if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
38805 throw new Error("extension level must be 'block' or 'inline'");
38807 if (extensions[ext.level]) {
38808 extensions[ext.level].unshift(ext.tokenizer);
38810 extensions[ext.level] = [ext.tokenizer];
38813 if (ext.level === "block") {
38814 if (extensions.startBlock) {
38815 extensions.startBlock.push(ext.start);
38817 extensions.startBlock = [ext.start];
38819 } else if (ext.level === "inline") {
38820 if (extensions.startInline) {
38821 extensions.startInline.push(ext.start);
38823 extensions.startInline = [ext.start];
38828 if ("childTokens" in ext && ext.childTokens) {
38829 extensions.childTokens[ext.name] = ext.childTokens;
38832 opts.extensions = extensions;
38834 if (pack.renderer) {
38835 const renderer = this.defaults.renderer || new _Renderer(this.defaults);
38836 for (const prop in pack.renderer) {
38837 const rendererFunc = pack.renderer[prop];
38838 const rendererKey = prop;
38839 const prevRenderer = renderer[rendererKey];
38840 renderer[rendererKey] = (...args2) => {
38841 let ret = rendererFunc.apply(renderer, args2);
38842 if (ret === false) {
38843 ret = prevRenderer.apply(renderer, args2);
38848 opts.renderer = renderer;
38850 if (pack.tokenizer) {
38851 const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
38852 for (const prop in pack.tokenizer) {
38853 const tokenizerFunc = pack.tokenizer[prop];
38854 const tokenizerKey = prop;
38855 const prevTokenizer = tokenizer[tokenizerKey];
38856 tokenizer[tokenizerKey] = (...args2) => {
38857 let ret = tokenizerFunc.apply(tokenizer, args2);
38858 if (ret === false) {
38859 ret = prevTokenizer.apply(tokenizer, args2);
38864 opts.tokenizer = tokenizer;
38867 const hooks = this.defaults.hooks || new _Hooks();
38868 for (const prop in pack.hooks) {
38869 const hooksFunc = pack.hooks[prop];
38870 const hooksKey = prop;
38871 const prevHook = hooks[hooksKey];
38872 if (_Hooks.passThroughHooks.has(prop)) {
38873 hooks[hooksKey] = (arg) => {
38874 if (this.defaults.async) {
38875 return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
38876 return prevHook.call(hooks, ret2);
38879 const ret = hooksFunc.call(hooks, arg);
38880 return prevHook.call(hooks, ret);
38883 hooks[hooksKey] = (...args2) => {
38884 let ret = hooksFunc.apply(hooks, args2);
38885 if (ret === false) {
38886 ret = prevHook.apply(hooks, args2);
38892 opts.hooks = hooks;
38894 if (pack.walkTokens) {
38895 const walkTokens2 = this.defaults.walkTokens;
38896 opts.walkTokens = function(token) {
38898 values.push(pack.walkTokens.call(this, token));
38900 values = values.concat(walkTokens2.call(this, token));
38905 this.defaults = { ...this.defaults, ...opts };
38910 this.defaults = { ...this.defaults, ...opt };
38913 #parseMarkdown(lexer2, parser3) {
38914 return (src, optOrCallback, callback) => {
38915 if (typeof optOrCallback === "function") {
38916 callback = optOrCallback;
38917 optOrCallback = null;
38919 const origOpt = { ...optOrCallback };
38920 const opt = { ...this.defaults, ...origOpt };
38921 const throwError = this.#onError(!!opt.silent, !!opt.async, callback);
38922 if (typeof src === "undefined" || src === null) {
38923 return throwError(new Error("marked(): input parameter is undefined or null"));
38925 if (typeof src !== "string") {
38926 return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
38928 checkDeprecations(opt, callback);
38930 opt.hooks.options = opt;
38933 const highlight = opt.highlight;
38937 src = opt.hooks.preprocess(src);
38939 tokens = lexer2(src, opt);
38941 return throwError(e3);
38943 const done = (err) => {
38947 if (opt.walkTokens) {
38948 this.walkTokens(tokens, opt.walkTokens);
38950 out = parser3(tokens, opt);
38952 out = opt.hooks.postprocess(out);
38958 opt.highlight = highlight;
38959 return err ? throwError(err) : callback(null, out);
38961 if (!highlight || highlight.length < 3) {
38964 delete opt.highlight;
38965 if (!tokens.length)
38968 this.walkTokens(tokens, (token) => {
38969 if (token.type === "code") {
38972 highlight(token.text, token.lang, (err, code) => {
38976 if (code != null && code !== token.text) {
38978 token.escaped = true;
38981 if (pending === 0) {
38988 if (pending === 0) {
38994 return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser3(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
38998 src = opt.hooks.preprocess(src);
39000 const tokens = lexer2(src, opt);
39001 if (opt.walkTokens) {
39002 this.walkTokens(tokens, opt.walkTokens);
39004 let html2 = parser3(tokens, opt);
39006 html2 = opt.hooks.postprocess(html2);
39010 return throwError(e3);
39014 #onError(silent, async, callback) {
39016 e3.message += "\nPlease report this to https://github.com/markedjs/marked.";
39018 const msg = "<p>An error occurred:</p><pre>" + escape4(e3.message + "", true) + "</pre>";
39020 return Promise.resolve(msg);
39023 callback(null, msg);
39029 return Promise.reject(e3);
39039 var markedInstance = new Marked();
39040 function marked(src, opt, callback) {
39041 return markedInstance.parse(src, opt, callback);
39043 marked.options = marked.setOptions = function(options2) {
39044 markedInstance.setOptions(options2);
39045 marked.defaults = markedInstance.defaults;
39046 changeDefaults(marked.defaults);
39049 marked.getDefaults = _getDefaults;
39050 marked.defaults = _defaults;
39051 marked.use = function(...args) {
39052 markedInstance.use(...args);
39053 marked.defaults = markedInstance.defaults;
39054 changeDefaults(marked.defaults);
39057 marked.walkTokens = function(tokens, callback) {
39058 return markedInstance.walkTokens(tokens, callback);
39060 marked.parseInline = markedInstance.parseInline;
39061 marked.Parser = _Parser;
39062 marked.parser = _Parser.parse;
39063 marked.Renderer = _Renderer;
39064 marked.TextRenderer = _TextRenderer;
39065 marked.Lexer = _Lexer;
39066 marked.lexer = _Lexer.lex;
39067 marked.Tokenizer = _Tokenizer;
39068 marked.Slugger = _Slugger;
39069 marked.Hooks = _Hooks;
39070 marked.parse = marked;
39071 var options = marked.options;
39072 var setOptions = marked.setOptions;
39073 var use = marked.use;
39074 var walkTokens = marked.walkTokens;
39075 var parseInline = marked.parseInline;
39076 var parser2 = _Parser.parse;
39077 var lexer = _Lexer.lex;
39079 // modules/services/osmose.js
39080 var tiler3 = utilTiler();
39081 var dispatch4 = dispatch_default("loaded");
39082 var _tileZoom3 = 14;
39083 var _osmoseUrlRoot = "https://osmose.openstreetmap.fr/api/0.3";
39084 var _osmoseData = { icons: {}, items: [] };
39086 function abortRequest3(controller) {
39088 controller.abort();
39091 function abortUnwantedRequests3(cache, tiles) {
39092 Object.keys(cache.inflightTile).forEach((k2) => {
39093 let wanted = tiles.find((tile) => k2 === tile.id);
39095 abortRequest3(cache.inflightTile[k2]);
39096 delete cache.inflightTile[k2];
39100 function encodeIssueRtree3(d2) {
39101 return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
39103 function updateRtree3(item, replace) {
39104 _cache3.rtree.remove(item, (a2, b2) => a2.data.id === b2.data.id);
39106 _cache3.rtree.insert(item);
39109 function preventCoincident2(loc) {
39110 let coincident = false;
39112 let delta = coincident ? [1e-5, 0] : [0, 1e-5];
39113 loc = geoVecAdd(loc, delta);
39114 let bbox2 = geoExtent(loc).bbox();
39115 coincident = _cache3.rtree.search(bbox2).length;
39116 } while (coincident);
39119 var osmose_default = {
39122 _mainFileFetcher.get("qa_data").then((d2) => {
39123 _osmoseData = d2.osmose;
39124 _osmoseData.items = Object.keys(d2.osmose.icons).map((s2) => s2.split("-")[0]).reduce((unique, item) => unique.indexOf(item) !== -1 ? unique : [...unique, item], []);
39129 this.event = utilRebind(this, dispatch4, "on");
39135 Object.values(_cache3.inflightTile).forEach(abortRequest3);
39136 _strings = _cache3.strings;
39137 _colors = _cache3.colors;
39145 rtree: new import_rbush3.default(),
39150 loadIssues(projection2) {
39152 // Tiles return a maximum # of issues
39153 // So we want to filter our request for only types iD supports
39154 item: _osmoseData.items
39156 let tiles = tiler3.zoomExtent([_tileZoom3, _tileZoom3]).getTiles(projection2);
39157 abortUnwantedRequests3(_cache3, tiles);
39158 tiles.forEach((tile) => {
39159 if (_cache3.loadedTile[tile.id] || _cache3.inflightTile[tile.id])
39161 let [x2, y2, z2] = tile.xyz;
39162 let url = `${_osmoseUrlRoot}/issues/${z2}/${x2}/${y2}.geojson?` + utilQsString(params);
39163 let controller = new AbortController();
39164 _cache3.inflightTile[tile.id] = controller;
39165 json_default(url, { signal: controller.signal }).then((data) => {
39166 delete _cache3.inflightTile[tile.id];
39167 _cache3.loadedTile[tile.id] = true;
39168 if (data.features) {
39169 data.features.forEach((issue) => {
39170 const { item, class: cl, uuid: id2 } = issue.properties;
39171 const itemType = `${item}-${cl}`;
39172 if (itemType in _osmoseData.icons) {
39173 let loc = issue.geometry.coordinates;
39174 loc = preventCoincident2(loc);
39175 let d2 = new QAItem(loc, this, itemType, id2, { item });
39176 if (item === 8300 || item === 8360) {
39179 _cache3.data[d2.id] = d2;
39180 _cache3.rtree.insert(encodeIssueRtree3(d2));
39184 dispatch4.call("loaded");
39186 delete _cache3.inflightTile[tile.id];
39187 _cache3.loadedTile[tile.id] = true;
39191 loadIssueDetail(issue) {
39192 if (issue.elems !== void 0) {
39193 return Promise.resolve(issue);
39195 const url = `${_osmoseUrlRoot}/issue/${issue.id}?langs=${_mainLocalizer.localeCode()}`;
39196 const cacheDetails = (data) => {
39197 issue.elems = data.elems.map((e3) => e3.type.substring(0, 1) + e3.id);
39198 issue.detail = data.subtitle ? marked(data.subtitle.auto) : "";
39199 this.replaceItem(issue);
39201 return json_default(url).then(cacheDetails).then(() => issue);
39203 loadStrings(locale2 = _mainLocalizer.localeCode()) {
39204 const items = Object.keys(_osmoseData.icons);
39205 if (locale2 in _cache3.strings && Object.keys(_cache3.strings[locale2]).length === items.length) {
39206 return Promise.resolve(_cache3.strings[locale2]);
39208 if (!(locale2 in _cache3.strings)) {
39209 _cache3.strings[locale2] = {};
39211 const allRequests = items.map((itemType) => {
39212 if (itemType in _cache3.strings[locale2])
39214 const cacheData = (data) => {
39215 const [cat = { items: [] }] = data.categories;
39216 const [item2 = { class: [] }] = cat.items;
39217 const [cl2 = null] = item2.class;
39219 console.log(`Osmose strings request (${itemType}) had unexpected data`);
39222 const { item: itemInt, color: color2 } = item2;
39223 if (/^#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/.test(color2)) {
39224 _cache3.colors[itemInt] = color2;
39226 const { title, detail, fix, trap } = cl2;
39227 let issueStrings = {};
39229 issueStrings.title = title.auto;
39231 issueStrings.detail = marked(detail.auto);
39233 issueStrings.trap = marked(trap.auto);
39235 issueStrings.fix = marked(fix.auto);
39236 _cache3.strings[locale2][itemType] = issueStrings;
39238 const [item, cl] = itemType.split("-");
39239 const url = `${_osmoseUrlRoot}/items/${item}/class/${cl}?langs=${locale2}`;
39240 return json_default(url).then(cacheData);
39241 }).filter(Boolean);
39242 return Promise.all(allRequests).then(() => _cache3.strings[locale2]);
39244 getStrings(itemType, locale2 = _mainLocalizer.localeCode()) {
39245 return locale2 in _cache3.strings ? _cache3.strings[locale2][itemType] : {};
39247 getColor(itemType) {
39248 return itemType in _cache3.colors ? _cache3.colors[itemType] : "#FFFFFF";
39250 postUpdate(issue, callback) {
39251 if (_cache3.inflightPost[issue.id]) {
39252 return callback({ message: "Issue update already inflight", status: -2 }, issue);
39254 const url = `${_osmoseUrlRoot}/issue/${issue.id}/${issue.newStatus}`;
39255 const controller = new AbortController();
39256 const after = () => {
39257 delete _cache3.inflightPost[issue.id];
39258 this.removeItem(issue);
39259 if (issue.newStatus === "done") {
39260 if (!(issue.item in _cache3.closed)) {
39261 _cache3.closed[issue.item] = 0;
39263 _cache3.closed[issue.item] += 1;
39266 callback(null, issue);
39268 _cache3.inflightPost[issue.id] = controller;
39269 fetch(url, { signal: controller.signal }).then(after).catch((err) => {
39270 delete _cache3.inflightPost[issue.id];
39272 callback(err.message);
39275 // Get all cached QAItems covering the viewport
39276 getItems(projection2) {
39277 const viewport = projection2.clipExtent();
39278 const min3 = [viewport[0][0], viewport[1][1]];
39279 const max3 = [viewport[1][0], viewport[0][1]];
39280 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
39281 return _cache3.rtree.search(bbox2).map((d2) => d2.data);
39283 // Get a QAItem from cache
39284 // NOTE: Don't change method name until UI v3 is merged
39286 return _cache3.data[id2];
39288 // get the name of the icon to display for this item
39289 getIcon(itemType) {
39290 return _osmoseData.icons[itemType];
39292 // Replace a single QAItem in the cache
39293 replaceItem(item) {
39294 if (!(item instanceof QAItem) || !item.id)
39296 _cache3.data[item.id] = item;
39297 updateRtree3(encodeIssueRtree3(item), true);
39300 // Remove a single QAItem from the cache
39302 if (!(item instanceof QAItem) || !item.id)
39304 delete _cache3.data[item.id];
39305 updateRtree3(encodeIssueRtree3(item), false);
39307 // Used to populate `closed:osmose:*` changeset tags
39308 getClosedCounts() {
39309 return _cache3.closed;
39312 return `https://osmose.openstreetmap.fr/en/error/${item.id}`;
39316 // modules/services/mapillary.js
39317 var import_pbf = __toESM(require_pbf());
39318 var import_rbush4 = __toESM(require_rbush_min());
39319 var import_vector_tile = __toESM(require_vector_tile());
39320 var accessToken = "MLY|4100327730013843|5bb78b81720791946a9a7b956c57b7cf";
39321 var apiUrl = "https://graph.mapillary.com/";
39322 var baseTileUrl = "https://tiles.mapillary.com/maps/vtp";
39323 var mapFeatureTileUrl = `${baseTileUrl}/mly_map_feature_point/2/{z}/{x}/{y}?access_token=${accessToken}`;
39324 var tileUrl = `${baseTileUrl}/mly1_public/2/{z}/{x}/{y}?access_token=${accessToken}`;
39325 var trafficSignTileUrl = `${baseTileUrl}/mly_map_feature_traffic_sign/2/{z}/{x}/{y}?access_token=${accessToken}`;
39326 var viewercss = "mapillary-js/mapillary.css";
39327 var viewerjs = "mapillary-js/mapillary.js";
39329 var dispatch5 = dispatch_default("change", "loadedImages", "loadedSigns", "loadedMapFeatures", "bearingChanged", "imageChanged");
39330 var _loadViewerPromise;
39331 var _mlyActiveImage;
39333 var _mlyFallback = false;
39334 var _mlyHighlightedDetection;
39335 var _mlyShowFeatureDetections = false;
39336 var _mlyShowSignDetections = false;
39338 var _mlyViewerFilter = ["all"];
39339 function loadTiles(which, url, maxZoom2, projection2) {
39340 const tiler9 = utilTiler().zoomExtent([minZoom, maxZoom2]).skipNullIsland(true);
39341 const tiles = tiler9.getTiles(projection2);
39342 tiles.forEach(function(tile) {
39343 loadTile(which, url, tile);
39346 function loadTile(which, url, tile) {
39347 const cache = _mlyCache.requests;
39348 const tileId = `${tile.id}-${which}`;
39349 if (cache.loaded[tileId] || cache.inflight[tileId])
39351 const controller = new AbortController();
39352 cache.inflight[tileId] = controller;
39353 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
39354 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
39355 if (!response.ok) {
39356 throw new Error(response.status + " " + response.statusText);
39358 cache.loaded[tileId] = true;
39359 delete cache.inflight[tileId];
39360 return response.arrayBuffer();
39361 }).then(function(data) {
39363 throw new Error("No Data");
39365 loadTileDataToCache(data, tile, which);
39366 if (which === "images") {
39367 dispatch5.call("loadedImages");
39368 } else if (which === "signs") {
39369 dispatch5.call("loadedSigns");
39370 } else if (which === "points") {
39371 dispatch5.call("loadedMapFeatures");
39373 }).catch(function() {
39374 cache.loaded[tileId] = true;
39375 delete cache.inflight[tileId];
39378 function loadTileDataToCache(data, tile, which) {
39379 const vectorTile = new import_vector_tile.VectorTile(new import_pbf.default(data));
39380 let features, cache, layer, i3, feature3, loc, d2;
39381 if (vectorTile.layers.hasOwnProperty("image")) {
39383 cache = _mlyCache.images;
39384 layer = vectorTile.layers.image;
39385 for (i3 = 0; i3 < layer.length; i3++) {
39386 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39387 loc = feature3.geometry.coordinates;
39390 captured_at: feature3.properties.captured_at,
39391 ca: feature3.properties.compass_angle,
39392 id: feature3.properties.id,
39393 is_pano: feature3.properties.is_pano,
39394 sequence_id: feature3.properties.sequence_id
39396 cache.forImageId[d2.id] = d2;
39406 cache.rtree.load(features);
39409 if (vectorTile.layers.hasOwnProperty("sequence")) {
39411 cache = _mlyCache.sequences;
39412 layer = vectorTile.layers.sequence;
39413 for (i3 = 0; i3 < layer.length; i3++) {
39414 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39415 if (cache.lineString[feature3.properties.id]) {
39416 cache.lineString[feature3.properties.id].push(feature3);
39418 cache.lineString[feature3.properties.id] = [feature3];
39422 if (vectorTile.layers.hasOwnProperty("point")) {
39424 cache = _mlyCache[which];
39425 layer = vectorTile.layers.point;
39426 for (i3 = 0; i3 < layer.length; i3++) {
39427 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39428 loc = feature3.geometry.coordinates;
39431 id: feature3.properties.id,
39432 first_seen_at: feature3.properties.first_seen_at,
39433 last_seen_at: feature3.properties.last_seen_at,
39434 value: feature3.properties.value
39445 cache.rtree.load(features);
39448 if (vectorTile.layers.hasOwnProperty("traffic_sign")) {
39450 cache = _mlyCache[which];
39451 layer = vectorTile.layers.traffic_sign;
39452 for (i3 = 0; i3 < layer.length; i3++) {
39453 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
39454 loc = feature3.geometry.coordinates;
39457 id: feature3.properties.id,
39458 first_seen_at: feature3.properties.first_seen_at,
39459 last_seen_at: feature3.properties.last_seen_at,
39460 value: feature3.properties.value
39471 cache.rtree.load(features);
39475 function loadData(url) {
39476 return fetch(url).then(function(response) {
39477 if (!response.ok) {
39478 throw new Error(response.status + " " + response.statusText);
39480 return response.json();
39481 }).then(function(result) {
39485 return result.data || [];
39488 function partitionViewport(projection2) {
39489 const z2 = geoScaleToZoom(projection2.scale());
39490 const z22 = Math.ceil(z2 * 2) / 2 + 2.5;
39491 const tiler9 = utilTiler().zoomExtent([z22, z22]);
39492 return tiler9.getTiles(projection2).map(function(tile) {
39493 return tile.extent;
39496 function searchLimited(limit, projection2, rtree) {
39497 limit = limit || 5;
39498 return partitionViewport(projection2).reduce(function(result, extent) {
39499 const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
39502 return found.length ? result.concat(found) : result;
39505 var mapillary_default = {
39506 // Initialize Mapillary
39511 this.event = utilRebind(this, dispatch5, "on");
39513 // Reset cache and state
39514 reset: function() {
39516 Object.values(_mlyCache.requests.inflight).forEach(function(request3) {
39521 images: { rtree: new import_rbush4.default(), forImageId: {} },
39522 image_detections: { forImageId: {} },
39523 signs: { rtree: new import_rbush4.default() },
39524 points: { rtree: new import_rbush4.default() },
39525 sequences: { rtree: new import_rbush4.default(), lineString: {} },
39526 requests: { loaded: {}, inflight: {} }
39528 _mlyActiveImage = null;
39530 // Get visible images
39531 images: function(projection2) {
39533 return searchLimited(limit, projection2, _mlyCache.images.rtree);
39535 // Get visible traffic signs
39536 signs: function(projection2) {
39538 return searchLimited(limit, projection2, _mlyCache.signs.rtree);
39540 // Get visible map (point) features
39541 mapFeatures: function(projection2) {
39543 return searchLimited(limit, projection2, _mlyCache.points.rtree);
39545 // Get cached image by id
39546 cachedImage: function(imageId) {
39547 return _mlyCache.images.forImageId[imageId];
39549 // Get visible sequences
39550 sequences: function(projection2) {
39551 const viewport = projection2.clipExtent();
39552 const min3 = [viewport[0][0], viewport[1][1]];
39553 const max3 = [viewport[1][0], viewport[0][1]];
39554 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
39555 const sequenceIds = {};
39556 let lineStrings = [];
39557 _mlyCache.images.rtree.search(bbox2).forEach(function(d2) {
39558 if (d2.data.sequence_id) {
39559 sequenceIds[d2.data.sequence_id] = true;
39562 Object.keys(sequenceIds).forEach(function(sequenceId) {
39563 if (_mlyCache.sequences.lineString[sequenceId]) {
39564 lineStrings = lineStrings.concat(_mlyCache.sequences.lineString[sequenceId]);
39567 return lineStrings;
39569 // Load images in the visible area
39570 loadImages: function(projection2) {
39571 loadTiles("images", tileUrl, 14, projection2);
39573 // Load traffic signs in the visible area
39574 loadSigns: function(projection2) {
39575 loadTiles("signs", trafficSignTileUrl, 14, projection2);
39577 // Load map (point) features in the visible area
39578 loadMapFeatures: function(projection2) {
39579 loadTiles("points", mapFeatureTileUrl, 14, projection2);
39581 // Return a promise that resolves when the image viewer (Mapillary JS) library has finished loading
39582 ensureViewerLoaded: function(context) {
39583 if (_loadViewerPromise)
39584 return _loadViewerPromise;
39585 const wrap2 = context.container().select(".photoviewer").selectAll(".mly-wrapper").data([0]);
39586 wrap2.enter().append("div").attr("id", "ideditor-mly").attr("class", "photo-wrapper mly-wrapper").classed("hide", true);
39588 _loadViewerPromise = new Promise((resolve, reject) => {
39589 let loadedCount = 0;
39590 function loaded() {
39592 if (loadedCount === 2)
39595 const head = select_default2("head");
39596 head.selectAll("#ideditor-mapillary-viewercss").data([0]).enter().append("link").attr("id", "ideditor-mapillary-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(viewercss)).on("load.serviceMapillary", loaded).on("error.serviceMapillary", function() {
39599 head.selectAll("#ideditor-mapillary-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-mapillary-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(viewerjs)).on("load.serviceMapillary", loaded).on("error.serviceMapillary", function() {
39602 }).catch(function() {
39603 _loadViewerPromise = null;
39604 }).then(function() {
39605 that.initViewer(context);
39607 return _loadViewerPromise;
39609 // Load traffic sign image sprites
39610 loadSignResources: function(context) {
39611 context.ui().svgDefs.addSprites(
39612 ["mapillary-sprite"],
39614 /* don't override colors */
39618 // Load map (point) feature image sprites
39619 loadObjectResources: function(context) {
39620 context.ui().svgDefs.addSprites(
39621 ["mapillary-object-sprite"],
39623 /* don't override colors */
39627 // Remove previous detections in image viewer
39628 resetTags: function() {
39629 if (_mlyViewer && !_mlyFallback) {
39630 _mlyViewer.getComponent("tag").removeAll();
39633 // Show map feature detections in image viewer
39634 showFeatureDetections: function(value) {
39635 _mlyShowFeatureDetections = value;
39636 if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
39640 // Show traffic sign detections in image viewer
39641 showSignDetections: function(value) {
39642 _mlyShowSignDetections = value;
39643 if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
39647 // Apply filter to image viewer
39648 filterViewer: function(context) {
39649 const showsPano = context.photos().showsPanoramic();
39650 const showsFlat = context.photos().showsFlat();
39651 const fromDate = context.photos().fromDate();
39652 const toDate = context.photos().toDate();
39653 const filter2 = ["all"];
39655 filter2.push(["!=", "cameraType", "spherical"]);
39656 if (!showsFlat && showsPano)
39657 filter2.push(["==", "pano", true]);
39659 filter2.push([">=", "capturedAt", new Date(fromDate).getTime()]);
39662 filter2.push([">=", "capturedAt", new Date(toDate).getTime()]);
39665 _mlyViewer.setFilter(filter2);
39667 _mlyViewerFilter = filter2;
39670 // Make the image viewer visible
39671 showViewer: function(context) {
39672 const wrap2 = context.container().select(".photoviewer").classed("hide", false);
39673 const isHidden = wrap2.selectAll(".photo-wrapper.mly-wrapper.hide").size();
39674 if (isHidden && _mlyViewer) {
39675 wrap2.selectAll(".photo-wrapper:not(.mly-wrapper)").classed("hide", true);
39676 wrap2.selectAll(".photo-wrapper.mly-wrapper").classed("hide", false);
39677 _mlyViewer.resize();
39681 // Hide the image viewer and resets map markers
39682 hideViewer: function(context) {
39683 _mlyActiveImage = null;
39684 if (!_mlyFallback && _mlyViewer) {
39685 _mlyViewer.getComponent("sequence").stop();
39687 const viewer = context.container().select(".photoviewer");
39688 if (!viewer.empty())
39689 viewer.datum(null);
39690 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
39691 this.updateUrlImage(null);
39692 dispatch5.call("imageChanged");
39693 dispatch5.call("loadedMapFeatures");
39694 dispatch5.call("loadedSigns");
39695 return this.setStyles(context, null);
39697 // Update the URL with current image id
39698 updateUrlImage: function(imageId) {
39699 if (!window.mocha) {
39700 const hash = utilStringQs(window.location.hash);
39702 hash.photo = "mapillary/" + imageId;
39706 window.location.replace("#" + utilQsString(hash, true));
39709 // Highlight the detection in the viewer that is related to the clicked map feature
39710 highlightDetection: function(detection) {
39712 _mlyHighlightedDetection = detection.id;
39716 // Initialize image viewer (Mapillar JS)
39717 initViewer: function(context) {
39719 if (!window.mapillary)
39728 container: "ideditor-mly"
39730 if (!mapillary.isSupported() && mapillary.isFallbackSupported()) {
39731 _mlyFallback = true;
39746 _mlyViewer = new mapillary.Viewer(opts);
39747 _mlyViewer.on("image", imageChanged);
39748 _mlyViewer.on("bearing", bearingChanged);
39749 if (_mlyViewerFilter) {
39750 _mlyViewer.setFilter(_mlyViewerFilter);
39752 context.ui().photoviewer.on("resize.mapillary", function() {
39754 _mlyViewer.resize();
39756 function imageChanged(node) {
39758 const image = node.image;
39759 that.setActiveImage(image);
39760 that.setStyles(context, null);
39761 const loc = [image.originalLngLat.lng, image.originalLngLat.lat];
39762 context.map().centerEase(loc);
39763 that.updateUrlImage(image.id);
39764 if (_mlyShowFeatureDetections || _mlyShowSignDetections) {
39765 that.updateDetections(image.id, `${apiUrl}/${image.id}/detections?access_token=${accessToken}&fields=id,image,geometry,value`);
39767 dispatch5.call("imageChanged");
39769 function bearingChanged(e3) {
39770 dispatch5.call("bearingChanged", void 0, e3);
39773 // Move to an image
39774 selectImage: function(context, imageId) {
39775 if (_mlyViewer && imageId) {
39776 _mlyViewer.moveTo(imageId).catch(function(e3) {
39777 console.error("mly3", e3);
39782 // Return the currently displayed image
39783 getActiveImage: function() {
39784 return _mlyActiveImage;
39786 // Return a list of detection objects for the given id
39787 getDetections: function(id2) {
39788 return loadData(`${apiUrl}/${id2}/detections?access_token=${accessToken}&fields=id,value,image`);
39790 // Set the currently visible image
39791 setActiveImage: function(image) {
39793 _mlyActiveImage = {
39794 ca: image.originalCompassAngle,
39796 loc: [image.originalLngLat.lng, image.originalLngLat.lat],
39797 is_pano: image.cameraType === "spherical",
39798 sequence_id: image.sequenceId
39801 _mlyActiveImage = null;
39804 // Update the currently highlighted sequence and selected bubble.
39805 setStyles: function(context, hovered) {
39806 const hoveredImageId = hovered && hovered.id;
39807 const hoveredSequenceId = hovered && hovered.sequence_id;
39808 const selectedSequenceId = _mlyActiveImage && _mlyActiveImage.sequence_id;
39809 context.container().selectAll(".layer-mapillary .viewfield-group").classed("highlighted", function(d2) {
39810 return d2.sequence_id === selectedSequenceId || d2.id === hoveredImageId;
39811 }).classed("hovered", function(d2) {
39812 return d2.id === hoveredImageId;
39814 context.container().selectAll(".layer-mapillary .sequence").classed("highlighted", function(d2) {
39815 return d2.properties.id === hoveredSequenceId;
39816 }).classed("currentView", function(d2) {
39817 return d2.properties.id === selectedSequenceId;
39821 // Get detections for the current image and shows them in the image viewer
39822 updateDetections: function(imageId, url) {
39823 if (!_mlyViewer || _mlyFallback)
39827 const cache = _mlyCache.image_detections;
39828 if (cache.forImageId[imageId]) {
39829 showDetections(_mlyCache.image_detections.forImageId[imageId]);
39831 loadData(url).then((detections) => {
39832 detections.forEach(function(detection) {
39833 if (!cache.forImageId[imageId]) {
39834 cache.forImageId[imageId] = [];
39836 cache.forImageId[imageId].push({
39837 geometry: detection.geometry,
39840 value: detection.value
39843 showDetections(_mlyCache.image_detections.forImageId[imageId] || []);
39846 function showDetections(detections) {
39847 const tagComponent = _mlyViewer.getComponent("tag");
39848 detections.forEach(function(data) {
39849 const tag = makeTag(data);
39851 tagComponent.add([tag]);
39855 function makeTag(data) {
39856 const valueParts = data.value.split("--");
39857 if (!valueParts.length)
39861 let color2 = 16777215;
39862 if (_mlyHighlightedDetection === data.id) {
39864 text2 = valueParts[1];
39865 if (text2 === "flat" || text2 === "discrete" || text2 === "sign") {
39866 text2 = valueParts[2];
39868 text2 = text2.replace(/-/g, " ");
39869 text2 = text2.charAt(0).toUpperCase() + text2.slice(1);
39870 _mlyHighlightedDetection = null;
39872 var decodedGeometry = window.atob(data.geometry);
39873 var uintArray = new Uint8Array(decodedGeometry.length);
39874 for (var i3 = 0; i3 < decodedGeometry.length; i3++) {
39875 uintArray[i3] = decodedGeometry.charCodeAt(i3);
39877 const tile = new import_vector_tile.VectorTile(new import_pbf.default(uintArray.buffer));
39878 const layer = tile.layers["mpy-or"];
39879 const geometries = layer.feature(0).loadGeometry();
39880 const polygon2 = geometries.map((ring) => ring.map((point2) => [point2.x / layer.extent, point2.y / layer.extent]));
39881 tag = new mapillary.OutlineTag(
39883 new mapillary.PolygonGeometry(polygon2[0]),
39896 // Return the current cache
39897 cache: function() {
39902 // modules/core/validation/models.js
39903 function validationIssue(attrs) {
39904 this.type = attrs.type;
39905 this.subtype = attrs.subtype;
39906 this.severity = attrs.severity;
39907 this.message = attrs.message;
39908 this.reference = attrs.reference;
39909 this.entityIds = attrs.entityIds;
39910 this.loc = attrs.loc;
39911 this.data = attrs.data;
39912 this.dynamicFixes = attrs.dynamicFixes;
39913 this.hash = attrs.hash;
39914 this.id = generateID.apply(this);
39915 this.key = generateKey.apply(this);
39916 this.autoFix = null;
39917 function generateID() {
39918 var parts = [this.type];
39920 parts.push(this.hash);
39922 if (this.subtype) {
39923 parts.push(this.subtype);
39925 if (this.entityIds) {
39926 var entityKeys = this.entityIds.slice().sort();
39927 parts.push.apply(parts, entityKeys);
39929 return parts.join(":");
39931 function generateKey() {
39932 return this.id + ":" + Date.now().toString();
39934 this.extent = function(resolver) {
39936 return geoExtent(this.loc);
39938 if (this.entityIds && this.entityIds.length) {
39939 return this.entityIds.reduce(function(extent, entityId) {
39940 return extent.extend(resolver.entity(entityId).extent(resolver));
39945 this.fixes = function(context) {
39946 var fixes = this.dynamicFixes ? this.dynamicFixes(context) : [];
39948 if (issue.severity === "warning") {
39949 fixes.push(new validationIssueFix({
39950 title: _t.append("issues.fix.ignore_issue.title"),
39951 icon: "iD-icon-close",
39952 onClick: function() {
39953 context.validator().ignoreIssue(this.issue.id);
39957 fixes.forEach(function(fix) {
39958 fix.id = fix.title.stringId;
39960 if (fix.autoArgs) {
39961 issue.autoFix = fix;
39967 function validationIssueFix(attrs) {
39968 this.title = attrs.title;
39969 this.onClick = attrs.onClick;
39970 this.disabledReason = attrs.disabledReason;
39971 this.icon = attrs.icon;
39972 this.entityIds = attrs.entityIds || [];
39973 this.autoArgs = attrs.autoArgs;
39977 // modules/services/maprules.js
39978 var buildRuleChecks = function() {
39980 equals: function(equals) {
39981 return function(tags) {
39982 return Object.keys(equals).every(function(k2) {
39983 return equals[k2] === tags[k2];
39987 notEquals: function(notEquals) {
39988 return function(tags) {
39989 return Object.keys(notEquals).some(function(k2) {
39990 return notEquals[k2] !== tags[k2];
39994 absence: function(absence) {
39995 return function(tags) {
39996 return Object.keys(tags).indexOf(absence) === -1;
39999 presence: function(presence) {
40000 return function(tags) {
40001 return Object.keys(tags).indexOf(presence) > -1;
40004 greaterThan: function(greaterThan) {
40005 var key = Object.keys(greaterThan)[0];
40006 var value = greaterThan[key];
40007 return function(tags) {
40008 return tags[key] > value;
40011 greaterThanEqual: function(greaterThanEqual) {
40012 var key = Object.keys(greaterThanEqual)[0];
40013 var value = greaterThanEqual[key];
40014 return function(tags) {
40015 return tags[key] >= value;
40018 lessThan: function(lessThan) {
40019 var key = Object.keys(lessThan)[0];
40020 var value = lessThan[key];
40021 return function(tags) {
40022 return tags[key] < value;
40025 lessThanEqual: function(lessThanEqual) {
40026 var key = Object.keys(lessThanEqual)[0];
40027 var value = lessThanEqual[key];
40028 return function(tags) {
40029 return tags[key] <= value;
40032 positiveRegex: function(positiveRegex) {
40033 var tagKey = Object.keys(positiveRegex)[0];
40034 var expression = positiveRegex[tagKey].join("|");
40035 var regex = new RegExp(expression);
40036 return function(tags) {
40037 return regex.test(tags[tagKey]);
40040 negativeRegex: function(negativeRegex) {
40041 var tagKey = Object.keys(negativeRegex)[0];
40042 var expression = negativeRegex[tagKey].join("|");
40043 var regex = new RegExp(expression);
40044 return function(tags) {
40045 return !regex.test(tags[tagKey]);
40050 var buildLineKeys = function() {
40065 var maprules_default = {
40067 this._ruleChecks = buildRuleChecks();
40068 this._validationRules = [];
40069 this._areaKeys = osmAreaKeys;
40070 this._lineKeys = buildLineKeys();
40072 // list of rules only relevant to tag checks...
40073 filterRuleChecks: function(selector) {
40074 var _ruleChecks = this._ruleChecks;
40075 return Object.keys(selector).reduce(function(rules, key) {
40076 if (["geometry", "error", "warning"].indexOf(key) === -1) {
40077 rules.push(_ruleChecks[key](selector[key]));
40082 // builds tagMap from mapcss-parse selector object...
40083 buildTagMap: function(selector) {
40084 var getRegexValues = function(regexes) {
40085 return regexes.map(function(regex) {
40086 return regex.replace(/\$|\^/g, "");
40089 var tagMap = Object.keys(selector).reduce(function(expectedTags, key) {
40091 var isRegex = /regex/gi.test(key);
40092 var isEqual4 = /equals/gi.test(key);
40093 if (isRegex || isEqual4) {
40094 Object.keys(selector[key]).forEach(function(selectorKey) {
40095 values = isEqual4 ? [selector[key][selectorKey]] : getRegexValues(selector[key][selectorKey]);
40096 if (expectedTags.hasOwnProperty(selectorKey)) {
40097 values = values.concat(expectedTags[selectorKey]);
40099 expectedTags[selectorKey] = values;
40101 } else if (/(greater|less)Than(Equal)?|presence/g.test(key)) {
40102 var tagKey = /presence/.test(key) ? selector[key] : Object.keys(selector[key])[0];
40103 values = [selector[key][tagKey]];
40104 if (expectedTags.hasOwnProperty(tagKey)) {
40105 values = values.concat(expectedTags[tagKey]);
40107 expectedTags[tagKey] = values;
40109 return expectedTags;
40113 // inspired by osmWay#isArea()
40114 inferGeometry: function(tagMap) {
40115 var _lineKeys = this._lineKeys;
40116 var _areaKeys = this._areaKeys;
40117 var keyValueDoesNotImplyArea = function(key2) {
40118 return utilArrayIntersection(tagMap[key2], Object.keys(_areaKeys[key2])).length > 0;
40120 var keyValueImpliesLine = function(key2) {
40121 return utilArrayIntersection(tagMap[key2], Object.keys(_lineKeys[key2])).length > 0;
40123 if (tagMap.hasOwnProperty("area")) {
40124 if (tagMap.area.indexOf("yes") > -1) {
40127 if (tagMap.area.indexOf("no") > -1) {
40131 for (var key in tagMap) {
40132 if (key in _areaKeys && !keyValueDoesNotImplyArea(key)) {
40135 if (key in _lineKeys && keyValueImpliesLine(key)) {
40141 // adds from mapcss-parse selector check...
40142 addRule: function(selector) {
40144 // checks relevant to mapcss-selector
40145 checks: this.filterRuleChecks(selector),
40146 // true if all conditions for a tag error are true..
40147 matches: function(entity) {
40148 return this.checks.every(function(check) {
40149 return check(entity.tags);
40152 // borrowed from Way#isArea()
40153 inferredGeometry: this.inferGeometry(this.buildTagMap(selector), this._areaKeys),
40154 geometryMatches: function(entity, graph) {
40155 if (entity.type === "node" || entity.type === "relation") {
40156 return selector.geometry === entity.type;
40157 } else if (entity.type === "way") {
40158 return this.inferredGeometry === entity.geometry(graph);
40161 // when geometries match and tag matches are present, return a warning...
40162 findIssues: function(entity, graph, issues) {
40163 if (this.geometryMatches(entity, graph) && this.matches(entity)) {
40164 var severity = Object.keys(selector).indexOf("error") > -1 ? "error" : "warning";
40165 var message = selector[severity];
40166 issues.push(new validationIssue({
40169 message: function() {
40172 entityIds: [entity.id]
40177 this._validationRules.push(rule);
40179 clearRules: function() {
40180 this._validationRules = [];
40182 // returns validationRules...
40183 validationRules: function() {
40184 return this._validationRules;
40186 // returns ruleChecks
40187 ruleChecks: function() {
40188 return this._ruleChecks;
40192 // modules/services/nominatim.js
40193 var import_rbush7 = __toESM(require_rbush_min());
40195 // modules/core/difference.js
40196 var import_fast_deep_equal3 = __toESM(require_fast_deep_equal());
40197 function coreDifference(base, head) {
40199 var _didChange = {};
40201 function checkEntityID(id2) {
40202 var h2 = head.entities[id2];
40203 var b2 = base.entities[id2];
40209 _changes[id2] = { base: b2, head: h2 };
40210 _didChange.deletion = true;
40214 _changes[id2] = { base: b2, head: h2 };
40215 _didChange.addition = true;
40219 if (h2.members && b2.members && !(0, import_fast_deep_equal3.default)(h2.members, b2.members)) {
40220 _changes[id2] = { base: b2, head: h2 };
40221 _didChange.geometry = true;
40222 _didChange.properties = true;
40225 if (h2.loc && b2.loc && !geoVecEqual(h2.loc, b2.loc)) {
40226 _changes[id2] = { base: b2, head: h2 };
40227 _didChange.geometry = true;
40229 if (h2.nodes && b2.nodes && !(0, import_fast_deep_equal3.default)(h2.nodes, b2.nodes)) {
40230 _changes[id2] = { base: b2, head: h2 };
40231 _didChange.geometry = true;
40233 if (h2.tags && b2.tags && !(0, import_fast_deep_equal3.default)(h2.tags, b2.tags)) {
40234 _changes[id2] = { base: b2, head: h2 };
40235 _didChange.properties = true;
40240 var ids = utilArrayUniq(Object.keys(head.entities).concat(Object.keys(base.entities)));
40241 for (var i3 = 0; i3 < ids.length; i3++) {
40242 checkEntityID(ids[i3]);
40246 _diff.length = function length() {
40247 return Object.keys(_changes).length;
40249 _diff.changes = function changes() {
40252 _diff.didChange = _didChange;
40253 _diff.extantIDs = function extantIDs(includeRelMembers) {
40254 var result = /* @__PURE__ */ new Set();
40255 Object.keys(_changes).forEach(function(id2) {
40256 if (_changes[id2].head) {
40259 var h2 = _changes[id2].head;
40260 var b2 = _changes[id2].base;
40261 var entity = h2 || b2;
40262 if (includeRelMembers && entity.type === "relation") {
40263 var mh = h2 ? h2.members.map(function(m2) {
40266 var mb = b2 ? b2.members.map(function(m2) {
40269 utilArrayUnion(mh, mb).forEach(function(memberID) {
40270 if (head.hasEntity(memberID)) {
40271 result.add(memberID);
40276 return Array.from(result);
40278 _diff.modified = function modified() {
40280 Object.values(_changes).forEach(function(change) {
40281 if (change.base && change.head) {
40282 result.push(change.head);
40287 _diff.created = function created() {
40289 Object.values(_changes).forEach(function(change) {
40290 if (!change.base && change.head) {
40291 result.push(change.head);
40296 _diff.deleted = function deleted() {
40298 Object.values(_changes).forEach(function(change) {
40299 if (change.base && !change.head) {
40300 result.push(change.base);
40305 _diff.summary = function summary() {
40307 var keys2 = Object.keys(_changes);
40308 for (var i3 = 0; i3 < keys2.length; i3++) {
40309 var change = _changes[keys2[i3]];
40310 if (change.head && change.head.geometry(head) !== "vertex") {
40311 addEntity(change.head, head, change.base ? "modified" : "created");
40312 } else if (change.base && change.base.geometry(base) !== "vertex") {
40313 addEntity(change.base, base, "deleted");
40314 } else if (change.base && change.head) {
40315 var moved = !(0, import_fast_deep_equal3.default)(change.base.loc, change.head.loc);
40316 var retagged = !(0, import_fast_deep_equal3.default)(change.base.tags, change.head.tags);
40318 addParents(change.head);
40320 if (retagged || moved && change.head.hasInterestingTags()) {
40321 addEntity(change.head, head, "modified");
40323 } else if (change.head && change.head.hasInterestingTags()) {
40324 addEntity(change.head, head, "created");
40325 } else if (change.base && change.base.hasInterestingTags()) {
40326 addEntity(change.base, base, "deleted");
40329 return Object.values(relevant);
40330 function addEntity(entity, graph, changeType) {
40331 relevant[entity.id] = {
40337 function addParents(entity) {
40338 var parents = head.parentWays(entity);
40339 for (var j3 = parents.length - 1; j3 >= 0; j3--) {
40340 var parent = parents[j3];
40341 if (!(parent.id in relevant)) {
40342 addEntity(parent, head, "modified");
40347 _diff.complete = function complete(extent) {
40350 for (id2 in _changes) {
40351 change = _changes[id2];
40352 var h2 = change.head;
40353 var b2 = change.base;
40354 var entity = h2 || b2;
40356 if (extent && (!h2 || !h2.intersects(extent, head)) && (!b2 || !b2.intersects(extent, base))) {
40360 if (entity.type === "way") {
40361 var nh = h2 ? h2.nodes : [];
40362 var nb = b2 ? b2.nodes : [];
40364 diff = utilArrayDifference(nh, nb);
40365 for (i3 = 0; i3 < diff.length; i3++) {
40366 result[diff[i3]] = head.hasEntity(diff[i3]);
40368 diff = utilArrayDifference(nb, nh);
40369 for (i3 = 0; i3 < diff.length; i3++) {
40370 result[diff[i3]] = head.hasEntity(diff[i3]);
40373 if (entity.type === "relation" && entity.isMultipolygon()) {
40374 var mh = h2 ? h2.members.map(function(m2) {
40377 var mb = b2 ? b2.members.map(function(m2) {
40380 var ids = utilArrayUnion(mh, mb);
40381 for (i3 = 0; i3 < ids.length; i3++) {
40382 var member = head.hasEntity(ids[i3]);
40385 if (extent && !member.intersects(extent, head))
40387 result[ids[i3]] = member;
40390 addParents(head.parentWays(entity), result);
40391 addParents(head.parentRelations(entity), result);
40394 function addParents(parents, result2) {
40395 for (var i4 = 0; i4 < parents.length; i4++) {
40396 var parent = parents[i4];
40397 if (parent.id in result2)
40399 result2[parent.id] = parent;
40400 addParents(head.parentRelations(parent), result2);
40407 // modules/core/tree.js
40408 var import_rbush5 = __toESM(require_rbush_min());
40409 function coreTree(head) {
40410 var _rtree = new import_rbush5.default();
40412 var _segmentsRTree = new import_rbush5.default();
40413 var _segmentsBBoxes = {};
40414 var _segmentsByWayId = {};
40416 function entityBBox(entity) {
40417 var bbox2 = entity.extent(head).bbox();
40418 bbox2.id = entity.id;
40419 _bboxes[entity.id] = bbox2;
40422 function segmentBBox(segment) {
40423 var extent = segment.extent(head);
40426 var bbox2 = extent.bbox();
40427 bbox2.segment = segment;
40428 _segmentsBBoxes[segment.id] = bbox2;
40431 function removeEntity(entity) {
40432 _rtree.remove(_bboxes[entity.id]);
40433 delete _bboxes[entity.id];
40434 if (_segmentsByWayId[entity.id]) {
40435 _segmentsByWayId[entity.id].forEach(function(segment) {
40436 _segmentsRTree.remove(_segmentsBBoxes[segment.id]);
40437 delete _segmentsBBoxes[segment.id];
40439 delete _segmentsByWayId[entity.id];
40442 function loadEntities(entities) {
40443 _rtree.load(entities.map(entityBBox));
40445 entities.forEach(function(entity) {
40446 if (entity.segments) {
40447 var entitySegments = entity.segments(head);
40448 _segmentsByWayId[entity.id] = entitySegments;
40449 segments = segments.concat(entitySegments);
40452 if (segments.length)
40453 _segmentsRTree.load(segments.map(segmentBBox).filter(Boolean));
40455 function updateParents(entity, insertions, memo) {
40456 head.parentWays(entity).forEach(function(way) {
40457 if (_bboxes[way.id]) {
40459 insertions[way.id] = way;
40461 updateParents(way, insertions, memo);
40463 head.parentRelations(entity).forEach(function(relation) {
40464 if (memo[entity.id])
40466 memo[entity.id] = true;
40467 if (_bboxes[relation.id]) {
40468 removeEntity(relation);
40469 insertions[relation.id] = relation;
40471 updateParents(relation, insertions, memo);
40474 tree.rebase = function(entities, force) {
40475 var insertions = {};
40476 for (var i3 = 0; i3 < entities.length; i3++) {
40477 var entity = entities[i3];
40478 if (!entity.visible)
40480 if (head.entities.hasOwnProperty(entity.id) || _bboxes[entity.id]) {
40483 } else if (_bboxes[entity.id]) {
40484 removeEntity(entity);
40487 insertions[entity.id] = entity;
40488 updateParents(entity, insertions, {});
40490 loadEntities(Object.values(insertions));
40493 function updateToGraph(graph) {
40494 if (graph === head)
40496 var diff = coreDifference(head, graph);
40498 var changed = diff.didChange;
40499 if (!changed.addition && !changed.deletion && !changed.geometry)
40501 var insertions = {};
40502 if (changed.deletion) {
40503 diff.deleted().forEach(function(entity) {
40504 removeEntity(entity);
40507 if (changed.geometry) {
40508 diff.modified().forEach(function(entity) {
40509 removeEntity(entity);
40510 insertions[entity.id] = entity;
40511 updateParents(entity, insertions, {});
40514 if (changed.addition) {
40515 diff.created().forEach(function(entity) {
40516 insertions[entity.id] = entity;
40519 loadEntities(Object.values(insertions));
40521 tree.intersects = function(extent, graph) {
40522 updateToGraph(graph);
40523 return _rtree.search(extent.bbox()).map(function(bbox2) {
40524 return graph.entity(bbox2.id);
40527 tree.waySegments = function(extent, graph) {
40528 updateToGraph(graph);
40529 return _segmentsRTree.search(extent.bbox()).map(function(bbox2) {
40530 return bbox2.segment;
40536 // modules/svg/icon.js
40537 function svgIcon(name, svgklass, useklass) {
40538 return function drawIcon(selection2) {
40539 selection2.selectAll("svg.icon" + (svgklass ? "." + svgklass.split(" ")[0] : "")).data([0]).enter().append("svg").attr("class", "icon " + (svgklass || "")).append("use").attr("xlink:href", name).attr("class", useklass);
40543 // modules/ui/modal.js
40544 function uiModal(selection2, blocking) {
40545 let keybinding = utilKeybinding("modal");
40546 let previous = selection2.select("div.modal");
40547 let animate = previous.empty();
40548 previous.transition().duration(200).style("opacity", 0).remove();
40549 let shaded = selection2.append("div").attr("class", "shaded").style("opacity", 0);
40550 shaded.close = () => {
40551 shaded.transition().duration(200).style("opacity", 0).remove();
40552 modal.transition().duration(200).style("top", "0px");
40553 select_default2(document).call(keybinding.unbind);
40555 let modal = shaded.append("div").attr("class", "modal fillL");
40556 modal.append("input").attr("class", "keytrap keytrap-first").on("focus.keytrap", moveFocusToLast);
40558 shaded.on("click.remove-modal", (d3_event) => {
40559 if (d3_event.target === this) {
40563 modal.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", shaded.close).call(svgIcon("#iD-icon-close"));
40564 keybinding.on("\u232B", shaded.close).on("\u238B", shaded.close);
40565 select_default2(document).call(keybinding);
40567 modal.append("div").attr("class", "content");
40568 modal.append("input").attr("class", "keytrap keytrap-last").on("focus.keytrap", moveFocusToFirst);
40570 shaded.transition().style("opacity", 1);
40572 shaded.style("opacity", 1);
40575 function moveFocusToFirst() {
40576 let node = modal.select("a, button, input:not(.keytrap), select, textarea").node();
40580 select_default2(this).node().blur();
40583 function moveFocusToLast() {
40584 let nodes = modal.selectAll("a, button, input:not(.keytrap), select, textarea").nodes();
40585 if (nodes.length) {
40586 nodes[nodes.length - 1].focus();
40588 select_default2(this).node().blur();
40593 // modules/ui/loading.js
40594 function uiLoading(context) {
40595 let _modalSelection = select_default2(null);
40597 let _blocking = false;
40598 let loading = (selection2) => {
40599 _modalSelection = uiModal(selection2, _blocking);
40600 let loadertext = _modalSelection.select(".content").classed("loading-modal", true).append("div").attr("class", "modal-section fillL");
40601 loadertext.append("img").attr("class", "loader").attr("src", context.imagePath("loader-white.gif"));
40602 loadertext.append("h3").html(_message);
40603 _modalSelection.select("button.close").attr("class", "hide");
40606 loading.message = function(val) {
40607 if (!arguments.length)
40612 loading.blocking = function(val) {
40613 if (!arguments.length)
40618 loading.close = () => {
40619 _modalSelection.remove();
40621 loading.isShown = () => {
40622 return _modalSelection && !_modalSelection.empty() && _modalSelection.node().parentNode;
40627 // modules/core/history.js
40628 function coreHistory(context) {
40629 var dispatch14 = dispatch_default("reset", "change", "merge", "restore", "undone", "redone", "storage_error");
40630 var lock = utilSessionMutex("lock");
40631 var _hasUnresolvedRestorableChanges = lock.lock() && !!corePreferences(getKey("saved_history"));
40632 var duration = 150;
40633 var _imageryUsed = [];
40634 var _photoOverlaysUsed = [];
40635 var _checkpoints = {};
40640 function _act(actions, t2) {
40641 actions = Array.prototype.slice.call(actions);
40643 if (typeof actions[actions.length - 1] !== "function") {
40644 annotation = actions.pop();
40646 var graph = _stack[_index].graph;
40647 for (var i3 = 0; i3 < actions.length; i3++) {
40648 graph = actions[i3](graph, t2);
40653 imageryUsed: _imageryUsed,
40654 photoOverlaysUsed: _photoOverlaysUsed,
40655 transform: context.projection.transform(),
40656 selectedIDs: context.selectedIDs()
40659 function _perform(args, t2) {
40660 var previous = _stack[_index].graph;
40661 _stack = _stack.slice(0, _index + 1);
40662 var actionResult = _act(args, t2);
40663 _stack.push(actionResult);
40665 return change(previous);
40667 function _replace(args, t2) {
40668 var previous = _stack[_index].graph;
40669 var actionResult = _act(args, t2);
40670 _stack[_index] = actionResult;
40671 return change(previous);
40673 function _overwrite(args, t2) {
40674 var previous = _stack[_index].graph;
40679 _stack = _stack.slice(0, _index + 1);
40680 var actionResult = _act(args, t2);
40681 _stack.push(actionResult);
40683 return change(previous);
40685 function change(previous) {
40686 var difference = coreDifference(previous, history.graph());
40687 if (!_pausedGraph) {
40688 dispatch14.call("change", this, difference);
40692 function getKey(n3) {
40693 return "iD_" + window.location.origin + "_" + n3;
40696 graph: function() {
40697 return _stack[_index].graph;
40703 return _stack[0].graph;
40705 merge: function(entities) {
40706 var stack = _stack.map(function(state) {
40707 return state.graph;
40709 _stack[0].graph.rebase(entities, stack, false);
40710 _tree.rebase(entities, false);
40711 dispatch14.call("merge", this, entities);
40713 perform: function() {
40714 select_default2(document).interrupt("history.perform");
40715 var transitionable = false;
40716 var action0 = arguments[0];
40717 if (arguments.length === 1 || arguments.length === 2 && typeof arguments[1] !== "function") {
40718 transitionable = !!action0.transitionable;
40720 if (transitionable) {
40721 var origArguments = arguments;
40722 select_default2(document).transition("history.perform").duration(duration).ease(linear2).tween("history.tween", function() {
40723 return function(t2) {
40725 _overwrite([action0], t2);
40727 }).on("start", function() {
40728 _perform([action0], 0);
40729 }).on("end interrupt", function() {
40730 _overwrite(origArguments, 1);
40733 return _perform(arguments);
40736 replace: function() {
40737 select_default2(document).interrupt("history.perform");
40738 return _replace(arguments, 1);
40740 // Same as calling pop and then perform
40741 overwrite: function() {
40742 select_default2(document).interrupt("history.perform");
40743 return _overwrite(arguments, 1);
40745 pop: function(n3) {
40746 select_default2(document).interrupt("history.perform");
40747 var previous = _stack[_index].graph;
40748 if (isNaN(+n3) || +n3 < 0) {
40751 while (n3-- > 0 && _index > 0) {
40755 return change(previous);
40757 // Back to the previous annotated state or _index = 0.
40759 select_default2(document).interrupt("history.perform");
40760 var previousStack = _stack[_index];
40761 var previous = previousStack.graph;
40762 while (_index > 0) {
40764 if (_stack[_index].annotation)
40767 dispatch14.call("undone", this, _stack[_index], previousStack);
40768 return change(previous);
40770 // Forward to the next annotated state.
40772 select_default2(document).interrupt("history.perform");
40773 var previousStack = _stack[_index];
40774 var previous = previousStack.graph;
40775 var tryIndex = _index;
40776 while (tryIndex < _stack.length - 1) {
40778 if (_stack[tryIndex].annotation) {
40780 dispatch14.call("redone", this, _stack[_index], previousStack);
40784 return change(previous);
40786 pauseChangeDispatch: function() {
40787 if (!_pausedGraph) {
40788 _pausedGraph = _stack[_index].graph;
40791 resumeChangeDispatch: function() {
40792 if (_pausedGraph) {
40793 var previous = _pausedGraph;
40794 _pausedGraph = null;
40795 return change(previous);
40798 undoAnnotation: function() {
40801 if (_stack[i3].annotation)
40802 return _stack[i3].annotation;
40806 redoAnnotation: function() {
40807 var i3 = _index + 1;
40808 while (i3 <= _stack.length - 1) {
40809 if (_stack[i3].annotation)
40810 return _stack[i3].annotation;
40814 // Returns the entities from the active graph with bounding boxes
40815 // overlapping the given `extent`.
40816 intersects: function(extent) {
40817 return _tree.intersects(extent, _stack[_index].graph);
40819 difference: function() {
40820 var base = _stack[0].graph;
40821 var head = _stack[_index].graph;
40822 return coreDifference(base, head);
40824 changes: function(action) {
40825 var base = _stack[0].graph;
40826 var head = _stack[_index].graph;
40828 head = action(head);
40830 var difference = coreDifference(base, head);
40832 modified: difference.modified(),
40833 created: difference.created(),
40834 deleted: difference.deleted()
40837 hasChanges: function() {
40838 return this.difference().length() > 0;
40840 imageryUsed: function(sources) {
40842 _imageryUsed = sources;
40845 var s2 = /* @__PURE__ */ new Set();
40846 _stack.slice(1, _index + 1).forEach(function(state) {
40847 state.imageryUsed.forEach(function(source) {
40848 if (source !== "Custom") {
40853 return Array.from(s2);
40856 photoOverlaysUsed: function(sources) {
40858 _photoOverlaysUsed = sources;
40861 var s2 = /* @__PURE__ */ new Set();
40862 _stack.slice(1, _index + 1).forEach(function(state) {
40863 if (state.photoOverlaysUsed && Array.isArray(state.photoOverlaysUsed)) {
40864 state.photoOverlaysUsed.forEach(function(photoOverlay) {
40865 s2.add(photoOverlay);
40869 return Array.from(s2);
40872 // save the current history state
40873 checkpoint: function(key) {
40874 _checkpoints[key] = {
40880 // restore history state to a given checkpoint or reset completely
40881 reset: function(key) {
40882 if (key !== void 0 && _checkpoints.hasOwnProperty(key)) {
40883 _stack = _checkpoints[key].stack;
40884 _index = _checkpoints[key].index;
40886 _stack = [{ graph: coreGraph() }];
40888 _tree = coreTree(_stack[0].graph);
40891 dispatch14.call("reset");
40892 dispatch14.call("change");
40895 // `toIntroGraph()` is used to export the intro graph used by the walkthrough.
40898 // 1. Start the walkthrough.
40899 // 2. Get to a "free editing" tutorial step
40900 // 3. Make your edits to the walkthrough map
40901 // 4. In your browser dev console run:
40902 // `id.history().toIntroGraph()`
40903 // 5. This outputs stringified JSON to the browser console
40904 // 6. Copy it to `data/intro_graph.json` and prettify it in your code editor
40905 toIntroGraph: function() {
40906 var nextID = { n: 0, r: 0, w: 0 };
40908 var graph = this.graph();
40909 var baseEntities = {};
40910 Object.values(graph.base().entities).forEach(function(entity) {
40911 var copy2 = copyIntroEntity(entity);
40912 baseEntities[copy2.id] = copy2;
40914 Object.keys(graph.entities).forEach(function(id2) {
40915 var entity = graph.entities[id2];
40917 var copy2 = copyIntroEntity(entity);
40918 baseEntities[copy2.id] = copy2;
40920 delete baseEntities[id2];
40923 Object.values(baseEntities).forEach(function(entity) {
40924 if (Array.isArray(entity.nodes)) {
40925 entity.nodes = entity.nodes.map(function(node) {
40926 return permIDs[node] || node;
40929 if (Array.isArray(entity.members)) {
40930 entity.members = entity.members.map(function(member) {
40931 member.id = permIDs[member.id] || member.id;
40936 return JSON.stringify({ dataIntroGraph: baseEntities });
40937 function copyIntroEntity(source) {
40938 var copy2 = utilObjectOmit(source, ["type", "user", "v", "version", "visible"]);
40939 if (copy2.tags && !Object.keys(copy2.tags)) {
40942 if (Array.isArray(copy2.loc)) {
40943 copy2.loc[0] = +copy2.loc[0].toFixed(6);
40944 copy2.loc[1] = +copy2.loc[1].toFixed(6);
40946 var match = source.id.match(/([nrw])-\d*/);
40947 if (match !== null) {
40948 var nrw = match[1];
40951 permID = nrw + ++nextID[nrw];
40952 } while (baseEntities.hasOwnProperty(permID));
40953 copy2.id = permIDs[source.id] = permID;
40958 toJSON: function() {
40959 if (!this.hasChanges())
40961 var allEntities = {};
40962 var baseEntities = {};
40963 var base = _stack[0];
40964 var s2 = _stack.map(function(i3) {
40967 Object.keys(i3.graph.entities).forEach(function(id2) {
40968 var entity = i3.graph.entities[id2];
40970 var key = osmEntity.key(entity);
40971 allEntities[key] = entity;
40972 modified.push(key);
40976 if (id2 in base.graph.entities) {
40977 baseEntities[id2] = base.graph.entities[id2];
40979 if (entity && entity.nodes) {
40980 entity.nodes.forEach(function(nodeID) {
40981 if (nodeID in base.graph.entities) {
40982 baseEntities[nodeID] = base.graph.entities[nodeID];
40986 var baseParents = base.graph._parentWays[id2];
40988 baseParents.forEach(function(parentID) {
40989 if (parentID in base.graph.entities) {
40990 baseEntities[parentID] = base.graph.entities[parentID];
40996 if (modified.length)
40997 x2.modified = modified;
40998 if (deleted.length)
40999 x2.deleted = deleted;
41000 if (i3.imageryUsed)
41001 x2.imageryUsed = i3.imageryUsed;
41002 if (i3.photoOverlaysUsed)
41003 x2.photoOverlaysUsed = i3.photoOverlaysUsed;
41005 x2.annotation = i3.annotation;
41007 x2.transform = i3.transform;
41008 if (i3.selectedIDs)
41009 x2.selectedIDs = i3.selectedIDs;
41012 return JSON.stringify({
41014 entities: Object.values(allEntities),
41015 baseEntities: Object.values(baseEntities),
41017 nextIDs: osmEntity.id.next,
41019 // note the time the changes were saved
41020 timestamp: (/* @__PURE__ */ new Date()).getTime()
41023 fromJSON: function(json, loadChildNodes) {
41024 var h2 = JSON.parse(json);
41025 var loadComplete = true;
41026 osmEntity.id.next = h2.nextIDs;
41028 if (h2.version === 2 || h2.version === 3) {
41029 var allEntities = {};
41030 h2.entities.forEach(function(entity) {
41031 allEntities[osmEntity.key(entity)] = osmEntity(entity);
41033 if (h2.version === 3) {
41034 var baseEntities = h2.baseEntities.map(function(d2) {
41035 return osmEntity(d2);
41037 var stack = _stack.map(function(state) {
41038 return state.graph;
41040 _stack[0].graph.rebase(baseEntities, stack, true);
41041 _tree.rebase(baseEntities, true);
41042 if (loadChildNodes) {
41043 var osm = context.connection();
41044 var baseWays = baseEntities.filter(function(e3) {
41045 return e3.type === "way";
41047 var nodeIDs = baseWays.reduce(function(acc, way) {
41048 return utilArrayUnion(acc, way.nodes);
41050 var missing = nodeIDs.filter(function(n3) {
41051 return !_stack[0].graph.hasEntity(n3);
41053 if (missing.length && osm) {
41054 loadComplete = false;
41055 context.map().redrawEnable(false);
41056 var loading = uiLoading(context).blocking(true);
41057 context.container().call(loading);
41058 var childNodesLoaded = function(err, result) {
41060 var visibleGroups = utilArrayGroupBy(result.data, "visible");
41061 var visibles = visibleGroups.true || [];
41062 var invisibles = visibleGroups.false || [];
41063 if (visibles.length) {
41064 var visibleIDs = visibles.map(function(entity) {
41067 var stack2 = _stack.map(function(state) {
41068 return state.graph;
41070 missing = utilArrayDifference(missing, visibleIDs);
41071 _stack[0].graph.rebase(visibles, stack2, true);
41072 _tree.rebase(visibles, true);
41074 invisibles.forEach(function(entity) {
41075 osm.loadEntityVersion(entity.id, +entity.version - 1, childNodesLoaded);
41078 if (err || !missing.length) {
41080 context.map().redrawEnable(true);
41081 dispatch14.call("change");
41082 dispatch14.call("restore", this);
41085 osm.loadMultiple(missing, childNodesLoaded);
41089 _stack = h2.stack.map(function(d2) {
41090 var entities = {}, entity;
41092 d2.modified.forEach(function(key) {
41093 entity = allEntities[key];
41094 entities[entity.id] = entity;
41098 d2.deleted.forEach(function(id2) {
41099 entities[id2] = void 0;
41103 graph: coreGraph(_stack[0].graph).load(entities),
41104 annotation: d2.annotation,
41105 imageryUsed: d2.imageryUsed,
41106 photoOverlaysUsed: d2.photoOverlaysUsed,
41107 transform: d2.transform,
41108 selectedIDs: d2.selectedIDs
41112 _stack = h2.stack.map(function(d2) {
41114 for (var i3 in d2.entities) {
41115 var entity = d2.entities[i3];
41116 entities[i3] = entity === "undefined" ? void 0 : osmEntity(entity);
41118 d2.graph = coreGraph(_stack[0].graph).load(entities);
41122 var transform2 = _stack[_index].transform;
41124 context.map().transformEase(transform2, 0);
41126 if (loadComplete) {
41127 dispatch14.call("change");
41128 dispatch14.call("restore", this);
41133 return lock.lock();
41135 unlock: function() {
41139 if (lock.locked() && // don't overwrite existing, unresolved changes
41140 !_hasUnresolvedRestorableChanges) {
41141 const success = corePreferences(getKey("saved_history"), history.toJSON() || null);
41143 dispatch14.call("storage_error");
41147 // delete the history version saved in localStorage
41148 clearSaved: function() {
41149 context.debouncedSave.cancel();
41150 if (lock.locked()) {
41151 _hasUnresolvedRestorableChanges = false;
41152 corePreferences(getKey("saved_history"), null);
41153 corePreferences("comment", null);
41154 corePreferences("hashtags", null);
41155 corePreferences("source", null);
41159 savedHistoryJSON: function() {
41160 return corePreferences(getKey("saved_history"));
41162 hasRestorableChanges: function() {
41163 return _hasUnresolvedRestorableChanges;
41165 // load history from a version stored in localStorage
41166 restore: function() {
41167 if (lock.locked()) {
41168 _hasUnresolvedRestorableChanges = false;
41169 var json = this.savedHistoryJSON();
41171 history.fromJSON(json, true);
41177 return utilRebind(history, dispatch14, "on");
41180 // modules/validations/index.js
41181 var validations_exports = {};
41182 __export(validations_exports, {
41183 validationAlmostJunction: () => validationAlmostJunction,
41184 validationCloseNodes: () => validationCloseNodes,
41185 validationCrossingWays: () => validationCrossingWays,
41186 validationDisconnectedWay: () => validationDisconnectedWay,
41187 validationFormatting: () => validationFormatting,
41188 validationHelpRequest: () => validationHelpRequest,
41189 validationImpossibleOneway: () => validationImpossibleOneway,
41190 validationIncompatibleSource: () => validationIncompatibleSource,
41191 validationMaprules: () => validationMaprules,
41192 validationMismatchedGeometry: () => validationMismatchedGeometry,
41193 validationMissingRole: () => validationMissingRole,
41194 validationMissingTag: () => validationMissingTag,
41195 validationOutdatedTags: () => validationOutdatedTags,
41196 validationPrivateData: () => validationPrivateData,
41197 validationSuspiciousName: () => validationSuspiciousName,
41198 validationUnsquareWay: () => validationUnsquareWay
41201 // modules/validations/almost_junction.js
41202 function validationAlmostJunction(context) {
41203 const type2 = "almost_junction";
41204 const EXTEND_TH_METERS = 5;
41205 const WELD_TH_METERS = 0.75;
41206 const CLOSE_NODE_TH = EXTEND_TH_METERS - WELD_TH_METERS;
41207 const SIG_ANGLE_TH = Math.atan(WELD_TH_METERS / EXTEND_TH_METERS);
41208 function isHighway(entity) {
41209 return entity.type === "way" && osmRoutableHighwayTagValues[entity.tags.highway];
41211 function isTaggedAsNotContinuing(node) {
41212 return node.tags.noexit === "yes" || node.tags.amenity === "parking_entrance" || node.tags.entrance && node.tags.entrance !== "no";
41214 const validation = function checkAlmostJunction(entity, graph) {
41215 if (!isHighway(entity))
41217 if (entity.isDegenerate())
41219 const tree = context.history().tree();
41220 const extendableNodeInfos = findConnectableEndNodesByExtension(entity);
41222 extendableNodeInfos.forEach((extendableNodeInfo) => {
41223 issues.push(new validationIssue({
41225 subtype: "highway-highway",
41226 severity: "warning",
41227 message: function(context2) {
41228 const entity1 = context2.hasEntity(this.entityIds[0]);
41229 if (this.entityIds[0] === this.entityIds[2]) {
41230 return entity1 ? _t.append("issues.almost_junction.self.message", {
41231 feature: utilDisplayLabel(entity1, context2.graph())
41234 const entity2 = context2.hasEntity(this.entityIds[2]);
41235 return entity1 && entity2 ? _t.append("issues.almost_junction.message", {
41236 feature: utilDisplayLabel(entity1, context2.graph()),
41237 feature2: utilDisplayLabel(entity2, context2.graph())
41241 reference: showReference,
41244 extendableNodeInfo.node.id,
41245 extendableNodeInfo.wid
41247 loc: extendableNodeInfo.node.loc,
41248 hash: JSON.stringify(extendableNodeInfo.node.loc),
41250 midId: extendableNodeInfo.mid.id,
41251 edge: extendableNodeInfo.edge,
41252 cross_loc: extendableNodeInfo.cross_loc
41254 dynamicFixes: makeFixes
41258 function makeFixes(context2) {
41259 let fixes = [new validationIssueFix({
41260 icon: "iD-icon-abutment",
41261 title: _t.append("issues.fix.connect_features.title"),
41262 onClick: function(context3) {
41263 const annotation = _t("issues.fix.connect_almost_junction.annotation");
41264 const [, endNodeId, crossWayId] = this.issue.entityIds;
41265 const midNode = context3.entity(this.issue.data.midId);
41266 const endNode = context3.entity(endNodeId);
41267 const crossWay = context3.entity(crossWayId);
41268 const nearEndNodes = findNearbyEndNodes(endNode, crossWay);
41269 if (nearEndNodes.length > 0) {
41270 const collinear = findSmallJoinAngle(midNode, endNode, nearEndNodes);
41273 actionMergeNodes([collinear.id, endNode.id], collinear.loc),
41279 const targetEdge = this.issue.data.edge;
41280 const crossLoc = this.issue.data.cross_loc;
41281 const edgeNodes = [context3.entity(targetEdge[0]), context3.entity(targetEdge[1])];
41282 const closestNodeInfo = geoSphericalClosestNode(edgeNodes, crossLoc);
41283 if (closestNodeInfo.distance < WELD_TH_METERS) {
41285 actionMergeNodes([closestNodeInfo.node.id, endNode.id], closestNodeInfo.node.loc),
41290 actionAddMidpoint({ loc: crossLoc, edge: targetEdge }, endNode),
41296 const node = context2.hasEntity(this.entityIds[1]);
41297 if (node && !node.hasInterestingTags()) {
41298 fixes.push(new validationIssueFix({
41299 icon: "maki-barrier",
41300 title: _t.append("issues.fix.tag_as_disconnected.title"),
41301 onClick: function(context3) {
41302 const nodeID = this.issue.entityIds[1];
41303 const tags = Object.assign({}, context3.entity(nodeID).tags);
41304 tags.noexit = "yes";
41306 actionChangeTags(nodeID, tags),
41307 _t("issues.fix.tag_as_disconnected.annotation")
41314 function showReference(selection2) {
41315 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.almost_junction.highway-highway.reference"));
41317 function isExtendableCandidate(node, way) {
41318 const osm = services.osm;
41319 if (osm && !osm.isDataLoaded(node.loc)) {
41322 if (isTaggedAsNotContinuing(node) || graph.parentWays(node).length !== 1) {
41325 let occurrences = 0;
41326 for (const index in way.nodes) {
41327 if (way.nodes[index] === node.id) {
41329 if (occurrences > 1) {
41336 function findConnectableEndNodesByExtension(way) {
41338 if (way.isClosed())
41341 const indices = [0, way.nodes.length - 1];
41342 indices.forEach((nodeIndex) => {
41343 const nodeID = way.nodes[nodeIndex];
41344 const node = graph.entity(nodeID);
41345 if (!isExtendableCandidate(node, way))
41347 const connectionInfo = canConnectByExtend(way, nodeIndex);
41348 if (!connectionInfo)
41350 testNodes = graph.childNodes(way).slice();
41351 testNodes[nodeIndex] = testNodes[nodeIndex].move(connectionInfo.cross_loc);
41352 if (geoHasSelfIntersections(testNodes, nodeID))
41354 results.push(connectionInfo);
41358 function findNearbyEndNodes(node, way) {
41361 way.nodes[way.nodes.length - 1]
41362 ].map((d2) => graph.entity(d2)).filter((d2) => {
41363 return d2.id !== node.id && geoSphericalDistance(node.loc, d2.loc) <= CLOSE_NODE_TH;
41366 function findSmallJoinAngle(midNode, tipNode, endNodes) {
41368 let minAngle = Infinity;
41369 endNodes.forEach((endNode) => {
41370 const a1 = geoAngle(midNode, tipNode, context.projection) + Math.PI;
41371 const a2 = geoAngle(midNode, endNode, context.projection) + Math.PI;
41372 const diff = Math.max(a1, a2) - Math.min(a1, a2);
41373 if (diff < minAngle) {
41378 if (minAngle <= SIG_ANGLE_TH)
41382 function hasTag(tags, key) {
41383 return tags[key] !== void 0 && tags[key] !== "no";
41385 function canConnectWays(way, way2) {
41386 if (way.id === way2.id)
41388 if ((hasTag(way.tags, "bridge") || hasTag(way2.tags, "bridge")) && !(hasTag(way.tags, "bridge") && hasTag(way2.tags, "bridge")))
41390 if ((hasTag(way.tags, "tunnel") || hasTag(way2.tags, "tunnel")) && !(hasTag(way.tags, "tunnel") && hasTag(way2.tags, "tunnel")))
41392 const layer1 = way.tags.layer || "0", layer2 = way2.tags.layer || "0";
41393 if (layer1 !== layer2)
41395 const level1 = way.tags.level || "0", level2 = way2.tags.level || "0";
41396 if (level1 !== level2)
41400 function canConnectByExtend(way, endNodeIdx) {
41401 const tipNid = way.nodes[endNodeIdx];
41402 const midNid = endNodeIdx === 0 ? way.nodes[1] : way.nodes[way.nodes.length - 2];
41403 const tipNode = graph.entity(tipNid);
41404 const midNode = graph.entity(midNid);
41405 const lon = tipNode.loc[0];
41406 const lat = tipNode.loc[1];
41407 const lon_range = geoMetersToLon(EXTEND_TH_METERS, lat) / 2;
41408 const lat_range = geoMetersToLat(EXTEND_TH_METERS) / 2;
41409 const queryExtent = geoExtent([
41410 [lon - lon_range, lat - lat_range],
41411 [lon + lon_range, lat + lat_range]
41413 const edgeLen = geoSphericalDistance(midNode.loc, tipNode.loc);
41414 const t2 = EXTEND_TH_METERS / edgeLen + 1;
41415 const extTipLoc = geoVecInterp(midNode.loc, tipNode.loc, t2);
41416 const segmentInfos = tree.waySegments(queryExtent, graph);
41417 for (let i3 = 0; i3 < segmentInfos.length; i3++) {
41418 let segmentInfo = segmentInfos[i3];
41419 let way2 = graph.entity(segmentInfo.wayId);
41420 if (!isHighway(way2))
41422 if (!canConnectWays(way, way2))
41424 let nAid = segmentInfo.nodes[0], nBid = segmentInfo.nodes[1];
41425 if (nAid === tipNid || nBid === tipNid)
41427 let nA = graph.entity(nAid), nB = graph.entity(nBid);
41428 let crossLoc = geoLineIntersection([tipNode.loc, extTipLoc], [nA.loc, nB.loc]);
41434 edge: [nA.id, nB.id],
41435 cross_loc: crossLoc
41442 validation.type = type2;
41446 // modules/validations/close_nodes.js
41447 function validationCloseNodes(context) {
41448 var type2 = "close_nodes";
41449 var pointThresholdMeters = 0.2;
41450 var validation = function(entity, graph) {
41451 if (entity.type === "node") {
41452 return getIssuesForNode(entity);
41453 } else if (entity.type === "way") {
41454 return getIssuesForWay(entity);
41457 function getIssuesForNode(node) {
41458 var parentWays = graph.parentWays(node);
41459 if (parentWays.length) {
41460 return getIssuesForVertex(node, parentWays);
41462 return getIssuesForDetachedPoint(node);
41465 function wayTypeFor(way) {
41466 if (way.tags.boundary && way.tags.boundary !== "no")
41468 if (way.tags.indoor && way.tags.indoor !== "no")
41470 if (way.tags.building && way.tags.building !== "no" || way.tags["building:part"] && way.tags["building:part"] !== "no")
41472 if (osmPathHighwayTagValues[way.tags.highway])
41474 var parentRelations = graph.parentRelations(way);
41475 for (var i3 in parentRelations) {
41476 var relation = parentRelations[i3];
41477 if (relation.tags.type === "boundary")
41479 if (relation.isMultipolygon()) {
41480 if (relation.tags.indoor && relation.tags.indoor !== "no")
41482 if (relation.tags.building && relation.tags.building !== "no" || relation.tags["building:part"] && relation.tags["building:part"] !== "no")
41488 function shouldCheckWay(way) {
41489 if (way.nodes.length <= 2 || way.isClosed() && way.nodes.length <= 4)
41491 var bbox2 = way.extent(graph).bbox();
41492 var hypotenuseMeters = geoSphericalDistance([bbox2.minX, bbox2.minY], [bbox2.maxX, bbox2.maxY]);
41493 if (hypotenuseMeters < 1.5)
41497 function getIssuesForWay(way) {
41498 if (!shouldCheckWay(way))
41500 var issues = [], nodes = graph.childNodes(way);
41501 for (var i3 = 0; i3 < nodes.length - 1; i3++) {
41502 var node1 = nodes[i3];
41503 var node2 = nodes[i3 + 1];
41504 var issue = getWayIssueIfAny(node1, node2, way);
41506 issues.push(issue);
41510 function getIssuesForVertex(node, parentWays) {
41512 function checkForCloseness(node1, node2, way) {
41513 var issue = getWayIssueIfAny(node1, node2, way);
41515 issues.push(issue);
41517 for (var i3 = 0; i3 < parentWays.length; i3++) {
41518 var parentWay = parentWays[i3];
41519 if (!shouldCheckWay(parentWay))
41521 var lastIndex = parentWay.nodes.length - 1;
41522 for (var j3 = 0; j3 < parentWay.nodes.length; j3++) {
41524 if (parentWay.nodes[j3 - 1] === node.id) {
41525 checkForCloseness(node, graph.entity(parentWay.nodes[j3]), parentWay);
41528 if (j3 !== lastIndex) {
41529 if (parentWay.nodes[j3 + 1] === node.id) {
41530 checkForCloseness(graph.entity(parentWay.nodes[j3]), node, parentWay);
41537 function thresholdMetersForWay(way) {
41538 if (!shouldCheckWay(way))
41540 var wayType = wayTypeFor(way);
41541 if (wayType === "boundary")
41543 if (wayType === "indoor")
41545 if (wayType === "building")
41547 if (wayType === "path")
41551 function getIssuesForDetachedPoint(node) {
41553 var lon = node.loc[0];
41554 var lat = node.loc[1];
41555 var lon_range = geoMetersToLon(pointThresholdMeters, lat) / 2;
41556 var lat_range = geoMetersToLat(pointThresholdMeters) / 2;
41557 var queryExtent = geoExtent([
41558 [lon - lon_range, lat - lat_range],
41559 [lon + lon_range, lat + lat_range]
41561 var intersected = context.history().tree().intersects(queryExtent, graph);
41562 for (var j3 = 0; j3 < intersected.length; j3++) {
41563 var nearby = intersected[j3];
41564 if (nearby.id === node.id)
41566 if (nearby.type !== "node" || nearby.geometry(graph) !== "point")
41568 if (nearby.loc === node.loc || geoSphericalDistance(node.loc, nearby.loc) < pointThresholdMeters) {
41569 if ("memorial:type" in node.tags && "memorial:type" in nearby.tags && node.tags["memorial:type"] === "stolperstein" && nearby.tags["memorial:type"] === "stolperstein")
41571 if ("memorial" in node.tags && "memorial" in nearby.tags && node.tags.memorial === "stolperstein" && nearby.tags.memorial === "stolperstein")
41573 var zAxisKeys = { layer: true, level: true, "addr:housenumber": true, "addr:unit": true };
41574 var zAxisDifferentiates = false;
41575 for (var key in zAxisKeys) {
41576 var nodeValue = node.tags[key] || "0";
41577 var nearbyValue = nearby.tags[key] || "0";
41578 if (nodeValue !== nearbyValue) {
41579 zAxisDifferentiates = true;
41583 if (zAxisDifferentiates)
41585 issues.push(new validationIssue({
41587 subtype: "detached",
41588 severity: "warning",
41589 message: function(context2) {
41590 var entity2 = context2.hasEntity(this.entityIds[0]), entity22 = context2.hasEntity(this.entityIds[1]);
41591 return entity2 && entity22 ? _t.append("issues.close_nodes.detached.message", {
41592 feature: utilDisplayLabel(entity2, context2.graph()),
41593 feature2: utilDisplayLabel(entity22, context2.graph())
41596 reference: showReference,
41597 entityIds: [node.id, nearby.id],
41598 dynamicFixes: function() {
41600 new validationIssueFix({
41601 icon: "iD-operation-disconnect",
41602 title: _t.append("issues.fix.move_points_apart.title")
41604 new validationIssueFix({
41605 icon: "iD-icon-layers",
41606 title: _t.append("issues.fix.use_different_layers_or_levels.title")
41614 function showReference(selection2) {
41615 var referenceText = _t("issues.close_nodes.detached.reference");
41616 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
41619 function getWayIssueIfAny(node1, node2, way) {
41620 if (node1.id === node2.id || node1.hasInterestingTags() && node2.hasInterestingTags()) {
41623 if (node1.loc !== node2.loc) {
41624 var parentWays1 = graph.parentWays(node1);
41625 var parentWays2 = new Set(graph.parentWays(node2));
41626 var sharedWays = parentWays1.filter(function(parentWay) {
41627 return parentWays2.has(parentWay);
41629 var thresholds = sharedWays.map(function(parentWay) {
41630 return thresholdMetersForWay(parentWay);
41632 var threshold = Math.min(...thresholds);
41633 var distance = geoSphericalDistance(node1.loc, node2.loc);
41634 if (distance > threshold)
41637 return new validationIssue({
41639 subtype: "vertices",
41640 severity: "warning",
41641 message: function(context2) {
41642 var entity2 = context2.hasEntity(this.entityIds[0]);
41643 return entity2 ? _t.append("issues.close_nodes.message", { way: utilDisplayLabel(entity2, context2.graph()) }) : "";
41645 reference: showReference,
41646 entityIds: [way.id, node1.id, node2.id],
41648 dynamicFixes: function() {
41650 new validationIssueFix({
41651 icon: "iD-icon-plus",
41652 title: _t.append("issues.fix.merge_points.title"),
41653 onClick: function(context2) {
41654 var entityIds = this.issue.entityIds;
41655 var action = actionMergeNodes([entityIds[1], entityIds[2]]);
41656 context2.perform(action, _t("issues.fix.merge_close_vertices.annotation"));
41659 new validationIssueFix({
41660 icon: "iD-operation-disconnect",
41661 title: _t.append("issues.fix.move_points_apart.title")
41666 function showReference(selection2) {
41667 var referenceText = _t("issues.close_nodes.reference");
41668 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
41672 validation.type = type2;
41676 // modules/validations/crossing_ways.js
41677 var import_lodash3 = __toESM(require_lodash());
41678 function validationCrossingWays(context) {
41679 var type2 = "crossing_ways";
41680 function getFeatureWithFeatureTypeTagsForWay(way, graph) {
41681 if (getFeatureType(way, graph) === null) {
41682 var parentRels = graph.parentRelations(way);
41683 for (var i3 = 0; i3 < parentRels.length; i3++) {
41684 var rel = parentRels[i3];
41685 if (getFeatureType(rel, graph) !== null) {
41692 function hasTag(tags, key) {
41693 return tags[key] !== void 0 && tags[key] !== "no";
41695 function taggedAsIndoor(tags) {
41696 return hasTag(tags, "indoor") || hasTag(tags, "level") || tags.highway === "corridor";
41698 function allowsBridge(featureType) {
41699 return featureType === "highway" || featureType === "railway" || featureType === "waterway";
41701 function allowsTunnel(featureType) {
41702 return featureType === "highway" || featureType === "railway" || featureType === "waterway";
41704 var ignoredBuildings = {
41710 function getFeatureType(entity, graph) {
41711 var geometry = entity.geometry(graph);
41712 if (geometry !== "line" && geometry !== "area")
41714 var tags = entity.tags;
41715 if (hasTag(tags, "building") && !ignoredBuildings[tags.building])
41717 if (hasTag(tags, "highway") && osmRoutableHighwayTagValues[tags.highway])
41719 if (geometry !== "line")
41721 if (hasTag(tags, "railway") && osmRailwayTrackTagValues[tags.railway])
41723 if (hasTag(tags, "waterway") && osmFlowingWaterwayTagValues[tags.waterway])
41727 function isLegitCrossing(tags1, featureType1, tags2, featureType2) {
41728 var level1 = tags1.level || "0";
41729 var level2 = tags2.level || "0";
41730 if (taggedAsIndoor(tags1) && taggedAsIndoor(tags2) && level1 !== level2) {
41733 var layer1 = tags1.layer || "0";
41734 var layer2 = tags2.layer || "0";
41735 if (allowsBridge(featureType1) && allowsBridge(featureType2)) {
41736 if (hasTag(tags1, "bridge") && !hasTag(tags2, "bridge"))
41738 if (!hasTag(tags1, "bridge") && hasTag(tags2, "bridge"))
41740 if (hasTag(tags1, "bridge") && hasTag(tags2, "bridge") && layer1 !== layer2)
41742 } else if (allowsBridge(featureType1) && hasTag(tags1, "bridge"))
41744 else if (allowsBridge(featureType2) && hasTag(tags2, "bridge"))
41746 if (allowsTunnel(featureType1) && allowsTunnel(featureType2)) {
41747 if (hasTag(tags1, "tunnel") && !hasTag(tags2, "tunnel"))
41749 if (!hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel"))
41751 if (hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel") && layer1 !== layer2)
41753 } else if (allowsTunnel(featureType1) && hasTag(tags1, "tunnel"))
41755 else if (allowsTunnel(featureType2) && hasTag(tags2, "tunnel"))
41757 if (featureType1 === "waterway" && featureType2 === "highway" && tags2.man_made === "pier")
41759 if (featureType2 === "waterway" && featureType1 === "highway" && tags1.man_made === "pier")
41761 if (featureType1 === "building" || featureType2 === "building" || taggedAsIndoor(tags1) || taggedAsIndoor(tags2)) {
41762 if (layer1 !== layer2)
41767 var highwaysDisallowingFords = {
41769 motorway_link: true,
41773 primary_link: true,
41775 secondary_link: true
41777 function tagsForConnectionNodeIfAllowed(entity1, entity2, graph, lessLikelyTags) {
41778 var featureType1 = getFeatureType(entity1, graph);
41779 var featureType2 = getFeatureType(entity2, graph);
41780 var geometry1 = entity1.geometry(graph);
41781 var geometry2 = entity2.geometry(graph);
41782 var bothLines = geometry1 === "line" && geometry2 === "line";
41783 if (featureType1 === featureType2) {
41784 if (featureType1 === "highway") {
41785 var entity1IsPath = osmPathHighwayTagValues[entity1.tags.highway];
41786 var entity2IsPath = osmPathHighwayTagValues[entity2.tags.highway];
41787 if ((entity1IsPath || entity2IsPath) && entity1IsPath !== entity2IsPath) {
41788 var roadFeature = entity1IsPath ? entity2 : entity1;
41789 var pathFeature = entity1IsPath ? entity1 : entity2;
41790 if (roadFeature.tags.highway === "track") {
41793 if (!lessLikelyTags && roadFeature.tags.highway === "service" && pathFeature.tags.highway === "footway" && pathFeature.tags.footway === "sidewalk") {
41796 if (["marked", "unmarked", "traffic_signals", "uncontrolled"].indexOf(pathFeature.tags.crossing) !== -1) {
41797 return bothLines ? { highway: "crossing", crossing: pathFeature.tags.crossing } : {};
41799 return bothLines ? { highway: "crossing" } : {};
41803 if (featureType1 === "waterway")
41805 if (featureType1 === "railway")
41808 var featureTypes = [featureType1, featureType2];
41809 if (featureTypes.indexOf("highway") !== -1) {
41810 if (featureTypes.indexOf("railway") !== -1) {
41813 var isTram = entity1.tags.railway === "tram" || entity2.tags.railway === "tram";
41814 if (osmPathHighwayTagValues[entity1.tags.highway] || osmPathHighwayTagValues[entity2.tags.highway]) {
41816 return { railway: "tram_crossing" };
41817 return { railway: "crossing" };
41820 return { railway: "tram_level_crossing" };
41821 return { railway: "level_crossing" };
41824 if (featureTypes.indexOf("waterway") !== -1) {
41825 if (hasTag(entity1.tags, "tunnel") && hasTag(entity2.tags, "tunnel"))
41827 if (hasTag(entity1.tags, "bridge") && hasTag(entity2.tags, "bridge"))
41829 if (highwaysDisallowingFords[entity1.tags.highway] || highwaysDisallowingFords[entity2.tags.highway]) {
41832 return bothLines ? { ford: "yes" } : {};
41838 function findCrossingsByWay(way1, graph, tree) {
41839 var edgeCrossInfos = [];
41840 if (way1.type !== "way")
41841 return edgeCrossInfos;
41842 var taggedFeature1 = getFeatureWithFeatureTypeTagsForWay(way1, graph);
41843 var way1FeatureType = getFeatureType(taggedFeature1, graph);
41844 if (way1FeatureType === null)
41845 return edgeCrossInfos;
41846 var checkedSingleCrossingWays = {};
41849 var n1, n22, nA, nB, nAId, nBId;
41850 var segment1, segment2;
41852 var segmentInfos, segment2Info, way2, taggedFeature2, way2FeatureType;
41853 var way1Nodes = graph.childNodes(way1);
41854 var comparedWays = {};
41855 for (i3 = 0; i3 < way1Nodes.length - 1; i3++) {
41856 n1 = way1Nodes[i3];
41857 n22 = way1Nodes[i3 + 1];
41858 extent = geoExtent([
41860 Math.min(n1.loc[0], n22.loc[0]),
41861 Math.min(n1.loc[1], n22.loc[1])
41864 Math.max(n1.loc[0], n22.loc[0]),
41865 Math.max(n1.loc[1], n22.loc[1])
41868 segmentInfos = tree.waySegments(extent, graph);
41869 for (j3 = 0; j3 < segmentInfos.length; j3++) {
41870 segment2Info = segmentInfos[j3];
41871 if (segment2Info.wayId === way1.id)
41873 if (checkedSingleCrossingWays[segment2Info.wayId])
41875 comparedWays[segment2Info.wayId] = true;
41876 way2 = graph.hasEntity(segment2Info.wayId);
41879 taggedFeature2 = getFeatureWithFeatureTypeTagsForWay(way2, graph);
41880 way2FeatureType = getFeatureType(taggedFeature2, graph);
41881 if (way2FeatureType === null || isLegitCrossing(taggedFeature1.tags, way1FeatureType, taggedFeature2.tags, way2FeatureType)) {
41884 oneOnly = way1FeatureType === "building" || way2FeatureType === "building";
41885 nAId = segment2Info.nodes[0];
41886 nBId = segment2Info.nodes[1];
41887 if (nAId === n1.id || nAId === n22.id || nBId === n1.id || nBId === n22.id) {
41890 nA = graph.hasEntity(nAId);
41893 nB = graph.hasEntity(nBId);
41896 segment1 = [n1.loc, n22.loc];
41897 segment2 = [nA.loc, nB.loc];
41898 var point2 = geoLineIntersection(segment1, segment2);
41900 edgeCrossInfos.push({
41904 featureType: way1FeatureType,
41905 edge: [n1.id, n22.id]
41909 featureType: way2FeatureType,
41910 edge: [nA.id, nB.id]
41916 checkedSingleCrossingWays[way2.id] = true;
41922 return edgeCrossInfos;
41924 function waysToCheck(entity, graph) {
41925 var featureType = getFeatureType(entity, graph);
41928 if (entity.type === "way") {
41930 } else if (entity.type === "relation") {
41931 return entity.members.reduce(function(array2, member) {
41932 if (member.type === "way" && // only look at geometry ways
41933 (!member.role || member.role === "outer" || member.role === "inner")) {
41934 var entity2 = graph.hasEntity(member.id);
41935 if (entity2 && array2.indexOf(entity2) === -1) {
41936 array2.push(entity2);
41944 var validation = function checkCrossingWays(entity, graph) {
41945 var tree = context.history().tree();
41946 var ways = waysToCheck(entity, graph);
41948 var wayIndex, crossingIndex, crossings;
41949 for (wayIndex in ways) {
41950 crossings = findCrossingsByWay(ways[wayIndex], graph, tree);
41951 for (crossingIndex in crossings) {
41952 issues.push(createIssue(crossings[crossingIndex], graph));
41957 function createIssue(crossing, graph) {
41958 crossing.wayInfos.sort(function(way1Info, way2Info) {
41959 var type1 = way1Info.featureType;
41960 var type22 = way2Info.featureType;
41961 if (type1 === type22) {
41962 return utilDisplayLabel(way1Info.way, graph) > utilDisplayLabel(way2Info.way, graph);
41963 } else if (type1 === "waterway") {
41965 } else if (type22 === "waterway") {
41968 return type1 < type22;
41970 var entities = crossing.wayInfos.map(function(wayInfo) {
41971 return getFeatureWithFeatureTypeTagsForWay(wayInfo.way, graph);
41973 var edges = [crossing.wayInfos[0].edge, crossing.wayInfos[1].edge];
41974 var featureTypes = [crossing.wayInfos[0].featureType, crossing.wayInfos[1].featureType];
41975 var connectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph);
41976 var featureType1 = crossing.wayInfos[0].featureType;
41977 var featureType2 = crossing.wayInfos[1].featureType;
41978 var isCrossingIndoors = taggedAsIndoor(entities[0].tags) && taggedAsIndoor(entities[1].tags);
41979 var isCrossingTunnels = allowsTunnel(featureType1) && hasTag(entities[0].tags, "tunnel") && allowsTunnel(featureType2) && hasTag(entities[1].tags, "tunnel");
41980 var isCrossingBridges = allowsBridge(featureType1) && hasTag(entities[0].tags, "bridge") && allowsBridge(featureType2) && hasTag(entities[1].tags, "bridge");
41981 var subtype = [featureType1, featureType2].sort().join("-");
41982 var crossingTypeID = subtype;
41983 if (isCrossingIndoors) {
41984 crossingTypeID = "indoor-indoor";
41985 } else if (isCrossingTunnels) {
41986 crossingTypeID = "tunnel-tunnel";
41987 } else if (isCrossingBridges) {
41988 crossingTypeID = "bridge-bridge";
41990 if (connectionTags && (isCrossingIndoors || isCrossingTunnels || isCrossingBridges)) {
41991 crossingTypeID += "_connectable";
41993 var uniqueID = crossing.crossPoint[0].toFixed(4) + "," + crossing.crossPoint[1].toFixed(4);
41994 return new validationIssue({
41997 severity: "warning",
41998 message: function(context2) {
41999 var graph2 = context2.graph();
42000 var entity1 = graph2.hasEntity(this.entityIds[0]), entity2 = graph2.hasEntity(this.entityIds[1]);
42001 return entity1 && entity2 ? _t.append("issues.crossing_ways.message", {
42002 feature: utilDisplayLabel(entity1, graph2),
42003 feature2: utilDisplayLabel(entity2, graph2)
42006 reference: showReference,
42007 entityIds: entities.map(function(entity) {
42016 loc: crossing.crossPoint,
42017 dynamicFixes: function(context2) {
42018 var mode = context2.mode();
42019 if (!mode || mode.id !== "select" || mode.selectedIDs().length !== 1)
42021 var selectedIndex = this.entityIds[0] === mode.selectedIDs()[0] ? 0 : 1;
42022 var selectedFeatureType = this.data.featureTypes[selectedIndex];
42023 var otherFeatureType = this.data.featureTypes[selectedIndex === 0 ? 1 : 0];
42025 if (connectionTags) {
42026 fixes.push(makeConnectWaysFix(this.data.connectionTags));
42027 let lessLikelyConnectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph, true);
42028 if (lessLikelyConnectionTags && !(0, import_lodash3.isEqual)(connectionTags, lessLikelyConnectionTags)) {
42029 fixes.push(makeConnectWaysFix(lessLikelyConnectionTags));
42032 if (isCrossingIndoors) {
42033 fixes.push(new validationIssueFix({
42034 icon: "iD-icon-layers",
42035 title: _t.append("issues.fix.use_different_levels.title")
42037 } else if (isCrossingTunnels || isCrossingBridges || featureType1 === "building" || featureType2 === "building") {
42038 fixes.push(makeChangeLayerFix("higher"));
42039 fixes.push(makeChangeLayerFix("lower"));
42040 } else if (context2.graph().geometry(this.entityIds[0]) === "line" && context2.graph().geometry(this.entityIds[1]) === "line") {
42041 if (allowsBridge(selectedFeatureType) && selectedFeatureType !== "waterway") {
42042 fixes.push(makeAddBridgeOrTunnelFix("add_a_bridge", "temaki-bridge", "bridge"));
42044 var skipTunnelFix = otherFeatureType === "waterway" && selectedFeatureType !== "waterway";
42045 if (allowsTunnel(selectedFeatureType) && !skipTunnelFix) {
42046 fixes.push(makeAddBridgeOrTunnelFix("add_a_tunnel", "temaki-tunnel", "tunnel"));
42049 fixes.push(new validationIssueFix({
42050 icon: "iD-operation-move",
42051 title: _t.append("issues.fix.reposition_features.title")
42056 function showReference(selection2) {
42057 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.crossing_ways." + crossingTypeID + ".reference"));
42060 function makeAddBridgeOrTunnelFix(fixTitleID, iconName, bridgeOrTunnel) {
42061 return new validationIssueFix({
42063 title: _t.append("issues.fix." + fixTitleID + ".title"),
42064 onClick: function(context2) {
42065 var mode = context2.mode();
42066 if (!mode || mode.id !== "select")
42068 var selectedIDs = mode.selectedIDs();
42069 if (selectedIDs.length !== 1)
42071 var selectedWayID = selectedIDs[0];
42072 if (!context2.hasEntity(selectedWayID))
42074 var resultWayIDs = [selectedWayID];
42075 var edge, crossedEdge, crossedWayID;
42076 if (this.issue.entityIds[0] === selectedWayID) {
42077 edge = this.issue.data.edges[0];
42078 crossedEdge = this.issue.data.edges[1];
42079 crossedWayID = this.issue.entityIds[1];
42081 edge = this.issue.data.edges[1];
42082 crossedEdge = this.issue.data.edges[0];
42083 crossedWayID = this.issue.entityIds[0];
42085 var crossingLoc = this.issue.loc;
42086 var projection2 = context2.projection;
42087 var action = function actionAddStructure(graph) {
42088 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
42089 var crossedWay = graph.hasEntity(crossedWayID);
42090 var structLengthMeters = crossedWay && isFinite(crossedWay.tags.width) && Number(crossedWay.tags.width);
42091 if (!structLengthMeters) {
42092 structLengthMeters = crossedWay && crossedWay.impliedLineWidthMeters();
42094 if (structLengthMeters) {
42095 if (getFeatureType(crossedWay, graph) === "railway") {
42096 structLengthMeters *= 2;
42099 structLengthMeters = 8;
42101 var a1 = geoAngle(edgeNodes[0], edgeNodes[1], projection2) + Math.PI;
42102 var a2 = geoAngle(graph.entity(crossedEdge[0]), graph.entity(crossedEdge[1]), projection2) + Math.PI;
42103 var crossingAngle = Math.max(a1, a2) - Math.min(a1, a2);
42104 if (crossingAngle > Math.PI)
42105 crossingAngle -= Math.PI;
42106 structLengthMeters = structLengthMeters / 2 / Math.sin(crossingAngle) * 2;
42107 structLengthMeters += 4;
42108 structLengthMeters = Math.min(Math.max(structLengthMeters, 4), 50);
42109 function geomToProj(geoPoint) {
42111 geoLonToMeters(geoPoint[0], geoPoint[1]),
42112 geoLatToMeters(geoPoint[1])
42115 function projToGeom(projPoint) {
42116 var lat = geoMetersToLat(projPoint[1]);
42118 geoMetersToLon(projPoint[0], lat),
42122 var projEdgeNode1 = geomToProj(edgeNodes[0].loc);
42123 var projEdgeNode2 = geomToProj(edgeNodes[1].loc);
42124 var projectedAngle = geoVecAngle(projEdgeNode1, projEdgeNode2);
42125 var projectedCrossingLoc = geomToProj(crossingLoc);
42126 var linearToSphericalMetersRatio = geoVecLength(projEdgeNode1, projEdgeNode2) / geoSphericalDistance(edgeNodes[0].loc, edgeNodes[1].loc);
42127 function locSphericalDistanceFromCrossingLoc(angle2, distanceMeters) {
42128 var lengthSphericalMeters = distanceMeters * linearToSphericalMetersRatio;
42129 return projToGeom([
42130 projectedCrossingLoc[0] + Math.cos(angle2) * lengthSphericalMeters,
42131 projectedCrossingLoc[1] + Math.sin(angle2) * lengthSphericalMeters
42134 var endpointLocGetter1 = function(lengthMeters) {
42135 return locSphericalDistanceFromCrossingLoc(projectedAngle, lengthMeters);
42137 var endpointLocGetter2 = function(lengthMeters) {
42138 return locSphericalDistanceFromCrossingLoc(projectedAngle + Math.PI, lengthMeters);
42140 var minEdgeLengthMeters = 0.55;
42141 function determineEndpoint(edge2, endNode, locGetter) {
42143 var idealLengthMeters = structLengthMeters / 2;
42144 var crossingToEdgeEndDistance = geoSphericalDistance(crossingLoc, endNode.loc);
42145 if (crossingToEdgeEndDistance - idealLengthMeters > minEdgeLengthMeters) {
42146 var idealNodeLoc = locGetter(idealLengthMeters);
42147 newNode = osmNode();
42148 graph = actionAddMidpoint({ loc: idealNodeLoc, edge: edge2 }, newNode)(graph);
42151 endNode.parentIntersectionWays(graph).forEach(function(way) {
42152 way.nodes.forEach(function(nodeID) {
42153 if (nodeID === endNode.id) {
42154 if (endNode.id === way.first() && endNode.id !== way.last() || endNode.id === way.last() && endNode.id !== way.first()) {
42162 if (edgeCount >= 3) {
42163 var insetLength = crossingToEdgeEndDistance - minEdgeLengthMeters;
42164 if (insetLength > minEdgeLengthMeters) {
42165 var insetNodeLoc = locGetter(insetLength);
42166 newNode = osmNode();
42167 graph = actionAddMidpoint({ loc: insetNodeLoc, edge: edge2 }, newNode)(graph);
42173 var splitAction = actionSplit([newNode.id]).limitWays(resultWayIDs);
42174 graph = splitAction(graph);
42175 if (splitAction.getCreatedWayIDs().length) {
42176 resultWayIDs.push(splitAction.getCreatedWayIDs()[0]);
42180 var structEndNode1 = determineEndpoint(edge, edgeNodes[1], endpointLocGetter1);
42181 var structEndNode2 = determineEndpoint([edgeNodes[0].id, structEndNode1.id], edgeNodes[0], endpointLocGetter2);
42182 var structureWay = resultWayIDs.map(function(id2) {
42183 return graph.entity(id2);
42184 }).find(function(way) {
42185 return way.nodes.indexOf(structEndNode1.id) !== -1 && way.nodes.indexOf(structEndNode2.id) !== -1;
42187 var tags = Object.assign({}, structureWay.tags);
42188 if (bridgeOrTunnel === "bridge") {
42189 tags.bridge = "yes";
42192 var tunnelValue = "yes";
42193 if (getFeatureType(structureWay, graph) === "waterway") {
42194 tunnelValue = "culvert";
42196 tags.tunnel = tunnelValue;
42199 graph = actionChangeTags(structureWay.id, tags)(graph);
42202 context2.perform(action, _t("issues.fix." + fixTitleID + ".annotation"));
42203 context2.enter(modeSelect(context2, resultWayIDs));
42207 function makeConnectWaysFix(connectionTags) {
42208 var fixTitleID = "connect_features";
42209 var fixIcon = "iD-icon-crossing";
42210 if (connectionTags.highway === "crossing") {
42211 fixTitleID = "connect_using_crossing";
42212 fixIcon = "temaki-pedestrian";
42214 if (connectionTags.ford) {
42215 fixTitleID = "connect_using_ford";
42216 fixIcon = "roentgen-ford";
42218 const fix = new validationIssueFix({
42220 title: _t.append("issues.fix." + fixTitleID + ".title"),
42221 onClick: function(context2) {
42222 var loc = this.issue.loc;
42223 var edges = this.issue.data.edges;
42225 function actionConnectCrossingWays(graph) {
42226 var node = osmNode({ loc, tags: connectionTags });
42227 graph = graph.replace(node);
42228 var nodesToMerge = [node.id];
42229 var mergeThresholdInMeters = 0.75;
42230 edges.forEach(function(edge) {
42231 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
42232 var nearby = geoSphericalClosestNode(edgeNodes, loc);
42233 if ((!nearby.node.hasInterestingTags() || nearby.node.isCrossing()) && nearby.distance < mergeThresholdInMeters) {
42234 nodesToMerge.push(nearby.node.id);
42236 graph = actionAddMidpoint({ loc, edge }, node)(graph);
42239 if (nodesToMerge.length > 1) {
42240 graph = actionMergeNodes(nodesToMerge, loc)(graph);
42244 _t("issues.fix.connect_crossing_features.annotation")
42248 fix._connectionTags = connectionTags;
42251 function makeChangeLayerFix(higherOrLower) {
42252 return new validationIssueFix({
42253 icon: "iD-icon-" + (higherOrLower === "higher" ? "up" : "down"),
42254 title: _t.append("issues.fix.tag_this_as_" + higherOrLower + ".title"),
42255 onClick: function(context2) {
42256 var mode = context2.mode();
42257 if (!mode || mode.id !== "select")
42259 var selectedIDs = mode.selectedIDs();
42260 if (selectedIDs.length !== 1)
42262 var selectedID = selectedIDs[0];
42263 if (!this.issue.entityIds.some(function(entityId) {
42264 return entityId === selectedID;
42267 var entity = context2.hasEntity(selectedID);
42270 var tags = Object.assign({}, entity.tags);
42271 var layer = tags.layer && Number(tags.layer);
42272 if (layer && !isNaN(layer)) {
42273 if (higherOrLower === "higher") {
42279 if (higherOrLower === "higher") {
42285 tags.layer = layer.toString();
42287 actionChangeTags(entity.id, tags),
42288 _t("operations.change_tags.annotation")
42293 validation.type = type2;
42297 // modules/behavior/draw_way.js
42298 function behaviorDrawWay(context, wayID, mode, startGraph) {
42299 const keybinding = utilKeybinding("drawWay");
42300 var dispatch14 = dispatch_default("rejectedSelfIntersection");
42301 var behavior = behaviorDraw(context);
42307 var _pointerHasMoved = false;
42309 var _didResolveTempEdit = false;
42310 function createDrawNode(loc) {
42311 _drawNode = osmNode({ loc });
42312 context.pauseChangeDispatch();
42313 context.replace(function actionAddDrawNode(graph) {
42314 var way = graph.entity(wayID);
42315 return graph.replace(_drawNode).replace(way.addNode(_drawNode.id, _nodeIndex));
42317 context.resumeChangeDispatch();
42318 setActiveElements();
42320 function removeDrawNode() {
42321 context.pauseChangeDispatch();
42323 function actionDeleteDrawNode(graph) {
42324 var way = graph.entity(wayID);
42325 return graph.replace(way.removeNode(_drawNode.id)).remove(_drawNode);
42329 _drawNode = void 0;
42330 context.resumeChangeDispatch();
42332 function keydown(d3_event) {
42333 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
42334 if (context.surface().classed("nope")) {
42335 context.surface().classed("nope-suppressed", true);
42337 context.surface().classed("nope", false).classed("nope-disabled", true);
42340 function keyup(d3_event) {
42341 if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
42342 if (context.surface().classed("nope-suppressed")) {
42343 context.surface().classed("nope", true);
42345 context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
42348 function allowsVertex(d2) {
42349 return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
42351 function move(d3_event, datum2) {
42352 var loc = context.map().mouseCoordinates();
42354 createDrawNode(loc);
42355 context.surface().classed("nope-disabled", d3_event.altKey);
42356 var targetLoc = datum2 && datum2.properties && datum2.properties.entity && allowsVertex(datum2.properties.entity) && datum2.properties.entity.loc;
42357 var targetNodes = datum2 && datum2.properties && datum2.properties.nodes;
42360 } else if (targetNodes) {
42361 var choice = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, _drawNode.id);
42366 context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
42367 _drawNode = context.entity(_drawNode.id);
42370 /* includeDrawNode */
42373 function checkGeometry(includeDrawNode) {
42374 var nopeDisabled = context.surface().classed("nope-disabled");
42375 var isInvalid = isInvalidGeometry(includeDrawNode);
42376 if (nopeDisabled) {
42377 context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
42379 context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
42382 function isInvalidGeometry(includeDrawNode) {
42383 var testNode = _drawNode;
42384 var parentWay = context.graph().entity(wayID);
42385 var nodes = context.graph().childNodes(parentWay).slice();
42386 if (includeDrawNode) {
42387 if (parentWay.isClosed()) {
42391 if (parentWay.isClosed()) {
42392 if (nodes.length < 3)
42395 nodes.splice(-2, 1);
42396 testNode = nodes[nodes.length - 2];
42401 return testNode && geoHasSelfIntersections(nodes, testNode.id);
42403 function undone() {
42404 _didResolveTempEdit = true;
42405 context.pauseChangeDispatch();
42407 if (context.graph() === startGraph) {
42408 nextMode = modeSelect(context, [wayID]);
42413 context.perform(actionNoop());
42415 context.resumeChangeDispatch();
42416 context.enter(nextMode);
42418 function setActiveElements() {
42421 context.surface().selectAll("." + _drawNode.id).classed("active", true);
42423 function resetToStartGraph() {
42424 while (context.graph() !== startGraph) {
42428 var drawWay = function(surface) {
42429 _drawNode = void 0;
42430 _didResolveTempEdit = false;
42431 _origWay = context.entity(wayID);
42432 if (typeof _nodeIndex === "number") {
42433 _headNodeID = _origWay.nodes[_nodeIndex];
42434 } else if (_origWay.isClosed()) {
42435 _headNodeID = _origWay.nodes[_origWay.nodes.length - 2];
42437 _headNodeID = _origWay.nodes[_origWay.nodes.length - 1];
42439 _wayGeometry = _origWay.geometry(context.graph());
42441 (_origWay.nodes.length === (_origWay.isClosed() ? 2 : 1) ? "operations.start.annotation." : "operations.continue.annotation.") + _wayGeometry
42443 _pointerHasMoved = false;
42444 context.pauseChangeDispatch();
42445 context.perform(actionNoop(), _annotation);
42446 context.resumeChangeDispatch();
42447 behavior.hover().initialNodeID(_headNodeID);
42448 behavior.on("move", function() {
42449 _pointerHasMoved = true;
42450 move.apply(this, arguments);
42451 }).on("down", function() {
42452 move.apply(this, arguments);
42453 }).on("downcancel", function() {
42456 }).on("click", drawWay.add).on("clickWay", drawWay.addWay).on("clickNode", drawWay.addNode).on("undo", context.undo).on("cancel", drawWay.cancel).on("finish", drawWay.finish);
42457 select_default2(window).on("keydown.drawWay", keydown).on("keyup.drawWay", keyup);
42458 context.map().dblclickZoomEnable(false).on("drawn.draw", setActiveElements);
42459 setActiveElements();
42460 surface.call(behavior);
42461 context.history().on("undone.draw", undone);
42463 drawWay.off = function(surface) {
42464 if (!_didResolveTempEdit) {
42465 context.pauseChangeDispatch();
42466 resetToStartGraph();
42467 context.resumeChangeDispatch();
42469 _drawNode = void 0;
42470 _nodeIndex = void 0;
42471 context.map().on("drawn.draw", null);
42472 surface.call(behavior.off).selectAll(".active").classed("active", false);
42473 surface.classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false);
42474 select_default2(window).on("keydown.drawWay", null).on("keyup.drawWay", null);
42475 context.history().on("undone.draw", null);
42477 function attemptAdd(d2, loc, doAdd) {
42479 context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
42480 _drawNode = context.entity(_drawNode.id);
42482 createDrawNode(loc);
42486 /* includeDrawNode */
42488 if (d2 && d2.properties && d2.properties.nope || context.surface().classed("nope")) {
42489 if (!_pointerHasMoved) {
42492 dispatch14.call("rejectedSelfIntersection", this);
42495 context.pauseChangeDispatch();
42497 _didResolveTempEdit = true;
42498 context.resumeChangeDispatch();
42499 context.enter(mode);
42501 drawWay.add = function(loc, d2) {
42502 attemptAdd(d2, loc, function() {
42505 drawWay.addWay = function(loc, edge, d2) {
42506 attemptAdd(d2, loc, function() {
42508 actionAddMidpoint({ loc, edge }, _drawNode),
42513 drawWay.addNode = function(node, d2) {
42514 if (node.id === _headNodeID || // or the first node when drawing an area
42515 _origWay.isClosed() && node.id === _origWay.first()) {
42519 attemptAdd(d2, node.loc, function() {
42521 function actionReplaceDrawNode(graph) {
42522 graph = graph.replace(graph.entity(wayID).removeNode(_drawNode.id)).remove(_drawNode);
42523 return graph.replace(graph.entity(wayID).addNode(node.id, _nodeIndex));
42529 function getFeatureType(ways) {
42530 if (ways.every((way) => way.isClosed()))
42532 if (ways.every((way) => !way.isClosed()))
42536 function followMode() {
42537 if (_didResolveTempEdit)
42540 const isDrawingArea = _origWay.nodes[0] === _origWay.nodes.slice(-1)[0];
42541 const [secondLastNodeId, lastNodeId] = _origWay.nodes.slice(isDrawingArea ? -3 : -2);
42542 const historyGraph = context.history().graph();
42543 if (!lastNodeId || !secondLastNodeId || !historyGraph.hasEntity(lastNodeId) || !historyGraph.hasEntity(secondLastNodeId)) {
42544 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.needs_more_initial_nodes"))();
42547 const lastNodesParents = historyGraph.parentWays(historyGraph.entity(lastNodeId)).filter((w2) => w2.id !== wayID);
42548 const secondLastNodesParents = historyGraph.parentWays(historyGraph.entity(secondLastNodeId)).filter((w2) => w2.id !== wayID);
42549 const featureType = getFeatureType(lastNodesParents);
42550 if (lastNodesParents.length !== 1 || secondLastNodesParents.length === 0) {
42551 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(`operations.follow.error.intersection_of_multiple_ways.${featureType}`))();
42554 if (!secondLastNodesParents.some((n3) => n3.id === lastNodesParents[0].id)) {
42555 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(`operations.follow.error.intersection_of_different_ways.${featureType}`))();
42558 const way = lastNodesParents[0];
42559 const indexOfLast = way.nodes.indexOf(lastNodeId);
42560 const indexOfSecondLast = way.nodes.indexOf(secondLastNodeId);
42561 const isDescendingPastZero = indexOfLast === way.nodes.length - 2 && indexOfSecondLast === 0;
42562 let nextNodeIndex = indexOfLast + (indexOfLast > indexOfSecondLast && !isDescendingPastZero ? 1 : -1);
42563 if (nextNodeIndex === -1)
42564 nextNodeIndex = indexOfSecondLast === 1 ? way.nodes.length - 2 : 1;
42565 const nextNode = historyGraph.entity(way.nodes[nextNodeIndex]);
42566 drawWay.addNode(nextNode, {
42567 geometry: { type: "Point", coordinates: nextNode.loc },
42569 properties: { target: true, entity: nextNode }
42572 context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.unknown"))();
42575 keybinding.on(_t("operations.follow.key"), followMode);
42576 select_default2(document).call(keybinding);
42577 drawWay.finish = function() {
42580 /* includeDrawNode */
42582 if (context.surface().classed("nope")) {
42583 dispatch14.call("rejectedSelfIntersection", this);
42586 context.pauseChangeDispatch();
42588 _didResolveTempEdit = true;
42589 context.resumeChangeDispatch();
42590 var way = context.hasEntity(wayID);
42591 if (!way || way.isDegenerate()) {
42595 window.setTimeout(function() {
42596 context.map().dblclickZoomEnable(true);
42598 var isNewFeature = !mode.isContinuing;
42599 context.enter(modeSelect(context, [wayID]).newFeature(isNewFeature));
42601 drawWay.cancel = function() {
42602 context.pauseChangeDispatch();
42603 resetToStartGraph();
42604 context.resumeChangeDispatch();
42605 window.setTimeout(function() {
42606 context.map().dblclickZoomEnable(true);
42608 context.surface().classed("nope", false).classed("nope-disabled", false).classed("nope-suppressed", false);
42609 context.enter(modeBrowse(context));
42611 drawWay.nodeIndex = function(val) {
42612 if (!arguments.length)
42617 drawWay.activeID = function() {
42618 if (!arguments.length)
42619 return _drawNode && _drawNode.id;
42622 return utilRebind(drawWay, dispatch14, "on");
42625 // modules/modes/draw_line.js
42626 function modeDrawLine(context, wayID, startGraph, button, affix, continuing) {
42631 var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawLine", function() {
42632 context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.lines"))();
42634 mode.wayID = wayID;
42635 mode.isContinuing = continuing;
42636 mode.enter = function() {
42637 behavior.nodeIndex(affix === "prefix" ? 0 : void 0);
42638 context.install(behavior);
42640 mode.exit = function() {
42641 context.uninstall(behavior);
42643 mode.selectedIDs = function() {
42646 mode.activeID = function() {
42647 return behavior && behavior.activeID() || [];
42652 // modules/validations/disconnected_way.js
42653 function validationDisconnectedWay() {
42654 var type2 = "disconnected_way";
42655 function isTaggedAsHighway(entity) {
42656 return osmRoutableHighwayTagValues[entity.tags.highway];
42658 var validation = function checkDisconnectedWay(entity, graph) {
42659 var routingIslandWays = routingIslandForEntity(entity);
42660 if (!routingIslandWays)
42662 return [new validationIssue({
42664 subtype: "highway",
42665 severity: "warning",
42666 message: function(context) {
42667 var entity2 = this.entityIds.length && context.hasEntity(this.entityIds[0]);
42668 var label = entity2 && utilDisplayLabel(entity2, context.graph());
42669 return _t.append("issues.disconnected_way.routable.message", { count: this.entityIds.length, highway: label });
42671 reference: showReference,
42672 entityIds: Array.from(routingIslandWays).map(function(way) {
42675 dynamicFixes: makeFixes
42677 function makeFixes(context) {
42679 var singleEntity = this.entityIds.length === 1 && context.hasEntity(this.entityIds[0]);
42680 if (singleEntity) {
42681 if (singleEntity.type === "way" && !singleEntity.isClosed()) {
42682 var textDirection = _mainLocalizer.textDirection();
42683 var startFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.first(), "start");
42685 fixes.push(startFix);
42686 var endFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.last(), "end");
42688 fixes.push(endFix);
42690 if (!fixes.length) {
42691 fixes.push(new validationIssueFix({
42692 title: _t.append("issues.fix.connect_feature.title")
42695 fixes.push(new validationIssueFix({
42696 icon: "iD-operation-delete",
42697 title: _t.append("issues.fix.delete_feature.title"),
42698 entityIds: [singleEntity.id],
42699 onClick: function(context2) {
42700 var id2 = this.issue.entityIds[0];
42701 var operation = operationDelete(context2, [id2]);
42702 if (!operation.disabled()) {
42708 fixes.push(new validationIssueFix({
42709 title: _t.append("issues.fix.connect_features.title")
42714 function showReference(selection2) {
42715 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.disconnected_way.routable.reference"));
42717 function routingIslandForEntity(entity2) {
42718 var routingIsland = /* @__PURE__ */ new Set();
42719 var waysToCheck = [];
42720 function queueParentWays(node) {
42721 graph.parentWays(node).forEach(function(parentWay) {
42722 if (!routingIsland.has(parentWay) && // only check each feature once
42723 isRoutableWay(parentWay, false)) {
42724 routingIsland.add(parentWay);
42725 waysToCheck.push(parentWay);
42729 if (entity2.type === "way" && isRoutableWay(entity2, true)) {
42730 routingIsland.add(entity2);
42731 waysToCheck.push(entity2);
42732 } else if (entity2.type === "node" && isRoutableNode(entity2)) {
42733 routingIsland.add(entity2);
42734 queueParentWays(entity2);
42738 while (waysToCheck.length) {
42739 var wayToCheck = waysToCheck.pop();
42740 var childNodes = graph.childNodes(wayToCheck);
42741 for (var i3 in childNodes) {
42742 var vertex = childNodes[i3];
42743 if (isConnectedVertex(vertex)) {
42746 if (isRoutableNode(vertex)) {
42747 routingIsland.add(vertex);
42749 queueParentWays(vertex);
42752 return routingIsland;
42754 function isConnectedVertex(vertex) {
42755 var osm = services.osm;
42756 if (osm && !osm.isDataLoaded(vertex.loc))
42758 if (vertex.tags.entrance && vertex.tags.entrance !== "no")
42760 if (vertex.tags.amenity === "parking_entrance")
42764 function isRoutableNode(node) {
42765 if (node.tags.highway === "elevator")
42769 function isRoutableWay(way, ignoreInnerWays) {
42770 if (isTaggedAsHighway(way) || way.tags.route === "ferry")
42772 return graph.parentRelations(way).some(function(parentRelation) {
42773 if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry")
42775 if (parentRelation.isMultipolygon() && isTaggedAsHighway(parentRelation) && (!ignoreInnerWays || parentRelation.memberById(way.id).role !== "inner"))
42780 function makeContinueDrawingFixIfAllowed(textDirection, vertexID, whichEnd) {
42781 var vertex = graph.hasEntity(vertexID);
42782 if (!vertex || vertex.tags.noexit === "yes")
42784 var useLeftContinue = whichEnd === "start" && textDirection === "ltr" || whichEnd === "end" && textDirection === "rtl";
42785 return new validationIssueFix({
42786 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
42787 title: _t.append("issues.fix.continue_from_" + whichEnd + ".title"),
42788 entityIds: [vertexID],
42789 onClick: function(context) {
42790 var wayId = this.issue.entityIds[0];
42791 var way = context.hasEntity(wayId);
42792 var vertexId = this.entityIds[0];
42793 var vertex2 = context.hasEntity(vertexId);
42794 if (!way || !vertex2)
42796 var map2 = context.map();
42797 if (!context.editable() || !map2.trimmedExtent().contains(vertex2.loc)) {
42798 map2.zoomToEase(vertex2);
42801 modeDrawLine(context, wayId, context.graph(), "line", way.affix(vertexId), true)
42807 validation.type = type2;
42811 // modules/validations/invalid_format.js
42812 function validationFormatting() {
42813 var type2 = "invalid_format";
42814 var validation = function(entity) {
42816 function isValidEmail(email) {
42817 var valid_email = /^[^\(\)\\,":;<>@\[\]]+@[^\(\)\\,":;<>@\[\]\.]+(?:\.[a-z0-9-]+)*$/i;
42818 return !email || valid_email.test(email);
42820 function showReferenceEmail(selection2) {
42821 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.invalid_format.email.reference"));
42823 if (entity.tags.email) {
42824 var emails = entity.tags.email.split(";").map(function(s2) {
42826 }).filter(function(x2) {
42827 return !isValidEmail(x2);
42829 if (emails.length) {
42830 issues.push(new validationIssue({
42833 severity: "warning",
42834 message: function(context) {
42835 var entity2 = context.hasEntity(this.entityIds[0]);
42836 return entity2 ? _t.append(
42837 "issues.invalid_format.email.message" + this.data,
42838 { feature: utilDisplayLabel(entity2, context.graph()), email: emails.join(", ") }
42841 reference: showReferenceEmail,
42842 entityIds: [entity.id],
42843 hash: emails.join(),
42844 data: emails.length > 1 ? "_multi" : ""
42850 validation.type = type2;
42854 // modules/validations/help_request.js
42855 function validationHelpRequest(context) {
42856 var type2 = "help_request";
42857 var validation = function checkFixmeTag(entity) {
42858 if (!entity.tags.fixme)
42860 if (entity.version === void 0)
42862 if (entity.v !== void 0) {
42863 var baseEntity = context.history().base().hasEntity(entity.id);
42864 if (!baseEntity || !baseEntity.tags.fixme)
42867 return [new validationIssue({
42869 subtype: "fixme_tag",
42870 severity: "warning",
42871 message: function(context2) {
42872 var entity2 = context2.hasEntity(this.entityIds[0]);
42873 return entity2 ? _t.append("issues.fixme_tag.message", {
42874 feature: utilDisplayLabel(
42882 dynamicFixes: function() {
42884 new validationIssueFix({
42885 title: _t.append("issues.fix.address_the_concern.title")
42889 reference: showReference,
42890 entityIds: [entity.id]
42892 function showReference(selection2) {
42893 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.fixme_tag.reference"));
42896 validation.type = type2;
42900 // modules/validations/impossible_oneway.js
42901 function validationImpossibleOneway() {
42902 var type2 = "impossible_oneway";
42903 var validation = function checkImpossibleOneway(entity, graph) {
42904 if (entity.type !== "way" || entity.geometry(graph) !== "line")
42906 if (entity.isClosed())
42908 if (!typeForWay(entity))
42910 if (!isOneway(entity))
42912 var firstIssues = issuesForNode(entity, entity.first());
42913 var lastIssues = issuesForNode(entity, entity.last());
42914 return firstIssues.concat(lastIssues);
42915 function typeForWay(way) {
42916 if (way.geometry(graph) !== "line")
42918 if (osmRoutableHighwayTagValues[way.tags.highway])
42920 if (osmFlowingWaterwayTagValues[way.tags.waterway])
42924 function isOneway(way) {
42925 if (way.tags.oneway === "yes")
42927 if (way.tags.oneway)
42929 for (var key in way.tags) {
42930 if (osmOneWayTags[key] && osmOneWayTags[key][way.tags[key]]) {
42936 function nodeOccursMoreThanOnce(way, nodeID) {
42937 var occurrences = 0;
42938 for (var index in way.nodes) {
42939 if (way.nodes[index] === nodeID) {
42941 if (occurrences > 1)
42947 function isConnectedViaOtherTypes(way, node) {
42948 var wayType = typeForWay(way);
42949 if (wayType === "highway") {
42950 if (node.tags.entrance && node.tags.entrance !== "no")
42952 if (node.tags.amenity === "parking_entrance")
42954 } else if (wayType === "waterway") {
42955 if (node.id === way.first()) {
42956 if (node.tags.natural === "spring")
42959 if (node.tags.manhole === "drain")
42963 return graph.parentWays(node).some(function(parentWay) {
42964 if (parentWay.id === way.id)
42966 if (wayType === "highway") {
42967 if (parentWay.geometry(graph) === "area" && osmRoutableHighwayTagValues[parentWay.tags.highway])
42969 if (parentWay.tags.route === "ferry")
42971 return graph.parentRelations(parentWay).some(function(parentRelation) {
42972 if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry")
42974 return parentRelation.isMultipolygon() && osmRoutableHighwayTagValues[parentRelation.tags.highway];
42976 } else if (wayType === "waterway") {
42977 if (parentWay.tags.natural === "water" || parentWay.tags.natural === "coastline")
42983 function issuesForNode(way, nodeID) {
42984 var isFirst = nodeID === way.first();
42985 var wayType = typeForWay(way);
42986 if (nodeOccursMoreThanOnce(way, nodeID))
42988 var osm = services.osm;
42991 var node = graph.hasEntity(nodeID);
42992 if (!node || !osm.isDataLoaded(node.loc))
42994 if (isConnectedViaOtherTypes(way, node))
42996 var attachedWaysOfSameType = graph.parentWays(node).filter(function(parentWay) {
42997 if (parentWay.id === way.id)
42999 return typeForWay(parentWay) === wayType;
43001 if (wayType === "waterway" && attachedWaysOfSameType.length === 0)
43003 var attachedOneways = attachedWaysOfSameType.filter(function(attachedWay) {
43004 return isOneway(attachedWay);
43006 if (attachedOneways.length < attachedWaysOfSameType.length)
43008 if (attachedOneways.length) {
43009 var connectedEndpointsOkay = attachedOneways.some(function(attachedOneway) {
43010 if ((isFirst ? attachedOneway.first() : attachedOneway.last()) !== nodeID)
43012 if (nodeOccursMoreThanOnce(attachedOneway, nodeID))
43016 if (connectedEndpointsOkay)
43019 var placement = isFirst ? "start" : "end", messageID = wayType + ".", referenceID = wayType + ".";
43020 if (wayType === "waterway") {
43021 messageID += "connected." + placement;
43022 referenceID += "connected";
43024 messageID += placement;
43025 referenceID += placement;
43027 return [new validationIssue({
43030 severity: "warning",
43031 message: function(context) {
43032 var entity2 = context.hasEntity(this.entityIds[0]);
43033 return entity2 ? _t.append("issues.impossible_oneway." + messageID + ".message", {
43034 feature: utilDisplayLabel(entity2, context.graph())
43037 reference: getReference(referenceID),
43038 entityIds: [way.id, node.id],
43039 dynamicFixes: function() {
43041 if (attachedOneways.length) {
43042 fixes.push(new validationIssueFix({
43043 icon: "iD-operation-reverse",
43044 title: _t.append("issues.fix.reverse_feature.title"),
43045 entityIds: [way.id],
43046 onClick: function(context) {
43047 var id2 = this.issue.entityIds[0];
43048 context.perform(actionReverse(id2), _t("operations.reverse.annotation.line", { n: 1 }));
43052 if (node.tags.noexit !== "yes") {
43053 var textDirection = _mainLocalizer.textDirection();
43054 var useLeftContinue = isFirst && textDirection === "ltr" || !isFirst && textDirection === "rtl";
43055 fixes.push(new validationIssueFix({
43056 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
43057 title: _t.append("issues.fix.continue_from_" + (isFirst ? "start" : "end") + ".title"),
43058 onClick: function(context) {
43059 var entityID = this.issue.entityIds[0];
43060 var vertexID = this.issue.entityIds[1];
43061 var way2 = context.entity(entityID);
43062 var vertex = context.entity(vertexID);
43063 continueDrawing(way2, vertex, context);
43071 function getReference(referenceID2) {
43072 return function showReference(selection2) {
43073 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.impossible_oneway." + referenceID2 + ".reference"));
43078 function continueDrawing(way, vertex, context) {
43079 var map2 = context.map();
43080 if (!context.editable() || !map2.trimmedExtent().contains(vertex.loc)) {
43081 map2.zoomToEase(vertex);
43084 modeDrawLine(context, way.id, context.graph(), "line", way.affix(vertex.id), true)
43087 validation.type = type2;
43091 // modules/validations/incompatible_source.js
43092 function validationIncompatibleSource() {
43093 const type2 = "incompatible_source";
43094 const incompatibleRules = [
43097 regex: /(^amap$|^amap\.com|autonavi|mapabc|高德)/i
43101 regex: /(baidu|mapbar|百度)/i
43106 exceptRegex: /((books|drive)\.google|google\s?(books|drive|plus))|(esri\/Google_Africa_Buildings)/i
43109 const validation = function checkIncompatibleSource(entity) {
43110 const entitySources = entity.tags && entity.tags.source && entity.tags.source.split(";");
43111 if (!entitySources)
43113 const entityID = entity.id;
43114 return entitySources.map((source) => {
43115 const matchRule = incompatibleRules.find((rule) => {
43116 if (!rule.regex.test(source))
43118 if (rule.exceptRegex && rule.exceptRegex.test(source))
43124 return new validationIssue({
43126 severity: "warning",
43127 message: (context) => {
43128 const entity2 = context.hasEntity(entityID);
43129 return entity2 ? _t.append("issues.incompatible_source.feature.message", {
43130 feature: utilDisplayLabel(
43139 reference: getReference(matchRule.id),
43140 entityIds: [entityID],
43142 dynamicFixes: () => {
43144 new validationIssueFix({ title: _t.append("issues.fix.remove_proprietary_data.title") })
43148 }).filter(Boolean);
43149 function getReference(id2) {
43150 return function showReference(selection2) {
43151 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append(`issues.incompatible_source.reference.${id2}`));
43155 validation.type = type2;
43159 // modules/validations/maprules.js
43160 function validationMaprules() {
43161 var type2 = "maprules";
43162 var validation = function checkMaprules(entity, graph) {
43163 if (!services.maprules)
43165 var rules = services.maprules.validationRules();
43167 for (var i3 = 0; i3 < rules.length; i3++) {
43168 var rule = rules[i3];
43169 rule.findIssues(entity, graph, issues);
43173 validation.type = type2;
43177 // modules/validations/mismatched_geometry.js
43178 var import_fast_deep_equal4 = __toESM(require_fast_deep_equal());
43179 function validationMismatchedGeometry() {
43180 var type2 = "mismatched_geometry";
43181 function tagSuggestingLineIsArea(entity) {
43182 if (entity.type !== "way" || entity.isClosed())
43184 var tagSuggestingArea = entity.tagSuggestingArea();
43185 if (!tagSuggestingArea) {
43188 var asLine = _mainPresetIndex.matchTags(tagSuggestingArea, "line");
43189 var asArea = _mainPresetIndex.matchTags(tagSuggestingArea, "area");
43190 if (asLine && asArea && (0, import_fast_deep_equal4.default)(asLine.tags, asArea.tags)) {
43193 return tagSuggestingArea;
43195 function makeConnectEndpointsFixOnClick(way, graph) {
43196 if (way.nodes.length < 3)
43198 var nodes = graph.childNodes(way), testNodes;
43199 var firstToLastDistanceMeters = geoSphericalDistance(nodes[0].loc, nodes[nodes.length - 1].loc);
43200 if (firstToLastDistanceMeters < 0.75) {
43201 testNodes = nodes.slice();
43203 testNodes.push(testNodes[0]);
43204 if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
43205 return function(context) {
43206 var way2 = context.entity(this.issue.entityIds[0]);
43208 actionMergeNodes([way2.nodes[0], way2.nodes[way2.nodes.length - 1]], nodes[0].loc),
43209 _t("issues.fix.connect_endpoints.annotation")
43214 testNodes = nodes.slice();
43215 testNodes.push(testNodes[0]);
43216 if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
43217 return function(context) {
43218 var wayId = this.issue.entityIds[0];
43219 var way2 = context.entity(wayId);
43220 var nodeId = way2.nodes[0];
43221 var index = way2.nodes.length;
43223 actionAddVertex(wayId, nodeId, index),
43224 _t("issues.fix.connect_endpoints.annotation")
43229 function lineTaggedAsAreaIssue(entity) {
43230 var tagSuggestingArea = tagSuggestingLineIsArea(entity);
43231 if (!tagSuggestingArea)
43233 var validAsLine = false;
43234 var presetAsLine = _mainPresetIndex.matchTags(entity.tags, "line");
43235 if (presetAsLine) {
43236 validAsLine = true;
43237 var key = Object.keys(tagSuggestingArea)[0];
43238 if (presetAsLine.tags[key] && presetAsLine.tags[key] === "*") {
43239 validAsLine = false;
43241 if (Object.keys(presetAsLine.tags).length === 0) {
43242 validAsLine = false;
43245 return new validationIssue({
43247 subtype: "area_as_line",
43248 severity: "warning",
43249 message: function(context) {
43250 var entity2 = context.hasEntity(this.entityIds[0]);
43251 return entity2 ? _t.append("issues.tag_suggests_area.message", {
43252 feature: utilDisplayLabel(
43258 tag: utilTagText({ tags: tagSuggestingArea })
43261 reference: showReference,
43262 entityIds: [entity.id],
43263 hash: JSON.stringify(tagSuggestingArea),
43264 dynamicFixes: function(context) {
43266 var entity2 = context.entity(this.entityIds[0]);
43267 var connectEndsOnClick = makeConnectEndpointsFixOnClick(entity2, context.graph());
43268 if (!validAsLine) {
43269 fixes.push(new validationIssueFix({
43270 title: _t.append("issues.fix.connect_endpoints.title"),
43271 onClick: connectEndsOnClick
43274 fixes.push(new validationIssueFix({
43275 icon: "iD-operation-delete",
43276 title: _t.append("issues.fix.remove_tag.title"),
43277 onClick: function(context2) {
43278 var entityId = this.issue.entityIds[0];
43279 var entity3 = context2.entity(entityId);
43280 var tags = Object.assign({}, entity3.tags);
43281 for (var key2 in tagSuggestingArea) {
43285 actionChangeTags(entityId, tags),
43286 _t("issues.fix.remove_tag.annotation")
43293 function showReference(selection2) {
43294 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.tag_suggests_area.reference"));
43297 function vertexPointIssue(entity, graph) {
43298 if (entity.type !== "node")
43300 if (Object.keys(entity.tags).length === 0)
43302 if (entity.isOnAddressLine(graph))
43304 var geometry = entity.geometry(graph);
43305 var allowedGeometries = osmNodeGeometriesForTags(entity.tags);
43306 if (geometry === "point" && !allowedGeometries.point && allowedGeometries.vertex) {
43307 return new validationIssue({
43309 subtype: "vertex_as_point",
43310 severity: "warning",
43311 message: function(context) {
43312 var entity2 = context.hasEntity(this.entityIds[0]);
43313 return entity2 ? _t.append("issues.vertex_as_point.message", {
43314 feature: utilDisplayLabel(
43322 reference: function showReference(selection2) {
43323 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.vertex_as_point.reference"));
43325 entityIds: [entity.id]
43327 } else if (geometry === "vertex" && !allowedGeometries.vertex && allowedGeometries.point) {
43328 return new validationIssue({
43330 subtype: "point_as_vertex",
43331 severity: "warning",
43332 message: function(context) {
43333 var entity2 = context.hasEntity(this.entityIds[0]);
43334 return entity2 ? _t.append("issues.point_as_vertex.message", {
43335 feature: utilDisplayLabel(
43343 reference: function showReference(selection2) {
43344 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.point_as_vertex.reference"));
43346 entityIds: [entity.id],
43347 dynamicFixes: extractPointDynamicFixes
43352 function otherMismatchIssue(entity, graph) {
43353 if (!entity.hasInterestingTags())
43355 if (entity.type !== "node" && entity.type !== "way")
43357 if (entity.type === "node" && entity.isOnAddressLine(graph))
43359 var sourceGeom = entity.geometry(graph);
43360 var targetGeoms = entity.type === "way" ? ["point", "vertex"] : ["line", "area"];
43361 if (sourceGeom === "area")
43362 targetGeoms.unshift("line");
43363 var asSource = _mainPresetIndex.match(entity, graph);
43364 var targetGeom = targetGeoms.find((nodeGeom) => {
43365 var asTarget = _mainPresetIndex.matchTags(entity.tags, nodeGeom);
43366 if (!asSource || !asTarget || asSource === asTarget || // sometimes there are two presets with the same tags for different geometries
43367 (0, import_fast_deep_equal4.default)(asSource.tags, asTarget.tags))
43369 if (asTarget.isFallback())
43371 var primaryKey = Object.keys(asTarget.tags)[0];
43372 if (primaryKey === "building")
43374 if (asTarget.tags[primaryKey] === "*")
43376 return asSource.isFallback() || asSource.tags[primaryKey] === "*";
43380 var subtype = targetGeom + "_as_" + sourceGeom;
43381 if (targetGeom === "vertex")
43382 targetGeom = "point";
43383 if (sourceGeom === "vertex")
43384 sourceGeom = "point";
43385 var referenceId = targetGeom + "_as_" + sourceGeom;
43387 if (targetGeom === "point") {
43388 dynamicFixes = extractPointDynamicFixes;
43389 } else if (sourceGeom === "area" && targetGeom === "line") {
43390 dynamicFixes = lineToAreaDynamicFixes;
43392 return new validationIssue({
43395 severity: "warning",
43396 message: function(context) {
43397 var entity2 = context.hasEntity(this.entityIds[0]);
43398 return entity2 ? _t.append("issues." + referenceId + ".message", {
43399 feature: utilDisplayLabel(
43407 reference: function showReference(selection2) {
43408 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.mismatched_geometry.reference"));
43410 entityIds: [entity.id],
43414 function lineToAreaDynamicFixes(context) {
43415 var convertOnClick;
43416 var entityId = this.entityIds[0];
43417 var entity = context.entity(entityId);
43418 var tags = Object.assign({}, entity.tags);
43420 if (!osmTagSuggestingArea(tags)) {
43421 convertOnClick = function(context2) {
43422 var entityId2 = this.issue.entityIds[0];
43423 var entity2 = context2.entity(entityId2);
43424 var tags2 = Object.assign({}, entity2.tags);
43429 actionChangeTags(entityId2, tags2),
43430 _t("issues.fix.convert_to_line.annotation")
43435 new validationIssueFix({
43436 icon: "iD-icon-line",
43437 title: _t.append("issues.fix.convert_to_line.title"),
43438 onClick: convertOnClick
43442 function extractPointDynamicFixes(context) {
43443 var entityId = this.entityIds[0];
43444 var extractOnClick = null;
43445 if (!context.hasHiddenConnections(entityId)) {
43446 extractOnClick = function(context2) {
43447 var entityId2 = this.issue.entityIds[0];
43448 var action = actionExtract(entityId2, context2.projection);
43451 _t("operations.extract.annotation", { n: 1 })
43453 context2.enter(modeSelect(context2, [action.getExtractedNodeID()]));
43457 new validationIssueFix({
43458 icon: "iD-operation-extract",
43459 title: _t.append("issues.fix.extract_point.title"),
43460 onClick: extractOnClick
43464 function unclosedMultipolygonPartIssues(entity, graph) {
43465 if (entity.type !== "relation" || !entity.isMultipolygon() || entity.isDegenerate() || // cannot determine issues for incompletely-downloaded relations
43466 !entity.isComplete(graph))
43468 var sequences = osmJoinWays(entity.members, graph);
43470 for (var i3 in sequences) {
43471 var sequence = sequences[i3];
43472 if (!sequence.nodes)
43474 var firstNode = sequence.nodes[0];
43475 var lastNode = sequence.nodes[sequence.nodes.length - 1];
43476 if (firstNode === lastNode)
43478 var issue = new validationIssue({
43480 subtype: "unclosed_multipolygon_part",
43481 severity: "warning",
43482 message: function(context) {
43483 var entity2 = context.hasEntity(this.entityIds[0]);
43484 return entity2 ? _t.append("issues.unclosed_multipolygon_part.message", {
43485 feature: utilDisplayLabel(
43493 reference: showReference,
43494 loc: sequence.nodes[0].loc,
43495 entityIds: [entity.id],
43496 hash: sequence.map(function(way) {
43500 issues.push(issue);
43503 function showReference(selection2) {
43504 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unclosed_multipolygon_part.reference"));
43507 var validation = function checkMismatchedGeometry(entity, graph) {
43508 var vertexPoint = vertexPointIssue(entity, graph);
43510 return [vertexPoint];
43511 var lineAsArea = lineTaggedAsAreaIssue(entity);
43513 return [lineAsArea];
43514 var mismatch = otherMismatchIssue(entity, graph);
43517 return unclosedMultipolygonPartIssues(entity, graph);
43519 validation.type = type2;
43523 // modules/validations/missing_role.js
43524 function validationMissingRole() {
43525 var type2 = "missing_role";
43526 var validation = function checkMissingRole(entity, graph) {
43528 if (entity.type === "way") {
43529 graph.parentRelations(entity).forEach(function(relation) {
43530 if (!relation.isMultipolygon())
43532 var member = relation.memberById(entity.id);
43533 if (member && isMissingRole(member)) {
43534 issues.push(makeIssue(entity, relation, member));
43537 } else if (entity.type === "relation" && entity.isMultipolygon()) {
43538 entity.indexedMembers().forEach(function(member) {
43539 var way = graph.hasEntity(member.id);
43540 if (way && isMissingRole(member)) {
43541 issues.push(makeIssue(way, entity, member));
43547 function isMissingRole(member) {
43548 return !member.role || !member.role.trim().length;
43550 function makeIssue(way, relation, member) {
43551 return new validationIssue({
43553 severity: "warning",
43554 message: function(context) {
43555 var member2 = context.hasEntity(this.entityIds[1]), relation2 = context.hasEntity(this.entityIds[0]);
43556 return member2 && relation2 ? _t.append("issues.missing_role.message", {
43557 member: utilDisplayLabel(member2, context.graph()),
43558 relation: utilDisplayLabel(relation2, context.graph())
43561 reference: showReference,
43562 entityIds: [relation.id, way.id],
43566 hash: member.index.toString(),
43567 dynamicFixes: function() {
43569 makeAddRoleFix("inner"),
43570 makeAddRoleFix("outer"),
43571 new validationIssueFix({
43572 icon: "iD-operation-delete",
43573 title: _t.append("issues.fix.remove_from_relation.title"),
43574 onClick: function(context) {
43576 actionDeleteMember(this.issue.entityIds[0], this.issue.data.member.index),
43577 _t("operations.delete_member.annotation", {
43586 function showReference(selection2) {
43587 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.missing_role.multipolygon.reference"));
43590 function makeAddRoleFix(role) {
43591 return new validationIssueFix({
43592 title: _t.append("issues.fix.set_as_" + role + ".title"),
43593 onClick: function(context) {
43594 var oldMember = this.issue.data.member;
43595 var member = { id: this.issue.entityIds[1], type: oldMember.type, role };
43597 actionChangeMember(this.issue.entityIds[0], member, oldMember.index),
43598 _t("operations.change_role.annotation", {
43605 validation.type = type2;
43609 // modules/validations/missing_tag.js
43610 function validationMissingTag(context) {
43611 var type2 = "missing_tag";
43612 function hasDescriptiveTags(entity, graph) {
43613 var onlyAttributeKeys = ["description", "name", "note", "start_date"];
43614 var entityDescriptiveKeys = Object.keys(entity.tags).filter(function(k2) {
43615 if (k2 === "area" || !osmIsInterestingTag(k2))
43617 return !onlyAttributeKeys.some(function(attributeKey) {
43618 return k2 === attributeKey || k2.indexOf(attributeKey + ":") === 0;
43621 if (entity.type === "relation" && entityDescriptiveKeys.length === 1 && entity.tags.type === "multipolygon") {
43622 return osmOldMultipolygonOuterMemberOfRelation(entity, graph);
43624 return entityDescriptiveKeys.length > 0;
43626 function isUnknownRoad(entity) {
43627 return entity.type === "way" && entity.tags.highway === "road";
43629 function isUntypedRelation(entity) {
43630 return entity.type === "relation" && !entity.tags.type;
43632 var validation = function checkMissingTag(entity, graph) {
43634 var osm = context.connection();
43635 var isUnloadedNode = entity.type === "node" && osm && !osm.isDataLoaded(entity.loc);
43636 if (!isUnloadedNode && // allow untagged nodes that are part of ways
43637 entity.geometry(graph) !== "vertex" && // allow untagged entities that are part of relations
43638 !entity.hasParentRelations(graph)) {
43639 if (Object.keys(entity.tags).length === 0) {
43641 } else if (!hasDescriptiveTags(entity, graph)) {
43642 subtype = "descriptive";
43643 } else if (isUntypedRelation(entity)) {
43644 subtype = "relation_type";
43647 if (!subtype && isUnknownRoad(entity)) {
43648 subtype = "highway_classification";
43652 var messageID = subtype === "highway_classification" ? "unknown_road" : "missing_tag." + subtype;
43653 var referenceID = subtype === "highway_classification" ? "unknown_road" : "missing_tag";
43654 var canDelete = entity.version === void 0 || entity.v !== void 0;
43655 var severity = canDelete && subtype !== "highway_classification" ? "error" : "warning";
43656 return [new validationIssue({
43660 message: function(context2) {
43661 var entity2 = context2.hasEntity(this.entityIds[0]);
43662 return entity2 ? _t.append("issues." + messageID + ".message", {
43663 feature: utilDisplayLabel(entity2, context2.graph())
43666 reference: showReference,
43667 entityIds: [entity.id],
43668 dynamicFixes: function(context2) {
43670 var selectFixType = subtype === "highway_classification" ? "select_road_type" : "select_preset";
43671 fixes.push(new validationIssueFix({
43672 icon: "iD-icon-search",
43673 title: _t.append("issues.fix." + selectFixType + ".title"),
43674 onClick: function(context3) {
43675 context3.ui().sidebar.showPresetList();
43679 var id2 = this.entityIds[0];
43680 var operation = operationDelete(context2, [id2]);
43681 var disabledReasonID = operation.disabled();
43682 if (!disabledReasonID) {
43683 deleteOnClick = function(context3) {
43684 var id3 = this.issue.entityIds[0];
43685 var operation2 = operationDelete(context3, [id3]);
43686 if (!operation2.disabled()) {
43692 new validationIssueFix({
43693 icon: "iD-operation-delete",
43694 title: _t.append("issues.fix.delete_feature.title"),
43695 disabledReason: disabledReasonID ? _t("operations.delete." + disabledReasonID + ".single") : void 0,
43696 onClick: deleteOnClick
43702 function showReference(selection2) {
43703 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues." + referenceID + ".reference"));
43706 validation.type = type2;
43710 // modules/validations/outdated_tags.js
43711 function validationOutdatedTags() {
43712 const type2 = "outdated_tags";
43713 let _waitingForDeprecated = true;
43714 let _dataDeprecated;
43715 _mainFileFetcher.get("deprecated").then((d2) => _dataDeprecated = d2).catch(() => {
43716 }).finally(() => _waitingForDeprecated = false);
43717 function oldTagIssues(entity, graph) {
43718 if (!entity.hasInterestingTags())
43720 let preset = _mainPresetIndex.match(entity, graph);
43723 const oldTags = Object.assign({}, entity.tags);
43724 let subtype = "deprecated_tags";
43725 if (preset.replacement) {
43726 const newPreset = _mainPresetIndex.item(preset.replacement);
43727 graph = actionChangePreset(
43732 /* skip field defaults */
43734 entity = graph.entity(entity.id);
43735 preset = newPreset;
43737 if (_dataDeprecated) {
43738 const deprecatedTags = entity.deprecatedTags(_dataDeprecated);
43739 if (deprecatedTags.length) {
43740 deprecatedTags.forEach((tag) => {
43741 graph = actionUpgradeTags(entity.id, tag.old, tag.replace)(graph);
43743 entity = graph.entity(entity.id);
43746 let newTags = Object.assign({}, entity.tags);
43747 if (preset.tags !== preset.addTags) {
43748 Object.keys(preset.addTags).forEach((k2) => {
43749 if (!newTags[k2]) {
43750 if (preset.addTags[k2] === "*") {
43751 newTags[k2] = "yes";
43753 newTags[k2] = preset.addTags[k2];
43758 const nsi = services.nsi;
43759 let waitingForNsi = false;
43762 waitingForNsi = nsi.status() === "loading";
43763 if (!waitingForNsi) {
43764 const loc = entity.extent(graph).center();
43765 nsiResult = nsi.upgradeTags(newTags, loc);
43767 newTags = nsiResult.newTags;
43768 subtype = "noncanonical_brand";
43773 issues.provisional = _waitingForDeprecated || waitingForNsi;
43774 const tagDiff = utilTagDiff(oldTags, newTags);
43775 if (!tagDiff.length)
43777 const isOnlyAddingTags = tagDiff.every((d2) => d2.type === "+");
43780 prefix = "noncanonical_brand.";
43781 } else if (subtype === "deprecated_tags" && isOnlyAddingTags) {
43782 subtype = "incomplete_tags";
43783 prefix = "incomplete.";
43785 let autoArgs = subtype !== "noncanonical_brand" ? [doUpgrade, _t("issues.fix.upgrade_tags.annotation")] : null;
43786 issues.push(new validationIssue({
43789 severity: "warning",
43790 message: showMessage,
43791 reference: showReference,
43792 entityIds: [entity.id],
43793 hash: utilHashcode(JSON.stringify(tagDiff)),
43794 dynamicFixes: () => {
43796 new validationIssueFix({
43798 title: _t.append("issues.fix.upgrade_tags.title"),
43799 onClick: (context) => {
43800 context.perform(doUpgrade, _t("issues.fix.upgrade_tags.annotation"));
43804 const item = nsiResult && nsiResult.matched;
43807 new validationIssueFix({
43808 title: _t.append("issues.fix.tag_as_not.title", { name: item.displayName }),
43809 onClick: (context) => {
43810 context.perform(addNotTag, _t("issues.fix.tag_as_not.annotation"));
43819 function doUpgrade(graph2) {
43820 const currEntity = graph2.hasEntity(entity.id);
43823 let newTags2 = Object.assign({}, currEntity.tags);
43824 tagDiff.forEach((diff) => {
43825 if (diff.type === "-") {
43826 delete newTags2[diff.key];
43827 } else if (diff.type === "+") {
43828 newTags2[diff.key] = diff.newVal;
43831 return actionChangeTags(currEntity.id, newTags2)(graph2);
43833 function addNotTag(graph2) {
43834 const currEntity = graph2.hasEntity(entity.id);
43837 const item = nsiResult && nsiResult.matched;
43840 let newTags2 = Object.assign({}, currEntity.tags);
43841 const wd = item.mainTag;
43842 const notwd = `not:${wd}`;
43843 const qid = item.tags[wd];
43844 newTags2[notwd] = qid;
43845 if (newTags2[wd] === qid) {
43846 const wp = item.mainTag.replace("wikidata", "wikipedia");
43847 delete newTags2[wd];
43848 delete newTags2[wp];
43850 return actionChangeTags(currEntity.id, newTags2)(graph2);
43852 function showMessage(context) {
43853 const currEntity = context.hasEntity(entity.id);
43856 let messageID = `issues.outdated_tags.${prefix}message`;
43857 if (subtype === "noncanonical_brand" && isOnlyAddingTags) {
43858 messageID += "_incomplete";
43860 return _t.append(messageID, {
43861 feature: utilDisplayLabel(
43869 function showReference(selection2) {
43870 let enter = selection2.selectAll(".issue-reference").data([0]).enter();
43871 enter.append("div").attr("class", "issue-reference").call(_t.append(`issues.outdated_tags.${prefix}reference`));
43872 enter.append("strong").call(_t.append("issues.suggested"));
43873 enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", (d2) => {
43874 let klass = d2.type === "+" ? "add" : "remove";
43875 return `tagDiff-cell tagDiff-cell-${klass}`;
43876 }).html((d2) => d2.display);
43879 function oldMultipolygonIssues(entity, graph) {
43880 let multipolygon, outerWay;
43881 if (entity.type === "relation") {
43882 outerWay = osmOldMultipolygonOuterMemberOfRelation(entity, graph);
43883 multipolygon = entity;
43884 } else if (entity.type === "way") {
43885 multipolygon = osmIsOldMultipolygonOuterMember(entity, graph);
43890 if (!multipolygon || !outerWay)
43892 return [new validationIssue({
43894 subtype: "old_multipolygon",
43895 severity: "warning",
43896 message: showMessage,
43897 reference: showReference,
43898 entityIds: [outerWay.id, multipolygon.id],
43899 dynamicFixes: () => {
43901 new validationIssueFix({
43902 autoArgs: [doUpgrade, _t("issues.fix.move_tags.annotation")],
43903 title: _t.append("issues.fix.move_tags.title"),
43904 onClick: (context) => {
43905 context.perform(doUpgrade, _t("issues.fix.move_tags.annotation"));
43911 function doUpgrade(graph2) {
43912 let currMultipolygon = graph2.hasEntity(multipolygon.id);
43913 let currOuterWay = graph2.hasEntity(outerWay.id);
43914 if (!currMultipolygon || !currOuterWay)
43916 currMultipolygon = currMultipolygon.mergeTags(currOuterWay.tags);
43917 graph2 = graph2.replace(currMultipolygon);
43918 return actionChangeTags(currOuterWay.id, {})(graph2);
43920 function showMessage(context) {
43921 let currMultipolygon = context.hasEntity(multipolygon.id);
43922 if (!currMultipolygon)
43925 "issues.old_multipolygon.message",
43926 { multipolygon: utilDisplayLabel(
43934 function showReference(selection2) {
43935 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.old_multipolygon.reference"));
43938 let validation = function checkOutdatedTags(entity, graph) {
43939 let issues = oldMultipolygonIssues(entity, graph);
43940 if (!issues.length)
43941 issues = oldTagIssues(entity, graph);
43944 validation.type = type2;
43948 // modules/validations/private_data.js
43949 function validationPrivateData() {
43950 var type2 = "private_data";
43951 var privateBuildingValues = {
43957 semidetached_house: true,
43958 static_caravan: true
43969 var personalTags = {
43970 "contact:email": true,
43971 "contact:fax": true,
43972 "contact:phone": true,
43977 var validation = function checkPrivateData(entity) {
43978 var tags = entity.tags;
43979 if (!tags.building || !privateBuildingValues[tags.building])
43982 for (var k2 in tags) {
43983 if (publicKeys[k2])
43985 if (!personalTags[k2]) {
43986 keepTags[k2] = tags[k2];
43989 var tagDiff = utilTagDiff(tags, keepTags);
43990 if (!tagDiff.length)
43992 var fixID = tagDiff.length === 1 ? "remove_tag" : "remove_tags";
43993 return [new validationIssue({
43995 severity: "warning",
43996 message: showMessage,
43997 reference: showReference,
43998 entityIds: [entity.id],
43999 dynamicFixes: function() {
44001 new validationIssueFix({
44002 icon: "iD-operation-delete",
44003 title: _t.append("issues.fix." + fixID + ".title"),
44004 onClick: function(context) {
44005 context.perform(doUpgrade, _t("issues.fix.remove_tag.annotation"));
44011 function doUpgrade(graph) {
44012 var currEntity = graph.hasEntity(entity.id);
44015 var newTags = Object.assign({}, currEntity.tags);
44016 tagDiff.forEach(function(diff) {
44017 if (diff.type === "-") {
44018 delete newTags[diff.key];
44019 } else if (diff.type === "+") {
44020 newTags[diff.key] = diff.newVal;
44023 return actionChangeTags(currEntity.id, newTags)(graph);
44025 function showMessage(context) {
44026 var currEntity = context.hasEntity(this.entityIds[0]);
44030 "issues.private_data.contact.message",
44031 { feature: utilDisplayLabel(currEntity, context.graph()) }
44034 function showReference(selection2) {
44035 var enter = selection2.selectAll(".issue-reference").data([0]).enter();
44036 enter.append("div").attr("class", "issue-reference").call(_t.append("issues.private_data.reference"));
44037 enter.append("strong").call(_t.append("issues.suggested"));
44038 enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", function(d2) {
44039 var klass = d2.type === "+" ? "add" : "remove";
44040 return "tagDiff-cell tagDiff-cell-" + klass;
44041 }).html(function(d2) {
44046 validation.type = type2;
44050 // modules/validations/suspicious_name.js
44051 function validationSuspiciousName() {
44052 const type2 = "suspicious_name";
44053 const keysToTestForGenericValues = [
44068 let _waitingForNsi = false;
44069 function isGenericMatchInNsi(tags) {
44070 const nsi = services.nsi;
44072 _waitingForNsi = nsi.status() === "loading";
44073 if (!_waitingForNsi) {
44074 return nsi.isGenericName(tags);
44079 function nameMatchesRawTag(lowercaseName, tags) {
44080 for (let i3 = 0; i3 < keysToTestForGenericValues.length; i3++) {
44081 let key = keysToTestForGenericValues[i3];
44082 let val = tags[key];
44084 val = val.toLowerCase();
44085 if (key === lowercaseName || val === lowercaseName || key.replace(/\_/g, " ") === lowercaseName || val.replace(/\_/g, " ") === lowercaseName) {
44092 function isGenericName(name, tags) {
44093 name = name.toLowerCase();
44094 return nameMatchesRawTag(name, tags) || isGenericMatchInNsi(tags);
44096 function makeGenericNameIssue(entityId, nameKey, genericName, langCode) {
44097 return new validationIssue({
44099 subtype: "generic_name",
44100 severity: "warning",
44101 message: function(context) {
44102 let entity = context.hasEntity(this.entityIds[0]);
44105 let preset = _mainPresetIndex.match(entity, context.graph());
44106 let langName = langCode && _mainLocalizer.languageName(langCode);
44108 "issues.generic_name.message" + (langName ? "_language" : ""),
44109 { feature: preset.name(), name: genericName, language: langName }
44112 reference: showReference,
44113 entityIds: [entityId],
44114 hash: `${nameKey}=${genericName}`,
44115 dynamicFixes: function() {
44117 new validationIssueFix({
44118 icon: "iD-operation-delete",
44119 title: _t.append("issues.fix.remove_the_name.title"),
44120 onClick: function(context) {
44121 let entityId2 = this.issue.entityIds[0];
44122 let entity = context.entity(entityId2);
44123 let tags = Object.assign({}, entity.tags);
44124 delete tags[nameKey];
44126 actionChangeTags(entityId2, tags),
44127 _t("issues.fix.remove_generic_name.annotation")
44134 function showReference(selection2) {
44135 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.generic_name.reference"));
44138 function makeIncorrectNameIssue(entityId, nameKey, incorrectName, langCode) {
44139 return new validationIssue({
44141 subtype: "not_name",
44142 severity: "warning",
44143 message: function(context) {
44144 const entity = context.hasEntity(this.entityIds[0]);
44147 const preset = _mainPresetIndex.match(entity, context.graph());
44148 const langName = langCode && _mainLocalizer.languageName(langCode);
44150 "issues.incorrect_name.message" + (langName ? "_language" : ""),
44151 { feature: preset.name(), name: incorrectName, language: langName }
44154 reference: showReference,
44155 entityIds: [entityId],
44156 hash: `${nameKey}=${incorrectName}`,
44157 dynamicFixes: function() {
44159 new validationIssueFix({
44160 icon: "iD-operation-delete",
44161 title: _t.append("issues.fix.remove_the_name.title"),
44162 onClick: function(context) {
44163 const entityId2 = this.issue.entityIds[0];
44164 const entity = context.entity(entityId2);
44165 let tags = Object.assign({}, entity.tags);
44166 delete tags[nameKey];
44168 actionChangeTags(entityId2, tags),
44169 _t("issues.fix.remove_mistaken_name.annotation")
44176 function showReference(selection2) {
44177 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.generic_name.reference"));
44180 let validation = function checkGenericName(entity) {
44181 const tags = entity.tags;
44182 const hasWikidata = !!tags.wikidata || !!tags["brand:wikidata"] || !!tags["operator:wikidata"];
44186 const notNames2 = (tags["not:name"] || "").split(";");
44187 for (let key in tags) {
44188 const m2 = key.match(/^name(?:(?::)([a-zA-Z_-]+))?$/);
44191 const langCode = m2.length >= 2 ? m2[1] : null;
44192 const value = tags[key];
44193 if (notNames2.length) {
44194 for (let i3 in notNames2) {
44195 const notName = notNames2[i3];
44196 if (notName && value === notName) {
44197 issues.push(makeIncorrectNameIssue(entity.id, key, value, langCode));
44202 if (isGenericName(value, tags)) {
44203 issues.provisional = _waitingForNsi;
44204 issues.push(makeGenericNameIssue(entity.id, key, value, langCode));
44209 validation.type = type2;
44213 // modules/validations/unsquare_way.js
44214 function validationUnsquareWay(context) {
44215 var type2 = "unsquare_way";
44216 var DEFAULT_DEG_THRESHOLD = 5;
44217 var epsilon3 = 0.05;
44218 var nodeThreshold = 10;
44219 function isBuilding(entity, graph) {
44220 if (entity.type !== "way" || entity.geometry(graph) !== "area")
44222 return entity.tags.building && entity.tags.building !== "no";
44224 var validation = function checkUnsquareWay(entity, graph) {
44225 if (!isBuilding(entity, graph))
44227 if (entity.tags.nonsquare === "yes")
44229 var isClosed = entity.isClosed();
44232 var nodes = graph.childNodes(entity).slice();
44233 if (nodes.length > nodeThreshold + 1)
44235 var osm = services.osm;
44236 if (!osm || nodes.some(function(node) {
44237 return !osm.isDataLoaded(node.loc);
44240 var hasConnectedSquarableWays = nodes.some(function(node) {
44241 return graph.parentWays(node).some(function(way) {
44242 if (way.id === entity.id)
44244 if (isBuilding(way, graph))
44246 return graph.parentRelations(way).some(function(parentRelation) {
44247 return parentRelation.isMultipolygon() && parentRelation.tags.building && parentRelation.tags.building !== "no";
44251 if (hasConnectedSquarableWays)
44253 var storedDegreeThreshold = corePreferences("validate-square-degrees");
44254 var degreeThreshold = isFinite(storedDegreeThreshold) ? Number(storedDegreeThreshold) : DEFAULT_DEG_THRESHOLD;
44255 var points = nodes.map(function(node) {
44256 return context.projection(node.loc);
44258 if (!geoOrthoCanOrthogonalize(points, isClosed, epsilon3, degreeThreshold, true))
44261 if (!entity.tags.wikidata) {
44262 var autoAction = actionOrthogonalize(entity.id, context.projection, void 0, degreeThreshold);
44263 autoAction.transitionable = false;
44264 autoArgs = [autoAction, _t("operations.orthogonalize.annotation.feature", { n: 1 })];
44266 return [new validationIssue({
44268 subtype: "building",
44269 severity: "warning",
44270 message: function(context2) {
44271 var entity2 = context2.hasEntity(this.entityIds[0]);
44272 return entity2 ? _t.append("issues.unsquare_way.message", {
44273 feature: utilDisplayLabel(entity2, context2.graph())
44276 reference: showReference,
44277 entityIds: [entity.id],
44278 hash: degreeThreshold,
44279 dynamicFixes: function() {
44281 new validationIssueFix({
44282 icon: "iD-operation-orthogonalize",
44283 title: _t.append("issues.fix.square_feature.title"),
44285 onClick: function(context2, completionHandler) {
44286 var entityId = this.issue.entityIds[0];
44288 actionOrthogonalize(entityId, context2.projection, void 0, degreeThreshold),
44289 _t("operations.orthogonalize.annotation.feature", { n: 1 })
44291 window.setTimeout(function() {
44292 completionHandler();
44297 new validationIssueFix({
44298 title: t.append('issues.fix.tag_as_unsquare.title'),
44299 onClick: function(context) {
44300 var entityId = this.issue.entityIds[0];
44301 var entity = context.entity(entityId);
44302 var tags = Object.assign({}, entity.tags); // shallow copy
44303 tags.nonsquare = 'yes';
44305 actionChangeTags(entityId, tags),
44306 t('issues.fix.tag_as_unsquare.annotation')
44314 function showReference(selection2) {
44315 selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unsquare_way.buildings.reference"));
44318 validation.type = type2;
44322 // modules/core/validator.js
44323 function coreValidator(context) {
44324 let dispatch14 = dispatch_default("validated", "focusedIssue");
44325 let validator = utilRebind({}, dispatch14, "on");
44327 let _disabledRules = {};
44328 let _ignoredIssueIDs = /* @__PURE__ */ new Set();
44329 let _resolvedIssueIDs = /* @__PURE__ */ new Set();
44330 let _baseCache = validationCache("base");
44331 let _headCache = validationCache("head");
44332 let _completeDiff = {};
44333 let _headIsCurrent = false;
44334 let _deferredRIC = {};
44335 let _deferredST = /* @__PURE__ */ new Set();
44338 const _errorOverrides = parseHashParam(context.initialHashParams.validationError);
44339 const _warningOverrides = parseHashParam(context.initialHashParams.validationWarning);
44340 const _disableOverrides = parseHashParam(context.initialHashParams.validationDisable);
44341 function parseHashParam(param) {
44343 let rules = (param || "").split(",");
44344 rules.forEach((rule) => {
44345 rule = rule.trim();
44346 const parts = rule.split("/", 2);
44347 const type2 = parts[0];
44348 const subtype = parts[1] || "*";
44349 if (!type2 || !subtype)
44351 result.push({ type: makeRegExp(type2), subtype: makeRegExp(subtype) });
44354 function makeRegExp(str2) {
44355 const escaped = str2.replace(/[-\/\\^$+?.()|[\]{}]/g, "\\$&").replace(/\*/g, ".*");
44356 return new RegExp("^" + escaped + "$");
44359 validator.init = () => {
44360 Object.values(validations_exports).forEach((validation) => {
44361 if (typeof validation !== "function")
44363 const fn = validation(context);
44364 const key = fn.type;
44367 let disabledRules = corePreferences("validate-disabledRules");
44368 if (disabledRules) {
44369 disabledRules.split(",").forEach((k2) => _disabledRules[k2] = true);
44372 function reset(resetIgnored) {
44373 _baseCache.queue = [];
44374 _headCache.queue = [];
44375 Object.keys(_deferredRIC).forEach((key) => {
44376 window.cancelIdleCallback(key);
44377 _deferredRIC[key]();
44380 _deferredST.forEach(window.clearTimeout);
44381 _deferredST.clear();
44383 _ignoredIssueIDs.clear();
44384 _resolvedIssueIDs.clear();
44385 _baseCache = validationCache("base");
44386 _headCache = validationCache("head");
44387 _completeDiff = {};
44388 _headIsCurrent = false;
44390 validator.reset = () => {
44393 validator.resetIgnoredIssues = () => {
44394 _ignoredIssueIDs.clear();
44395 dispatch14.call("validated");
44397 validator.revalidateUnsquare = () => {
44398 revalidateUnsquare(_headCache);
44399 revalidateUnsquare(_baseCache);
44400 dispatch14.call("validated");
44402 function revalidateUnsquare(cache) {
44403 const checkUnsquareWay = _rules.unsquare_way;
44404 if (!cache.graph || typeof checkUnsquareWay !== "function")
44406 cache.uncacheIssuesOfType("unsquare_way");
44407 const buildings = context.history().tree().intersects(geoExtent([-180, -90], [180, 90]), cache.graph).filter((entity) => entity.type === "way" && entity.tags.building && entity.tags.building !== "no");
44408 buildings.forEach((entity) => {
44409 const detected = checkUnsquareWay(entity, cache.graph);
44410 if (!detected.length)
44412 cache.cacheIssues(detected);
44415 validator.getIssues = (options2) => {
44416 const opts = Object.assign({ what: "all", where: "all", includeIgnored: false, includeDisabledRules: false }, options2);
44417 const view = context.map().extent();
44418 let seen = /* @__PURE__ */ new Set();
44420 if (_headCache.graph && _headCache.graph !== _baseCache.graph) {
44421 Object.values(_headCache.issuesByIssueID).forEach((issue) => {
44422 const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
44423 if (opts.what === "edited" && !userModified)
44425 if (!filter2(issue))
44427 seen.add(issue.id);
44428 results.push(issue);
44431 if (opts.what === "all") {
44432 Object.values(_baseCache.issuesByIssueID).forEach((issue) => {
44433 if (!filter2(issue))
44435 seen.add(issue.id);
44436 results.push(issue);
44440 function filter2(issue) {
44443 if (seen.has(issue.id))
44445 if (_resolvedIssueIDs.has(issue.id))
44447 if (opts.includeDisabledRules === "only" && !_disabledRules[issue.type])
44449 if (!opts.includeDisabledRules && _disabledRules[issue.type])
44451 if (opts.includeIgnored === "only" && !_ignoredIssueIDs.has(issue.id))
44453 if (!opts.includeIgnored && _ignoredIssueIDs.has(issue.id))
44455 if ((issue.entityIds || []).some((id2) => !context.hasEntity(id2)))
44457 if (opts.where === "visible") {
44458 const extent = issue.extent(context.graph());
44459 if (!view.intersects(extent))
44465 validator.getResolvedIssues = () => {
44466 return Array.from(_resolvedIssueIDs).map((issueID) => _baseCache.issuesByIssueID[issueID]).filter(Boolean);
44468 validator.focusIssue = (issue) => {
44469 const graph = context.graph();
44472 const issueExtent = issue.extent(graph);
44474 focusCenter = issueExtent.center();
44476 if (issue.entityIds && issue.entityIds.length) {
44477 selectID = issue.entityIds[0];
44478 if (selectID && selectID.charAt(0) === "r") {
44479 const ids = utilEntityAndDeepMemberIDs([selectID], graph);
44480 let nodeID = ids.find((id2) => id2.charAt(0) === "n" && graph.hasEntity(id2));
44482 const wayID = ids.find((id2) => id2.charAt(0) === "w" && graph.hasEntity(id2));
44484 nodeID = graph.entity(wayID).first();
44488 focusCenter = graph.entity(nodeID).loc;
44493 const setZoom = Math.max(context.map().zoom(), 19);
44494 context.map().unobscuredCenterZoomEase(focusCenter, setZoom);
44497 window.setTimeout(() => {
44498 context.enter(modeSelect(context, [selectID]));
44499 dispatch14.call("focusedIssue", this, issue);
44503 validator.getIssuesBySeverity = (options2) => {
44504 let groups = utilArrayGroupBy(validator.getIssues(options2), "severity");
44505 groups.error = groups.error || [];
44506 groups.warning = groups.warning || [];
44509 validator.getSharedEntityIssues = (entityIDs, options2) => {
44510 const orderedIssueTypes = [
44511 // Show some issue types in a particular order:
44514 // - missing data first
44516 "mismatched_geometry",
44517 // - identity issues
44520 // - geometry issues where fixing them might solve connectivity issues
44521 "disconnected_way",
44522 "impossible_oneway"
44523 // - finally connectivity issues
44525 const allIssues = validator.getIssues(options2);
44526 const forEntityIDs = new Set(entityIDs);
44527 return allIssues.filter((issue) => (issue.entityIds || []).some((entityID) => forEntityIDs.has(entityID))).sort((issue1, issue2) => {
44528 if (issue1.type === issue2.type) {
44529 return issue1.id < issue2.id ? -1 : 1;
44531 const index1 = orderedIssueTypes.indexOf(issue1.type);
44532 const index2 = orderedIssueTypes.indexOf(issue2.type);
44533 if (index1 !== -1 && index2 !== -1) {
44534 return index1 - index2;
44535 } else if (index1 === -1 && index2 === -1) {
44536 return issue1.type < issue2.type ? -1 : 1;
44538 return index1 !== -1 ? -1 : 1;
44542 validator.getEntityIssues = (entityID, options2) => {
44543 return validator.getSharedEntityIssues([entityID], options2);
44545 validator.getRuleKeys = () => {
44546 return Object.keys(_rules);
44548 validator.isRuleEnabled = (key) => {
44549 return !_disabledRules[key];
44551 validator.toggleRule = (key) => {
44552 if (_disabledRules[key]) {
44553 delete _disabledRules[key];
44555 _disabledRules[key] = true;
44557 corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
44558 validator.validate();
44560 validator.disableRules = (keys2) => {
44561 _disabledRules = {};
44562 keys2.forEach((k2) => _disabledRules[k2] = true);
44563 corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
44564 validator.validate();
44566 validator.ignoreIssue = (issueID) => {
44567 _ignoredIssueIDs.add(issueID);
44569 validator.validate = () => {
44570 const baseGraph = context.history().base();
44571 if (!_headCache.graph)
44572 _headCache.graph = baseGraph;
44573 if (!_baseCache.graph)
44574 _baseCache.graph = baseGraph;
44575 const prevGraph = _headCache.graph;
44576 const currGraph = context.graph();
44577 if (currGraph === prevGraph) {
44578 _headIsCurrent = true;
44579 dispatch14.call("validated");
44580 return Promise.resolve();
44582 if (_headPromise) {
44583 _headIsCurrent = false;
44584 return _headPromise;
44586 _headCache.graph = currGraph;
44587 _completeDiff = context.history().difference().complete();
44588 const incrementalDiff = coreDifference(prevGraph, currGraph);
44589 let entityIDs = Object.keys(incrementalDiff.complete());
44590 entityIDs = _headCache.withAllRelatedEntities(entityIDs);
44591 if (!entityIDs.size) {
44592 dispatch14.call("validated");
44593 return Promise.resolve();
44595 _headPromise = validateEntitiesAsync(entityIDs, _headCache).then(() => updateResolvedIssues(entityIDs)).then(() => dispatch14.call("validated")).catch(() => {
44597 _headPromise = null;
44598 if (!_headIsCurrent) {
44599 validator.validate();
44602 return _headPromise;
44604 context.history().on("restore.validator", validator.validate).on("undone.validator", validator.validate).on("redone.validator", validator.validate).on("reset.validator", () => {
44606 validator.validate();
44608 context.on("exit.validator", validator.validate);
44609 context.history().on("merge.validator", (entities) => {
44612 const baseGraph = context.history().base();
44613 if (!_headCache.graph)
44614 _headCache.graph = baseGraph;
44615 if (!_baseCache.graph)
44616 _baseCache.graph = baseGraph;
44617 let entityIDs = entities.map((entity) => entity.id);
44618 entityIDs = _baseCache.withAllRelatedEntities(entityIDs);
44619 validateEntitiesAsync(entityIDs, _baseCache);
44621 function validateEntity(entity, graph) {
44622 let result = { issues: [], provisional: false };
44623 Object.keys(_rules).forEach(runValidation);
44625 function runValidation(key) {
44626 const fn = _rules[key];
44627 if (typeof fn !== "function") {
44628 console.error("no such validation rule = " + key);
44631 let detected = fn(entity, graph);
44632 if (detected.provisional) {
44633 result.provisional = true;
44635 detected = detected.filter(applySeverityOverrides);
44636 result.issues = result.issues.concat(detected);
44637 function applySeverityOverrides(issue) {
44638 const type2 = issue.type;
44639 const subtype = issue.subtype || "";
44641 for (i3 = 0; i3 < _errorOverrides.length; i3++) {
44642 if (_errorOverrides[i3].type.test(type2) && _errorOverrides[i3].subtype.test(subtype)) {
44643 issue.severity = "error";
44647 for (i3 = 0; i3 < _warningOverrides.length; i3++) {
44648 if (_warningOverrides[i3].type.test(type2) && _warningOverrides[i3].subtype.test(subtype)) {
44649 issue.severity = "warning";
44653 for (i3 = 0; i3 < _disableOverrides.length; i3++) {
44654 if (_disableOverrides[i3].type.test(type2) && _disableOverrides[i3].subtype.test(subtype)) {
44662 function updateResolvedIssues(entityIDs) {
44663 entityIDs.forEach((entityID) => {
44664 const baseIssues = _baseCache.issuesByEntityID[entityID];
44667 baseIssues.forEach((issueID) => {
44668 const issue = _baseCache.issuesByIssueID[issueID];
44669 const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
44670 if (userModified && !_headCache.issuesByIssueID[issueID]) {
44671 _resolvedIssueIDs.add(issueID);
44673 _resolvedIssueIDs.delete(issueID);
44678 function validateEntitiesAsync(entityIDs, cache) {
44679 const jobs = Array.from(entityIDs).map((entityID) => {
44680 if (cache.queuedEntityIDs.has(entityID))
44682 cache.queuedEntityIDs.add(entityID);
44683 cache.uncacheEntityID(entityID);
44685 cache.queuedEntityIDs.delete(entityID);
44686 const graph = cache.graph;
44689 const entity = graph.hasEntity(entityID);
44692 const result = validateEntity(entity, graph);
44693 if (result.provisional) {
44694 cache.provisionalEntityIDs.add(entityID);
44696 cache.cacheIssues(result.issues);
44698 }).filter(Boolean);
44699 cache.queue = cache.queue.concat(utilArrayChunk(jobs, 100));
44700 if (cache.queuePromise)
44701 return cache.queuePromise;
44702 cache.queuePromise = processQueue(cache).then(() => revalidateProvisionalEntities(cache)).catch(() => {
44703 }).finally(() => cache.queuePromise = null);
44704 return cache.queuePromise;
44706 function revalidateProvisionalEntities(cache) {
44707 if (!cache.provisionalEntityIDs.size)
44709 const handle = window.setTimeout(() => {
44710 _deferredST.delete(handle);
44711 if (!cache.provisionalEntityIDs.size)
44713 validateEntitiesAsync(Array.from(cache.provisionalEntityIDs), cache);
44715 _deferredST.add(handle);
44717 function processQueue(cache) {
44718 if (!cache.queue.length)
44719 return Promise.resolve();
44720 const chunk = cache.queue.pop();
44721 return new Promise((resolvePromise, rejectPromise) => {
44722 const handle = window.requestIdleCallback(() => {
44723 delete _deferredRIC[handle];
44724 chunk.forEach((job) => job());
44727 _deferredRIC[handle] = rejectPromise;
44729 if (cache.queue.length % 25 === 0)
44730 dispatch14.call("validated");
44731 }).then(() => processQueue(cache));
44735 function validationCache(which) {
44740 queuePromise: null,
44741 queuedEntityIDs: /* @__PURE__ */ new Set(),
44742 provisionalEntityIDs: /* @__PURE__ */ new Set(),
44743 issuesByIssueID: {},
44744 // issue.id -> issue
44745 issuesByEntityID: {}
44746 // entity.id -> Set(issue.id)
44748 cache.cacheIssue = (issue) => {
44749 (issue.entityIds || []).forEach((entityID) => {
44750 if (!cache.issuesByEntityID[entityID]) {
44751 cache.issuesByEntityID[entityID] = /* @__PURE__ */ new Set();
44753 cache.issuesByEntityID[entityID].add(issue.id);
44755 cache.issuesByIssueID[issue.id] = issue;
44757 cache.uncacheIssue = (issue) => {
44758 (issue.entityIds || []).forEach((entityID) => {
44759 if (cache.issuesByEntityID[entityID]) {
44760 cache.issuesByEntityID[entityID].delete(issue.id);
44763 delete cache.issuesByIssueID[issue.id];
44765 cache.cacheIssues = (issues) => {
44766 issues.forEach(cache.cacheIssue);
44768 cache.uncacheIssues = (issues) => {
44769 issues.forEach(cache.uncacheIssue);
44771 cache.uncacheIssuesOfType = (type2) => {
44772 const issuesOfType = Object.values(cache.issuesByIssueID).filter((issue) => issue.type === type2);
44773 cache.uncacheIssues(issuesOfType);
44775 cache.uncacheEntityID = (entityID) => {
44776 const entityIssueIDs = cache.issuesByEntityID[entityID];
44777 if (entityIssueIDs) {
44778 entityIssueIDs.forEach((issueID) => {
44779 const issue = cache.issuesByIssueID[issueID];
44781 cache.uncacheIssue(issue);
44783 delete cache.issuesByIssueID[issueID];
44787 delete cache.issuesByEntityID[entityID];
44788 cache.provisionalEntityIDs.delete(entityID);
44790 cache.withAllRelatedEntities = (entityIDs) => {
44791 let result = /* @__PURE__ */ new Set();
44792 (entityIDs || []).forEach((entityID) => {
44793 result.add(entityID);
44794 const entityIssueIDs = cache.issuesByEntityID[entityID];
44795 if (entityIssueIDs) {
44796 entityIssueIDs.forEach((issueID) => {
44797 const issue = cache.issuesByIssueID[issueID];
44799 (issue.entityIds || []).forEach((relatedID) => result.add(relatedID));
44801 delete cache.issuesByIssueID[issueID];
44811 // modules/core/uploader.js
44812 function coreUploader(context) {
44813 var dispatch14 = dispatch_default(
44814 // Start and end events are dispatched exactly once each per legitimate outside call to `save`
44816 // dispatched as soon as a call to `save` has been deemed legitimate
44818 // dispatched after the result event has been dispatched
44819 "willAttemptUpload",
44820 // dispatched before the actual upload call occurs, if it will
44822 // Each save results in one of these outcomes:
44824 // upload wasn't attempted since there were no edits
44826 // upload failed due to errors
44828 // upload failed due to data conflicts
44830 // upload completed without errors
44832 var _isSaving = false;
44833 var _conflicts = [];
44836 var _discardTags = {};
44837 _mainFileFetcher.get("discarded").then(function(d2) {
44839 }).catch(function() {
44841 var uploader = utilRebind({}, dispatch14, "on");
44842 uploader.isSaving = function() {
44845 uploader.save = function(changeset, tryAgain, checkConflicts) {
44846 if (_isSaving && !tryAgain) {
44849 var osm = context.connection();
44852 if (!osm.authenticated()) {
44853 osm.authenticate(function(err) {
44855 uploader.save(changeset, tryAgain, checkConflicts);
44862 dispatch14.call("saveStarted", this);
44864 var history = context.history();
44867 _origChanges = history.changes(actionDiscardTags(history.difference(), _discardTags));
44869 history.perform(actionNoop());
44871 if (!checkConflicts) {
44874 performFullConflictCheck(changeset);
44877 function performFullConflictCheck(changeset) {
44878 var osm = context.connection();
44881 var history = context.history();
44882 var localGraph = context.graph();
44883 var remoteGraph = coreGraph(history.base(), true);
44884 var summary = history.difference().summary();
44886 for (var i3 = 0; i3 < summary.length; i3++) {
44887 var item = summary[i3];
44888 if (item.changeType === "modified") {
44889 _toCheck.push(item.entity.id);
44892 var _toLoad = withChildNodes(_toCheck, localGraph);
44894 var _toLoadCount = 0;
44895 var _toLoadTotal = _toLoad.length;
44896 if (_toCheck.length) {
44897 dispatch14.call("progressChanged", this, _toLoadCount, _toLoadTotal);
44898 _toLoad.forEach(function(id2) {
44899 _loaded[id2] = false;
44901 osm.loadMultiple(_toLoad, loaded);
44906 function withChildNodes(ids, graph) {
44907 var s2 = new Set(ids);
44908 ids.forEach(function(id2) {
44909 var entity = graph.entity(id2);
44910 if (entity.type !== "way")
44912 graph.childNodes(entity).forEach(function(child) {
44913 if (child.version !== void 0) {
44918 return Array.from(s2);
44920 function loaded(err, result) {
44921 if (_errors.length)
44925 msg: err.message || err.responseText,
44926 details: [_t("save.status_code", { code: err.status })]
44928 didResultInErrors();
44931 result.data.forEach(function(entity) {
44932 remoteGraph.replace(entity);
44933 _loaded[entity.id] = true;
44934 _toLoad = _toLoad.filter(function(val) {
44935 return val !== entity.id;
44937 if (!entity.visible)
44940 if (entity.type === "way") {
44941 for (i4 = 0; i4 < entity.nodes.length; i4++) {
44942 id2 = entity.nodes[i4];
44943 if (_loaded[id2] === void 0) {
44944 _loaded[id2] = false;
44945 loadMore.push(id2);
44948 } else if (entity.type === "relation" && entity.isMultipolygon()) {
44949 for (i4 = 0; i4 < entity.members.length; i4++) {
44950 id2 = entity.members[i4].id;
44951 if (_loaded[id2] === void 0) {
44952 _loaded[id2] = false;
44953 loadMore.push(id2);
44958 _toLoadCount += result.data.length;
44959 _toLoadTotal += loadMore.length;
44960 dispatch14.call("progressChanged", this, _toLoadCount, _toLoadTotal);
44961 if (loadMore.length) {
44962 _toLoad.push.apply(_toLoad, loadMore);
44963 osm.loadMultiple(loadMore, loaded);
44965 if (!_toLoad.length) {
44971 function detectConflicts() {
44972 function choice(id2, text2, action) {
44976 action: function() {
44977 history.replace(action);
44981 function formatUser(d2) {
44982 return '<a href="' + osm.userURL(d2) + '" target="_blank">' + escape_default(d2) + "</a>";
44984 function entityName(entity) {
44985 return utilDisplayName(entity) || utilDisplayType(entity.id) + " " + entity.id;
44987 function sameVersions(local, remote) {
44988 if (local.version !== remote.version)
44990 if (local.type === "way") {
44991 var children2 = utilArrayUnion(local.nodes, remote.nodes);
44992 for (var i4 = 0; i4 < children2.length; i4++) {
44993 var a2 = localGraph.hasEntity(children2[i4]);
44994 var b2 = remoteGraph.hasEntity(children2[i4]);
44995 if (a2 && b2 && a2.version !== b2.version)
45001 _toCheck.forEach(function(id2) {
45002 var local = localGraph.entity(id2);
45003 var remote = remoteGraph.entity(id2);
45004 if (sameVersions(local, remote))
45006 var merge2 = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags, formatUser);
45007 history.replace(merge2);
45008 var mergeConflicts = merge2.conflicts();
45009 if (!mergeConflicts.length)
45011 var forceLocal = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_local");
45012 var forceRemote = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_remote");
45013 var keepMine = _t("save.conflict." + (remote.visible ? "keep_local" : "restore"));
45014 var keepTheirs = _t("save.conflict." + (remote.visible ? "keep_remote" : "delete"));
45017 name: entityName(local),
45018 details: mergeConflicts,
45021 choice(id2, keepMine, forceLocal),
45022 choice(id2, keepTheirs, forceRemote)
45028 function upload(changeset) {
45029 var osm = context.connection();
45031 _errors.push({ msg: "No OSM Service" });
45033 if (_conflicts.length) {
45034 didResultInConflicts(changeset);
45035 } else if (_errors.length) {
45036 didResultInErrors();
45038 var history = context.history();
45039 var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
45040 if (changes.modified.length || changes.created.length || changes.deleted.length) {
45041 dispatch14.call("willAttemptUpload", this);
45042 osm.putChangeset(changeset, changes, uploadCallback);
45044 didResultInNoChanges();
45048 function uploadCallback(err, changeset) {
45050 if (err.status === 409) {
45051 uploader.save(changeset, true, true);
45054 msg: err.message || err.responseText,
45055 details: [_t("save.status_code", { code: err.status })]
45057 didResultInErrors();
45060 didResultInSuccess(changeset);
45063 function didResultInNoChanges() {
45064 dispatch14.call("resultNoChanges", this);
45068 function didResultInErrors() {
45069 context.history().pop();
45070 dispatch14.call("resultErrors", this, _errors);
45073 function didResultInConflicts(changeset) {
45074 _conflicts.sort(function(a2, b2) {
45075 return b2.id.localeCompare(a2.id);
45077 dispatch14.call("resultConflicts", this, changeset, _conflicts, _origChanges);
45080 function didResultInSuccess(changeset) {
45081 context.history().clearSaved();
45082 dispatch14.call("resultSuccess", this, changeset);
45083 window.setTimeout(function() {
45088 function endSave() {
45090 dispatch14.call("saveEnded", this);
45092 uploader.cancelConflictResolution = function() {
45093 context.history().pop();
45095 uploader.processResolvedConflicts = function(changeset) {
45096 var history = context.history();
45097 for (var i3 = 0; i3 < _conflicts.length; i3++) {
45098 if (_conflicts[i3].chosen === 1) {
45099 var entity = context.hasEntity(_conflicts[i3].id);
45100 if (entity && entity.type === "way") {
45101 var children2 = utilArrayUniq(entity.nodes);
45102 for (var j3 = 0; j3 < children2.length; j3++) {
45103 history.replace(actionRevert(children2[j3]));
45106 history.replace(actionRevert(_conflicts[i3].id));
45109 uploader.save(changeset, true, false);
45111 uploader.reset = function() {
45116 // modules/renderer/background_source.js
45117 var import_lodash4 = __toESM(require_lodash());
45119 // modules/util/IntervalTasksQueue.js
45120 var IntervalTasksQueue = class {
45122 * Interval in milliseconds inside which only 1 task can execute.
45123 * e.g. if interval is 200ms, and 5 async tasks are unqueued,
45124 * they will complete in ~1s if not cleared
45125 * @param {number} intervalInMs
45127 constructor(intervalInMs) {
45128 this.intervalInMs = intervalInMs;
45129 this.pendingHandles = [];
45133 let taskTimeout = this.time;
45134 this.time += this.intervalInMs;
45135 this.pendingHandles.push(setTimeout(() => {
45136 this.time -= this.intervalInMs;
45141 this.pendingHandles.forEach((timeoutHandle) => {
45142 clearTimeout(timeoutHandle);
45144 this.pendingHandles = [];
45149 // modules/renderer/background_source.js
45150 var isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
45151 window.matchMedia(`
45152 (-webkit-min-device-pixel-ratio: 2), /* Safari */
45153 (min-resolution: 2dppx), /* standard */
45154 (min-resolution: 192dpi) /* fallback */
45155 `).addListener(function() {
45156 isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
45158 function localeDateString(s2) {
45161 var options2 = { day: "numeric", month: "short", year: "numeric" };
45162 var d2 = new Date(s2);
45163 if (isNaN(d2.getTime()))
45165 return d2.toLocaleDateString(_mainLocalizer.localeCode(), options2);
45167 function vintageRange(vintage) {
45169 if (vintage.start || vintage.end) {
45170 s2 = vintage.start || "?";
45171 if (vintage.start !== vintage.end) {
45172 s2 += " - " + (vintage.end || "?");
45177 function rendererBackgroundSource(data) {
45178 var source = Object.assign({}, data);
45179 var _offset = [0, 0];
45180 var _name = source.name;
45181 var _description = source.description;
45182 var _best = !!source.best;
45183 var _template = source.encrypted ? utilAesDecrypt(source.template) : source.template;
45184 source.tileSize = data.tileSize || 256;
45185 source.zoomExtent = data.zoomExtent || [0, 22];
45186 source.overzoom = data.overzoom !== false;
45187 source.offset = function(val) {
45188 if (!arguments.length)
45193 source.nudge = function(val, zoomlevel) {
45194 _offset[0] += val[0] / Math.pow(2, zoomlevel);
45195 _offset[1] += val[1] / Math.pow(2, zoomlevel);
45198 source.name = function() {
45199 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45200 return _t("imagery." + id_safe + ".name", { default: (0, import_lodash4.escape)(_name) });
45202 source.label = function() {
45203 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45204 return _t.append("imagery." + id_safe + ".name", { default: (0, import_lodash4.escape)(_name) });
45206 source.hasDescription = function() {
45207 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45208 var descriptionText = _mainLocalizer.tInfo("imagery." + id_safe + ".description", { default: (0, import_lodash4.escape)(_description) }).text;
45209 return descriptionText !== "";
45211 source.description = function() {
45212 var id_safe = source.id.replace(/\./g, "<TX_DOT>");
45213 return _t.append("imagery." + id_safe + ".description", { default: (0, import_lodash4.escape)(_description) });
45215 source.best = function() {
45218 source.area = function() {
45220 return Number.MAX_VALUE;
45221 var area = area_default({ type: "MultiPolygon", coordinates: [data.polygon] });
45222 return isNaN(area) ? 0 : area;
45224 source.imageryUsed = function() {
45225 return _name || source.id;
45227 source.template = function(val) {
45228 if (!arguments.length)
45230 if (source.id === "custom" || source.id === "Bing") {
45235 source.url = function(coord2) {
45236 var result = _template.replace(/#[\s\S]*/u, "");
45239 if (!source.type || source.id === "custom") {
45240 if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(result)) {
45241 source.type = "wms";
45242 source.projection = "EPSG:3857";
45243 } else if (/\{(x|y)\}/.test(result)) {
45244 source.type = "tms";
45245 } else if (/\{u\}/.test(result)) {
45246 source.type = "bing";
45249 if (source.type === "wms") {
45250 var tileToProjectedCoords = function(x2, y2, z2) {
45251 var zoomSize = Math.pow(2, z2);
45252 var lon = x2 / zoomSize * Math.PI * 2 - Math.PI;
45253 var lat = Math.atan(Math.sinh(Math.PI * (1 - 2 * y2 / zoomSize)));
45254 switch (source.projection) {
45257 x: lon * 180 / Math.PI,
45258 y: lat * 180 / Math.PI
45261 var mercCoords = mercatorRaw(lon, lat);
45263 x: 2003750834e-2 / Math.PI * mercCoords[0],
45264 y: 2003750834e-2 / Math.PI * mercCoords[1]
45268 var tileSize = source.tileSize;
45269 var projection2 = source.projection;
45270 var minXmaxY = tileToProjectedCoords(coord2[0], coord2[1], coord2[2]);
45271 var maxXminY = tileToProjectedCoords(coord2[0] + 1, coord2[1] + 1, coord2[2]);
45272 result = result.replace(/\{(\w+)\}/g, function(token, key) {
45278 return projection2;
45280 return projection2.replace(/^EPSG:/, "");
45282 if (projection2 === "EPSG:4326" && // The CRS parameter implies version 1.3 (prior versions use SRS)
45283 /VERSION=1.3|CRS={proj}/.test(source.template().toUpperCase())) {
45284 return maxXminY.y + "," + minXmaxY.x + "," + minXmaxY.y + "," + maxXminY.x;
45286 return minXmaxY.x + "," + maxXminY.y + "," + maxXminY.x + "," + minXmaxY.y;
45300 } else if (source.type === "tms") {
45301 result = result.replace("{x}", coord2[0]).replace("{y}", coord2[1]).replace(/\{[t-]y\}/, Math.pow(2, coord2[2]) - coord2[1] - 1).replace(/\{z(oom)?\}/, coord2[2]).replace(/\{@2x\}|\{r\}/, isRetina ? "@2x" : "");
45302 } else if (source.type === "bing") {
45303 result = result.replace("{u}", function() {
45305 for (var zoom = coord2[2]; zoom > 0; zoom--) {
45307 var mask = 1 << zoom - 1;
45308 if ((coord2[0] & mask) !== 0)
45310 if ((coord2[1] & mask) !== 0)
45312 u2 += b2.toString();
45317 result = result.replace(/\{switch:([^}]+)\}/, function(s2, r2) {
45318 var subdomains = r2.split(",");
45319 return subdomains[(coord2[0] + coord2[1]) % subdomains.length];
45323 source.validZoom = function(z2) {
45324 return source.zoomExtent[0] <= z2 && (source.overzoom || source.zoomExtent[1] > z2);
45326 source.isLocatorOverlay = function() {
45327 return source.id === "mapbox_locator_overlay";
45329 source.isHidden = function() {
45330 return source.id === "DigitalGlobe-Premium-vintage" || source.id === "DigitalGlobe-Standard-vintage";
45332 source.copyrightNotices = function() {
45334 source.getMetadata = function(center, tileCoord, callback) {
45336 start: localeDateString(source.startDate),
45337 end: localeDateString(source.endDate)
45339 vintage.range = vintageRange(vintage);
45340 var metadata = { vintage };
45341 callback(null, metadata);
45345 rendererBackgroundSource.Bing = function(data, dispatch14) {
45346 data.template = "https://ecn.t{switch:0,1,2,3}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=1&pr=odbl&n=z";
45347 var bing = rendererBackgroundSource(data);
45348 var key = utilAesDecrypt("5c875730b09c6b422433e807e1ff060b6536c791dbfffcffc4c6b18a1bdba1f14593d151adb50e19e1be1ab19aef813bf135d0f103475e5c724dec94389e45d0");
45349 const strictParam = "n";
45350 var url = "https://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialOSM?include=ImageryProviders&uriScheme=https&key=" + key;
45353 var providers = [];
45354 var taskQueue = new IntervalTasksQueue(250);
45355 var metadataLastZoom = -1;
45356 json_default(url).then(function(json) {
45357 let imageryResource = json.resourceSets[0].resources[0];
45358 let template = imageryResource.imageUrl;
45359 let subDomains = imageryResource.imageUrlSubdomains;
45360 let subDomainNumbers = subDomains.map((subDomain) => {
45361 return subDomain.substring(1);
45363 template = template.replace("{subdomain}", `t{switch:${subDomainNumbers}}`).replace("{quadkey}", "{u}");
45364 if (!new URLSearchParams(template).has(strictParam)) {
45365 template += `&${strictParam}=z`;
45367 bing.template(template);
45368 providers = imageryResource.imageryProviders.map(function(provider) {
45370 attribution: provider.attribution,
45371 areas: provider.coverageAreas.map(function(area) {
45373 zoom: [area.zoomMin, area.zoomMax],
45374 extent: geoExtent([area.bbox[1], area.bbox[0]], [area.bbox[3], area.bbox[2]])
45379 dispatch14.call("change");
45380 }).catch(function() {
45382 bing.copyrightNotices = function(zoom, extent) {
45383 zoom = Math.min(zoom, 21);
45384 return providers.filter(function(provider) {
45385 return provider.areas.some(function(area) {
45386 return extent.intersects(area.extent) && area.zoom[0] <= zoom && area.zoom[1] >= zoom;
45388 }).map(function(provider) {
45389 return provider.attribution;
45392 bing.getMetadata = function(center, tileCoord, callback) {
45393 var tileID = tileCoord.slice(0, 3).join("/");
45394 var zoom = Math.min(tileCoord[2], 21);
45395 var centerPoint = center[1] + "," + center[0];
45396 var url2 = "https://dev.virtualearth.net/REST/v1/Imagery/BasicMetadata/AerialOSM/" + centerPoint + "?zl=" + zoom + "&key=" + key;
45397 if (inflight[tileID])
45399 if (!cache[tileID]) {
45400 cache[tileID] = {};
45402 if (cache[tileID] && cache[tileID].metadata) {
45403 return callback(null, cache[tileID].metadata);
45405 inflight[tileID] = true;
45406 if (metadataLastZoom !== tileCoord[2]) {
45407 metadataLastZoom = tileCoord[2];
45410 taskQueue.enqueue(() => {
45411 json_default(url2).then(function(result) {
45412 delete inflight[tileID];
45414 throw new Error("Unknown Error");
45417 start: localeDateString(result.resourceSets[0].resources[0].vintageStart),
45418 end: localeDateString(result.resourceSets[0].resources[0].vintageEnd)
45420 vintage.range = vintageRange(vintage);
45421 var metadata = { vintage };
45422 cache[tileID].metadata = metadata;
45424 callback(null, metadata);
45425 }).catch(function(err) {
45426 delete inflight[tileID];
45428 callback(err.message);
45432 bing.terms_url = "https://blog.openstreetmap.org/2010/11/30/microsoft-imagery-details";
45435 rendererBackgroundSource.Esri = function(data) {
45436 if (data.template.match(/blankTile/) === null) {
45437 data.template = data.template + "?blankTile=false";
45439 var esri = rendererBackgroundSource(data);
45443 esri.fetchTilemap = function(center) {
45444 if (_prevCenter && geoSphericalDistance(center, _prevCenter) < 5e3)
45446 _prevCenter = center;
45448 var dummyUrl = esri.url([1, 2, 3]);
45449 var x2 = Math.floor((center[0] + 180) / 360 * Math.pow(2, z2));
45450 var y2 = Math.floor((1 - Math.log(Math.tan(center[1] * Math.PI / 180) + 1 / Math.cos(center[1] * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, z2));
45451 var tilemapUrl = dummyUrl.replace(/tile\/[0-9]+\/[0-9]+\/[0-9]+\?blankTile=false/, "tilemap") + "/" + z2 + "/" + y2 + "/" + x2 + "/8/8";
45452 json_default(tilemapUrl).then(function(tilemap) {
45454 throw new Error("Unknown Error");
45456 var hasTiles = true;
45457 for (var i3 = 0; i3 < tilemap.data.length; i3++) {
45458 if (!tilemap.data[i3]) {
45463 esri.zoomExtent[1] = hasTiles ? 22 : 19;
45464 }).catch(function() {
45467 esri.getMetadata = function(center, tileCoord, callback) {
45468 if (esri.id !== "EsriWorldImagery") {
45469 return callback(null, {});
45471 var tileID = tileCoord.slice(0, 3).join("/");
45472 var zoom = Math.min(tileCoord[2], esri.zoomExtent[1]);
45473 var centerPoint = center[0] + "," + center[1];
45474 var unknown = _t("info_panels.background.unknown");
45477 if (inflight[tileID])
45479 var url = "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/4/query";
45480 url += "?returnGeometry=false&geometry=" + centerPoint + "&inSR=4326&geometryType=esriGeometryPoint&outFields=*&f=json";
45481 if (!cache[tileID]) {
45482 cache[tileID] = {};
45484 if (cache[tileID] && cache[tileID].metadata) {
45485 return callback(null, cache[tileID].metadata);
45487 inflight[tileID] = true;
45488 json_default(url).then(function(result) {
45489 delete inflight[tileID];
45490 result = result.features.map((f3) => f3.attributes).filter((a2) => a2.MinMapLevel <= zoom && a2.MaxMapLevel >= zoom)[0];
45492 throw new Error("Unknown Error");
45493 } else if (result.features && result.features.length < 1) {
45494 throw new Error("No Results");
45495 } else if (result.error && result.error.message) {
45496 throw new Error(result.error.message);
45498 var captureDate = localeDateString(result.SRC_DATE2);
45500 start: captureDate,
45506 source: clean2(result.NICE_NAME),
45507 description: clean2(result.NICE_DESC),
45508 resolution: clean2(+Number(result.SRC_RES).toFixed(4)),
45509 accuracy: clean2(+Number(result.SRC_ACC).toFixed(4))
45511 if (isFinite(metadata.resolution)) {
45512 metadata.resolution += " m";
45514 if (isFinite(metadata.accuracy)) {
45515 metadata.accuracy += " m";
45517 cache[tileID].metadata = metadata;
45519 callback(null, metadata);
45520 }).catch(function(err) {
45521 delete inflight[tileID];
45523 callback(err.message);
45525 function clean2(val) {
45526 return String(val).trim() || unknown;
45531 rendererBackgroundSource.None = function() {
45532 var source = rendererBackgroundSource({ id: "none", template: "" });
45533 source.name = function() {
45534 return _t("background.none");
45536 source.label = function() {
45537 return _t.append("background.none");
45539 source.imageryUsed = function() {
45542 source.area = function() {
45547 rendererBackgroundSource.Custom = function(template) {
45548 var source = rendererBackgroundSource({ id: "custom", template });
45549 source.name = function() {
45550 return _t("background.custom");
45552 source.label = function() {
45553 return _t.append("background.custom");
45555 source.imageryUsed = function() {
45556 var cleaned = source.template();
45557 if (cleaned.indexOf("?") !== -1) {
45558 var parts = cleaned.split("?", 2);
45559 var qs = utilStringQs(parts[1]);
45560 ["access_token", "connectId", "token"].forEach(function(param) {
45562 qs[param] = "{apikey}";
45565 cleaned = parts[0] + "?" + utilQsString(qs, true);
45567 cleaned = cleaned.replace(/token\/(\w+)/, "token/{apikey}").replace(/key=(\w+)/, "key={apikey}");
45568 return "Custom (" + cleaned + " )";
45570 source.area = function() {
45576 // node_modules/@turf/helpers/dist/es/index.js
45577 var earthRadius = 63710088e-1;
45579 centimeters: earthRadius * 100,
45580 centimetres: earthRadius * 100,
45581 degrees: earthRadius / 111325,
45582 feet: earthRadius * 3.28084,
45583 inches: earthRadius * 39.37,
45584 kilometers: earthRadius / 1e3,
45585 kilometres: earthRadius / 1e3,
45586 meters: earthRadius,
45587 metres: earthRadius,
45588 miles: earthRadius / 1609.344,
45589 millimeters: earthRadius * 1e3,
45590 millimetres: earthRadius * 1e3,
45591 nauticalmiles: earthRadius / 1852,
45593 yards: earthRadius * 1.0936
45595 var unitsFactors = {
45598 degrees: 1 / 111325,
45601 kilometers: 1 / 1e3,
45602 kilometres: 1 / 1e3,
45605 miles: 1 / 1609.344,
45608 nauticalmiles: 1 / 1852,
45609 radians: 1 / earthRadius,
45612 function feature2(geom, properties, options2) {
45613 if (options2 === void 0) {
45616 var feat = { type: "Feature" };
45617 if (options2.id === 0 || options2.id) {
45618 feat.id = options2.id;
45620 if (options2.bbox) {
45621 feat.bbox = options2.bbox;
45623 feat.properties = properties || {};
45624 feat.geometry = geom;
45627 function polygon(coordinates, properties, options2) {
45628 if (options2 === void 0) {
45631 for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {
45632 var ring = coordinates_1[_i];
45633 if (ring.length < 4) {
45634 throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
45636 for (var j3 = 0; j3 < ring[ring.length - 1].length; j3++) {
45637 if (ring[ring.length - 1][j3] !== ring[0][j3]) {
45638 throw new Error("First and last Position are not equivalent.");
45646 return feature2(geom, properties, options2);
45648 function lineString(coordinates, properties, options2) {
45649 if (options2 === void 0) {
45652 if (coordinates.length < 2) {
45653 throw new Error("coordinates must be an array of two or more positions");
45656 type: "LineString",
45659 return feature2(geom, properties, options2);
45661 function multiLineString(coordinates, properties, options2) {
45662 if (options2 === void 0) {
45666 type: "MultiLineString",
45669 return feature2(geom, properties, options2);
45671 function multiPolygon(coordinates, properties, options2) {
45672 if (options2 === void 0) {
45676 type: "MultiPolygon",
45679 return feature2(geom, properties, options2);
45682 // node_modules/@turf/invariant/dist/es/index.js
45683 function getGeom(geojson) {
45684 if (geojson.type === "Feature") {
45685 return geojson.geometry;
45690 // node_modules/@turf/bbox-clip/dist/es/lib/lineclip.js
45691 function lineclip(points, bbox2, result) {
45692 var len = points.length, codeA = bitCode(points[0], bbox2), part = [], i3, codeB, lastCode;
45697 for (i3 = 1; i3 < len; i3++) {
45698 a2 = points[i3 - 1];
45700 codeB = lastCode = bitCode(b2, bbox2);
45702 if (!(codeA | codeB)) {
45704 if (codeB !== lastCode) {
45706 if (i3 < len - 1) {
45710 } else if (i3 === len - 1) {
45714 } else if (codeA & codeB) {
45716 } else if (codeA) {
45717 a2 = intersect(a2, b2, codeA, bbox2);
45718 codeA = bitCode(a2, bbox2);
45720 b2 = intersect(a2, b2, codeB, bbox2);
45721 codeB = bitCode(b2, bbox2);
45730 function polygonclip(points, bbox2) {
45731 var result, edge, prev, prevInside, i3, p2, inside;
45732 for (edge = 1; edge <= 8; edge *= 2) {
45734 prev = points[points.length - 1];
45735 prevInside = !(bitCode(prev, bbox2) & edge);
45736 for (i3 = 0; i3 < points.length; i3++) {
45738 inside = !(bitCode(p2, bbox2) & edge);
45739 if (inside !== prevInside)
45740 result.push(intersect(prev, p2, edge, bbox2));
45744 prevInside = inside;
45747 if (!points.length)
45752 function intersect(a2, b2, edge, bbox2) {
45753 return edge & 8 ? [a2[0] + (b2[0] - a2[0]) * (bbox2[3] - a2[1]) / (b2[1] - a2[1]), bbox2[3]] : edge & 4 ? [a2[0] + (b2[0] - a2[0]) * (bbox2[1] - a2[1]) / (b2[1] - a2[1]), bbox2[1]] : edge & 2 ? [bbox2[2], a2[1] + (b2[1] - a2[1]) * (bbox2[2] - a2[0]) / (b2[0] - a2[0])] : edge & 1 ? [bbox2[0], a2[1] + (b2[1] - a2[1]) * (bbox2[0] - a2[0]) / (b2[0] - a2[0])] : null;
45755 function bitCode(p2, bbox2) {
45757 if (p2[0] < bbox2[0])
45759 else if (p2[0] > bbox2[2])
45761 if (p2[1] < bbox2[1])
45763 else if (p2[1] > bbox2[3])
45768 // node_modules/@turf/bbox-clip/dist/es/index.js
45769 function bboxClip(feature3, bbox2) {
45770 var geom = getGeom(feature3);
45771 var type2 = geom.type;
45772 var properties = feature3.type === "Feature" ? feature3.properties : {};
45773 var coords = geom.coordinates;
45776 case "MultiLineString": {
45778 if (type2 === "LineString") {
45781 coords.forEach(function(line) {
45782 lineclip(line, bbox2, lines_1);
45784 if (lines_1.length === 1) {
45785 return lineString(lines_1[0], properties);
45787 return multiLineString(lines_1, properties);
45790 return polygon(clipPolygon(coords, bbox2), properties);
45791 case "MultiPolygon":
45792 return multiPolygon(coords.map(function(poly) {
45793 return clipPolygon(poly, bbox2);
45796 throw new Error("geometry " + type2 + " not supported");
45799 function clipPolygon(rings, bbox2) {
45801 for (var _i = 0, rings_1 = rings; _i < rings_1.length; _i++) {
45802 var ring = rings_1[_i];
45803 var clipped = polygonclip(ring, bbox2);
45804 if (clipped.length > 0) {
45805 if (clipped[0][0] !== clipped[clipped.length - 1][0] || clipped[0][1] !== clipped[clipped.length - 1][1]) {
45806 clipped.push(clipped[0]);
45808 if (clipped.length >= 4) {
45809 outRings.push(clipped);
45816 // node_modules/@turf/meta/dist/es/index.js
45817 function coordEach(geojson, callback, excludeWrapCoord) {
45818 if (geojson === null)
45820 var j3, k2, l2, geometry, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type2 = geojson.type, isFeatureCollection = type2 === "FeatureCollection", isFeature = type2 === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
45821 for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
45822 geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
45823 isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
45824 stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
45825 for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
45826 var multiFeatureIndex = 0;
45827 var geometryIndex = 0;
45828 geometry = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
45829 if (geometry === null)
45831 coords = geometry.coordinates;
45832 var geomType = geometry.type;
45833 wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
45834 switch (geomType) {
45847 multiFeatureIndex++;
45851 for (j3 = 0; j3 < coords.length; j3++) {
45861 if (geomType === "MultiPoint")
45862 multiFeatureIndex++;
45864 if (geomType === "LineString")
45865 multiFeatureIndex++;
45868 case "MultiLineString":
45869 for (j3 = 0; j3 < coords.length; j3++) {
45870 for (k2 = 0; k2 < coords[j3].length - wrapShrink; k2++) {
45881 if (geomType === "MultiLineString")
45882 multiFeatureIndex++;
45883 if (geomType === "Polygon")
45886 if (geomType === "Polygon")
45887 multiFeatureIndex++;
45889 case "MultiPolygon":
45890 for (j3 = 0; j3 < coords.length; j3++) {
45892 for (k2 = 0; k2 < coords[j3].length; k2++) {
45893 for (l2 = 0; l2 < coords[j3][k2].length - wrapShrink; l2++) {
45895 coords[j3][k2][l2],
45906 multiFeatureIndex++;
45909 case "GeometryCollection":
45910 for (j3 = 0; j3 < geometry.geometries.length; j3++)
45911 if (coordEach(geometry.geometries[j3], callback, excludeWrapCoord) === false)
45915 throw new Error("Unknown Geometry Type");
45921 // node_modules/@turf/bbox/dist/es/index.js
45922 function bbox(geojson) {
45923 var result = [Infinity, Infinity, -Infinity, -Infinity];
45924 coordEach(geojson, function(coord2) {
45925 if (result[0] > coord2[0]) {
45926 result[0] = coord2[0];
45928 if (result[1] > coord2[1]) {
45929 result[1] = coord2[1];
45931 if (result[2] < coord2[0]) {
45932 result[2] = coord2[0];
45934 if (result[3] < coord2[1]) {
45935 result[3] = coord2[1];
45940 bbox["default"] = bbox;
45941 var es_default = bbox;
45943 // modules/renderer/background.js
45944 var import_which_polygon3 = __toESM(require_which_polygon());
45946 // modules/renderer/tile_layer.js
45947 function rendererTileLayer(context) {
45948 var transformProp = utilPrefixCSSProperty("Transform");
45949 var tiler9 = utilTiler();
45950 var _tileSize = 256;
45956 function tileSizeAtZoom(d2, z2) {
45957 var EPSILON = 2e-3;
45958 return _tileSize * Math.pow(2, z2 - d2[2]) / _tileSize + EPSILON;
45960 function atZoom(t2, distance) {
45961 var power = Math.pow(2, distance);
45963 Math.floor(t2[0] * power),
45964 Math.floor(t2[1] * power),
45968 function lookUp(d2) {
45969 for (var up = -1; up > -d2[2]; up--) {
45970 var tile = atZoom(d2, up);
45971 if (_cache4[_source.url(tile)] !== false) {
45976 function uniqueBy(a2, n3) {
45979 for (var i3 = 0; i3 < a2.length; i3++) {
45980 if (seen[a2[i3][n3]] === void 0) {
45982 seen[a2[i3][n3]] = true;
45987 function addSource(d2) {
45988 d2.push(_source.url(d2));
45991 function background(selection2) {
45992 _zoom = geoScaleToZoom(_projection.scale(), _tileSize);
45996 _source.offset()[0] * Math.pow(2, _zoom),
45997 _source.offset()[1] * Math.pow(2, _zoom)
46000 pixelOffset = [0, 0];
46003 _projection.translate()[0] + pixelOffset[0],
46004 _projection.translate()[1] + pixelOffset[1]
46006 tiler9.scale(_projection.scale() * 2 * Math.PI).translate(translate);
46008 _projection.scale() * Math.PI - translate[0],
46009 _projection.scale() * Math.PI - translate[1]
46011 render(selection2);
46013 function render(selection2) {
46017 var showDebug = context.getDebug("tile") && !_source.overlay;
46018 if (_source.validZoom(_zoom)) {
46019 tiler9.skipNullIsland(!!_source.overlay);
46020 tiler9().forEach(function(d2) {
46024 if (typeof d2[3] !== "string")
46027 if (_cache4[d2[3]] === false && lookUp(d2)) {
46028 requests.push(addSource(lookUp(d2)));
46031 requests = uniqueBy(requests, 3).filter(function(r2) {
46032 return _cache4[r2[3]] !== false;
46035 function load(d3_event, d2) {
46036 _cache4[d2[3]] = true;
46037 select_default2(this).on("error", null).on("load", null).classed("tile-loaded", true);
46038 render(selection2);
46040 function error(d3_event, d2) {
46041 _cache4[d2[3]] = false;
46042 select_default2(this).on("error", null).on("load", null).remove();
46043 render(selection2);
46045 function imageTransform(d2) {
46046 var ts = _tileSize * Math.pow(2, _zoom - d2[2]);
46047 var scale = tileSizeAtZoom(d2, _zoom);
46048 return "translate(" + (d2[0] * ts - _tileOrigin[0]) + "px," + (d2[1] * ts - _tileOrigin[1]) + "px) scale(" + scale + "," + scale + ")";
46050 function tileCenter(d2) {
46051 var ts = _tileSize * Math.pow(2, _zoom - d2[2]);
46053 d2[0] * ts - _tileOrigin[0] + ts / 2,
46054 d2[1] * ts - _tileOrigin[1] + ts / 2
46057 function debugTransform(d2) {
46058 var coord2 = tileCenter(d2);
46059 return "translate(" + coord2[0] + "px," + coord2[1] + "px)";
46061 var dims = tiler9.size();
46062 var mapCenter = [dims[0] / 2, dims[1] / 2];
46063 var minDist = Math.max(dims[0], dims[1]);
46065 requests.forEach(function(d2) {
46066 var c2 = tileCenter(d2);
46067 var dist = geoVecLength(c2, mapCenter);
46068 if (dist < minDist) {
46073 var image = selection2.selectAll("img").data(requests, function(d2) {
46076 image.exit().style(transformProp, imageTransform).classed("tile-removing", true).classed("tile-center", false).each(function() {
46077 var tile = select_default2(this);
46078 window.setTimeout(function() {
46079 if (tile.classed("tile-removing")) {
46084 image.enter().append("img").attr("class", "tile").attr("alt", "").attr("draggable", "false").style("width", _tileSize + "px").style("height", _tileSize + "px").attr("src", function(d2) {
46086 }).on("error", error).on("load", load).merge(image).style(transformProp, imageTransform).classed("tile-debug", showDebug).classed("tile-removing", false).classed("tile-center", function(d2) {
46087 return d2 === nearCenter;
46089 var debug2 = selection2.selectAll(".tile-label-debug").data(showDebug ? requests : [], function(d2) {
46092 debug2.exit().remove();
46094 var debugEnter = debug2.enter().append("div").attr("class", "tile-label-debug");
46095 debugEnter.append("div").attr("class", "tile-label-debug-coord");
46096 debugEnter.append("div").attr("class", "tile-label-debug-vintage");
46097 debug2 = debug2.merge(debugEnter);
46098 debug2.style(transformProp, debugTransform);
46099 debug2.selectAll(".tile-label-debug-coord").text(function(d2) {
46100 return d2[2] + " / " + d2[0] + " / " + d2[1];
46102 debug2.selectAll(".tile-label-debug-vintage").each(function(d2) {
46103 var span = select_default2(this);
46104 var center = context.projection.invert(tileCenter(d2));
46105 _source.getMetadata(center, d2, function(err, result) {
46106 if (result && result.vintage && result.vintage.range) {
46107 span.text(result.vintage.range);
46110 span.call(_t.append("info_panels.background.vintage"));
46111 span.append("span").text(": ");
46112 span.call(_t.append("info_panels.background.unknown"));
46118 background.projection = function(val) {
46119 if (!arguments.length)
46120 return _projection;
46124 background.dimensions = function(val) {
46125 if (!arguments.length)
46126 return tiler9.size();
46130 background.source = function(val) {
46131 if (!arguments.length)
46134 _tileSize = _source.tileSize;
46136 tiler9.tileSize(_source.tileSize).zoomExtent(_source.zoomExtent);
46142 // modules/renderer/background.js
46143 var _imageryIndex = null;
46144 function rendererBackground(context) {
46145 const dispatch14 = dispatch_default("change");
46146 const baseLayer = rendererTileLayer(context).projection(context.projection);
46147 let _checkedBlocklists = [];
46148 let _isValid = true;
46149 let _overlayLayers = [];
46150 let _brightness = 1;
46152 let _saturation = 1;
46153 let _sharpness = 1;
46154 function ensureImageryIndex() {
46155 return _mainFileFetcher.get("imagery").then((sources) => {
46157 return _imageryIndex;
46162 const features = sources.map((source) => {
46163 if (!source.polygon)
46165 const rings = source.polygon.map((ring) => [ring]);
46168 properties: { id: source.id },
46169 geometry: { type: "MultiPolygon", coordinates: rings }
46171 _imageryIndex.features[source.id] = feature3;
46173 }).filter(Boolean);
46174 _imageryIndex.query = (0, import_which_polygon3.default)({ type: "FeatureCollection", features });
46175 _imageryIndex.backgrounds = sources.map((source) => {
46176 if (source.type === "bing") {
46177 return rendererBackgroundSource.Bing(source, dispatch14);
46178 } else if (/^EsriWorldImagery/.test(source.id)) {
46179 return rendererBackgroundSource.Esri(source);
46181 return rendererBackgroundSource(source);
46184 _imageryIndex.backgrounds.unshift(rendererBackgroundSource.None());
46185 let template = corePreferences("background-custom-template") || "";
46186 const custom = rendererBackgroundSource.Custom(template);
46187 _imageryIndex.backgrounds.unshift(custom);
46188 return _imageryIndex;
46191 function background(selection2) {
46192 const currSource = baseLayer.source();
46193 if (context.map().zoom() > 18) {
46194 if (currSource && /^EsriWorldImagery/.test(currSource.id)) {
46195 const center = context.map().center();
46196 currSource.fetchTilemap(center);
46199 const sources = background.sources(context.map().extent());
46200 const wasValid = _isValid;
46201 _isValid = !!sources.filter((d2) => d2 === currSource).length;
46202 if (wasValid !== _isValid) {
46203 background.updateImagery();
46205 let baseFilter = "";
46206 if (_brightness !== 1) {
46207 baseFilter += ` brightness(${_brightness})`;
46209 if (_contrast !== 1) {
46210 baseFilter += ` contrast(${_contrast})`;
46212 if (_saturation !== 1) {
46213 baseFilter += ` saturate(${_saturation})`;
46215 if (_sharpness < 1) {
46216 const blur = number_default(0.5, 5)(1 - _sharpness);
46217 baseFilter += ` blur(${blur}px)`;
46219 let base = selection2.selectAll(".layer-background").data([0]);
46220 base = base.enter().insert("div", ".layer-data").attr("class", "layer layer-background").merge(base);
46221 base.style("filter", baseFilter || null);
46222 let imagery = base.selectAll(".layer-imagery").data([0]);
46223 imagery.enter().append("div").attr("class", "layer layer-imagery").merge(imagery).call(baseLayer);
46224 let maskFilter = "";
46225 let mixBlendMode = "";
46226 if (_sharpness > 1) {
46227 mixBlendMode = "overlay";
46228 maskFilter = "saturate(0) blur(3px) invert(1)";
46229 let contrast = _sharpness - 1;
46230 maskFilter += ` contrast(${contrast})`;
46231 let brightness = number_default(1, 0.85)(_sharpness - 1);
46232 maskFilter += ` brightness(${brightness})`;
46234 let mask = base.selectAll(".layer-unsharp-mask").data(_sharpness > 1 ? [0] : []);
46235 mask.exit().remove();
46236 mask.enter().append("div").attr("class", "layer layer-mask layer-unsharp-mask").merge(mask).call(baseLayer).style("filter", maskFilter || null).style("mix-blend-mode", mixBlendMode || null);
46237 let overlays = selection2.selectAll(".layer-overlay").data(_overlayLayers, (d2) => d2.source().name());
46238 overlays.exit().remove();
46239 overlays.enter().insert("div", ".layer-data").attr("class", "layer layer-overlay").merge(overlays).each((layer, i3, nodes) => select_default2(nodes[i3]).call(layer));
46241 background.updateImagery = function() {
46242 let currSource = baseLayer.source();
46243 if (context.inIntro() || !currSource)
46245 let o2 = _overlayLayers.filter((d2) => !d2.source().isLocatorOverlay() && !d2.source().isHidden()).map((d2) => d2.source().id).join(",");
46246 const meters = geoOffsetToMeters(currSource.offset());
46247 const EPSILON = 0.01;
46248 const x2 = +meters[0].toFixed(2);
46249 const y2 = +meters[1].toFixed(2);
46250 let hash = utilStringQs(window.location.hash);
46251 let id2 = currSource.id;
46252 if (id2 === "custom") {
46253 id2 = `custom:${currSource.template()}`;
46256 hash.background = id2;
46258 delete hash.background;
46261 hash.overlays = o2;
46263 delete hash.overlays;
46265 if (Math.abs(x2) > EPSILON || Math.abs(y2) > EPSILON) {
46266 hash.offset = `${x2},${y2}`;
46268 delete hash.offset;
46270 if (!window.mocha) {
46271 window.location.replace("#" + utilQsString(hash, true));
46273 let imageryUsed = [];
46274 let photoOverlaysUsed = [];
46275 const currUsed = currSource.imageryUsed();
46276 if (currUsed && _isValid) {
46277 imageryUsed.push(currUsed);
46279 _overlayLayers.filter((d2) => !d2.source().isLocatorOverlay() && !d2.source().isHidden()).forEach((d2) => imageryUsed.push(d2.source().imageryUsed()));
46280 const dataLayer = context.layers().layer("data");
46281 if (dataLayer && dataLayer.enabled() && dataLayer.hasData()) {
46282 imageryUsed.push(dataLayer.getSrc());
46284 const photoOverlayLayers = {
46285 streetside: "Bing Streetside",
46286 mapillary: "Mapillary Images",
46287 "mapillary-map-features": "Mapillary Map Features",
46288 "mapillary-signs": "Mapillary Signs",
46289 kartaview: "KartaView Images",
46290 vegbilder: "Norwegian Road Administration Images",
46291 mapilio: "Mapilio Images"
46293 for (let layerID in photoOverlayLayers) {
46294 const layer = context.layers().layer(layerID);
46295 if (layer && layer.enabled()) {
46296 photoOverlaysUsed.push(layerID);
46297 imageryUsed.push(photoOverlayLayers[layerID]);
46300 context.history().imageryUsed(imageryUsed);
46301 context.history().photoOverlaysUsed(photoOverlaysUsed);
46303 background.sources = (extent, zoom, includeCurrent) => {
46304 if (!_imageryIndex)
46307 (_imageryIndex.query.bbox(extent.rectangle(), true) || []).forEach((d2) => visible[d2.id] = true);
46308 const currSource = baseLayer.source();
46309 const osm = context.connection();
46310 const blocklists = osm && osm.imageryBlocklists() || [];
46311 const blocklistChanged = blocklists.length !== _checkedBlocklists.length || blocklists.some((regex, index) => String(regex) !== _checkedBlocklists[index]);
46312 if (blocklistChanged) {
46313 _imageryIndex.backgrounds.forEach((source) => {
46314 source.isBlocked = blocklists.some((regex) => regex.test(source.template()));
46316 _checkedBlocklists = blocklists.map((regex) => String(regex));
46318 return _imageryIndex.backgrounds.filter((source) => {
46319 if (includeCurrent && currSource === source)
46321 if (source.isBlocked)
46323 if (!source.polygon)
46325 if (zoom && zoom < 6)
46327 return visible[source.id];
46330 background.dimensions = (val) => {
46333 baseLayer.dimensions(val);
46334 _overlayLayers.forEach((layer) => layer.dimensions(val));
46336 background.baseLayerSource = function(d2) {
46337 if (!arguments.length)
46338 return baseLayer.source();
46339 const osm = context.connection();
46342 const blocklists = osm.imageryBlocklists();
46343 const template = d2.template();
46347 for (let i3 = 0; i3 < blocklists.length; i3++) {
46348 regex = blocklists[i3];
46349 fail = regex.test(template);
46355 regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
46356 fail = regex.test(template);
46358 baseLayer.source(!fail ? d2 : background.findSource("none"));
46359 dispatch14.call("change");
46360 background.updateImagery();
46363 background.findSource = (id2) => {
46364 if (!id2 || !_imageryIndex)
46366 return _imageryIndex.backgrounds.find((d2) => d2.id && d2.id === id2);
46368 background.bing = () => {
46369 background.baseLayerSource(background.findSource("Bing"));
46371 background.showsLayer = (d2) => {
46372 const currSource = baseLayer.source();
46373 if (!d2 || !currSource)
46375 return d2.id === currSource.id || _overlayLayers.some((layer) => d2.id === layer.source().id);
46377 background.overlayLayerSources = () => {
46378 return _overlayLayers.map((layer) => layer.source());
46380 background.toggleOverlayLayer = (d2) => {
46382 for (let i3 = 0; i3 < _overlayLayers.length; i3++) {
46383 layer = _overlayLayers[i3];
46384 if (layer.source() === d2) {
46385 _overlayLayers.splice(i3, 1);
46386 dispatch14.call("change");
46387 background.updateImagery();
46391 layer = rendererTileLayer(context).source(d2).projection(context.projection).dimensions(
46392 baseLayer.dimensions()
46394 _overlayLayers.push(layer);
46395 dispatch14.call("change");
46396 background.updateImagery();
46398 background.nudge = (d2, zoom) => {
46399 const currSource = baseLayer.source();
46401 currSource.nudge(d2, zoom);
46402 dispatch14.call("change");
46403 background.updateImagery();
46407 background.offset = function(d2) {
46408 const currSource = baseLayer.source();
46409 if (!arguments.length) {
46410 return currSource && currSource.offset() || [0, 0];
46413 currSource.offset(d2);
46414 dispatch14.call("change");
46415 background.updateImagery();
46419 background.brightness = function(d2) {
46420 if (!arguments.length)
46421 return _brightness;
46423 if (context.mode())
46424 dispatch14.call("change");
46427 background.contrast = function(d2) {
46428 if (!arguments.length)
46431 if (context.mode())
46432 dispatch14.call("change");
46435 background.saturation = function(d2) {
46436 if (!arguments.length)
46437 return _saturation;
46439 if (context.mode())
46440 dispatch14.call("change");
46443 background.sharpness = function(d2) {
46444 if (!arguments.length)
46447 if (context.mode())
46448 dispatch14.call("change");
46452 background.ensureLoaded = () => {
46454 return _loadPromise;
46455 return _loadPromise = ensureImageryIndex();
46457 background.init = () => {
46458 const loadPromise = background.ensureLoaded();
46459 const hash = utilStringQs(window.location.hash);
46460 const requestedBackground = hash.background || hash.layer;
46461 const lastUsedBackground = corePreferences("background-last-used");
46462 return loadPromise.then((imageryIndex) => {
46463 const extent = context.map().extent();
46464 const validBackgrounds = background.sources(extent).filter((d2) => d2.id !== "none" && d2.id !== "custom");
46465 const first = validBackgrounds.length && validBackgrounds[0];
46466 const isLastUsedValid = !!validBackgrounds.find((d2) => d2.id && d2.id === lastUsedBackground);
46468 if (!requestedBackground && extent) {
46469 const viewArea = extent.area();
46470 best = validBackgrounds.find((s2) => {
46471 if (!s2.best() || s2.overlay)
46473 let bbox2 = es_default(bboxClip(
46474 { type: "MultiPolygon", coordinates: [s2.polygon || [extent.polygon()]] },
46477 let area = geoExtent(bbox2.slice(0, 2), bbox2.slice(2, 4)).area();
46478 return area / viewArea > 0.5;
46481 if (requestedBackground && requestedBackground.indexOf("custom:") === 0) {
46482 const template = requestedBackground.replace(/^custom:/, "");
46483 const custom = background.findSource("custom");
46484 background.baseLayerSource(custom.template(template));
46485 corePreferences("background-custom-template", template);
46487 background.baseLayerSource(
46488 background.findSource(requestedBackground) || best || isLastUsedValid && background.findSource(lastUsedBackground) || background.findSource("Bing") || first || background.findSource("none")
46491 const locator = imageryIndex.backgrounds.find((d2) => d2.overlay && d2.default);
46493 background.toggleOverlayLayer(locator);
46495 const overlays = (hash.overlays || "").split(",");
46496 overlays.forEach((overlay) => {
46497 overlay = background.findSource(overlay);
46499 background.toggleOverlayLayer(overlay);
46503 const gpx2 = context.layers().layer("data");
46505 gpx2.url(hash.gpx, ".gpx");
46509 const offset = hash.offset.replace(/;/g, ",").split(",").map((n3) => !isNaN(n3) && n3);
46510 if (offset.length === 2) {
46511 background.offset(geoMetersToOffset(offset));
46514 }).catch((err) => {
46515 console.error(err);
46518 return utilRebind(background, dispatch14, "on");
46521 // modules/renderer/features.js
46522 function rendererFeatures(context) {
46523 var dispatch14 = dispatch_default("change", "redraw");
46524 var features = utilRebind({}, dispatch14, "on");
46525 var _deferred2 = /* @__PURE__ */ new Set();
46526 var traffic_roads = {
46528 "motorway_link": true,
46530 "trunk_link": true,
46532 "primary_link": true,
46534 "secondary_link": true,
46536 "tertiary_link": true,
46537 "residential": true,
46538 "unclassified": true,
46539 "living_street": true,
46542 var service_roads = {
46555 var _cullFactor = 1;
46561 var _forceVisible = {};
46562 function update() {
46563 if (!window.mocha) {
46564 var hash = utilStringQs(window.location.hash);
46565 var disabled = features.disabled();
46566 if (disabled.length) {
46567 hash.disable_features = disabled.join(",");
46569 delete hash.disable_features;
46571 window.location.replace("#" + utilQsString(hash, true));
46572 corePreferences("disabled-features", disabled.join(","));
46574 _hidden = features.hidden();
46575 dispatch14.call("change");
46576 dispatch14.call("redraw");
46578 function defineRule(k2, filter2, max3) {
46579 var isEnabled = true;
46583 enabled: isEnabled,
46584 // whether the user wants it enabled..
46586 currentMax: max3 || Infinity,
46587 defaultMax: max3 || Infinity,
46588 enable: function() {
46589 this.enabled = true;
46590 this.currentMax = this.defaultMax;
46592 disable: function() {
46593 this.enabled = false;
46594 this.currentMax = 0;
46596 hidden: function() {
46597 return this.count === 0 && !this.enabled || this.count > this.currentMax * _cullFactor;
46599 autoHidden: function() {
46600 return this.hidden() && this.currentMax > 0;
46604 defineRule("points", function isPoint(tags, geometry) {
46605 return geometry === "point";
46607 defineRule("traffic_roads", function isTrafficRoad(tags) {
46608 return traffic_roads[tags.highway];
46610 defineRule("service_roads", function isServiceRoad(tags) {
46611 return service_roads[tags.highway];
46613 defineRule("paths", function isPath(tags) {
46614 return paths[tags.highway];
46616 defineRule("buildings", function isBuilding(tags) {
46617 return !!tags.building && tags.building !== "no" || tags.parking === "multi-storey" || tags.parking === "sheds" || tags.parking === "carports" || tags.parking === "garage_boxes";
46619 defineRule("building_parts", function isBuildingPart(tags) {
46620 return tags["building:part"];
46622 defineRule("indoor", function isIndoor(tags) {
46623 return tags.indoor;
46625 defineRule("landuse", function isLanduse(tags, geometry) {
46626 return geometry === "area" && !_rules.buildings.filter(tags) && !_rules.building_parts.filter(tags) && !_rules.indoor.filter(tags) && !_rules.water.filter(tags) && !_rules.pistes.filter(tags);
46628 defineRule("boundaries", function isBoundary(tags, geometry) {
46629 return (geometry === "line" && !!tags.boundary || geometry === "relation" && tags.type === "boundary") && !(traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway] || tags.waterway || tags.railway || tags.landuse || tags.natural || tags.building || tags.power);
46631 defineRule("water", function isWater(tags) {
46632 return !!tags.waterway || tags.natural === "water" || tags.natural === "coastline" || tags.natural === "bay" || tags.landuse === "pond" || tags.landuse === "basin" || tags.landuse === "reservoir" || tags.landuse === "salt_pond";
46634 defineRule("rail", function isRail(tags) {
46635 return (!!tags.railway || tags.landuse === "railway") && !(traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]);
46637 defineRule("pistes", function isPiste(tags) {
46638 return tags["piste:type"];
46640 defineRule("aerialways", function isPiste(tags) {
46641 return tags.aerialway && tags.aerialway !== "yes" && tags.aerialway !== "station";
46643 defineRule("power", function isPower(tags) {
46644 return !!tags.power;
46646 defineRule("past_future", function isPastFuture(tags) {
46647 if (traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]) {
46650 var strings = Object.keys(tags);
46651 for (var i3 = 0; i3 < strings.length; i3++) {
46652 var s2 = strings[i3];
46653 if (osmLifecyclePrefixes[s2] || osmLifecyclePrefixes[tags[s2]])
46658 defineRule("others", function isOther(tags, geometry) {
46659 return geometry === "line" || geometry === "area";
46661 features.features = function() {
46664 features.keys = function() {
46667 features.enabled = function(k2) {
46668 if (!arguments.length) {
46669 return _keys.filter(function(k3) {
46670 return _rules[k3].enabled;
46673 return _rules[k2] && _rules[k2].enabled;
46675 features.disabled = function(k2) {
46676 if (!arguments.length) {
46677 return _keys.filter(function(k3) {
46678 return !_rules[k3].enabled;
46681 return _rules[k2] && !_rules[k2].enabled;
46683 features.hidden = function(k2) {
46684 if (!arguments.length) {
46685 return _keys.filter(function(k3) {
46686 return _rules[k3].hidden();
46689 return _rules[k2] && _rules[k2].hidden();
46691 features.autoHidden = function(k2) {
46692 if (!arguments.length) {
46693 return _keys.filter(function(k3) {
46694 return _rules[k3].autoHidden();
46697 return _rules[k2] && _rules[k2].autoHidden();
46699 features.enable = function(k2) {
46700 if (_rules[k2] && !_rules[k2].enabled) {
46701 _rules[k2].enable();
46705 features.enableAll = function() {
46706 var didEnable = false;
46707 for (var k2 in _rules) {
46708 if (!_rules[k2].enabled) {
46710 _rules[k2].enable();
46716 features.disable = function(k2) {
46717 if (_rules[k2] && _rules[k2].enabled) {
46718 _rules[k2].disable();
46722 features.disableAll = function() {
46723 var didDisable = false;
46724 for (var k2 in _rules) {
46725 if (_rules[k2].enabled) {
46727 _rules[k2].disable();
46733 features.toggle = function(k2) {
46736 return f3.enabled ? f3.disable() : f3.enable();
46741 features.resetStats = function() {
46742 for (var i3 = 0; i3 < _keys.length; i3++) {
46743 _rules[_keys[i3]].count = 0;
46745 dispatch14.call("change");
46747 features.gatherStats = function(d2, resolver, dimensions) {
46748 var needsRedraw = false;
46749 var types = utilArrayGroupBy(d2, "type");
46750 var entities = [].concat(types.relation || [], types.way || [], types.node || []);
46751 var currHidden, geometry, matches, i3, j3;
46752 for (i3 = 0; i3 < _keys.length; i3++) {
46753 _rules[_keys[i3]].count = 0;
46755 _cullFactor = dimensions[0] * dimensions[1] / 1e6;
46756 for (i3 = 0; i3 < entities.length; i3++) {
46757 geometry = entities[i3].geometry(resolver);
46758 matches = Object.keys(features.getMatches(entities[i3], resolver, geometry));
46759 for (j3 = 0; j3 < matches.length; j3++) {
46760 _rules[matches[j3]].count++;
46763 currHidden = features.hidden();
46764 if (currHidden !== _hidden) {
46765 _hidden = currHidden;
46766 needsRedraw = true;
46767 dispatch14.call("change");
46769 return needsRedraw;
46771 features.stats = function() {
46772 for (var i3 = 0; i3 < _keys.length; i3++) {
46773 _stats[_keys[i3]] = _rules[_keys[i3]].count;
46777 features.clear = function(d2) {
46778 for (var i3 = 0; i3 < d2.length; i3++) {
46779 features.clearEntity(d2[i3]);
46782 features.clearEntity = function(entity) {
46783 delete _cache4[osmEntity.key(entity)];
46785 features.reset = function() {
46786 Array.from(_deferred2).forEach(function(handle) {
46787 window.cancelIdleCallback(handle);
46788 _deferred2.delete(handle);
46792 function relationShouldBeChecked(relation) {
46793 return relation.tags.type === "boundary";
46795 features.getMatches = function(entity, resolver, geometry) {
46796 if (geometry === "vertex" || geometry === "relation" && !relationShouldBeChecked(entity))
46798 var ent = osmEntity.key(entity);
46799 if (!_cache4[ent]) {
46802 if (!_cache4[ent].matches) {
46804 var hasMatch = false;
46805 for (var i3 = 0; i3 < _keys.length; i3++) {
46806 if (_keys[i3] === "others") {
46809 if (entity.type === "way") {
46810 var parents = features.getParents(entity, resolver, geometry);
46811 if (parents.length === 1 && parents[0].isMultipolygon() || // 2b. or belongs only to boundary relations
46812 parents.length > 0 && parents.every(function(parent) {
46813 return parent.tags.type === "boundary";
46815 var pkey = osmEntity.key(parents[0]);
46816 if (_cache4[pkey] && _cache4[pkey].matches) {
46817 matches = Object.assign({}, _cache4[pkey].matches);
46823 if (_rules[_keys[i3]].filter(entity.tags, geometry)) {
46824 matches[_keys[i3]] = hasMatch = true;
46827 _cache4[ent].matches = matches;
46829 return _cache4[ent].matches;
46831 features.getParents = function(entity, resolver, geometry) {
46832 if (geometry === "point")
46834 var ent = osmEntity.key(entity);
46835 if (!_cache4[ent]) {
46838 if (!_cache4[ent].parents) {
46840 if (geometry === "vertex") {
46841 parents = resolver.parentWays(entity);
46843 parents = resolver.parentRelations(entity);
46845 _cache4[ent].parents = parents;
46847 return _cache4[ent].parents;
46849 features.isHiddenPreset = function(preset, geometry) {
46850 if (!_hidden.length)
46854 var test = preset.setTags({}, geometry);
46855 for (var key in _rules) {
46856 if (_rules[key].filter(test, geometry)) {
46857 if (_hidden.indexOf(key) !== -1) {
46865 features.isHiddenFeature = function(entity, resolver, geometry) {
46866 if (!_hidden.length)
46868 if (!entity.version)
46870 if (_forceVisible[entity.id])
46872 var matches = Object.keys(features.getMatches(entity, resolver, geometry));
46873 return matches.length && matches.every(function(k2) {
46874 return features.hidden(k2);
46877 features.isHiddenChild = function(entity, resolver, geometry) {
46878 if (!_hidden.length)
46880 if (!entity.version || geometry === "point")
46882 if (_forceVisible[entity.id])
46884 var parents = features.getParents(entity, resolver, geometry);
46885 if (!parents.length)
46887 for (var i3 = 0; i3 < parents.length; i3++) {
46888 if (!features.isHidden(parents[i3], resolver, parents[i3].geometry(resolver))) {
46894 features.hasHiddenConnections = function(entity, resolver) {
46895 if (!_hidden.length)
46897 var childNodes, connections;
46898 if (entity.type === "midpoint") {
46899 childNodes = [resolver.entity(entity.edge[0]), resolver.entity(entity.edge[1])];
46902 childNodes = entity.nodes ? resolver.childNodes(entity) : [];
46903 connections = features.getParents(entity, resolver, entity.geometry(resolver));
46905 connections = childNodes.reduce(function(result, e3) {
46906 return resolver.isShared(e3) ? utilArrayUnion(result, resolver.parentWays(e3)) : result;
46908 return connections.some(function(e3) {
46909 return features.isHidden(e3, resolver, e3.geometry(resolver));
46912 features.isHidden = function(entity, resolver, geometry) {
46913 if (!_hidden.length)
46915 if (!entity.version)
46917 var fn = geometry === "vertex" ? features.isHiddenChild : features.isHiddenFeature;
46918 return fn(entity, resolver, geometry);
46920 features.filter = function(d2, resolver) {
46921 if (!_hidden.length)
46924 for (var i3 = 0; i3 < d2.length; i3++) {
46925 var entity = d2[i3];
46926 if (!features.isHidden(entity, resolver, entity.geometry(resolver))) {
46927 result.push(entity);
46932 features.forceVisible = function(entityIDs) {
46933 if (!arguments.length)
46934 return Object.keys(_forceVisible);
46935 _forceVisible = {};
46936 for (var i3 = 0; i3 < entityIDs.length; i3++) {
46937 _forceVisible[entityIDs[i3]] = true;
46938 var entity = context.hasEntity(entityIDs[i3]);
46939 if (entity && entity.type === "relation") {
46940 for (var j3 in entity.members) {
46941 _forceVisible[entity.members[j3].id] = true;
46947 features.init = function() {
46948 var storage = corePreferences("disabled-features");
46950 var storageDisabled = storage.replace(/;/g, ",").split(",");
46951 storageDisabled.forEach(features.disable);
46953 var hash = utilStringQs(window.location.hash);
46954 if (hash.disable_features) {
46955 var hashDisabled = hash.disable_features.replace(/;/g, ",").split(",");
46956 hashDisabled.forEach(features.disable);
46959 context.history().on("merge.features", function(newEntities) {
46962 var handle = window.requestIdleCallback(function() {
46963 var graph = context.graph();
46964 var types = utilArrayGroupBy(newEntities, "type");
46965 var entities = [].concat(types.relation || [], types.way || [], types.node || []);
46966 for (var i3 = 0; i3 < entities.length; i3++) {
46967 var geometry = entities[i3].geometry(graph);
46968 features.getMatches(entities[i3], graph, geometry);
46971 _deferred2.add(handle);
46976 // modules/svg/areas.js
46977 var import_fast_deep_equal5 = __toESM(require_fast_deep_equal());
46979 // modules/svg/helpers.js
46980 function svgPassiveVertex(node, graph, activeID) {
46983 if (activeID === node.id)
46985 var parents = graph.parentWays(node);
46986 var i3, j3, nodes, isClosed, ix1, ix2, ix3, ix4, max3;
46987 for (i3 = 0; i3 < parents.length; i3++) {
46988 nodes = parents[i3].nodes;
46989 isClosed = parents[i3].isClosed();
46990 for (j3 = 0; j3 < nodes.length; j3++) {
46991 if (nodes[j3] === node.id) {
46997 max3 = nodes.length - 1;
47007 if (nodes[ix1] === activeID)
47009 else if (nodes[ix2] === activeID)
47011 else if (nodes[ix3] === activeID)
47013 else if (nodes[ix4] === activeID)
47015 else if (isClosed && nodes.indexOf(activeID) !== -1)
47022 function svgMarkerSegments(projection2, graph, dt2, shouldReverse, bothDirections) {
47023 return function(entity) {
47027 var clip = identity_default2().clipExtent(projection2.clipExtent()).stream;
47028 var coordinates = graph.childNodes(entity).map(function(n3) {
47032 if (shouldReverse(entity)) {
47033 coordinates.reverse();
47036 type: "LineString",
47038 }, projection2.stream(clip({
47039 lineStart: function() {
47041 lineEnd: function() {
47044 point: function(x2, y2) {
47047 var span = geoVecLength(a2, b2) - offset;
47049 var heading = geoVecAngle(a2, b2);
47050 var dx = dt2 * Math.cos(heading);
47051 var dy = dt2 * Math.sin(heading);
47053 a2[0] + offset * Math.cos(heading),
47054 a2[1] + offset * Math.sin(heading)
47056 var coord2 = [a2, p2];
47057 for (span -= dt2; span >= 0; span -= dt2) {
47058 p2 = geoVecAdd(p2, [dx, dy]);
47064 for (j3 = 0; j3 < coord2.length; j3++) {
47065 segment += (j3 === 0 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
47067 segments.push({ id: entity.id, index: i3++, d: segment });
47068 if (bothDirections(entity)) {
47070 for (j3 = coord2.length - 1; j3 >= 0; j3--) {
47071 segment += (j3 === coord2.length - 1 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
47073 segments.push({ id: entity.id, index: i3++, d: segment });
47084 function svgPath(projection2, graph, isArea) {
47086 var padding = isArea ? 65 : 5;
47087 var viewport = projection2.clipExtent();
47088 var paddedExtent = [
47089 [viewport[0][0] - padding, viewport[0][1] - padding],
47090 [viewport[1][0] + padding, viewport[1][1] + padding]
47092 var clip = identity_default2().clipExtent(paddedExtent).stream;
47093 var project = projection2.stream;
47094 var path = path_default().projection({ stream: function(output) {
47095 return project(clip(output));
47097 var svgpath = function(entity) {
47098 if (entity.id in cache) {
47099 return cache[entity.id];
47101 return cache[entity.id] = path(entity.asGeoJSON(graph));
47104 svgpath.geojson = function(d2) {
47105 if (d2.__featurehash__ !== void 0) {
47106 if (d2.__featurehash__ in cache) {
47107 return cache[d2.__featurehash__];
47109 return cache[d2.__featurehash__] = path(d2);
47117 function svgPointTransform(projection2) {
47118 var svgpoint = function(entity) {
47119 var pt2 = projection2(entity.loc);
47120 return "translate(" + pt2[0] + "," + pt2[1] + ")";
47122 svgpoint.geojson = function(d2) {
47123 return svgpoint(d2.properties.entity);
47127 function svgRelationMemberTags(graph) {
47128 return function(entity) {
47129 var tags = entity.tags;
47130 var shouldCopyMultipolygonTags = !entity.hasInterestingTags();
47131 graph.parentRelations(entity).forEach(function(relation) {
47132 var type2 = relation.tags.type;
47133 if (type2 === "multipolygon" && shouldCopyMultipolygonTags || type2 === "boundary") {
47134 tags = Object.assign({}, relation.tags, tags);
47140 function svgSegmentWay(way, graph, activeID) {
47141 if (activeID === void 0) {
47142 return graph.transient(way, "waySegments", getWaySegments);
47144 return getWaySegments();
47146 function getWaySegments() {
47147 var isActiveWay = way.nodes.indexOf(activeID) !== -1;
47148 var features = { passive: [], active: [] };
47152 for (var i3 = 0; i3 < way.nodes.length; i3++) {
47153 node = graph.entity(way.nodes[i3]);
47154 type2 = svgPassiveVertex(node, graph, activeID);
47155 end = { node, type: type2 };
47156 if (start2.type !== void 0) {
47157 if (start2.node.id === activeID || end.node.id === activeID) {
47158 } else if (isActiveWay && (start2.type === 2 || end.type === 2)) {
47159 pushActive(start2, end, i3);
47160 } else if (start2.type === 0 && end.type === 0) {
47161 pushActive(start2, end, i3);
47163 pushPassive(start2, end, i3);
47169 function pushActive(start3, end2, index) {
47170 features.active.push({
47172 id: way.id + "-" + index + "-nope",
47177 nodes: [start3.node, end2.node],
47181 type: "LineString",
47182 coordinates: [start3.node.loc, end2.node.loc]
47186 function pushPassive(start3, end2, index) {
47187 features.passive.push({
47189 id: way.id + "-" + index,
47193 nodes: [start3.node, end2.node],
47197 type: "LineString",
47198 coordinates: [start3.node.loc, end2.node.loc]
47205 // modules/svg/tag_classes.js
47206 function svgTagClasses() {
47229 var statuses = Object.keys(osmLifecyclePrefixes);
47230 var secondaries = [
47243 "public_transport",
47254 var _tags = function(entity) {
47255 return entity.tags;
47257 var tagClasses = function(selection2) {
47258 selection2.each(function tagClassesEach(entity) {
47259 var value = this.className;
47260 if (value.baseVal !== void 0) {
47261 value = value.baseVal;
47263 var t2 = _tags(entity);
47264 var computed = tagClasses.getClassesString(t2, value);
47265 if (computed !== value) {
47266 select_default2(this).attr("class", computed);
47270 tagClasses.getClassesString = function(t2, value) {
47271 var primary, status;
47272 var i3, j3, k2, v2;
47273 var overrideGeometry;
47274 if (/\bstroke\b/.test(value)) {
47275 if (!!t2.barrier && t2.barrier !== "no") {
47276 overrideGeometry = "line";
47279 var classes = value.trim().split(/\s+/).filter(function(klass) {
47280 return klass.length && !/^tag-/.test(klass);
47281 }).map(function(klass) {
47282 return klass === "line" || klass === "area" ? overrideGeometry || klass : klass;
47284 for (i3 = 0; i3 < primaries.length; i3++) {
47285 k2 = primaries[i3];
47287 if (!v2 || v2 === "no")
47289 if (k2 === "piste:type") {
47291 } else if (k2 === "building:part") {
47292 k2 = "building_part";
47295 if (statuses.indexOf(v2) !== -1) {
47297 classes.push("tag-" + k2);
47299 classes.push("tag-" + k2);
47300 classes.push("tag-" + k2 + "-" + v2);
47305 for (i3 = 0; i3 < statuses.length; i3++) {
47306 for (j3 = 0; j3 < primaries.length; j3++) {
47307 k2 = statuses[i3] + ":" + primaries[j3];
47309 if (!v2 || v2 === "no")
47311 status = statuses[i3];
47317 for (i3 = 0; i3 < statuses.length; i3++) {
47320 if (!v2 || v2 === "no")
47322 if (v2 === "yes") {
47324 } else if (primary && primary === v2) {
47326 } else if (!primary && primaries.indexOf(v2) !== -1) {
47329 classes.push("tag-" + v2);
47336 classes.push("tag-status");
47337 classes.push("tag-status-" + status);
47339 for (i3 = 0; i3 < secondaries.length; i3++) {
47340 k2 = secondaries[i3];
47342 if (!v2 || v2 === "no" || k2 === primary)
47344 classes.push("tag-" + k2);
47345 classes.push("tag-" + k2 + "-" + v2);
47347 if (primary === "highway" && !osmPathHighwayTagValues[t2.highway] || primary === "aeroway") {
47348 var surface = t2.highway === "track" ? "unpaved" : "paved";
47351 if (k2 in osmPavedTags) {
47352 surface = osmPavedTags[k2][v2] ? "paved" : "unpaved";
47354 if (k2 in osmSemipavedTags && !!osmSemipavedTags[k2][v2]) {
47355 surface = "semipaved";
47358 classes.push("tag-" + surface);
47360 var qid = t2.wikidata || t2["flag:wikidata"] || t2["brand:wikidata"] || t2["network:wikidata"] || t2["operator:wikidata"];
47362 classes.push("tag-wikidata");
47364 return classes.filter((klass) => /^[-_a-z0-9]+$/.test(klass)).join(" ").trim();
47366 tagClasses.tags = function(val) {
47367 if (!arguments.length)
47375 // modules/svg/tag_pattern.js
47377 // tag - pattern name
47379 // tag - value - pattern name
47381 // tag - value - rules (optional tag-values, pattern name)
47382 // (matches earlier rules first, so fallback should be last entry)
47384 grave_yard: "cemetery",
47385 fountain: "water_standing"
47389 { religion: "christian", pattern: "cemetery_christian" },
47390 { religion: "buddhist", pattern: "cemetery_buddhist" },
47391 { religion: "muslim", pattern: "cemetery_muslim" },
47392 { religion: "jewish", pattern: "cemetery_jewish" },
47393 { pattern: "cemetery" }
47395 construction: "construction",
47396 farmland: "farmland",
47397 farmyard: "farmyard",
47399 { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
47400 { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
47401 { leaf_type: "leafless", pattern: "forest_leafless" },
47402 { pattern: "forest" }
47403 // same as 'leaf_type:mixed'
47405 grave_yard: "cemetery",
47407 landfill: "landfill",
47409 military: "construction",
47410 orchard: "orchard",
47412 vineyard: "vineyard"
47415 horse_riding: "farmyard"
47419 grassland: "grass",
47423 { water: "pond", pattern: "pond" },
47424 { water: "reservoir", pattern: "water_standing" },
47425 { pattern: "waves" }
47428 { wetland: "marsh", pattern: "wetland_marsh" },
47429 { wetland: "swamp", pattern: "wetland_swamp" },
47430 { wetland: "bog", pattern: "wetland_bog" },
47431 { wetland: "reedbed", pattern: "wetland_reedbed" },
47432 { pattern: "wetland" }
47435 { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
47436 { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
47437 { leaf_type: "leafless", pattern: "forest_leafless" },
47438 { pattern: "forest" }
47439 // same as 'leaf_type:mixed'
47443 green: "golf_green",
47453 function svgTagPattern(tags) {
47454 if (tags.building && tags.building !== "no") {
47457 for (var tag in patterns) {
47458 var entityValue = tags[tag];
47461 if (typeof patterns[tag] === "string") {
47462 return "pattern-" + patterns[tag];
47464 var values = patterns[tag];
47465 for (var value in values) {
47466 if (entityValue !== value)
47468 var rules = values[value];
47469 if (typeof rules === "string") {
47470 return "pattern-" + rules;
47472 for (var ruleKey in rules) {
47473 var rule = rules[ruleKey];
47475 for (var criterion in rule) {
47476 if (criterion !== "pattern") {
47477 var v2 = tags[criterion];
47478 if (!v2 || v2 !== rule[criterion]) {
47485 return "pattern-" + rule.pattern;
47494 // modules/svg/areas.js
47495 function svgAreas(projection2, context) {
47496 function getPatternStyle(tags) {
47497 var imageID = svgTagPattern(tags);
47499 return 'url("#ideditor-' + imageID + '")';
47503 function drawTargets(selection2, graph, entities, filter2) {
47504 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
47505 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
47506 var getPath = svgPath(projection2).geojson;
47507 var activeID = context.activeID();
47508 var base = context.history().base();
47509 var data = { targets: [], nopes: [] };
47510 entities.forEach(function(way) {
47511 var features = svgSegmentWay(way, graph, activeID);
47512 data.targets.push.apply(data.targets, features.passive);
47513 data.nopes.push.apply(data.nopes, features.active);
47515 var targetData = data.targets.filter(getPath);
47516 var targets = selection2.selectAll(".area.target-allowed").filter(function(d2) {
47517 return filter2(d2.properties.entity);
47518 }).data(targetData, function key(d2) {
47521 targets.exit().remove();
47522 var segmentWasEdited = function(d2) {
47523 var wayID = d2.properties.entity.id;
47524 if (!base.entities[wayID] || !(0, import_fast_deep_equal5.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
47527 return d2.properties.nodes.some(function(n3) {
47528 return !base.entities[n3.id] || !(0, import_fast_deep_equal5.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
47531 targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d2) {
47532 return "way area target target-allowed " + targetClass + d2.id;
47533 }).classed("segment-edited", segmentWasEdited);
47534 var nopeData = data.nopes.filter(getPath);
47535 var nopes = selection2.selectAll(".area.target-nope").filter(function(d2) {
47536 return filter2(d2.properties.entity);
47537 }).data(nopeData, function key(d2) {
47540 nopes.exit().remove();
47541 nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d2) {
47542 return "way area target target-nope " + nopeClass + d2.id;
47543 }).classed("segment-edited", segmentWasEdited);
47545 function drawAreas(selection2, graph, entities, filter2) {
47546 var path = svgPath(projection2, graph, true);
47549 var base = context.history().base();
47550 for (var i3 = 0; i3 < entities.length; i3++) {
47551 var entity = entities[i3];
47552 if (entity.geometry(graph) !== "area")
47554 multipolygon = osmIsOldMultipolygonOuterMember(entity, graph);
47555 if (multipolygon) {
47556 areas[multipolygon.id] = {
47557 entity: multipolygon.mergeTags(entity.tags),
47558 area: Math.abs(entity.area(graph))
47560 } else if (!areas[entity.id]) {
47561 areas[entity.id] = {
47563 area: Math.abs(entity.area(graph))
47567 var fills = Object.values(areas).filter(function hasPath(a2) {
47568 return path(a2.entity);
47570 fills.sort(function areaSort(a2, b2) {
47571 return b2.area - a2.area;
47573 fills = fills.map(function(a2) {
47576 var strokes = fills.filter(function(area) {
47577 return area.type === "way";
47585 var clipPaths = context.surface().selectAll("defs").selectAll(".clipPath-osm").filter(filter2).data(data.clip, osmEntity.key);
47586 clipPaths.exit().remove();
47587 var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-osm").attr("id", function(entity2) {
47588 return "ideditor-" + entity2.id + "-clippath";
47590 clipPathsEnter.append("path");
47591 clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", path);
47592 var drawLayer = selection2.selectAll(".layer-osm.areas");
47593 var touchLayer = selection2.selectAll(".layer-touch.areas");
47594 var areagroup = drawLayer.selectAll("g.areagroup").data(["fill", "shadow", "stroke"]);
47595 areagroup = areagroup.enter().append("g").attr("class", function(d2) {
47596 return "areagroup area-" + d2;
47597 }).merge(areagroup);
47598 var paths = areagroup.selectAll("path").filter(filter2).data(function(layer) {
47599 return data[layer];
47601 paths.exit().remove();
47602 var fillpaths = selection2.selectAll(".area-fill path.area").nodes();
47603 var bisect = bisector(function(node) {
47604 return -node.__data__.area(graph);
47606 function sortedByArea(entity2) {
47607 if (this._parent.__data__ === "fill") {
47608 return fillpaths[bisect(fillpaths, -entity2.area(graph))];
47611 paths = paths.enter().insert("path", sortedByArea).merge(paths).each(function(entity2) {
47612 var layer = this.parentNode.__data__;
47613 this.setAttribute("class", entity2.type + " area " + layer + " " + entity2.id);
47614 if (layer === "fill") {
47615 this.setAttribute("clip-path", "url(#ideditor-" + entity2.id + "-clippath)");
47616 this.style.fill = this.style.stroke = getPatternStyle(entity2.tags);
47618 }).classed("added", function(d2) {
47619 return !base.entities[d2.id];
47620 }).classed("geometry-edited", function(d2) {
47621 return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal5.default)(graph.entities[d2.id].nodes, base.entities[d2.id].nodes);
47622 }).classed("retagged", function(d2) {
47623 return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal5.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
47624 }).call(svgTagClasses()).attr("d", path);
47625 touchLayer.call(drawTargets, graph, data.stroke, filter2);
47630 // modules/svg/data.js
47631 var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify());
47633 // node_modules/@tmcw/togeojson/dist/togeojson.es.mjs
47634 function $(element, tagName) {
47635 return Array.from(element.getElementsByTagName(tagName));
47637 function normalizeId(id2) {
47638 return id2[0] === "#" ? id2 : `#${id2}`;
47640 function $ns(element, tagName, ns) {
47641 return Array.from(element.getElementsByTagNameNS(ns, tagName));
47643 function nodeVal(node) {
47645 return node && node.textContent || "";
47647 function get1(node, tagName, callback) {
47648 const n3 = node.getElementsByTagName(tagName);
47649 const result = n3.length ? n3[0] : null;
47650 if (result && callback)
47654 function get3(node, tagName, callback) {
47655 const properties = {};
47658 const n3 = node.getElementsByTagName(tagName);
47659 const result = n3.length ? n3[0] : null;
47660 if (result && callback) {
47661 return callback(result, properties);
47665 function val1(node, tagName, callback) {
47666 const val = nodeVal(get1(node, tagName));
47667 if (val && callback)
47668 return callback(val) || {};
47671 function $num(node, tagName, callback) {
47672 const val = parseFloat(nodeVal(get1(node, tagName)));
47675 if (val && callback)
47676 return callback(val) || {};
47679 function num1(node, tagName, callback) {
47680 const val = parseFloat(nodeVal(get1(node, tagName)));
47687 function getMulti(node, propertyNames) {
47688 const properties = {};
47689 for (const property of propertyNames) {
47690 val1(node, property, (val) => {
47691 properties[property] = val;
47696 function isElement(node) {
47697 return node?.nodeType === 1;
47699 function getLineStyle(node) {
47700 return get3(node, "line", (lineStyle) => {
47701 const val = Object.assign({}, val1(lineStyle, "color", (color2) => {
47702 return { stroke: `#${color2}` };
47703 }), $num(lineStyle, "opacity", (opacity) => {
47704 return { "stroke-opacity": opacity };
47705 }), $num(lineStyle, "width", (width) => {
47706 return { "stroke-width": width * 96 / 25.4 };
47711 function getExtensions(node) {
47715 for (const child of Array.from(node.childNodes)) {
47716 if (!isElement(child))
47718 const name = abbreviateName(child.nodeName);
47719 if (name === "gpxtpx:TrackPointExtension") {
47720 values = values.concat(getExtensions(child));
47722 const val = nodeVal(child);
47723 values.push([name, parseNumeric(val)]);
47728 function abbreviateName(name) {
47729 return ["heart", "gpxtpx:hr", "hr"].includes(name) ? "heart" : name;
47731 function parseNumeric(val) {
47732 const num = parseFloat(val);
47733 return isNaN(num) ? val : num;
47735 function coordPair$1(node) {
47737 parseFloat(node.getAttribute("lon") || ""),
47738 parseFloat(node.getAttribute("lat") || "")
47740 if (isNaN(ll[0]) || isNaN(ll[1])) {
47743 num1(node, "ele", (val) => {
47746 const time = get1(node, "time");
47749 time: time ? nodeVal(time) : null,
47750 extendedValues: getExtensions(get1(node, "extensions"))
47753 function extractProperties(node) {
47754 const properties = getMulti(node, [
47762 const extensions = Array.from(node.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3", "*"));
47763 for (const child of extensions) {
47764 if (child.parentNode?.parentNode === node) {
47765 properties[child.tagName.replace(":", "_")] = nodeVal(child);
47768 const links = $(node, "link");
47769 if (links.length) {
47770 properties.links = links.map((link2) => Object.assign({ href: link2.getAttribute("href") }, getMulti(link2, ["text", "type"])));
47774 function getPoints$1(node, pointname) {
47775 const pts = $(node, pointname);
47778 const extendedValues = {};
47779 for (let i3 = 0; i3 < pts.length; i3++) {
47780 const c2 = coordPair$1(pts[i3]);
47784 line.push(c2.coordinates);
47786 times.push(c2.time);
47787 for (const [name, val] of c2.extendedValues) {
47788 const plural = name === "heart" ? name : name.replace("gpxtpx:", "") + "s";
47789 if (!extendedValues[plural]) {
47790 extendedValues[plural] = Array(pts.length).fill(null);
47792 extendedValues[plural][i3] = val;
47795 if (line.length < 2)
47803 function getRoute(node) {
47804 const line = getPoints$1(node, "rtept");
47809 properties: Object.assign({ _gpxType: "rte" }, extractProperties(node), getLineStyle(get1(node, "extensions"))),
47811 type: "LineString",
47812 coordinates: line.line
47816 function getTrack(node) {
47817 const segments = $(node, "trkseg");
47820 const extractedLines = [];
47821 for (const segment of segments) {
47822 const line = getPoints$1(segment, "trkpt");
47824 extractedLines.push(line);
47825 if (line.times && line.times.length)
47826 times.push(line.times);
47829 if (extractedLines.length === 0)
47831 const multi = extractedLines.length > 1;
47832 const properties = Object.assign({ _gpxType: "trk" }, extractProperties(node), getLineStyle(get1(node, "extensions")), times.length ? {
47833 coordinateProperties: {
47834 times: multi ? times : times[0]
47837 for (const line of extractedLines) {
47838 track.push(line.line);
47839 if (!properties.coordinateProperties) {
47840 properties.coordinateProperties = {};
47842 const props = properties.coordinateProperties;
47843 const entries = Object.entries(line.extendedValues);
47844 for (let i3 = 0; i3 < entries.length; i3++) {
47845 const [name, val] = entries[i3];
47847 if (!props[name]) {
47848 props[name] = extractedLines.map((line2) => new Array(line2.line.length).fill(null));
47850 props[name][i3] = val;
47859 geometry: multi ? {
47860 type: "MultiLineString",
47863 type: "LineString",
47864 coordinates: track[0]
47868 function getPoint(node) {
47869 const properties = Object.assign(extractProperties(node), getMulti(node, ["sym"]));
47870 const pair3 = coordPair$1(node);
47878 coordinates: pair3.coordinates
47882 function* gpxGen(node) {
47883 for (const track of $(node, "trk")) {
47884 const feature3 = getTrack(track);
47888 for (const route of $(node, "rte")) {
47889 const feature3 = getRoute(route);
47893 for (const waypoint of $(node, "wpt")) {
47894 const point2 = getPoint(waypoint);
47899 function gpx(node) {
47901 type: "FeatureCollection",
47902 features: Array.from(gpxGen(node))
47905 function fixColor(v2, prefix) {
47906 const properties = {};
47907 const colorProp = prefix == "stroke" || prefix === "fill" ? prefix : prefix + "-color";
47908 if (v2[0] === "#") {
47909 v2 = v2.substring(1);
47911 if (v2.length === 6 || v2.length === 3) {
47912 properties[colorProp] = "#" + v2;
47913 } else if (v2.length === 8) {
47914 properties[prefix + "-opacity"] = parseInt(v2.substring(0, 2), 16) / 255;
47915 properties[colorProp] = "#" + v2.substring(6, 8) + v2.substring(4, 6) + v2.substring(2, 4);
47919 function numericProperty(node, source, target) {
47920 const properties = {};
47921 num1(node, source, (val) => {
47922 properties[target] = val;
47926 function getColor(node, output) {
47927 return get3(node, "color", (elem) => fixColor(nodeVal(elem), output));
47929 function extractIconHref(node) {
47930 return get3(node, "Icon", (icon2, properties) => {
47931 val1(icon2, "href", (href) => {
47932 properties.icon = href;
47937 function extractIcon(node) {
47938 return get3(node, "IconStyle", (iconStyle) => {
47939 return Object.assign(getColor(iconStyle, "icon"), numericProperty(iconStyle, "scale", "icon-scale"), numericProperty(iconStyle, "heading", "icon-heading"), get3(iconStyle, "hotSpot", (hotspot) => {
47940 const left = parseFloat(hotspot.getAttribute("x") || "");
47941 const top = parseFloat(hotspot.getAttribute("y") || "");
47942 const xunits = hotspot.getAttribute("xunits") || "";
47943 const yunits = hotspot.getAttribute("yunits") || "";
47944 if (!isNaN(left) && !isNaN(top))
47946 "icon-offset": [left, top],
47947 "icon-offset-units": [xunits, yunits]
47950 }), extractIconHref(iconStyle));
47953 function extractLabel(node) {
47954 return get3(node, "LabelStyle", (labelStyle) => {
47955 return Object.assign(getColor(labelStyle, "label"), numericProperty(labelStyle, "scale", "label-scale"));
47958 function extractLine(node) {
47959 return get3(node, "LineStyle", (lineStyle) => {
47960 return Object.assign(getColor(lineStyle, "stroke"), numericProperty(lineStyle, "width", "stroke-width"));
47963 function extractPoly(node) {
47964 return get3(node, "PolyStyle", (polyStyle, properties) => {
47965 return Object.assign(properties, get3(polyStyle, "color", (elem) => fixColor(nodeVal(elem), "fill")), val1(polyStyle, "fill", (fill) => {
47967 return { "fill-opacity": 0 };
47968 }), val1(polyStyle, "outline", (outline) => {
47969 if (outline === "0")
47970 return { "stroke-opacity": 0 };
47974 function extractStyle(node) {
47975 return Object.assign({}, extractPoly(node), extractLine(node), extractLabel(node), extractIcon(node));
47977 var toNumber2 = (x2) => Number(x2);
47978 var typeConverters = {
47979 string: (x2) => x2,
47986 bool: (x2) => Boolean(x2)
47988 function extractExtendedData(node, schema) {
47989 return get3(node, "ExtendedData", (extendedData, properties) => {
47990 for (const data of $(extendedData, "Data")) {
47991 properties[data.getAttribute("name") || ""] = nodeVal(get1(data, "value"));
47993 for (const simpleData of $(extendedData, "SimpleData")) {
47994 const name = simpleData.getAttribute("name") || "";
47995 const typeConverter = schema[name] || typeConverters.string;
47996 properties[name] = typeConverter(nodeVal(simpleData));
48001 function getMaybeHTMLDescription(node) {
48002 const descriptionNode = get1(node, "description");
48003 for (const c2 of Array.from(descriptionNode?.childNodes || [])) {
48004 if (c2.nodeType === 4) {
48015 function extractTimeSpan(node) {
48016 return get3(node, "TimeSpan", (timeSpan) => {
48019 begin: nodeVal(get1(timeSpan, "begin")),
48020 end: nodeVal(get1(timeSpan, "end"))
48025 function extractTimeStamp(node) {
48026 return get3(node, "TimeStamp", (timeStamp) => {
48027 return { timestamp: nodeVal(get1(timeStamp, "when")) };
48030 function extractCascadedStyle(node, styleMap) {
48031 return val1(node, "styleUrl", (styleUrl) => {
48032 styleUrl = normalizeId(styleUrl);
48033 if (styleMap[styleUrl]) {
48034 return Object.assign({ styleUrl }, styleMap[styleUrl]);
48036 return { styleUrl };
48039 var removeSpace = /\s*/g;
48040 var trimSpace = /^\s*|\s*$/g;
48041 var splitSpace = /\s+/;
48042 function coord1(value) {
48043 return value.replace(removeSpace, "").split(",").map(parseFloat).filter((num) => !isNaN(num)).slice(0, 3);
48045 function coord(value) {
48046 return value.replace(trimSpace, "").split(splitSpace).map(coord1).filter((coord2) => {
48047 return coord2.length >= 2;
48050 function gxCoords(node) {
48051 let elems = $(node, "coord");
48052 if (elems.length === 0) {
48053 elems = $ns(node, "coord", "*");
48055 const coordinates = elems.map((elem) => {
48056 return nodeVal(elem).split(" ").map(parseFloat);
48058 if (coordinates.length === 0) {
48062 geometry: coordinates.length > 2 ? {
48063 type: "LineString",
48067 coordinates: coordinates[0]
48069 times: $(node, "when").map((elem) => nodeVal(elem))
48072 function fixRing(ring) {
48073 if (ring.length === 0)
48075 const first = ring[0];
48076 const last = ring[ring.length - 1];
48078 for (let i3 = 0; i3 < Math.max(first.length, last.length); i3++) {
48079 if (first[i3] !== last[i3]) {
48085 return ring.concat([ring[0]]);
48089 function getCoordinates(node) {
48090 return nodeVal(get1(node, "coordinates"));
48092 function getGeometry(node) {
48093 let geometries = [];
48094 let coordTimes = [];
48095 for (let i3 = 0; i3 < node.childNodes.length; i3++) {
48096 const child = node.childNodes.item(i3);
48097 if (isElement(child)) {
48098 switch (child.tagName) {
48099 case "MultiGeometry":
48101 case "gx:MultiTrack": {
48102 const childGeometries = getGeometry(child);
48103 geometries = geometries.concat(childGeometries.geometries);
48104 coordTimes = coordTimes.concat(childGeometries.coordTimes);
48108 const coordinates = coord1(getCoordinates(child));
48109 if (coordinates.length >= 2) {
48118 case "LineString": {
48119 const coordinates = coord(getCoordinates(child));
48120 if (coordinates.length >= 2) {
48122 type: "LineString",
48130 for (const linearRing of $(child, "LinearRing")) {
48131 const ring = fixRing(coord(getCoordinates(linearRing)));
48132 if (ring.length >= 4) {
48136 if (coords.length) {
48139 coordinates: coords
48146 const gx = gxCoords(child);
48149 const { times, geometry } = gx;
48150 geometries.push(geometry);
48152 coordTimes.push(times);
48163 function geometryListToGeometry(geometries) {
48164 return geometries.length === 0 ? null : geometries.length === 1 ? geometries[0] : {
48165 type: "GeometryCollection",
48169 function getPlacemark(node, styleMap, schema, options2) {
48170 const { coordTimes, geometries } = getGeometry(node);
48171 const geometry = geometryListToGeometry(geometries);
48172 if (!geometry && options2.skipNullGeometry) {
48178 properties: Object.assign(getMulti(node, [
48185 ]), getMaybeHTMLDescription(node), extractCascadedStyle(node, styleMap), extractStyle(node), extractExtendedData(node, schema), extractTimeSpan(node), extractTimeStamp(node), coordTimes.length ? {
48186 coordinateProperties: {
48187 times: coordTimes.length === 1 ? coordTimes[0] : coordTimes
48191 if (feature3.properties?.visibility !== void 0) {
48192 feature3.properties.visibility = feature3.properties.visibility !== "0";
48194 const id2 = node.getAttribute("id");
48195 if (id2 !== null && id2 !== "")
48199 function getGroundOverlayBox(node) {
48200 const latLonQuad = get1(node, "gx:LatLonQuad");
48202 const ring = fixRing(coord(getCoordinates(node)));
48206 coordinates: [ring]
48210 return getLatLonBox(node);
48212 var DEGREES_TO_RADIANS = Math.PI / 180;
48213 function rotateBox(bbox2, coordinates, rotation) {
48214 const center = [(bbox2[0] + bbox2[2]) / 2, (bbox2[1] + bbox2[3]) / 2];
48216 coordinates[0].map((coordinate) => {
48217 const dy = coordinate[1] - center[1];
48218 const dx = coordinate[0] - center[0];
48219 const distance = Math.sqrt(Math.pow(dy, 2) + Math.pow(dx, 2));
48220 const angle2 = Math.atan2(dy, dx) + rotation * DEGREES_TO_RADIANS;
48222 center[0] + Math.cos(angle2) * distance,
48223 center[1] + Math.sin(angle2) * distance
48228 function getLatLonBox(node) {
48229 const latLonBox = get1(node, "LatLonBox");
48231 const north = num1(latLonBox, "north");
48232 const west = num1(latLonBox, "west");
48233 const east = num1(latLonBox, "east");
48234 const south = num1(latLonBox, "south");
48235 const rotation = num1(latLonBox, "rotation");
48236 if (typeof north === "number" && typeof south === "number" && typeof west === "number" && typeof east === "number") {
48237 const bbox2 = [west, south, east, north];
48238 let coordinates = [
48245 // top left (again)
48248 if (typeof rotation === "number") {
48249 coordinates = rotateBox(bbox2, coordinates, rotation);
48262 function getGroundOverlay(node, styleMap, schema, options2) {
48263 const box = getGroundOverlayBox(node);
48264 const geometry = box?.geometry || null;
48265 if (!geometry && options2.skipNullGeometry) {
48271 properties: Object.assign(
48274 * https://gist.github.com/tmcw/037a1cb6660d74a392e9da7446540f46
48276 { "@geometry-type": "groundoverlay" },
48285 getMaybeHTMLDescription(node),
48286 extractCascadedStyle(node, styleMap),
48287 extractStyle(node),
48288 extractIconHref(node),
48289 extractExtendedData(node, schema),
48290 extractTimeSpan(node),
48291 extractTimeStamp(node)
48295 feature3.bbox = box.bbox;
48297 if (feature3.properties?.visibility !== void 0) {
48298 feature3.properties.visibility = feature3.properties.visibility !== "0";
48300 const id2 = node.getAttribute("id");
48301 if (id2 !== null && id2 !== "")
48305 function getStyleId(style) {
48306 let id2 = style.getAttribute("id");
48307 const parentNode = style.parentNode;
48308 if (!id2 && isElement(parentNode) && parentNode.localName === "CascadingStyle") {
48309 id2 = parentNode.getAttribute("kml:id") || parentNode.getAttribute("id");
48311 return normalizeId(id2 || "");
48313 function buildStyleMap(node) {
48314 const styleMap = {};
48315 for (const style of $(node, "Style")) {
48316 styleMap[getStyleId(style)] = extractStyle(style);
48318 for (const map2 of $(node, "StyleMap")) {
48319 const id2 = normalizeId(map2.getAttribute("id") || "");
48320 val1(map2, "styleUrl", (styleUrl) => {
48321 styleUrl = normalizeId(styleUrl);
48322 if (styleMap[styleUrl]) {
48323 styleMap[id2] = styleMap[styleUrl];
48329 function buildSchema(node) {
48331 for (const field of $(node, "SimpleField")) {
48332 schema[field.getAttribute("name") || ""] = typeConverters[field.getAttribute("type") || ""] || typeConverters["string"];
48336 function* kmlGen(node, options2 = {
48337 skipNullGeometry: false
48339 const styleMap = buildStyleMap(node);
48340 const schema = buildSchema(node);
48341 for (const placemark of $(node, "Placemark")) {
48342 const feature3 = getPlacemark(placemark, styleMap, schema, options2);
48346 for (const groundOverlay of $(node, "GroundOverlay")) {
48347 const feature3 = getGroundOverlay(groundOverlay, styleMap, schema, options2);
48352 function kml(node, options2 = {
48353 skipNullGeometry: false
48356 type: "FeatureCollection",
48357 features: Array.from(kmlGen(node, options2))
48361 // modules/svg/data.js
48362 var _initialized = false;
48363 var _enabled = false;
48365 function svgData(projection2, context, dispatch14) {
48366 var throttledRedraw = throttle_default(function() {
48367 dispatch14.call("change");
48369 var _showLabels = true;
48370 var detected = utilDetect();
48371 var layer = select_default2(null);
48376 const supportedFormats = [
48387 function over(d3_event) {
48388 d3_event.stopPropagation();
48389 d3_event.preventDefault();
48390 d3_event.dataTransfer.dropEffect = "copy";
48392 context.container().attr("dropzone", "copy").on("drop.svgData", function(d3_event) {
48393 d3_event.stopPropagation();
48394 d3_event.preventDefault();
48395 if (!detected.filedrop)
48397 var f3 = d3_event.dataTransfer.files[0];
48398 var extension = getExtension(f3.name);
48399 if (!supportedFormats.includes(extension))
48401 drawData.fileList(d3_event.dataTransfer.files);
48402 }).on("dragenter.svgData", over).on("dragexit.svgData", over).on("dragover.svgData", over);
48403 _initialized = true;
48405 function getService() {
48406 if (services.vectorTile && !_vtService) {
48407 _vtService = services.vectorTile;
48408 _vtService.event.on("loadedData", throttledRedraw);
48409 } else if (!services.vectorTile && _vtService) {
48414 function showLayer() {
48416 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
48417 dispatch14.call("change");
48420 function hideLayer() {
48421 throttledRedraw.cancel();
48422 layer.transition().duration(250).style("opacity", 0).on("end", layerOff);
48424 function layerOn() {
48425 layer.style("display", "block");
48427 function layerOff() {
48428 layer.selectAll(".viewfield-group").remove();
48429 layer.style("display", "none");
48431 function ensureIDs(gj) {
48434 if (gj.type === "FeatureCollection") {
48435 for (var i3 = 0; i3 < gj.features.length; i3++) {
48436 ensureFeatureID(gj.features[i3]);
48439 ensureFeatureID(gj);
48443 function ensureFeatureID(feature3) {
48446 feature3.__featurehash__ = utilHashcode((0, import_fast_json_stable_stringify.default)(feature3));
48449 function getFeatures(gj) {
48452 if (gj.type === "FeatureCollection") {
48453 return gj.features;
48458 function featureKey(d2) {
48459 return d2.__featurehash__;
48461 function isPolygon(d2) {
48462 return d2.geometry.type === "Polygon" || d2.geometry.type === "MultiPolygon";
48464 function clipPathID(d2) {
48465 return "ideditor-data-" + d2.__featurehash__ + "-clippath";
48467 function featureClasses(d2) {
48469 "data" + d2.__featurehash__,
48471 isPolygon(d2) ? "area" : "",
48472 d2.__layerID__ || ""
48473 ].filter(Boolean).join(" ");
48475 function drawData(selection2) {
48476 var vtService = getService();
48477 var getPath = svgPath(projection2).geojson;
48478 var getAreaPath = svgPath(projection2, null, true).geojson;
48479 var hasData = drawData.hasData();
48480 layer = selection2.selectAll(".layer-mapdata").data(_enabled && hasData ? [0] : []);
48481 layer.exit().remove();
48482 layer = layer.enter().append("g").attr("class", "layer-mapdata").merge(layer);
48483 var surface = context.surface();
48484 if (!surface || surface.empty())
48486 var geoData, polygonData;
48487 if (_template && vtService) {
48488 var sourceID = _template;
48489 vtService.loadTiles(sourceID, _template, projection2);
48490 geoData = vtService.data(sourceID, projection2);
48492 geoData = getFeatures(_geojson);
48494 geoData = geoData.filter(getPath);
48495 polygonData = geoData.filter(isPolygon);
48496 var clipPaths = surface.selectAll("defs").selectAll(".clipPath-data").data(polygonData, featureKey);
48497 clipPaths.exit().remove();
48498 var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-data").attr("id", clipPathID);
48499 clipPathsEnter.append("path");
48500 clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", getAreaPath);
48501 var datagroups = layer.selectAll("g.datagroup").data(["fill", "shadow", "stroke"]);
48502 datagroups = datagroups.enter().append("g").attr("class", function(d2) {
48503 return "datagroup datagroup-" + d2;
48504 }).merge(datagroups);
48510 var paths = datagroups.selectAll("path").data(function(layer2) {
48511 return pathData[layer2];
48513 paths.exit().remove();
48514 paths = paths.enter().append("path").attr("class", function(d2) {
48515 var datagroup = this.parentNode.__data__;
48516 return "pathdata " + datagroup + " " + featureClasses(d2);
48517 }).attr("clip-path", function(d2) {
48518 var datagroup = this.parentNode.__data__;
48519 return datagroup === "fill" ? "url(#" + clipPathID(d2) + ")" : null;
48520 }).merge(paths).attr("d", function(d2) {
48521 var datagroup = this.parentNode.__data__;
48522 return datagroup === "fill" ? getAreaPath(d2) : getPath(d2);
48524 layer.call(drawLabels, "label-halo", geoData).call(drawLabels, "label", geoData);
48525 function drawLabels(selection3, textClass, data) {
48526 var labelPath = path_default(projection2);
48527 var labelData = data.filter(function(d2) {
48528 return _showLabels && d2.properties && (d2.properties.desc || d2.properties.name);
48530 var labels = selection3.selectAll("text." + textClass).data(labelData, featureKey);
48531 labels.exit().remove();
48532 labels = labels.enter().append("text").attr("class", function(d2) {
48533 return textClass + " " + featureClasses(d2);
48534 }).merge(labels).text(function(d2) {
48535 return d2.properties.desc || d2.properties.name;
48536 }).attr("x", function(d2) {
48537 var centroid = labelPath.centroid(d2);
48538 return centroid[0] + 11;
48539 }).attr("y", function(d2) {
48540 var centroid = labelPath.centroid(d2);
48541 return centroid[1];
48545 function getExtension(fileName) {
48548 var re3 = /\.(gpx|kml|(geo)?json|png)$/i;
48549 var match = fileName.toLowerCase().match(re3);
48550 return match && match.length && match[0];
48552 function xmlToDom(textdata) {
48553 return new DOMParser().parseFromString(textdata, "text/xml");
48555 function stringifyGeojsonProperties(feature3) {
48556 const properties = feature3.properties;
48557 for (const key in properties) {
48558 const property = properties[key];
48559 if (typeof property === "number" || typeof property === "boolean" || Array.isArray(property)) {
48560 properties[key] = property.toString();
48561 } else if (property === null) {
48562 properties[key] = "null";
48563 } else if (typeof property === "object") {
48564 properties[key] = JSON.stringify(property);
48568 drawData.setFile = function(extension, data) {
48574 switch (extension) {
48576 gj = gpx(xmlToDom(data));
48579 gj = kml(xmlToDom(data));
48583 gj = JSON.parse(data);
48584 if (gj.type === "FeatureCollection") {
48585 gj.features.forEach(stringifyGeojsonProperties);
48586 } else if (gj.type === "Feature") {
48587 stringifyGeojsonProperties(gj);
48592 if (Object.keys(gj).length) {
48593 _geojson = ensureIDs(gj);
48594 _src = extension + " data file";
48597 dispatch14.call("change");
48600 drawData.showLabels = function(val) {
48601 if (!arguments.length)
48602 return _showLabels;
48606 drawData.enabled = function(val) {
48607 if (!arguments.length)
48615 dispatch14.call("change");
48618 drawData.hasData = function() {
48619 var gj = _geojson || {};
48620 return !!(_template || Object.keys(gj).length);
48622 drawData.template = function(val, src) {
48623 if (!arguments.length)
48625 var osm = context.connection();
48627 var blocklists = osm.imageryBlocklists();
48631 for (var i3 = 0; i3 < blocklists.length; i3++) {
48632 regex = blocklists[i3];
48633 fail = regex.test(val);
48639 regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
48640 fail = regex.test(val);
48646 _src = src || "vectortile:" + val.split(/[?#]/)[0];
48647 dispatch14.call("change");
48650 drawData.geojson = function(gj, src) {
48651 if (!arguments.length)
48658 if (Object.keys(gj).length) {
48659 _geojson = ensureIDs(gj);
48660 _src = src || "unknown.geojson";
48662 dispatch14.call("change");
48665 drawData.fileList = function(fileList) {
48666 if (!arguments.length)
48671 _fileList = fileList;
48672 if (!fileList || !fileList.length)
48674 var f3 = fileList[0];
48675 var extension = getExtension(f3.name);
48676 var reader = new FileReader();
48677 reader.onload = function() {
48678 return function(e3) {
48679 drawData.setFile(extension, e3.target.result);
48682 reader.readAsText(f3);
48685 drawData.url = function(url, defaultExtension) {
48690 var testUrl = url.split(/[?#]/)[0];
48691 var extension = getExtension(testUrl) || defaultExtension;
48694 text_default3(url).then(function(data) {
48695 drawData.setFile(extension, data);
48696 }).catch(function() {
48699 drawData.template(url);
48703 drawData.getSrc = function() {
48706 drawData.fitZoom = function() {
48707 var features = getFeatures(_geojson);
48708 if (!features.length)
48710 var map2 = context.map();
48711 var viewport = map2.trimmedExtent().polygon();
48712 var coords = features.reduce(function(coords2, feature3) {
48713 var geom = feature3.geometry;
48716 var c2 = geom.coordinates;
48717 switch (geom.type) {
48723 case "MultiPolygon":
48724 c2 = utilArrayFlatten(c2);
48726 case "MultiLineString":
48727 c2 = utilArrayFlatten(c2);
48730 return utilArrayUnion(coords2, c2);
48732 if (!geoPolygonIntersectsPolygon(viewport, coords, true)) {
48733 var extent = geoExtent(bounds_default({ type: "LineString", coordinates: coords }));
48734 map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
48742 // modules/svg/debug.js
48743 function svgDebug(projection2, context) {
48744 function drawDebug(selection2) {
48745 const showTile = context.getDebug("tile");
48746 const showCollision = context.getDebug("collision");
48747 const showImagery = context.getDebug("imagery");
48748 const showTouchTargets = context.getDebug("target");
48749 const showDownloaded = context.getDebug("downloaded");
48750 let debugData = [];
48752 debugData.push({ class: "red", label: "tile" });
48754 if (showCollision) {
48755 debugData.push({ class: "yellow", label: "collision" });
48758 debugData.push({ class: "orange", label: "imagery" });
48760 if (showTouchTargets) {
48761 debugData.push({ class: "pink", label: "touchTargets" });
48763 if (showDownloaded) {
48764 debugData.push({ class: "purple", label: "downloaded" });
48766 let legend = context.container().select(".main-content").selectAll(".debug-legend").data(debugData.length ? [0] : []);
48767 legend.exit().remove();
48768 legend = legend.enter().append("div").attr("class", "fillD debug-legend").merge(legend);
48769 let legendItems = legend.selectAll(".debug-legend-item").data(debugData, (d2) => d2.label);
48770 legendItems.exit().remove();
48771 legendItems.enter().append("span").attr("class", (d2) => `debug-legend-item ${d2.class}`).text((d2) => d2.label);
48772 let layer = selection2.selectAll(".layer-debug").data(showImagery || showDownloaded ? [0] : []);
48773 layer.exit().remove();
48774 layer = layer.enter().append("g").attr("class", "layer-debug").merge(layer);
48775 const extent = context.map().extent();
48776 _mainFileFetcher.get("imagery").then((d2) => {
48777 const hits = showImagery && d2.query.bbox(extent.rectangle(), true) || [];
48778 const features = hits.map((d4) => d4.features[d4.id]);
48779 let imagery = layer.selectAll("path.debug-imagery").data(features);
48780 imagery.exit().remove();
48781 imagery.enter().append("path").attr("class", "debug-imagery debug orange");
48784 const osm = context.connection();
48785 let dataDownloaded = [];
48786 if (osm && showDownloaded) {
48787 const rtree = osm.caches("get").tile.rtree;
48788 dataDownloaded = rtree.all().map((bbox2) => {
48791 properties: { id: bbox2.id },
48795 [bbox2.minX, bbox2.minY],
48796 [bbox2.minX, bbox2.maxY],
48797 [bbox2.maxX, bbox2.maxY],
48798 [bbox2.maxX, bbox2.minY],
48799 [bbox2.minX, bbox2.minY]
48805 let downloaded = layer.selectAll("path.debug-downloaded").data(showDownloaded ? dataDownloaded : []);
48806 downloaded.exit().remove();
48807 downloaded.enter().append("path").attr("class", "debug-downloaded debug purple");
48808 layer.selectAll("path").attr("d", svgPath(projection2).geojson);
48810 drawDebug.enabled = function() {
48811 if (!arguments.length) {
48812 return context.getDebug("tile") || context.getDebug("collision") || context.getDebug("imagery") || context.getDebug("target") || context.getDebug("downloaded");
48820 // modules/svg/defs.js
48821 function svgDefs(context) {
48822 var _defsSelection = select_default2(null);
48823 var _spritesheetIds = [
48831 function drawDefs(selection2) {
48832 _defsSelection = selection2.append("defs");
48833 _defsSelection.append("marker").attr("id", "ideditor-oneway-marker").attr("viewBox", "0 0 10 5").attr("refX", 2.5).attr("refY", 2.5).attr("markerWidth", 2).attr("markerHeight", 2).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "oneway-marker-path").attr("d", "M 5,3 L 0,3 L 0,2 L 5,2 L 5,0 L 10,2.5 L 5,5 z").attr("stroke", "none").attr("fill", "#000").attr("opacity", "0.75");
48834 function addSidedMarker(name, color2, offset) {
48835 _defsSelection.append("marker").attr("id", "ideditor-sided-marker-" + name).attr("viewBox", "0 0 2 2").attr("refX", 1).attr("refY", -offset).attr("markerWidth", 1.5).attr("markerHeight", 1.5).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "sided-marker-path sided-marker-" + name + "-path").attr("d", "M 0,0 L 1,1 L 2,0 z").attr("stroke", "none").attr("fill", color2);
48837 addSidedMarker("natural", "rgb(170, 170, 170)", 0);
48838 addSidedMarker("coastline", "#77dede", 1);
48839 addSidedMarker("waterway", "#77dede", 1);
48840 addSidedMarker("barrier", "#ddd", 1);
48841 addSidedMarker("man_made", "#fff", 0);
48842 _defsSelection.append("marker").attr("id", "ideditor-viewfield-marker").attr("viewBox", "0 0 16 16").attr("refX", 8).attr("refY", 16).attr("markerWidth", 4).attr("markerHeight", 4).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "viewfield-marker-path").attr("d", "M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill", "#333").attr("fill-opacity", "0.75").attr("stroke", "#fff").attr("stroke-width", "0.5px").attr("stroke-opacity", "0.75");
48843 _defsSelection.append("marker").attr("id", "ideditor-viewfield-marker-wireframe").attr("viewBox", "0 0 16 16").attr("refX", 8).attr("refY", 16).attr("markerWidth", 4).attr("markerHeight", 4).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("class", "viewfield-marker-path").attr("d", "M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill", "none").attr("stroke", "#fff").attr("stroke-width", "0.5px").attr("stroke-opacity", "0.75");
48844 var patterns2 = _defsSelection.selectAll("pattern").data([
48845 // pattern name, pattern image name
48847 ["construction", "construction"],
48848 ["cemetery", "cemetery"],
48849 ["cemetery_christian", "cemetery_christian"],
48850 ["cemetery_buddhist", "cemetery_buddhist"],
48851 ["cemetery_muslim", "cemetery_muslim"],
48852 ["cemetery_jewish", "cemetery_jewish"],
48853 ["farmland", "farmland"],
48854 ["farmyard", "farmyard"],
48855 ["forest", "forest"],
48856 ["forest_broadleaved", "forest_broadleaved"],
48857 ["forest_needleleaved", "forest_needleleaved"],
48858 ["forest_leafless", "forest_leafless"],
48859 ["golf_green", "grass"],
48860 ["grass", "grass"],
48861 ["landfill", "landfill"],
48862 ["meadow", "grass"],
48863 ["orchard", "orchard"],
48865 ["quarry", "quarry"],
48866 ["scrub", "bushes"],
48867 ["vineyard", "vineyard"],
48868 ["water_standing", "lines"],
48869 ["waves", "waves"],
48870 ["wetland", "wetland"],
48871 ["wetland_marsh", "wetland_marsh"],
48872 ["wetland_swamp", "wetland_swamp"],
48873 ["wetland_bog", "wetland_bog"],
48874 ["wetland_reedbed", "wetland_reedbed"]
48875 ]).enter().append("pattern").attr("id", function(d2) {
48876 return "ideditor-pattern-" + d2[0];
48877 }).attr("width", 32).attr("height", 32).attr("patternUnits", "userSpaceOnUse");
48878 patterns2.append("rect").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("class", function(d2) {
48879 return "pattern-color-" + d2[0];
48881 patterns2.append("image").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("xlink:href", function(d2) {
48882 return context.imagePath("pattern/" + d2[1] + ".png");
48884 _defsSelection.selectAll("clipPath").data([12, 18, 20, 32, 45]).enter().append("clipPath").attr("id", function(d2) {
48885 return "ideditor-clip-square-" + d2;
48886 }).append("rect").attr("x", 0).attr("y", 0).attr("width", function(d2) {
48888 }).attr("height", function(d2) {
48891 addSprites(_spritesheetIds, true);
48893 function addSprites(ids, overrideColors) {
48894 _spritesheetIds = utilArrayUniq(_spritesheetIds.concat(ids));
48895 var spritesheets = _defsSelection.selectAll(".spritesheet").data(_spritesheetIds);
48896 spritesheets.enter().append("g").attr("class", function(d2) {
48897 return "spritesheet spritesheet-" + d2;
48898 }).each(function(d2) {
48899 var url = context.imagePath(d2 + ".svg");
48900 var node = select_default2(this).node();
48901 svg(url).then(function(svg2) {
48903 select_default2(svg2.documentElement).attr("id", "ideditor-" + d2).node()
48905 if (overrideColors && d2 !== "iD-sprite") {
48906 select_default2(node).selectAll("path").attr("fill", "currentColor");
48908 }).catch(function() {
48911 spritesheets.exit().remove();
48913 drawDefs.addSprites = addSprites;
48917 // modules/svg/keepRight.js
48918 var _layerEnabled = false;
48920 function svgKeepRight(projection2, context, dispatch14) {
48921 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
48922 const minZoom4 = 12;
48923 let touchLayer = select_default2(null);
48924 let drawLayer = select_default2(null);
48925 let layerVisible = false;
48926 function markerPath(selection2, klass) {
48927 selection2.attr("class", klass).attr("transform", "translate(-4, -24)").attr("d", "M11.6,6.2H7.1l1.4-5.1C8.6,0.6,8.1,0,7.5,0H2.2C1.7,0,1.3,0.3,1.3,0.8L0,10.2c-0.1,0.6,0.4,1.1,0.9,1.1h4.6l-1.8,7.6C3.6,19.4,4.1,20,4.7,20c0.3,0,0.6-0.2,0.8-0.5l6.9-11.9C12.7,7,12.3,6.2,11.6,6.2z");
48929 function getService() {
48930 if (services.keepRight && !_qaService) {
48931 _qaService = services.keepRight;
48932 _qaService.on("loaded", throttledRedraw);
48933 } else if (!services.keepRight && _qaService) {
48938 function editOn() {
48939 if (!layerVisible) {
48940 layerVisible = true;
48941 drawLayer.style("display", "block");
48944 function editOff() {
48945 if (layerVisible) {
48946 layerVisible = false;
48947 drawLayer.style("display", "none");
48948 drawLayer.selectAll(".qaItem.keepRight").remove();
48949 touchLayer.selectAll(".qaItem.keepRight").remove();
48952 function layerOn() {
48954 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
48956 function layerOff() {
48957 throttledRedraw.cancel();
48958 drawLayer.interrupt();
48959 touchLayer.selectAll(".qaItem.keepRight").remove();
48960 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
48962 dispatch14.call("change");
48965 function updateMarkers() {
48966 if (!layerVisible || !_layerEnabled)
48968 const service = getService();
48969 const selectedID = context.selectedErrorID();
48970 const data = service ? service.getItems(projection2) : [];
48971 const getTransform = svgPointTransform(projection2);
48972 const markers = drawLayer.selectAll(".qaItem.keepRight").data(data, (d2) => d2.id);
48973 markers.exit().remove();
48974 const markersEnter = markers.enter().append("g").attr("class", (d2) => `qaItem ${d2.service} itemId-${d2.id} itemType-${d2.parentIssueType}`);
48975 markersEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
48976 markersEnter.append("path").call(markerPath, "shadow");
48977 markersEnter.append("use").attr("class", "qaItem-fill").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").attr("xlink:href", "#iD-icon-bolt");
48978 markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
48979 if (touchLayer.empty())
48981 const fillClass = context.getDebug("target") ? "pink " : "nocolor ";
48982 const targets = touchLayer.selectAll(".qaItem.keepRight").data(data, (d2) => d2.id);
48983 targets.exit().remove();
48984 targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", (d2) => `qaItem ${d2.service} target ${fillClass} itemId-${d2.id}`).attr("transform", getTransform);
48985 function sortY(a2, b2) {
48986 return a2.id === selectedID ? 1 : b2.id === selectedID ? -1 : a2.severity === "error" && b2.severity !== "error" ? 1 : b2.severity === "error" && a2.severity !== "error" ? -1 : b2.loc[1] - a2.loc[1];
48989 function drawKeepRight(selection2) {
48990 const service = getService();
48991 const surface = context.surface();
48992 if (surface && !surface.empty()) {
48993 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
48995 drawLayer = selection2.selectAll(".layer-keepRight").data(service ? [0] : []);
48996 drawLayer.exit().remove();
48997 drawLayer = drawLayer.enter().append("g").attr("class", "layer-keepRight").style("display", _layerEnabled ? "block" : "none").merge(drawLayer);
48998 if (_layerEnabled) {
48999 if (service && ~~context.map().zoom() >= minZoom4) {
49001 service.loadIssues(projection2);
49008 drawKeepRight.enabled = function(val) {
49009 if (!arguments.length)
49010 return _layerEnabled;
49011 _layerEnabled = val;
49012 if (_layerEnabled) {
49016 if (context.selectedErrorID()) {
49017 context.enter(modeBrowse(context));
49020 dispatch14.call("change");
49023 drawKeepRight.supported = () => !!getService();
49024 return drawKeepRight;
49027 // modules/svg/geolocate.js
49028 function svgGeolocate(projection2) {
49029 var layer = select_default2(null);
49032 if (svgGeolocate.initialized)
49034 svgGeolocate.enabled = false;
49035 svgGeolocate.initialized = true;
49037 function showLayer() {
49038 layer.style("display", "block");
49040 function hideLayer() {
49041 layer.transition().duration(250).style("opacity", 0);
49043 function layerOn() {
49044 layer.style("opacity", 0).transition().duration(250).style("opacity", 1);
49046 function layerOff() {
49047 layer.style("display", "none");
49049 function transform2(d2) {
49050 return svgPointTransform(projection2)(d2);
49052 function accuracy(accuracy2, loc) {
49053 var degreesRadius = geoMetersToLat(accuracy2), tangentLoc = [loc[0], loc[1] + degreesRadius], projectedTangent = projection2(tangentLoc), projectedLoc = projection2([loc[0], loc[1]]);
49054 return Math.round(projectedLoc[1] - projectedTangent[1]).toString();
49056 function update() {
49057 var geolocation = { loc: [_position.coords.longitude, _position.coords.latitude] };
49058 var groups = layer.selectAll(".geolocations").selectAll(".geolocation").data([geolocation]);
49059 groups.exit().remove();
49060 var pointsEnter = groups.enter().append("g").attr("class", "geolocation");
49061 pointsEnter.append("circle").attr("class", "geolocate-radius").attr("dx", "0").attr("dy", "0").attr("fill", "rgb(15,128,225)").attr("fill-opacity", "0.3").attr("r", "0");
49062 pointsEnter.append("circle").attr("dx", "0").attr("dy", "0").attr("fill", "rgb(15,128,225)").attr("stroke", "white").attr("stroke-width", "1.5").attr("r", "6");
49063 groups.merge(pointsEnter).attr("transform", transform2);
49064 layer.select(".geolocate-radius").attr("r", accuracy(_position.coords.accuracy, geolocation.loc));
49066 function drawLocation(selection2) {
49067 var enabled = svgGeolocate.enabled;
49068 layer = selection2.selectAll(".layer-geolocate").data([0]);
49069 layer.exit().remove();
49070 var layerEnter = layer.enter().append("g").attr("class", "layer-geolocate").style("display", enabled ? "block" : "none");
49071 layerEnter.append("g").attr("class", "geolocations");
49072 layer = layerEnter.merge(layer);
49079 drawLocation.enabled = function(position, enabled) {
49080 if (!arguments.length)
49081 return svgGeolocate.enabled;
49082 _position = position;
49083 svgGeolocate.enabled = enabled;
49084 if (svgGeolocate.enabled) {
49093 return drawLocation;
49096 // modules/svg/labels.js
49097 var import_rbush6 = __toESM(require_rbush_min());
49098 function svgLabels(projection2, context) {
49099 var path = path_default(projection2);
49100 var detected = utilDetect();
49101 var baselineHack = detected.ie || detected.browser.toLowerCase() === "edge" || detected.browser.toLowerCase() === "firefox" && detected.version >= 70;
49102 var _rdrawn = new import_rbush6.default();
49103 var _rskipped = new import_rbush6.default();
49104 var _textWidthCache = {};
49105 var _entitybboxes = {};
49107 ["line", "aeroway", "*", 12],
49108 ["line", "highway", "motorway", 12],
49109 ["line", "highway", "trunk", 12],
49110 ["line", "highway", "primary", 12],
49111 ["line", "highway", "secondary", 12],
49112 ["line", "highway", "tertiary", 12],
49113 ["line", "highway", "*", 12],
49114 ["line", "railway", "*", 12],
49115 ["line", "waterway", "*", 12],
49116 ["area", "aeroway", "*", 12],
49117 ["area", "amenity", "*", 12],
49118 ["area", "building", "*", 12],
49119 ["area", "historic", "*", 12],
49120 ["area", "leisure", "*", 12],
49121 ["area", "man_made", "*", 12],
49122 ["area", "natural", "*", 12],
49123 ["area", "shop", "*", 12],
49124 ["area", "tourism", "*", 12],
49125 ["area", "camp_site", "*", 12],
49126 ["point", "aeroway", "*", 10],
49127 ["point", "amenity", "*", 10],
49128 ["point", "building", "*", 10],
49129 ["point", "historic", "*", 10],
49130 ["point", "leisure", "*", 10],
49131 ["point", "man_made", "*", 10],
49132 ["point", "natural", "*", 10],
49133 ["point", "shop", "*", 10],
49134 ["point", "tourism", "*", 10],
49135 ["point", "camp_site", "*", 10],
49136 ["line", "ref", "*", 12],
49137 ["area", "ref", "*", 12],
49138 ["point", "ref", "*", 10],
49139 ["line", "name", "*", 12],
49140 ["area", "name", "*", 12],
49141 ["point", "name", "*", 10]
49143 function shouldSkipIcon(preset) {
49144 var noIcons = ["building", "landuse", "natural"];
49145 return noIcons.some(function(s2) {
49146 return preset.id.indexOf(s2) >= 0;
49149 function get4(array2, prop) {
49150 return function(d2, i3) {
49151 return array2[i3][prop];
49154 function textWidth(text2, size, elem) {
49155 var c2 = _textWidthCache[size];
49157 c2 = _textWidthCache[size] = {};
49161 c2[text2] = elem.getComputedTextLength();
49164 var str2 = encodeURIComponent(text2).match(/%[CDEFcdef]/g);
49165 if (str2 === null) {
49166 return size / 3 * 2 * text2.length;
49168 return size / 3 * (2 * text2.length + str2.length);
49172 function drawLinePaths(selection2, entities, filter2, classes, labels) {
49173 var paths = selection2.selectAll("path").filter(filter2).data(entities, osmEntity.key);
49174 paths.exit().remove();
49175 paths.enter().append("path").style("stroke-width", get4(labels, "font-size")).attr("id", function(d2) {
49176 return "ideditor-labelpath-" + d2.id;
49177 }).attr("class", classes).merge(paths).attr("d", get4(labels, "lineString"));
49179 function drawLineLabels(selection2, entities, filter2, classes, labels) {
49180 var texts = selection2.selectAll("text." + classes).filter(filter2).data(entities, osmEntity.key);
49181 texts.exit().remove();
49182 texts.enter().append("text").attr("class", function(d2, i3) {
49183 return classes + " " + labels[i3].classes + " " + d2.id;
49184 }).attr("dy", baselineHack ? "0.35em" : null).append("textPath").attr("class", "textpath");
49185 selection2.selectAll("text." + classes).selectAll(".textpath").filter(filter2).data(entities, osmEntity.key).attr("startOffset", "50%").attr("xlink:href", function(d2) {
49186 return "#ideditor-labelpath-" + d2.id;
49187 }).text(utilDisplayNameForPath);
49189 function drawPointLabels(selection2, entities, filter2, classes, labels) {
49190 var texts = selection2.selectAll("text." + classes).filter(filter2).data(entities, osmEntity.key);
49191 texts.exit().remove();
49192 texts.enter().append("text").attr("class", function(d2, i3) {
49193 return classes + " " + labels[i3].classes + " " + d2.id;
49194 }).merge(texts).attr("x", get4(labels, "x")).attr("y", get4(labels, "y")).style("text-anchor", get4(labels, "textAnchor")).text(utilDisplayName).each(function(d2, i3) {
49195 textWidth(utilDisplayName(d2), labels[i3].height, this);
49198 function drawAreaLabels(selection2, entities, filter2, classes, labels) {
49199 entities = entities.filter(hasText);
49200 labels = labels.filter(hasText);
49201 drawPointLabels(selection2, entities, filter2, classes, labels);
49202 function hasText(d2, i3) {
49203 return labels[i3].hasOwnProperty("x") && labels[i3].hasOwnProperty("y");
49206 function drawAreaIcons(selection2, entities, filter2, classes, labels) {
49207 var icons = selection2.selectAll("use." + classes).filter(filter2).data(entities, osmEntity.key);
49208 icons.exit().remove();
49209 icons.enter().append("use").attr("class", "icon " + classes).attr("width", "17px").attr("height", "17px").merge(icons).attr("transform", get4(labels, "transform")).attr("xlink:href", function(d2) {
49210 var preset = _mainPresetIndex.match(d2, context.graph());
49211 var picon = preset && preset.icon;
49212 return picon ? "#" + picon : "";
49215 function drawCollisionBoxes(selection2, rtree, which) {
49216 var classes = "debug " + which + " " + (which === "debug-skipped" ? "orange" : "yellow");
49218 if (context.getDebug("collision")) {
49219 gj = rtree.all().map(function(d2) {
49220 return { type: "Polygon", coordinates: [[
49221 [d2.minX, d2.minY],
49222 [d2.maxX, d2.minY],
49223 [d2.maxX, d2.maxY],
49224 [d2.minX, d2.maxY],
49229 var boxes = selection2.selectAll("." + which).data(gj);
49230 boxes.exit().remove();
49231 boxes.enter().append("path").attr("class", classes).merge(boxes).attr("d", path_default());
49233 function drawLabels(selection2, graph, entities, filter2, dimensions, fullRedraw) {
49234 var wireframe = context.surface().classed("fill-wireframe");
49235 var zoom = geoScaleToZoom(projection2.scale());
49236 var labelable = [];
49237 var renderNodeAs = {};
49238 var i3, j3, k2, entity, geometry;
49239 for (i3 = 0; i3 < labelStack.length; i3++) {
49240 labelable.push([]);
49245 _entitybboxes = {};
49247 for (i3 = 0; i3 < entities.length; i3++) {
49248 entity = entities[i3];
49249 var toRemove = [].concat(_entitybboxes[entity.id] || []).concat(_entitybboxes[entity.id + "I"] || []);
49250 for (j3 = 0; j3 < toRemove.length; j3++) {
49251 _rdrawn.remove(toRemove[j3]);
49252 _rskipped.remove(toRemove[j3]);
49256 for (i3 = 0; i3 < entities.length; i3++) {
49257 entity = entities[i3];
49258 geometry = entity.geometry(graph);
49259 if (geometry === "point" || geometry === "vertex" && isInterestingVertex(entity)) {
49260 var hasDirections = entity.directions(graph, projection2).length;
49262 if (!wireframe && geometry === "point" && !(zoom >= 18 && hasDirections)) {
49263 renderNodeAs[entity.id] = "point";
49264 markerPadding = 20;
49266 renderNodeAs[entity.id] = "vertex";
49269 var coord2 = projection2(entity.loc);
49270 var nodePadding = 10;
49272 minX: coord2[0] - nodePadding,
49273 minY: coord2[1] - nodePadding - markerPadding,
49274 maxX: coord2[0] + nodePadding,
49275 maxY: coord2[1] + nodePadding
49277 doInsert(bbox2, entity.id + "P");
49279 if (geometry === "vertex") {
49280 geometry = "point";
49282 var preset = geometry === "area" && _mainPresetIndex.match(entity, graph);
49283 var icon2 = preset && !shouldSkipIcon(preset) && preset.icon;
49284 if (!icon2 && !utilDisplayName(entity))
49286 for (k2 = 0; k2 < labelStack.length; k2++) {
49287 var matchGeom = labelStack[k2][0];
49288 var matchKey = labelStack[k2][1];
49289 var matchVal = labelStack[k2][2];
49290 var hasVal = entity.tags[matchKey];
49291 if (geometry === matchGeom && hasVal && (matchVal === "*" || matchVal === hasVal)) {
49292 labelable[k2].push(entity);
49307 for (k2 = 0; k2 < labelable.length; k2++) {
49308 var fontSize = labelStack[k2][3];
49309 for (i3 = 0; i3 < labelable[k2].length; i3++) {
49310 entity = labelable[k2][i3];
49311 geometry = entity.geometry(graph);
49312 var getName = geometry === "line" ? utilDisplayNameForPath : utilDisplayName;
49313 var name = getName(entity);
49314 var width = name && textWidth(name, fontSize);
49316 if (geometry === "point" || geometry === "vertex") {
49319 var renderAs = renderNodeAs[entity.id];
49320 if (renderAs === "vertex" && zoom < 17)
49322 p2 = getPointLabel(entity, width, fontSize, renderAs);
49323 } else if (geometry === "line") {
49324 p2 = getLineLabel(entity, width, fontSize);
49325 } else if (geometry === "area") {
49326 p2 = getAreaLabel(entity, width, fontSize);
49329 if (geometry === "vertex") {
49330 geometry = "point";
49332 p2.classes = geometry + " tag-" + labelStack[k2][1];
49333 positions[geometry].push(p2);
49334 labelled[geometry].push(entity);
49338 function isInterestingVertex(entity2) {
49339 var selectedIDs = context.selectedIDs();
49340 return entity2.hasInterestingTags() || entity2.isEndpoint(graph) || entity2.isConnected(graph) || selectedIDs.indexOf(entity2.id) !== -1 || graph.parentWays(entity2).some(function(parent) {
49341 return selectedIDs.indexOf(parent.id) !== -1;
49344 function getPointLabel(entity2, width2, height, geometry2) {
49345 var y2 = geometry2 === "point" ? -12 : 0;
49346 var pointOffsets = {
49347 ltr: [15, y2, "start"],
49348 rtl: [-15, y2, "end"]
49350 var textDirection = _mainLocalizer.textDirection();
49351 var coord3 = projection2(entity2.loc);
49352 var textPadding = 2;
49353 var offset = pointOffsets[textDirection];
49357 x: coord3[0] + offset[0],
49358 y: coord3[1] + offset[1],
49359 textAnchor: offset[2]
49362 if (textDirection === "rtl") {
49364 minX: p3.x - width2 - textPadding,
49365 minY: p3.y - height / 2 - textPadding,
49366 maxX: p3.x + textPadding,
49367 maxY: p3.y + height / 2 + textPadding
49371 minX: p3.x - textPadding,
49372 minY: p3.y - height / 2 - textPadding,
49373 maxX: p3.x + width2 + textPadding,
49374 maxY: p3.y + height / 2 + textPadding
49377 if (tryInsert([bbox3], entity2.id, true)) {
49381 function getLineLabel(entity2, width2, height) {
49382 var viewport = geoExtent(context.projection.clipExtent()).polygon();
49383 var points = graph.childNodes(entity2).map(function(node) {
49384 return projection2(node.loc);
49386 var length = geoPathLength(points);
49387 if (length < width2 + 20)
49389 var lineOffsets = [
49411 for (var i4 = 0; i4 < lineOffsets.length; i4++) {
49412 var offset = lineOffsets[i4];
49413 var middle = offset / 100 * length;
49414 var start2 = middle - width2 / 2;
49415 if (start2 < 0 || start2 + width2 > length)
49417 var sub = subpath(points, start2, start2 + width2);
49418 if (!sub || !geoPolygonIntersectsPolygon(viewport, sub, true)) {
49421 var isReverse = reverse(sub);
49423 sub = sub.reverse();
49426 var boxsize = (height + 2) / 2;
49427 for (var j4 = 0; j4 < sub.length - 1; j4++) {
49429 var b2 = sub[j4 + 1];
49430 var num = Math.max(1, Math.floor(geoVecLength(a2, b2) / boxsize / 2));
49431 for (var box = 0; box < num; box++) {
49432 var p3 = geoVecInterp(a2, b2, box / num);
49433 var x05 = p3[0] - boxsize - padding;
49434 var y05 = p3[1] - boxsize - padding;
49435 var x12 = p3[0] + boxsize + padding;
49436 var y12 = p3[1] + boxsize + padding;
49438 minX: Math.min(x05, x12),
49439 minY: Math.min(y05, y12),
49440 maxX: Math.max(x05, x12),
49441 maxY: Math.max(y05, y12)
49445 if (tryInsert(bboxes, entity2.id, false)) {
49447 "font-size": height + 2,
49448 lineString: lineString2(sub),
49449 startOffset: offset + "%"
49453 function reverse(p4) {
49454 var angle2 = Math.atan2(p4[1][1] - p4[0][1], p4[1][0] - p4[0][0]);
49455 return !(p4[0][0] < p4[p4.length - 1][0] && angle2 < Math.PI / 2 && angle2 > -Math.PI / 2);
49457 function lineString2(points2) {
49458 return "M" + points2.join("L");
49460 function subpath(points2, from, to) {
49462 var start3, end, i0, i1;
49463 for (var i5 = 0; i5 < points2.length - 1; i5++) {
49464 var a3 = points2[i5];
49465 var b3 = points2[i5 + 1];
49466 var current = geoVecLength(a3, b3);
49468 if (!start3 && sofar + current >= from) {
49469 portion = (from - sofar) / current;
49471 a3[0] + portion * (b3[0] - a3[0]),
49472 a3[1] + portion * (b3[1] - a3[1])
49476 if (!end && sofar + current >= to) {
49477 portion = (to - sofar) / current;
49479 a3[0] + portion * (b3[0] - a3[0]),
49480 a3[1] + portion * (b3[1] - a3[1])
49486 var result = points2.slice(i0, i1);
49487 result.unshift(start3);
49492 function getAreaLabel(entity2, width2, height) {
49493 var centroid = path.centroid(entity2.asGeoJSON(graph));
49494 var extent = entity2.extent(graph);
49495 var areaWidth = projection2(extent[1])[0] - projection2(extent[0])[0];
49496 if (isNaN(centroid[0]) || areaWidth < 20)
49498 var preset2 = _mainPresetIndex.match(entity2, context.graph());
49499 var picon = preset2 && preset2.icon;
49505 addLabel(iconSize + padding);
49513 function addIcon() {
49514 var iconX = centroid[0] - iconSize / 2;
49515 var iconY = centroid[1] - iconSize / 2;
49519 maxX: iconX + iconSize,
49520 maxY: iconY + iconSize
49522 if (tryInsert([bbox3], entity2.id + "I", true)) {
49523 p3.transform = "translate(" + iconX + "," + iconY + ")";
49528 function addLabel(yOffset) {
49529 if (width2 && areaWidth >= width2 + 20) {
49530 var labelX = centroid[0];
49531 var labelY = centroid[1] + yOffset;
49533 minX: labelX - width2 / 2 - padding,
49534 minY: labelY - height / 2 - padding,
49535 maxX: labelX + width2 / 2 + padding,
49536 maxY: labelY + height / 2 + padding
49538 if (tryInsert([bbox3], entity2.id, true)) {
49541 p3.textAnchor = "middle";
49542 p3.height = height;
49549 function doInsert(bbox3, id2) {
49551 var oldbox = _entitybboxes[id2];
49553 _rdrawn.remove(oldbox);
49555 _entitybboxes[id2] = bbox3;
49556 _rdrawn.insert(bbox3);
49558 function tryInsert(bboxes, id2, saveSkipped) {
49559 var skipped = false;
49560 for (var i4 = 0; i4 < bboxes.length; i4++) {
49561 var bbox3 = bboxes[i4];
49563 if (bbox3.minX < 0 || bbox3.minY < 0 || bbox3.maxX > dimensions[0] || bbox3.maxY > dimensions[1]) {
49567 if (_rdrawn.collides(bbox3)) {
49572 _entitybboxes[id2] = bboxes;
49575 _rskipped.load(bboxes);
49578 _rdrawn.load(bboxes);
49582 var layer = selection2.selectAll(".layer-osm.labels");
49583 layer.selectAll(".labels-group").data(["halo", "label", "debug"]).enter().append("g").attr("class", function(d2) {
49584 return "labels-group " + d2;
49586 var halo = layer.selectAll(".labels-group.halo");
49587 var label = layer.selectAll(".labels-group.label");
49588 var debug2 = layer.selectAll(".labels-group.debug");
49589 drawPointLabels(label, labelled.point, filter2, "pointlabel", positions.point);
49590 drawPointLabels(halo, labelled.point, filter2, "pointlabel-halo", positions.point);
49591 drawLinePaths(layer, labelled.line, filter2, "", positions.line);
49592 drawLineLabels(label, labelled.line, filter2, "linelabel", positions.line);
49593 drawLineLabels(halo, labelled.line, filter2, "linelabel-halo", positions.line);
49594 drawAreaLabels(label, labelled.area, filter2, "arealabel", positions.area);
49595 drawAreaLabels(halo, labelled.area, filter2, "arealabel-halo", positions.area);
49596 drawAreaIcons(label, labelled.area, filter2, "areaicon", positions.area);
49597 drawAreaIcons(halo, labelled.area, filter2, "areaicon-halo", positions.area);
49598 drawCollisionBoxes(debug2, _rskipped, "debug-skipped");
49599 drawCollisionBoxes(debug2, _rdrawn, "debug-drawn");
49600 layer.call(filterLabels);
49602 function filterLabels(selection2) {
49603 var drawLayer = selection2.selectAll(".layer-osm.labels");
49604 var layers = drawLayer.selectAll(".labels-group.halo, .labels-group.label");
49605 layers.selectAll(".nolabel").classed("nolabel", false);
49606 var mouse = context.map().mouse();
49607 var graph = context.graph();
49608 var selectedIDs = context.selectedIDs();
49613 bbox2 = { minX: mouse[0] - pad2, minY: mouse[1] - pad2, maxX: mouse[0] + pad2, maxY: mouse[1] + pad2 };
49614 var nearMouse = _rdrawn.search(bbox2).map(function(entity2) {
49617 ids.push.apply(ids, nearMouse);
49619 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
49620 var entity = graph.hasEntity(selectedIDs[i3]);
49621 if (entity && entity.type === "node") {
49622 ids.push(selectedIDs[i3]);
49625 layers.selectAll(utilEntitySelector(ids)).classed("nolabel", true);
49626 var debug2 = selection2.selectAll(".labels-group.debug");
49628 if (context.getDebug("collision")) {
49632 [bbox2.minX, bbox2.minY],
49633 [bbox2.maxX, bbox2.minY],
49634 [bbox2.maxX, bbox2.maxY],
49635 [bbox2.minX, bbox2.maxY],
49636 [bbox2.minX, bbox2.minY]
49640 var box = debug2.selectAll(".debug-mouse").data(gj);
49641 box.exit().remove();
49642 box.enter().append("path").attr("class", "debug debug-mouse yellow").merge(box).attr("d", path_default());
49644 var throttleFilterLabels = throttle_default(filterLabels, 100);
49645 drawLabels.observe = function(selection2) {
49646 var listener = function() {
49647 throttleFilterLabels(selection2);
49649 selection2.on("mousemove.hidelabels", listener);
49650 context.on("enter.hidelabels", listener);
49652 drawLabels.off = function(selection2) {
49653 throttleFilterLabels.cancel();
49654 selection2.on("mousemove.hidelabels", null);
49655 context.on("enter.hidelabels", null);
49660 // node_modules/exifr/dist/full.esm.mjs
49661 var e = "undefined" != typeof self ? self : global;
49662 var t = "undefined" != typeof navigator;
49663 var i2 = t && "undefined" == typeof HTMLImageElement;
49664 var n2 = !("undefined" == typeof global || "undefined" == typeof process || !process.versions || !process.versions.node);
49668 var o = (e3) => e3;
49669 function l(e3, t2 = o) {
49672 return "function" == typeof __require ? Promise.resolve(t2(__require(e3))) : import(
49673 /* webpackIgnore: true */
49677 console.warn(`Couldn't load ${e3}`);
49681 var u = (e3) => h = e3;
49683 const e3 = l("http", (e4) => e4), t2 = l("https", (e4) => e4), i3 = (n3, { headers: s2 } = {}) => new Promise(async (r2, a2) => {
49684 let { port: o2, hostname: l2, pathname: h2, protocol: u2, search: c2 } = new URL(n3);
49685 const f3 = { method: "GET", hostname: l2, path: encodeURI(h2) + c2, headers: s2 };
49686 "" !== o2 && (f3.port = Number(o2));
49687 const d2 = ("https:" === u2 ? await t2 : await e3).request(f3, (e4) => {
49688 if (301 === e4.statusCode || 302 === e4.statusCode) {
49689 let t3 = new URL(e4.headers.location, n3).toString();
49690 return i3(t3, { headers: s2 }).then(r2).catch(a2);
49692 r2({ status: e4.statusCode, arrayBuffer: () => new Promise((t3) => {
49694 e4.on("data", (e6) => i4.push(e6)), e4.on("end", () => t3(Buffer.concat(i4)));
49697 d2.on("error", a2), d2.end();
49701 function c(e3, t2, i3) {
49702 return t2 in e3 ? Object.defineProperty(e3, t2, { value: i3, enumerable: true, configurable: true, writable: true }) : e3[t2] = i3, e3;
49704 var f2 = (e3) => p(e3) ? void 0 : e3;
49705 var d = (e3) => void 0 !== e3;
49707 return void 0 === e3 || (e3 instanceof Map ? 0 === e3.size : 0 === Object.values(e3).filter(d).length);
49710 let t2 = new Error(e3);
49711 throw delete t2.stack, t2;
49714 return "" === (e3 = function(e4) {
49715 for (; e4.endsWith("\0"); )
49716 e4 = e4.slice(0, -1);
49718 }(e3).trim()) ? void 0 : e3;
49721 let t2 = function(e4) {
49723 return e4.ifd0.enabled && (t3 += 1024), e4.exif.enabled && (t3 += 2048), e4.makerNote && (t3 += 2048), e4.userComment && (t3 += 1024), e4.gps.enabled && (t3 += 512), e4.interop.enabled && (t3 += 100), e4.ifd1.enabled && (t3 += 1024), t3 + 2048;
49725 return e3.jfif.enabled && (t2 += 50), e3.xmp.enabled && (t2 += 2e4), e3.iptc.enabled && (t2 += 14e3), e3.icc.enabled && (t2 += 6e3), t2;
49727 var C = (e3) => String.fromCharCode.apply(null, e3);
49728 var y = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : void 0;
49730 return y ? y.decode(e3) : a ? Buffer.from(e3).toString("utf8") : decodeURIComponent(escape(C(e3)));
49733 static from(e3, t2) {
49734 return e3 instanceof this && e3.le === t2 ? e3 : new _I(e3, void 0, void 0, t2);
49736 constructor(e3, t2 = 0, i3, n3) {
49737 if ("boolean" == typeof n3 && (this.le = n3), Array.isArray(e3) && (e3 = new Uint8Array(e3)), 0 === e3)
49738 this.byteOffset = 0, this.byteLength = 0;
49739 else if (e3 instanceof ArrayBuffer) {
49740 void 0 === i3 && (i3 = e3.byteLength - t2);
49741 let n4 = new DataView(e3, t2, i3);
49742 this._swapDataView(n4);
49743 } else if (e3 instanceof Uint8Array || e3 instanceof DataView || e3 instanceof _I) {
49744 void 0 === i3 && (i3 = e3.byteLength - t2), (t2 += e3.byteOffset) + i3 > e3.byteOffset + e3.byteLength && g2("Creating view outside of available memory in ArrayBuffer");
49745 let n4 = new DataView(e3.buffer, t2, i3);
49746 this._swapDataView(n4);
49747 } else if ("number" == typeof e3) {
49748 let t3 = new DataView(new ArrayBuffer(e3));
49749 this._swapDataView(t3);
49751 g2("Invalid input argument for BufferView: " + e3);
49753 _swapArrayBuffer(e3) {
49754 this._swapDataView(new DataView(e3));
49757 this._swapDataView(new DataView(e3.buffer, e3.byteOffset, e3.byteLength));
49759 _swapDataView(e3) {
49760 this.dataView = e3, this.buffer = e3.buffer, this.byteOffset = e3.byteOffset, this.byteLength = e3.byteLength;
49763 return this.byteLength - e3;
49765 set(e3, t2, i3 = _I) {
49766 return e3 instanceof DataView || e3 instanceof _I ? e3 = new Uint8Array(e3.buffer, e3.byteOffset, e3.byteLength) : e3 instanceof ArrayBuffer && (e3 = new Uint8Array(e3)), e3 instanceof Uint8Array || g2("BufferView.set(): Invalid data argument."), this.toUint8().set(e3, t2), new i3(this, t2, e3.byteLength);
49769 return t2 = t2 || this._lengthToEnd(e3), new _I(this, e3, t2);
49772 return new Uint8Array(this.buffer, this.byteOffset, this.byteLength);
49774 getUint8Array(e3, t2) {
49775 return new Uint8Array(this.buffer, this.byteOffset + e3, t2);
49777 getString(e3 = 0, t2 = this.byteLength) {
49778 return b(this.getUint8Array(e3, t2));
49780 getLatin1String(e3 = 0, t2 = this.byteLength) {
49781 let i3 = this.getUint8Array(e3, t2);
49784 getUnicodeString(e3 = 0, t2 = this.byteLength) {
49786 for (let n3 = 0; n3 < t2 && e3 + n3 < this.byteLength; n3 += 2)
49787 i3.push(this.getUint16(e3 + n3));
49791 return this.dataView.getInt8(e3);
49794 return this.dataView.getUint8(e3);
49796 getInt16(e3, t2 = this.le) {
49797 return this.dataView.getInt16(e3, t2);
49799 getInt32(e3, t2 = this.le) {
49800 return this.dataView.getInt32(e3, t2);
49802 getUint16(e3, t2 = this.le) {
49803 return this.dataView.getUint16(e3, t2);
49805 getUint32(e3, t2 = this.le) {
49806 return this.dataView.getUint32(e3, t2);
49808 getFloat32(e3, t2 = this.le) {
49809 return this.dataView.getFloat32(e3, t2);
49811 getFloat64(e3, t2 = this.le) {
49812 return this.dataView.getFloat64(e3, t2);
49814 getFloat(e3, t2 = this.le) {
49815 return this.dataView.getFloat32(e3, t2);
49817 getDouble(e3, t2 = this.le) {
49818 return this.dataView.getFloat64(e3, t2);
49820 getUintBytes(e3, t2, i3) {
49823 return this.getUint8(e3, i3);
49825 return this.getUint16(e3, i3);
49827 return this.getUint32(e3, i3);
49829 return this.getUint64 && this.getUint64(e3, i3);
49832 getUint(e3, t2, i3) {
49835 return this.getUint8(e3, i3);
49837 return this.getUint16(e3, i3);
49839 return this.getUint32(e3, i3);
49841 return this.getUint64 && this.getUint64(e3, i3);
49845 return this.dataView.toString(e3, this.constructor.name);
49850 function P(e3, t2) {
49851 g2(`${e3} '${t2}' was not loaded, try using full build of exifr.`);
49853 var k = class extends Map {
49855 super(), this.kind = e3;
49858 return this.has(e3) || P(this.kind, e3), t2 && (e3 in t2 || function(e4, t3) {
49859 g2(`Unknown ${e4} '${t3}'.`);
49860 }(this.kind, e3), t2[e3].enabled || P(this.kind, e3)), super.get(e3);
49863 return Array.from(this.keys());
49866 var w = new k("file parser");
49867 var T = new k("segment parser");
49868 var A = new k("file reader");
49869 function D(e3, n3) {
49870 return "string" == typeof e3 ? O(e3, n3) : t && !i2 && e3 instanceof HTMLImageElement ? O(e3.src, n3) : e3 instanceof Uint8Array || e3 instanceof ArrayBuffer || e3 instanceof DataView ? new I(e3) : t && e3 instanceof Blob ? x(e3, n3, "blob", R) : void g2("Invalid input argument");
49872 function O(e3, i3) {
49873 return (s2 = e3).startsWith("data:") || s2.length > 1e4 ? v(e3, i3, "base64") : n2 && e3.includes("://") ? x(e3, i3, "url", M) : n2 ? v(e3, i3, "fs") : t ? x(e3, i3, "url", M) : void g2("Invalid input argument");
49876 async function x(e3, t2, i3, n3) {
49877 return A.has(i3) ? v(e3, t2, i3) : n3 ? async function(e4, t3) {
49878 let i4 = await t3(e4);
49880 }(e3, n3) : void g2(`Parser ${i3} is not loaded`);
49882 async function v(e3, t2, i3) {
49883 let n3 = new (A.get(i3))(e3, t2);
49884 return await n3.read(), n3;
49886 var M = (e3) => h(e3).then((e4) => e4.arrayBuffer());
49887 var R = (e3) => new Promise((t2, i3) => {
49888 let n3 = new FileReader();
49889 n3.onloadend = () => t2(n3.result || new ArrayBuffer()), n3.onerror = i3, n3.readAsArrayBuffer(e3);
49891 var L = class extends Map {
49893 return this.allKeys || (this.allKeys = Array.from(this.keys())), this.allKeys;
49896 return this.allValues || (this.allValues = Array.from(this.values())), this.allValues;
49899 function U(e3, t2, i3) {
49901 for (let [e4, t3] of i3)
49903 if (Array.isArray(t2))
49910 function F(e3, t2, i3) {
49911 let n3, s2 = e3.get(t2);
49913 s2.set(n3[0], n3[1]);
49915 var E = /* @__PURE__ */ new Map();
49916 var B = /* @__PURE__ */ new Map();
49917 var N = /* @__PURE__ */ new Map();
49918 var G = ["chunked", "firstChunkSize", "firstChunkSizeNode", "firstChunkSizeBrowser", "chunkSize", "chunkLimit"];
49919 var V = ["jfif", "xmp", "icc", "iptc", "ihdr"];
49920 var z = ["tiff", ...V];
49921 var H = ["ifd0", "ifd1", "exif", "gps", "interop"];
49922 var j2 = [...z, ...H];
49923 var W = ["makerNote", "userComment"];
49924 var K = ["translateKeys", "translateValues", "reviveValues", "multiSegment"];
49925 var X = [...K, "sanitize", "mergeOutput", "silentErrors"];
49928 return this.translateKeys || this.translateValues || this.reviveValues;
49931 var Y = class extends _ {
49933 return this.enabled || this.deps.size > 0;
49935 constructor(e3, t2, i3, n3) {
49936 if (super(), c(this, "enabled", false), c(this, "skip", /* @__PURE__ */ new Set()), c(this, "pick", /* @__PURE__ */ new Set()), c(this, "deps", /* @__PURE__ */ new Set()), c(this, "translateKeys", false), c(this, "translateValues", false), c(this, "reviveValues", false), this.key = e3, this.enabled = t2, this.parse = this.enabled, this.applyInheritables(n3), this.canBeFiltered = H.includes(e3), this.canBeFiltered && (this.dict = E.get(e3)), void 0 !== i3)
49937 if (Array.isArray(i3))
49938 this.parse = this.enabled = true, this.canBeFiltered && i3.length > 0 && this.translateTagSet(i3, this.pick);
49939 else if ("object" == typeof i3) {
49940 if (this.enabled = true, this.parse = false !== i3.parse, this.canBeFiltered) {
49941 let { pick: e4, skip: t3 } = i3;
49942 e4 && e4.length > 0 && this.translateTagSet(e4, this.pick), t3 && t3.length > 0 && this.translateTagSet(t3, this.skip);
49944 this.applyInheritables(i3);
49946 true === i3 || false === i3 ? this.parse = this.enabled = i3 : g2(`Invalid options argument: ${i3}`);
49948 applyInheritables(e3) {
49951 i3 = e3[t2], void 0 !== i3 && (this[t2] = i3);
49953 translateTagSet(e3, t2) {
49955 let i3, n3, { tagKeys: s2, tagValues: r2 } = this.dict;
49957 "string" == typeof i3 ? (n3 = r2.indexOf(i3), -1 === n3 && (n3 = s2.indexOf(Number(i3))), -1 !== n3 && t2.add(Number(s2[n3]))) : t2.add(i3);
49962 finalizeFilters() {
49963 !this.enabled && this.deps.size > 0 ? (this.enabled = true, ee(this.pick, this.deps)) : this.enabled && this.pick.size > 0 && ee(this.pick, this.deps);
49966 var $2 = { jfif: false, tiff: true, xmp: false, icc: false, iptc: false, ifd0: true, ifd1: false, exif: true, gps: true, interop: false, ihdr: void 0, makerNote: false, userComment: false, multiSegment: false, skip: [], pick: [], translateKeys: true, translateValues: true, reviveValues: true, sanitize: true, mergeOutput: true, silentErrors: true, chunked: true, firstChunkSize: void 0, firstChunkSizeNode: 512, firstChunkSizeBrowser: 65536, chunkSize: 65536, chunkLimit: 5 };
49967 var J = /* @__PURE__ */ new Map();
49968 var q = class extends _ {
49969 static useCached(e3) {
49970 let t2 = J.get(e3);
49971 return void 0 !== t2 || (t2 = new this(e3), J.set(e3, t2)), t2;
49974 super(), true === e3 ? this.setupFromTrue() : void 0 === e3 ? this.setupFromUndefined() : Array.isArray(e3) ? this.setupFromArray(e3) : "object" == typeof e3 ? this.setupFromObject(e3) : g2(`Invalid options argument ${e3}`), void 0 === this.firstChunkSize && (this.firstChunkSize = t ? this.firstChunkSizeBrowser : this.firstChunkSizeNode), this.mergeOutput && (this.ifd1.enabled = false), this.filterNestedSegmentTags(), this.traverseTiffDependencyTree(), this.checkLoadedPlugins();
49976 setupFromUndefined() {
49985 this[e3] = new Y(e3, $2[e3], void 0, this);
49996 this[e3] = new Y(e3, true, void 0, this);
49998 setupFromArray(e3) {
50007 this[t2] = new Y(t2, false, void 0, this);
50008 this.setupGlobalFilters(e3, void 0, H);
50010 setupFromObject(e3) {
50012 for (t2 of (H.ifd0 = H.ifd0 || H.image, H.ifd1 = H.ifd1 || H.thumbnail, Object.assign(this, e3), G))
50013 this[t2] = Z(e3[t2], $2[t2]);
50015 this[t2] = Z(e3[t2], $2[t2]);
50017 this[t2] = Z(e3[t2], $2[t2]);
50019 this[t2] = new Y(t2, $2[t2], e3[t2], this);
50021 this[t2] = new Y(t2, $2[t2], e3[t2], this.tiff);
50022 this.setupGlobalFilters(e3.pick, e3.skip, H, j2), true === e3.tiff ? this.batchEnableWithBool(H, true) : false === e3.tiff ? this.batchEnableWithUserValue(H, e3) : Array.isArray(e3.tiff) ? this.setupGlobalFilters(e3.tiff, void 0, H) : "object" == typeof e3.tiff && this.setupGlobalFilters(e3.tiff.pick, e3.tiff.skip, H);
50024 batchEnableWithBool(e3, t2) {
50026 this[i3].enabled = t2;
50028 batchEnableWithUserValue(e3, t2) {
50029 for (let i3 of e3) {
50031 this[i3].enabled = false !== e4 && void 0 !== e4;
50034 setupGlobalFilters(e3, t2, i3, n3 = i3) {
50035 if (e3 && e3.length) {
50037 this[e4].enabled = false;
50038 let t3 = Q(e3, i3);
50039 for (let [e4, i4] of t3)
50040 ee(this[e4].pick, i4), this[e4].enabled = true;
50041 } else if (t2 && t2.length) {
50042 let e4 = Q(t2, i3);
50043 for (let [t3, i4] of e4)
50044 ee(this[t3].skip, i4);
50047 filterNestedSegmentTags() {
50048 let { ifd0: e3, exif: t2, xmp: i3, iptc: n3, icc: s2 } = this;
50049 this.makerNote ? t2.deps.add(37500) : t2.skip.add(37500), this.userComment ? t2.deps.add(37510) : t2.skip.add(37510), i3.enabled || e3.skip.add(700), n3.enabled || e3.skip.add(33723), s2.enabled || e3.skip.add(34675);
50051 traverseTiffDependencyTree() {
50052 let { ifd0: e3, exif: t2, gps: i3, interop: n3 } = this;
50053 n3.needed && (t2.deps.add(40965), e3.deps.add(40965)), t2.needed && e3.deps.add(34665), i3.needed && e3.deps.add(34853), this.tiff.enabled = H.some((e4) => true === this[e4].enabled) || this.makerNote || this.userComment;
50055 this[e4].finalizeFilters();
50058 return !V.map((e3) => this[e3].enabled).some((e3) => true === e3) && this.tiff.enabled;
50060 checkLoadedPlugins() {
50062 this[e3].enabled && !T.has(e3) && P("segment parser", e3);
50065 function Q(e3, t2) {
50066 let i3, n3, s2, r2, a2 = [];
50068 for (r2 of (i3 = E.get(s2), n3 = [], i3))
50069 (e3.includes(r2[0]) || e3.includes(r2[1])) && n3.push(r2[0]);
50070 n3.length && a2.push([s2, n3]);
50074 function Z(e3, t2) {
50075 return void 0 !== e3 ? e3 : void 0 !== t2 ? t2 : void 0;
50077 function ee(e3, t2) {
50081 c(q, "default", $2);
50084 c(this, "parsers", {}), c(this, "output", {}), c(this, "errors", []), c(this, "pushToErrors", (e4) => this.errors.push(e4)), this.options = q.useCached(e3);
50087 this.file = await D(e3, this.options);
50090 if (this.fileParser)
50092 let { file: e3 } = this, t2 = e3.getUint16(0);
50093 for (let [i3, n3] of w)
50094 if (n3.canHandle(e3, t2))
50095 return this.fileParser = new n3(this.options, this.file, this.parsers), e3[i3] = true;
50096 this.file.close && this.file.close(), g2("Unknown file format");
50099 let { output: e3, errors: t2 } = this;
50100 return this.setup(), this.options.silentErrors ? (await this.executeParsers().catch(this.pushToErrors), t2.push(...this.fileParser.errors)) : await this.executeParsers(), this.file.close && this.file.close(), this.options.silentErrors && t2.length > 0 && (e3.errors = t2), f2(e3);
50102 async executeParsers() {
50103 let { output: e3 } = this;
50104 await this.fileParser.parse();
50105 let t2 = Object.values(this.parsers).map(async (t3) => {
50106 let i3 = await t3.parse();
50107 t3.assignToOutput(e3, i3);
50109 this.options.silentErrors && (t2 = t2.map((e4) => e4.catch(this.pushToErrors))), await Promise.all(t2);
50111 async extractThumbnail() {
50113 let { options: e3, file: t2 } = this, i3 = T.get("tiff", e3);
50115 if (t2.tiff ? n3 = { start: 0, type: "tiff" } : t2.jpeg && (n3 = await this.fileParser.getOrFindSegment("tiff")), void 0 === n3)
50117 let s2 = await this.fileParser.ensureSegmentChunk(n3), r2 = this.parsers.tiff = new i3(s2, e3, t2), a2 = await r2.extractThumbnail();
50118 return t2.close && t2.close(), a2;
50121 async function ie(e3, t2) {
50122 let i3 = new te(t2);
50123 return await i3.read(e3), i3.parse();
50125 var ne = Object.freeze({ __proto__: null, parse: ie, Exifr: te, fileParsers: w, segmentParsers: T, fileReaders: A, tagKeys: E, tagValues: B, tagRevivers: N, createDictionary: U, extendDictionary: F, fetchUrlAsArrayBuffer: M, readBlobAsArrayBuffer: R, chunkedProps: G, otherSegments: V, segments: z, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W, inheritables: K, allFormatters: X, Options: q });
50127 constructor(e3, t2, i3) {
50128 c(this, "errors", []), c(this, "ensureSegmentChunk", async (e4) => {
50129 let t3 = e4.start, i4 = e4.size || 65536;
50130 if (this.file.chunked)
50131 if (this.file.available(t3, i4))
50132 e4.chunk = this.file.subarray(t3, i4);
50135 e4.chunk = await this.file.readChunk(t3, i4);
50137 g2(`Couldn't read segment: ${JSON.stringify(e4)}. ${t4.message}`);
50140 this.file.byteLength > t3 + i4 ? e4.chunk = this.file.subarray(t3, i4) : void 0 === e4.size ? e4.chunk = this.file.subarray(t3) : g2("Segment unreachable: " + JSON.stringify(e4));
50142 }), this.extendOptions && this.extendOptions(e3), this.options = e3, this.file = t2, this.parsers = i3;
50144 injectSegment(e3, t2) {
50145 this.options[e3].enabled && this.createParser(e3, t2);
50147 createParser(e3, t2) {
50148 let i3 = new (T.get(e3))(t2, this.options, this.file);
50149 return this.parsers[e3] = i3;
50151 createParsers(e3) {
50152 for (let t2 of e3) {
50153 let { type: e4, chunk: i3 } = t2, n3 = this.options[e4];
50154 if (n3 && n3.enabled) {
50155 let t3 = this.parsers[e4];
50156 t3 && t3.append || t3 || this.createParser(e4, i3);
50160 async readSegments(e3) {
50161 let t2 = e3.map(this.ensureSegmentChunk);
50162 await Promise.all(t2);
50166 static findPosition(e3, t2) {
50167 let i3 = e3.getUint16(t2 + 2) + 2, n3 = "function" == typeof this.headerLength ? this.headerLength(e3, t2, i3) : this.headerLength, s2 = t2 + n3, r2 = i3 - n3;
50168 return { offset: t2, length: i3, headerLength: n3, start: s2, size: r2, end: s2 + r2 };
50170 static parse(e3, t2 = {}) {
50171 return new this(e3, new q({ [this.type]: t2 }), e3).parse();
50173 normalizeInput(e3) {
50174 return e3 instanceof I ? e3 : new I(e3);
50176 constructor(e3, t2 = {}, i3) {
50177 c(this, "errors", []), c(this, "raw", /* @__PURE__ */ new Map()), c(this, "handleError", (e4) => {
50178 if (!this.options.silentErrors)
50180 this.errors.push(e4.message);
50181 }), this.chunk = this.normalizeInput(e3), this.file = i3, this.type = this.constructor.type, this.globalOptions = this.options = t2, this.localOptions = t2[this.type], this.canTranslate = this.localOptions && this.localOptions.translate;
50184 this.canTranslate && (this.translated = this.translateBlock(this.raw, this.type));
50187 return this.translated ? this.translated : this.raw ? Object.fromEntries(this.raw) : void 0;
50189 translateBlock(e3, t2) {
50190 let i3 = N.get(t2), n3 = B.get(t2), s2 = E.get(t2), r2 = this.options[t2], a2 = r2.reviveValues && !!i3, o2 = r2.translateValues && !!n3, l2 = r2.translateKeys && !!s2, h2 = {};
50191 for (let [t3, r3] of e3)
50192 a2 && i3.has(t3) ? r3 = i3.get(t3)(r3) : o2 && n3.has(t3) && (r3 = this.translateValue(r3, n3.get(t3))), l2 && s2.has(t3) && (t3 = s2.get(t3) || t3), h2[t3] = r3;
50195 translateValue(e3, t2) {
50196 return t2[e3] || t2.DEFAULT || e3;
50198 assignToOutput(e3, t2) {
50199 this.assignObjectToOutput(e3, this.constructor.type, t2);
50201 assignObjectToOutput(e3, t2, i3) {
50202 if (this.globalOptions.mergeOutput)
50203 return Object.assign(e3, i3);
50204 e3[t2] ? Object.assign(e3[t2], i3) : e3[t2] = i3;
50207 c(re2, "headerLength", 4), c(re2, "type", void 0), c(re2, "multiSegment", false), c(re2, "canHandle", () => false);
50209 return 192 === e3 || 194 === e3 || 196 === e3 || 219 === e3 || 221 === e3 || 218 === e3 || 254 === e3;
50212 return e3 >= 224 && e3 <= 239;
50214 function le(e3, t2, i3) {
50215 for (let [n3, s2] of T)
50216 if (s2.canHandle(e3, t2, i3))
50219 var he = class extends se {
50220 constructor(...e3) {
50221 super(...e3), c(this, "appSegments", []), c(this, "jpegSegments", []), c(this, "unknownSegments", []);
50223 static canHandle(e3, t2) {
50224 return 65496 === t2;
50227 await this.findAppSegments(), await this.readSegments(this.appSegments), this.mergeMultiSegments(), this.createParsers(this.mergedAppSegments || this.appSegments);
50229 setupSegmentFinderArgs(e3) {
50230 true === e3 ? (this.findAll = true, this.wanted = new Set(T.keyList())) : (e3 = void 0 === e3 ? T.keyList().filter((e4) => this.options[e4].enabled) : e3.filter((e4) => this.options[e4].enabled && T.has(e4)), this.findAll = false, this.remaining = new Set(e3), this.wanted = new Set(e3)), this.unfinishedMultiSegment = false;
50232 async findAppSegments(e3 = 0, t2) {
50233 this.setupSegmentFinderArgs(t2);
50234 let { file: i3, findAll: n3, wanted: s2, remaining: r2 } = this;
50235 if (!n3 && this.file.chunked && (n3 = Array.from(s2).some((e4) => {
50236 let t3 = T.get(e4), i4 = this.options[e4];
50237 return t3.multiSegment && i4.multiSegment;
50238 }), n3 && await this.file.readWhole()), e3 = this.findAppSegmentsInRange(e3, i3.byteLength), !this.options.onlyTiff && i3.chunked) {
50240 for (; r2.size > 0 && !t3 && (i3.canReadNextChunk || this.unfinishedMultiSegment); ) {
50241 let { nextChunkOffset: n4 } = i3, s3 = this.appSegments.some((e4) => !this.file.available(e4.offset || e4.start, e4.length || e4.size));
50242 if (t3 = e3 > n4 && !s3 ? !await i3.readNextChunk(e3) : !await i3.readNextChunk(n4), void 0 === (e3 = this.findAppSegmentsInRange(e3, i3.byteLength)))
50247 findAppSegmentsInRange(e3, t2) {
50249 let i3, n3, s2, r2, a2, o2, { file: l2, findAll: h2, wanted: u2, remaining: c2, options: f3 } = this;
50250 for (; e3 < t2; e3++)
50251 if (255 === l2.getUint8(e3)) {
50252 if (i3 = l2.getUint8(e3 + 1), oe(i3)) {
50253 if (n3 = l2.getUint16(e3 + 2), s2 = le(l2, e3, n3), s2 && u2.has(s2) && (r2 = T.get(s2), a2 = r2.findPosition(l2, e3), o2 = f3[s2], a2.type = s2, this.appSegments.push(a2), !h2 && (r2.multiSegment && o2.multiSegment ? (this.unfinishedMultiSegment = a2.chunkNumber < a2.chunkCount, this.unfinishedMultiSegment || c2.delete(s2)) : c2.delete(s2), 0 === c2.size)))
50255 f3.recordUnknownSegments && (a2 = re2.findPosition(l2, e3), a2.marker = i3, this.unknownSegments.push(a2)), e3 += n3 + 1;
50256 } else if (ae(i3)) {
50257 if (n3 = l2.getUint16(e3 + 2), 218 === i3 && false !== f3.stopAfterSos)
50259 f3.recordJpegSegments && this.jpegSegments.push({ offset: e3, length: n3, marker: i3 }), e3 += n3 + 1;
50264 mergeMultiSegments() {
50265 if (!this.appSegments.some((e4) => e4.multiSegment))
50267 let e3 = function(e4, t2) {
50268 let i3, n3, s2, r2 = /* @__PURE__ */ new Map();
50269 for (let a2 = 0; a2 < e4.length; a2++)
50270 i3 = e4[a2], n3 = i3[t2], r2.has(n3) ? s2 = r2.get(n3) : r2.set(n3, s2 = []), s2.push(i3);
50271 return Array.from(r2);
50272 }(this.appSegments, "type");
50273 this.mergedAppSegments = e3.map(([e4, t2]) => {
50274 let i3 = T.get(e4, this.options);
50275 if (i3.handleMultiSegments) {
50276 return { type: e4, chunk: i3.handleMultiSegments(t2) };
50282 return this.appSegments.find((t2) => t2.type === e3);
50284 async getOrFindSegment(e3) {
50285 let t2 = this.getSegment(e3);
50286 return void 0 === t2 && (await this.findAppSegments(0, [e3]), t2 = this.getSegment(e3)), t2;
50289 c(he, "type", "jpeg"), w.set("jpeg", he);
50290 var ue = [void 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4];
50291 var ce = class extends re2 {
50293 var e3 = this.chunk.getUint16();
50294 18761 === e3 ? this.le = true : 19789 === e3 && (this.le = false), this.chunk.le = this.le, this.headerParsed = true;
50296 parseTags(e3, t2, i3 = /* @__PURE__ */ new Map()) {
50297 let { pick: n3, skip: s2 } = this.options[t2];
50299 let r2 = n3.size > 0, a2 = 0 === s2.size, o2 = this.chunk.getUint16(e3);
50301 for (let l2 = 0; l2 < o2; l2++) {
50302 let o3 = this.chunk.getUint16(e3);
50304 if (n3.has(o3) && (i3.set(o3, this.parseTag(e3, o3, t2)), n3.delete(o3), 0 === n3.size))
50307 !a2 && s2.has(o3) || i3.set(o3, this.parseTag(e3, o3, t2));
50312 parseTag(e3, t2, i3) {
50313 let { chunk: n3 } = this, s2 = n3.getUint16(e3 + 2), r2 = n3.getUint32(e3 + 4), a2 = ue[s2];
50314 if (a2 * r2 <= 4 ? e3 += 8 : e3 = n3.getUint32(e3 + 8), (s2 < 1 || s2 > 13) && g2(`Invalid TIFF value type. block: ${i3.toUpperCase()}, tag: ${t2.toString(16)}, type: ${s2}, offset ${e3}`), e3 > n3.byteLength && g2(`Invalid TIFF value offset. block: ${i3.toUpperCase()}, tag: ${t2.toString(16)}, type: ${s2}, offset ${e3} is outside of chunk size ${n3.byteLength}`), 1 === s2)
50315 return n3.getUint8Array(e3, r2);
50317 return m(n3.getString(e3, r2));
50319 return n3.getUint8Array(e3, r2);
50321 return this.parseTagValue(s2, e3);
50323 let t3 = new (function(e4) {
50328 return Uint16Array;
50330 return Uint32Array;
50342 return Float32Array;
50344 return Float64Array;
50348 }(s2))(r2), i4 = a2;
50349 for (let n4 = 0; n4 < r2; n4++)
50350 t3[n4] = this.parseTagValue(s2, e3), e3 += i4;
50354 parseTagValue(e3, t2) {
50355 let { chunk: i3 } = this;
50358 return i3.getUint8(t2);
50360 return i3.getUint16(t2);
50362 return i3.getUint32(t2);
50364 return i3.getUint32(t2) / i3.getUint32(t2 + 4);
50366 return i3.getInt8(t2);
50368 return i3.getInt16(t2);
50370 return i3.getInt32(t2);
50372 return i3.getInt32(t2) / i3.getInt32(t2 + 4);
50374 return i3.getFloat(t2);
50376 return i3.getDouble(t2);
50378 return i3.getUint32(t2);
50380 g2(`Invalid tiff type ${e3}`);
50384 var fe = class extends ce {
50385 static canHandle(e3, t2) {
50386 return 225 === e3.getUint8(t2 + 1) && 1165519206 === e3.getUint32(t2 + 4) && 0 === e3.getUint16(t2 + 8);
50389 this.parseHeader();
50390 let { options: e3 } = this;
50391 return e3.ifd0.enabled && await this.parseIfd0Block(), e3.exif.enabled && await this.safeParse("parseExifBlock"), e3.gps.enabled && await this.safeParse("parseGpsBlock"), e3.interop.enabled && await this.safeParse("parseInteropBlock"), e3.ifd1.enabled && await this.safeParse("parseThumbnailBlock"), this.createOutput();
50394 let t2 = this[e3]();
50395 return void 0 !== t2.catch && (t2 = t2.catch(this.handleError)), t2;
50398 void 0 === this.ifd0Offset && (this.ifd0Offset = this.chunk.getUint32(4));
50401 if (void 0 === this.ifd1Offset) {
50402 this.findIfd0Offset();
50403 let e3 = this.chunk.getUint16(this.ifd0Offset), t2 = this.ifd0Offset + 2 + 12 * e3;
50404 this.ifd1Offset = this.chunk.getUint32(t2);
50407 parseBlock(e3, t2) {
50408 let i3 = /* @__PURE__ */ new Map();
50409 return this[t2] = i3, this.parseTags(e3, t2, i3), i3;
50411 async parseIfd0Block() {
50414 let { file: e3 } = this;
50415 this.findIfd0Offset(), this.ifd0Offset < 8 && g2("Malformed EXIF data"), !e3.chunked && this.ifd0Offset > e3.byteLength && g2(`IFD0 offset points to outside of file.
50416 this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e3.byteLength}`), e3.tiff && await e3.ensureChunk(this.ifd0Offset, S(this.options));
50417 let t2 = this.parseBlock(this.ifd0Offset, "ifd0");
50418 return 0 !== t2.size ? (this.exifOffset = t2.get(34665), this.interopOffset = t2.get(40965), this.gpsOffset = t2.get(34853), this.xmp = t2.get(700), this.iptc = t2.get(33723), this.icc = t2.get(34675), this.options.sanitize && (t2.delete(34665), t2.delete(40965), t2.delete(34853), t2.delete(700), t2.delete(33723), t2.delete(34675)), t2) : void 0;
50420 async parseExifBlock() {
50423 if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.exifOffset)
50425 this.file.tiff && await this.file.ensureChunk(this.exifOffset, S(this.options));
50426 let e3 = this.parseBlock(this.exifOffset, "exif");
50427 return this.interopOffset || (this.interopOffset = e3.get(40965)), this.makerNote = e3.get(37500), this.userComment = e3.get(37510), this.options.sanitize && (e3.delete(40965), e3.delete(37500), e3.delete(37510)), this.unpack(e3, 41728), this.unpack(e3, 41729), e3;
50430 let i3 = e3.get(t2);
50431 i3 && 1 === i3.length && e3.set(t2, i3[0]);
50433 async parseGpsBlock() {
50436 if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.gpsOffset)
50438 let e3 = this.parseBlock(this.gpsOffset, "gps");
50439 return e3 && e3.has(2) && e3.has(4) && (e3.set("latitude", de(...e3.get(2), e3.get(1))), e3.set("longitude", de(...e3.get(4), e3.get(3)))), e3;
50441 async parseInteropBlock() {
50442 if (!this.interop && (this.ifd0 || await this.parseIfd0Block(), void 0 !== this.interopOffset || this.exif || await this.parseExifBlock(), void 0 !== this.interopOffset))
50443 return this.parseBlock(this.interopOffset, "interop");
50445 async parseThumbnailBlock(e3 = false) {
50446 if (!this.ifd1 && !this.ifd1Parsed && (!this.options.mergeOutput || e3))
50447 return this.findIfd1Offset(), this.ifd1Offset > 0 && (this.parseBlock(this.ifd1Offset, "ifd1"), this.ifd1Parsed = true), this.ifd1;
50449 async extractThumbnail() {
50450 if (this.headerParsed || this.parseHeader(), this.ifd1Parsed || await this.parseThumbnailBlock(true), void 0 === this.ifd1)
50452 let e3 = this.ifd1.get(513), t2 = this.ifd1.get(514);
50453 return this.chunk.getUint8Array(e3, t2);
50462 let e3, t2, i3, n3 = {};
50464 if (e3 = this[t2], !p(e3))
50465 if (i3 = this.canTranslate ? this.translateBlock(e3, t2) : Object.fromEntries(e3), this.options.mergeOutput) {
50468 Object.assign(n3, i3);
50471 return this.makerNote && (n3.makerNote = this.makerNote), this.userComment && (n3.userComment = this.userComment), n3;
50473 assignToOutput(e3, t2) {
50474 if (this.globalOptions.mergeOutput)
50475 Object.assign(e3, t2);
50477 for (let [i3, n3] of Object.entries(t2))
50478 this.assignObjectToOutput(e3, i3, n3);
50481 function de(e3, t2, i3, n3) {
50482 var s2 = e3 + t2 / 60 + i3 / 3600;
50483 return "S" !== n3 && "W" !== n3 || (s2 *= -1), s2;
50485 c(fe, "type", "tiff"), c(fe, "headerLength", 10), T.set("tiff", fe);
50486 var pe = Object.freeze({ __proto__: null, default: ne, Exifr: te, fileParsers: w, segmentParsers: T, fileReaders: A, tagKeys: E, tagValues: B, tagRevivers: N, createDictionary: U, extendDictionary: F, fetchUrlAsArrayBuffer: M, readBlobAsArrayBuffer: R, chunkedProps: G, otherSegments: V, segments: z, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W, inheritables: K, allFormatters: X, Options: q, parse: ie });
50487 var ge = { ifd0: false, ifd1: false, exif: false, gps: false, interop: false, sanitize: false, reviveValues: true, translateKeys: false, translateValues: false, mergeOutput: false };
50488 var me = Object.assign({}, ge, { firstChunkSize: 4e4, gps: [1, 2, 3, 4] });
50489 async function Se(e3) {
50490 let t2 = new te(me);
50492 let i3 = await t2.parse();
50493 if (i3 && i3.gps) {
50494 let { latitude: e4, longitude: t3 } = i3.gps;
50495 return { latitude: e4, longitude: t3 };
50498 var Ce = Object.assign({}, ge, { tiff: false, ifd1: true, mergeOutput: false });
50499 async function ye(e3) {
50500 let t2 = new te(Ce);
50502 let i3 = await t2.extractThumbnail();
50503 return i3 && a ? s.from(i3) : i3;
50505 async function be(e3) {
50506 let t2 = await this.thumbnail(e3);
50507 if (void 0 !== t2) {
50508 let e4 = new Blob([t2]);
50509 return URL.createObjectURL(e4);
50512 var Ie = Object.assign({}, ge, { firstChunkSize: 4e4, ifd0: [274] });
50513 async function Pe(e3) {
50514 let t2 = new te(Ie);
50516 let i3 = await t2.parse();
50518 return i3.ifd0[274];
50520 var ke = Object.freeze({ 1: { dimensionSwapped: false, scaleX: 1, scaleY: 1, deg: 0, rad: 0 }, 2: { dimensionSwapped: false, scaleX: -1, scaleY: 1, deg: 0, rad: 0 }, 3: { dimensionSwapped: false, scaleX: 1, scaleY: 1, deg: 180, rad: 180 * Math.PI / 180 }, 4: { dimensionSwapped: false, scaleX: -1, scaleY: 1, deg: 180, rad: 180 * Math.PI / 180 }, 5: { dimensionSwapped: true, scaleX: 1, scaleY: -1, deg: 90, rad: 90 * Math.PI / 180 }, 6: { dimensionSwapped: true, scaleX: 1, scaleY: 1, deg: 90, rad: 90 * Math.PI / 180 }, 7: { dimensionSwapped: true, scaleX: 1, scaleY: -1, deg: 270, rad: 270 * Math.PI / 180 }, 8: { dimensionSwapped: true, scaleX: 1, scaleY: 1, deg: 270, rad: 270 * Math.PI / 180 } });
50523 if ("object" == typeof navigator) {
50524 let e3 = navigator.userAgent;
50525 if (e3.includes("iPad") || e3.includes("iPhone")) {
50526 let t2 = e3.match(/OS (\d+)_(\d+)/);
50528 let [, e4, i3] = t2, n3 = Number(e4) + 0.1 * Number(i3);
50529 we = n3 < 13.4, Te = false;
50531 } else if (e3.includes("OS X 10")) {
50532 let [, t2] = e3.match(/OS X 10[_.](\d+)/);
50533 we = Te = Number(t2) < 15;
50535 if (e3.includes("Chrome/")) {
50536 let [, t2] = e3.match(/Chrome\/(\d+)/);
50537 we = Te = Number(t2) < 81;
50538 } else if (e3.includes("Firefox/")) {
50539 let [, t2] = e3.match(/Firefox\/(\d+)/);
50540 we = Te = Number(t2) < 77;
50543 async function Ae(e3) {
50544 let t2 = await Pe(e3);
50545 return Object.assign({ canvas: we, css: Te }, ke[t2]);
50547 var De = class extends I {
50548 constructor(...e3) {
50549 super(...e3), c(this, "ranges", new Oe()), 0 !== this.byteLength && this.ranges.add(0, this.byteLength);
50551 _tryExtend(e3, t2, i3) {
50552 if (0 === e3 && 0 === this.byteLength && i3) {
50553 let e4 = new DataView(i3.buffer || i3, i3.byteOffset, i3.byteLength);
50554 this._swapDataView(e4);
50557 if (i4 > this.byteLength) {
50558 let { dataView: e4 } = this._extend(i4);
50559 this._swapDataView(e4);
50565 t2 = a ? s.allocUnsafe(e3) : new Uint8Array(e3);
50566 let i3 = new DataView(t2.buffer, t2.byteOffset, t2.byteLength);
50567 return t2.set(new Uint8Array(this.buffer, this.byteOffset, this.byteLength), 0), { uintView: t2, dataView: i3 };
50569 subarray(e3, t2, i3 = false) {
50570 return t2 = t2 || this._lengthToEnd(e3), i3 && this._tryExtend(e3, t2), this.ranges.add(e3, t2), super.subarray(e3, t2);
50572 set(e3, t2, i3 = false) {
50573 i3 && this._tryExtend(t2, e3.byteLength, e3);
50574 let n3 = super.set(e3, t2);
50575 return this.ranges.add(t2, n3.byteLength), n3;
50577 async ensureChunk(e3, t2) {
50578 this.chunked && (this.ranges.available(e3, t2) || await this.readChunk(e3, t2));
50580 available(e3, t2) {
50581 return this.ranges.available(e3, t2);
50586 c(this, "list", []);
50589 return this.list.length;
50591 add(e3, t2, i3 = 0) {
50592 let n3 = e3 + t2, s2 = this.list.filter((t3) => xe(e3, t3.offset, n3) || xe(e3, t3.end, n3));
50593 if (s2.length > 0) {
50594 e3 = Math.min(e3, ...s2.map((e4) => e4.offset)), n3 = Math.max(n3, ...s2.map((e4) => e4.end)), t2 = n3 - e3;
50595 let i4 = s2.shift();
50596 i4.offset = e3, i4.length = t2, i4.end = n3, this.list = this.list.filter((e4) => !s2.includes(e4));
50598 this.list.push({ offset: e3, length: t2, end: n3 });
50600 available(e3, t2) {
50602 return this.list.some((t3) => t3.offset <= e3 && i3 <= t3.end);
50605 function xe(e3, t2, i3) {
50606 return e3 <= t2 && t2 <= i3;
50608 var ve = class extends De {
50609 constructor(e3, t2) {
50610 super(0), c(this, "chunksRead", 0), this.input = e3, this.options = t2;
50612 async readWhole() {
50613 this.chunked = false, await this.readChunk(this.nextChunkOffset);
50615 async readChunked() {
50616 this.chunked = true, await this.readChunk(0, this.options.firstChunkSize);
50618 async readNextChunk(e3 = this.nextChunkOffset) {
50619 if (this.fullyRead)
50620 return this.chunksRead++, false;
50621 let t2 = this.options.chunkSize, i3 = await this.readChunk(e3, t2);
50622 return !!i3 && i3.byteLength === t2;
50624 async readChunk(e3, t2) {
50625 if (this.chunksRead++, 0 !== (t2 = this.safeWrapAddress(e3, t2)))
50626 return this._readChunk(e3, t2);
50628 safeWrapAddress(e3, t2) {
50629 return void 0 !== this.size && e3 + t2 > this.size ? Math.max(0, this.size - e3) : t2;
50631 get nextChunkOffset() {
50632 if (0 !== this.ranges.list.length)
50633 return this.ranges.list[0].length;
50635 get canReadNextChunk() {
50636 return this.chunksRead < this.options.chunkLimit;
50639 return void 0 !== this.size && this.nextChunkOffset === this.size;
50642 return this.options.chunked ? this.readChunked() : this.readWhole();
50647 A.set("blob", class extends ve {
50648 async readWhole() {
50649 this.chunked = false;
50650 let e3 = await R(this.input);
50651 this._swapArrayBuffer(e3);
50654 return this.chunked = true, this.size = this.input.size, super.readChunked();
50656 async _readChunk(e3, t2) {
50657 let i3 = t2 ? e3 + t2 : void 0, n3 = this.input.slice(e3, i3), s2 = await R(n3);
50658 return this.set(s2, e3, true);
50661 var Me = Object.freeze({ __proto__: null, default: pe, Exifr: te, fileParsers: w, segmentParsers: T, fileReaders: A, tagKeys: E, tagValues: B, tagRevivers: N, createDictionary: U, extendDictionary: F, fetchUrlAsArrayBuffer: M, readBlobAsArrayBuffer: R, chunkedProps: G, otherSegments: V, segments: z, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W, inheritables: K, allFormatters: X, Options: q, parse: ie, gpsOnlyOptions: me, gps: Se, thumbnailOnlyOptions: Ce, thumbnail: ye, thumbnailUrl: be, orientationOnlyOptions: Ie, orientation: Pe, rotations: ke, get rotateCanvas() {
50663 }, get rotateCss() {
50665 }, rotation: Ae });
50666 A.set("url", class extends ve {
50667 async readWhole() {
50668 this.chunked = false;
50669 let e3 = await M(this.input);
50670 e3 instanceof ArrayBuffer ? this._swapArrayBuffer(e3) : e3 instanceof Uint8Array && this._swapBuffer(e3);
50672 async _readChunk(e3, t2) {
50673 let i3 = t2 ? e3 + t2 - 1 : void 0, n3 = this.options.httpHeaders || {};
50674 (e3 || i3) && (n3.range = `bytes=${[e3, i3].join("-")}`);
50675 let s2 = await h(this.input, { headers: n3 }), r2 = await s2.arrayBuffer(), a2 = r2.byteLength;
50676 if (416 !== s2.status)
50677 return a2 !== t2 && (this.size = e3 + a2), this.set(r2, e3, true);
50680 I.prototype.getUint64 = function(e3) {
50681 let t2 = this.getUint32(e3), i3 = this.getUint32(e3 + 4);
50682 return t2 < 1048575 ? t2 << 32 | i3 : void 0 !== typeof r ? (console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."), r(t2) << r(32) | r(i3)) : void g2("Trying to read 64b value but JS can only handle 53b numbers.");
50684 var Re = class extends se {
50685 parseBoxes(e3 = 0) {
50687 for (; e3 < this.file.byteLength - 4; ) {
50688 let i3 = this.parseBoxHead(e3);
50689 if (t2.push(i3), 0 === i3.length)
50695 parseSubBoxes(e3) {
50696 e3.boxes = this.parseBoxes(e3.start);
50699 return void 0 === e3.boxes && this.parseSubBoxes(e3), e3.boxes.find((e4) => e4.kind === t2);
50702 let t2 = this.file.getUint32(e3), i3 = this.file.getString(e3 + 4, 4), n3 = e3 + 8;
50703 return 1 === t2 && (t2 = this.file.getUint64(e3 + 8), n3 += 8), { offset: e3, length: t2, kind: i3, start: n3 };
50705 parseBoxFullHead(e3) {
50706 if (void 0 !== e3.version)
50708 let t2 = this.file.getUint32(e3.start);
50709 e3.version = t2 >> 24, e3.start += 4;
50712 var Le = class extends Re {
50713 static canHandle(e3, t2) {
50716 let i3 = e3.getUint16(2);
50719 let n3 = 16, s2 = [];
50721 s2.push(e3.getString(n3, 4)), n3 += 4;
50722 return s2.includes(this.type);
50725 let e3 = this.file.getUint32(0), t2 = this.parseBoxHead(e3);
50726 for (; "meta" !== t2.kind; )
50727 e3 += t2.length, await this.file.ensureChunk(e3, 16), t2 = this.parseBoxHead(e3);
50728 await this.file.ensureChunk(t2.offset, t2.length), this.parseBoxFullHead(t2), this.parseSubBoxes(t2), this.options.icc.enabled && await this.findIcc(t2), this.options.tiff.enabled && await this.findExif(t2);
50730 async registerSegment(e3, t2, i3) {
50731 await this.file.ensureChunk(t2, i3);
50732 let n3 = this.file.subarray(t2, i3);
50733 this.createParser(e3, n3);
50735 async findIcc(e3) {
50736 let t2 = this.findBox(e3, "iprp");
50739 let i3 = this.findBox(t2, "ipco");
50742 let n3 = this.findBox(i3, "colr");
50743 void 0 !== n3 && await this.registerSegment("icc", n3.offset + 12, n3.length);
50745 async findExif(e3) {
50746 let t2 = this.findBox(e3, "iinf");
50749 let i3 = this.findBox(e3, "iloc");
50752 let n3 = this.findExifLocIdInIinf(t2), s2 = this.findExtentInIloc(i3, n3);
50756 await this.file.ensureChunk(r2, a2);
50757 let o2 = 4 + this.file.getUint32(r2);
50758 r2 += o2, a2 -= o2, await this.registerSegment("tiff", r2, a2);
50760 findExifLocIdInIinf(e3) {
50761 this.parseBoxFullHead(e3);
50762 let t2, i3, n3, s2, r2 = e3.start, a2 = this.file.getUint16(r2);
50763 for (r2 += 2; a2--; ) {
50764 if (t2 = this.parseBoxHead(r2), this.parseBoxFullHead(t2), i3 = t2.start, t2.version >= 2 && (n3 = 3 === t2.version ? 4 : 2, s2 = this.file.getString(i3 + n3 + 2, 4), "Exif" === s2))
50765 return this.file.getUintBytes(i3, n3);
50770 let t2 = this.file.getUint8(e3);
50771 return [t2 >> 4, 15 & t2];
50773 findExtentInIloc(e3, t2) {
50774 this.parseBoxFullHead(e3);
50775 let i3 = e3.start, [n3, s2] = this.get8bits(i3++), [r2, a2] = this.get8bits(i3++), o2 = 2 === e3.version ? 4 : 2, l2 = 1 === e3.version || 2 === e3.version ? 2 : 0, h2 = a2 + n3 + s2, u2 = 2 === e3.version ? 4 : 2, c2 = this.file.getUintBytes(i3, u2);
50776 for (i3 += u2; c2--; ) {
50777 let e4 = this.file.getUintBytes(i3, o2);
50778 i3 += o2 + l2 + 2 + r2;
50779 let u3 = this.file.getUint16(i3);
50780 if (i3 += 2, e4 === t2)
50781 return u3 > 1 && console.warn("ILOC box has more than one extent but we're only processing one\nPlease create an issue at https://github.com/MikeKovarik/exifr with this file"), [this.file.getUintBytes(i3 + a2, n3), this.file.getUintBytes(i3 + a2 + n3, s2)];
50786 var Ue = class extends Le {
50788 c(Ue, "type", "heic");
50789 var Fe = class extends Le {
50791 c(Fe, "type", "avif"), w.set("heic", Ue), w.set("avif", Fe), U(E, ["ifd0", "ifd1"], [[256, "ImageWidth"], [257, "ImageHeight"], [258, "BitsPerSample"], [259, "Compression"], [262, "PhotometricInterpretation"], [270, "ImageDescription"], [271, "Make"], [272, "Model"], [273, "StripOffsets"], [274, "Orientation"], [277, "SamplesPerPixel"], [278, "RowsPerStrip"], [279, "StripByteCounts"], [282, "XResolution"], [283, "YResolution"], [284, "PlanarConfiguration"], [296, "ResolutionUnit"], [301, "TransferFunction"], [305, "Software"], [306, "ModifyDate"], [315, "Artist"], [316, "HostComputer"], [317, "Predictor"], [318, "WhitePoint"], [319, "PrimaryChromaticities"], [513, "ThumbnailOffset"], [514, "ThumbnailLength"], [529, "YCbCrCoefficients"], [530, "YCbCrSubSampling"], [531, "YCbCrPositioning"], [532, "ReferenceBlackWhite"], [700, "ApplicationNotes"], [33432, "Copyright"], [33723, "IPTC"], [34665, "ExifIFD"], [34675, "ICC"], [34853, "GpsIFD"], [330, "SubIFD"], [40965, "InteropIFD"], [40091, "XPTitle"], [40092, "XPComment"], [40093, "XPAuthor"], [40094, "XPKeywords"], [40095, "XPSubject"]]), U(E, "exif", [[33434, "ExposureTime"], [33437, "FNumber"], [34850, "ExposureProgram"], [34852, "SpectralSensitivity"], [34855, "ISO"], [34858, "TimeZoneOffset"], [34859, "SelfTimerMode"], [34864, "SensitivityType"], [34865, "StandardOutputSensitivity"], [34866, "RecommendedExposureIndex"], [34867, "ISOSpeed"], [34868, "ISOSpeedLatitudeyyy"], [34869, "ISOSpeedLatitudezzz"], [36864, "ExifVersion"], [36867, "DateTimeOriginal"], [36868, "CreateDate"], [36873, "GooglePlusUploadCode"], [36880, "OffsetTime"], [36881, "OffsetTimeOriginal"], [36882, "OffsetTimeDigitized"], [37121, "ComponentsConfiguration"], [37122, "CompressedBitsPerPixel"], [37377, "ShutterSpeedValue"], [37378, "ApertureValue"], [37379, "BrightnessValue"], [37380, "ExposureCompensation"], [37381, "MaxApertureValue"], [37382, "SubjectDistance"], [37383, "MeteringMode"], [37384, "LightSource"], [37385, "Flash"], [37386, "FocalLength"], [37393, "ImageNumber"], [37394, "SecurityClassification"], [37395, "ImageHistory"], [37396, "SubjectArea"], [37500, "MakerNote"], [37510, "UserComment"], [37520, "SubSecTime"], [37521, "SubSecTimeOriginal"], [37522, "SubSecTimeDigitized"], [37888, "AmbientTemperature"], [37889, "Humidity"], [37890, "Pressure"], [37891, "WaterDepth"], [37892, "Acceleration"], [37893, "CameraElevationAngle"], [40960, "FlashpixVersion"], [40961, "ColorSpace"], [40962, "ExifImageWidth"], [40963, "ExifImageHeight"], [40964, "RelatedSoundFile"], [41483, "FlashEnergy"], [41486, "FocalPlaneXResolution"], [41487, "FocalPlaneYResolution"], [41488, "FocalPlaneResolutionUnit"], [41492, "SubjectLocation"], [41493, "ExposureIndex"], [41495, "SensingMethod"], [41728, "FileSource"], [41729, "SceneType"], [41730, "CFAPattern"], [41985, "CustomRendered"], [41986, "ExposureMode"], [41987, "WhiteBalance"], [41988, "DigitalZoomRatio"], [41989, "FocalLengthIn35mmFormat"], [41990, "SceneCaptureType"], [41991, "GainControl"], [41992, "Contrast"], [41993, "Saturation"], [41994, "Sharpness"], [41996, "SubjectDistanceRange"], [42016, "ImageUniqueID"], [42032, "OwnerName"], [42033, "SerialNumber"], [42034, "LensInfo"], [42035, "LensMake"], [42036, "LensModel"], [42037, "LensSerialNumber"], [42080, "CompositeImage"], [42081, "CompositeImageCount"], [42082, "CompositeImageExposureTimes"], [42240, "Gamma"], [59932, "Padding"], [59933, "OffsetSchema"], [65e3, "OwnerName"], [65001, "SerialNumber"], [65002, "Lens"], [65100, "RawFile"], [65101, "Converter"], [65102, "WhiteBalance"], [65105, "Exposure"], [65106, "Shadows"], [65107, "Brightness"], [65108, "Contrast"], [65109, "Saturation"], [65110, "Sharpness"], [65111, "Smoothness"], [65112, "MoireFilter"], [40965, "InteropIFD"]]), U(E, "gps", [[0, "GPSVersionID"], [1, "GPSLatitudeRef"], [2, "GPSLatitude"], [3, "GPSLongitudeRef"], [4, "GPSLongitude"], [5, "GPSAltitudeRef"], [6, "GPSAltitude"], [7, "GPSTimeStamp"], [8, "GPSSatellites"], [9, "GPSStatus"], [10, "GPSMeasureMode"], [11, "GPSDOP"], [12, "GPSSpeedRef"], [13, "GPSSpeed"], [14, "GPSTrackRef"], [15, "GPSTrack"], [16, "GPSImgDirectionRef"], [17, "GPSImgDirection"], [18, "GPSMapDatum"], [19, "GPSDestLatitudeRef"], [20, "GPSDestLatitude"], [21, "GPSDestLongitudeRef"], [22, "GPSDestLongitude"], [23, "GPSDestBearingRef"], [24, "GPSDestBearing"], [25, "GPSDestDistanceRef"], [26, "GPSDestDistance"], [27, "GPSProcessingMethod"], [28, "GPSAreaInformation"], [29, "GPSDateStamp"], [30, "GPSDifferential"], [31, "GPSHPositioningError"]]), U(B, ["ifd0", "ifd1"], [[274, { 1: "Horizontal (normal)", 2: "Mirror horizontal", 3: "Rotate 180", 4: "Mirror vertical", 5: "Mirror horizontal and rotate 270 CW", 6: "Rotate 90 CW", 7: "Mirror horizontal and rotate 90 CW", 8: "Rotate 270 CW" }], [296, { 1: "None", 2: "inches", 3: "cm" }]]);
50792 var Ee = U(B, "exif", [[34850, { 0: "Not defined", 1: "Manual", 2: "Normal program", 3: "Aperture priority", 4: "Shutter priority", 5: "Creative program", 6: "Action program", 7: "Portrait mode", 8: "Landscape mode" }], [37121, { 0: "-", 1: "Y", 2: "Cb", 3: "Cr", 4: "R", 5: "G", 6: "B" }], [37383, { 0: "Unknown", 1: "Average", 2: "CenterWeightedAverage", 3: "Spot", 4: "MultiSpot", 5: "Pattern", 6: "Partial", 255: "Other" }], [37384, { 0: "Unknown", 1: "Daylight", 2: "Fluorescent", 3: "Tungsten (incandescent light)", 4: "Flash", 9: "Fine weather", 10: "Cloudy weather", 11: "Shade", 12: "Daylight fluorescent (D 5700 - 7100K)", 13: "Day white fluorescent (N 4600 - 5400K)", 14: "Cool white fluorescent (W 3900 - 4500K)", 15: "White fluorescent (WW 3200 - 3700K)", 17: "Standard light A", 18: "Standard light B", 19: "Standard light C", 20: "D55", 21: "D65", 22: "D75", 23: "D50", 24: "ISO studio tungsten", 255: "Other" }], [37385, { 0: "Flash did not fire", 1: "Flash fired", 5: "Strobe return light not detected", 7: "Strobe return light detected", 9: "Flash fired, compulsory flash mode", 13: "Flash fired, compulsory flash mode, return light not detected", 15: "Flash fired, compulsory flash mode, return light detected", 16: "Flash did not fire, compulsory flash mode", 24: "Flash did not fire, auto mode", 25: "Flash fired, auto mode", 29: "Flash fired, auto mode, return light not detected", 31: "Flash fired, auto mode, return light detected", 32: "No flash function", 65: "Flash fired, red-eye reduction mode", 69: "Flash fired, red-eye reduction mode, return light not detected", 71: "Flash fired, red-eye reduction mode, return light detected", 73: "Flash fired, compulsory flash mode, red-eye reduction mode", 77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected", 79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected", 89: "Flash fired, auto mode, red-eye reduction mode", 93: "Flash fired, auto mode, return light not detected, red-eye reduction mode", 95: "Flash fired, auto mode, return light detected, red-eye reduction mode" }], [41495, { 1: "Not defined", 2: "One-chip color area sensor", 3: "Two-chip color area sensor", 4: "Three-chip color area sensor", 5: "Color sequential area sensor", 7: "Trilinear sensor", 8: "Color sequential linear sensor" }], [41728, { 1: "Film Scanner", 2: "Reflection Print Scanner", 3: "Digital Camera" }], [41729, { 1: "Directly photographed" }], [41985, { 0: "Normal", 1: "Custom", 2: "HDR (no original saved)", 3: "HDR (original saved)", 4: "Original (for HDR)", 6: "Panorama", 7: "Portrait HDR", 8: "Portrait" }], [41986, { 0: "Auto", 1: "Manual", 2: "Auto bracket" }], [41987, { 0: "Auto", 1: "Manual" }], [41990, { 0: "Standard", 1: "Landscape", 2: "Portrait", 3: "Night", 4: "Other" }], [41991, { 0: "None", 1: "Low gain up", 2: "High gain up", 3: "Low gain down", 4: "High gain down" }], [41996, { 0: "Unknown", 1: "Macro", 2: "Close", 3: "Distant" }], [42080, { 0: "Unknown", 1: "Not a Composite Image", 2: "General Composite Image", 3: "Composite Image Captured While Shooting" }]]);
50793 var Be = { 1: "No absolute unit of measurement", 2: "Inch", 3: "Centimeter" };
50794 Ee.set(37392, Be), Ee.set(41488, Be);
50795 var Ne = { 0: "Normal", 1: "Low", 2: "High" };
50797 return "object" == typeof e3 && void 0 !== e3.length ? e3[0] : e3;
50800 let t2 = Array.from(e3).slice(1);
50801 return t2[1] > 15 && (t2 = t2.map((e4) => String.fromCharCode(e4))), "0" !== t2[2] && 0 !== t2[2] || t2.pop(), t2.join(".");
50804 if ("string" == typeof e3) {
50805 var [t2, i3, n3, s2, r2, a2] = e3.trim().split(/[-: ]/g).map(Number), o2 = new Date(t2, i3 - 1, n3);
50806 return Number.isNaN(s2) || Number.isNaN(r2) || Number.isNaN(a2) || (o2.setHours(s2), o2.setMinutes(r2), o2.setSeconds(a2)), Number.isNaN(+o2) ? e3 : o2;
50810 if ("string" == typeof e3)
50813 if (0 === e3[1] && 0 === e3[e3.length - 1])
50814 for (let i3 = 0; i3 < e3.length; i3 += 2)
50815 t2.push(je(e3[i3 + 1], e3[i3]));
50817 for (let i3 = 0; i3 < e3.length; i3 += 2)
50818 t2.push(je(e3[i3], e3[i3 + 1]));
50819 return m(String.fromCodePoint(...t2));
50821 function je(e3, t2) {
50822 return e3 << 8 | t2;
50824 Ee.set(41992, Ne), Ee.set(41993, Ne), Ee.set(41994, Ne), U(N, ["ifd0", "ifd1"], [[50827, function(e3) {
50825 return "string" != typeof e3 ? b(e3) : e3;
50826 }], [306, ze], [40091, He], [40092, He], [40093, He], [40094, He], [40095, He]]), U(N, "exif", [[40960, Ve], [36864, Ve], [36867, ze], [36868, ze], [40962, Ge], [40963, Ge]]), U(N, "gps", [[0, (e3) => Array.from(e3).join(".")], [7, (e3) => Array.from(e3).join(":")]]);
50827 var We = class extends re2 {
50828 static canHandle(e3, t2) {
50829 return 225 === e3.getUint8(t2 + 1) && 1752462448 === e3.getUint32(t2 + 4) && "http://ns.adobe.com/" === e3.getString(t2 + 4, "http://ns.adobe.com/".length);
50831 static headerLength(e3, t2) {
50832 return "http://ns.adobe.com/xmp/extension/" === e3.getString(t2 + 4, "http://ns.adobe.com/xmp/extension/".length) ? 79 : 4 + "http://ns.adobe.com/xap/1.0/".length + 1;
50834 static findPosition(e3, t2) {
50835 let i3 = super.findPosition(e3, t2);
50836 return i3.multiSegment = i3.extended = 79 === i3.headerLength, i3.multiSegment ? (i3.chunkCount = e3.getUint8(t2 + 72), i3.chunkNumber = e3.getUint8(t2 + 76), 0 !== e3.getUint8(t2 + 77) && i3.chunkNumber++) : (i3.chunkCount = 1 / 0, i3.chunkNumber = -1), i3;
50838 static handleMultiSegments(e3) {
50839 return e3.map((e4) => e4.chunk.getString()).join("");
50841 normalizeInput(e3) {
50842 return "string" == typeof e3 ? e3 : I.from(e3).getString();
50844 parse(e3 = this.chunk) {
50845 if (!this.localOptions.parse)
50847 e3 = function(e4) {
50848 let t3 = {}, i4 = {};
50850 t3[e6] = [], i4[e6] = 0;
50851 return e4.replace(et, (e6, n4, s2) => {
50854 return t3[s2].push(n5), `${e6}#${n5}`;
50856 return `${e6}#${t3[s2].pop()}`;
50859 let t2 = Xe.findAll(e3, "rdf", "Description");
50860 0 === t2.length && t2.push(new Xe("rdf", "Description", void 0, e3));
50863 for (let t3 of e4.properties)
50864 i3 = Je(t3.ns, n3), _e(t3, i3);
50865 return function(e4) {
50868 t3 = e4[i4] = f2(e4[i4]), void 0 === t3 && delete e4[i4];
50872 assignToOutput(e3, t2) {
50873 if (this.localOptions.parse)
50874 for (let [i3, n3] of Object.entries(t2))
50877 this.assignObjectToOutput(e3, "ifd0", n3);
50880 this.assignObjectToOutput(e3, "exif", n3);
50885 this.assignObjectToOutput(e3, i3, n3);
50891 c(We, "type", "xmp"), c(We, "multiSegment", true), T.set("xmp", We);
50892 var Ke = class _Ke {
50893 static findAll(e3) {
50894 return qe(e3, /([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(_Ke.unpackMatch);
50896 static unpackMatch(e3) {
50897 let t2 = e3[1], i3 = e3[2], n3 = e3[3].slice(1, -1);
50898 return n3 = Qe(n3), new _Ke(t2, i3, n3);
50900 constructor(e3, t2, i3) {
50901 this.ns = e3, this.name = t2, this.value = i3;
50907 var Xe = class _Xe {
50908 static findAll(e3, t2, i3) {
50909 if (void 0 !== t2 || void 0 !== i3) {
50910 t2 = t2 || "[\\w\\d-]+", i3 = i3 || "[\\w\\d-]+";
50911 var n3 = new RegExp(`<(${t2}):(${i3})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`, "gm");
50913 n3 = /<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;
50914 return qe(e3, n3).map(_Xe.unpackMatch);
50916 static unpackMatch(e3) {
50917 let t2 = e3[1], i3 = e3[2], n3 = e3[4], s2 = e3[8];
50918 return new _Xe(t2, i3, n3, s2);
50920 constructor(e3, t2, i3, n3) {
50921 this.ns = e3, this.name = t2, this.attrString = i3, this.innerXml = n3, this.attrs = Ke.findAll(i3), this.children = _Xe.findAll(n3), this.value = 0 === this.children.length ? Qe(n3) : void 0, this.properties = [...this.attrs, ...this.children];
50923 get isPrimitive() {
50924 return void 0 !== this.value && 0 === this.attrs.length && 0 === this.children.length;
50926 get isListContainer() {
50927 return 1 === this.children.length && this.children[0].isList;
50930 let { ns: e3, name: t2 } = this;
50931 return "rdf" === e3 && ("Seq" === t2 || "Bag" === t2 || "Alt" === t2);
50934 return "rdf" === this.ns && "li" === this.name;
50937 if (0 === this.properties.length && void 0 === this.value)
50939 if (this.isPrimitive)
50941 if (this.isListContainer)
50942 return this.children[0].serialize();
50944 return $e(this.children.map(Ye));
50945 if (this.isListItem && 1 === this.children.length && 0 === this.attrs.length)
50946 return this.children[0].serialize();
50948 for (let t2 of this.properties)
50950 return void 0 !== this.value && (e3.value = this.value), f2(e3);
50953 function _e(e3, t2) {
50954 let i3 = e3.serialize();
50955 void 0 !== i3 && (t2[e3.name] = i3);
50957 var Ye = (e3) => e3.serialize();
50958 var $e = (e3) => 1 === e3.length ? e3[0] : e3;
50959 var Je = (e3, t2) => t2[e3] ? t2[e3] : t2[e3] = {};
50960 function qe(e3, t2) {
50964 for (; null !== (i3 = t2.exec(e3)); )
50970 return null == e4 || "null" === e4 || "undefined" === e4 || "" === e4 || "" === e4.trim();
50973 let t2 = Number(e3);
50974 if (!Number.isNaN(t2))
50976 let i3 = e3.toLowerCase();
50977 return "true" === i3 || "false" !== i3 && e3.trim();
50979 var Ze = ["rdf:li", "rdf:Seq", "rdf:Bag", "rdf:Alt", "rdf:Description"];
50980 var et = new RegExp(`(<|\\/)(${Ze.join("|")})`, "g");
50981 var tt = Object.freeze({ __proto__: null, default: Me, Exifr: te, fileParsers: w, segmentParsers: T, fileReaders: A, tagKeys: E, tagValues: B, tagRevivers: N, createDictionary: U, extendDictionary: F, fetchUrlAsArrayBuffer: M, readBlobAsArrayBuffer: R, chunkedProps: G, otherSegments: V, segments: z, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W, inheritables: K, allFormatters: X, Options: q, parse: ie, gpsOnlyOptions: me, gps: Se, thumbnailOnlyOptions: Ce, thumbnail: ye, thumbnailUrl: be, orientationOnlyOptions: Ie, orientation: Pe, rotations: ke, get rotateCanvas() {
50983 }, get rotateCss() {
50985 }, rotation: Ae });
50986 var at = l("fs", (e3) => e3.promises);
50987 A.set("fs", class extends ve {
50988 async readWhole() {
50989 this.chunked = false, this.fs = await at;
50990 let e3 = await this.fs.readFile(this.input);
50991 this._swapBuffer(e3);
50993 async readChunked() {
50994 this.chunked = true, this.fs = await at, await this.open(), await this.readChunk(0, this.options.firstChunkSize);
50997 void 0 === this.fh && (this.fh = await this.fs.open(this.input, "r"), this.size = (await this.fh.stat(this.input)).size);
50999 async _readChunk(e3, t2) {
51000 void 0 === this.fh && await this.open(), e3 + t2 > this.size && (t2 = this.size - e3);
51001 var i3 = this.subarray(e3, t2, true);
51002 return await this.fh.read(i3.dataView, 0, t2, e3), i3;
51007 this.fh = void 0, await e3.close();
51011 A.set("base64", class extends ve {
51012 constructor(...e3) {
51013 super(...e3), this.input = this.input.replace(/^data:([^;]+);base64,/gim, ""), this.size = this.input.length / 4 * 3, this.input.endsWith("==") ? this.size -= 2 : this.input.endsWith("=") && (this.size -= 1);
51015 async _readChunk(e3, t2) {
51016 let i3, n3, r2 = this.input;
51017 void 0 === e3 ? (e3 = 0, i3 = 0, n3 = 0) : (i3 = 4 * Math.floor(e3 / 3), n3 = e3 - i3 / 4 * 3), void 0 === t2 && (t2 = this.size);
51018 let o2 = e3 + t2, l2 = i3 + 4 * Math.ceil(o2 / 3);
51019 r2 = r2.slice(i3, l2);
51020 let h2 = Math.min(t2, this.size - e3);
51022 let t3 = s.from(r2, "base64").slice(n3, n3 + h2);
51023 return this.set(t3, e3, true);
51026 let t3 = this.subarray(e3, h2, true), i4 = atob(r2), s2 = t3.toUint8();
51027 for (let e4 = 0; e4 < h2; e4++)
51028 s2[e4] = i4.charCodeAt(n3 + e4);
51033 var ot = class extends se {
51034 static canHandle(e3, t2) {
51035 return 18761 === t2 || 19789 === t2;
51037 extendOptions(e3) {
51038 let { ifd0: t2, xmp: i3, iptc: n3, icc: s2 } = e3;
51039 i3.enabled && t2.deps.add(700), n3.enabled && t2.deps.add(33723), s2.enabled && t2.deps.add(34675), t2.finalizeFilters();
51042 let { tiff: e3, xmp: t2, iptc: i3, icc: n3 } = this.options;
51043 if (e3.enabled || t2.enabled || i3.enabled || n3.enabled) {
51044 let e4 = Math.max(S(this.options), this.options.chunkSize);
51045 await this.file.ensureChunk(0, e4), this.createParser("tiff", this.file), this.parsers.tiff.parseHeader(), await this.parsers.tiff.parseIfd0Block(), this.adaptTiffPropAsSegment("xmp"), this.adaptTiffPropAsSegment("iptc"), this.adaptTiffPropAsSegment("icc");
51048 adaptTiffPropAsSegment(e3) {
51049 if (this.parsers.tiff[e3]) {
51050 let t2 = this.parsers.tiff[e3];
51051 this.injectSegment(e3, t2);
51055 c(ot, "type", "tiff"), w.set("tiff", ot);
51056 var lt = l("zlib");
51057 var ht = ["ihdr", "iccp", "text", "itxt", "exif"];
51058 var ut = class extends se {
51059 constructor(...e3) {
51060 super(...e3), c(this, "catchError", (e4) => this.errors.push(e4)), c(this, "metaChunks", []), c(this, "unknownChunks", []);
51062 static canHandle(e3, t2) {
51063 return 35152 === t2 && 2303741511 === e3.getUint32(0) && 218765834 === e3.getUint32(4);
51066 let { file: e3 } = this;
51067 await this.findPngChunksInRange("\x89PNG\r\n
\1a\n".length, e3.byteLength), await this.readSegments(this.metaChunks), this.findIhdr(), this.parseTextChunks(), await this.findExif().catch(this.catchError), await this.findXmp().catch(this.catchError), await this.findIcc().catch(this.catchError);
51069 async findPngChunksInRange(e3, t2) {
51070 let { file: i3 } = this;
51071 for (; e3 < t2; ) {
51072 let t3 = i3.getUint32(e3), n3 = i3.getUint32(e3 + 4), s2 = i3.getString(e3 + 4, 4).toLowerCase(), r2 = t3 + 4 + 4 + 4, a2 = { type: s2, offset: e3, length: r2, start: e3 + 4 + 4, size: t3, marker: n3 };
51073 ht.includes(s2) ? this.metaChunks.push(a2) : this.unknownChunks.push(a2), e3 += r2;
51076 parseTextChunks() {
51077 let e3 = this.metaChunks.filter((e4) => "text" === e4.type);
51078 for (let t2 of e3) {
51079 let [e4, i3] = this.file.getString(t2.start, t2.size).split("\0");
51080 this.injectKeyValToIhdr(e4, i3);
51083 injectKeyValToIhdr(e3, t2) {
51084 let i3 = this.parsers.ihdr;
51085 i3 && i3.raw.set(e3, t2);
51088 let e3 = this.metaChunks.find((e4) => "ihdr" === e4.type);
51089 e3 && false !== this.options.ihdr.enabled && this.createParser("ihdr", e3.chunk);
51092 let e3 = this.metaChunks.find((e4) => "exif" === e4.type);
51093 e3 && this.injectSegment("tiff", e3.chunk);
51096 let e3 = this.metaChunks.filter((e4) => "itxt" === e4.type);
51097 for (let t2 of e3) {
51098 "XML:com.adobe.xmp" === t2.chunk.getString(0, "XML:com.adobe.xmp".length) && this.injectSegment("xmp", t2.chunk);
51102 let e3 = this.metaChunks.find((e4) => "iccp" === e4.type);
51105 let { chunk: t2 } = e3, i3 = t2.getUint8Array(0, 81), s2 = 0;
51106 for (; s2 < 80 && 0 !== i3[s2]; )
51108 let r2 = s2 + 2, a2 = t2.getString(0, s2);
51109 if (this.injectKeyValToIhdr("ProfileName", a2), n2) {
51110 let e4 = await lt, i4 = t2.getUint8Array(r2);
51111 i4 = e4.inflateSync(i4), this.injectSegment("icc", i4);
51115 c(ut, "type", "png"), w.set("png", ut), U(E, "interop", [[1, "InteropIndex"], [2, "InteropVersion"], [4096, "RelatedImageFileFormat"], [4097, "RelatedImageWidth"], [4098, "RelatedImageHeight"]]), F(E, "ifd0", [[11, "ProcessingSoftware"], [254, "SubfileType"], [255, "OldSubfileType"], [263, "Thresholding"], [264, "CellWidth"], [265, "CellLength"], [266, "FillOrder"], [269, "DocumentName"], [280, "MinSampleValue"], [281, "MaxSampleValue"], [285, "PageName"], [286, "XPosition"], [287, "YPosition"], [290, "GrayResponseUnit"], [297, "PageNumber"], [321, "HalftoneHints"], [322, "TileWidth"], [323, "TileLength"], [332, "InkSet"], [337, "TargetPrinter"], [18246, "Rating"], [18249, "RatingPercent"], [33550, "PixelScale"], [34264, "ModelTransform"], [34377, "PhotoshopSettings"], [50706, "DNGVersion"], [50707, "DNGBackwardVersion"], [50708, "UniqueCameraModel"], [50709, "LocalizedCameraModel"], [50736, "DNGLensInfo"], [50739, "ShadowScale"], [50740, "DNGPrivateData"], [33920, "IntergraphMatrix"], [33922, "ModelTiePoint"], [34118, "SEMInfo"], [34735, "GeoTiffDirectory"], [34736, "GeoTiffDoubleParams"], [34737, "GeoTiffAsciiParams"], [50341, "PrintIM"], [50721, "ColorMatrix1"], [50722, "ColorMatrix2"], [50723, "CameraCalibration1"], [50724, "CameraCalibration2"], [50725, "ReductionMatrix1"], [50726, "ReductionMatrix2"], [50727, "AnalogBalance"], [50728, "AsShotNeutral"], [50729, "AsShotWhiteXY"], [50730, "BaselineExposure"], [50731, "BaselineNoise"], [50732, "BaselineSharpness"], [50734, "LinearResponseLimit"], [50735, "CameraSerialNumber"], [50741, "MakerNoteSafety"], [50778, "CalibrationIlluminant1"], [50779, "CalibrationIlluminant2"], [50781, "RawDataUniqueID"], [50827, "OriginalRawFileName"], [50828, "OriginalRawFileData"], [50831, "AsShotICCProfile"], [50832, "AsShotPreProfileMatrix"], [50833, "CurrentICCProfile"], [50834, "CurrentPreProfileMatrix"], [50879, "ColorimetricReference"], [50885, "SRawType"], [50898, "PanasonicTitle"], [50899, "PanasonicTitle2"], [50931, "CameraCalibrationSig"], [50932, "ProfileCalibrationSig"], [50933, "ProfileIFD"], [50934, "AsShotProfileName"], [50936, "ProfileName"], [50937, "ProfileHueSatMapDims"], [50938, "ProfileHueSatMapData1"], [50939, "ProfileHueSatMapData2"], [50940, "ProfileToneCurve"], [50941, "ProfileEmbedPolicy"], [50942, "ProfileCopyright"], [50964, "ForwardMatrix1"], [50965, "ForwardMatrix2"], [50966, "PreviewApplicationName"], [50967, "PreviewApplicationVersion"], [50968, "PreviewSettingsName"], [50969, "PreviewSettingsDigest"], [50970, "PreviewColorSpace"], [50971, "PreviewDateTime"], [50972, "RawImageDigest"], [50973, "OriginalRawFileDigest"], [50981, "ProfileLookTableDims"], [50982, "ProfileLookTableData"], [51043, "TimeCodes"], [51044, "FrameRate"], [51058, "TStop"], [51081, "ReelName"], [51089, "OriginalDefaultFinalSize"], [51090, "OriginalBestQualitySize"], [51091, "OriginalDefaultCropSize"], [51105, "CameraLabel"], [51107, "ProfileHueSatMapEncoding"], [51108, "ProfileLookTableEncoding"], [51109, "BaselineExposureOffset"], [51110, "DefaultBlackRender"], [51111, "NewRawImageDigest"], [51112, "RawToPreviewGain"]]);
51116 var ct = [[273, "StripOffsets"], [279, "StripByteCounts"], [288, "FreeOffsets"], [289, "FreeByteCounts"], [291, "GrayResponseCurve"], [292, "T4Options"], [293, "T6Options"], [300, "ColorResponseUnit"], [320, "ColorMap"], [324, "TileOffsets"], [325, "TileByteCounts"], [326, "BadFaxLines"], [327, "CleanFaxData"], [328, "ConsecutiveBadFaxLines"], [330, "SubIFD"], [333, "InkNames"], [334, "NumberofInks"], [336, "DotRange"], [338, "ExtraSamples"], [339, "SampleFormat"], [340, "SMinSampleValue"], [341, "SMaxSampleValue"], [342, "TransferRange"], [343, "ClipPath"], [344, "XClipPathUnits"], [345, "YClipPathUnits"], [346, "Indexed"], [347, "JPEGTables"], [351, "OPIProxy"], [400, "GlobalParametersIFD"], [401, "ProfileType"], [402, "FaxProfile"], [403, "CodingMethods"], [404, "VersionYear"], [405, "ModeNumber"], [433, "Decode"], [434, "DefaultImageColor"], [435, "T82Options"], [437, "JPEGTables"], [512, "JPEGProc"], [515, "JPEGRestartInterval"], [517, "JPEGLosslessPredictors"], [518, "JPEGPointTransforms"], [519, "JPEGQTables"], [520, "JPEGDCTables"], [521, "JPEGACTables"], [559, "StripRowCounts"], [999, "USPTOMiscellaneous"], [18247, "XP_DIP_XML"], [18248, "StitchInfo"], [28672, "SonyRawFileType"], [28688, "SonyToneCurve"], [28721, "VignettingCorrection"], [28722, "VignettingCorrParams"], [28724, "ChromaticAberrationCorrection"], [28725, "ChromaticAberrationCorrParams"], [28726, "DistortionCorrection"], [28727, "DistortionCorrParams"], [29895, "SonyCropTopLeft"], [29896, "SonyCropSize"], [32781, "ImageID"], [32931, "WangTag1"], [32932, "WangAnnotation"], [32933, "WangTag3"], [32934, "WangTag4"], [32953, "ImageReferencePoints"], [32954, "RegionXformTackPoint"], [32955, "WarpQuadrilateral"], [32956, "AffineTransformMat"], [32995, "Matteing"], [32996, "DataType"], [32997, "ImageDepth"], [32998, "TileDepth"], [33300, "ImageFullWidth"], [33301, "ImageFullHeight"], [33302, "TextureFormat"], [33303, "WrapModes"], [33304, "FovCot"], [33305, "MatrixWorldToScreen"], [33306, "MatrixWorldToCamera"], [33405, "Model2"], [33421, "CFARepeatPatternDim"], [33422, "CFAPattern2"], [33423, "BatteryLevel"], [33424, "KodakIFD"], [33445, "MDFileTag"], [33446, "MDScalePixel"], [33447, "MDColorTable"], [33448, "MDLabName"], [33449, "MDSampleInfo"], [33450, "MDPrepDate"], [33451, "MDPrepTime"], [33452, "MDFileUnits"], [33589, "AdventScale"], [33590, "AdventRevision"], [33628, "UIC1Tag"], [33629, "UIC2Tag"], [33630, "UIC3Tag"], [33631, "UIC4Tag"], [33918, "IntergraphPacketData"], [33919, "IntergraphFlagRegisters"], [33921, "INGRReserved"], [34016, "Site"], [34017, "ColorSequence"], [34018, "IT8Header"], [34019, "RasterPadding"], [34020, "BitsPerRunLength"], [34021, "BitsPerExtendedRunLength"], [34022, "ColorTable"], [34023, "ImageColorIndicator"], [34024, "BackgroundColorIndicator"], [34025, "ImageColorValue"], [34026, "BackgroundColorValue"], [34027, "PixelIntensityRange"], [34028, "TransparencyIndicator"], [34029, "ColorCharacterization"], [34030, "HCUsage"], [34031, "TrapIndicator"], [34032, "CMYKEquivalent"], [34152, "AFCP_IPTC"], [34232, "PixelMagicJBIGOptions"], [34263, "JPLCartoIFD"], [34306, "WB_GRGBLevels"], [34310, "LeafData"], [34687, "TIFF_FXExtensions"], [34688, "MultiProfiles"], [34689, "SharedData"], [34690, "T88Options"], [34732, "ImageLayer"], [34750, "JBIGOptions"], [34856, "Opto-ElectricConvFactor"], [34857, "Interlace"], [34908, "FaxRecvParams"], [34909, "FaxSubAddress"], [34910, "FaxRecvTime"], [34929, "FedexEDR"], [34954, "LeafSubIFD"], [37387, "FlashEnergy"], [37388, "SpatialFrequencyResponse"], [37389, "Noise"], [37390, "FocalPlaneXResolution"], [37391, "FocalPlaneYResolution"], [37392, "FocalPlaneResolutionUnit"], [37397, "ExposureIndex"], [37398, "TIFF-EPStandardID"], [37399, "SensingMethod"], [37434, "CIP3DataFile"], [37435, "CIP3Sheet"], [37436, "CIP3Side"], [37439, "StoNits"], [37679, "MSDocumentText"], [37680, "MSPropertySetStorage"], [37681, "MSDocumentTextPosition"], [37724, "ImageSourceData"], [40965, "InteropIFD"], [40976, "SamsungRawPointersOffset"], [40977, "SamsungRawPointersLength"], [41217, "SamsungRawByteOrder"], [41218, "SamsungRawUnknown"], [41484, "SpatialFrequencyResponse"], [41485, "Noise"], [41489, "ImageNumber"], [41490, "SecurityClassification"], [41491, "ImageHistory"], [41494, "TIFF-EPStandardID"], [41995, "DeviceSettingDescription"], [42112, "GDALMetadata"], [42113, "GDALNoData"], [44992, "ExpandSoftware"], [44993, "ExpandLens"], [44994, "ExpandFilm"], [44995, "ExpandFilterLens"], [44996, "ExpandScanner"], [44997, "ExpandFlashLamp"], [46275, "HasselbladRawImage"], [48129, "PixelFormat"], [48130, "Transformation"], [48131, "Uncompressed"], [48132, "ImageType"], [48256, "ImageWidth"], [48257, "ImageHeight"], [48258, "WidthResolution"], [48259, "HeightResolution"], [48320, "ImageOffset"], [48321, "ImageByteCount"], [48322, "AlphaOffset"], [48323, "AlphaByteCount"], [48324, "ImageDataDiscard"], [48325, "AlphaDataDiscard"], [50215, "OceScanjobDesc"], [50216, "OceApplicationSelector"], [50217, "OceIDNumber"], [50218, "OceImageLogic"], [50255, "Annotations"], [50459, "HasselbladExif"], [50547, "OriginalFileName"], [50560, "USPTOOriginalContentType"], [50656, "CR2CFAPattern"], [50710, "CFAPlaneColor"], [50711, "CFALayout"], [50712, "LinearizationTable"], [50713, "BlackLevelRepeatDim"], [50714, "BlackLevel"], [50715, "BlackLevelDeltaH"], [50716, "BlackLevelDeltaV"], [50717, "WhiteLevel"], [50718, "DefaultScale"], [50719, "DefaultCropOrigin"], [50720, "DefaultCropSize"], [50733, "BayerGreenSplit"], [50737, "ChromaBlurRadius"], [50738, "AntiAliasStrength"], [50752, "RawImageSegmentation"], [50780, "BestQualityScale"], [50784, "AliasLayerMetadata"], [50829, "ActiveArea"], [50830, "MaskedAreas"], [50935, "NoiseReductionApplied"], [50974, "SubTileBlockSize"], [50975, "RowInterleaveFactor"], [51008, "OpcodeList1"], [51009, "OpcodeList2"], [51022, "OpcodeList3"], [51041, "NoiseProfile"], [51114, "CacheVersion"], [51125, "DefaultUserCrop"], [51157, "NikonNEFInfo"], [65024, "KdcIFD"]];
51117 F(E, "ifd0", ct), F(E, "exif", ct), U(B, "gps", [[23, { M: "Magnetic North", T: "True North" }], [25, { K: "Kilometers", M: "Miles", N: "Nautical Miles" }]]);
51118 var ft = class extends re2 {
51119 static canHandle(e3, t2) {
51120 return 224 === e3.getUint8(t2 + 1) && 1246120262 === e3.getUint32(t2 + 4) && 0 === e3.getUint8(t2 + 8);
51123 return this.parseTags(), this.translate(), this.output;
51126 this.raw = /* @__PURE__ */ new Map([[0, this.chunk.getUint16(0)], [2, this.chunk.getUint8(2)], [3, this.chunk.getUint16(3)], [5, this.chunk.getUint16(5)], [7, this.chunk.getUint8(7)], [8, this.chunk.getUint8(8)]]);
51129 c(ft, "type", "jfif"), c(ft, "headerLength", 9), T.set("jfif", ft), U(E, "jfif", [[0, "JFIFVersion"], [2, "ResolutionUnit"], [3, "XResolution"], [5, "YResolution"], [7, "ThumbnailWidth"], [8, "ThumbnailHeight"]]);
51130 var dt = class extends re2 {
51132 return this.parseTags(), this.translate(), this.output;
51135 this.raw = new Map([[0, this.chunk.getUint32(0)], [4, this.chunk.getUint32(4)], [8, this.chunk.getUint8(8)], [9, this.chunk.getUint8(9)], [10, this.chunk.getUint8(10)], [11, this.chunk.getUint8(11)], [12, this.chunk.getUint8(12)], ...Array.from(this.raw)]);
51138 c(dt, "type", "ihdr"), T.set("ihdr", dt), U(E, "ihdr", [[0, "ImageWidth"], [4, "ImageHeight"], [8, "BitDepth"], [9, "ColorType"], [10, "Compression"], [11, "Filter"], [12, "Interlace"]]), U(B, "ihdr", [[9, { 0: "Grayscale", 2: "RGB", 3: "Palette", 4: "Grayscale with Alpha", 6: "RGB with Alpha", DEFAULT: "Unknown" }], [10, { 0: "Deflate/Inflate", DEFAULT: "Unknown" }], [11, { 0: "Adaptive", DEFAULT: "Unknown" }], [12, { 0: "Noninterlaced", 1: "Adam7 Interlace", DEFAULT: "Unknown" }]]);
51139 var pt = class extends re2 {
51140 static canHandle(e3, t2) {
51141 return 226 === e3.getUint8(t2 + 1) && 1229144927 === e3.getUint32(t2 + 4);
51143 static findPosition(e3, t2) {
51144 let i3 = super.findPosition(e3, t2);
51145 return i3.chunkNumber = e3.getUint8(t2 + 16), i3.chunkCount = e3.getUint8(t2 + 17), i3.multiSegment = i3.chunkCount > 1, i3;
51147 static handleMultiSegments(e3) {
51148 return function(e4) {
51149 let t2 = function(e6) {
51150 let t3 = e6[0].constructor, i3 = 0;
51153 let n3 = new t3(i3), s2 = 0;
51155 n3.set(t4, s2), s2 += t4.length;
51157 }(e4.map((e6) => e6.chunk.toUint8()));
51162 return this.raw = /* @__PURE__ */ new Map(), this.parseHeader(), this.parseTags(), this.translate(), this.output;
51165 let { raw: e3 } = this;
51166 this.chunk.byteLength < 84 && g2("ICC header is too short");
51167 for (let [t2, i3] of Object.entries(gt)) {
51168 t2 = parseInt(t2, 10);
51169 let n3 = i3(this.chunk, t2);
51170 "\0\0\0\0" !== n3 && e3.set(t2, n3);
51174 let e3, t2, i3, n3, s2, { raw: r2 } = this, a2 = this.chunk.getUint32(128), o2 = 132, l2 = this.chunk.byteLength;
51176 if (e3 = this.chunk.getString(o2, 4), t2 = this.chunk.getUint32(o2 + 4), i3 = this.chunk.getUint32(o2 + 8), n3 = this.chunk.getString(t2, 4), t2 + i3 > l2)
51177 return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");
51178 s2 = this.parseTag(n3, t2, i3), void 0 !== s2 && "\0\0\0\0" !== s2 && r2.set(e3, s2), o2 += 12;
51181 parseTag(e3, t2, i3) {
51184 return this.parseDesc(t2);
51186 return this.parseMluc(t2);
51188 return this.parseText(t2, i3);
51190 return this.parseSig(t2);
51192 if (!(t2 + i3 > this.chunk.byteLength))
51193 return this.chunk.getUint8Array(t2, i3);
51196 let t2 = this.chunk.getUint32(e3 + 8) - 1;
51197 return m(this.chunk.getString(e3 + 12, t2));
51199 parseText(e3, t2) {
51200 return m(this.chunk.getString(e3 + 8, t2 - 8));
51203 return m(this.chunk.getString(e3 + 8, 4));
51206 let { chunk: t2 } = this, i3 = t2.getUint32(e3 + 8), n3 = t2.getUint32(e3 + 12), s2 = e3 + 16, r2 = [];
51207 for (let a2 = 0; a2 < i3; a2++) {
51208 let i4 = t2.getString(s2 + 0, 2), a3 = t2.getString(s2 + 2, 2), o2 = t2.getUint32(s2 + 4), l2 = t2.getUint32(s2 + 8) + e3, h2 = m(t2.getUnicodeString(l2, o2));
51209 r2.push({ lang: i4, country: a3, text: h2 }), s2 += n3;
51211 return 1 === i3 ? r2[0].text : r2;
51213 translateValue(e3, t2) {
51214 return "string" == typeof e3 ? t2[e3] || t2[e3.toLowerCase()] || e3 : t2[e3] || e3;
51217 c(pt, "type", "icc"), c(pt, "multiSegment", true), c(pt, "headerLength", 18);
51218 var gt = { 4: mt, 8: function(e3, t2) {
51219 return [e3.getUint8(t2), e3.getUint8(t2 + 1) >> 4, e3.getUint8(t2 + 1) % 16].map((e4) => e4.toString(10)).join(".");
51220 }, 12: mt, 16: mt, 20: mt, 24: function(e3, t2) {
51221 const i3 = e3.getUint16(t2), n3 = e3.getUint16(t2 + 2) - 1, s2 = e3.getUint16(t2 + 4), r2 = e3.getUint16(t2 + 6), a2 = e3.getUint16(t2 + 8), o2 = e3.getUint16(t2 + 10);
51222 return new Date(Date.UTC(i3, n3, s2, r2, a2, o2));
51223 }, 36: mt, 40: mt, 48: mt, 52: mt, 64: (e3, t2) => e3.getUint32(t2), 80: mt };
51224 function mt(e3, t2) {
51225 return m(e3.getString(t2, 4));
51227 T.set("icc", pt), U(E, "icc", [[4, "ProfileCMMType"], [8, "ProfileVersion"], [12, "ProfileClass"], [16, "ColorSpaceData"], [20, "ProfileConnectionSpace"], [24, "ProfileDateTime"], [36, "ProfileFileSignature"], [40, "PrimaryPlatform"], [44, "CMMFlags"], [48, "DeviceManufacturer"], [52, "DeviceModel"], [56, "DeviceAttributes"], [64, "RenderingIntent"], [68, "ConnectionSpaceIlluminant"], [80, "ProfileCreator"], [84, "ProfileID"], ["Header", "ProfileHeader"], ["MS00", "WCSProfiles"], ["bTRC", "BlueTRC"], ["bXYZ", "BlueMatrixColumn"], ["bfd", "UCRBG"], ["bkpt", "MediaBlackPoint"], ["calt", "CalibrationDateTime"], ["chad", "ChromaticAdaptation"], ["chrm", "Chromaticity"], ["ciis", "ColorimetricIntentImageState"], ["clot", "ColorantTableOut"], ["clro", "ColorantOrder"], ["clrt", "ColorantTable"], ["cprt", "ProfileCopyright"], ["crdi", "CRDInfo"], ["desc", "ProfileDescription"], ["devs", "DeviceSettings"], ["dmdd", "DeviceModelDesc"], ["dmnd", "DeviceMfgDesc"], ["dscm", "ProfileDescriptionML"], ["fpce", "FocalPlaneColorimetryEstimates"], ["gTRC", "GreenTRC"], ["gXYZ", "GreenMatrixColumn"], ["gamt", "Gamut"], ["kTRC", "GrayTRC"], ["lumi", "Luminance"], ["meas", "Measurement"], ["meta", "Metadata"], ["mmod", "MakeAndModel"], ["ncl2", "NamedColor2"], ["ncol", "NamedColor"], ["ndin", "NativeDisplayInfo"], ["pre0", "Preview0"], ["pre1", "Preview1"], ["pre2", "Preview2"], ["ps2i", "PS2RenderingIntent"], ["ps2s", "PostScript2CSA"], ["psd0", "PostScript2CRD0"], ["psd1", "PostScript2CRD1"], ["psd2", "PostScript2CRD2"], ["psd3", "PostScript2CRD3"], ["pseq", "ProfileSequenceDesc"], ["psid", "ProfileSequenceIdentifier"], ["psvm", "PS2CRDVMSize"], ["rTRC", "RedTRC"], ["rXYZ", "RedMatrixColumn"], ["resp", "OutputResponse"], ["rhoc", "ReflectionHardcopyOrigColorimetry"], ["rig0", "PerceptualRenderingIntentGamut"], ["rig2", "SaturationRenderingIntentGamut"], ["rpoc", "ReflectionPrintOutputColorimetry"], ["sape", "SceneAppearanceEstimates"], ["scoe", "SceneColorimetryEstimates"], ["scrd", "ScreeningDesc"], ["scrn", "Screening"], ["targ", "CharTarget"], ["tech", "Technology"], ["vcgt", "VideoCardGamma"], ["view", "ViewingConditions"], ["vued", "ViewingCondDesc"], ["wtpt", "MediaWhitePoint"]]);
51228 var St = { "4d2p": "Erdt Systems", AAMA: "Aamazing Technologies", ACER: "Acer", ACLT: "Acolyte Color Research", ACTI: "Actix Sytems", ADAR: "Adara Technology", ADBE: "Adobe", ADI: "ADI Systems", AGFA: "Agfa Graphics", ALMD: "Alps Electric", ALPS: "Alps Electric", ALWN: "Alwan Color Expertise", AMTI: "Amiable Technologies", AOC: "AOC International", APAG: "Apago", APPL: "Apple Computer", AST: "AST", "AT&T": "AT&T", BAEL: "BARBIERI electronic", BRCO: "Barco NV", BRKP: "Breakpoint", BROT: "Brother", BULL: "Bull", BUS: "Bus Computer Systems", "C-IT": "C-Itoh", CAMR: "Intel", CANO: "Canon", CARR: "Carroll Touch", CASI: "Casio", CBUS: "Colorbus PL", CEL: "Crossfield", CELx: "Crossfield", CGS: "CGS Publishing Technologies International", CHM: "Rochester Robotics", CIGL: "Colour Imaging Group, London", CITI: "Citizen", CL00: "Candela", CLIQ: "Color IQ", CMCO: "Chromaco", CMiX: "CHROMiX", COLO: "Colorgraphic Communications", COMP: "Compaq", COMp: "Compeq/Focus Technology", CONR: "Conrac Display Products", CORD: "Cordata Technologies", CPQ: "Compaq", CPRO: "ColorPro", CRN: "Cornerstone", CTX: "CTX International", CVIS: "ColorVision", CWC: "Fujitsu Laboratories", DARI: "Darius Technology", DATA: "Dataproducts", DCP: "Dry Creek Photo", DCRC: "Digital Contents Resource Center, Chung-Ang University", DELL: "Dell Computer", DIC: "Dainippon Ink and Chemicals", DICO: "Diconix", DIGI: "Digital", "DL&C": "Digital Light & Color", DPLG: "Doppelganger", DS: "Dainippon Screen", DSOL: "DOOSOL", DUPN: "DuPont", EPSO: "Epson", ESKO: "Esko-Graphics", ETRI: "Electronics and Telecommunications Research Institute", EVER: "Everex Systems", EXAC: "ExactCODE", Eizo: "Eizo", FALC: "Falco Data Products", FF: "Fuji Photo Film", FFEI: "FujiFilm Electronic Imaging", FNRD: "Fnord Software", FORA: "Fora", FORE: "Forefront Technology", FP: "Fujitsu", FPA: "WayTech Development", FUJI: "Fujitsu", FX: "Fuji Xerox", GCC: "GCC Technologies", GGSL: "Global Graphics Software", GMB: "Gretagmacbeth", GMG: "GMG", GOLD: "GoldStar Technology", GOOG: "Google", GPRT: "Giantprint", GTMB: "Gretagmacbeth", GVC: "WayTech Development", GW2K: "Sony", HCI: "HCI", HDM: "Heidelberger Druckmaschinen", HERM: "Hermes", HITA: "Hitachi America", HP: "Hewlett-Packard", HTC: "Hitachi", HiTi: "HiTi Digital", IBM: "IBM", IDNT: "Scitex", IEC: "Hewlett-Packard", IIYA: "Iiyama North America", IKEG: "Ikegami Electronics", IMAG: "Image Systems", IMI: "Ingram Micro", INTC: "Intel", INTL: "N/A (INTL)", INTR: "Intra Electronics", IOCO: "Iocomm International Technology", IPS: "InfoPrint Solutions Company", IRIS: "Scitex", ISL: "Ichikawa Soft Laboratory", ITNL: "N/A (ITNL)", IVM: "IVM", IWAT: "Iwatsu Electric", Idnt: "Scitex", Inca: "Inca Digital Printers", Iris: "Scitex", JPEG: "Joint Photographic Experts Group", JSFT: "Jetsoft Development", JVC: "JVC Information Products", KART: "Scitex", KFC: "KFC Computek Components", KLH: "KLH Computers", KMHD: "Konica Minolta", KNCA: "Konica", KODA: "Kodak", KYOC: "Kyocera", Kart: "Scitex", LCAG: "Leica", LCCD: "Leeds Colour", LDAK: "Left Dakota", LEAD: "Leading Technology", LEXM: "Lexmark International", LINK: "Link Computer", LINO: "Linotronic", LITE: "Lite-On", Leaf: "Leaf", Lino: "Linotronic", MAGC: "Mag Computronic", MAGI: "MAG Innovision", MANN: "Mannesmann", MICN: "Micron Technology", MICR: "Microtek", MICV: "Microvitec", MINO: "Minolta", MITS: "Mitsubishi Electronics America", MITs: "Mitsuba", MNLT: "Minolta", MODG: "Modgraph", MONI: "Monitronix", MONS: "Monaco Systems", MORS: "Morse Technology", MOTI: "Motive Systems", MSFT: "Microsoft", MUTO: "MUTOH INDUSTRIES", Mits: "Mitsubishi Electric", NANA: "NANAO", NEC: "NEC", NEXP: "NexPress Solutions", NISS: "Nissei Sangyo America", NKON: "Nikon", NONE: "none", OCE: "Oce Technologies", OCEC: "OceColor", OKI: "Oki", OKID: "Okidata", OKIP: "Okidata", OLIV: "Olivetti", OLYM: "Olympus", ONYX: "Onyx Graphics", OPTI: "Optiquest", PACK: "Packard Bell", PANA: "Matsushita Electric Industrial", PANT: "Pantone", PBN: "Packard Bell", PFU: "PFU", PHIL: "Philips Consumer Electronics", PNTX: "HOYA", POne: "Phase One A/S", PREM: "Premier Computer Innovations", PRIN: "Princeton Graphic Systems", PRIP: "Princeton Publishing Labs", QLUX: "Hong Kong", QMS: "QMS", QPCD: "QPcard AB", QUAD: "QuadLaser", QUME: "Qume", RADI: "Radius", RDDx: "Integrated Color Solutions", RDG: "Roland DG", REDM: "REDMS Group", RELI: "Relisys", RGMS: "Rolf Gierling Multitools", RICO: "Ricoh", RNLD: "Edmund Ronald", ROYA: "Royal", RPC: "Ricoh Printing Systems", RTL: "Royal Information Electronics", SAMP: "Sampo", SAMS: "Samsung", SANT: "Jaime Santana Pomares", SCIT: "Scitex", SCRN: "Dainippon Screen", SDP: "Scitex", SEC: "Samsung", SEIK: "Seiko Instruments", SEIk: "Seikosha", SGUY: "ScanGuy.com", SHAR: "Sharp Laboratories", SICC: "International Color Consortium", SONY: "Sony", SPCL: "SpectraCal", STAR: "Star", STC: "Sampo Technology", Scit: "Scitex", Sdp: "Scitex", Sony: "Sony", TALO: "Talon Technology", TAND: "Tandy", TATU: "Tatung", TAXA: "TAXAN America", TDS: "Tokyo Denshi Sekei", TECO: "TECO Information Systems", TEGR: "Tegra", TEKT: "Tektronix", TI: "Texas Instruments", TMKR: "TypeMaker", TOSB: "Toshiba", TOSH: "Toshiba", TOTK: "TOTOKU ELECTRIC", TRIU: "Triumph", TSBT: "Toshiba", TTX: "TTX Computer Products", TVM: "TVM Professional Monitor", TW: "TW Casper", ULSX: "Ulead Systems", UNIS: "Unisys", UTZF: "Utz Fehlau & Sohn", VARI: "Varityper", VIEW: "Viewsonic", VISL: "Visual communication", VIVO: "Vivo Mobile Communication", WANG: "Wang", WLBR: "Wilbur Imaging", WTG2: "Ware To Go", WYSE: "WYSE Technology", XERX: "Xerox", XRIT: "X-Rite", ZRAN: "Zoran", Zebr: "Zebra Technologies", appl: "Apple Computer", bICC: "basICColor", berg: "bergdesign", ceyd: "Integrated Color Solutions", clsp: "MacDermid ColorSpan", ds: "Dainippon Screen", dupn: "DuPont", ffei: "FujiFilm Electronic Imaging", flux: "FluxData", iris: "Scitex", kart: "Scitex", lcms: "Little CMS", lino: "Linotronic", none: "none", ob4d: "Erdt Systems", obic: "Medigraph", quby: "Qubyx Sarl", scit: "Scitex", scrn: "Dainippon Screen", sdp: "Scitex", siwi: "SIWI GRAFIKA", yxym: "YxyMaster" };
51229 var Ct = { scnr: "Scanner", mntr: "Monitor", prtr: "Printer", link: "Device Link", abst: "Abstract", spac: "Color Space Conversion Profile", nmcl: "Named Color", cenc: "ColorEncodingSpace profile", mid: "MultiplexIdentification profile", mlnk: "MultiplexLink profile", mvis: "MultiplexVisualization profile", nkpf: "Nikon Input Device Profile (NON-STANDARD!)" };
51230 U(B, "icc", [[4, St], [12, Ct], [40, Object.assign({}, St, Ct)], [48, St], [80, St], [64, { 0: "Perceptual", 1: "Relative Colorimetric", 2: "Saturation", 3: "Absolute Colorimetric" }], ["tech", { amd: "Active Matrix Display", crt: "Cathode Ray Tube Display", kpcd: "Photo CD", pmd: "Passive Matrix Display", dcam: "Digital Camera", dcpj: "Digital Cinema Projector", dmpc: "Digital Motion Picture Camera", dsub: "Dye Sublimation Printer", epho: "Electrophotographic Printer", esta: "Electrostatic Printer", flex: "Flexography", fprn: "Film Writer", fscn: "Film Scanner", grav: "Gravure", ijet: "Ink Jet Printer", imgs: "Photo Image Setter", mpfr: "Motion Picture Film Recorder", mpfs: "Motion Picture Film Scanner", offs: "Offset Lithography", pjtv: "Projection Television", rpho: "Photographic Paper Printer", rscn: "Reflective Scanner", silk: "Silkscreen", twax: "Thermal Wax Printer", vidc: "Video Camera", vidm: "Video Monitor" }]]);
51231 var yt = class extends re2 {
51232 static canHandle(e3, t2, i3) {
51233 return 237 === e3.getUint8(t2 + 1) && "Photoshop" === e3.getString(t2 + 4, 9) && void 0 !== this.containsIptc8bim(e3, t2, i3);
51235 static headerLength(e3, t2, i3) {
51236 let n3, s2 = this.containsIptc8bim(e3, t2, i3);
51238 return n3 = e3.getUint8(t2 + s2 + 7), n3 % 2 != 0 && (n3 += 1), 0 === n3 && (n3 = 4), s2 + 8 + n3;
51240 static containsIptc8bim(e3, t2, i3) {
51241 for (let n3 = 0; n3 < i3; n3++)
51242 if (this.isIptcSegmentHead(e3, t2 + n3))
51245 static isIptcSegmentHead(e3, t2) {
51246 return 56 === e3.getUint8(t2) && 943868237 === e3.getUint32(t2) && 1028 === e3.getUint16(t2 + 4);
51249 let { raw: e3 } = this, t2 = this.chunk.byteLength - 1, i3 = false;
51250 for (let n3 = 0; n3 < t2; n3++)
51251 if (28 === this.chunk.getUint8(n3) && 2 === this.chunk.getUint8(n3 + 1)) {
51253 let t3 = this.chunk.getUint16(n3 + 3), s2 = this.chunk.getUint8(n3 + 2), r2 = this.chunk.getLatin1String(n3 + 5, t3);
51254 e3.set(s2, this.pluralizeValue(e3.get(s2), r2)), n3 += 4 + t3;
51257 return this.translate(), this.output;
51259 pluralizeValue(e3, t2) {
51260 return void 0 !== e3 ? e3 instanceof Array ? (e3.push(t2), e3) : [e3, t2] : t2;
51263 c(yt, "type", "iptc"), c(yt, "translateValues", false), c(yt, "reviveValues", false), T.set("iptc", yt), U(E, "iptc", [[0, "ApplicationRecordVersion"], [3, "ObjectTypeReference"], [4, "ObjectAttributeReference"], [5, "ObjectName"], [7, "EditStatus"], [8, "EditorialUpdate"], [10, "Urgency"], [12, "SubjectReference"], [15, "Category"], [20, "SupplementalCategories"], [22, "FixtureIdentifier"], [25, "Keywords"], [26, "ContentLocationCode"], [27, "ContentLocationName"], [30, "ReleaseDate"], [35, "ReleaseTime"], [37, "ExpirationDate"], [38, "ExpirationTime"], [40, "SpecialInstructions"], [42, "ActionAdvised"], [45, "ReferenceService"], [47, "ReferenceDate"], [50, "ReferenceNumber"], [55, "DateCreated"], [60, "TimeCreated"], [62, "DigitalCreationDate"], [63, "DigitalCreationTime"], [65, "OriginatingProgram"], [70, "ProgramVersion"], [75, "ObjectCycle"], [80, "Byline"], [85, "BylineTitle"], [90, "City"], [92, "Sublocation"], [95, "State"], [100, "CountryCode"], [101, "Country"], [103, "OriginalTransmissionReference"], [105, "Headline"], [110, "Credit"], [115, "Source"], [116, "CopyrightNotice"], [118, "Contact"], [120, "Caption"], [121, "LocalCaption"], [122, "Writer"], [125, "RasterizedCaption"], [130, "ImageType"], [131, "ImageOrientation"], [135, "LanguageIdentifier"], [150, "AudioType"], [151, "AudioSamplingRate"], [152, "AudioSamplingResolution"], [153, "AudioDuration"], [154, "AudioOutcue"], [184, "JobID"], [185, "MasterDocumentID"], [186, "ShortDocumentID"], [187, "UniqueDocumentID"], [188, "OwnerID"], [200, "ObjectPreviewFileFormat"], [201, "ObjectPreviewFileVersion"], [202, "ObjectPreviewData"], [221, "Prefs"], [225, "ClassifyState"], [228, "SimilarityIndex"], [230, "DocumentNotes"], [231, "DocumentHistory"], [232, "ExifCameraInfo"], [255, "CatalogSets"]]), U(B, "iptc", [[10, { 0: "0 (reserved)", 1: "1 (most urgent)", 2: "2", 3: "3", 4: "4", 5: "5 (normal urgency)", 6: "6", 7: "7", 8: "8 (least urgent)", 9: "9 (user-defined priority)" }], [75, { a: "Morning", b: "Both Morning and Evening", p: "Evening" }], [131, { L: "Landscape", P: "Portrait", S: "Square" }]]);
51264 var full_esm_default = tt;
51266 // modules/services/plane_photo.js
51267 var dispatch6 = dispatch_default("viewerChanged");
51271 var _widthOverflow;
51272 function zoomPan(d3_event) {
51273 let t2 = d3_event.transform;
51274 _photo.call(utilSetTransform, t2.x, t2.y, t2.k);
51276 function zoomBeahvior() {
51277 const { width: wrapperWidth, height: wrapperHeight } = _wrapper.node().getBoundingClientRect();
51278 const { naturalHeight, naturalWidth } = _photo.node();
51279 const intrinsicRatio = naturalWidth / naturalHeight;
51280 _widthOverflow = wrapperHeight * intrinsicRatio - wrapperWidth;
51281 return zoom_default2().extent([[0, 0], [wrapperWidth, wrapperHeight]]).translateExtent([[0, 0], [wrapperWidth + _widthOverflow, wrapperHeight]]).scaleExtent([1, 15]).on("zoom", zoomPan);
51283 function loadImage(selection2, path) {
51284 return new Promise((resolve) => {
51285 selection2.attr("src", path);
51286 selection2.on("load", () => {
51287 resolve(selection2);
51291 var plane_photo_default = {
51292 init: async function(context, selection2) {
51293 this.event = utilRebind(this, dispatch6, "on");
51294 _wrapper = selection2.append("div").attr("class", "photo-frame plane-frame").classed("hide", true);
51295 _photo = _wrapper.append("img").attr("class", "plane-photo");
51296 context.ui().photoviewer.on("resize.plane", () => {
51297 imgZoom = zoomBeahvior();
51298 _wrapper.call(imgZoom);
51300 await Promise.resolve();
51303 showPhotoFrame: function(context) {
51304 const isHidden = context.selectAll(".photo-frame.plane-frame.hide").size();
51306 context.selectAll(".photo-frame:not(.plane-frame)").classed("hide", true);
51307 context.selectAll(".photo-frame.plane-frame").classed("hide", false);
51311 hidePhotoFrame: function(context) {
51312 context.select("photo-frame.plane-frame").classed("hide", false);
51315 selectPhoto: function(data, keepOrientation) {
51316 dispatch6.call("viewerChanged");
51317 loadImage(_photo, "");
51318 loadImage(_photo, data.image_path).then(() => {
51319 if (!keepOrientation) {
51320 imgZoom = zoomBeahvior();
51321 _wrapper.call(imgZoom);
51322 _wrapper.call(imgZoom.transform, identity2.translate(-_widthOverflow / 2, 0));
51327 getYaw: function() {
51332 // modules/svg/local_photos.js
51333 var _initialized2 = false;
51334 var _enabled2 = false;
51335 var minViewfieldZoom = 16;
51336 function svgLocalPhotos(projection2, context, dispatch14) {
51337 const detected = utilDetect();
51338 let layer = select_default2(null);
51341 let _idAutoinc = 0;
51347 function over(d3_event) {
51348 d3_event.stopPropagation();
51349 d3_event.preventDefault();
51350 d3_event.dataTransfer.dropEffect = "copy";
51352 context.container().attr("dropzone", "copy").on("drop.svgLocalPhotos", function(d3_event) {
51353 d3_event.stopPropagation();
51354 d3_event.preventDefault();
51355 if (!detected.filedrop)
51357 drawPhotos.fileList(d3_event.dataTransfer.files, (loaded) => {
51358 if (loaded.length > 0) {
51359 drawPhotos.fitZoom(false);
51362 }).on("dragenter.svgLocalPhotos", over).on("dragexit.svgLocalPhotos", over).on("dragover.svgLocalPhotos", over);
51363 _initialized2 = true;
51365 function ensureViewerLoaded(context2) {
51367 return Promise.resolve(_photoFrame);
51369 const viewer = context2.container().select(".photoviewer").selectAll(".local-photos-wrapper").data([0]);
51370 const viewerEnter = viewer.enter().append("div").attr("class", "photo-wrapper local-photos-wrapper").classed("hide", true);
51371 viewerEnter.append("div").attr("class", "photo-attribution fillD");
51372 return plane_photo_default.init(context2, viewerEnter).then((planePhotoFrame) => {
51373 _photoFrame = planePhotoFrame;
51376 function click(d3_event, image, zoomTo) {
51377 ensureViewerLoaded(context).then(() => {
51378 const viewer = context.container().select(".photoviewer").datum(image).classed("hide", false);
51379 const viewerWrap = viewer.select(".local-photos-wrapper").classed("hide", false);
51380 const attribution = viewerWrap.selectAll(".photo-attribution").text("");
51382 attribution.append("span").classed("filename", true).text(image.name);
51384 _photoFrame.selectPhoto({ image_path: "" });
51385 image.getSrc().then((src) => {
51386 _photoFrame.selectPhoto({ image_path: src }).showPhotoFrame(viewerWrap);
51391 context.map().centerEase(image.loc);
51394 function transform2(d2) {
51395 var svgpoint = projection2(d2.loc);
51396 return "translate(" + svgpoint[0] + "," + svgpoint[1] + ")";
51398 function setStyles(hovered) {
51399 const viewer = context.container().select(".photoviewer");
51400 const selected = viewer.empty() ? void 0 : viewer.datum();
51401 context.container().selectAll(".layer-local-photos .viewfield-group").classed("hovered", (d2) => d2.id === hovered?.id).classed("highlighted", (d2) => d2.id === hovered?.id || d2.id === selected?.id).classed("currentView", (d2) => d2.id === selected?.id);
51403 function display_markers(imageList) {
51404 imageList = imageList.filter((image) => isArray_default(image.loc) && isNumber_default(image.loc[0]) && isNumber_default(image.loc[1]));
51405 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(imageList, function(d2) {
51408 groups.exit().remove();
51409 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", (d3_event, d2) => setStyles(d2)).on("mouseleave", () => setStyles(null)).on("click", click);
51410 groupsEnter.append("g").attr("class", "viewfield-scale");
51411 const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
51412 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
51413 const showViewfields = context.map().zoom() >= minViewfieldZoom;
51414 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
51415 viewfields.exit().remove();
51416 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", function() {
51417 const d2 = this.parentNode.__data__;
51418 return `rotate(${Math.round(d2.direction ?? 0)},0,0),scale(1.5,1.5),translate(-8,-13)`;
51419 }).attr("d", "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z").style("visibility", function() {
51420 const d2 = this.parentNode.__data__;
51421 return isNumber_default(d2.direction) ? "visible" : "hidden";
51424 function drawPhotos(selection2) {
51425 layer = selection2.selectAll(".layer-local-photos").data(_photos ? [0] : []);
51426 layer.exit().remove();
51427 const layerEnter = layer.enter().append("g").attr("class", "layer-local-photos");
51428 layerEnter.append("g").attr("class", "markers");
51429 layer = layerEnter.merge(layer);
51430 if (_photos && _photos.length !== 0) {
51431 display_markers(_photos);
51434 function readFileAsDataURL(file) {
51435 return new Promise((resolve, reject) => {
51436 const reader = new FileReader();
51437 reader.onload = () => resolve(reader.result);
51438 reader.onerror = (error) => reject(error);
51439 reader.readAsDataURL(file);
51442 async function readmultifiles(files, callback) {
51444 for (const file of files) {
51446 const exifData = await full_esm_default.parse(file);
51450 getSrc: () => readFileAsDataURL(file),
51452 loc: [exifData.longitude, exifData.latitude],
51453 direction: exifData.GPSImgDirection
51455 loaded.push(photo);
51456 const sameName = _photos.filter((i3) => i3.name === photo.name);
51457 if (sameName.length === 0) {
51458 _photos.push(photo);
51460 const thisContent = await photo.getSrc();
51461 const sameNameContent = await Promise.allSettled(sameName.map((i3) => i3.getSrc()));
51462 if (!sameNameContent.some((i3) => i3.value === thisContent)) {
51463 _photos.push(photo);
51469 if (typeof callback === "function")
51471 dispatch14.call("change");
51473 drawPhotos.setFiles = function(fileList, callback) {
51474 readmultifiles(Array.from(fileList), callback);
51477 drawPhotos.fileList = function(fileList, callback) {
51478 if (!arguments.length)
51480 _fileList = fileList;
51481 if (!fileList || !fileList.length)
51483 drawPhotos.setFiles(_fileList, callback);
51486 drawPhotos.getPhotos = function() {
51489 drawPhotos.removePhoto = function(id2) {
51490 _photos = _photos.filter((i3) => i3.id !== id2);
51491 dispatch14.call("change");
51494 drawPhotos.openPhoto = click;
51495 drawPhotos.fitZoom = function(force) {
51496 const coords = _photos.map((image) => image.loc).filter((l2) => isArray_default(l2) && isNumber_default(l2[0]) && isNumber_default(l2[1]));
51497 if (coords.length === 0)
51499 const extent = coords.map((l2) => geoExtent(l2, l2)).reduce((a2, b2) => a2.extend(b2));
51500 const map2 = context.map();
51501 var viewport = map2.trimmedExtent().polygon();
51502 if (force !== false || !geoPolygonIntersectsPolygon(viewport, coords, true)) {
51503 map2.centerZoom(extent.center(), Math.min(18, map2.trimmedExtentZoom(extent)));
51506 function showLayer() {
51507 layer.style("display", "block");
51508 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
51509 dispatch14.call("change");
51512 function hideLayer() {
51513 layer.transition().duration(250).style("opacity", 0).on("end", () => {
51514 layer.selectAll(".viewfield-group").remove();
51515 layer.style("display", "none");
51518 drawPhotos.enabled = function(val) {
51519 if (!arguments.length)
51527 dispatch14.call("change");
51530 drawPhotos.hasData = function() {
51531 return isArray_default(_photos) && _photos.length > 0;
51537 // modules/svg/improveOSM.js
51538 var _layerEnabled2 = false;
51540 function svgImproveOSM(projection2, context, dispatch14) {
51541 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
51542 const minZoom4 = 12;
51543 let touchLayer = select_default2(null);
51544 let drawLayer = select_default2(null);
51545 let layerVisible = false;
51546 function markerPath(selection2, klass) {
51547 selection2.attr("class", klass).attr("transform", "translate(-10, -28)").attr("points", "16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6");
51549 function getService() {
51550 if (services.improveOSM && !_qaService2) {
51551 _qaService2 = services.improveOSM;
51552 _qaService2.on("loaded", throttledRedraw);
51553 } else if (!services.improveOSM && _qaService2) {
51554 _qaService2 = null;
51556 return _qaService2;
51558 function editOn() {
51559 if (!layerVisible) {
51560 layerVisible = true;
51561 drawLayer.style("display", "block");
51564 function editOff() {
51565 if (layerVisible) {
51566 layerVisible = false;
51567 drawLayer.style("display", "none");
51568 drawLayer.selectAll(".qaItem.improveOSM").remove();
51569 touchLayer.selectAll(".qaItem.improveOSM").remove();
51572 function layerOn() {
51574 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
51576 function layerOff() {
51577 throttledRedraw.cancel();
51578 drawLayer.interrupt();
51579 touchLayer.selectAll(".qaItem.improveOSM").remove();
51580 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
51582 dispatch14.call("change");
51585 function updateMarkers() {
51586 if (!layerVisible || !_layerEnabled2)
51588 const service = getService();
51589 const selectedID = context.selectedErrorID();
51590 const data = service ? service.getItems(projection2) : [];
51591 const getTransform = svgPointTransform(projection2);
51592 const markers = drawLayer.selectAll(".qaItem.improveOSM").data(data, (d2) => d2.id);
51593 markers.exit().remove();
51594 const markersEnter = markers.enter().append("g").attr("class", (d2) => `qaItem ${d2.service} itemId-${d2.id} itemType-${d2.itemType}`);
51595 markersEnter.append("polygon").call(markerPath, "shadow");
51596 markersEnter.append("ellipse").attr("cx", 0).attr("cy", 0).attr("rx", 4.5).attr("ry", 2).attr("class", "stroke");
51597 markersEnter.append("polygon").attr("fill", "currentColor").call(markerPath, "qaItem-fill");
51598 markersEnter.append("use").attr("class", "icon-annotation").attr("transform", "translate(-6, -22)").attr("width", "12px").attr("height", "12px").attr("xlink:href", (d2) => d2.icon ? "#" + d2.icon : "");
51599 markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
51600 if (touchLayer.empty())
51602 const fillClass = context.getDebug("target") ? "pink " : "nocolor ";
51603 const targets = touchLayer.selectAll(".qaItem.improveOSM").data(data, (d2) => d2.id);
51604 targets.exit().remove();
51605 targets.enter().append("rect").attr("width", "20px").attr("height", "30px").attr("x", "-10px").attr("y", "-28px").merge(targets).sort(sortY).attr("class", (d2) => `qaItem ${d2.service} target ${fillClass} itemId-${d2.id}`).attr("transform", getTransform);
51606 function sortY(a2, b2) {
51607 return a2.id === selectedID ? 1 : b2.id === selectedID ? -1 : b2.loc[1] - a2.loc[1];
51610 function drawImproveOSM(selection2) {
51611 const service = getService();
51612 const surface = context.surface();
51613 if (surface && !surface.empty()) {
51614 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
51616 drawLayer = selection2.selectAll(".layer-improveOSM").data(service ? [0] : []);
51617 drawLayer.exit().remove();
51618 drawLayer = drawLayer.enter().append("g").attr("class", "layer-improveOSM").style("display", _layerEnabled2 ? "block" : "none").merge(drawLayer);
51619 if (_layerEnabled2) {
51620 if (service && ~~context.map().zoom() >= minZoom4) {
51622 service.loadIssues(projection2);
51629 drawImproveOSM.enabled = function(val) {
51630 if (!arguments.length)
51631 return _layerEnabled2;
51632 _layerEnabled2 = val;
51633 if (_layerEnabled2) {
51637 if (context.selectedErrorID()) {
51638 context.enter(modeBrowse(context));
51641 dispatch14.call("change");
51644 drawImproveOSM.supported = () => !!getService();
51645 return drawImproveOSM;
51648 // modules/svg/osmose.js
51649 var _layerEnabled3 = false;
51651 function svgOsmose(projection2, context, dispatch14) {
51652 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
51653 const minZoom4 = 12;
51654 let touchLayer = select_default2(null);
51655 let drawLayer = select_default2(null);
51656 let layerVisible = false;
51657 function markerPath(selection2, klass) {
51658 selection2.attr("class", klass).attr("transform", "translate(-10, -28)").attr("points", "16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6");
51660 function getService() {
51661 if (services.osmose && !_qaService3) {
51662 _qaService3 = services.osmose;
51663 _qaService3.on("loaded", throttledRedraw);
51664 } else if (!services.osmose && _qaService3) {
51665 _qaService3 = null;
51667 return _qaService3;
51669 function editOn() {
51670 if (!layerVisible) {
51671 layerVisible = true;
51672 drawLayer.style("display", "block");
51675 function editOff() {
51676 if (layerVisible) {
51677 layerVisible = false;
51678 drawLayer.style("display", "none");
51679 drawLayer.selectAll(".qaItem.osmose").remove();
51680 touchLayer.selectAll(".qaItem.osmose").remove();
51683 function layerOn() {
51685 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch14.call("change"));
51687 function layerOff() {
51688 throttledRedraw.cancel();
51689 drawLayer.interrupt();
51690 touchLayer.selectAll(".qaItem.osmose").remove();
51691 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
51693 dispatch14.call("change");
51696 function updateMarkers() {
51697 if (!layerVisible || !_layerEnabled3)
51699 const service = getService();
51700 const selectedID = context.selectedErrorID();
51701 const data = service ? service.getItems(projection2) : [];
51702 const getTransform = svgPointTransform(projection2);
51703 const markers = drawLayer.selectAll(".qaItem.osmose").data(data, (d2) => d2.id);
51704 markers.exit().remove();
51705 const markersEnter = markers.enter().append("g").attr("class", (d2) => `qaItem ${d2.service} itemId-${d2.id} itemType-${d2.itemType}`);
51706 markersEnter.append("polygon").call(markerPath, "shadow");
51707 markersEnter.append("ellipse").attr("cx", 0).attr("cy", 0).attr("rx", 4.5).attr("ry", 2).attr("class", "stroke");
51708 markersEnter.append("polygon").attr("fill", (d2) => service.getColor(d2.item)).call(markerPath, "qaItem-fill");
51709 markersEnter.append("use").attr("class", "icon-annotation").attr("transform", "translate(-6, -22)").attr("width", "12px").attr("height", "12px").attr("xlink:href", (d2) => d2.icon ? "#" + d2.icon : "");
51710 markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
51711 if (touchLayer.empty())
51713 const fillClass = context.getDebug("target") ? "pink" : "nocolor";
51714 const targets = touchLayer.selectAll(".qaItem.osmose").data(data, (d2) => d2.id);
51715 targets.exit().remove();
51716 targets.enter().append("rect").attr("width", "20px").attr("height", "30px").attr("x", "-10px").attr("y", "-28px").merge(targets).sort(sortY).attr("class", (d2) => `qaItem ${d2.service} target ${fillClass} itemId-${d2.id}`).attr("transform", getTransform);
51717 function sortY(a2, b2) {
51718 return a2.id === selectedID ? 1 : b2.id === selectedID ? -1 : b2.loc[1] - a2.loc[1];
51721 function drawOsmose(selection2) {
51722 const service = getService();
51723 const surface = context.surface();
51724 if (surface && !surface.empty()) {
51725 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
51727 drawLayer = selection2.selectAll(".layer-osmose").data(service ? [0] : []);
51728 drawLayer.exit().remove();
51729 drawLayer = drawLayer.enter().append("g").attr("class", "layer-osmose").style("display", _layerEnabled3 ? "block" : "none").merge(drawLayer);
51730 if (_layerEnabled3) {
51731 if (service && ~~context.map().zoom() >= minZoom4) {
51733 service.loadIssues(projection2);
51740 drawOsmose.enabled = function(val) {
51741 if (!arguments.length)
51742 return _layerEnabled3;
51743 _layerEnabled3 = val;
51744 if (_layerEnabled3) {
51745 getService().loadStrings().then(layerOn).catch((err) => {
51750 if (context.selectedErrorID()) {
51751 context.enter(modeBrowse(context));
51754 dispatch14.call("change");
51757 drawOsmose.supported = () => !!getService();
51761 // modules/svg/streetside.js
51762 function svgStreetside(projection2, context, dispatch14) {
51763 var throttledRedraw = throttle_default(function() {
51764 dispatch14.call("change");
51767 var minMarkerZoom = 16;
51768 var minViewfieldZoom2 = 18;
51769 var layer = select_default2(null);
51770 var _viewerYaw = 0;
51771 var _selectedSequence = null;
51774 if (svgStreetside.initialized)
51776 svgStreetside.enabled = false;
51777 svgStreetside.initialized = true;
51779 function getService() {
51780 if (services.streetside && !_streetside) {
51781 _streetside = services.streetside;
51782 _streetside.event.on("viewerChanged.svgStreetside", viewerChanged).on("loadedImages.svgStreetside", throttledRedraw);
51783 } else if (!services.streetside && _streetside) {
51784 _streetside = null;
51786 return _streetside;
51788 function showLayer() {
51789 var service = getService();
51793 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
51794 dispatch14.call("change");
51797 function hideLayer() {
51798 throttledRedraw.cancel();
51799 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
51801 function editOn() {
51802 layer.style("display", "block");
51804 function editOff() {
51805 layer.selectAll(".viewfield-group").remove();
51806 layer.style("display", "none");
51808 function click(d3_event, d2) {
51809 var service = getService();
51812 if (d2.sequenceKey !== _selectedSequence) {
51815 _selectedSequence = d2.sequenceKey;
51816 service.ensureViewerLoaded(context).then(function() {
51817 service.selectImage(context, d2.key).yaw(_viewerYaw).showViewer(context);
51819 context.map().centerEase(d2.loc);
51821 function mouseover(d3_event, d2) {
51822 var service = getService();
51824 service.setStyles(context, d2);
51826 function mouseout() {
51827 var service = getService();
51829 service.setStyles(context, null);
51831 function transform2(d2) {
51832 var t2 = svgPointTransform(projection2)(d2);
51833 var rot = d2.ca + _viewerYaw;
51835 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
51839 function viewerChanged() {
51840 var service = getService();
51843 var viewer = service.viewer();
51846 _viewerYaw = viewer.getYaw();
51847 if (context.map().isTransformed())
51849 layer.selectAll(".viewfield-group.currentView").attr("transform", transform2);
51851 function filterBubbles(bubbles) {
51852 var fromDate = context.photos().fromDate();
51853 var toDate = context.photos().toDate();
51854 var usernames = context.photos().usernames();
51856 var fromTimestamp = new Date(fromDate).getTime();
51857 bubbles = bubbles.filter(function(bubble) {
51858 return new Date(bubble.captured_at).getTime() >= fromTimestamp;
51862 var toTimestamp = new Date(toDate).getTime();
51863 bubbles = bubbles.filter(function(bubble) {
51864 return new Date(bubble.captured_at).getTime() <= toTimestamp;
51868 bubbles = bubbles.filter(function(bubble) {
51869 return usernames.indexOf(bubble.captured_by) !== -1;
51874 function filterSequences(sequences) {
51875 var fromDate = context.photos().fromDate();
51876 var toDate = context.photos().toDate();
51877 var usernames = context.photos().usernames();
51879 var fromTimestamp = new Date(fromDate).getTime();
51880 sequences = sequences.filter(function(sequences2) {
51881 return new Date(sequences2.properties.captured_at).getTime() >= fromTimestamp;
51885 var toTimestamp = new Date(toDate).getTime();
51886 sequences = sequences.filter(function(sequences2) {
51887 return new Date(sequences2.properties.captured_at).getTime() <= toTimestamp;
51891 sequences = sequences.filter(function(sequences2) {
51892 return usernames.indexOf(sequences2.properties.captured_by) !== -1;
51897 function update() {
51898 var viewer = context.container().select(".photoviewer");
51899 var selected = viewer.empty() ? void 0 : viewer.datum();
51900 var z2 = ~~context.map().zoom();
51901 var showMarkers = z2 >= minMarkerZoom;
51902 var showViewfields = z2 >= minViewfieldZoom2;
51903 var service = getService();
51904 var sequences = [];
51906 if (context.photos().showsPanoramic()) {
51907 sequences = service ? service.sequences(projection2) : [];
51908 bubbles = service && showMarkers ? service.bubbles(projection2) : [];
51909 sequences = filterSequences(sequences);
51910 bubbles = filterBubbles(bubbles);
51912 var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
51913 return d2.properties.key;
51915 traces.exit().remove();
51916 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
51917 var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(bubbles, function(d2) {
51918 return d2.key + (d2.sequenceKey ? "v1" : "v0");
51920 groups.exit().remove();
51921 var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
51922 groupsEnter.append("g").attr("class", "viewfield-scale");
51923 var markers = groups.merge(groupsEnter).sort(function(a2, b2) {
51924 return a2 === selected ? 1 : b2 === selected ? -1 : b2.loc[1] - a2.loc[1];
51925 }).attr("transform", transform2).select(".viewfield-scale");
51926 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
51927 var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
51928 viewfields.exit().remove();
51929 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
51930 function viewfieldPath() {
51931 var d2 = this.parentNode.__data__;
51933 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
51935 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
51939 function drawImages(selection2) {
51940 var enabled = svgStreetside.enabled;
51941 var service = getService();
51942 layer = selection2.selectAll(".layer-streetside-images").data(service ? [0] : []);
51943 layer.exit().remove();
51944 var layerEnter = layer.enter().append("g").attr("class", "layer-streetside-images").style("display", enabled ? "block" : "none");
51945 layerEnter.append("g").attr("class", "sequences");
51946 layerEnter.append("g").attr("class", "markers");
51947 layer = layerEnter.merge(layer);
51949 if (service && ~~context.map().zoom() >= minZoom4) {
51952 service.loadBubbles(projection2);
51958 drawImages.enabled = function(_2) {
51959 if (!arguments.length)
51960 return svgStreetside.enabled;
51961 svgStreetside.enabled = _2;
51962 if (svgStreetside.enabled) {
51964 context.photos().on("change.streetside", update);
51967 context.photos().on("change.streetside", null);
51969 dispatch14.call("change");
51972 drawImages.supported = function() {
51973 return !!getService();
51975 drawImages.rendered = function(zoom) {
51976 return zoom >= minZoom4;
51982 // modules/svg/vegbilder.js
51983 function svgVegbilder(projection2, context, dispatch14) {
51984 const throttledRedraw = throttle_default(() => dispatch14.call("change"), 1e3);
51985 const minZoom4 = 14;
51986 const minMarkerZoom = 16;
51987 const minViewfieldZoom2 = 18;
51988 let layer = select_default2(null);
51989 let _viewerYaw = 0;
51992 if (svgVegbilder.initialized)
51994 svgVegbilder.enabled = false;
51995 svgVegbilder.initialized = true;
51997 function getService() {
51998 if (services.vegbilder && !_vegbilder) {
51999 _vegbilder = services.vegbilder;
52000 _vegbilder.event.on("viewerChanged.svgVegbilder", viewerChanged).on("loadedImages.svgVegbilder", throttledRedraw);
52001 } else if (!services.vegbilder && _vegbilder) {
52006 function showLayer() {
52007 const service = getService();
52011 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", () => dispatch14.call("change"));
52013 function hideLayer() {
52014 throttledRedraw.cancel();
52015 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52017 function editOn() {
52018 layer.style("display", "block");
52020 function editOff() {
52021 layer.selectAll(".viewfield-group").remove();
52022 layer.style("display", "none");
52024 function click(d3_event, d2) {
52025 const service = getService();
52028 service.ensureViewerLoaded(context).then(() => {
52029 service.selectImage(context, d2.key).showViewer(context);
52031 context.map().centerEase(d2.loc);
52033 function mouseover(d3_event, d2) {
52034 const service = getService();
52036 service.setStyles(context, d2);
52038 function mouseout() {
52039 const service = getService();
52041 service.setStyles(context, null);
52043 function transform2(d2, selected) {
52044 let t2 = svgPointTransform(projection2)(d2);
52046 if (d2 === selected) {
52050 t2 += " rotate(" + Math.floor(rot) + ",0,0)";
52054 function viewerChanged() {
52055 const service = getService();
52058 const frame2 = service.photoFrame();
52059 _viewerYaw = frame2.getYaw();
52060 if (context.map().isTransformed())
52062 layer.selectAll(".viewfield-group.currentView").attr("transform", (d2) => transform2(d2, d2));
52064 function filterImages(images) {
52065 const photoContext = context.photos();
52066 const fromDateString = photoContext.fromDate();
52067 const toDateString = photoContext.toDate();
52068 const showsFlat = photoContext.showsFlat();
52069 const showsPano = photoContext.showsPanoramic();
52070 if (fromDateString) {
52071 const fromDate = new Date(fromDateString);
52072 images = images.filter((image) => image.captured_at.getTime() >= fromDate.getTime());
52074 if (toDateString) {
52075 const toDate = new Date(toDateString);
52076 images = images.filter((image) => image.captured_at.getTime() <= toDate.getTime());
52079 images = images.filter((image) => !image.is_sphere);
52082 images = images.filter((image) => image.is_sphere);
52086 function filterSequences(sequences) {
52087 const photoContext = context.photos();
52088 const fromDateString = photoContext.fromDate();
52089 const toDateString = photoContext.toDate();
52090 const showsFlat = photoContext.showsFlat();
52091 const showsPano = photoContext.showsPanoramic();
52092 if (fromDateString) {
52093 const fromDate = new Date(fromDateString);
52094 sequences = sequences.filter(({ images }) => images[0].captured_at.getTime() >= fromDate.getTime());
52096 if (toDateString) {
52097 const toDate = new Date(toDateString);
52098 sequences = sequences.filter(({ images }) => images[images.length - 1].captured_at.getTime() <= toDate.getTime());
52101 sequences = sequences.filter(({ images }) => !images[0].is_sphere);
52104 sequences = sequences.filter(({ images }) => images[0].is_sphere);
52108 function update() {
52109 const viewer = context.container().select(".photoviewer");
52110 const selected = viewer.empty() ? void 0 : viewer.datum();
52111 const z2 = ~~context.map().zoom();
52112 const showMarkers = z2 >= minMarkerZoom;
52113 const showViewfields = z2 >= minViewfieldZoom2;
52114 const service = getService();
52115 let sequences = [];
52118 service.loadImages(context);
52119 sequences = service.sequences(projection2);
52120 images = showMarkers ? service.images(projection2) : [];
52121 images = filterImages(images);
52122 sequences = filterSequences(sequences);
52124 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, (d2) => d2.key);
52125 traces.exit().remove();
52126 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
52127 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, (d2) => d2.key);
52128 groups.exit().remove();
52129 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
52130 groupsEnter.append("g").attr("class", "viewfield-scale");
52131 const markers = groups.merge(groupsEnter).sort((a2, b2) => {
52132 return a2 === selected ? 1 : b2 === selected ? -1 : b2.loc[1] - a2.loc[1];
52133 }).attr("transform", (d2) => transform2(d2, selected)).select(".viewfield-scale");
52134 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52135 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52136 viewfields.exit().remove();
52137 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
52138 function viewfieldPath() {
52139 const d2 = this.parentNode.__data__;
52140 if (d2.is_sphere) {
52141 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
52143 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
52147 function drawImages(selection2) {
52148 const enabled = svgVegbilder.enabled;
52149 const service = getService();
52150 layer = selection2.selectAll(".layer-vegbilder").data(service ? [0] : []);
52151 layer.exit().remove();
52152 const layerEnter = layer.enter().append("g").attr("class", "layer-vegbilder").style("display", enabled ? "block" : "none");
52153 layerEnter.append("g").attr("class", "sequences");
52154 layerEnter.append("g").attr("class", "markers");
52155 layer = layerEnter.merge(layer);
52157 if (service && ~~context.map().zoom() >= minZoom4) {
52160 service.loadImages(context);
52166 drawImages.enabled = function(_2) {
52167 if (!arguments.length)
52168 return svgVegbilder.enabled;
52169 svgVegbilder.enabled = _2;
52170 if (svgVegbilder.enabled) {
52172 context.photos().on("change.vegbilder", update);
52175 context.photos().on("change.vegbilder", null);
52177 dispatch14.call("change");
52180 drawImages.supported = function() {
52181 return !!getService();
52183 drawImages.rendered = function(zoom) {
52184 return zoom >= minZoom4;
52186 drawImages.validHere = function(extent, zoom) {
52187 return zoom >= minZoom4 - 2 && getService().validHere(extent);
52193 // modules/svg/mapillary_images.js
52194 function svgMapillaryImages(projection2, context, dispatch14) {
52195 const throttledRedraw = throttle_default(function() {
52196 dispatch14.call("change");
52198 const minZoom4 = 12;
52199 const minMarkerZoom = 16;
52200 const minViewfieldZoom2 = 18;
52201 let layer = select_default2(null);
52204 if (svgMapillaryImages.initialized)
52206 svgMapillaryImages.enabled = false;
52207 svgMapillaryImages.initialized = true;
52209 function getService() {
52210 if (services.mapillary && !_mapillary) {
52211 _mapillary = services.mapillary;
52212 _mapillary.event.on("loadedImages", throttledRedraw);
52213 } else if (!services.mapillary && _mapillary) {
52218 function showLayer() {
52219 const service = getService();
52223 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
52224 dispatch14.call("change");
52227 function hideLayer() {
52228 throttledRedraw.cancel();
52229 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52231 function editOn() {
52232 layer.style("display", "block");
52234 function editOff() {
52235 layer.selectAll(".viewfield-group").remove();
52236 layer.style("display", "none");
52238 function click(d3_event, image) {
52239 const service = getService();
52242 service.ensureViewerLoaded(context).then(function() {
52243 service.selectImage(context, image.id).showViewer(context);
52245 context.map().centerEase(image.loc);
52247 function mouseover(d3_event, image) {
52248 const service = getService();
52250 service.setStyles(context, image);
52252 function mouseout() {
52253 const service = getService();
52255 service.setStyles(context, null);
52257 function transform2(d2) {
52258 let t2 = svgPointTransform(projection2)(d2);
52260 t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
52264 function filterImages(images) {
52265 const showsPano = context.photos().showsPanoramic();
52266 const showsFlat = context.photos().showsFlat();
52267 const fromDate = context.photos().fromDate();
52268 const toDate = context.photos().toDate();
52269 if (!showsPano || !showsFlat) {
52270 images = images.filter(function(image) {
52277 images = images.filter(function(image) {
52278 return new Date(image.captured_at).getTime() >= new Date(fromDate).getTime();
52282 images = images.filter(function(image) {
52283 return new Date(image.captured_at).getTime() <= new Date(toDate).getTime();
52288 function filterSequences(sequences) {
52289 const showsPano = context.photos().showsPanoramic();
52290 const showsFlat = context.photos().showsFlat();
52291 const fromDate = context.photos().fromDate();
52292 const toDate = context.photos().toDate();
52293 if (!showsPano || !showsFlat) {
52294 sequences = sequences.filter(function(sequence) {
52295 if (sequence.properties.hasOwnProperty("is_pano")) {
52296 if (sequence.properties.is_pano)
52304 sequences = sequences.filter(function(sequence) {
52305 return new Date(sequence.properties.captured_at).getTime() >= new Date(fromDate).getTime().toString();
52309 sequences = sequences.filter(function(sequence) {
52310 return new Date(sequence.properties.captured_at).getTime() <= new Date(toDate).getTime().toString();
52315 function update() {
52316 const z2 = ~~context.map().zoom();
52317 const showMarkers = z2 >= minMarkerZoom;
52318 const showViewfields = z2 >= minViewfieldZoom2;
52319 const service = getService();
52320 let sequences = service ? service.sequences(projection2) : [];
52321 let images = service && showMarkers ? service.images(projection2) : [];
52322 images = filterImages(images);
52323 sequences = filterSequences(sequences, service);
52324 service.filterViewer(context);
52325 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
52326 return d2.properties.id;
52328 traces.exit().remove();
52329 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
52330 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
52333 groups.exit().remove();
52334 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
52335 groupsEnter.append("g").attr("class", "viewfield-scale");
52336 const markers = groups.merge(groupsEnter).sort(function(a2, b2) {
52337 return b2.loc[1] - a2.loc[1];
52338 }).attr("transform", transform2).select(".viewfield-scale");
52339 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52340 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52341 viewfields.exit().remove();
52342 viewfields.enter().insert("path", "circle").attr("class", "viewfield").classed("pano", function() {
52343 return this.parentNode.__data__.is_pano;
52344 }).attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
52345 function viewfieldPath() {
52346 if (this.parentNode.__data__.is_pano) {
52347 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
52349 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
52353 function drawImages(selection2) {
52354 const enabled = svgMapillaryImages.enabled;
52355 const service = getService();
52356 layer = selection2.selectAll(".layer-mapillary").data(service ? [0] : []);
52357 layer.exit().remove();
52358 const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary").style("display", enabled ? "block" : "none");
52359 layerEnter.append("g").attr("class", "sequences");
52360 layerEnter.append("g").attr("class", "markers");
52361 layer = layerEnter.merge(layer);
52363 if (service && ~~context.map().zoom() >= minZoom4) {
52366 service.loadImages(projection2);
52372 drawImages.enabled = function(_2) {
52373 if (!arguments.length)
52374 return svgMapillaryImages.enabled;
52375 svgMapillaryImages.enabled = _2;
52376 if (svgMapillaryImages.enabled) {
52378 context.photos().on("change.mapillary_images", update);
52381 context.photos().on("change.mapillary_images", null);
52383 dispatch14.call("change");
52386 drawImages.supported = function() {
52387 return !!getService();
52389 drawImages.rendered = function(zoom) {
52390 return zoom >= minZoom4;
52396 // modules/svg/mapillary_position.js
52397 function svgMapillaryPosition(projection2, context) {
52398 const throttledRedraw = throttle_default(function() {
52401 const minZoom4 = 12;
52402 const minViewfieldZoom2 = 18;
52403 let layer = select_default2(null);
52405 let viewerCompassAngle;
52407 if (svgMapillaryPosition.initialized)
52409 svgMapillaryPosition.initialized = true;
52411 function getService() {
52412 if (services.mapillary && !_mapillary) {
52413 _mapillary = services.mapillary;
52414 _mapillary.event.on("imageChanged", throttledRedraw);
52415 _mapillary.event.on("bearingChanged", function(e3) {
52416 viewerCompassAngle = e3.bearing;
52417 if (context.map().isTransformed())
52419 layer.selectAll(".viewfield-group.currentView").filter(function(d2) {
52421 }).attr("transform", transform2);
52423 } else if (!services.mapillary && _mapillary) {
52428 function editOn() {
52429 layer.style("display", "block");
52431 function editOff() {
52432 layer.selectAll(".viewfield-group").remove();
52433 layer.style("display", "none");
52435 function transform2(d2) {
52436 let t2 = svgPointTransform(projection2)(d2);
52437 if (d2.is_pano && viewerCompassAngle !== null && isFinite(viewerCompassAngle)) {
52438 t2 += " rotate(" + Math.floor(viewerCompassAngle) + ",0,0)";
52439 } else if (d2.ca) {
52440 t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
52444 function update() {
52445 const z2 = ~~context.map().zoom();
52446 const showViewfields = z2 >= minViewfieldZoom2;
52447 const service = getService();
52448 const image = service && service.getActiveImage();
52449 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(image ? [image] : [], function(d2) {
52452 groups.exit().remove();
52453 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group currentView highlighted");
52454 groupsEnter.append("g").attr("class", "viewfield-scale");
52455 const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
52456 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52457 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52458 viewfields.exit().remove();
52459 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z");
52461 function drawImages(selection2) {
52462 const service = getService();
52463 layer = selection2.selectAll(".layer-mapillary-position").data(service ? [0] : []);
52464 layer.exit().remove();
52465 const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary-position");
52466 layerEnter.append("g").attr("class", "markers");
52467 layer = layerEnter.merge(layer);
52468 if (service && ~~context.map().zoom() >= minZoom4) {
52475 drawImages.enabled = function() {
52479 drawImages.supported = function() {
52480 return !!getService();
52482 drawImages.rendered = function(zoom) {
52483 return zoom >= minZoom4;
52489 // modules/svg/mapillary_signs.js
52490 function svgMapillarySigns(projection2, context, dispatch14) {
52491 const throttledRedraw = throttle_default(function() {
52492 dispatch14.call("change");
52494 const minZoom4 = 12;
52495 let layer = select_default2(null);
52498 if (svgMapillarySigns.initialized)
52500 svgMapillarySigns.enabled = false;
52501 svgMapillarySigns.initialized = true;
52503 function getService() {
52504 if (services.mapillary && !_mapillary) {
52505 _mapillary = services.mapillary;
52506 _mapillary.event.on("loadedSigns", throttledRedraw);
52507 } else if (!services.mapillary && _mapillary) {
52512 function showLayer() {
52513 const service = getService();
52516 service.loadSignResources(context);
52519 function hideLayer() {
52520 throttledRedraw.cancel();
52523 function editOn() {
52524 layer.style("display", "block");
52526 function editOff() {
52527 layer.selectAll(".icon-sign").remove();
52528 layer.style("display", "none");
52530 function click(d3_event, d2) {
52531 const service = getService();
52534 context.map().centerEase(d2.loc);
52535 const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
52536 service.getDetections(d2.id).then((detections) => {
52537 if (detections.length) {
52538 const imageId = detections[0].image.id;
52539 if (imageId === selectedImageId) {
52540 service.highlightDetection(detections[0]).selectImage(context, imageId);
52542 service.ensureViewerLoaded(context).then(function() {
52543 service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
52549 function filterData(detectedFeatures) {
52550 var fromDate = context.photos().fromDate();
52551 var toDate = context.photos().toDate();
52553 var fromTimestamp = new Date(fromDate).getTime();
52554 detectedFeatures = detectedFeatures.filter(function(feature3) {
52555 return new Date(feature3.last_seen_at).getTime() >= fromTimestamp;
52559 var toTimestamp = new Date(toDate).getTime();
52560 detectedFeatures = detectedFeatures.filter(function(feature3) {
52561 return new Date(feature3.first_seen_at).getTime() <= toTimestamp;
52564 return detectedFeatures;
52566 function update() {
52567 const service = getService();
52568 let data = service ? service.signs(projection2) : [];
52569 data = filterData(data);
52570 const transform2 = svgPointTransform(projection2);
52571 const signs = layer.selectAll(".icon-sign").data(data, function(d2) {
52574 signs.exit().remove();
52575 const enter = signs.enter().append("g").attr("class", "icon-sign icon-detected").on("click", click);
52576 enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d2) {
52577 return "#" + d2.value;
52579 enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
52580 signs.merge(enter).attr("transform", transform2);
52582 function drawSigns(selection2) {
52583 const enabled = svgMapillarySigns.enabled;
52584 const service = getService();
52585 layer = selection2.selectAll(".layer-mapillary-signs").data(service ? [0] : []);
52586 layer.exit().remove();
52587 layer = layer.enter().append("g").attr("class", "layer-mapillary-signs layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
52589 if (service && ~~context.map().zoom() >= minZoom4) {
52592 service.loadSigns(projection2);
52593 service.showSignDetections(true);
52597 } else if (service) {
52598 service.showSignDetections(false);
52601 drawSigns.enabled = function(_2) {
52602 if (!arguments.length)
52603 return svgMapillarySigns.enabled;
52604 svgMapillarySigns.enabled = _2;
52605 if (svgMapillarySigns.enabled) {
52607 context.photos().on("change.mapillary_signs", update);
52610 context.photos().on("change.mapillary_signs", null);
52612 dispatch14.call("change");
52615 drawSigns.supported = function() {
52616 return !!getService();
52618 drawSigns.rendered = function(zoom) {
52619 return zoom >= minZoom4;
52625 // modules/svg/mapillary_map_features.js
52626 function svgMapillaryMapFeatures(projection2, context, dispatch14) {
52627 const throttledRedraw = throttle_default(function() {
52628 dispatch14.call("change");
52630 const minZoom4 = 12;
52631 let layer = select_default2(null);
52634 if (svgMapillaryMapFeatures.initialized)
52636 svgMapillaryMapFeatures.enabled = false;
52637 svgMapillaryMapFeatures.initialized = true;
52639 function getService() {
52640 if (services.mapillary && !_mapillary) {
52641 _mapillary = services.mapillary;
52642 _mapillary.event.on("loadedMapFeatures", throttledRedraw);
52643 } else if (!services.mapillary && _mapillary) {
52648 function showLayer() {
52649 const service = getService();
52652 service.loadObjectResources(context);
52655 function hideLayer() {
52656 throttledRedraw.cancel();
52659 function editOn() {
52660 layer.style("display", "block");
52662 function editOff() {
52663 layer.selectAll(".icon-map-feature").remove();
52664 layer.style("display", "none");
52666 function click(d3_event, d2) {
52667 const service = getService();
52670 context.map().centerEase(d2.loc);
52671 const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
52672 service.getDetections(d2.id).then((detections) => {
52673 if (detections.length) {
52674 const imageId = detections[0].image.id;
52675 if (imageId === selectedImageId) {
52676 service.highlightDetection(detections[0]).selectImage(context, imageId);
52678 service.ensureViewerLoaded(context).then(function() {
52679 service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
52685 function filterData(detectedFeatures) {
52686 const fromDate = context.photos().fromDate();
52687 const toDate = context.photos().toDate();
52689 detectedFeatures = detectedFeatures.filter(function(feature3) {
52690 return new Date(feature3.last_seen_at).getTime() >= new Date(fromDate).getTime();
52694 detectedFeatures = detectedFeatures.filter(function(feature3) {
52695 return new Date(feature3.first_seen_at).getTime() <= new Date(toDate).getTime();
52698 return detectedFeatures;
52700 function update() {
52701 const service = getService();
52702 let data = service ? service.mapFeatures(projection2) : [];
52703 data = filterData(data);
52704 const transform2 = svgPointTransform(projection2);
52705 const mapFeatures = layer.selectAll(".icon-map-feature").data(data, function(d2) {
52708 mapFeatures.exit().remove();
52709 const enter = mapFeatures.enter().append("g").attr("class", "icon-map-feature icon-detected").on("click", click);
52710 enter.append("title").text(function(d2) {
52711 var id2 = d2.value.replace(/--/g, ".").replace(/-/g, "_");
52712 return _t("mapillary_map_features." + id2);
52714 enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d2) {
52715 if (d2.value === "object--billboard") {
52716 return "#object--sign--advertisement";
52718 return "#" + d2.value;
52720 enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
52721 mapFeatures.merge(enter).attr("transform", transform2);
52723 function drawMapFeatures(selection2) {
52724 const enabled = svgMapillaryMapFeatures.enabled;
52725 const service = getService();
52726 layer = selection2.selectAll(".layer-mapillary-map-features").data(service ? [0] : []);
52727 layer.exit().remove();
52728 layer = layer.enter().append("g").attr("class", "layer-mapillary-map-features layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
52730 if (service && ~~context.map().zoom() >= minZoom4) {
52733 service.loadMapFeatures(projection2);
52734 service.showFeatureDetections(true);
52738 } else if (service) {
52739 service.showFeatureDetections(false);
52742 drawMapFeatures.enabled = function(_2) {
52743 if (!arguments.length)
52744 return svgMapillaryMapFeatures.enabled;
52745 svgMapillaryMapFeatures.enabled = _2;
52746 if (svgMapillaryMapFeatures.enabled) {
52748 context.photos().on("change.mapillary_map_features", update);
52751 context.photos().on("change.mapillary_map_features", null);
52753 dispatch14.call("change");
52756 drawMapFeatures.supported = function() {
52757 return !!getService();
52759 drawMapFeatures.rendered = function(zoom) {
52760 return zoom >= minZoom4;
52763 return drawMapFeatures;
52766 // modules/svg/kartaview_images.js
52767 function svgKartaviewImages(projection2, context, dispatch14) {
52768 var throttledRedraw = throttle_default(function() {
52769 dispatch14.call("change");
52772 var minMarkerZoom = 16;
52773 var minViewfieldZoom2 = 18;
52774 var layer = select_default2(null);
52777 if (svgKartaviewImages.initialized)
52779 svgKartaviewImages.enabled = false;
52780 svgKartaviewImages.initialized = true;
52782 function getService() {
52783 if (services.kartaview && !_kartaview) {
52784 _kartaview = services.kartaview;
52785 _kartaview.event.on("loadedImages", throttledRedraw);
52786 } else if (!services.kartaview && _kartaview) {
52791 function showLayer() {
52792 var service = getService();
52796 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
52797 dispatch14.call("change");
52800 function hideLayer() {
52801 throttledRedraw.cancel();
52802 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52804 function editOn() {
52805 layer.style("display", "block");
52807 function editOff() {
52808 layer.selectAll(".viewfield-group").remove();
52809 layer.style("display", "none");
52811 function click(d3_event, d2) {
52812 var service = getService();
52815 service.ensureViewerLoaded(context).then(function() {
52816 service.selectImage(context, d2.key).showViewer(context);
52818 context.map().centerEase(d2.loc);
52820 function mouseover(d3_event, d2) {
52821 var service = getService();
52823 service.setStyles(context, d2);
52825 function mouseout() {
52826 var service = getService();
52828 service.setStyles(context, null);
52830 function transform2(d2) {
52831 var t2 = svgPointTransform(projection2)(d2);
52833 t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
52837 function filterImages(images) {
52838 var fromDate = context.photos().fromDate();
52839 var toDate = context.photos().toDate();
52840 var usernames = context.photos().usernames();
52842 var fromTimestamp = new Date(fromDate).getTime();
52843 images = images.filter(function(item) {
52844 return new Date(item.captured_at).getTime() >= fromTimestamp;
52848 var toTimestamp = new Date(toDate).getTime();
52849 images = images.filter(function(item) {
52850 return new Date(item.captured_at).getTime() <= toTimestamp;
52854 images = images.filter(function(item) {
52855 return usernames.indexOf(item.captured_by) !== -1;
52860 function filterSequences(sequences) {
52861 var fromDate = context.photos().fromDate();
52862 var toDate = context.photos().toDate();
52863 var usernames = context.photos().usernames();
52865 var fromTimestamp = new Date(fromDate).getTime();
52866 sequences = sequences.filter(function(image) {
52867 return new Date(image.properties.captured_at).getTime() >= fromTimestamp;
52871 var toTimestamp = new Date(toDate).getTime();
52872 sequences = sequences.filter(function(image) {
52873 return new Date(image.properties.captured_at).getTime() <= toTimestamp;
52877 sequences = sequences.filter(function(image) {
52878 return usernames.indexOf(image.properties.captured_by) !== -1;
52883 function update() {
52884 var viewer = context.container().select(".photoviewer");
52885 var selected = viewer.empty() ? void 0 : viewer.datum();
52886 var z2 = ~~context.map().zoom();
52887 var showMarkers = z2 >= minMarkerZoom;
52888 var showViewfields = z2 >= minViewfieldZoom2;
52889 var service = getService();
52890 var sequences = [];
52892 if (context.photos().showsFlat()) {
52893 sequences = service ? service.sequences(projection2) : [];
52894 images = service && showMarkers ? service.images(projection2) : [];
52895 sequences = filterSequences(sequences);
52896 images = filterImages(images);
52898 var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
52899 return d2.properties.key;
52901 traces.exit().remove();
52902 traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
52903 var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
52906 groups.exit().remove();
52907 var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
52908 groupsEnter.append("g").attr("class", "viewfield-scale");
52909 var markers = groups.merge(groupsEnter).sort(function(a2, b2) {
52910 return a2 === selected ? 1 : b2 === selected ? -1 : b2.loc[1] - a2.loc[1];
52911 }).attr("transform", transform2).select(".viewfield-scale");
52912 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
52913 var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
52914 viewfields.exit().remove();
52915 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z");
52917 function drawImages(selection2) {
52918 var enabled = svgKartaviewImages.enabled, service = getService();
52919 layer = selection2.selectAll(".layer-kartaview").data(service ? [0] : []);
52920 layer.exit().remove();
52921 var layerEnter = layer.enter().append("g").attr("class", "layer-kartaview").style("display", enabled ? "block" : "none");
52922 layerEnter.append("g").attr("class", "sequences");
52923 layerEnter.append("g").attr("class", "markers");
52924 layer = layerEnter.merge(layer);
52926 if (service && ~~context.map().zoom() >= minZoom4) {
52929 service.loadImages(projection2);
52935 drawImages.enabled = function(_2) {
52936 if (!arguments.length)
52937 return svgKartaviewImages.enabled;
52938 svgKartaviewImages.enabled = _2;
52939 if (svgKartaviewImages.enabled) {
52941 context.photos().on("change.kartaview_images", update);
52944 context.photos().on("change.kartaview_images", null);
52946 dispatch14.call("change");
52949 drawImages.supported = function() {
52950 return !!getService();
52952 drawImages.rendered = function(zoom) {
52953 return zoom >= minZoom4;
52959 // modules/svg/mapilio_images.js
52960 function svgMapilioImages(projection2, context, dispatch14) {
52961 const throttledRedraw = throttle_default(function() {
52962 dispatch14.call("change");
52964 const minZoom4 = 12;
52965 let layer = select_default2(null);
52967 const viewFieldZoomLevel = 18;
52969 if (svgMapilioImages.initialized)
52971 svgMapilioImages.enabled = false;
52972 svgMapilioImages.initialized = true;
52974 function getService() {
52975 if (services.mapilio && !_mapilio) {
52976 _mapilio = services.mapilio;
52977 _mapilio.event.on("loadedImages", throttledRedraw);
52978 } else if (!services.mapilio && _mapilio) {
52983 function showLayer() {
52984 const service = getService();
52988 layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
52989 dispatch14.call("change");
52992 function hideLayer() {
52993 throttledRedraw.cancel();
52994 layer.transition().duration(250).style("opacity", 0).on("end", editOff);
52996 function transform2(d2) {
52997 let t2 = svgPointTransform(projection2)(d2);
52999 t2 += " rotate(" + Math.floor(d2.heading) + ",0,0)";
53003 function editOn() {
53004 layer.style("display", "block");
53006 function editOff() {
53007 layer.selectAll(".viewfield-group").remove();
53008 layer.style("display", "none");
53010 function click(d3_event, image) {
53011 const service = getService();
53014 service.ensureViewerLoaded(context, image.id).then(function() {
53015 service.selectImage(context, image.id).showViewer(context);
53017 context.map().centerEase(image.loc);
53019 function mouseover(d3_event, image) {
53020 const service = getService();
53022 service.setStyles(context, image);
53024 function mouseout() {
53025 const service = getService();
53027 service.setStyles(context, null);
53029 function update() {
53030 const z2 = ~~context.map().zoom();
53031 const showViewfields = z2 >= viewFieldZoomLevel;
53032 const service = getService();
53033 let sequences = service ? service.sequences(projection2) : [];
53034 let images = service ? service.images(projection2) : [];
53035 let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
53036 return d2.properties.id;
53038 traces.exit().remove();
53039 traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
53040 const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
53043 groups.exit().remove();
53044 const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
53045 groupsEnter.append("g").attr("class", "viewfield-scale");
53046 const markers = groups.merge(groupsEnter).sort(function(a2, b2) {
53047 return b2.loc[1] - a2.loc[1];
53048 }).attr("transform", transform2).select(".viewfield-scale");
53049 markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
53050 const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
53051 viewfields.exit().remove();
53052 viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
53053 function viewfieldPath() {
53054 if (this.parentNode.__data__.isPano) {
53055 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
53057 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
53061 function drawImages(selection2) {
53062 const enabled = svgMapilioImages.enabled;
53063 const service = getService();
53064 layer = selection2.selectAll(".layer-mapilio").data(service ? [0] : []);
53065 layer.exit().remove();
53066 const layerEnter = layer.enter().append("g").attr("class", "layer-mapilio").style("display", enabled ? "block" : "none");
53067 layerEnter.append("g").attr("class", "sequences");
53068 layerEnter.append("g").attr("class", "markers");
53069 layer = layerEnter.merge(layer);
53071 if (service && ~~context.map().zoom() >= minZoom4) {
53074 service.loadImages(projection2);
53075 service.loadLines(projection2);
53081 drawImages.enabled = function(_2) {
53082 if (!arguments.length)
53083 return svgMapilioImages.enabled;
53084 svgMapilioImages.enabled = _2;
53085 if (svgMapilioImages.enabled) {
53087 context.photos().on("change.mapilio_images", null);
53090 context.photos().on("change.mapilio_images", null);
53092 dispatch14.call("change");
53095 drawImages.supported = function() {
53096 return !!getService();
53098 drawImages.rendered = function(zoom) {
53099 return zoom >= minZoom4;
53105 // modules/svg/osm.js
53106 function svgOsm(projection2, context, dispatch14) {
53107 var enabled = true;
53108 function drawOsm(selection2) {
53109 selection2.selectAll(".layer-osm").data(["covered", "areas", "lines", "points", "labels"]).enter().append("g").attr("class", function(d2) {
53110 return "layer-osm " + d2;
53112 selection2.selectAll(".layer-osm.points").selectAll(".points-group").data(["points", "midpoints", "vertices", "turns"]).enter().append("g").attr("class", function(d2) {
53113 return "points-group " + d2;
53116 function showLayer() {
53117 var layer = context.surface().selectAll(".data-layer.osm");
53119 layer.classed("disabled", false).style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
53120 dispatch14.call("change");
53123 function hideLayer() {
53124 var layer = context.surface().selectAll(".data-layer.osm");
53126 layer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
53127 layer.classed("disabled", true);
53128 dispatch14.call("change");
53131 drawOsm.enabled = function(val) {
53132 if (!arguments.length)
53140 dispatch14.call("change");
53146 // modules/svg/notes.js
53147 var _notesEnabled = false;
53149 function svgNotes(projection2, context, dispatch14) {
53151 dispatch14 = dispatch_default("change");
53153 var throttledRedraw = throttle_default(function() {
53154 dispatch14.call("change");
53157 var touchLayer = select_default2(null);
53158 var drawLayer = select_default2(null);
53159 var _notesVisible = false;
53160 function markerPath(selection2, klass) {
53161 selection2.attr("class", klass).attr("transform", "translate(-8, -22)").attr("d", "m17.5,0l-15,0c-1.37,0 -2.5,1.12 -2.5,2.5l0,11.25c0,1.37 1.12,2.5 2.5,2.5l3.75,0l0,3.28c0,0.38 0.43,0.6 0.75,0.37l4.87,-3.65l5.62,0c1.37,0 2.5,-1.12 2.5,-2.5l0,-11.25c0,-1.37 -1.12,-2.5 -2.5,-2.5z");
53163 function getService() {
53164 if (services.osm && !_osmService) {
53165 _osmService = services.osm;
53166 _osmService.on("loadedNotes", throttledRedraw);
53167 } else if (!services.osm && _osmService) {
53168 _osmService = null;
53170 return _osmService;
53172 function editOn() {
53173 if (!_notesVisible) {
53174 _notesVisible = true;
53175 drawLayer.style("display", "block");
53178 function editOff() {
53179 if (_notesVisible) {
53180 _notesVisible = false;
53181 drawLayer.style("display", "none");
53182 drawLayer.selectAll(".note").remove();
53183 touchLayer.selectAll(".note").remove();
53186 function layerOn() {
53188 drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
53189 dispatch14.call("change");
53192 function layerOff() {
53193 throttledRedraw.cancel();
53194 drawLayer.interrupt();
53195 touchLayer.selectAll(".note").remove();
53196 drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
53198 dispatch14.call("change");
53201 function updateMarkers() {
53202 if (!_notesVisible || !_notesEnabled)
53204 var service = getService();
53205 var selectedID = context.selectedNoteID();
53206 var data = service ? service.notes(projection2) : [];
53207 var getTransform = svgPointTransform(projection2);
53208 var notes = drawLayer.selectAll(".note").data(data, function(d2) {
53209 return d2.status + d2.id;
53211 notes.exit().remove();
53212 var notesEnter = notes.enter().append("g").attr("class", function(d2) {
53213 return "note note-" + d2.id + " " + d2.status;
53214 }).classed("new", function(d2) {
53217 notesEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
53218 notesEnter.append("path").call(markerPath, "shadow");
53219 notesEnter.append("use").attr("class", "note-fill").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").attr("xlink:href", "#iD-icon-note");
53220 notesEnter.selectAll(".icon-annotation").data(function(d2) {
53222 }).enter().append("use").attr("class", "icon-annotation").attr("width", "10px").attr("height", "10px").attr("x", "-3px").attr("y", "-19px").attr("xlink:href", function(d2) {
53224 return "#iD-icon-plus";
53225 if (d2.status === "open")
53226 return "#iD-icon-close";
53227 return "#iD-icon-apply";
53229 notes.merge(notesEnter).sort(sortY).classed("selected", function(d2) {
53230 var mode = context.mode();
53231 var isMoving = mode && mode.id === "drag-note";
53232 return !isMoving && d2.id === selectedID;
53233 }).attr("transform", getTransform);
53234 if (touchLayer.empty())
53236 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53237 var targets = touchLayer.selectAll(".note").data(data, function(d2) {
53240 targets.exit().remove();
53241 targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", function(d2) {
53242 var newClass = d2.id < 0 ? "new" : "";
53243 return "note target note-" + d2.id + " " + fillClass + newClass;
53244 }).attr("transform", getTransform);
53245 function sortY(a2, b2) {
53246 if (a2.id === selectedID)
53248 if (b2.id === selectedID)
53250 return b2.loc[1] - a2.loc[1];
53253 function drawNotes(selection2) {
53254 var service = getService();
53255 var surface = context.surface();
53256 if (surface && !surface.empty()) {
53257 touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
53259 drawLayer = selection2.selectAll(".layer-notes").data(service ? [0] : []);
53260 drawLayer.exit().remove();
53261 drawLayer = drawLayer.enter().append("g").attr("class", "layer-notes").style("display", _notesEnabled ? "block" : "none").merge(drawLayer);
53262 if (_notesEnabled) {
53263 if (service && ~~context.map().zoom() >= minZoom4) {
53265 service.loadNotes(projection2);
53272 drawNotes.enabled = function(val) {
53273 if (!arguments.length)
53274 return _notesEnabled;
53275 _notesEnabled = val;
53276 if (_notesEnabled) {
53280 if (context.selectedNoteID()) {
53281 context.enter(modeBrowse(context));
53284 dispatch14.call("change");
53290 // modules/svg/touch.js
53291 function svgTouch() {
53292 function drawTouch(selection2) {
53293 selection2.selectAll(".layer-touch").data(["areas", "lines", "points", "turns", "markers"]).enter().append("g").attr("class", function(d2) {
53294 return "layer-touch " + d2;
53300 // modules/util/dimensions.js
53301 function refresh(selection2, node) {
53302 var cr = node.getBoundingClientRect();
53303 var prop = [cr.width, cr.height];
53304 selection2.property("__dimensions__", prop);
53307 function utilGetDimensions(selection2, force) {
53308 if (!selection2 || selection2.empty()) {
53311 var node = selection2.node(), cached = selection2.property("__dimensions__");
53312 return !cached || force ? refresh(selection2, node) : cached;
53314 function utilSetDimensions(selection2, dimensions) {
53315 if (!selection2 || selection2.empty()) {
53318 var node = selection2.node();
53319 if (dimensions === null) {
53320 refresh(selection2, node);
53323 return selection2.property("__dimensions__", [dimensions[0], dimensions[1]]).attr("width", dimensions[0]).attr("height", dimensions[1]);
53326 // modules/svg/layers.js
53327 function svgLayers(projection2, context) {
53328 var dispatch14 = dispatch_default("change");
53329 var svg2 = select_default2(null);
53331 { id: "osm", layer: svgOsm(projection2, context, dispatch14) },
53332 { id: "notes", layer: svgNotes(projection2, context, dispatch14) },
53333 { id: "data", layer: svgData(projection2, context, dispatch14) },
53334 { id: "keepRight", layer: svgKeepRight(projection2, context, dispatch14) },
53335 { id: "improveOSM", layer: svgImproveOSM(projection2, context, dispatch14) },
53336 { id: "osmose", layer: svgOsmose(projection2, context, dispatch14) },
53337 { id: "streetside", layer: svgStreetside(projection2, context, dispatch14) },
53338 { id: "mapillary", layer: svgMapillaryImages(projection2, context, dispatch14) },
53339 { id: "mapillary-position", layer: svgMapillaryPosition(projection2, context, dispatch14) },
53340 { id: "mapillary-map-features", layer: svgMapillaryMapFeatures(projection2, context, dispatch14) },
53341 { id: "mapillary-signs", layer: svgMapillarySigns(projection2, context, dispatch14) },
53342 { id: "kartaview", layer: svgKartaviewImages(projection2, context, dispatch14) },
53343 { id: "mapilio", layer: svgMapilioImages(projection2, context, dispatch14) },
53344 { id: "vegbilder", layer: svgVegbilder(projection2, context, dispatch14) },
53345 { id: "local-photos", layer: svgLocalPhotos(projection2, context, dispatch14) },
53346 { id: "debug", layer: svgDebug(projection2, context, dispatch14) },
53347 { id: "geolocate", layer: svgGeolocate(projection2, context, dispatch14) },
53348 { id: "touch", layer: svgTouch(projection2, context, dispatch14) }
53350 function drawLayers(selection2) {
53351 svg2 = selection2.selectAll(".surface").data([0]);
53352 svg2 = svg2.enter().append("svg").attr("class", "surface").merge(svg2);
53353 var defs = svg2.selectAll(".surface-defs").data([0]);
53354 defs.enter().append("defs").attr("class", "surface-defs");
53355 var groups = svg2.selectAll(".data-layer").data(_layers);
53356 groups.exit().remove();
53357 groups.enter().append("g").attr("class", function(d2) {
53358 return "data-layer " + d2.id;
53359 }).merge(groups).each(function(d2) {
53360 select_default2(this).call(d2.layer);
53363 drawLayers.all = function() {
53366 drawLayers.layer = function(id2) {
53367 var obj = _layers.find(function(o2) {
53368 return o2.id === id2;
53370 return obj && obj.layer;
53372 drawLayers.only = function(what) {
53373 var arr = [].concat(what);
53374 var all = _layers.map(function(layer) {
53377 return drawLayers.remove(utilArrayDifference(all, arr));
53379 drawLayers.remove = function(what) {
53380 var arr = [].concat(what);
53381 arr.forEach(function(id2) {
53382 _layers = _layers.filter(function(o2) {
53383 return o2.id !== id2;
53386 dispatch14.call("change");
53389 drawLayers.add = function(what) {
53390 var arr = [].concat(what);
53391 arr.forEach(function(obj) {
53392 if ("id" in obj && "layer" in obj) {
53396 dispatch14.call("change");
53399 drawLayers.dimensions = function(val) {
53400 if (!arguments.length)
53401 return utilGetDimensions(svg2);
53402 utilSetDimensions(svg2, val);
53405 return utilRebind(drawLayers, dispatch14, "on");
53408 // modules/svg/lines.js
53409 var import_fast_deep_equal6 = __toESM(require_fast_deep_equal());
53410 function svgLines(projection2, context) {
53411 var detected = utilDetect();
53412 var highway_stack = {
53426 function drawTargets(selection2, graph, entities, filter2) {
53427 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
53428 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
53429 var getPath = svgPath(projection2).geojson;
53430 var activeID = context.activeID();
53431 var base = context.history().base();
53432 var data = { targets: [], nopes: [] };
53433 entities.forEach(function(way) {
53434 var features = svgSegmentWay(way, graph, activeID);
53435 data.targets.push.apply(data.targets, features.passive);
53436 data.nopes.push.apply(data.nopes, features.active);
53438 var targetData = data.targets.filter(getPath);
53439 var targets = selection2.selectAll(".line.target-allowed").filter(function(d2) {
53440 return filter2(d2.properties.entity);
53441 }).data(targetData, function key(d2) {
53444 targets.exit().remove();
53445 var segmentWasEdited = function(d2) {
53446 var wayID = d2.properties.entity.id;
53447 if (!base.entities[wayID] || !(0, import_fast_deep_equal6.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
53450 return d2.properties.nodes.some(function(n3) {
53451 return !base.entities[n3.id] || !(0, import_fast_deep_equal6.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
53454 targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d2) {
53455 return "way line target target-allowed " + targetClass + d2.id;
53456 }).classed("segment-edited", segmentWasEdited);
53457 var nopeData = data.nopes.filter(getPath);
53458 var nopes = selection2.selectAll(".line.target-nope").filter(function(d2) {
53459 return filter2(d2.properties.entity);
53460 }).data(nopeData, function key(d2) {
53463 nopes.exit().remove();
53464 nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d2) {
53465 return "way line target target-nope " + nopeClass + d2.id;
53466 }).classed("segment-edited", segmentWasEdited);
53468 function drawLines(selection2, graph, entities, filter2) {
53469 var base = context.history().base();
53470 function waystack(a2, b2) {
53471 var selected = context.selectedIDs();
53472 var scoreA = selected.indexOf(a2.id) !== -1 ? 20 : 0;
53473 var scoreB = selected.indexOf(b2.id) !== -1 ? 20 : 0;
53474 if (a2.tags.highway) {
53475 scoreA -= highway_stack[a2.tags.highway];
53477 if (b2.tags.highway) {
53478 scoreB -= highway_stack[b2.tags.highway];
53480 return scoreA - scoreB;
53482 function drawLineGroup(selection3, klass, isSelected) {
53483 var mode = context.mode();
53484 var isDrawing = mode && /^draw/.test(mode.id);
53485 var selectedClass = !isDrawing && isSelected ? "selected " : "";
53486 var lines = selection3.selectAll("path").filter(filter2).data(getPathData(isSelected), osmEntity.key);
53487 lines.exit().remove();
53488 lines.enter().append("path").attr("class", function(d2) {
53489 var prefix = "way line";
53490 if (!d2.hasInterestingTags()) {
53491 var parentRelations = graph.parentRelations(d2);
53492 var parentMultipolygons = parentRelations.filter(function(relation) {
53493 return relation.isMultipolygon();
53495 if (parentMultipolygons.length > 0 && // and only multipolygon relations
53496 parentRelations.length === parentMultipolygons.length) {
53497 prefix = "relation area";
53500 var oldMPClass = oldMultiPolygonOuters[d2.id] ? "old-multipolygon " : "";
53501 return prefix + " " + klass + " " + selectedClass + oldMPClass + d2.id;
53502 }).classed("added", function(d2) {
53503 return !base.entities[d2.id];
53504 }).classed("geometry-edited", function(d2) {
53505 return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal6.default)(graph.entities[d2.id].nodes, base.entities[d2.id].nodes);
53506 }).classed("retagged", function(d2) {
53507 return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal6.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
53508 }).call(svgTagClasses()).merge(lines).sort(waystack).attr("d", getPath).call(svgTagClasses().tags(svgRelationMemberTags(graph)));
53511 function getPathData(isSelected) {
53512 return function() {
53513 var layer = this.parentNode.__data__;
53514 var data = pathdata[layer] || [];
53515 return data.filter(function(d2) {
53517 return context.selectedIDs().indexOf(d2.id) !== -1;
53519 return context.selectedIDs().indexOf(d2.id) === -1;
53524 function addMarkers(layergroup, pathclass, groupclass, groupdata, marker) {
53525 var markergroup = layergroup.selectAll("g." + groupclass).data([pathclass]);
53526 markergroup = markergroup.enter().append("g").attr("class", groupclass).merge(markergroup);
53527 var markers = markergroup.selectAll("path").filter(filter2).data(
53529 return groupdata[this.parentNode.__data__] || [];
53532 return [d2.id, d2.index];
53535 markers.exit().remove();
53536 markers = markers.enter().append("path").attr("class", pathclass).merge(markers).attr("marker-mid", marker).attr("d", function(d2) {
53540 markers.each(function() {
53541 this.parentNode.insertBefore(this, this);
53545 var getPath = svgPath(projection2, graph);
53547 var onewaydata = {};
53548 var sideddata = {};
53549 var oldMultiPolygonOuters = {};
53550 for (var i3 = 0; i3 < entities.length; i3++) {
53551 var entity = entities[i3];
53552 var outer = osmOldMultipolygonOuterMember(entity, graph);
53554 ways.push(entity.mergeTags(outer.tags));
53555 oldMultiPolygonOuters[outer.id] = true;
53556 } else if (entity.geometry(graph) === "line" || entity.geometry(graph) === "area" && entity.sidednessIdentifier && entity.sidednessIdentifier() === "coastline") {
53560 ways = ways.filter(getPath);
53561 var pathdata = utilArrayGroupBy(ways, function(way) {
53562 return way.layer();
53564 Object.keys(pathdata).forEach(function(k2) {
53565 var v2 = pathdata[k2];
53566 var onewayArr = v2.filter(function(d2) {
53567 return d2.isOneWay();
53569 var onewaySegments = svgMarkerSegments(
53573 function shouldReverse(entity2) {
53574 return entity2.tags.oneway === "-1";
53576 function bothDirections(entity2) {
53577 return entity2.tags.oneway === "reversible" || entity2.tags.oneway === "alternating";
53580 onewaydata[k2] = utilArrayFlatten(onewayArr.map(onewaySegments));
53581 var sidedArr = v2.filter(function(d2) {
53582 return d2.isSided();
53584 var sidedSegments = svgMarkerSegments(
53588 function shouldReverse() {
53591 function bothDirections() {
53595 sideddata[k2] = utilArrayFlatten(sidedArr.map(sidedSegments));
53597 var covered = selection2.selectAll(".layer-osm.covered");
53598 var uncovered = selection2.selectAll(".layer-osm.lines");
53599 var touchLayer = selection2.selectAll(".layer-touch.lines");
53600 [covered, uncovered].forEach(function(selection3) {
53601 var range3 = selection3 === covered ? range(-10, 0) : range(0, 11);
53602 var layergroup = selection3.selectAll("g.layergroup").data(range3);
53603 layergroup = layergroup.enter().append("g").attr("class", function(d2) {
53604 return "layergroup layer" + String(d2);
53605 }).merge(layergroup);
53606 layergroup.selectAll("g.linegroup").data(["shadow", "casing", "stroke", "shadow-highlighted", "casing-highlighted", "stroke-highlighted"]).enter().append("g").attr("class", function(d2) {
53607 return "linegroup line-" + d2;
53609 layergroup.selectAll("g.line-shadow").call(drawLineGroup, "shadow", false);
53610 layergroup.selectAll("g.line-casing").call(drawLineGroup, "casing", false);
53611 layergroup.selectAll("g.line-stroke").call(drawLineGroup, "stroke", false);
53612 layergroup.selectAll("g.line-shadow-highlighted").call(drawLineGroup, "shadow", true);
53613 layergroup.selectAll("g.line-casing-highlighted").call(drawLineGroup, "casing", true);
53614 layergroup.selectAll("g.line-stroke-highlighted").call(drawLineGroup, "stroke", true);
53615 addMarkers(layergroup, "oneway", "onewaygroup", onewaydata, "url(#ideditor-oneway-marker)");
53621 function marker(d2) {
53622 var category = graph.entity(d2.id).sidednessIdentifier();
53623 return "url(#ideditor-sided-marker-" + category + ")";
53627 touchLayer.call(drawTargets, graph, ways, filter2);
53632 // modules/svg/midpoints.js
53633 function svgMidpoints(projection2, context) {
53634 var targetRadius = 8;
53635 function drawTargets(selection2, graph, entities, filter2) {
53636 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53637 var getTransform = svgPointTransform(projection2).geojson;
53638 var data = entities.map(function(midpoint) {
53648 coordinates: midpoint.loc
53652 var targets = selection2.selectAll(".midpoint.target").filter(function(d2) {
53653 return filter2(d2.properties.entity);
53654 }).data(data, function key(d2) {
53657 targets.exit().remove();
53658 targets.enter().append("circle").attr("r", targetRadius).merge(targets).attr("class", function(d2) {
53659 return "node midpoint target " + fillClass + d2.id;
53660 }).attr("transform", getTransform);
53662 function drawMidpoints(selection2, graph, entities, filter2, extent) {
53663 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.midpoints");
53664 var touchLayer = selection2.selectAll(".layer-touch.points");
53665 var mode = context.mode();
53666 if (mode && mode.id !== "select" || !context.map().withinEditableZoom()) {
53667 drawLayer.selectAll(".midpoint").remove();
53668 touchLayer.selectAll(".midpoint.target").remove();
53671 var poly = extent.polygon();
53672 var midpoints = {};
53673 for (var i3 = 0; i3 < entities.length; i3++) {
53674 var entity = entities[i3];
53675 if (entity.type !== "way")
53677 if (!filter2(entity))
53679 if (context.selectedIDs().indexOf(entity.id) < 0)
53681 var nodes = graph.childNodes(entity);
53682 for (var j3 = 0; j3 < nodes.length - 1; j3++) {
53683 var a2 = nodes[j3];
53684 var b2 = nodes[j3 + 1];
53685 var id2 = [a2.id, b2.id].sort().join("-");
53686 if (midpoints[id2]) {
53687 midpoints[id2].parents.push(entity);
53688 } else if (geoVecLength(projection2(a2.loc), projection2(b2.loc)) > 40) {
53689 var point2 = geoVecInterp(a2.loc, b2.loc, 0.5);
53691 if (extent.intersects(point2)) {
53694 for (var k2 = 0; k2 < 4; k2++) {
53695 point2 = geoLineIntersection([a2.loc, b2.loc], [poly[k2], poly[k2 + 1]]);
53696 if (point2 && geoVecLength(projection2(a2.loc), projection2(point2)) > 20 && geoVecLength(projection2(b2.loc), projection2(point2)) > 20) {
53707 edge: [a2.id, b2.id],
53714 function midpointFilter(d2) {
53715 if (midpoints[d2.id])
53717 for (var i4 = 0; i4 < d2.parents.length; i4++) {
53718 if (filter2(d2.parents[i4])) {
53724 var groups = drawLayer.selectAll(".midpoint").filter(midpointFilter).data(Object.values(midpoints), function(d2) {
53727 groups.exit().remove();
53728 var enter = groups.enter().insert("g", ":first-child").attr("class", "midpoint");
53729 enter.append("polygon").attr("points", "-6,8 10,0 -6,-8").attr("class", "shadow");
53730 enter.append("polygon").attr("points", "-3,4 5,0 -3,-4").attr("class", "fill");
53731 groups = groups.merge(enter).attr("transform", function(d2) {
53732 var translate = svgPointTransform(projection2);
53733 var a3 = graph.entity(d2.edge[0]);
53734 var b3 = graph.entity(d2.edge[1]);
53735 var angle2 = geoAngle(a3, b3, projection2) * (180 / Math.PI);
53736 return translate(d2) + " rotate(" + angle2 + ")";
53737 }).call(svgTagClasses().tags(
53739 return d2.parents[0].tags;
53742 groups.select("polygon.shadow");
53743 groups.select("polygon.fill");
53744 touchLayer.call(drawTargets, graph, Object.values(midpoints), midpointFilter);
53746 return drawMidpoints;
53749 // modules/svg/points.js
53750 var import_fast_deep_equal7 = __toESM(require_fast_deep_equal());
53751 function svgPoints(projection2, context) {
53752 function markerPath(selection2, klass) {
53753 selection2.attr("class", klass).attr("transform", "translate(-8, -23)").attr("d", "M 17,8 C 17,13 11,21 8.5,23.5 C 6,21 0,13 0,8 C 0,4 4,-0.5 8.5,-0.5 C 13,-0.5 17,4 17,8 z");
53755 function sortY(a2, b2) {
53756 return b2.loc[1] - a2.loc[1];
53758 function fastEntityKey(d2) {
53759 var mode = context.mode();
53760 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
53761 return isMoving ? d2.id : osmEntity.key(d2);
53763 function drawTargets(selection2, graph, entities, filter2) {
53764 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53765 var getTransform = svgPointTransform(projection2).geojson;
53766 var activeID = context.activeID();
53768 entities.forEach(function(node) {
53769 if (activeID === node.id)
53778 geometry: node.asGeoJSON()
53781 var targets = selection2.selectAll(".point.target").filter(function(d2) {
53782 return filter2(d2.properties.entity);
53783 }).data(data, function key(d2) {
53786 targets.exit().remove();
53787 targets.enter().append("rect").attr("x", -10).attr("y", -26).attr("width", 20).attr("height", 30).merge(targets).attr("class", function(d2) {
53788 return "node point target " + fillClass + d2.id;
53789 }).attr("transform", getTransform);
53791 function drawPoints(selection2, graph, entities, filter2) {
53792 var wireframe = context.surface().classed("fill-wireframe");
53793 var zoom = geoScaleToZoom(projection2.scale());
53794 var base = context.history().base();
53795 function renderAsPoint(entity) {
53796 return entity.geometry(graph) === "point" && !(zoom >= 18 && entity.directions(graph, projection2).length);
53798 var points = wireframe ? [] : entities.filter(renderAsPoint);
53799 points.sort(sortY);
53800 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.points");
53801 var touchLayer = selection2.selectAll(".layer-touch.points");
53802 var groups = drawLayer.selectAll("g.point").filter(filter2).data(points, fastEntityKey);
53803 groups.exit().remove();
53804 var enter = groups.enter().append("g").attr("class", function(d2) {
53805 return "node point " + d2.id;
53807 enter.append("path").call(markerPath, "shadow");
53808 enter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
53809 enter.append("path").call(markerPath, "stroke");
53810 enter.append("use").attr("transform", "translate(-5.5, -20)").attr("class", "icon").attr("width", "12px").attr("height", "12px");
53811 groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("added", function(d2) {
53812 return !base.entities[d2.id];
53813 }).classed("moved", function(d2) {
53814 return base.entities[d2.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d2.id].loc, base.entities[d2.id].loc);
53815 }).classed("retagged", function(d2) {
53816 return base.entities[d2.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
53817 }).call(svgTagClasses());
53818 groups.select(".shadow");
53819 groups.select(".stroke");
53820 groups.select(".icon").attr("xlink:href", function(entity) {
53821 var preset = _mainPresetIndex.match(entity, graph);
53822 var picon = preset && preset.icon;
53823 return picon ? "#" + picon : "";
53825 touchLayer.call(drawTargets, graph, points, filter2);
53830 // modules/svg/turns.js
53831 function svgTurns(projection2, context) {
53832 function icon2(turn) {
53833 var u2 = turn.u ? "-u" : "";
53835 return "#iD-turn-no" + u2;
53837 return "#iD-turn-only" + u2;
53838 return "#iD-turn-yes" + u2;
53840 function drawTurns(selection2, graph, turns) {
53841 function turnTransform(d2) {
53843 var toWay = graph.entity(d2.to.way);
53844 var toPoints = graph.childNodes(toWay).map(function(n3) {
53846 }).map(projection2);
53847 var toLength = geoPathLength(toPoints);
53848 var mid = toLength / 2;
53849 var toNode = graph.entity(d2.to.node);
53850 var toVertex = graph.entity(d2.to.vertex);
53851 var a2 = geoAngle(toVertex, toNode, projection2);
53852 var o2 = projection2(toVertex.loc);
53853 var r2 = d2.u ? 0 : !toWay.__via ? pxRadius : Math.min(mid, pxRadius);
53854 return "translate(" + (r2 * Math.cos(a2) + o2[0]) + "," + (r2 * Math.sin(a2) + o2[1]) + ") rotate(" + a2 * 180 / Math.PI + ")";
53856 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.turns");
53857 var touchLayer = selection2.selectAll(".layer-touch.turns");
53858 var groups = drawLayer.selectAll("g.turn").data(turns, function(d2) {
53861 groups.exit().remove();
53862 var groupsEnter = groups.enter().append("g").attr("class", function(d2) {
53863 return "turn " + d2.key;
53865 var turnsEnter = groupsEnter.filter(function(d2) {
53868 turnsEnter.append("rect").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
53869 turnsEnter.append("use").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
53870 var uEnter = groupsEnter.filter(function(d2) {
53873 uEnter.append("circle").attr("r", "16");
53874 uEnter.append("use").attr("transform", "translate(-16, -16)").attr("width", "32").attr("height", "32");
53875 groups = groups.merge(groupsEnter).attr("opacity", function(d2) {
53876 return d2.direct === false ? "0.7" : null;
53877 }).attr("transform", turnTransform);
53878 groups.select("use").attr("xlink:href", icon2);
53879 groups.select("rect");
53880 groups.select("circle");
53881 var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
53882 groups = touchLayer.selectAll("g.turn").data(turns, function(d2) {
53885 groups.exit().remove();
53886 groupsEnter = groups.enter().append("g").attr("class", function(d2) {
53887 return "turn " + d2.key;
53889 turnsEnter = groupsEnter.filter(function(d2) {
53892 turnsEnter.append("rect").attr("class", "target " + fillClass).attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
53893 uEnter = groupsEnter.filter(function(d2) {
53896 uEnter.append("circle").attr("class", "target " + fillClass).attr("r", "16");
53897 groups = groups.merge(groupsEnter).attr("transform", turnTransform);
53898 groups.select("rect");
53899 groups.select("circle");
53905 // modules/svg/vertices.js
53906 var import_fast_deep_equal8 = __toESM(require_fast_deep_equal());
53907 function svgVertices(projection2, context) {
53909 // z16-, z17, z18+, w/icon
53910 shadow: [6, 7.5, 7.5, 12],
53911 stroke: [2.5, 3.5, 3.5, 8],
53912 fill: [1, 1.5, 1.5, 1.5]
53914 var _currHoverTarget;
53915 var _currPersistent = {};
53916 var _currHover = {};
53917 var _prevHover = {};
53918 var _currSelected = {};
53919 var _prevSelected = {};
53921 function sortY(a2, b2) {
53922 return b2.loc[1] - a2.loc[1];
53924 function fastEntityKey(d2) {
53925 var mode = context.mode();
53926 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
53927 return isMoving ? d2.id : osmEntity.key(d2);
53929 function draw(selection2, graph, vertices, sets2, filter2) {
53930 sets2 = sets2 || { selected: {}, important: {}, hovered: {} };
53932 var directions = {};
53933 var wireframe = context.surface().classed("fill-wireframe");
53934 var zoom = geoScaleToZoom(projection2.scale());
53935 var z2 = zoom < 17 ? 0 : zoom < 18 ? 1 : 2;
53936 var activeID = context.activeID();
53937 var base = context.history().base();
53938 function getIcon(d2) {
53939 var entity = graph.entity(d2.id);
53940 if (entity.id in icons)
53941 return icons[entity.id];
53942 icons[entity.id] = entity.hasInterestingTags() && _mainPresetIndex.match(entity, graph).icon;
53943 return icons[entity.id];
53945 function getDirections(entity) {
53946 if (entity.id in directions)
53947 return directions[entity.id];
53948 var angles = entity.directions(graph, projection2);
53949 directions[entity.id] = angles.length ? angles : false;
53952 function updateAttributes(selection3) {
53953 ["shadow", "stroke", "fill"].forEach(function(klass) {
53954 var rads = radiuses[klass];
53955 selection3.selectAll("." + klass).each(function(entity) {
53956 var i3 = z2 && getIcon(entity);
53957 var r2 = rads[i3 ? 3 : z2];
53958 if (entity.id !== activeID && entity.isEndpoint(graph) && !entity.isConnected(graph)) {
53961 if (klass === "shadow") {
53962 _radii[entity.id] = r2;
53964 select_default2(this).attr("r", r2).attr("visibility", i3 && klass === "fill" ? "hidden" : null);
53968 vertices.sort(sortY);
53969 var groups = selection2.selectAll("g.vertex").filter(filter2).data(vertices, fastEntityKey);
53970 groups.exit().remove();
53971 var enter = groups.enter().append("g").attr("class", function(d2) {
53972 return "node vertex " + d2.id;
53974 enter.append("circle").attr("class", "shadow");
53975 enter.append("circle").attr("class", "stroke");
53976 enter.filter(function(d2) {
53977 return d2.hasInterestingTags();
53978 }).append("circle").attr("class", "fill");
53979 groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("sibling", function(d2) {
53980 return d2.id in sets2.selected;
53981 }).classed("shared", function(d2) {
53982 return graph.isShared(d2);
53983 }).classed("endpoint", function(d2) {
53984 return d2.isEndpoint(graph);
53985 }).classed("added", function(d2) {
53986 return !base.entities[d2.id];
53987 }).classed("moved", function(d2) {
53988 return base.entities[d2.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d2.id].loc, base.entities[d2.id].loc);
53989 }).classed("retagged", function(d2) {
53990 return base.entities[d2.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
53991 }).call(updateAttributes);
53992 var iconUse = groups.selectAll(".icon").data(function data(d2) {
53993 return zoom >= 17 && getIcon(d2) ? [d2] : [];
53995 iconUse.exit().remove();
53996 iconUse.enter().append("use").attr("class", "icon").attr("width", "12px").attr("height", "12px").attr("transform", "translate(-6, -6)").attr("xlink:href", function(d2) {
53997 var picon = getIcon(d2);
53998 return picon ? "#" + picon : "";
54000 var dgroups = groups.selectAll(".viewfieldgroup").data(function data(d2) {
54001 return zoom >= 18 && getDirections(d2) ? [d2] : [];
54003 dgroups.exit().remove();
54004 dgroups = dgroups.enter().insert("g", ".shadow").attr("class", "viewfieldgroup").merge(dgroups);
54005 var viewfields = dgroups.selectAll(".viewfield").data(getDirections, function key(d2) {
54006 return osmEntity.key(d2);
54008 viewfields.exit().remove();
54009 viewfields.enter().append("path").attr("class", "viewfield").attr("d", "M0,0H0").merge(viewfields).attr("marker-start", "url(#ideditor-viewfield-marker" + (wireframe ? "-wireframe" : "") + ")").attr("transform", function(d2) {
54010 return "rotate(" + d2 + ")";
54013 function drawTargets(selection2, graph, entities, filter2) {
54014 var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
54015 var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
54016 var getTransform = svgPointTransform(projection2).geojson;
54017 var activeID = context.activeID();
54018 var data = { targets: [], nopes: [] };
54019 entities.forEach(function(node) {
54020 if (activeID === node.id)
54022 var vertexType = svgPassiveVertex(node, graph, activeID);
54023 if (vertexType !== 0) {
54024 data.targets.push({
54031 geometry: node.asGeoJSON()
54036 id: node.id + "-nope",
54042 geometry: node.asGeoJSON()
54046 var targets = selection2.selectAll(".vertex.target-allowed").filter(function(d2) {
54047 return filter2(d2.properties.entity);
54048 }).data(data.targets, function key(d2) {
54051 targets.exit().remove();
54052 targets.enter().append("circle").attr("r", function(d2) {
54053 return _radii[d2.id] || radiuses.shadow[3];
54054 }).merge(targets).attr("class", function(d2) {
54055 return "node vertex target target-allowed " + targetClass + d2.id;
54056 }).attr("transform", getTransform);
54057 var nopes = selection2.selectAll(".vertex.target-nope").filter(function(d2) {
54058 return filter2(d2.properties.entity);
54059 }).data(data.nopes, function key(d2) {
54062 nopes.exit().remove();
54063 nopes.enter().append("circle").attr("r", function(d2) {
54064 return _radii[d2.properties.entity.id] || radiuses.shadow[3];
54065 }).merge(nopes).attr("class", function(d2) {
54066 return "node vertex target target-nope " + nopeClass + d2.id;
54067 }).attr("transform", getTransform);
54069 function renderAsVertex(entity, graph, wireframe, zoom) {
54070 var geometry = entity.geometry(graph);
54071 return geometry === "vertex" || geometry === "point" && (wireframe || zoom >= 18 && entity.directions(graph, projection2).length);
54073 function isEditedNode(node, base, head) {
54074 var baseNode = base.entities[node.id];
54075 var headNode = head.entities[node.id];
54076 return !headNode || !baseNode || !(0, import_fast_deep_equal8.default)(headNode.tags, baseNode.tags) || !(0, import_fast_deep_equal8.default)(headNode.loc, baseNode.loc);
54078 function getSiblingAndChildVertices(ids, graph, wireframe, zoom) {
54081 function addChildVertices(entity) {
54082 if (seenIds[entity.id])
54084 seenIds[entity.id] = true;
54085 var geometry = entity.geometry(graph);
54086 if (!context.features().isHiddenFeature(entity, graph, geometry)) {
54088 if (entity.type === "way") {
54089 for (i3 = 0; i3 < entity.nodes.length; i3++) {
54090 var child = graph.hasEntity(entity.nodes[i3]);
54092 addChildVertices(child);
54095 } else if (entity.type === "relation") {
54096 for (i3 = 0; i3 < entity.members.length; i3++) {
54097 var member = graph.hasEntity(entity.members[i3].id);
54099 addChildVertices(member);
54102 } else if (renderAsVertex(entity, graph, wireframe, zoom)) {
54103 results[entity.id] = entity;
54107 ids.forEach(function(id2) {
54108 var entity = graph.hasEntity(id2);
54111 if (entity.type === "node") {
54112 if (renderAsVertex(entity, graph, wireframe, zoom)) {
54113 results[entity.id] = entity;
54114 graph.parentWays(entity).forEach(function(entity2) {
54115 addChildVertices(entity2);
54119 addChildVertices(entity);
54124 function drawVertices(selection2, graph, entities, filter2, extent, fullRedraw) {
54125 var wireframe = context.surface().classed("fill-wireframe");
54126 var visualDiff = context.surface().classed("highlight-edited");
54127 var zoom = geoScaleToZoom(projection2.scale());
54128 var mode = context.mode();
54129 var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
54130 var base = context.history().base();
54131 var drawLayer = selection2.selectAll(".layer-osm.points .points-group.vertices");
54132 var touchLayer = selection2.selectAll(".layer-touch.points");
54134 _currPersistent = {};
54137 for (var i3 = 0; i3 < entities.length; i3++) {
54138 var entity = entities[i3];
54139 var geometry = entity.geometry(graph);
54141 if (geometry === "point" && renderAsVertex(entity, graph, wireframe, zoom)) {
54142 _currPersistent[entity.id] = entity;
54144 } else if (geometry === "vertex" && (entity.hasInterestingTags() || entity.isEndpoint(graph) || entity.isConnected(graph) || visualDiff && isEditedNode(entity, base, graph))) {
54145 _currPersistent[entity.id] = entity;
54148 if (!keep && !fullRedraw) {
54149 delete _currPersistent[entity.id];
54153 persistent: _currPersistent,
54154 // persistent = important vertices (render always)
54155 selected: _currSelected,
54156 // selected + siblings of selected (render always)
54157 hovered: _currHover
54158 // hovered + siblings of hovered (render only in draw modes)
54160 var all = Object.assign({}, isMoving ? _currHover : {}, _currSelected, _currPersistent);
54161 var filterRendered = function(d2) {
54162 return d2.id in _currPersistent || d2.id in _currSelected || d2.id in _currHover || filter2(d2);
54164 drawLayer.call(draw, graph, currentVisible(all), sets2, filterRendered);
54165 var filterTouch = function(d2) {
54166 return isMoving ? true : filterRendered(d2);
54168 touchLayer.call(drawTargets, graph, currentVisible(all), filterTouch);
54169 function currentVisible(which) {
54170 return Object.keys(which).map(graph.hasEntity, graph).filter(function(entity2) {
54171 return entity2 && entity2.intersects(extent, graph);
54175 drawVertices.drawSelected = function(selection2, graph, extent) {
54176 var wireframe = context.surface().classed("fill-wireframe");
54177 var zoom = geoScaleToZoom(projection2.scale());
54178 _prevSelected = _currSelected || {};
54179 if (context.map().isInWideSelection()) {
54180 _currSelected = {};
54181 context.selectedIDs().forEach(function(id2) {
54182 var entity = graph.hasEntity(id2);
54185 if (entity.type === "node") {
54186 if (renderAsVertex(entity, graph, wireframe, zoom)) {
54187 _currSelected[entity.id] = entity;
54192 _currSelected = getSiblingAndChildVertices(context.selectedIDs(), graph, wireframe, zoom);
54194 var filter2 = function(d2) {
54195 return d2.id in _prevSelected;
54197 drawVertices(selection2, graph, Object.values(_prevSelected), filter2, extent, false);
54199 drawVertices.drawHover = function(selection2, graph, target, extent) {
54200 if (target === _currHoverTarget)
54202 var wireframe = context.surface().classed("fill-wireframe");
54203 var zoom = geoScaleToZoom(projection2.scale());
54204 _prevHover = _currHover || {};
54205 _currHoverTarget = target;
54206 var entity = target && target.properties && target.properties.entity;
54208 _currHover = getSiblingAndChildVertices([entity.id], graph, wireframe, zoom);
54212 var filter2 = function(d2) {
54213 return d2.id in _prevHover;
54215 drawVertices(selection2, graph, Object.values(_prevHover), filter2, extent, false);
54217 return drawVertices;
54220 // modules/util/bind_once.js
54221 function utilBindOnce(target, type2, listener, capture) {
54222 var typeOnce = type2 + ".once";
54224 target.on(typeOnce, null);
54225 listener.apply(this, arguments);
54227 target.on(typeOnce, one2, capture);
54231 // modules/util/zoom_pan.js
54232 function defaultFilter3(d3_event) {
54233 return !d3_event.ctrlKey && !d3_event.button;
54235 function defaultExtent2() {
54237 if (e3 instanceof SVGElement) {
54238 e3 = e3.ownerSVGElement || e3;
54239 if (e3.hasAttribute("viewBox")) {
54240 e3 = e3.viewBox.baseVal;
54241 return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
54243 return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
54245 return [[0, 0], [e3.clientWidth, e3.clientHeight]];
54247 function defaultWheelDelta2(d3_event) {
54248 return -d3_event.deltaY * (d3_event.deltaMode === 1 ? 0.05 : d3_event.deltaMode ? 1 : 2e-3);
54250 function defaultConstrain2(transform2, extent, translateExtent) {
54251 var dx0 = transform2.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform2.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform2.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform2.invertY(extent[1][1]) - translateExtent[1][1];
54252 return transform2.translate(
54253 dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
54254 dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
54257 function utilZoomPan() {
54258 var filter2 = defaultFilter3, extent = defaultExtent2, constrain = defaultConstrain2, wheelDelta = defaultWheelDelta2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], interpolate = zoom_default, dispatch14 = dispatch_default("start", "zoom", "end"), _wheelDelay = 150, _transform = identity2, _activeGesture;
54259 function zoom(selection2) {
54260 selection2.on("pointerdown.zoom", pointerdown).on("wheel.zoom", wheeled).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
54261 select_default2(window).on("pointermove.zoompan", pointermove).on("pointerup.zoompan pointercancel.zoompan", pointerup);
54263 zoom.transform = function(collection, transform2, point2) {
54264 var selection2 = collection.selection ? collection.selection() : collection;
54265 if (collection !== selection2) {
54266 schedule(collection, transform2, point2);
54268 selection2.interrupt().each(function() {
54269 gesture(this, arguments).start(null).zoom(null, null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end(null);
54273 zoom.scaleBy = function(selection2, k2, p2) {
54274 zoom.scaleTo(selection2, function() {
54275 var k0 = _transform.k, k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
54279 zoom.scaleTo = function(selection2, k2, p2) {
54280 zoom.transform(selection2, function() {
54281 var e3 = extent.apply(this, arguments), t0 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2, p1 = t0.invert(p02), k1 = typeof k2 === "function" ? k2.apply(this, arguments) : k2;
54282 return constrain(translate(scale(t0, k1), p02, p1), e3, translateExtent);
54285 zoom.translateBy = function(selection2, x2, y2) {
54286 zoom.transform(selection2, function() {
54287 return constrain(_transform.translate(
54288 typeof x2 === "function" ? x2.apply(this, arguments) : x2,
54289 typeof y2 === "function" ? y2.apply(this, arguments) : y2
54290 ), extent.apply(this, arguments), translateExtent);
54293 zoom.translateTo = function(selection2, x2, y2, p2) {
54294 zoom.transform(selection2, function() {
54295 var e3 = extent.apply(this, arguments), t2 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
54296 return constrain(identity2.translate(p02[0], p02[1]).scale(t2.k).translate(
54297 typeof x2 === "function" ? -x2.apply(this, arguments) : -x2,
54298 typeof y2 === "function" ? -y2.apply(this, arguments) : -y2
54299 ), e3, translateExtent);
54302 function scale(transform2, k2) {
54303 k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k2));
54304 return k2 === transform2.k ? transform2 : new Transform(k2, transform2.x, transform2.y);
54306 function translate(transform2, p02, p1) {
54307 var x2 = p02[0] - p1[0] * transform2.k, y2 = p02[1] - p1[1] * transform2.k;
54308 return x2 === transform2.x && y2 === transform2.y ? transform2 : new Transform(transform2.k, x2, y2);
54310 function centroid(extent2) {
54311 return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
54313 function schedule(transition2, transform2, point2) {
54314 transition2.on("start.zoom", function() {
54315 gesture(this, arguments).start(null);
54316 }).on("interrupt.zoom end.zoom", function() {
54317 gesture(this, arguments).end(null);
54318 }).tween("zoom", function() {
54319 var that = this, args = arguments, g3 = gesture(that, args), e3 = extent.apply(that, args), p2 = !point2 ? centroid(e3) : typeof point2 === "function" ? point2.apply(that, args) : point2, w2 = Math.max(e3[1][0] - e3[0][0], e3[1][1] - e3[0][1]), a2 = _transform, b2 = typeof transform2 === "function" ? transform2.apply(that, args) : transform2, i3 = interpolate(a2.invert(p2).concat(w2 / a2.k), b2.invert(p2).concat(w2 / b2.k));
54320 return function(t2) {
54325 var k2 = w2 / l2[2];
54326 t2 = new Transform(k2, p2[0] - l2[0] * k2, p2[1] - l2[1] * k2);
54328 g3.zoom(null, null, t2);
54332 function gesture(that, args, clean2) {
54333 return !clean2 && _activeGesture || new Gesture(that, args);
54335 function Gesture(that, args) {
54339 this.extent = extent.apply(that, args);
54341 Gesture.prototype = {
54342 start: function(d3_event) {
54343 if (++this.active === 1) {
54344 _activeGesture = this;
54345 dispatch14.call("start", this, d3_event);
54349 zoom: function(d3_event, key, transform2) {
54350 if (this.mouse && key !== "mouse")
54351 this.mouse[1] = transform2.invert(this.mouse[0]);
54352 if (this.pointer0 && key !== "touch")
54353 this.pointer0[1] = transform2.invert(this.pointer0[0]);
54354 if (this.pointer1 && key !== "touch")
54355 this.pointer1[1] = transform2.invert(this.pointer1[0]);
54356 _transform = transform2;
54357 dispatch14.call("zoom", this, d3_event, key, transform2);
54360 end: function(d3_event) {
54361 if (--this.active === 0) {
54362 _activeGesture = null;
54363 dispatch14.call("end", this, d3_event);
54368 function wheeled(d3_event) {
54369 if (!filter2.apply(this, arguments))
54371 var g3 = gesture(this, arguments), t2 = _transform, k2 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p2 = utilFastMouse(this)(d3_event);
54373 if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
54374 g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
54376 clearTimeout(g3.wheel);
54378 g3.mouse = [p2, t2.invert(p2)];
54379 interrupt_default(this);
54380 g3.start(d3_event);
54382 d3_event.preventDefault();
54383 d3_event.stopImmediatePropagation();
54384 g3.wheel = setTimeout(wheelidled, _wheelDelay);
54385 g3.zoom(d3_event, "mouse", constrain(translate(scale(t2, k2), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
54386 function wheelidled() {
54391 var _downPointerIDs = /* @__PURE__ */ new Set();
54392 var _pointerLocGetter;
54393 function pointerdown(d3_event) {
54394 _downPointerIDs.add(d3_event.pointerId);
54395 if (!filter2.apply(this, arguments))
54397 var g3 = gesture(this, arguments, _downPointerIDs.size === 1);
54399 d3_event.stopImmediatePropagation();
54400 _pointerLocGetter = utilFastMouse(this);
54401 var loc = _pointerLocGetter(d3_event);
54402 var p2 = [loc, _transform.invert(loc), d3_event.pointerId];
54403 if (!g3.pointer0) {
54406 } else if (!g3.pointer1 && g3.pointer0[2] !== p2[2]) {
54410 interrupt_default(this);
54411 g3.start(d3_event);
54414 function pointermove(d3_event) {
54415 if (!_downPointerIDs.has(d3_event.pointerId))
54417 if (!_activeGesture || !_pointerLocGetter)
54419 var g3 = gesture(this, arguments);
54420 var isPointer0 = g3.pointer0 && g3.pointer0[2] === d3_event.pointerId;
54421 var isPointer1 = !isPointer0 && g3.pointer1 && g3.pointer1[2] === d3_event.pointerId;
54422 if ((isPointer0 || isPointer1) && "buttons" in d3_event && !d3_event.buttons) {
54424 _downPointerIDs.delete(g3.pointer0[2]);
54426 _downPointerIDs.delete(g3.pointer1[2]);
54430 d3_event.preventDefault();
54431 d3_event.stopImmediatePropagation();
54432 var loc = _pointerLocGetter(d3_event);
54435 g3.pointer0[0] = loc;
54436 else if (isPointer1)
54437 g3.pointer1[0] = loc;
54440 var p02 = g3.pointer0[0], l0 = g3.pointer0[1], p1 = g3.pointer1[0], l1 = g3.pointer1[1], dp = (dp = p1[0] - p02[0]) * dp + (dp = p1[1] - p02[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
54441 t2 = scale(t2, Math.sqrt(dp / dl));
54442 p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
54443 l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
54444 } else if (g3.pointer0) {
54445 p2 = g3.pointer0[0];
54446 l2 = g3.pointer0[1];
54450 g3.zoom(d3_event, "touch", constrain(translate(t2, p2, l2), g3.extent, translateExtent));
54452 function pointerup(d3_event) {
54453 if (!_downPointerIDs.has(d3_event.pointerId))
54455 _downPointerIDs.delete(d3_event.pointerId);
54456 if (!_activeGesture)
54458 var g3 = gesture(this, arguments);
54459 d3_event.stopImmediatePropagation();
54460 if (g3.pointer0 && g3.pointer0[2] === d3_event.pointerId)
54461 delete g3.pointer0;
54462 else if (g3.pointer1 && g3.pointer1[2] === d3_event.pointerId)
54463 delete g3.pointer1;
54464 if (g3.pointer1 && !g3.pointer0) {
54465 g3.pointer0 = g3.pointer1;
54466 delete g3.pointer1;
54469 g3.pointer0[1] = _transform.invert(g3.pointer0[0]);
54474 zoom.wheelDelta = function(_2) {
54475 return arguments.length ? (wheelDelta = utilFunctor(+_2), zoom) : wheelDelta;
54477 zoom.filter = function(_2) {
54478 return arguments.length ? (filter2 = utilFunctor(!!_2), zoom) : filter2;
54480 zoom.extent = function(_2) {
54481 return arguments.length ? (extent = utilFunctor([[+_2[0][0], +_2[0][1]], [+_2[1][0], +_2[1][1]]]), zoom) : extent;
54483 zoom.scaleExtent = function(_2) {
54484 return arguments.length ? (scaleExtent[0] = +_2[0], scaleExtent[1] = +_2[1], zoom) : [scaleExtent[0], scaleExtent[1]];
54486 zoom.translateExtent = function(_2) {
54487 return arguments.length ? (translateExtent[0][0] = +_2[0][0], translateExtent[1][0] = +_2[1][0], translateExtent[0][1] = +_2[0][1], translateExtent[1][1] = +_2[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
54489 zoom.constrain = function(_2) {
54490 return arguments.length ? (constrain = _2, zoom) : constrain;
54492 zoom.interpolate = function(_2) {
54493 return arguments.length ? (interpolate = _2, zoom) : interpolate;
54495 zoom._transform = function(_2) {
54496 return arguments.length ? (_transform = _2, zoom) : _transform;
54498 return utilRebind(zoom, dispatch14, "on");
54501 // modules/util/double_up.js
54502 function utilDoubleUp() {
54503 var dispatch14 = dispatch_default("doubleUp");
54504 var _maxTimespan = 500;
54505 var _maxDistance = 20;
54507 function pointerIsValidFor(loc) {
54508 return (/* @__PURE__ */ new Date()).getTime() - _pointer.startTime <= _maxTimespan && // all pointer events must occur within a small distance of the first pointerdown
54509 geoVecLength(_pointer.startLoc, loc) <= _maxDistance;
54511 function pointerdown(d3_event) {
54512 if (d3_event.ctrlKey || d3_event.button === 2)
54514 var loc = [d3_event.clientX, d3_event.clientY];
54515 if (_pointer && !pointerIsValidFor(loc)) {
54521 startTime: (/* @__PURE__ */ new Date()).getTime(),
54523 pointerId: d3_event.pointerId
54526 _pointer.pointerId = d3_event.pointerId;
54529 function pointerup(d3_event) {
54530 if (d3_event.ctrlKey || d3_event.button === 2)
54532 if (!_pointer || _pointer.pointerId !== d3_event.pointerId)
54534 _pointer.upCount += 1;
54535 if (_pointer.upCount === 2) {
54536 var loc = [d3_event.clientX, d3_event.clientY];
54537 if (pointerIsValidFor(loc)) {
54538 var locInThis = utilFastMouse(this)(d3_event);
54539 dispatch14.call("doubleUp", this, d3_event, locInThis);
54544 function doubleUp(selection2) {
54545 if ("PointerEvent" in window) {
54546 selection2.on("pointerdown.doubleUp", pointerdown).on("pointerup.doubleUp", pointerup);
54548 selection2.on("dblclick.doubleUp", function(d3_event) {
54549 dispatch14.call("doubleUp", this, d3_event, utilFastMouse(this)(d3_event));
54553 doubleUp.off = function(selection2) {
54554 selection2.on("pointerdown.doubleUp", null).on("pointerup.doubleUp", null).on("dblclick.doubleUp", null);
54556 return utilRebind(doubleUp, dispatch14, "on");
54559 // modules/renderer/map.js
54560 var TILESIZE = 256;
54563 var kMin = geoZoomToScale(minZoom2, TILESIZE);
54564 var kMax = geoZoomToScale(maxZoom, TILESIZE);
54565 function clamp(num, min3, max3) {
54566 return Math.max(min3, Math.min(num, max3));
54568 function rendererMap(context) {
54569 var dispatch14 = dispatch_default(
54572 "crossEditableZoom",
54574 "changeHighlighting",
54577 var projection2 = context.projection;
54578 var curtainProjection = context.curtainProjection;
54586 var _selection = select_default2(null);
54587 var supersurface = select_default2(null);
54588 var wrapper = select_default2(null);
54589 var surface = select_default2(null);
54590 var _dimensions = [1, 1];
54591 var _dblClickZoomEnabled = true;
54592 var _redrawEnabled = true;
54593 var _gestureTransformStart;
54594 var _transformStart = projection2.transform();
54595 var _transformLast;
54596 var _isTransformed = false;
54598 var _getMouseCoords;
54599 var _lastPointerEvent;
54600 var _lastWithinEditableZoom;
54601 var _pointerDown = false;
54602 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
54603 var _zoomerPannerFunction = "PointerEvent" in window ? utilZoomPan : zoom_default2;
54604 var _zoomerPanner = _zoomerPannerFunction().scaleExtent([kMin, kMax]).interpolate(value_default).filter(zoomEventFilter).on("zoom.map", zoomPan2).on("start.map", function(d3_event) {
54605 _pointerDown = d3_event && (d3_event.type === "pointerdown" || d3_event.sourceEvent && d3_event.sourceEvent.type === "pointerdown");
54606 }).on("end.map", function() {
54607 _pointerDown = false;
54609 var _doubleUpHandler = utilDoubleUp();
54610 var scheduleRedraw = throttle_default(redraw, 750);
54611 function cancelPendingRedraw() {
54612 scheduleRedraw.cancel();
54614 function map2(selection2) {
54615 _selection = selection2;
54616 context.on("change.map", immediateRedraw);
54617 var osm = context.connection();
54619 osm.on("change.map", immediateRedraw);
54621 function didUndoOrRedo(targetTransform) {
54622 var mode = context.mode().id;
54623 if (mode !== "browse" && mode !== "select")
54625 if (targetTransform) {
54626 map2.transformEase(targetTransform);
54629 context.history().on("merge.map", function() {
54631 }).on("change.map", immediateRedraw).on("undone.map", function(stack, fromStack) {
54632 didUndoOrRedo(fromStack.transform);
54633 }).on("redone.map", function(stack) {
54634 didUndoOrRedo(stack.transform);
54636 context.background().on("change.map", immediateRedraw);
54637 context.features().on("redraw.map", immediateRedraw);
54638 drawLayers.on("change.map", function() {
54639 context.background().updateImagery();
54642 selection2.on("wheel.map mousewheel.map", function(d3_event) {
54643 d3_event.preventDefault();
54644 }).call(_zoomerPanner).call(_zoomerPanner.transform, projection2.transform()).on("dblclick.zoom", null);
54645 map2.supersurface = supersurface = selection2.append("div").attr("class", "supersurface").call(utilSetTransform, 0, 0);
54646 wrapper = supersurface.append("div").attr("class", "layer layer-data");
54647 map2.surface = surface = wrapper.call(drawLayers).selectAll(".surface");
54648 surface.call(drawLabels.observe).call(_doubleUpHandler).on(_pointerPrefix + "down.zoom", function(d3_event) {
54649 _lastPointerEvent = d3_event;
54650 if (d3_event.button === 2) {
54651 d3_event.stopPropagation();
54653 }, true).on(_pointerPrefix + "up.zoom", function(d3_event) {
54654 _lastPointerEvent = d3_event;
54655 if (resetTransform()) {
54658 }).on(_pointerPrefix + "move.map", function(d3_event) {
54659 _lastPointerEvent = d3_event;
54660 }).on(_pointerPrefix + "over.vertices", function(d3_event) {
54661 if (map2.editableDataEnabled() && !_isTransformed) {
54662 var hover = d3_event.target.__data__;
54663 surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
54664 dispatch14.call("drawn", this, { full: false });
54666 }).on(_pointerPrefix + "out.vertices", function(d3_event) {
54667 if (map2.editableDataEnabled() && !_isTransformed) {
54668 var hover = d3_event.relatedTarget && d3_event.relatedTarget.__data__;
54669 surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
54670 dispatch14.call("drawn", this, { full: false });
54673 var detected = utilDetect();
54674 if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
54675 // but we only need to do this on desktop Safari anyway. – #7694
54676 !detected.isMobileWebKit) {
54677 surface.on("gesturestart.surface", function(d3_event) {
54678 d3_event.preventDefault();
54679 _gestureTransformStart = projection2.transform();
54680 }).on("gesturechange.surface", gestureChange);
54683 _doubleUpHandler.on("doubleUp.map", function(d3_event, p02) {
54684 if (!_dblClickZoomEnabled)
54686 if (typeof d3_event.target.__data__ === "object" && // or area fills
54687 !select_default2(d3_event.target).classed("fill"))
54689 var zoomOut2 = d3_event.shiftKey;
54690 var t2 = projection2.transform();
54691 var p1 = t2.invert(p02);
54692 t2 = t2.scale(zoomOut2 ? 0.5 : 2);
54693 t2.x = p02[0] - p1[0] * t2.k;
54694 t2.y = p02[1] - p1[1] * t2.k;
54695 map2.transformEase(t2);
54697 context.on("enter.map", function() {
54698 if (!map2.editableDataEnabled(
54700 /* skip zoom check */
54703 if (_isTransformed)
54705 var graph = context.graph();
54706 var selectedAndParents = {};
54707 context.selectedIDs().forEach(function(id2) {
54708 var entity = graph.hasEntity(id2);
54710 selectedAndParents[entity.id] = entity;
54711 if (entity.type === "node") {
54712 graph.parentWays(entity).forEach(function(parent) {
54713 selectedAndParents[parent.id] = parent;
54718 var data = Object.values(selectedAndParents);
54719 var filter2 = function(d2) {
54720 return d2.id in selectedAndParents;
54722 data = context.features().filter(data, graph);
54723 surface.call(drawVertices.drawSelected, graph, map2.extent()).call(drawLines, graph, data, filter2).call(drawAreas, graph, data, filter2).call(drawMidpoints, graph, data, filter2, map2.trimmedExtent());
54724 dispatch14.call("drawn", this, { full: false });
54727 map2.dimensions(utilGetDimensions(selection2));
54729 function zoomEventFilter(d3_event) {
54730 if (d3_event.type === "mousedown") {
54731 var hasOrphan = false;
54732 var listeners = window.__on;
54733 for (var i3 = 0; i3 < listeners.length; i3++) {
54734 var listener = listeners[i3];
54735 if (listener.name === "zoom" && listener.type === "mouseup") {
54741 var event = window.CustomEvent;
54743 event = new event("mouseup");
54745 event = window.document.createEvent("Event");
54746 event.initEvent("mouseup", false, false);
54748 event.view = window;
54749 window.dispatchEvent(event);
54752 return d3_event.button !== 2;
54754 function pxCenter() {
54755 return [_dimensions[0] / 2, _dimensions[1] / 2];
54757 function drawEditable(difference, extent) {
54758 var mode = context.mode();
54759 var graph = context.graph();
54760 var features = context.features();
54761 var all = context.history().intersects(map2.extent());
54762 var fullRedraw = false;
54766 var applyFeatureLayerFilters = true;
54767 if (map2.isInWideSelection()) {
54769 utilEntityAndDeepMemberIDs(mode.selectedIDs(), context.graph()).forEach(function(id2) {
54770 var entity = context.hasEntity(id2);
54775 filter2 = utilFunctor(true);
54776 applyFeatureLayerFilters = false;
54777 } else if (difference) {
54778 var complete = difference.complete(map2.extent());
54779 data = Object.values(complete).filter(Boolean);
54780 set3 = new Set(Object.keys(complete));
54781 filter2 = function(d2) {
54782 return set3.has(d2.id);
54784 features.clear(data);
54786 if (features.gatherStats(all, graph, _dimensions)) {
54790 data = context.history().intersects(map2.extent().intersection(extent));
54791 set3 = new Set(data.map(function(entity) {
54794 filter2 = function(d2) {
54795 return set3.has(d2.id);
54800 filter2 = utilFunctor(true);
54803 if (applyFeatureLayerFilters) {
54804 data = features.filter(data, graph);
54806 context.features().resetStats();
54808 if (mode && mode.id === "select") {
54809 surface.call(drawVertices.drawSelected, graph, map2.extent());
54811 surface.call(drawVertices, graph, data, filter2, map2.extent(), fullRedraw).call(drawLines, graph, data, filter2).call(drawAreas, graph, data, filter2).call(drawMidpoints, graph, data, filter2, map2.trimmedExtent()).call(drawLabels, graph, data, filter2, _dimensions, fullRedraw).call(drawPoints, graph, data, filter2);
54812 dispatch14.call("drawn", this, { full: true });
54814 map2.init = function() {
54815 drawLayers = svgLayers(projection2, context);
54816 drawPoints = svgPoints(projection2, context);
54817 drawVertices = svgVertices(projection2, context);
54818 drawLines = svgLines(projection2, context);
54819 drawAreas = svgAreas(projection2, context);
54820 drawMidpoints = svgMidpoints(projection2, context);
54821 drawLabels = svgLabels(projection2, context);
54823 function editOff() {
54824 context.features().resetStats();
54825 surface.selectAll(".layer-osm *").remove();
54826 surface.selectAll(".layer-touch:not(.markers) *").remove();
54830 "select-note": true,
54831 "select-data": true,
54832 "select-error": true
54834 var mode = context.mode();
54835 if (mode && !allowed[mode.id]) {
54836 context.enter(modeBrowse(context));
54838 dispatch14.call("drawn", this, { full: true });
54840 function gestureChange(d3_event) {
54842 e3.preventDefault();
54845 // dummy values to ignore in zoomPan
54847 // dummy values to ignore in zoomPan
54848 clientX: e3.clientX,
54849 clientY: e3.clientY,
54850 screenX: e3.screenX,
54851 screenY: e3.screenY,
54855 var e22 = new WheelEvent("wheel", props);
54856 e22._scale = e3.scale;
54857 e22._rotation = e3.rotation;
54858 _selection.node().dispatchEvent(e22);
54860 function zoomPan2(event, key, transform2) {
54861 var source = event && event.sourceEvent || event;
54862 var eventTransform = transform2 || event && event.transform;
54863 var x2 = eventTransform.x;
54864 var y2 = eventTransform.y;
54865 var k2 = eventTransform.k;
54866 if (source && source.type === "wheel") {
54869 var detected = utilDetect();
54870 var dX = source.deltaX;
54871 var dY = source.deltaY;
54876 if (source.deltaMode === 1) {
54877 var lines = Math.abs(source.deltaY);
54878 var sign2 = source.deltaY > 0 ? 1 : -1;
54879 dY = sign2 * clamp(
54880 Math.exp((lines - 1) * 0.75) * 4.000244140625,
54886 if (detected.os !== "mac") {
54889 t0 = _isTransformed ? _transformLast : _transformStart;
54890 p02 = _getMouseCoords(source);
54891 p1 = t0.invert(p02);
54892 k22 = t0.k * Math.pow(2, -dY / 500);
54893 k22 = clamp(k22, kMin, kMax);
54894 x22 = p02[0] - p1[0] * k22;
54895 y22 = p02[1] - p1[1] * k22;
54896 } else if (source._scale) {
54897 t0 = _gestureTransformStart;
54898 p02 = _getMouseCoords(source);
54899 p1 = t0.invert(p02);
54900 k22 = t0.k * source._scale;
54901 k22 = clamp(k22, kMin, kMax);
54902 x22 = p02[0] - p1[0] * k22;
54903 y22 = p02[1] - p1[1] * k22;
54904 } else if (source.ctrlKey && !isInteger(dY)) {
54906 t0 = _isTransformed ? _transformLast : _transformStart;
54907 p02 = _getMouseCoords(source);
54908 p1 = t0.invert(p02);
54909 k22 = t0.k * Math.pow(2, -dY / 500);
54910 k22 = clamp(k22, kMin, kMax);
54911 x22 = p02[0] - p1[0] * k22;
54912 y22 = p02[1] - p1[1] * k22;
54913 } else if ((source.altKey || source.shiftKey) && isInteger(dY)) {
54914 t0 = _isTransformed ? _transformLast : _transformStart;
54915 p02 = _getMouseCoords(source);
54916 p1 = t0.invert(p02);
54917 k22 = t0.k * Math.pow(2, -dY / 500);
54918 k22 = clamp(k22, kMin, kMax);
54919 x22 = p02[0] - p1[0] * k22;
54920 y22 = p02[1] - p1[1] * k22;
54921 } else if (detected.os === "mac" && detected.browser !== "Firefox" && !source.ctrlKey && isInteger(dX) && isInteger(dY)) {
54922 p1 = projection2.translate();
54925 k22 = projection2.scale();
54926 k22 = clamp(k22, kMin, kMax);
54928 if (x22 !== x2 || y22 !== y2 || k22 !== k2) {
54932 eventTransform = identity2.translate(x22, y22).scale(k22);
54933 if (_zoomerPanner._transform) {
54934 _zoomerPanner._transform(eventTransform);
54936 _selection.node().__zoom = eventTransform;
54940 if (_transformStart.x === x2 && _transformStart.y === y2 && _transformStart.k === k2) {
54943 if (geoScaleToZoom(k2, TILESIZE) < _minzoom) {
54944 surface.interrupt();
54945 dispatch14.call("hitMinZoom", this, map2);
54946 setCenterZoom(map2.center(), context.minEditableZoom(), 0, true);
54948 dispatch14.call("move", this, map2);
54951 projection2.transform(eventTransform);
54952 var withinEditableZoom = map2.withinEditableZoom();
54953 if (_lastWithinEditableZoom !== withinEditableZoom) {
54954 if (_lastWithinEditableZoom !== void 0) {
54955 dispatch14.call("crossEditableZoom", this, withinEditableZoom);
54957 _lastWithinEditableZoom = withinEditableZoom;
54959 var scale = k2 / _transformStart.k;
54960 var tX = (x2 / scale - _transformStart.x) * scale;
54961 var tY = (y2 / scale - _transformStart.y) * scale;
54962 if (context.inIntro()) {
54963 curtainProjection.transform({
54970 _lastPointerEvent = event;
54972 _isTransformed = true;
54973 _transformLast = eventTransform;
54974 utilSetTransform(supersurface, tX, tY, scale);
54976 dispatch14.call("move", this, map2);
54977 function isInteger(val) {
54978 return typeof val === "number" && isFinite(val) && Math.floor(val) === val;
54981 function resetTransform() {
54982 if (!_isTransformed)
54984 utilSetTransform(supersurface, 0, 0);
54985 _isTransformed = false;
54986 if (context.inIntro()) {
54987 curtainProjection.transform(projection2.transform());
54991 function redraw(difference, extent) {
54992 if (surface.empty() || !_redrawEnabled)
54994 if (resetTransform()) {
54995 difference = extent = void 0;
54997 var zoom = map2.zoom();
54998 var z2 = String(~~zoom);
54999 if (surface.attr("data-zoom") !== z2) {
55000 surface.attr("data-zoom", z2);
55002 var lat = map2.center()[1];
55003 var lowzoom = linear3().domain([-60, 0, 60]).range([17, 18.5, 17]).clamp(true);
55004 surface.classed("low-zoom", zoom <= lowzoom(lat));
55006 supersurface.call(context.background());
55007 wrapper.call(drawLayers);
55009 if (map2.editableDataEnabled() || map2.isInWideSelection()) {
55010 context.loadTiles(projection2);
55011 drawEditable(difference, extent);
55015 _transformStart = projection2.transform();
55018 var immediateRedraw = function(difference, extent) {
55019 if (!difference && !extent)
55020 cancelPendingRedraw();
55021 redraw(difference, extent);
55023 map2.lastPointerEvent = function() {
55024 return _lastPointerEvent;
55026 map2.mouse = function(d3_event) {
55027 var event = d3_event || _lastPointerEvent;
55030 while (s2 = event.sourceEvent) {
55033 return _getMouseCoords(event);
55037 map2.mouseCoordinates = function() {
55038 var coord2 = map2.mouse() || pxCenter();
55039 return projection2.invert(coord2);
55041 map2.dblclickZoomEnable = function(val) {
55042 if (!arguments.length)
55043 return _dblClickZoomEnabled;
55044 _dblClickZoomEnabled = val;
55047 map2.redrawEnable = function(val) {
55048 if (!arguments.length)
55049 return _redrawEnabled;
55050 _redrawEnabled = val;
55053 map2.isTransformed = function() {
55054 return _isTransformed;
55056 function setTransform(t2, duration, force) {
55057 var t3 = projection2.transform();
55058 if (!force && t2.k === t3.k && t2.x === t3.x && t2.y === t3.y)
55061 _selection.transition().duration(duration).on("start", function() {
55063 }).call(_zoomerPanner.transform, identity2.translate(t2.x, t2.y).scale(t2.k));
55065 projection2.transform(t2);
55066 _transformStart = t2;
55067 _selection.call(_zoomerPanner.transform, _transformStart);
55071 function setCenterZoom(loc2, z2, duration, force) {
55072 var c2 = map2.center();
55073 var z3 = map2.zoom();
55074 if (loc2[0] === c2[0] && loc2[1] === c2[1] && z2 === z3 && !force)
55076 var proj = geoRawMercator().transform(projection2.transform());
55077 var k2 = clamp(geoZoomToScale(z2, TILESIZE), kMin, kMax);
55079 var t2 = proj.translate();
55080 var point2 = proj(loc2);
55081 var center = pxCenter();
55082 t2[0] += center[0] - point2[0];
55083 t2[1] += center[1] - point2[1];
55084 return setTransform(identity2.translate(t2[0], t2[1]).scale(k2), duration, force);
55086 map2.pan = function(delta, duration) {
55087 var t2 = projection2.translate();
55088 var k2 = projection2.scale();
55092 _selection.transition().duration(duration).on("start", function() {
55094 }).call(_zoomerPanner.transform, identity2.translate(t2[0], t2[1]).scale(k2));
55096 projection2.translate(t2);
55097 _transformStart = projection2.transform();
55098 _selection.call(_zoomerPanner.transform, _transformStart);
55099 dispatch14.call("move", this, map2);
55104 map2.dimensions = function(val) {
55105 if (!arguments.length)
55106 return _dimensions;
55108 drawLayers.dimensions(_dimensions);
55109 context.background().dimensions(_dimensions);
55110 projection2.clipExtent([[0, 0], _dimensions]);
55111 _getMouseCoords = utilFastMouse(supersurface.node());
55115 function zoomIn(delta) {
55116 setCenterZoom(map2.center(), ~~map2.zoom() + delta, 250, true);
55118 function zoomOut(delta) {
55119 setCenterZoom(map2.center(), ~~map2.zoom() - delta, 250, true);
55121 map2.zoomIn = function() {
55124 map2.zoomInFurther = function() {
55127 map2.canZoomIn = function() {
55128 return map2.zoom() < maxZoom;
55130 map2.zoomOut = function() {
55133 map2.zoomOutFurther = function() {
55136 map2.canZoomOut = function() {
55137 return map2.zoom() > minZoom2;
55139 map2.center = function(loc2) {
55140 if (!arguments.length) {
55141 return projection2.invert(pxCenter());
55143 if (setCenterZoom(loc2, map2.zoom())) {
55144 dispatch14.call("move", this, map2);
55149 map2.unobscuredCenterZoomEase = function(loc, zoom) {
55150 var offset = map2.unobscuredOffsetPx();
55151 var proj = geoRawMercator().transform(projection2.transform());
55152 proj.scale(geoZoomToScale(zoom, TILESIZE));
55153 var locPx = proj(loc);
55154 var offsetLocPx = [locPx[0] + offset[0], locPx[1] + offset[1]];
55155 var offsetLoc = proj.invert(offsetLocPx);
55156 map2.centerZoomEase(offsetLoc, zoom);
55158 map2.unobscuredOffsetPx = function() {
55159 var openPane = context.container().select(".map-panes .map-pane.shown");
55160 if (!openPane.empty()) {
55161 return [openPane.node().offsetWidth / 2, 0];
55165 map2.zoom = function(z2) {
55166 if (!arguments.length) {
55167 return Math.max(geoScaleToZoom(projection2.scale(), TILESIZE), 0);
55169 if (z2 < _minzoom) {
55170 surface.interrupt();
55171 dispatch14.call("hitMinZoom", this, map2);
55172 z2 = context.minEditableZoom();
55174 if (setCenterZoom(map2.center(), z2)) {
55175 dispatch14.call("move", this, map2);
55180 map2.centerZoom = function(loc2, z2) {
55181 if (setCenterZoom(loc2, z2)) {
55182 dispatch14.call("move", this, map2);
55187 map2.zoomTo = function(entity) {
55188 var extent = entity.extent(context.graph());
55189 if (!isFinite(extent.area()))
55191 var z2 = clamp(map2.trimmedExtentZoom(extent), 0, 20);
55192 return map2.centerZoom(extent.center(), z2);
55194 map2.centerEase = function(loc2, duration) {
55195 duration = duration || 250;
55196 setCenterZoom(loc2, map2.zoom(), duration);
55199 map2.zoomEase = function(z2, duration) {
55200 duration = duration || 250;
55201 setCenterZoom(map2.center(), z2, duration, false);
55204 map2.centerZoomEase = function(loc2, z2, duration) {
55205 duration = duration || 250;
55206 setCenterZoom(loc2, z2, duration, false);
55209 map2.transformEase = function(t2, duration) {
55210 duration = duration || 250;
55219 map2.zoomToEase = function(obj, duration) {
55221 if (Array.isArray(obj)) {
55222 obj.forEach(function(entity) {
55223 var entityExtent = entity.extent(context.graph());
55225 extent = entityExtent;
55227 extent = extent.extend(entityExtent);
55231 extent = obj.extent(context.graph());
55233 if (!isFinite(extent.area()))
55235 var z2 = clamp(map2.trimmedExtentZoom(extent), 0, 20);
55236 return map2.centerZoomEase(extent.center(), z2, duration);
55238 map2.startEase = function() {
55239 utilBindOnce(surface, _pointerPrefix + "down.ease", function() {
55244 map2.cancelEase = function() {
55245 _selection.interrupt();
55248 map2.extent = function(val) {
55249 if (!arguments.length) {
55250 return new geoExtent(
55251 projection2.invert([0, _dimensions[1]]),
55252 projection2.invert([_dimensions[0], 0])
55255 var extent = geoExtent(val);
55256 map2.centerZoom(extent.center(), map2.extentZoom(extent));
55259 map2.trimmedExtent = function(val) {
55260 if (!arguments.length) {
55264 return new geoExtent(
55265 projection2.invert([pad2, _dimensions[1] - footerY - pad2]),
55266 projection2.invert([_dimensions[0] - pad2, headerY + pad2])
55269 var extent = geoExtent(val);
55270 map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
55273 function calcExtentZoom(extent, dim) {
55274 var tl = projection2([extent[0][0], extent[1][1]]);
55275 var br = projection2([extent[1][0], extent[0][1]]);
55276 var hFactor = (br[0] - tl[0]) / dim[0];
55277 var vFactor = (br[1] - tl[1]) / dim[1];
55278 var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
55279 var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
55280 var newZoom = map2.zoom() - Math.max(hZoomDiff, vZoomDiff);
55283 map2.extentZoom = function(val) {
55284 return calcExtentZoom(geoExtent(val), _dimensions);
55286 map2.trimmedExtentZoom = function(val) {
55289 var trimmed = [_dimensions[0] - trimX, _dimensions[1] - trimY];
55290 return calcExtentZoom(geoExtent(val), trimmed);
55292 map2.withinEditableZoom = function() {
55293 return map2.zoom() >= context.minEditableZoom();
55295 map2.isInWideSelection = function() {
55296 return !map2.withinEditableZoom() && context.selectedIDs().length;
55298 map2.editableDataEnabled = function(skipZoomCheck) {
55299 var layer = context.layers().layer("osm");
55300 if (!layer || !layer.enabled())
55302 return skipZoomCheck || map2.withinEditableZoom();
55304 map2.notesEditable = function() {
55305 var layer = context.layers().layer("notes");
55306 if (!layer || !layer.enabled())
55308 return map2.withinEditableZoom();
55310 map2.minzoom = function(val) {
55311 if (!arguments.length)
55316 map2.toggleHighlightEdited = function() {
55317 surface.classed("highlight-edited", !surface.classed("highlight-edited"));
55319 dispatch14.call("changeHighlighting", this);
55321 map2.areaFillOptions = ["wireframe", "partial", "full"];
55322 map2.activeAreaFill = function(val) {
55323 if (!arguments.length)
55324 return corePreferences("area-fill") || "partial";
55325 corePreferences("area-fill", val);
55326 if (val !== "wireframe") {
55327 corePreferences("area-fill-toggle", val);
55331 dispatch14.call("changeAreaFill", this);
55334 map2.toggleWireframe = function() {
55335 var activeFill = map2.activeAreaFill();
55336 if (activeFill === "wireframe") {
55337 activeFill = corePreferences("area-fill-toggle") || "partial";
55339 activeFill = "wireframe";
55341 map2.activeAreaFill(activeFill);
55343 function updateAreaFill() {
55344 var activeFill = map2.activeAreaFill();
55345 map2.areaFillOptions.forEach(function(opt) {
55346 surface.classed("fill-" + opt, Boolean(opt === activeFill));
55349 map2.layers = () => drawLayers;
55350 map2.doubleUpHandler = function() {
55351 return _doubleUpHandler;
55353 return utilRebind(map2, dispatch14, "on");
55356 // modules/renderer/photos.js
55357 function rendererPhotos(context) {
55358 var dispatch14 = dispatch_default("change");
55359 var _layerIDs = ["streetside", "mapillary", "mapillary-map-features", "mapillary-signs", "kartaview", "mapilio", "vegbilder"];
55360 var _allPhotoTypes = ["flat", "panoramic"];
55361 var _shownPhotoTypes = _allPhotoTypes.slice();
55362 var _dateFilters = ["fromDate", "toDate"];
55366 function photos() {
55368 function updateStorage() {
55371 var hash = utilStringQs(window.location.hash);
55372 var enabled = context.layers().all().filter(function(d2) {
55373 return _layerIDs.indexOf(d2.id) !== -1 && d2.layer && d2.layer.supported() && d2.layer.enabled();
55374 }).map(function(d2) {
55377 if (enabled.length) {
55378 hash.photo_overlay = enabled.join(",");
55380 delete hash.photo_overlay;
55382 window.location.replace("#" + utilQsString(hash, true));
55384 photos.overlayLayerIDs = function() {
55387 photos.allPhotoTypes = function() {
55388 return _allPhotoTypes;
55390 photos.dateFilters = function() {
55391 return _dateFilters;
55393 photos.dateFilterValue = function(val) {
55394 return val === _dateFilters[0] ? _fromDate : _toDate;
55396 photos.setDateFilter = function(type2, val, updateUrl) {
55397 var date = val && new Date(val);
55398 if (date && !isNaN(date)) {
55399 val = date.toISOString().slice(0, 10);
55403 if (type2 === _dateFilters[0]) {
55405 if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
55406 _toDate = _fromDate;
55409 if (type2 === _dateFilters[1]) {
55411 if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
55412 _fromDate = _toDate;
55415 dispatch14.call("change", this);
55418 if (_fromDate || _toDate) {
55419 rangeString = (_fromDate || "") + "_" + (_toDate || "");
55421 setUrlFilterValue("photo_dates", rangeString);
55424 photos.setUsernameFilter = function(val, updateUrl) {
55425 if (val && typeof val === "string")
55426 val = val.replace(/;/g, ",").split(",");
55428 val = val.map((d2) => d2.trim()).filter(Boolean);
55434 dispatch14.call("change", this);
55438 hashString = _usernames.join(",");
55440 setUrlFilterValue("photo_username", hashString);
55443 function setUrlFilterValue(property, val) {
55444 if (!window.mocha) {
55445 var hash = utilStringQs(window.location.hash);
55447 if (hash[property] === val)
55449 hash[property] = val;
55451 if (!(property in hash))
55453 delete hash[property];
55455 window.location.replace("#" + utilQsString(hash, true));
55458 function showsLayer(id2) {
55459 var layer = context.layers().layer(id2);
55460 return layer && layer.supported() && layer.enabled();
55462 photos.shouldFilterByDate = function() {
55463 return showsLayer("mapillary") || showsLayer("kartaview") || showsLayer("streetside") || showsLayer("vegbilder");
55465 photos.shouldFilterByPhotoType = function() {
55466 return showsLayer("mapillary") || showsLayer("streetside") && showsLayer("kartaview") || showsLayer("vegbilder");
55468 photos.shouldFilterByUsername = function() {
55469 return !showsLayer("mapillary") && showsLayer("kartaview") && !showsLayer("streetside");
55471 photos.showsPhotoType = function(val) {
55472 if (!photos.shouldFilterByPhotoType())
55474 return _shownPhotoTypes.indexOf(val) !== -1;
55476 photos.showsFlat = function() {
55477 return photos.showsPhotoType("flat");
55479 photos.showsPanoramic = function() {
55480 return photos.showsPhotoType("panoramic");
55482 photos.fromDate = function() {
55485 photos.toDate = function() {
55488 photos.togglePhotoType = function(val) {
55489 var index = _shownPhotoTypes.indexOf(val);
55490 if (index !== -1) {
55491 _shownPhotoTypes.splice(index, 1);
55493 _shownPhotoTypes.push(val);
55495 dispatch14.call("change", this);
55498 photos.usernames = function() {
55501 photos.init = function() {
55502 var hash = utilStringQs(window.location.hash);
55503 if (hash.photo_dates) {
55504 var parts = /^(.*)[–_](.*)$/g.exec(hash.photo_dates.trim());
55505 this.setDateFilter("fromDate", parts && parts.length >= 2 && parts[1], false);
55506 this.setDateFilter("toDate", parts && parts.length >= 3 && parts[2], false);
55508 if (hash.photo_username) {
55509 this.setUsernameFilter(hash.photo_username, false);
55511 if (hash.photo_overlay) {
55512 var hashOverlayIDs = hash.photo_overlay.replace(/;/g, ",").split(",");
55513 hashOverlayIDs.forEach(function(id2) {
55514 if (id2 === "openstreetcam")
55516 var layer2 = _layerIDs.indexOf(id2) !== -1 && context.layers().layer(id2);
55517 if (layer2 && !layer2.enabled())
55518 layer2.enabled(true);
55522 var photoIds = hash.photo.replace(/;/g, ",").split(",");
55523 var photoId = photoIds.length && photoIds[0].trim();
55524 var results = /(.*)\/(.*)/g.exec(photoId);
55525 if (results && results.length >= 3) {
55526 var serviceId = results[1];
55527 if (serviceId === "openstreetcam")
55528 serviceId = "kartaview";
55529 var photoKey = results[2];
55530 var service = services[serviceId];
55531 if (service && service.ensureViewerLoaded) {
55532 var layer = _layerIDs.indexOf(serviceId) !== -1 && context.layers().layer(serviceId);
55533 if (layer && !layer.enabled())
55534 layer.enabled(true);
55535 var baselineTime = Date.now();
55536 service.on("loadedImages.rendererPhotos", function() {
55537 if (Date.now() - baselineTime > 45e3) {
55538 service.on("loadedImages.rendererPhotos", null);
55541 if (!service.cachedImage(photoKey))
55543 service.on("loadedImages.rendererPhotos", null);
55544 service.ensureViewerLoaded(context).then(function() {
55545 service.selectImage(context, photoKey).showViewer(context);
55551 context.layers().on("change.rendererPhotos", updateStorage);
55553 return utilRebind(photos, dispatch14, "on");
55556 // modules/ui/account.js
55557 function uiAccount(context) {
55558 const osm = context.connection();
55559 function updateUserDetails(selection2) {
55562 if (!osm.authenticated()) {
55563 render(selection2, null);
55565 osm.userDetails((err, user) => render(selection2, user));
55568 function render(selection2, user) {
55569 let userInfo = selection2.select(".userInfo");
55570 let loginLogout = selection2.select(".loginLogout");
55572 userInfo.html("").classed("hide", false);
55573 let userLink = userInfo.append("a").attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
55574 if (user.image_url) {
55575 userLink.append("img").attr("class", "icon pre-text user-icon").attr("src", user.image_url);
55577 userLink.call(svgIcon("#iD-icon-avatar", "pre-text light"));
55579 userLink.append("span").attr("class", "label").html(user.display_name);
55580 loginLogout.classed("hide", false).select("a").text(_t("logout")).on("click", (e3) => {
55581 e3.preventDefault();
55586 userInfo.html("").classed("hide", true);
55587 loginLogout.classed("hide", false).select("a").text(_t("login")).on("click", (e3) => {
55588 e3.preventDefault();
55589 osm.authenticate();
55593 function tryLogout() {
55596 const url = osm.getUrlRoot() + "/logout?referer=%2Flogin";
55602 ["left", window.screen.width / 2 - w2 / 2],
55603 ["top", window.screen.height / 2 - h2 / 2]
55604 ].map((x2) => x2.join("=")).join(",");
55605 window.open(url, "_blank", settings);
55607 return function(selection2) {
55610 selection2.append("li").attr("class", "userInfo").classed("hide", true);
55611 selection2.append("li").attr("class", "loginLogout").classed("hide", true).append("a").attr("href", "#");
55612 osm.on("change.account", () => updateUserDetails(selection2));
55613 updateUserDetails(selection2);
55617 // modules/ui/attribution.js
55618 function uiAttribution(context) {
55619 let _selection = select_default2(null);
55620 function render(selection2, data, klass) {
55621 let div = selection2.selectAll(`.${klass}`).data([0]);
55622 div = div.enter().append("div").attr("class", klass).merge(div);
55623 let attributions = div.selectAll(".attribution").data(data, (d2) => d2.id);
55624 attributions.exit().remove();
55625 attributions = attributions.enter().append("span").attr("class", "attribution").each((d2, i3, nodes) => {
55626 let attribution = select_default2(nodes[i3]);
55627 if (d2.terms_html) {
55628 attribution.html(d2.terms_html);
55631 if (d2.terms_url) {
55632 attribution = attribution.append("a").attr("href", d2.terms_url).attr("target", "_blank");
55634 const sourceID = d2.id.replace(/\./g, "<TX_DOT>");
55635 const terms_text = _t(
55636 `imagery.${sourceID}.attribution.text`,
55637 { default: d2.terms_text || d2.id || d2.name() }
55639 if (d2.icon && !d2.overlay) {
55640 attribution.append("img").attr("class", "source-image").attr("src", d2.icon);
55642 attribution.append("span").attr("class", "attribution-text").text(terms_text);
55643 }).merge(attributions);
55644 let copyright = attributions.selectAll(".copyright-notice").data((d2) => {
55645 let notice = d2.copyrightNotices(context.map().zoom(), context.map().extent());
55646 return notice ? [notice] : [];
55648 copyright.exit().remove();
55649 copyright = copyright.enter().append("span").attr("class", "copyright-notice").merge(copyright);
55650 copyright.text(String);
55652 function update() {
55653 let baselayer = context.background().baseLayerSource();
55654 _selection.call(render, baselayer ? [baselayer] : [], "base-layer-attribution");
55655 const z2 = context.map().zoom();
55656 let overlays = context.background().overlayLayerSources() || [];
55657 _selection.call(render, overlays.filter((s2) => s2.validZoom(z2)), "overlay-layer-attribution");
55659 return function(selection2) {
55660 _selection = selection2;
55661 context.background().on("change.attribution", update);
55662 context.map().on("move.attribution", throttle_default(update, 400, { leading: false }));
55667 // modules/ui/contributors.js
55668 function uiContributors(context) {
55669 var osm = context.connection(), debouncedUpdate = debounce_default(function() {
55671 }, 1e3), limit = 4, hidden = false, wrap2 = select_default2(null);
55672 function update() {
55675 var users = {}, entities = context.history().intersects(context.map().extent());
55676 entities.forEach(function(entity) {
55677 if (entity && entity.user)
55678 users[entity.user] = true;
55680 var u2 = Object.keys(users), subset = u2.slice(0, u2.length > limit ? limit - 1 : limit);
55681 wrap2.html("").call(svgIcon("#iD-icon-nearby", "pre-text light"));
55682 var userList = select_default2(document.createElement("span"));
55683 userList.selectAll().data(subset).enter().append("a").attr("class", "user-link").attr("href", function(d2) {
55684 return osm.userURL(d2);
55685 }).attr("target", "_blank").text(String);
55686 if (u2.length > limit) {
55687 var count = select_default2(document.createElement("span"));
55688 var othersNum = u2.length - limit + 1;
55689 count.append("a").attr("target", "_blank").attr("href", function() {
55690 return osm.changesetsURL(context.map().center(), context.map().zoom());
55691 }).text(othersNum);
55692 wrap2.append("span").html(_t.html("contributors.truncated_list", { n: othersNum, users: { html: userList.html() }, count: { html: count.html() } }));
55694 wrap2.append("span").html(_t.html("contributors.list", { users: { html: userList.html() } }));
55698 wrap2.transition().style("opacity", 0);
55699 } else if (hidden) {
55700 wrap2.transition().style("opacity", 1);
55703 return function(selection2) {
55706 wrap2 = selection2;
55708 osm.on("loaded.contributors", debouncedUpdate);
55709 context.map().on("move.contributors", debouncedUpdate);
55713 // modules/ui/popover.js
55714 var _popoverID = 0;
55715 function uiPopover(klass) {
55716 var _id = _popoverID++;
55717 var _anchorSelection = select_default2(null);
55718 var popover = function(selection2) {
55719 _anchorSelection = selection2;
55720 selection2.each(setup);
55722 var _animation = utilFunctor(false);
55723 var _placement = utilFunctor("top");
55724 var _alignment = utilFunctor("center");
55725 var _scrollContainer = utilFunctor(select_default2(null));
55727 var _displayType = utilFunctor("");
55728 var _hasArrow = utilFunctor(true);
55729 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
55730 popover.displayType = function(val) {
55731 if (arguments.length) {
55732 _displayType = utilFunctor(val);
55735 return _displayType;
55738 popover.hasArrow = function(val) {
55739 if (arguments.length) {
55740 _hasArrow = utilFunctor(val);
55746 popover.placement = function(val) {
55747 if (arguments.length) {
55748 _placement = utilFunctor(val);
55754 popover.alignment = function(val) {
55755 if (arguments.length) {
55756 _alignment = utilFunctor(val);
55762 popover.scrollContainer = function(val) {
55763 if (arguments.length) {
55764 _scrollContainer = utilFunctor(val);
55767 return _scrollContainer;
55770 popover.content = function(val) {
55771 if (arguments.length) {
55778 popover.isShown = function() {
55779 var popoverSelection = _anchorSelection.select(".popover-" + _id);
55780 return !popoverSelection.empty() && popoverSelection.classed("in");
55782 popover.show = function() {
55783 _anchorSelection.each(show);
55785 popover.updateContent = function() {
55786 _anchorSelection.each(updateContent);
55788 popover.hide = function() {
55789 _anchorSelection.each(hide);
55791 popover.toggle = function() {
55792 _anchorSelection.each(toggle);
55794 popover.destroy = function(selection2, selector) {
55795 selector = selector || ".popover-" + _id;
55796 selection2.on(_pointerPrefix + "enter.popover", null).on(_pointerPrefix + "leave.popover", null).on(_pointerPrefix + "up.popover", null).on(_pointerPrefix + "down.popover", null).on("click.popover", null).attr("title", function() {
55797 return this.getAttribute("data-original-title") || this.getAttribute("title");
55798 }).attr("data-original-title", null).selectAll(selector).remove();
55800 popover.destroyAny = function(selection2) {
55801 selection2.call(popover.destroy, ".popover");
55804 var anchor = select_default2(this);
55805 var animate = _animation.apply(this, arguments);
55806 var popoverSelection = anchor.selectAll(".popover-" + _id).data([0]);
55807 var enter = popoverSelection.enter().append("div").attr("class", "popover popover-" + _id + " " + (klass ? klass : "")).classed("arrowed", _hasArrow.apply(this, arguments));
55808 enter.append("div").attr("class", "popover-arrow");
55809 enter.append("div").attr("class", "popover-inner");
55810 popoverSelection = enter.merge(popoverSelection);
55812 popoverSelection.classed("fade", true);
55814 var display = _displayType.apply(this, arguments);
55815 if (display === "hover") {
55816 var _lastNonMouseEnterTime;
55817 anchor.on(_pointerPrefix + "enter.popover", function(d3_event) {
55818 if (d3_event.pointerType) {
55819 if (d3_event.pointerType !== "mouse") {
55820 _lastNonMouseEnterTime = d3_event.timeStamp;
55822 } else if (_lastNonMouseEnterTime && d3_event.timeStamp - _lastNonMouseEnterTime < 1500) {
55826 if (d3_event.buttons !== 0)
55828 show.apply(this, arguments);
55829 }).on(_pointerPrefix + "leave.popover", function() {
55830 hide.apply(this, arguments);
55831 }).on("focus.popover", function() {
55832 show.apply(this, arguments);
55833 }).on("blur.popover", function() {
55834 hide.apply(this, arguments);
55836 } else if (display === "clickFocus") {
55837 anchor.on(_pointerPrefix + "down.popover", function(d3_event) {
55838 d3_event.preventDefault();
55839 d3_event.stopPropagation();
55840 }).on(_pointerPrefix + "up.popover", function(d3_event) {
55841 d3_event.preventDefault();
55842 d3_event.stopPropagation();
55843 }).on("click.popover", toggle);
55844 popoverSelection.attr("tabindex", 0).on("blur.popover", function() {
55845 anchor.each(function() {
55846 hide.apply(this, arguments);
55852 var anchor = select_default2(this);
55853 var popoverSelection = anchor.selectAll(".popover-" + _id);
55854 if (popoverSelection.empty()) {
55855 anchor.call(popover.destroy);
55856 anchor.each(setup);
55857 popoverSelection = anchor.selectAll(".popover-" + _id);
55859 popoverSelection.classed("in", true);
55860 var displayType = _displayType.apply(this, arguments);
55861 if (displayType === "clickFocus") {
55862 anchor.classed("active", true);
55863 popoverSelection.node().focus();
55865 anchor.each(updateContent);
55867 function updateContent() {
55868 var anchor = select_default2(this);
55870 anchor.selectAll(".popover-" + _id + " > .popover-inner").call(_content.apply(this, arguments));
55872 updatePosition.apply(this, arguments);
55873 updatePosition.apply(this, arguments);
55874 updatePosition.apply(this, arguments);
55876 function updatePosition() {
55877 var anchor = select_default2(this);
55878 var popoverSelection = anchor.selectAll(".popover-" + _id);
55879 var scrollContainer = _scrollContainer && _scrollContainer.apply(this, arguments);
55880 var scrollNode = scrollContainer && !scrollContainer.empty() && scrollContainer.node();
55881 var scrollLeft = scrollNode ? scrollNode.scrollLeft : 0;
55882 var scrollTop = scrollNode ? scrollNode.scrollTop : 0;
55883 var placement = _placement.apply(this, arguments);
55884 popoverSelection.classed("left", false).classed("right", false).classed("top", false).classed("bottom", false).classed(placement, true);
55885 var alignment = _alignment.apply(this, arguments);
55886 var alignFactor = 0.5;
55887 if (alignment === "leading") {
55889 } else if (alignment === "trailing") {
55892 var anchorFrame = getFrame(anchor.node());
55893 var popoverFrame = getFrame(popoverSelection.node());
55895 switch (placement) {
55898 x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
55899 y: anchorFrame.y - popoverFrame.h
55904 x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
55905 y: anchorFrame.y + anchorFrame.h
55910 x: anchorFrame.x - popoverFrame.w,
55911 y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
55916 x: anchorFrame.x + anchorFrame.w,
55917 y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
55922 if (scrollNode && (placement === "top" || placement === "bottom")) {
55923 var initialPosX = position.x;
55924 if (position.x + popoverFrame.w > scrollNode.offsetWidth - 10) {
55925 position.x = scrollNode.offsetWidth - 10 - popoverFrame.w;
55926 } else if (position.x < 10) {
55929 var arrow = anchor.selectAll(".popover-" + _id + " > .popover-arrow");
55930 var arrowPosX = Math.min(Math.max(popoverFrame.w / 2 - (position.x - initialPosX), 10), popoverFrame.w - 10);
55931 arrow.style("left", ~~arrowPosX + "px");
55933 popoverSelection.style("left", ~~position.x + "px").style("top", ~~position.y + "px");
55935 popoverSelection.style("left", null).style("top", null);
55937 function getFrame(node) {
55938 var positionStyle = select_default2(node).style("position");
55939 if (positionStyle === "absolute" || positionStyle === "static") {
55941 x: node.offsetLeft - scrollLeft,
55942 y: node.offsetTop - scrollTop,
55943 w: node.offsetWidth,
55944 h: node.offsetHeight
55950 w: node.offsetWidth,
55951 h: node.offsetHeight
55957 var anchor = select_default2(this);
55958 if (_displayType.apply(this, arguments) === "clickFocus") {
55959 anchor.classed("active", false);
55961 anchor.selectAll(".popover-" + _id).classed("in", false);
55963 function toggle() {
55964 if (select_default2(this).select(".popover-" + _id).classed("in")) {
55965 hide.apply(this, arguments);
55967 show.apply(this, arguments);
55973 // modules/ui/tooltip.js
55974 function uiTooltip(klass) {
55975 var tooltip = uiPopover((klass || "") + " tooltip").displayType("hover");
55976 var _title = function() {
55977 var title = this.getAttribute("data-original-title");
55981 title = this.getAttribute("title");
55982 this.removeAttribute("title");
55983 this.setAttribute("data-original-title", title);
55987 var _heading = utilFunctor(null);
55988 var _keys = utilFunctor(null);
55989 tooltip.title = function(val) {
55990 if (!arguments.length)
55992 _title = utilFunctor(val);
55995 tooltip.heading = function(val) {
55996 if (!arguments.length)
55998 _heading = utilFunctor(val);
56001 tooltip.keys = function(val) {
56002 if (!arguments.length)
56004 _keys = utilFunctor(val);
56007 tooltip.content(function() {
56008 var heading = _heading.apply(this, arguments);
56009 var text2 = _title.apply(this, arguments);
56010 var keys2 = _keys.apply(this, arguments);
56011 var headingCallback = typeof heading === "function" ? heading : (s2) => s2.text(heading);
56012 var textCallback = typeof text2 === "function" ? text2 : (s2) => s2.text(text2);
56013 return function(selection2) {
56014 var headingSelect = selection2.selectAll(".tooltip-heading").data(heading ? [heading] : []);
56015 headingSelect.exit().remove();
56016 headingSelect.enter().append("div").attr("class", "tooltip-heading").merge(headingSelect).text("").call(headingCallback);
56017 var textSelect = selection2.selectAll(".tooltip-text").data(text2 ? [text2] : []);
56018 textSelect.exit().remove();
56019 textSelect.enter().append("div").attr("class", "tooltip-text").merge(textSelect).text("").call(textCallback);
56020 var keyhintWrap = selection2.selectAll(".keyhint-wrap").data(keys2 && keys2.length ? [0] : []);
56021 keyhintWrap.exit().remove();
56022 var keyhintWrapEnter = keyhintWrap.enter().append("div").attr("class", "keyhint-wrap");
56023 keyhintWrapEnter.append("span").call(_t.append("tooltip_keyhint"));
56024 keyhintWrap = keyhintWrapEnter.merge(keyhintWrap);
56025 keyhintWrap.selectAll("kbd.shortcut").data(keys2 && keys2.length ? keys2 : []).enter().append("kbd").attr("class", "shortcut").text(function(d2) {
56033 // modules/ui/edit_menu.js
56034 function uiEditMenu(context) {
56035 var dispatch14 = dispatch_default("toggled");
56036 var _menu = select_default2(null);
56037 var _operations = [];
56038 var _anchorLoc = [0, 0];
56039 var _anchorLocLonLat = [0, 0];
56040 var _triggerType = "";
56041 var _vpTopMargin = 85;
56042 var _vpBottomMargin = 45;
56043 var _vpSideMargin = 35;
56044 var _menuTop = false;
56047 var _verticalPadding = 4;
56048 var _tooltipWidth = 210;
56049 var _menuSideMargin = 10;
56050 var _tooltips = [];
56051 var editMenu = function(selection2) {
56052 var isTouchMenu = _triggerType.includes("touch") || _triggerType.includes("pen");
56053 var ops = _operations.filter(function(op) {
56054 return !isTouchMenu || !op.mouseOnly;
56059 _menuTop = isTouchMenu;
56060 var showLabels = isTouchMenu;
56061 var buttonHeight = showLabels ? 32 : 34;
56063 _menuWidth = 52 + Math.min(120, 6 * Math.max.apply(Math, ops.map(function(op) {
56064 return op.title.length;
56069 _menuHeight = _verticalPadding * 2 + ops.length * buttonHeight;
56070 _menu = selection2.append("div").attr("class", "edit-menu").classed("touch-menu", isTouchMenu).style("padding", _verticalPadding + "px 0");
56071 var buttons = _menu.selectAll(".edit-menu-item").data(ops);
56072 var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
56073 return "edit-menu-item edit-menu-item-" + d2.id;
56074 }).style("height", buttonHeight + "px").on("click", click).on("pointerup", pointerup).on("pointerdown mousedown", function pointerdown(d3_event) {
56075 d3_event.stopPropagation();
56076 }).on("mouseenter.highlight", function(d3_event, d2) {
56077 if (!d2.relatedEntityIds || select_default2(this).classed("disabled"))
56079 utilHighlightEntities(d2.relatedEntityIds(), true, context);
56080 }).on("mouseleave.highlight", function(d3_event, d2) {
56081 if (!d2.relatedEntityIds)
56083 utilHighlightEntities(d2.relatedEntityIds(), false, context);
56085 buttonsEnter.each(function(d2) {
56086 var tooltip = uiTooltip().heading(() => d2.title).title(d2.tooltip).keys([d2.keys[0]]);
56087 _tooltips.push(tooltip);
56088 select_default2(this).call(tooltip).append("div").attr("class", "icon-wrap").call(svgIcon(d2.icon && d2.icon() || "#iD-operation-" + d2.id, "operation"));
56091 buttonsEnter.append("span").attr("class", "label").each(function(d2) {
56092 select_default2(this).call(d2.title);
56095 buttonsEnter.merge(buttons).classed("disabled", function(d2) {
56096 return d2.disabled();
56099 var initialScale = context.projection.scale();
56100 context.map().on("move.edit-menu", function() {
56101 if (initialScale !== context.projection.scale()) {
56104 }).on("drawn.edit-menu", function(info) {
56108 var lastPointerUpType;
56109 function pointerup(d3_event) {
56110 lastPointerUpType = d3_event.pointerType;
56112 function click(d3_event, operation) {
56113 d3_event.stopPropagation();
56114 if (operation.relatedEntityIds) {
56115 utilHighlightEntities(operation.relatedEntityIds(), false, context);
56117 if (operation.disabled()) {
56118 if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
56119 context.ui().flash.duration(4e3).iconName("#iD-operation-" + operation.id).iconClass("operation disabled").label(operation.tooltip())();
56122 if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
56123 context.ui().flash.duration(2e3).iconName("#iD-operation-" + operation.id).iconClass("operation").label(operation.annotation() || operation.title)();
56128 lastPointerUpType = null;
56130 dispatch14.call("toggled", this, true);
56132 function updatePosition() {
56133 if (!_menu || _menu.empty())
56135 var anchorLoc = context.projection(_anchorLocLonLat);
56136 var viewport = context.surfaceRect();
56137 if (anchorLoc[0] < 0 || anchorLoc[0] > viewport.width || anchorLoc[1] < 0 || anchorLoc[1] > viewport.height) {
56141 var menuLeft = displayOnLeft(viewport);
56142 var offset = [0, 0];
56143 offset[0] = menuLeft ? -1 * (_menuSideMargin + _menuWidth) : _menuSideMargin;
56145 if (anchorLoc[1] - _menuHeight < _vpTopMargin) {
56146 offset[1] = -anchorLoc[1] + _vpTopMargin;
56148 offset[1] = -_menuHeight;
56151 if (anchorLoc[1] + _menuHeight > viewport.height - _vpBottomMargin) {
56152 offset[1] = -anchorLoc[1] - _menuHeight + viewport.height - _vpBottomMargin;
56157 var origin = geoVecAdd(anchorLoc, offset);
56158 _menu.style("left", origin[0] + "px").style("top", origin[1] + "px");
56159 var tooltipSide = tooltipPosition(viewport, menuLeft);
56160 _tooltips.forEach(function(tooltip) {
56161 tooltip.placement(tooltipSide);
56163 function displayOnLeft(viewport2) {
56164 if (_mainLocalizer.textDirection() === "ltr") {
56165 if (anchorLoc[0] + _menuSideMargin + _menuWidth > viewport2.width - _vpSideMargin) {
56170 if (anchorLoc[0] - _menuSideMargin - _menuWidth < _vpSideMargin) {
56176 function tooltipPosition(viewport2, menuLeft2) {
56177 if (_mainLocalizer.textDirection() === "ltr") {
56181 if (anchorLoc[0] + _menuSideMargin + _menuWidth + _tooltipWidth > viewport2.width - _vpSideMargin) {
56189 if (anchorLoc[0] - _menuSideMargin - _menuWidth - _tooltipWidth < _vpSideMargin) {
56196 editMenu.close = function() {
56197 context.map().on("move.edit-menu", null).on("drawn.edit-menu", null);
56200 dispatch14.call("toggled", this, false);
56202 editMenu.anchorLoc = function(val) {
56203 if (!arguments.length)
56206 _anchorLocLonLat = context.projection.invert(_anchorLoc);
56209 editMenu.triggerType = function(val) {
56210 if (!arguments.length)
56211 return _triggerType;
56212 _triggerType = val;
56215 editMenu.operations = function(val) {
56216 if (!arguments.length)
56217 return _operations;
56221 return utilRebind(editMenu, dispatch14, "on");
56224 // modules/ui/feature_info.js
56225 function uiFeatureInfo(context) {
56226 function update(selection2) {
56227 var features = context.features();
56228 var stats = features.stats();
56230 var hiddenList = features.hidden().map(function(k2) {
56232 count += stats[k2];
56233 return _t.append("inspector.title_count", {
56234 title: _t("feature." + k2 + ".description"),
56239 }).filter(Boolean);
56240 selection2.text("");
56241 if (hiddenList.length) {
56242 var tooltipBehavior = uiTooltip().placement("top").title(function() {
56243 return (selection3) => {
56244 hiddenList.forEach((hiddenFeature) => {
56245 selection3.append("div").call(hiddenFeature);
56249 selection2.append("a").attr("class", "chip").attr("href", "#").call(_t.append("feature_info.hidden_warning", { count })).call(tooltipBehavior).on("click", function(d3_event) {
56250 tooltipBehavior.hide();
56251 d3_event.preventDefault();
56252 context.ui().togglePanes(context.container().select(".map-panes .map-data-pane"));
56255 selection2.classed("hide", !hiddenList.length);
56257 return function(selection2) {
56258 update(selection2);
56259 context.features().on("change.feature_info", function() {
56260 update(selection2);
56265 // modules/ui/flash.js
56266 function uiFlash(context) {
56268 var _duration = 2e3;
56269 var _iconName = "#iD-icon-no";
56270 var _iconClass = "disabled";
56271 var _label = (s2) => s2.text("");
56274 _flashTimer.stop();
56276 context.container().select(".main-footer-wrap").classed("footer-hide", true).classed("footer-show", false);
56277 context.container().select(".flash-wrap").classed("footer-hide", false).classed("footer-show", true);
56278 var content = context.container().select(".flash-wrap").selectAll(".flash-content").data([0]);
56279 var contentEnter = content.enter().append("div").attr("class", "flash-content");
56280 var iconEnter = contentEnter.append("svg").attr("class", "flash-icon icon").append("g").attr("transform", "translate(10,10)");
56281 iconEnter.append("circle").attr("r", 9);
56282 iconEnter.append("use").attr("transform", "translate(-7,-7)").attr("width", "14").attr("height", "14");
56283 contentEnter.append("div").attr("class", "flash-text");
56284 content = content.merge(contentEnter);
56285 content.selectAll(".flash-icon").attr("class", "icon flash-icon " + (_iconClass || ""));
56286 content.selectAll(".flash-icon use").attr("xlink:href", _iconName);
56287 content.selectAll(".flash-text").attr("class", "flash-text").call(_label);
56288 _flashTimer = timeout_default(function() {
56289 _flashTimer = null;
56290 context.container().select(".main-footer-wrap").classed("footer-hide", false).classed("footer-show", true);
56291 context.container().select(".flash-wrap").classed("footer-hide", true).classed("footer-show", false);
56295 flash.duration = function(_2) {
56296 if (!arguments.length)
56301 flash.label = function(_2) {
56302 if (!arguments.length)
56304 if (typeof _2 !== "function") {
56305 _label = (selection2) => selection2.text(_2);
56307 _label = (selection2) => selection2.text("").call(_2);
56311 flash.iconName = function(_2) {
56312 if (!arguments.length)
56317 flash.iconClass = function(_2) {
56318 if (!arguments.length)
56326 // modules/ui/full_screen.js
56327 function uiFullScreen(context) {
56328 var element = context.container().node();
56329 function getFullScreenFn() {
56330 if (element.requestFullscreen) {
56331 return element.requestFullscreen;
56332 } else if (element.msRequestFullscreen) {
56333 return element.msRequestFullscreen;
56334 } else if (element.mozRequestFullScreen) {
56335 return element.mozRequestFullScreen;
56336 } else if (element.webkitRequestFullscreen) {
56337 return element.webkitRequestFullscreen;
56340 function getExitFullScreenFn() {
56341 if (document.exitFullscreen) {
56342 return document.exitFullscreen;
56343 } else if (document.msExitFullscreen) {
56344 return document.msExitFullscreen;
56345 } else if (document.mozCancelFullScreen) {
56346 return document.mozCancelFullScreen;
56347 } else if (document.webkitExitFullscreen) {
56348 return document.webkitExitFullscreen;
56351 function isFullScreen() {
56352 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
56354 function isSupported() {
56355 return !!getFullScreenFn();
56357 function fullScreen(d3_event) {
56358 d3_event.preventDefault();
56359 if (!isFullScreen()) {
56360 getFullScreenFn().apply(element);
56362 getExitFullScreenFn().apply(document);
56365 return function() {
56366 if (!isSupported())
56368 var detected = utilDetect();
56369 var keys2 = detected.os === "mac" ? [uiCmd("\u2303\u2318F"), "f11"] : ["f11"];
56370 context.keybinding().on(keys2, fullScreen);
56374 // modules/ui/geolocate.js
56375 function uiGeolocate(context) {
56376 var _geolocationOptions = {
56377 // prioritize speed and power usage over precision
56378 enableHighAccuracy: false,
56379 // don't hang indefinitely getting the location
56383 var _locating = uiLoading(context).message(_t.html("geolocate.locating")).blocking(true);
56384 var _layer = context.layers().layer("geolocate");
56388 var _button = select_default2(null);
56390 if (context.inIntro())
56392 if (!_layer.enabled() && !_locating.isShown()) {
56393 _timeoutID = setTimeout(
56398 context.container().call(_locating);
56399 navigator.geolocation.getCurrentPosition(success, error, _geolocationOptions);
56402 _layer.enabled(null, false);
56403 updateButtonState();
56406 function zoomTo() {
56407 context.enter(modeBrowse(context));
56408 var map2 = context.map();
56409 _layer.enabled(_position, true);
56410 updateButtonState();
56411 map2.centerZoomEase(_extent.center(), Math.min(20, map2.extentZoom(_extent)));
56413 function success(geolocation) {
56414 _position = geolocation;
56415 var coords = _position.coords;
56416 _extent = geoExtent([coords.longitude, coords.latitude]).padByMeters(coords.accuracy);
56424 context.ui().flash.label(_t.append("geolocate.location_unavailable")).iconName("#iD-icon-geolocate")();
56428 function finish() {
56431 clearTimeout(_timeoutID);
56433 _timeoutID = void 0;
56435 function updateButtonState() {
56436 _button.classed("active", _layer.enabled());
56437 _button.attr("aria-pressed", _layer.enabled());
56439 return function(selection2) {
56440 if (!navigator.geolocation || !navigator.geolocation.getCurrentPosition)
56442 _button = selection2.append("button").on("click", click).attr("aria-pressed", false).call(svgIcon("#iD-icon-geolocate", "light")).call(
56443 uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _t.append("geolocate.title")).keys([_t("geolocate.key")])
56445 context.keybinding().on(_t("geolocate.key"), click);
56449 // modules/ui/panels/background.js
56450 function uiPanelBackground(context) {
56451 var background = context.background();
56452 var _currSourceName = null;
56453 var _metadata = {};
56454 var _metadataKeys = [
56462 var debouncedRedraw = debounce_default(redraw, 250);
56463 function redraw(selection2) {
56464 var source = background.baseLayerSource();
56467 var isDG = source.id.match(/^DigitalGlobe/i) !== null;
56468 var sourceLabel = source.label();
56469 if (_currSourceName !== sourceLabel) {
56470 _currSourceName = sourceLabel;
56473 selection2.text("");
56474 var list = selection2.append("ul").attr("class", "background-info");
56475 list.append("li").call(_currSourceName);
56476 _metadataKeys.forEach(function(k2) {
56477 if (isDG && k2 === "vintage")
56479 list.append("li").attr("class", "background-info-list-" + k2).classed("hide", !_metadata[k2]).call(_t.append("info_panels.background." + k2, { suffix: ":" })).append("span").attr("class", "background-info-span-" + k2).text(_metadata[k2]);
56481 debouncedGetMetadata(selection2);
56482 var toggleTiles = context.getDebug("tile") ? "hide_tiles" : "show_tiles";
56483 selection2.append("a").call(_t.append("info_panels.background." + toggleTiles)).attr("href", "#").attr("class", "button button-toggle-tiles").on("click", function(d3_event) {
56484 d3_event.preventDefault();
56485 context.setDebug("tile", !context.getDebug("tile"));
56486 selection2.call(redraw);
56489 var key = source.id + "-vintage";
56490 var sourceVintage = context.background().findSource(key);
56491 var showsVintage = context.background().showsLayer(sourceVintage);
56492 var toggleVintage = showsVintage ? "hide_vintage" : "show_vintage";
56493 selection2.append("a").call(_t.append("info_panels.background." + toggleVintage)).attr("href", "#").attr("class", "button button-toggle-vintage").on("click", function(d3_event) {
56494 d3_event.preventDefault();
56495 context.background().toggleOverlayLayer(sourceVintage);
56496 selection2.call(redraw);
56499 ["DigitalGlobe-Premium", "DigitalGlobe-Standard"].forEach(function(layerId) {
56500 if (source.id !== layerId) {
56501 var key2 = layerId + "-vintage";
56502 var sourceVintage2 = context.background().findSource(key2);
56503 if (context.background().showsLayer(sourceVintage2)) {
56504 context.background().toggleOverlayLayer(sourceVintage2);
56509 var debouncedGetMetadata = debounce_default(getMetadata, 250);
56510 function getMetadata(selection2) {
56511 var tile = context.container().select(".layer-background img.tile-center");
56514 var sourceName = _currSourceName;
56515 var d2 = tile.datum();
56516 var zoom = d2 && d2.length >= 3 && d2[2] || Math.floor(context.map().zoom());
56517 var center = context.map().center();
56518 _metadata.zoom = String(zoom);
56519 selection2.selectAll(".background-info-list-zoom").classed("hide", false).selectAll(".background-info-span-zoom").text(_metadata.zoom);
56520 if (!d2 || !d2.length >= 3)
56522 background.baseLayerSource().getMetadata(center, d2, function(err, result) {
56523 if (err || _currSourceName !== sourceName)
56525 var vintage = result.vintage;
56526 _metadata.vintage = vintage && vintage.range || _t("info_panels.background.unknown");
56527 selection2.selectAll(".background-info-list-vintage").classed("hide", false).selectAll(".background-info-span-vintage").text(_metadata.vintage);
56528 _metadataKeys.forEach(function(k2) {
56529 if (k2 === "zoom" || k2 === "vintage")
56531 var val = result[k2];
56532 _metadata[k2] = val;
56533 selection2.selectAll(".background-info-list-" + k2).classed("hide", !val).selectAll(".background-info-span-" + k2).text(val);
56537 var panel = function(selection2) {
56538 selection2.call(redraw);
56539 context.map().on("drawn.info-background", function() {
56540 selection2.call(debouncedRedraw);
56541 }).on("move.info-background", function() {
56542 selection2.call(debouncedGetMetadata);
56545 panel.off = function() {
56546 context.map().on("drawn.info-background", null).on("move.info-background", null);
56548 panel.id = "background";
56549 panel.label = _t.append("info_panels.background.title");
56550 panel.key = _t("info_panels.background.key");
56554 // modules/ui/panels/history.js
56555 function uiPanelHistory(context) {
56557 function displayTimestamp(timestamp) {
56559 return _t("info_panels.history.unknown");
56568 var d2 = new Date(timestamp);
56569 if (isNaN(d2.getTime()))
56570 return _t("info_panels.history.unknown");
56571 return d2.toLocaleString(_mainLocalizer.localeCode(), options2);
56573 function displayUser(selection2, userName) {
56575 selection2.append("span").call(_t.append("info_panels.history.unknown"));
56578 selection2.append("span").attr("class", "user-name").text(userName);
56579 var links = selection2.append("div").attr("class", "links");
56581 links.append("a").attr("class", "user-osm-link").attr("href", osm.userURL(userName)).attr("target", "_blank").call(_t.append("info_panels.history.profile_link"));
56583 links.append("a").attr("class", "user-hdyc-link").attr("href", "https://hdyc.neis-one.org/?" + userName).attr("target", "_blank").attr("tabindex", -1).text("HDYC");
56585 function displayChangeset(selection2, changeset) {
56587 selection2.append("span").call(_t.append("info_panels.history.unknown"));
56590 selection2.append("span").attr("class", "changeset-id").text(changeset);
56591 var links = selection2.append("div").attr("class", "links");
56593 links.append("a").attr("class", "changeset-osm-link").attr("href", osm.changesetURL(changeset)).attr("target", "_blank").call(_t.append("info_panels.history.changeset_link"));
56595 links.append("a").attr("class", "changeset-osmcha-link").attr("href", "https://osmcha.org/changesets/" + changeset).attr("target", "_blank").text("OSMCha");
56596 links.append("a").attr("class", "changeset-achavi-link").attr("href", "https://overpass-api.de/achavi/?changeset=" + changeset).attr("target", "_blank").text("Achavi");
56598 function redraw(selection2) {
56599 var selectedNoteID = context.selectedNoteID();
56600 osm = context.connection();
56601 var selected, note, entity;
56602 if (selectedNoteID && osm) {
56603 selected = [_t.html("note.note") + " " + selectedNoteID];
56604 note = osm.getNote(selectedNoteID);
56606 selected = context.selectedIDs().filter(function(e3) {
56607 return context.hasEntity(e3);
56609 if (selected.length) {
56610 entity = context.entity(selected[0]);
56613 var singular = selected.length === 1 ? selected[0] : null;
56614 selection2.html("");
56616 selection2.append("h4").attr("class", "history-heading").html(singular);
56618 selection2.append("h4").attr("class", "history-heading").call(_t.append("info_panels.selected", { n: selected.length }));
56623 selection2.call(redrawEntity, entity);
56625 selection2.call(redrawNote, note);
56628 function redrawNote(selection2, note) {
56629 if (!note || note.isNew()) {
56630 selection2.append("div").call(_t.append("info_panels.history.note_no_history"));
56633 var list = selection2.append("ul");
56634 list.append("li").call(_t.append("info_panels.history.note_comments", { suffix: ":" })).append("span").text(note.comments.length);
56635 if (note.comments.length) {
56636 list.append("li").call(_t.append("info_panels.history.note_created_date", { suffix: ":" })).append("span").text(displayTimestamp(note.comments[0].date));
56637 list.append("li").call(_t.append("info_panels.history.note_created_user", { suffix: ":" })).call(displayUser, note.comments[0].user);
56640 selection2.append("a").attr("class", "view-history-on-osm").attr("target", "_blank").attr("href", osm.noteURL(note)).call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("info_panels.history.note_link_text"));
56643 function redrawEntity(selection2, entity) {
56644 if (!entity || entity.isNew()) {
56645 selection2.append("div").call(_t.append("info_panels.history.no_history"));
56648 var links = selection2.append("div").attr("class", "links");
56650 links.append("a").attr("class", "view-history-on-osm").attr("href", osm.historyURL(entity)).attr("target", "_blank").call(_t.append("info_panels.history.history_link"));
56652 links.append("a").attr("class", "pewu-history-viewer-link").attr("href", "https://pewu.github.io/osm-history/#/" + entity.type + "/" + entity.osmId()).attr("target", "_blank").attr("tabindex", -1).text("PeWu");
56653 var list = selection2.append("ul");
56654 list.append("li").call(_t.append("info_panels.history.version", { suffix: ":" })).append("span").text(entity.version);
56655 list.append("li").call(_t.append("info_panels.history.last_edit", { suffix: ":" })).append("span").text(displayTimestamp(entity.timestamp));
56656 list.append("li").call(_t.append("info_panels.history.edited_by", { suffix: ":" })).call(displayUser, entity.user);
56657 list.append("li").call(_t.append("info_panels.history.changeset", { suffix: ":" })).call(displayChangeset, entity.changeset);
56659 var panel = function(selection2) {
56660 selection2.call(redraw);
56661 context.map().on("drawn.info-history", function() {
56662 selection2.call(redraw);
56664 context.on("enter.info-history", function() {
56665 selection2.call(redraw);
56668 panel.off = function() {
56669 context.map().on("drawn.info-history", null);
56670 context.on("enter.info-history", null);
56672 panel.id = "history";
56673 panel.label = _t.append("info_panels.history.title");
56674 panel.key = _t("info_panels.history.key");
56678 // modules/util/units.js
56679 var OSM_PRECISION = 7;
56680 function displayLength(m2, isImperial) {
56681 var d2 = m2 * (isImperial ? 3.28084 : 1);
56693 unit2 = "kilometers";
56698 return _t("units." + unit2, {
56699 quantity: d2.toLocaleString(_mainLocalizer.localeCode(), {
56700 maximumSignificantDigits: 4
56704 function displayArea(m2, isImperial) {
56705 var locale2 = _mainLocalizer.localeCode();
56706 var d2 = m2 * (isImperial ? 10.7639111056 : 1);
56711 if (d2 >= 6969600) {
56712 d1 = d2 / 27878400;
56713 unit1 = "square_miles";
56716 unit1 = "square_feet";
56718 if (d2 > 4356 && d2 < 4356e4) {
56725 unit1 = "square_kilometers";
56728 unit1 = "square_meters";
56730 if (d2 > 1e3 && d2 < 1e7) {
56732 unit2 = "hectares";
56735 area = _t("units." + unit1, {
56736 quantity: d1.toLocaleString(locale2, {
56737 maximumSignificantDigits: 4
56741 return _t("units.area_pair", {
56743 area2: _t("units." + unit2, {
56744 quantity: d22.toLocaleString(locale2, {
56745 maximumSignificantDigits: 2
56753 function wrap(x2, min3, max3) {
56754 var d2 = max3 - min3;
56755 return ((x2 - min3) % d2 + d2) % d2 + min3;
56757 function clamp2(x2, min3, max3) {
56758 return Math.max(min3, Math.min(x2, max3));
56760 function displayCoordinate(deg, pos, neg) {
56761 var locale2 = _mainLocalizer.localeCode();
56762 var min3 = (Math.abs(deg) - Math.floor(Math.abs(deg))) * 60;
56763 var sec = (min3 - Math.floor(min3)) * 60;
56764 var displayDegrees = _t("units.arcdegrees", {
56765 quantity: Math.floor(Math.abs(deg)).toLocaleString(locale2)
56767 var displayCoordinate2;
56768 if (Math.floor(sec) > 0) {
56769 displayCoordinate2 = displayDegrees + _t("units.arcminutes", {
56770 quantity: Math.floor(min3).toLocaleString(locale2)
56771 }) + _t("units.arcseconds", {
56772 quantity: Math.round(sec).toLocaleString(locale2)
56774 } else if (Math.floor(min3) > 0) {
56775 displayCoordinate2 = displayDegrees + _t("units.arcminutes", {
56776 quantity: Math.round(min3).toLocaleString(locale2)
56779 displayCoordinate2 = _t("units.arcdegrees", {
56780 quantity: Math.round(Math.abs(deg)).toLocaleString(locale2)
56784 return displayCoordinate2;
56786 return _t("units.coordinate", {
56787 coordinate: displayCoordinate2,
56788 direction: _t("units." + (deg > 0 ? pos : neg))
56792 function dmsCoordinatePair(coord2) {
56793 return _t("units.coordinate_pair", {
56794 latitude: displayCoordinate(clamp2(coord2[1], -90, 90), "north", "south"),
56795 longitude: displayCoordinate(wrap(coord2[0], -180, 180), "east", "west")
56798 function decimalCoordinatePair(coord2) {
56799 return _t("units.coordinate_pair", {
56800 latitude: clamp2(coord2[1], -90, 90).toFixed(OSM_PRECISION),
56801 longitude: wrap(coord2[0], -180, 180).toFixed(OSM_PRECISION)
56805 // modules/ui/panels/location.js
56806 function uiPanelLocation(context) {
56807 var currLocation = "";
56808 function redraw(selection2) {
56809 selection2.html("");
56810 var list = selection2.append("ul");
56811 var coord2 = context.map().mouseCoordinates();
56812 if (coord2.some(isNaN)) {
56813 coord2 = context.map().center();
56815 list.append("li").text(dmsCoordinatePair(coord2)).append("li").text(decimalCoordinatePair(coord2));
56816 selection2.append("div").attr("class", "location-info").text(currLocation || " ");
56817 debouncedGetLocation(selection2, coord2);
56819 var debouncedGetLocation = debounce_default(getLocation, 250);
56820 function getLocation(selection2, coord2) {
56821 if (!services.geocoder) {
56822 currLocation = _t("info_panels.location.unknown_location");
56823 selection2.selectAll(".location-info").text(currLocation);
56825 services.geocoder.reverse(coord2, function(err, result) {
56826 currLocation = result ? result.display_name : _t("info_panels.location.unknown_location");
56827 selection2.selectAll(".location-info").text(currLocation);
56831 var panel = function(selection2) {
56832 selection2.call(redraw);
56833 context.surface().on(("PointerEvent" in window ? "pointer" : "mouse") + "move.info-location", function() {
56834 selection2.call(redraw);
56837 panel.off = function() {
56838 context.surface().on(".info-location", null);
56840 panel.id = "location";
56841 panel.label = _t.append("info_panels.location.title");
56842 panel.key = _t("info_panels.location.key");
56846 // modules/ui/panels/measurement.js
56847 function uiPanelMeasurement(context) {
56848 function radiansToMeters(r2) {
56849 return r2 * 63710071809e-4;
56851 function steradiansToSqmeters(r2) {
56852 return r2 / (4 * Math.PI) * 510065621724e3;
56854 function toLineString(feature3) {
56855 if (feature3.type === "LineString")
56857 var result = { type: "LineString", coordinates: [] };
56858 if (feature3.type === "Polygon") {
56859 result.coordinates = feature3.coordinates[0];
56860 } else if (feature3.type === "MultiPolygon") {
56861 result.coordinates = feature3.coordinates[0][0];
56865 var _isImperial = !_mainLocalizer.usesMetric();
56866 function redraw(selection2) {
56867 var graph = context.graph();
56868 var selectedNoteID = context.selectedNoteID();
56869 var osm = services.osm;
56870 var localeCode = _mainLocalizer.localeCode();
56872 var center, location, centroid;
56873 var closed, geometry;
56874 var totalNodeCount, length = 0, area = 0, distance;
56875 if (selectedNoteID && osm) {
56876 var note = osm.getNote(selectedNoteID);
56877 heading = _t.html("note.note") + " " + selectedNoteID;
56878 location = note.loc;
56881 var selectedIDs = context.selectedIDs().filter(function(id2) {
56882 return context.hasEntity(id2);
56884 var selected = selectedIDs.map(function(id2) {
56885 return context.entity(id2);
56887 heading = selected.length === 1 ? selected[0].id : _t.html("info_panels.selected", { n: selected.length });
56888 if (selected.length) {
56889 var extent = geoExtent();
56890 for (var i3 in selected) {
56891 var entity = selected[i3];
56892 extent._extend(entity.extent(graph));
56893 geometry = entity.geometry(graph);
56894 if (geometry === "line" || geometry === "area") {
56895 closed = entity.type === "relation" || entity.isClosed() && !entity.isDegenerate();
56896 var feature3 = entity.asGeoJSON(graph);
56897 length += radiansToMeters(length_default(toLineString(feature3)));
56898 centroid = path_default(context.projection).centroid(entity.asGeoJSON(graph));
56899 centroid = centroid && context.projection.invert(centroid);
56900 if (!centroid || !isFinite(centroid[0]) || !isFinite(centroid[1])) {
56901 centroid = entity.extent(graph).center();
56904 area += steradiansToSqmeters(entity.area(graph));
56908 if (selected.length > 1) {
56913 if (selected.length === 2 && selected[0].type === "node" && selected[1].type === "node") {
56914 distance = geoSphericalDistance(selected[0].loc, selected[1].loc);
56916 if (selected.length === 1 && selected[0].type === "node") {
56917 location = selected[0].loc;
56919 totalNodeCount = utilGetAllNodes(selectedIDs, context.graph()).length;
56921 if (!location && !centroid) {
56922 center = extent.center();
56926 selection2.html("");
56928 selection2.append("h4").attr("class", "measurement-heading").html(heading);
56930 var list = selection2.append("ul");
56933 list.append("li").call(_t.append("info_panels.measurement.geometry", { suffix: ":" })).append("span").html(
56934 closed ? _t.html("info_panels.measurement.closed_" + geometry) : _t.html("geometry." + geometry)
56937 if (totalNodeCount) {
56938 list.append("li").call(_t.append("info_panels.measurement.node_count", { suffix: ":" })).append("span").text(totalNodeCount.toLocaleString(localeCode));
56941 list.append("li").call(_t.append("info_panels.measurement.area", { suffix: ":" })).append("span").text(displayArea(area, _isImperial));
56944 list.append("li").call(_t.append("info_panels.measurement." + (closed ? "perimeter" : "length"), { suffix: ":" })).append("span").text(displayLength(length, _isImperial));
56946 if (typeof distance === "number") {
56947 list.append("li").call(_t.append("info_panels.measurement.distance", { suffix: ":" })).append("span").text(displayLength(distance, _isImperial));
56950 coordItem = list.append("li").call(_t.append("info_panels.measurement.location", { suffix: ":" }));
56951 coordItem.append("span").text(dmsCoordinatePair(location));
56952 coordItem.append("span").text(decimalCoordinatePair(location));
56955 coordItem = list.append("li").call(_t.append("info_panels.measurement.centroid", { suffix: ":" }));
56956 coordItem.append("span").text(dmsCoordinatePair(centroid));
56957 coordItem.append("span").text(decimalCoordinatePair(centroid));
56960 coordItem = list.append("li").call(_t.append("info_panels.measurement.center", { suffix: ":" }));
56961 coordItem.append("span").text(dmsCoordinatePair(center));
56962 coordItem.append("span").text(decimalCoordinatePair(center));
56964 if (length || area || typeof distance === "number") {
56965 var toggle = _isImperial ? "imperial" : "metric";
56966 selection2.append("a").call(_t.append("info_panels.measurement." + toggle)).attr("href", "#").attr("class", "button button-toggle-units").on("click", function(d3_event) {
56967 d3_event.preventDefault();
56968 _isImperial = !_isImperial;
56969 selection2.call(redraw);
56973 var panel = function(selection2) {
56974 selection2.call(redraw);
56975 context.map().on("drawn.info-measurement", function() {
56976 selection2.call(redraw);
56978 context.on("enter.info-measurement", function() {
56979 selection2.call(redraw);
56982 panel.off = function() {
56983 context.map().on("drawn.info-measurement", null);
56984 context.on("enter.info-measurement", null);
56986 panel.id = "measurement";
56987 panel.label = _t.append("info_panels.measurement.title");
56988 panel.key = _t("info_panels.measurement.key");
56992 // modules/ui/panels/index.js
56993 var uiInfoPanels = {
56994 background: uiPanelBackground,
56995 history: uiPanelHistory,
56996 location: uiPanelLocation,
56997 measurement: uiPanelMeasurement
57000 // modules/ui/info.js
57001 function uiInfo(context) {
57002 var ids = Object.keys(uiInfoPanels);
57003 var wasActive = ["measurement"];
57006 ids.forEach(function(k2) {
57008 panels[k2] = uiInfoPanels[k2](context);
57009 active[k2] = false;
57012 function info(selection2) {
57013 function redraw() {
57014 var activeids = ids.filter(function(k2) {
57017 var containers = infoPanels.selectAll(".panel-container").data(activeids, function(k2) {
57020 containers.exit().style("opacity", 1).transition().duration(200).style("opacity", 0).on("end", function(d2) {
57021 select_default2(this).call(panels[d2].off).remove();
57023 var enter = containers.enter().append("div").attr("class", function(d2) {
57024 return "fillD2 panel-container panel-container-" + d2;
57026 enter.style("opacity", 0).transition().duration(200).style("opacity", 1);
57027 var title = enter.append("div").attr("class", "panel-title fillD2");
57028 title.append("h3").each(function(d2) {
57029 return panels[d2].label(select_default2(this));
57031 title.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function(d3_event, d2) {
57032 d3_event.stopImmediatePropagation();
57033 d3_event.preventDefault();
57035 }).call(svgIcon("#iD-icon-close"));
57036 enter.append("div").attr("class", function(d2) {
57037 return "panel-content panel-content-" + d2;
57039 infoPanels.selectAll(".panel-content").each(function(d2) {
57040 select_default2(this).call(panels[d2]);
57043 info.toggle = function(which) {
57044 var activeids = ids.filter(function(k2) {
57048 active[which] = !active[which];
57049 if (activeids.length === 1 && activeids[0] === which) {
57050 wasActive = [which];
57052 context.container().select("." + which + "-panel-toggle-item").classed("active", active[which]).select("input").property("checked", active[which]);
57054 if (activeids.length) {
57055 wasActive = activeids;
57056 activeids.forEach(function(k2) {
57057 active[k2] = false;
57060 wasActive.forEach(function(k2) {
57067 var infoPanels = selection2.selectAll(".info-panels").data([0]);
57068 infoPanels = infoPanels.enter().append("div").attr("class", "info-panels").merge(infoPanels);
57070 context.keybinding().on(uiCmd("\u2318" + _t("info_panels.key")), function(d3_event) {
57071 d3_event.stopImmediatePropagation();
57072 d3_event.preventDefault();
57075 ids.forEach(function(k2) {
57076 var key = _t("info_panels." + k2 + ".key", { default: null });
57079 context.keybinding().on(uiCmd("\u2318\u21E7" + key), function(d3_event) {
57080 d3_event.stopImmediatePropagation();
57081 d3_event.preventDefault();
57089 // modules/ui/intro/helper.js
57090 function pointBox(loc, context) {
57091 var rect = context.surfaceRect();
57092 var point2 = context.curtainProjection(loc);
57094 left: point2[0] + rect.left - 40,
57095 top: point2[1] + rect.top - 60,
57100 function pad(locOrBox, padding, context) {
57102 if (locOrBox instanceof Array) {
57103 var rect = context.surfaceRect();
57104 var point2 = context.curtainProjection(locOrBox);
57106 left: point2[0] + rect.left,
57107 top: point2[1] + rect.top
57113 left: box.left - padding,
57114 top: box.top - padding,
57115 width: (box.width || 0) + 2 * padding,
57116 height: (box.width || 0) + 2 * padding
57119 function icon(name, svgklass, useklass) {
57120 return '<svg class="icon ' + (svgklass || "") + '"><use xlink:href="' + name + '"' + (useklass ? ' class="' + useklass + '"' : "") + "></use></svg>";
57122 var helpStringReplacements;
57123 function helpHtml(id2, replacements) {
57124 if (!helpStringReplacements) {
57125 helpStringReplacements = {
57126 // insert icons corresponding to various UI elements
57127 point_icon: icon("#iD-icon-point", "inline"),
57128 line_icon: icon("#iD-icon-line", "inline"),
57129 area_icon: icon("#iD-icon-area", "inline"),
57130 note_icon: icon("#iD-icon-note", "inline add-note"),
57131 plus: icon("#iD-icon-plus", "inline"),
57132 minus: icon("#iD-icon-minus", "inline"),
57133 layers_icon: icon("#iD-icon-layers", "inline"),
57134 data_icon: icon("#iD-icon-data", "inline"),
57135 inspect: icon("#iD-icon-inspect", "inline"),
57136 help_icon: icon("#iD-icon-help", "inline"),
57137 undo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo", "inline"),
57138 redo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-undo" : "#iD-icon-redo", "inline"),
57139 save_icon: icon("#iD-icon-save", "inline"),
57141 circularize_icon: icon("#iD-operation-circularize", "inline operation"),
57142 continue_icon: icon("#iD-operation-continue", "inline operation"),
57143 copy_icon: icon("#iD-operation-copy", "inline operation"),
57144 delete_icon: icon("#iD-operation-delete", "inline operation"),
57145 disconnect_icon: icon("#iD-operation-disconnect", "inline operation"),
57146 downgrade_icon: icon("#iD-operation-downgrade", "inline operation"),
57147 extract_icon: icon("#iD-operation-extract", "inline operation"),
57148 merge_icon: icon("#iD-operation-merge", "inline operation"),
57149 move_icon: icon("#iD-operation-move", "inline operation"),
57150 orthogonalize_icon: icon("#iD-operation-orthogonalize", "inline operation"),
57151 paste_icon: icon("#iD-operation-paste", "inline operation"),
57152 reflect_long_icon: icon("#iD-operation-reflect-long", "inline operation"),
57153 reflect_short_icon: icon("#iD-operation-reflect-short", "inline operation"),
57154 reverse_icon: icon("#iD-operation-reverse", "inline operation"),
57155 rotate_icon: icon("#iD-operation-rotate", "inline operation"),
57156 split_icon: icon("#iD-operation-split", "inline operation"),
57157 straighten_icon: icon("#iD-operation-straighten", "inline operation"),
57158 // interaction icons
57159 leftclick: icon("#iD-walkthrough-mouse-left", "inline operation"),
57160 rightclick: icon("#iD-walkthrough-mouse-right", "inline operation"),
57161 mousewheel_icon: icon("#iD-walkthrough-mousewheel", "inline operation"),
57162 tap_icon: icon("#iD-walkthrough-tap", "inline operation"),
57163 doubletap_icon: icon("#iD-walkthrough-doubletap", "inline operation"),
57164 longpress_icon: icon("#iD-walkthrough-longpress", "inline operation"),
57165 touchdrag_icon: icon("#iD-walkthrough-touchdrag", "inline operation"),
57166 pinch_icon: icon("#iD-walkthrough-pinch-apart", "inline operation"),
57167 // insert keys; may be localized and platform-dependent
57168 shift: uiCmd.display("\u21E7"),
57169 alt: uiCmd.display("\u2325"),
57170 return: uiCmd.display("\u21B5"),
57171 esc: _t.html("shortcuts.key.esc"),
57172 space: _t.html("shortcuts.key.space"),
57173 add_note_key: _t.html("modes.add_note.key"),
57174 help_key: _t.html("help.key"),
57175 shortcuts_key: _t.html("shortcuts.toggle.key"),
57176 // reference localized UI labels directly so that they'll always match
57177 save: _t.html("save.title"),
57178 undo: _t.html("undo.title"),
57179 redo: _t.html("redo.title"),
57180 upload: _t.html("commit.save"),
57181 point: _t.html("modes.add_point.title"),
57182 line: _t.html("modes.add_line.title"),
57183 area: _t.html("modes.add_area.title"),
57184 note: _t.html("modes.add_note.label"),
57185 circularize: _t.html("operations.circularize.title"),
57186 continue: _t.html("operations.continue.title"),
57187 copy: _t.html("operations.copy.title"),
57188 delete: _t.html("operations.delete.title"),
57189 disconnect: _t.html("operations.disconnect.title"),
57190 downgrade: _t.html("operations.downgrade.title"),
57191 extract: _t.html("operations.extract.title"),
57192 merge: _t.html("operations.merge.title"),
57193 move: _t.html("operations.move.title"),
57194 orthogonalize: _t.html("operations.orthogonalize.title"),
57195 paste: _t.html("operations.paste.title"),
57196 reflect_long: _t.html("operations.reflect.title.long"),
57197 reflect_short: _t.html("operations.reflect.title.short"),
57198 reverse: _t.html("operations.reverse.title"),
57199 rotate: _t.html("operations.rotate.title"),
57200 split: _t.html("operations.split.title"),
57201 straighten: _t.html("operations.straighten.title"),
57202 map_data: _t.html("map_data.title"),
57203 osm_notes: _t.html("map_data.layers.notes.title"),
57204 fields: _t.html("inspector.fields"),
57205 tags: _t.html("inspector.tags"),
57206 relations: _t.html("inspector.relations"),
57207 new_relation: _t.html("inspector.new_relation"),
57208 turn_restrictions: _t.html("_tagging.presets.fields.restrictions.label"),
57209 background_settings: _t.html("background.description"),
57210 imagery_offset: _t.html("background.fix_misalignment"),
57211 start_the_walkthrough: _t.html("splash.walkthrough"),
57212 help: _t.html("help.title"),
57213 ok: _t.html("intro.ok")
57215 for (var key in helpStringReplacements) {
57216 helpStringReplacements[key] = { html: helpStringReplacements[key] };
57220 if (replacements) {
57221 reps = Object.assign(replacements, helpStringReplacements);
57223 reps = helpStringReplacements;
57225 return _t.html(id2, reps).replace(/\`(.*?)\`/g, "<kbd>$1</kbd>");
57227 function slugify(text2) {
57228 return text2.toString().toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
57230 var missingStrings = {};
57231 function checkKey(key, text2) {
57232 if (_t(key, { default: void 0 }) === void 0) {
57233 if (missingStrings.hasOwnProperty(key))
57235 missingStrings[key] = text2;
57236 var missing = key + ": " + text2;
57237 if (typeof console !== "undefined")
57238 console.log(missing);
57241 function localize(obj) {
57243 var name = obj.tags && obj.tags.name;
57245 key = "intro.graph.name." + slugify(name);
57246 obj.tags.name = _t(key, { default: name });
57247 checkKey(key, name);
57249 var street = obj.tags && obj.tags["addr:street"];
57251 key = "intro.graph.name." + slugify(street);
57252 obj.tags["addr:street"] = _t(key, { default: street });
57253 checkKey(key, street);
57268 addrTags.forEach(function(k2) {
57269 var key2 = "intro.graph." + k2;
57270 var tag = "addr:" + k2;
57271 var val = obj.tags && obj.tags[tag];
57272 var str2 = _t(key2, { default: val });
57274 if (str2.match(/^<.*>$/) !== null) {
57275 delete obj.tags[tag];
57277 obj.tags[tag] = str2;
57284 function isMostlySquare(points) {
57285 var threshold = 15;
57286 var lowerBound = Math.cos((90 - threshold) * Math.PI / 180);
57287 var upperBound = Math.cos(threshold * Math.PI / 180);
57288 for (var i3 = 0; i3 < points.length; i3++) {
57289 var a2 = points[(i3 - 1 + points.length) % points.length];
57290 var origin = points[i3];
57291 var b2 = points[(i3 + 1) % points.length];
57292 var dotp = geoVecNormalizedDot(a2, b2, origin);
57293 var mag = Math.abs(dotp);
57294 if (mag > lowerBound && mag < upperBound) {
57300 function selectMenuItem(context, operation) {
57301 return context.container().select(".edit-menu .edit-menu-item-" + operation);
57303 function transitionTime(point1, point2) {
57304 var distance = geoSphericalDistance(point1, point2);
57305 if (distance === 0) {
57307 } else if (distance < 80) {
57314 // modules/ui/toggle.js
57315 function uiToggle(show, callback) {
57316 return function(selection2) {
57317 selection2.style("opacity", show ? 0 : 1).classed("hide", false).transition().style("opacity", show ? 1 : 0).on("end", function() {
57318 select_default2(this).classed("hide", !show).style("opacity", null);
57320 callback.apply(this);
57325 // modules/ui/curtain.js
57326 function uiCurtain(containerNode) {
57327 var surface = select_default2(null), tooltip = select_default2(null), darkness = select_default2(null);
57328 function curtain(selection2) {
57329 surface = selection2.append("svg").attr("class", "curtain").style("top", 0).style("left", 0);
57330 darkness = surface.append("path").attr("x", 0).attr("y", 0).attr("class", "curtain-darkness");
57331 select_default2(window).on("resize.curtain", resize);
57332 tooltip = selection2.append("div").attr("class", "tooltip");
57333 tooltip.append("div").attr("class", "popover-arrow");
57334 tooltip.append("div").attr("class", "popover-inner");
57336 function resize() {
57337 surface.attr("width", containerNode.clientWidth).attr("height", containerNode.clientHeight);
57338 curtain.cut(darkness.datum());
57341 curtain.reveal = function(box, html2, options2) {
57342 options2 = options2 || {};
57343 if (typeof box === "string") {
57344 box = select_default2(box).node();
57346 if (box && box.getBoundingClientRect) {
57347 box = copyBox(box.getBoundingClientRect());
57348 var containerRect = containerNode.getBoundingClientRect();
57349 box.top -= containerRect.top;
57350 box.left -= containerRect.left;
57352 if (box && options2.padding) {
57353 box.top -= options2.padding;
57354 box.left -= options2.padding;
57355 box.bottom += options2.padding;
57356 box.right += options2.padding;
57357 box.height += options2.padding * 2;
57358 box.width += options2.padding * 2;
57361 if (options2.tooltipBox) {
57362 tooltipBox = options2.tooltipBox;
57363 if (typeof tooltipBox === "string") {
57364 tooltipBox = select_default2(tooltipBox).node();
57366 if (tooltipBox && tooltipBox.getBoundingClientRect) {
57367 tooltipBox = copyBox(tooltipBox.getBoundingClientRect());
57372 if (tooltipBox && html2) {
57373 if (html2.indexOf("**") !== -1) {
57374 if (html2.indexOf("<span") === 0) {
57375 html2 = html2.replace(/^(<span.*?>)(.+?)(\*\*)/, "$1<span>$2</span>$3");
57377 html2 = html2.replace(/^(.+?)(\*\*)/, "<span>$1</span>$2");
57379 html2 = html2.replace(/\*\*(.*?)\*\*/g, '<span class="instruction">$1</span>');
57381 html2 = html2.replace(/\*(.*?)\*/g, "<em>$1</em>");
57382 html2 = html2.replace(/\{br\}/g, "<br/><br/>");
57383 if (options2.buttonText && options2.buttonCallback) {
57384 html2 += '<div class="button-section"><button href="#" class="button action">' + options2.buttonText + "</button></div>";
57386 var classes = "curtain-tooltip popover tooltip arrowed in " + (options2.tooltipClass || "");
57387 tooltip.classed(classes, true).selectAll(".popover-inner").html(html2);
57388 if (options2.buttonText && options2.buttonCallback) {
57389 var button = tooltip.selectAll(".button-section .button.action");
57390 button.on("click", function(d3_event) {
57391 d3_event.preventDefault();
57392 options2.buttonCallback();
57395 var tip = copyBox(tooltip.node().getBoundingClientRect()), w2 = containerNode.clientWidth, h2 = containerNode.clientHeight, tooltipWidth = 200, tooltipArrow = 5, side, pos;
57396 if (options2.tooltipClass === "intro-mouse") {
57399 if (tooltipBox.top + tooltipBox.height > h2) {
57400 tooltipBox.height -= tooltipBox.top + tooltipBox.height - h2;
57402 if (tooltipBox.left + tooltipBox.width > w2) {
57403 tooltipBox.width -= tooltipBox.left + tooltipBox.width - w2;
57405 if (tooltipBox.top + tooltipBox.height < 100) {
57408 tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
57409 tooltipBox.top + tooltipBox.height
57411 } else if (tooltipBox.top > h2 - 140) {
57414 tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
57415 tooltipBox.top - tip.height
57418 var tipY = tooltipBox.top + tooltipBox.height / 2 - tip.height / 2;
57419 if (_mainLocalizer.textDirection() === "rtl") {
57420 if (tooltipBox.left - tooltipWidth - tooltipArrow < 70) {
57422 pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
57425 pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
57428 if (tooltipBox.left + tooltipBox.width + tooltipArrow + tooltipWidth > w2 - 70) {
57430 pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
57433 pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
57437 if (options2.duration !== 0 || !tooltip.classed(side)) {
57438 tooltip.call(uiToggle(true));
57440 tooltip.style("top", pos[1] + "px").style("left", pos[0] + "px").attr("class", classes + " " + side);
57442 if (side === "left" || side === "right") {
57444 shiftY = 60 - pos[1];
57445 } else if (pos[1] + tip.height > h2 - 100) {
57446 shiftY = h2 - pos[1] - tip.height - 100;
57449 tooltip.selectAll(".popover-inner").style("top", shiftY + "px");
57451 tooltip.classed("in", false).call(uiToggle(false));
57453 curtain.cut(box, options2.duration);
57456 curtain.cut = function(datum2, duration) {
57457 darkness.datum(datum2).interrupt();
57459 if (duration === 0) {
57460 selection2 = darkness;
57462 selection2 = darkness.transition().duration(duration || 600).ease(linear2);
57464 selection2.attr("d", function(d2) {
57465 var containerWidth = containerNode.clientWidth;
57466 var containerHeight = containerNode.clientHeight;
57467 var string = "M 0,0 L 0," + containerHeight + " L " + containerWidth + "," + containerHeight + "L" + containerWidth + ",0 Z";
57470 return string + "M" + d2.left + "," + d2.top + "L" + d2.left + "," + (d2.top + d2.height) + "L" + (d2.left + d2.width) + "," + (d2.top + d2.height) + "L" + (d2.left + d2.width) + "," + d2.top + "Z";
57473 curtain.remove = function() {
57476 select_default2(window).on("resize.curtain", null);
57478 function copyBox(src) {
57482 bottom: src.bottom,
57491 // modules/ui/intro/welcome.js
57492 function uiIntroWelcome(context, reveal) {
57493 var dispatch14 = dispatch_default("done");
57495 title: "intro.welcome.title"
57497 function welcome() {
57498 context.map().centerZoom([-85.63591, 41.94285], 19);
57500 ".intro-nav-wrap .chapter-welcome",
57501 helpHtml("intro.welcome.welcome"),
57502 { buttonText: _t.html("intro.ok"), buttonCallback: practice }
57505 function practice() {
57507 ".intro-nav-wrap .chapter-welcome",
57508 helpHtml("intro.welcome.practice"),
57509 { buttonText: _t.html("intro.ok"), buttonCallback: words }
57514 ".intro-nav-wrap .chapter-welcome",
57515 helpHtml("intro.welcome.words"),
57516 { buttonText: _t.html("intro.ok"), buttonCallback: chapters }
57519 function chapters() {
57520 dispatch14.call("done");
57522 ".intro-nav-wrap .chapter-navigation",
57523 helpHtml("intro.welcome.chapters", { next: _t("intro.navigation.title") })
57526 chapter.enter = function() {
57529 chapter.exit = function() {
57530 context.container().select(".curtain-tooltip.intro-mouse").selectAll(".counter").remove();
57532 chapter.restart = function() {
57536 return utilRebind(chapter, dispatch14, "on");
57539 // modules/ui/intro/navigation.js
57540 function uiIntroNavigation(context, reveal) {
57541 var dispatch14 = dispatch_default("done");
57543 var hallId = "n2061";
57544 var townHall = [-85.63591, 41.94285];
57545 var springStreetId = "w397";
57546 var springStreetEndId = "n1834";
57547 var springStreet = [-85.63582, 41.94255];
57548 var onewayField = _mainPresetIndex.field("oneway");
57549 var maxspeedField = _mainPresetIndex.field("maxspeed");
57551 title: "intro.navigation.title"
57553 function timeout2(f3, t2) {
57554 timeouts.push(window.setTimeout(f3, t2));
57556 function eventCancel(d3_event) {
57557 d3_event.stopPropagation();
57558 d3_event.preventDefault();
57560 function isTownHallSelected() {
57561 var ids = context.selectedIDs();
57562 return ids.length === 1 && ids[0] === hallId;
57564 function dragMap() {
57565 context.enter(modeBrowse(context));
57566 context.history().reset("initial");
57567 var msec = transitionTime(townHall, context.map().center());
57569 reveal(null, null, { duration: 0 });
57571 context.map().centerZoomEase(townHall, 19, msec);
57572 timeout2(function() {
57573 var centerStart = context.map().center();
57574 var textId = context.lastPointerType() === "mouse" ? "drag" : "drag_touch";
57575 var dragString = helpHtml("intro.navigation.map_info") + "{br}" + helpHtml("intro.navigation." + textId);
57576 reveal(".surface", dragString);
57577 context.map().on("drawn.intro", function() {
57578 reveal(".surface", dragString, { duration: 0 });
57580 context.map().on("move.intro", function() {
57581 var centerNow = context.map().center();
57582 if (centerStart[0] !== centerNow[0] || centerStart[1] !== centerNow[1]) {
57583 context.map().on("move.intro", null);
57584 timeout2(function() {
57585 continueTo(zoomMap);
57590 function continueTo(nextStep) {
57591 context.map().on("move.intro drawn.intro", null);
57595 function zoomMap() {
57596 var zoomStart = context.map().zoom();
57597 var textId = context.lastPointerType() === "mouse" ? "zoom" : "zoom_touch";
57598 var zoomString = helpHtml("intro.navigation." + textId);
57599 reveal(".surface", zoomString);
57600 context.map().on("drawn.intro", function() {
57601 reveal(".surface", zoomString, { duration: 0 });
57603 context.map().on("move.intro", function() {
57604 if (context.map().zoom() !== zoomStart) {
57605 context.map().on("move.intro", null);
57606 timeout2(function() {
57607 continueTo(features);
57611 function continueTo(nextStep) {
57612 context.map().on("move.intro drawn.intro", null);
57616 function features() {
57617 var onClick = function() {
57618 continueTo(pointsLinesAreas);
57622 helpHtml("intro.navigation.features"),
57623 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57625 context.map().on("drawn.intro", function() {
57628 helpHtml("intro.navigation.features"),
57629 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57632 function continueTo(nextStep) {
57633 context.map().on("drawn.intro", null);
57637 function pointsLinesAreas() {
57638 var onClick = function() {
57639 continueTo(nodesWays);
57643 helpHtml("intro.navigation.points_lines_areas"),
57644 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57646 context.map().on("drawn.intro", function() {
57649 helpHtml("intro.navigation.points_lines_areas"),
57650 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57653 function continueTo(nextStep) {
57654 context.map().on("drawn.intro", null);
57658 function nodesWays() {
57659 var onClick = function() {
57660 continueTo(clickTownHall);
57664 helpHtml("intro.navigation.nodes_ways"),
57665 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57667 context.map().on("drawn.intro", function() {
57670 helpHtml("intro.navigation.nodes_ways"),
57671 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57674 function continueTo(nextStep) {
57675 context.map().on("drawn.intro", null);
57679 function clickTownHall() {
57680 context.enter(modeBrowse(context));
57681 context.history().reset("initial");
57682 var entity = context.hasEntity(hallId);
57685 reveal(null, null, { duration: 0 });
57686 context.map().centerZoomEase(entity.loc, 19, 500);
57687 timeout2(function() {
57688 var entity2 = context.hasEntity(hallId);
57691 var box = pointBox(entity2.loc, context);
57692 var textId = context.lastPointerType() === "mouse" ? "click_townhall" : "tap_townhall";
57693 reveal(box, helpHtml("intro.navigation." + textId));
57694 context.map().on("move.intro drawn.intro", function() {
57695 var entity3 = context.hasEntity(hallId);
57698 var box2 = pointBox(entity3.loc, context);
57699 reveal(box2, helpHtml("intro.navigation." + textId), { duration: 0 });
57701 context.on("enter.intro", function() {
57702 if (isTownHallSelected())
57703 continueTo(selectedTownHall);
57706 context.history().on("change.intro", function() {
57707 if (!context.hasEntity(hallId)) {
57708 continueTo(clickTownHall);
57711 function continueTo(nextStep) {
57712 context.on("enter.intro", null);
57713 context.map().on("move.intro drawn.intro", null);
57714 context.history().on("change.intro", null);
57718 function selectedTownHall() {
57719 if (!isTownHallSelected())
57720 return clickTownHall();
57721 var entity = context.hasEntity(hallId);
57723 return clickTownHall();
57724 var box = pointBox(entity.loc, context);
57725 var onClick = function() {
57726 continueTo(editorTownHall);
57730 helpHtml("intro.navigation.selected_townhall"),
57731 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57733 context.map().on("move.intro drawn.intro", function() {
57734 var entity2 = context.hasEntity(hallId);
57737 var box2 = pointBox(entity2.loc, context);
57740 helpHtml("intro.navigation.selected_townhall"),
57741 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57744 context.history().on("change.intro", function() {
57745 if (!context.hasEntity(hallId)) {
57746 continueTo(clickTownHall);
57749 function continueTo(nextStep) {
57750 context.map().on("move.intro drawn.intro", null);
57751 context.history().on("change.intro", null);
57755 function editorTownHall() {
57756 if (!isTownHallSelected())
57757 return clickTownHall();
57758 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
57759 var onClick = function() {
57760 continueTo(presetTownHall);
57763 ".entity-editor-pane",
57764 helpHtml("intro.navigation.editor_townhall"),
57765 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57767 context.on("exit.intro", function() {
57768 continueTo(clickTownHall);
57770 context.history().on("change.intro", function() {
57771 if (!context.hasEntity(hallId)) {
57772 continueTo(clickTownHall);
57775 function continueTo(nextStep) {
57776 context.on("exit.intro", null);
57777 context.history().on("change.intro", null);
57778 context.container().select(".inspector-wrap").on("wheel.intro", null);
57782 function presetTownHall() {
57783 if (!isTownHallSelected())
57784 return clickTownHall();
57785 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
57786 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
57787 var entity = context.entity(context.selectedIDs()[0]);
57788 var preset = _mainPresetIndex.match(entity, context.graph());
57789 var onClick = function() {
57790 continueTo(fieldsTownHall);
57793 ".entity-editor-pane .section-feature-type",
57794 helpHtml("intro.navigation.preset_townhall", { preset: preset.name() }),
57795 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57797 context.on("exit.intro", function() {
57798 continueTo(clickTownHall);
57800 context.history().on("change.intro", function() {
57801 if (!context.hasEntity(hallId)) {
57802 continueTo(clickTownHall);
57805 function continueTo(nextStep) {
57806 context.on("exit.intro", null);
57807 context.history().on("change.intro", null);
57808 context.container().select(".inspector-wrap").on("wheel.intro", null);
57812 function fieldsTownHall() {
57813 if (!isTownHallSelected())
57814 return clickTownHall();
57815 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
57816 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
57817 var onClick = function() {
57818 continueTo(closeTownHall);
57821 ".entity-editor-pane .section-preset-fields",
57822 helpHtml("intro.navigation.fields_townhall"),
57823 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57825 context.on("exit.intro", function() {
57826 continueTo(clickTownHall);
57828 context.history().on("change.intro", function() {
57829 if (!context.hasEntity(hallId)) {
57830 continueTo(clickTownHall);
57833 function continueTo(nextStep) {
57834 context.on("exit.intro", null);
57835 context.history().on("change.intro", null);
57836 context.container().select(".inspector-wrap").on("wheel.intro", null);
57840 function closeTownHall() {
57841 if (!isTownHallSelected())
57842 return clickTownHall();
57843 var selector = ".entity-editor-pane button.close svg use";
57844 var href = select_default2(selector).attr("href") || "#iD-icon-close";
57846 ".entity-editor-pane",
57847 helpHtml("intro.navigation.close_townhall", { button: { html: icon(href, "inline") } })
57849 context.on("exit.intro", function() {
57850 continueTo(searchStreet);
57852 context.history().on("change.intro", function() {
57853 var selector2 = ".entity-editor-pane button.close svg use";
57854 var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
57856 ".entity-editor-pane",
57857 helpHtml("intro.navigation.close_townhall", { button: { html: icon(href2, "inline") } }),
57861 function continueTo(nextStep) {
57862 context.on("exit.intro", null);
57863 context.history().on("change.intro", null);
57867 function searchStreet() {
57868 context.enter(modeBrowse(context));
57869 context.history().reset("initial");
57870 var msec = transitionTime(springStreet, context.map().center());
57872 reveal(null, null, { duration: 0 });
57874 context.map().centerZoomEase(springStreet, 19, msec);
57875 timeout2(function() {
57877 ".search-header input",
57878 helpHtml("intro.navigation.search_street", { name: _t("intro.graph.name.spring-street") })
57880 context.container().select(".search-header input").on("keyup.intro", checkSearchResult);
57883 function checkSearchResult() {
57884 var first = context.container().select(".feature-list-item:nth-child(0n+2)");
57885 var firstName = first.select(".entity-name");
57886 var name = _t("intro.graph.name.spring-street");
57887 if (!firstName.empty() && firstName.html() === name) {
57890 helpHtml("intro.navigation.choose_street", { name }),
57893 context.on("exit.intro", function() {
57894 continueTo(selectedStreet);
57896 context.container().select(".search-header input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
57898 function continueTo(nextStep) {
57899 context.on("exit.intro", null);
57900 context.container().select(".search-header input").on("keydown.intro", null).on("keyup.intro", null);
57904 function selectedStreet() {
57905 if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
57906 return searchStreet();
57908 var onClick = function() {
57909 continueTo(editorStreet);
57911 var entity = context.entity(springStreetEndId);
57912 var box = pointBox(entity.loc, context);
57916 helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
57917 { duration: 600, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57919 timeout2(function() {
57920 context.map().on("move.intro drawn.intro", function() {
57921 var entity2 = context.hasEntity(springStreetEndId);
57924 var box2 = pointBox(entity2.loc, context);
57928 helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
57929 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
57933 context.on("enter.intro", function(mode) {
57934 if (!context.hasEntity(springStreetId)) {
57935 return continueTo(searchStreet);
57937 var ids = context.selectedIDs();
57938 if (mode.id !== "select" || !ids.length || ids[0] !== springStreetId) {
57939 context.enter(modeSelect(context, [springStreetId]));
57942 context.history().on("change.intro", function() {
57943 if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
57944 timeout2(function() {
57945 continueTo(searchStreet);
57949 function continueTo(nextStep) {
57950 context.map().on("move.intro drawn.intro", null);
57951 context.on("enter.intro", null);
57952 context.history().on("change.intro", null);
57956 function editorStreet() {
57957 var selector = ".entity-editor-pane button.close svg use";
57958 var href = select_default2(selector).attr("href") || "#iD-icon-close";
57959 reveal(".entity-editor-pane", helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
57960 button: { html: icon(href, "inline") },
57961 field1: onewayField.title(),
57962 field2: maxspeedField.title()
57964 context.on("exit.intro", function() {
57967 context.history().on("change.intro", function() {
57968 var selector2 = ".entity-editor-pane button.close svg use";
57969 var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
57971 ".entity-editor-pane",
57972 helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
57973 button: { html: icon(href2, "inline") },
57974 field1: onewayField.title(),
57975 field2: maxspeedField.title()
57980 function continueTo(nextStep) {
57981 context.on("exit.intro", null);
57982 context.history().on("change.intro", null);
57987 dispatch14.call("done");
57990 helpHtml("intro.navigation.play", { next: _t("intro.points.title") }),
57992 tooltipBox: ".intro-nav-wrap .chapter-point",
57993 buttonText: _t.html("intro.ok"),
57994 buttonCallback: function() {
57995 reveal(".ideditor");
58000 chapter.enter = function() {
58003 chapter.exit = function() {
58004 timeouts.forEach(window.clearTimeout);
58005 context.on("enter.intro exit.intro", null);
58006 context.map().on("move.intro drawn.intro", null);
58007 context.history().on("change.intro", null);
58008 context.container().select(".inspector-wrap").on("wheel.intro", null);
58009 context.container().select(".search-header input").on("keydown.intro keyup.intro", null);
58011 chapter.restart = function() {
58015 return utilRebind(chapter, dispatch14, "on");
58018 // modules/ui/intro/point.js
58019 function uiIntroPoint(context, reveal) {
58020 var dispatch14 = dispatch_default("done");
58022 var intersection = [-85.63279, 41.94394];
58023 var building = [-85.632422, 41.944045];
58024 var cafePreset = _mainPresetIndex.item("amenity/cafe");
58025 var _pointID = null;
58027 title: "intro.points.title"
58029 function timeout2(f3, t2) {
58030 timeouts.push(window.setTimeout(f3, t2));
58032 function eventCancel(d3_event) {
58033 d3_event.stopPropagation();
58034 d3_event.preventDefault();
58036 function addPoint() {
58037 context.enter(modeBrowse(context));
58038 context.history().reset("initial");
58039 var msec = transitionTime(intersection, context.map().center());
58041 reveal(null, null, { duration: 0 });
58043 context.map().centerZoomEase(intersection, 19, msec);
58044 timeout2(function() {
58045 var tooltip = reveal(
58046 "button.add-point",
58047 helpHtml("intro.points.points_info") + "{br}" + helpHtml("intro.points.add_point")
58050 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-points");
58051 context.on("enter.intro", function(mode) {
58052 if (mode.id !== "add-point")
58054 continueTo(placePoint);
58057 function continueTo(nextStep) {
58058 context.on("enter.intro", null);
58062 function placePoint() {
58063 if (context.mode().id !== "add-point") {
58064 return chapter.restart();
58066 var pointBox2 = pad(building, 150, context);
58067 var textId = context.lastPointerType() === "mouse" ? "place_point" : "place_point_touch";
58068 reveal(pointBox2, helpHtml("intro.points." + textId));
58069 context.map().on("move.intro drawn.intro", function() {
58070 pointBox2 = pad(building, 150, context);
58071 reveal(pointBox2, helpHtml("intro.points." + textId), { duration: 0 });
58073 context.on("enter.intro", function(mode) {
58074 if (mode.id !== "select")
58075 return chapter.restart();
58076 _pointID = context.mode().selectedIDs()[0];
58077 continueTo(searchPreset);
58079 function continueTo(nextStep) {
58080 context.map().on("move.intro drawn.intro", null);
58081 context.on("enter.intro", null);
58085 function searchPreset() {
58086 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58089 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58090 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58092 ".preset-search-input",
58093 helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
58095 context.on("enter.intro", function(mode) {
58096 if (!_pointID || !context.hasEntity(_pointID)) {
58097 return continueTo(addPoint);
58099 var ids = context.selectedIDs();
58100 if (mode.id !== "select" || !ids.length || ids[0] !== _pointID) {
58101 context.enter(modeSelect(context, [_pointID]));
58102 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58103 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58105 ".preset-search-input",
58106 helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
58108 context.history().on("change.intro", null);
58111 function checkPresetSearch() {
58112 var first = context.container().select(".preset-list-item:first-child");
58113 if (first.classed("preset-amenity-cafe")) {
58114 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
58116 first.select(".preset-list-button").node(),
58117 helpHtml("intro.points.choose_cafe", { preset: cafePreset.name() }),
58120 context.history().on("change.intro", function() {
58121 continueTo(aboutFeatureEditor);
58125 function continueTo(nextStep) {
58126 context.on("enter.intro", null);
58127 context.history().on("change.intro", null);
58128 context.container().select(".inspector-wrap").on("wheel.intro", null);
58129 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58133 function aboutFeatureEditor() {
58134 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58137 timeout2(function() {
58138 reveal(".entity-editor-pane", helpHtml("intro.points.feature_editor"), {
58139 tooltipClass: "intro-points-describe",
58140 buttonText: _t.html("intro.ok"),
58141 buttonCallback: function() {
58142 continueTo(addName);
58146 context.on("exit.intro", function() {
58147 continueTo(reselectPoint);
58149 function continueTo(nextStep) {
58150 context.on("exit.intro", null);
58154 function addName() {
58155 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58158 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58159 var addNameString = helpHtml("intro.points.fields_info") + "{br}" + helpHtml("intro.points.add_name");
58160 timeout2(function() {
58161 var entity = context.entity(_pointID);
58162 if (entity.tags.name) {
58163 var tooltip = reveal(".entity-editor-pane", addNameString, {
58164 tooltipClass: "intro-points-describe",
58165 buttonText: _t.html("intro.ok"),
58166 buttonCallback: function() {
58167 continueTo(addCloseEditor);
58170 tooltip.select(".instruction").style("display", "none");
58173 ".entity-editor-pane",
58175 { tooltipClass: "intro-points-describe" }
58179 context.history().on("change.intro", function() {
58180 continueTo(addCloseEditor);
58182 context.on("exit.intro", function() {
58183 continueTo(reselectPoint);
58185 function continueTo(nextStep) {
58186 context.on("exit.intro", null);
58187 context.history().on("change.intro", null);
58191 function addCloseEditor() {
58192 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58193 var selector = ".entity-editor-pane button.close svg use";
58194 var href = select_default2(selector).attr("href") || "#iD-icon-close";
58195 context.on("exit.intro", function() {
58196 continueTo(reselectPoint);
58199 ".entity-editor-pane",
58200 helpHtml("intro.points.add_close", { button: { html: icon(href, "inline") } })
58202 function continueTo(nextStep) {
58203 context.on("exit.intro", null);
58207 function reselectPoint() {
58209 return chapter.restart();
58210 var entity = context.hasEntity(_pointID);
58212 return chapter.restart();
58213 var oldPreset = _mainPresetIndex.match(entity, context.graph());
58214 context.replace(actionChangePreset(_pointID, oldPreset, cafePreset));
58215 context.enter(modeBrowse(context));
58216 var msec = transitionTime(entity.loc, context.map().center());
58218 reveal(null, null, { duration: 0 });
58220 context.map().centerEase(entity.loc, msec);
58221 timeout2(function() {
58222 var box = pointBox(entity.loc, context);
58223 reveal(box, helpHtml("intro.points.reselect"), { duration: 600 });
58224 timeout2(function() {
58225 context.map().on("move.intro drawn.intro", function() {
58226 var entity2 = context.hasEntity(_pointID);
58228 return chapter.restart();
58229 var box2 = pointBox(entity2.loc, context);
58230 reveal(box2, helpHtml("intro.points.reselect"), { duration: 0 });
58233 context.on("enter.intro", function(mode) {
58234 if (mode.id !== "select")
58236 continueTo(updatePoint);
58239 function continueTo(nextStep) {
58240 context.map().on("move.intro drawn.intro", null);
58241 context.on("enter.intro", null);
58245 function updatePoint() {
58246 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58247 return continueTo(reselectPoint);
58249 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58250 context.on("exit.intro", function() {
58251 continueTo(reselectPoint);
58253 context.history().on("change.intro", function() {
58254 continueTo(updateCloseEditor);
58256 timeout2(function() {
58258 ".entity-editor-pane",
58259 helpHtml("intro.points.update"),
58260 { tooltipClass: "intro-points-describe" }
58263 function continueTo(nextStep) {
58264 context.on("exit.intro", null);
58265 context.history().on("change.intro", null);
58269 function updateCloseEditor() {
58270 if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
58271 return continueTo(reselectPoint);
58273 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58274 context.on("exit.intro", function() {
58275 continueTo(rightClickPoint);
58277 timeout2(function() {
58279 ".entity-editor-pane",
58280 helpHtml("intro.points.update_close", { button: { html: icon("#iD-icon-close", "inline") } })
58283 function continueTo(nextStep) {
58284 context.on("exit.intro", null);
58288 function rightClickPoint() {
58290 return chapter.restart();
58291 var entity = context.hasEntity(_pointID);
58293 return chapter.restart();
58294 context.enter(modeBrowse(context));
58295 var box = pointBox(entity.loc, context);
58296 var textId = context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch";
58297 reveal(box, helpHtml("intro.points." + textId), { duration: 600 });
58298 timeout2(function() {
58299 context.map().on("move.intro", function() {
58300 var entity2 = context.hasEntity(_pointID);
58302 return chapter.restart();
58303 var box2 = pointBox(entity2.loc, context);
58304 reveal(box2, helpHtml("intro.points." + textId), { duration: 0 });
58307 context.on("enter.intro", function(mode) {
58308 if (mode.id !== "select")
58310 var ids = context.selectedIDs();
58311 if (ids.length !== 1 || ids[0] !== _pointID)
58313 timeout2(function() {
58314 var node = selectMenuItem(context, "delete").node();
58317 continueTo(enterDelete);
58320 function continueTo(nextStep) {
58321 context.on("enter.intro", null);
58322 context.map().on("move.intro", null);
58326 function enterDelete() {
58328 return chapter.restart();
58329 var entity = context.hasEntity(_pointID);
58331 return chapter.restart();
58332 var node = selectMenuItem(context, "delete").node();
58334 return continueTo(rightClickPoint);
58338 helpHtml("intro.points.delete"),
58341 timeout2(function() {
58342 context.map().on("move.intro", function() {
58345 helpHtml("intro.points.delete"),
58346 { duration: 0, padding: 50 }
58350 context.on("exit.intro", function() {
58352 return chapter.restart();
58353 var entity2 = context.hasEntity(_pointID);
58355 return continueTo(rightClickPoint);
58357 context.history().on("change.intro", function(changed) {
58358 if (changed.deleted().length) {
58362 function continueTo(nextStep) {
58363 context.map().on("move.intro", null);
58364 context.history().on("change.intro", null);
58365 context.on("exit.intro", null);
58370 context.history().on("change.intro", function() {
58374 ".top-toolbar button.undo-button",
58375 helpHtml("intro.points.undo")
58377 function continueTo(nextStep) {
58378 context.history().on("change.intro", null);
58383 dispatch14.call("done");
58386 helpHtml("intro.points.play", { next: _t("intro.areas.title") }),
58388 tooltipBox: ".intro-nav-wrap .chapter-area",
58389 buttonText: _t.html("intro.ok"),
58390 buttonCallback: function() {
58391 reveal(".ideditor");
58396 chapter.enter = function() {
58399 chapter.exit = function() {
58400 timeouts.forEach(window.clearTimeout);
58401 context.on("enter.intro exit.intro", null);
58402 context.map().on("move.intro drawn.intro", null);
58403 context.history().on("change.intro", null);
58404 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58405 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58407 chapter.restart = function() {
58411 return utilRebind(chapter, dispatch14, "on");
58414 // modules/ui/intro/area.js
58415 function uiIntroArea(context, reveal) {
58416 var dispatch14 = dispatch_default("done");
58417 var playground = [-85.63552, 41.94159];
58418 var playgroundPreset = _mainPresetIndex.item("leisure/playground");
58419 var nameField = _mainPresetIndex.field("name");
58420 var descriptionField = _mainPresetIndex.field("description");
58424 title: "intro.areas.title"
58426 function timeout2(f3, t2) {
58427 timeouts.push(window.setTimeout(f3, t2));
58429 function eventCancel(d3_event) {
58430 d3_event.stopPropagation();
58431 d3_event.preventDefault();
58433 function revealPlayground(center, text2, options2) {
58434 var padding = 180 * Math.pow(2, context.map().zoom() - 19.5);
58435 var box = pad(center, padding, context);
58436 reveal(box, text2, options2);
58438 function addArea() {
58439 context.enter(modeBrowse(context));
58440 context.history().reset("initial");
58442 var msec = transitionTime(playground, context.map().center());
58444 reveal(null, null, { duration: 0 });
58446 context.map().centerZoomEase(playground, 19, msec);
58447 timeout2(function() {
58448 var tooltip = reveal(
58450 helpHtml("intro.areas.add_playground")
58452 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-areas");
58453 context.on("enter.intro", function(mode) {
58454 if (mode.id !== "add-area")
58456 continueTo(startPlayground);
58459 function continueTo(nextStep) {
58460 context.on("enter.intro", null);
58464 function startPlayground() {
58465 if (context.mode().id !== "add-area") {
58466 return chapter.restart();
58469 context.map().zoomEase(19.5, 500);
58470 timeout2(function() {
58471 var textId = context.lastPointerType() === "mouse" ? "starting_node_click" : "starting_node_tap";
58472 var startDrawString = helpHtml("intro.areas.start_playground") + helpHtml("intro.areas." + textId);
58478 timeout2(function() {
58479 context.map().on("move.intro drawn.intro", function() {
58486 context.on("enter.intro", function(mode) {
58487 if (mode.id !== "draw-area")
58488 return chapter.restart();
58489 continueTo(continuePlayground);
58493 function continueTo(nextStep) {
58494 context.map().on("move.intro drawn.intro", null);
58495 context.on("enter.intro", null);
58499 function continuePlayground() {
58500 if (context.mode().id !== "draw-area") {
58501 return chapter.restart();
58506 helpHtml("intro.areas.continue_playground"),
58509 timeout2(function() {
58510 context.map().on("move.intro drawn.intro", function() {
58513 helpHtml("intro.areas.continue_playground"),
58518 context.on("enter.intro", function(mode) {
58519 if (mode.id === "draw-area") {
58520 var entity = context.hasEntity(context.selectedIDs()[0]);
58521 if (entity && entity.nodes.length >= 6) {
58522 return continueTo(finishPlayground);
58526 } else if (mode.id === "select") {
58527 _areaID = context.selectedIDs()[0];
58528 return continueTo(searchPresets);
58530 return chapter.restart();
58533 function continueTo(nextStep) {
58534 context.map().on("move.intro drawn.intro", null);
58535 context.on("enter.intro", null);
58539 function finishPlayground() {
58540 if (context.mode().id !== "draw-area") {
58541 return chapter.restart();
58544 var finishString = helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.areas.finish_playground");
58550 timeout2(function() {
58551 context.map().on("move.intro drawn.intro", function() {
58559 context.on("enter.intro", function(mode) {
58560 if (mode.id === "draw-area") {
58562 } else if (mode.id === "select") {
58563 _areaID = context.selectedIDs()[0];
58564 return continueTo(searchPresets);
58566 return chapter.restart();
58569 function continueTo(nextStep) {
58570 context.map().on("move.intro drawn.intro", null);
58571 context.on("enter.intro", null);
58575 function searchPresets() {
58576 if (!_areaID || !context.hasEntity(_areaID)) {
58579 var ids = context.selectedIDs();
58580 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58581 context.enter(modeSelect(context, [_areaID]));
58583 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58584 timeout2(function() {
58585 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
58586 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58588 ".preset-search-input",
58589 helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
58592 context.on("enter.intro", function(mode) {
58593 if (!_areaID || !context.hasEntity(_areaID)) {
58594 return continueTo(addArea);
58596 var ids2 = context.selectedIDs();
58597 if (mode.id !== "select" || !ids2.length || ids2[0] !== _areaID) {
58598 context.enter(modeSelect(context, [_areaID]));
58599 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
58600 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58601 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
58603 ".preset-search-input",
58604 helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
58606 context.history().on("change.intro", null);
58609 function checkPresetSearch() {
58610 var first = context.container().select(".preset-list-item:first-child");
58611 if (first.classed("preset-leisure-playground")) {
58613 first.select(".preset-list-button").node(),
58614 helpHtml("intro.areas.choose_playground", { preset: playgroundPreset.name() }),
58617 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
58618 context.history().on("change.intro", function() {
58619 continueTo(clickAddField);
58623 function continueTo(nextStep) {
58624 context.container().select(".inspector-wrap").on("wheel.intro", null);
58625 context.on("enter.intro", null);
58626 context.history().on("change.intro", null);
58627 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58631 function clickAddField() {
58632 if (!_areaID || !context.hasEntity(_areaID)) {
58635 var ids = context.selectedIDs();
58636 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58637 return searchPresets();
58639 if (!context.container().select(".form-field-description").empty()) {
58640 return continueTo(describePlayground);
58642 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
58643 timeout2(function() {
58644 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58645 var entity = context.entity(_areaID);
58646 if (entity.tags.description) {
58647 return continueTo(play);
58649 var box = context.container().select(".more-fields").node().getBoundingClientRect();
58650 if (box.top > 300) {
58651 var pane = context.container().select(".entity-editor-pane .inspector-body");
58652 var start2 = pane.node().scrollTop;
58653 var end = start2 + (box.top - 300);
58654 pane.transition().duration(250).tween("scroll.inspector", function() {
58656 var i3 = number_default(start2, end);
58657 return function(t2) {
58658 node.scrollTop = i3(t2);
58662 timeout2(function() {
58664 ".more-fields .combobox-input",
58665 helpHtml("intro.areas.add_field", {
58666 name: nameField.title(),
58667 description: descriptionField.title()
58671 context.container().select(".more-fields .combobox-input").on("click.intro", function() {
58673 watcher = window.setInterval(function() {
58674 if (!context.container().select("div.combobox").empty()) {
58675 window.clearInterval(watcher);
58676 continueTo(chooseDescriptionField);
58682 context.on("exit.intro", function() {
58683 return continueTo(searchPresets);
58685 function continueTo(nextStep) {
58686 context.container().select(".inspector-wrap").on("wheel.intro", null);
58687 context.container().select(".more-fields .combobox-input").on("click.intro", null);
58688 context.on("exit.intro", null);
58692 function chooseDescriptionField() {
58693 if (!_areaID || !context.hasEntity(_areaID)) {
58696 var ids = context.selectedIDs();
58697 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58698 return searchPresets();
58700 if (!context.container().select(".form-field-description").empty()) {
58701 return continueTo(describePlayground);
58703 if (context.container().select("div.combobox").empty()) {
58704 return continueTo(clickAddField);
58707 watcher = window.setInterval(function() {
58708 if (context.container().select("div.combobox").empty()) {
58709 window.clearInterval(watcher);
58710 timeout2(function() {
58711 if (context.container().select(".form-field-description").empty()) {
58712 continueTo(retryChooseDescription);
58714 continueTo(describePlayground);
58721 helpHtml("intro.areas.choose_field", { field: descriptionField.title() }),
58724 context.on("exit.intro", function() {
58725 return continueTo(searchPresets);
58727 function continueTo(nextStep) {
58729 window.clearInterval(watcher);
58730 context.on("exit.intro", null);
58734 function describePlayground() {
58735 if (!_areaID || !context.hasEntity(_areaID)) {
58738 var ids = context.selectedIDs();
58739 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58740 return searchPresets();
58742 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58743 if (context.container().select(".form-field-description").empty()) {
58744 return continueTo(retryChooseDescription);
58746 context.on("exit.intro", function() {
58750 ".entity-editor-pane",
58751 helpHtml("intro.areas.describe_playground", { button: { html: icon("#iD-icon-close", "inline") } }),
58754 function continueTo(nextStep) {
58755 context.on("exit.intro", null);
58759 function retryChooseDescription() {
58760 if (!_areaID || !context.hasEntity(_areaID)) {
58763 var ids = context.selectedIDs();
58764 if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
58765 return searchPresets();
58767 context.container().select(".inspector-wrap .panewrap").style("right", "0%");
58769 ".entity-editor-pane",
58770 helpHtml("intro.areas.retry_add_field", { field: descriptionField.title() }),
58772 buttonText: _t.html("intro.ok"),
58773 buttonCallback: function() {
58774 continueTo(clickAddField);
58778 context.on("exit.intro", function() {
58779 return continueTo(searchPresets);
58781 function continueTo(nextStep) {
58782 context.on("exit.intro", null);
58787 dispatch14.call("done");
58790 helpHtml("intro.areas.play", { next: _t("intro.lines.title") }),
58792 tooltipBox: ".intro-nav-wrap .chapter-line",
58793 buttonText: _t.html("intro.ok"),
58794 buttonCallback: function() {
58795 reveal(".ideditor");
58800 chapter.enter = function() {
58803 chapter.exit = function() {
58804 timeouts.forEach(window.clearTimeout);
58805 context.on("enter.intro exit.intro", null);
58806 context.map().on("move.intro drawn.intro", null);
58807 context.history().on("change.intro", null);
58808 context.container().select(".inspector-wrap").on("wheel.intro", null);
58809 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
58810 context.container().select(".more-fields .combobox-input").on("click.intro", null);
58812 chapter.restart = function() {
58816 return utilRebind(chapter, dispatch14, "on");
58819 // modules/ui/intro/line.js
58820 function uiIntroLine(context, reveal) {
58821 var dispatch14 = dispatch_default("done");
58823 var _tulipRoadID = null;
58824 var flowerRoadID = "w646";
58825 var tulipRoadStart = [-85.6297754121684, 41.95805253325314];
58826 var tulipRoadMidpoint = [-85.62975395449628, 41.95787501510204];
58827 var tulipRoadIntersection = [-85.62974496187628, 41.95742515554585];
58828 var roadCategory = _mainPresetIndex.item("category-road_minor");
58829 var residentialPreset = _mainPresetIndex.item("highway/residential");
58830 var woodRoadID = "w525";
58831 var woodRoadEndID = "n2862";
58832 var woodRoadAddNode = [-85.62390110349587, 41.95397111462291];
58833 var woodRoadDragEndpoint = [-85.623867390213, 41.95466987786487];
58834 var woodRoadDragMidpoint = [-85.62386254803509, 41.95430395953872];
58835 var washingtonStreetID = "w522";
58836 var twelfthAvenueID = "w1";
58837 var eleventhAvenueEndID = "n3550";
58838 var twelfthAvenueEndID = "n5";
58839 var _washingtonSegmentID = null;
58840 var eleventhAvenueEnd = context.entity(eleventhAvenueEndID).loc;
58841 var twelfthAvenueEnd = context.entity(twelfthAvenueEndID).loc;
58842 var deleteLinesLoc = [-85.6219395542764, 41.95228033922477];
58843 var twelfthAvenue = [-85.62219310052491, 41.952505413152956];
58845 title: "intro.lines.title"
58847 function timeout2(f3, t2) {
58848 timeouts.push(window.setTimeout(f3, t2));
58850 function eventCancel(d3_event) {
58851 d3_event.stopPropagation();
58852 d3_event.preventDefault();
58854 function addLine() {
58855 context.enter(modeBrowse(context));
58856 context.history().reset("initial");
58857 var msec = transitionTime(tulipRoadStart, context.map().center());
58859 reveal(null, null, { duration: 0 });
58861 context.map().centerZoomEase(tulipRoadStart, 18.5, msec);
58862 timeout2(function() {
58863 var tooltip = reveal(
58865 helpHtml("intro.lines.add_line")
58867 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-lines");
58868 context.on("enter.intro", function(mode) {
58869 if (mode.id !== "add-line")
58871 continueTo(startLine);
58874 function continueTo(nextStep) {
58875 context.on("enter.intro", null);
58879 function startLine() {
58880 if (context.mode().id !== "add-line")
58881 return chapter.restart();
58882 _tulipRoadID = null;
58883 var padding = 70 * Math.pow(2, context.map().zoom() - 18);
58884 var box = pad(tulipRoadStart, padding, context);
58885 box.height = box.height + 100;
58886 var textId = context.lastPointerType() === "mouse" ? "start_line" : "start_line_tap";
58887 var startLineString = helpHtml("intro.lines.missing_road") + "{br}" + helpHtml("intro.lines.line_draw_info") + helpHtml("intro.lines." + textId);
58888 reveal(box, startLineString);
58889 context.map().on("move.intro drawn.intro", function() {
58890 padding = 70 * Math.pow(2, context.map().zoom() - 18);
58891 box = pad(tulipRoadStart, padding, context);
58892 box.height = box.height + 100;
58893 reveal(box, startLineString, { duration: 0 });
58895 context.on("enter.intro", function(mode) {
58896 if (mode.id !== "draw-line")
58897 return chapter.restart();
58898 continueTo(drawLine);
58900 function continueTo(nextStep) {
58901 context.map().on("move.intro drawn.intro", null);
58902 context.on("enter.intro", null);
58906 function drawLine() {
58907 if (context.mode().id !== "draw-line")
58908 return chapter.restart();
58909 _tulipRoadID = context.mode().selectedIDs()[0];
58910 context.map().centerEase(tulipRoadMidpoint, 500);
58911 timeout2(function() {
58912 var padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
58913 var box = pad(tulipRoadMidpoint, padding, context);
58914 box.height = box.height * 2;
58917 helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") })
58919 context.map().on("move.intro drawn.intro", function() {
58920 padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
58921 box = pad(tulipRoadMidpoint, padding, context);
58922 box.height = box.height * 2;
58925 helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") }),
58930 context.history().on("change.intro", function() {
58931 if (isLineConnected()) {
58932 continueTo(continueLine);
58935 context.on("enter.intro", function(mode) {
58936 if (mode.id === "draw-line") {
58938 } else if (mode.id === "select") {
58939 continueTo(retryIntersect);
58942 return chapter.restart();
58945 function continueTo(nextStep) {
58946 context.map().on("move.intro drawn.intro", null);
58947 context.history().on("change.intro", null);
58948 context.on("enter.intro", null);
58952 function isLineConnected() {
58953 var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
58956 var drawNodes = context.graph().childNodes(entity);
58957 return drawNodes.some(function(node) {
58958 return context.graph().parentWays(node).some(function(parent) {
58959 return parent.id === flowerRoadID;
58963 function retryIntersect() {
58964 select_default2(window).on("pointerdown.intro mousedown.intro", eventCancel, true);
58965 var box = pad(tulipRoadIntersection, 80, context);
58968 helpHtml("intro.lines.retry_intersect", { name: _t("intro.graph.name.flower-street") })
58970 timeout2(chapter.restart, 3e3);
58972 function continueLine() {
58973 if (context.mode().id !== "draw-line")
58974 return chapter.restart();
58975 var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
58977 return chapter.restart();
58978 context.map().centerEase(tulipRoadIntersection, 500);
58979 var continueLineText = helpHtml("intro.lines.continue_line") + "{br}" + helpHtml("intro.lines.finish_line_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.lines.finish_road");
58980 reveal(".surface", continueLineText);
58981 context.on("enter.intro", function(mode) {
58982 if (mode.id === "draw-line") {
58984 } else if (mode.id === "select") {
58985 return continueTo(chooseCategoryRoad);
58987 return chapter.restart();
58990 function continueTo(nextStep) {
58991 context.on("enter.intro", null);
58995 function chooseCategoryRoad() {
58996 if (context.mode().id !== "select")
58997 return chapter.restart();
58998 context.on("exit.intro", function() {
58999 return chapter.restart();
59001 var button = context.container().select(".preset-category-road_minor .preset-list-button");
59002 if (button.empty())
59003 return chapter.restart();
59004 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59005 timeout2(function() {
59006 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
59009 helpHtml("intro.lines.choose_category_road", { category: roadCategory.name() })
59011 button.on("click.intro", function() {
59012 continueTo(choosePresetResidential);
59015 function continueTo(nextStep) {
59016 context.container().select(".inspector-wrap").on("wheel.intro", null);
59017 context.container().select(".preset-list-button").on("click.intro", null);
59018 context.on("exit.intro", null);
59022 function choosePresetResidential() {
59023 if (context.mode().id !== "select")
59024 return chapter.restart();
59025 context.on("exit.intro", function() {
59026 return chapter.restart();
59028 var subgrid = context.container().select(".preset-category-road_minor .subgrid");
59029 if (subgrid.empty())
59030 return chapter.restart();
59031 subgrid.selectAll(":not(.preset-highway-residential) .preset-list-button").on("click.intro", function() {
59032 continueTo(retryPresetResidential);
59034 subgrid.selectAll(".preset-highway-residential .preset-list-button").on("click.intro", function() {
59035 continueTo(nameRoad);
59037 timeout2(function() {
59040 helpHtml("intro.lines.choose_preset_residential", { preset: residentialPreset.name() }),
59041 { tooltipBox: ".preset-highway-residential .preset-list-button", duration: 300 }
59044 function continueTo(nextStep) {
59045 context.container().select(".preset-list-button").on("click.intro", null);
59046 context.on("exit.intro", null);
59050 function retryPresetResidential() {
59051 if (context.mode().id !== "select")
59052 return chapter.restart();
59053 context.on("exit.intro", function() {
59054 return chapter.restart();
59056 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59057 timeout2(function() {
59058 var button = context.container().select(".entity-editor-pane .preset-list-button");
59061 helpHtml("intro.lines.retry_preset_residential", { preset: residentialPreset.name() })
59063 button.on("click.intro", function() {
59064 continueTo(chooseCategoryRoad);
59067 function continueTo(nextStep) {
59068 context.container().select(".inspector-wrap").on("wheel.intro", null);
59069 context.container().select(".preset-list-button").on("click.intro", null);
59070 context.on("exit.intro", null);
59074 function nameRoad() {
59075 context.on("exit.intro", function() {
59076 continueTo(didNameRoad);
59078 timeout2(function() {
59080 ".entity-editor-pane",
59081 helpHtml("intro.lines.name_road", { button: { html: icon("#iD-icon-close", "inline") } }),
59082 { tooltipClass: "intro-lines-name_road" }
59085 function continueTo(nextStep) {
59086 context.on("exit.intro", null);
59090 function didNameRoad() {
59091 context.history().checkpoint("doneAddLine");
59092 timeout2(function() {
59093 reveal(".surface", helpHtml("intro.lines.did_name_road"), {
59094 buttonText: _t.html("intro.ok"),
59095 buttonCallback: function() {
59096 continueTo(updateLine);
59100 function continueTo(nextStep) {
59104 function updateLine() {
59105 context.history().reset("doneAddLine");
59106 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59107 return chapter.restart();
59109 var msec = transitionTime(woodRoadDragMidpoint, context.map().center());
59111 reveal(null, null, { duration: 0 });
59113 context.map().centerZoomEase(woodRoadDragMidpoint, 19, msec);
59114 timeout2(function() {
59115 var padding = 250 * Math.pow(2, context.map().zoom() - 19);
59116 var box = pad(woodRoadDragMidpoint, padding, context);
59117 var advance = function() {
59118 continueTo(addNode);
59122 helpHtml("intro.lines.update_line"),
59123 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59125 context.map().on("move.intro drawn.intro", function() {
59126 var padding2 = 250 * Math.pow(2, context.map().zoom() - 19);
59127 var box2 = pad(woodRoadDragMidpoint, padding2, context);
59130 helpHtml("intro.lines.update_line"),
59131 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59135 function continueTo(nextStep) {
59136 context.map().on("move.intro drawn.intro", null);
59140 function addNode() {
59141 context.history().reset("doneAddLine");
59142 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59143 return chapter.restart();
59145 var padding = 40 * Math.pow(2, context.map().zoom() - 19);
59146 var box = pad(woodRoadAddNode, padding, context);
59147 var addNodeString = helpHtml("intro.lines.add_node" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
59148 reveal(box, addNodeString);
59149 context.map().on("move.intro drawn.intro", function() {
59150 var padding2 = 40 * Math.pow(2, context.map().zoom() - 19);
59151 var box2 = pad(woodRoadAddNode, padding2, context);
59152 reveal(box2, addNodeString, { duration: 0 });
59154 context.history().on("change.intro", function(changed) {
59155 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59156 return continueTo(updateLine);
59158 if (changed.created().length === 1) {
59159 timeout2(function() {
59160 continueTo(startDragEndpoint);
59164 context.on("enter.intro", function(mode) {
59165 if (mode.id !== "select") {
59166 continueTo(updateLine);
59169 function continueTo(nextStep) {
59170 context.map().on("move.intro drawn.intro", null);
59171 context.history().on("change.intro", null);
59172 context.on("enter.intro", null);
59176 function startDragEndpoint() {
59177 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59178 return continueTo(updateLine);
59180 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
59181 var box = pad(woodRoadDragEndpoint, padding, context);
59182 var startDragString = helpHtml("intro.lines.start_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch")) + helpHtml("intro.lines.drag_to_intersection");
59183 reveal(box, startDragString);
59184 context.map().on("move.intro drawn.intro", function() {
59185 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59186 return continueTo(updateLine);
59188 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
59189 var box2 = pad(woodRoadDragEndpoint, padding2, context);
59190 reveal(box2, startDragString, { duration: 0 });
59191 var entity = context.entity(woodRoadEndID);
59192 if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) <= 4) {
59193 continueTo(finishDragEndpoint);
59196 function continueTo(nextStep) {
59197 context.map().on("move.intro drawn.intro", null);
59201 function finishDragEndpoint() {
59202 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59203 return continueTo(updateLine);
59205 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
59206 var box = pad(woodRoadDragEndpoint, padding, context);
59207 var finishDragString = helpHtml("intro.lines.spot_looks_good") + helpHtml("intro.lines.finish_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
59208 reveal(box, finishDragString);
59209 context.map().on("move.intro drawn.intro", function() {
59210 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59211 return continueTo(updateLine);
59213 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
59214 var box2 = pad(woodRoadDragEndpoint, padding2, context);
59215 reveal(box2, finishDragString, { duration: 0 });
59216 var entity = context.entity(woodRoadEndID);
59217 if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) > 4) {
59218 continueTo(startDragEndpoint);
59221 context.on("enter.intro", function() {
59222 continueTo(startDragMidpoint);
59224 function continueTo(nextStep) {
59225 context.map().on("move.intro drawn.intro", null);
59226 context.on("enter.intro", null);
59230 function startDragMidpoint() {
59231 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59232 return continueTo(updateLine);
59234 if (context.selectedIDs().indexOf(woodRoadID) === -1) {
59235 context.enter(modeSelect(context, [woodRoadID]));
59237 var padding = 80 * Math.pow(2, context.map().zoom() - 19);
59238 var box = pad(woodRoadDragMidpoint, padding, context);
59239 reveal(box, helpHtml("intro.lines.start_drag_midpoint"));
59240 context.map().on("move.intro drawn.intro", function() {
59241 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59242 return continueTo(updateLine);
59244 var padding2 = 80 * Math.pow(2, context.map().zoom() - 19);
59245 var box2 = pad(woodRoadDragMidpoint, padding2, context);
59246 reveal(box2, helpHtml("intro.lines.start_drag_midpoint"), { duration: 0 });
59248 context.history().on("change.intro", function(changed) {
59249 if (changed.created().length === 1) {
59250 continueTo(continueDragMidpoint);
59253 context.on("enter.intro", function(mode) {
59254 if (mode.id !== "select") {
59255 context.enter(modeSelect(context, [woodRoadID]));
59258 function continueTo(nextStep) {
59259 context.map().on("move.intro drawn.intro", null);
59260 context.history().on("change.intro", null);
59261 context.on("enter.intro", null);
59265 function continueDragMidpoint() {
59266 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59267 return continueTo(updateLine);
59269 var padding = 100 * Math.pow(2, context.map().zoom() - 19);
59270 var box = pad(woodRoadDragEndpoint, padding, context);
59272 var advance = function() {
59273 context.history().checkpoint("doneUpdateLine");
59274 continueTo(deleteLines);
59278 helpHtml("intro.lines.continue_drag_midpoint"),
59279 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59281 context.map().on("move.intro drawn.intro", function() {
59282 if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
59283 return continueTo(updateLine);
59285 var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
59286 var box2 = pad(woodRoadDragEndpoint, padding2, context);
59287 box2.height += 400;
59290 helpHtml("intro.lines.continue_drag_midpoint"),
59291 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59294 function continueTo(nextStep) {
59295 context.map().on("move.intro drawn.intro", null);
59299 function deleteLines() {
59300 context.history().reset("doneUpdateLine");
59301 context.enter(modeBrowse(context));
59302 if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59303 return chapter.restart();
59305 var msec = transitionTime(deleteLinesLoc, context.map().center());
59307 reveal(null, null, { duration: 0 });
59309 context.map().centerZoomEase(deleteLinesLoc, 18, msec);
59310 timeout2(function() {
59311 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59312 var box = pad(deleteLinesLoc, padding, context);
59315 var advance = function() {
59316 continueTo(rightClickIntersection);
59320 helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
59321 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59323 context.map().on("move.intro drawn.intro", function() {
59324 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
59325 var box2 = pad(deleteLinesLoc, padding2, context);
59327 box2.height += 400;
59330 helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
59331 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59334 context.history().on("change.intro", function() {
59335 timeout2(function() {
59336 continueTo(deleteLines);
59340 function continueTo(nextStep) {
59341 context.map().on("move.intro drawn.intro", null);
59342 context.history().on("change.intro", null);
59346 function rightClickIntersection() {
59347 context.history().reset("doneUpdateLine");
59348 context.enter(modeBrowse(context));
59349 context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
59350 var rightClickString = helpHtml("intro.lines.split_street", {
59351 street1: _t("intro.graph.name.11th-avenue"),
59352 street2: _t("intro.graph.name.washington-street")
59353 }) + helpHtml("intro.lines." + (context.lastPointerType() === "mouse" ? "rightclick_intersection" : "edit_menu_intersection_touch"));
59354 timeout2(function() {
59355 var padding = 60 * Math.pow(2, context.map().zoom() - 18);
59356 var box = pad(eleventhAvenueEnd, padding, context);
59357 reveal(box, rightClickString);
59358 context.map().on("move.intro drawn.intro", function() {
59359 var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
59360 var box2 = pad(eleventhAvenueEnd, padding2, context);
59367 context.on("enter.intro", function(mode) {
59368 if (mode.id !== "select")
59370 var ids = context.selectedIDs();
59371 if (ids.length !== 1 || ids[0] !== eleventhAvenueEndID)
59373 timeout2(function() {
59374 var node = selectMenuItem(context, "split").node();
59377 continueTo(splitIntersection);
59380 context.history().on("change.intro", function() {
59381 timeout2(function() {
59382 continueTo(deleteLines);
59386 function continueTo(nextStep) {
59387 context.map().on("move.intro drawn.intro", null);
59388 context.on("enter.intro", null);
59389 context.history().on("change.intro", null);
59393 function splitIntersection() {
59394 if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59395 return continueTo(deleteLines);
59397 var node = selectMenuItem(context, "split").node();
59399 return continueTo(rightClickIntersection);
59401 var wasChanged = false;
59402 _washingtonSegmentID = null;
59406 "intro.lines.split_intersection",
59407 { street: _t("intro.graph.name.washington-street") }
59411 context.map().on("move.intro drawn.intro", function() {
59412 var node2 = selectMenuItem(context, "split").node();
59413 if (!wasChanged && !node2) {
59414 return continueTo(rightClickIntersection);
59419 "intro.lines.split_intersection",
59420 { street: _t("intro.graph.name.washington-street") }
59422 { duration: 0, padding: 50 }
59425 context.history().on("change.intro", function(changed) {
59427 timeout2(function() {
59428 if (context.history().undoAnnotation() === _t("operations.split.annotation.line", { n: 1 })) {
59429 _washingtonSegmentID = changed.created()[0].id;
59430 continueTo(didSplit);
59432 _washingtonSegmentID = null;
59433 continueTo(retrySplit);
59437 function continueTo(nextStep) {
59438 context.map().on("move.intro drawn.intro", null);
59439 context.history().on("change.intro", null);
59443 function retrySplit() {
59444 context.enter(modeBrowse(context));
59445 context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
59446 var advance = function() {
59447 continueTo(rightClickIntersection);
59449 var padding = 60 * Math.pow(2, context.map().zoom() - 18);
59450 var box = pad(eleventhAvenueEnd, padding, context);
59453 helpHtml("intro.lines.retry_split"),
59454 { buttonText: _t.html("intro.ok"), buttonCallback: advance }
59456 context.map().on("move.intro drawn.intro", function() {
59457 var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
59458 var box2 = pad(eleventhAvenueEnd, padding2, context);
59461 helpHtml("intro.lines.retry_split"),
59462 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
59465 function continueTo(nextStep) {
59466 context.map().on("move.intro drawn.intro", null);
59470 function didSplit() {
59471 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59472 return continueTo(rightClickIntersection);
59474 var ids = context.selectedIDs();
59475 var string = "intro.lines.did_split_" + (ids.length > 1 ? "multi" : "single");
59476 var street = _t("intro.graph.name.washington-street");
59477 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59478 var box = pad(twelfthAvenue, padding, context);
59479 box.width = box.width / 2;
59482 helpHtml(string, { street1: street, street2: street }),
59485 timeout2(function() {
59486 context.map().centerZoomEase(twelfthAvenue, 18, 500);
59487 context.map().on("move.intro drawn.intro", function() {
59488 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
59489 var box2 = pad(twelfthAvenue, padding2, context);
59490 box2.width = box2.width / 2;
59493 helpHtml(string, { street1: street, street2: street }),
59498 context.on("enter.intro", function() {
59499 var ids2 = context.selectedIDs();
59500 if (ids2.length === 1 && ids2[0] === _washingtonSegmentID) {
59501 continueTo(multiSelect);
59504 context.history().on("change.intro", function() {
59505 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59506 return continueTo(rightClickIntersection);
59509 function continueTo(nextStep) {
59510 context.map().on("move.intro drawn.intro", null);
59511 context.on("enter.intro", null);
59512 context.history().on("change.intro", null);
59516 function multiSelect() {
59517 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59518 return continueTo(rightClickIntersection);
59520 var ids = context.selectedIDs();
59521 var hasWashington = ids.indexOf(_washingtonSegmentID) !== -1;
59522 var hasTwelfth = ids.indexOf(twelfthAvenueID) !== -1;
59523 if (hasWashington && hasTwelfth) {
59524 return continueTo(multiRightClick);
59525 } else if (!hasWashington && !hasTwelfth) {
59526 return continueTo(didSplit);
59528 context.map().centerZoomEase(twelfthAvenue, 18, 500);
59529 timeout2(function() {
59530 var selected, other, padding, box;
59531 if (hasWashington) {
59532 selected = _t("intro.graph.name.washington-street");
59533 other = _t("intro.graph.name.12th-avenue");
59534 padding = 60 * Math.pow(2, context.map().zoom() - 18);
59535 box = pad(twelfthAvenueEnd, padding, context);
59538 selected = _t("intro.graph.name.12th-avenue");
59539 other = _t("intro.graph.name.washington-street");
59540 padding = 200 * Math.pow(2, context.map().zoom() - 18);
59541 box = pad(twelfthAvenue, padding, context);
59547 "intro.lines.multi_select",
59548 { selected, other1: other }
59549 ) + " " + helpHtml(
59550 "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
59551 { selected, other2: other }
59554 context.map().on("move.intro drawn.intro", function() {
59555 if (hasWashington) {
59556 selected = _t("intro.graph.name.washington-street");
59557 other = _t("intro.graph.name.12th-avenue");
59558 padding = 60 * Math.pow(2, context.map().zoom() - 18);
59559 box = pad(twelfthAvenueEnd, padding, context);
59562 selected = _t("intro.graph.name.12th-avenue");
59563 other = _t("intro.graph.name.washington-street");
59564 padding = 200 * Math.pow(2, context.map().zoom() - 18);
59565 box = pad(twelfthAvenue, padding, context);
59571 "intro.lines.multi_select",
59572 { selected, other1: other }
59573 ) + " " + helpHtml(
59574 "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
59575 { selected, other2: other }
59580 context.on("enter.intro", function() {
59581 continueTo(multiSelect);
59583 context.history().on("change.intro", function() {
59584 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59585 return continueTo(rightClickIntersection);
59589 function continueTo(nextStep) {
59590 context.map().on("move.intro drawn.intro", null);
59591 context.on("enter.intro", null);
59592 context.history().on("change.intro", null);
59596 function multiRightClick() {
59597 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59598 return continueTo(rightClickIntersection);
59600 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59601 var box = pad(twelfthAvenue, padding, context);
59602 var rightClickString = helpHtml("intro.lines.multi_select_success") + helpHtml("intro.lines.multi_" + (context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch"));
59603 reveal(box, rightClickString);
59604 context.map().on("move.intro drawn.intro", function() {
59605 var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
59606 var box2 = pad(twelfthAvenue, padding2, context);
59607 reveal(box2, rightClickString, { duration: 0 });
59609 context.ui().editMenu().on("toggled.intro", function(open) {
59612 timeout2(function() {
59613 var ids = context.selectedIDs();
59614 if (ids.length === 2 && ids.indexOf(twelfthAvenueID) !== -1 && ids.indexOf(_washingtonSegmentID) !== -1) {
59615 var node = selectMenuItem(context, "delete").node();
59618 continueTo(multiDelete);
59619 } else if (ids.length === 1 && ids.indexOf(_washingtonSegmentID) !== -1) {
59620 return continueTo(multiSelect);
59622 return continueTo(didSplit);
59626 context.history().on("change.intro", function() {
59627 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59628 return continueTo(rightClickIntersection);
59631 function continueTo(nextStep) {
59632 context.map().on("move.intro drawn.intro", null);
59633 context.ui().editMenu().on("toggled.intro", null);
59634 context.history().on("change.intro", null);
59638 function multiDelete() {
59639 if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
59640 return continueTo(rightClickIntersection);
59642 var node = selectMenuItem(context, "delete").node();
59644 return continueTo(multiRightClick);
59647 helpHtml("intro.lines.multi_delete"),
59650 context.map().on("move.intro drawn.intro", function() {
59653 helpHtml("intro.lines.multi_delete"),
59654 { duration: 0, padding: 50 }
59657 context.on("exit.intro", function() {
59658 if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
59659 return continueTo(multiSelect);
59662 context.history().on("change.intro", function() {
59663 if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
59664 continueTo(retryDelete);
59669 function continueTo(nextStep) {
59670 context.map().on("move.intro drawn.intro", null);
59671 context.on("exit.intro", null);
59672 context.history().on("change.intro", null);
59676 function retryDelete() {
59677 context.enter(modeBrowse(context));
59678 var padding = 200 * Math.pow(2, context.map().zoom() - 18);
59679 var box = pad(twelfthAvenue, padding, context);
59680 reveal(box, helpHtml("intro.lines.retry_delete"), {
59681 buttonText: _t.html("intro.ok"),
59682 buttonCallback: function() {
59683 continueTo(multiSelect);
59686 function continueTo(nextStep) {
59691 dispatch14.call("done");
59694 helpHtml("intro.lines.play", { next: _t("intro.buildings.title") }),
59696 tooltipBox: ".intro-nav-wrap .chapter-building",
59697 buttonText: _t.html("intro.ok"),
59698 buttonCallback: function() {
59699 reveal(".ideditor");
59704 chapter.enter = function() {
59707 chapter.exit = function() {
59708 timeouts.forEach(window.clearTimeout);
59709 select_default2(window).on("pointerdown.intro mousedown.intro", null, true);
59710 context.on("enter.intro exit.intro", null);
59711 context.map().on("move.intro drawn.intro", null);
59712 context.history().on("change.intro", null);
59713 context.container().select(".inspector-wrap").on("wheel.intro", null);
59714 context.container().select(".preset-list-button").on("click.intro", null);
59716 chapter.restart = function() {
59720 return utilRebind(chapter, dispatch14, "on");
59723 // modules/ui/intro/building.js
59724 function uiIntroBuilding(context, reveal) {
59725 var dispatch14 = dispatch_default("done");
59726 var house = [-85.62815, 41.95638];
59727 var tank = [-85.62732, 41.95347];
59728 var buildingCatetory = _mainPresetIndex.item("category-building");
59729 var housePreset = _mainPresetIndex.item("building/house");
59730 var tankPreset = _mainPresetIndex.item("man_made/storage_tank");
59732 var _houseID = null;
59733 var _tankID = null;
59735 title: "intro.buildings.title"
59737 function timeout2(f3, t2) {
59738 timeouts.push(window.setTimeout(f3, t2));
59740 function eventCancel(d3_event) {
59741 d3_event.stopPropagation();
59742 d3_event.preventDefault();
59744 function revealHouse(center, text2, options2) {
59745 var padding = 160 * Math.pow(2, context.map().zoom() - 20);
59746 var box = pad(center, padding, context);
59747 reveal(box, text2, options2);
59749 function revealTank(center, text2, options2) {
59750 var padding = 190 * Math.pow(2, context.map().zoom() - 19.5);
59751 var box = pad(center, padding, context);
59752 reveal(box, text2, options2);
59754 function addHouse() {
59755 context.enter(modeBrowse(context));
59756 context.history().reset("initial");
59758 var msec = transitionTime(house, context.map().center());
59760 reveal(null, null, { duration: 0 });
59762 context.map().centerZoomEase(house, 19, msec);
59763 timeout2(function() {
59764 var tooltip = reveal(
59766 helpHtml("intro.buildings.add_building")
59768 tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-buildings");
59769 context.on("enter.intro", function(mode) {
59770 if (mode.id !== "add-area")
59772 continueTo(startHouse);
59775 function continueTo(nextStep) {
59776 context.on("enter.intro", null);
59780 function startHouse() {
59781 if (context.mode().id !== "add-area") {
59782 return continueTo(addHouse);
59785 context.map().zoomEase(20, 500);
59786 timeout2(function() {
59787 var startString = helpHtml("intro.buildings.start_building") + helpHtml("intro.buildings.building_corner_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
59788 revealHouse(house, startString);
59789 context.map().on("move.intro drawn.intro", function() {
59790 revealHouse(house, startString, { duration: 0 });
59792 context.on("enter.intro", function(mode) {
59793 if (mode.id !== "draw-area")
59794 return chapter.restart();
59795 continueTo(continueHouse);
59798 function continueTo(nextStep) {
59799 context.map().on("move.intro drawn.intro", null);
59800 context.on("enter.intro", null);
59804 function continueHouse() {
59805 if (context.mode().id !== "draw-area") {
59806 return continueTo(addHouse);
59809 var continueString = helpHtml("intro.buildings.continue_building") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_building");
59810 revealHouse(house, continueString);
59811 context.map().on("move.intro drawn.intro", function() {
59812 revealHouse(house, continueString, { duration: 0 });
59814 context.on("enter.intro", function(mode) {
59815 if (mode.id === "draw-area") {
59817 } else if (mode.id === "select") {
59818 var graph = context.graph();
59819 var way = context.entity(context.selectedIDs()[0]);
59820 var nodes = graph.childNodes(way);
59821 var points = utilArrayUniq(nodes).map(function(n3) {
59822 return context.projection(n3.loc);
59824 if (isMostlySquare(points)) {
59826 return continueTo(chooseCategoryBuilding);
59828 return continueTo(retryHouse);
59831 return chapter.restart();
59834 function continueTo(nextStep) {
59835 context.map().on("move.intro drawn.intro", null);
59836 context.on("enter.intro", null);
59840 function retryHouse() {
59841 var onClick = function() {
59842 continueTo(addHouse);
59846 helpHtml("intro.buildings.retry_building"),
59847 { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
59849 context.map().on("move.intro drawn.intro", function() {
59852 helpHtml("intro.buildings.retry_building"),
59853 { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
59856 function continueTo(nextStep) {
59857 context.map().on("move.intro drawn.intro", null);
59861 function chooseCategoryBuilding() {
59862 if (!_houseID || !context.hasEntity(_houseID)) {
59865 var ids = context.selectedIDs();
59866 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
59867 context.enter(modeSelect(context, [_houseID]));
59869 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59870 timeout2(function() {
59871 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
59872 var button = context.container().select(".preset-category-building .preset-list-button");
59875 helpHtml("intro.buildings.choose_category_building", { category: buildingCatetory.name() })
59877 button.on("click.intro", function() {
59878 button.on("click.intro", null);
59879 continueTo(choosePresetHouse);
59882 context.on("enter.intro", function(mode) {
59883 if (!_houseID || !context.hasEntity(_houseID)) {
59884 return continueTo(addHouse);
59886 var ids2 = context.selectedIDs();
59887 if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
59888 return continueTo(chooseCategoryBuilding);
59891 function continueTo(nextStep) {
59892 context.container().select(".inspector-wrap").on("wheel.intro", null);
59893 context.container().select(".preset-list-button").on("click.intro", null);
59894 context.on("enter.intro", null);
59898 function choosePresetHouse() {
59899 if (!_houseID || !context.hasEntity(_houseID)) {
59902 var ids = context.selectedIDs();
59903 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
59904 context.enter(modeSelect(context, [_houseID]));
59906 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
59907 timeout2(function() {
59908 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
59909 var button = context.container().select(".preset-building-house .preset-list-button");
59912 helpHtml("intro.buildings.choose_preset_house", { preset: housePreset.name() }),
59915 button.on("click.intro", function() {
59916 button.on("click.intro", null);
59917 continueTo(closeEditorHouse);
59920 context.on("enter.intro", function(mode) {
59921 if (!_houseID || !context.hasEntity(_houseID)) {
59922 return continueTo(addHouse);
59924 var ids2 = context.selectedIDs();
59925 if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
59926 return continueTo(chooseCategoryBuilding);
59929 function continueTo(nextStep) {
59930 context.container().select(".inspector-wrap").on("wheel.intro", null);
59931 context.container().select(".preset-list-button").on("click.intro", null);
59932 context.on("enter.intro", null);
59936 function closeEditorHouse() {
59937 if (!_houseID || !context.hasEntity(_houseID)) {
59940 var ids = context.selectedIDs();
59941 if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
59942 context.enter(modeSelect(context, [_houseID]));
59944 context.history().checkpoint("hasHouse");
59945 context.on("exit.intro", function() {
59946 continueTo(rightClickHouse);
59948 timeout2(function() {
59950 ".entity-editor-pane",
59951 helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
59954 function continueTo(nextStep) {
59955 context.on("exit.intro", null);
59959 function rightClickHouse() {
59961 return chapter.restart();
59962 context.enter(modeBrowse(context));
59963 context.history().reset("hasHouse");
59964 var zoom = context.map().zoom();
59968 context.map().centerZoomEase(house, zoom, 500);
59969 context.on("enter.intro", function(mode) {
59970 if (mode.id !== "select")
59972 var ids = context.selectedIDs();
59973 if (ids.length !== 1 || ids[0] !== _houseID)
59975 timeout2(function() {
59976 var node = selectMenuItem(context, "orthogonalize").node();
59979 continueTo(clickSquare);
59982 context.map().on("move.intro drawn.intro", function() {
59983 var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_building" : "edit_menu_building_touch"));
59984 revealHouse(house, rightclickString, { duration: 0 });
59986 context.history().on("change.intro", function() {
59987 continueTo(rightClickHouse);
59989 function continueTo(nextStep) {
59990 context.on("enter.intro", null);
59991 context.map().on("move.intro drawn.intro", null);
59992 context.history().on("change.intro", null);
59996 function clickSquare() {
59998 return chapter.restart();
59999 var entity = context.hasEntity(_houseID);
60001 return continueTo(rightClickHouse);
60002 var node = selectMenuItem(context, "orthogonalize").node();
60004 return continueTo(rightClickHouse);
60006 var wasChanged = false;
60009 helpHtml("intro.buildings.square_building"),
60012 context.on("enter.intro", function(mode) {
60013 if (mode.id === "browse") {
60014 continueTo(rightClickHouse);
60015 } else if (mode.id === "move" || mode.id === "rotate") {
60016 continueTo(retryClickSquare);
60019 context.map().on("move.intro", function() {
60020 var node2 = selectMenuItem(context, "orthogonalize").node();
60021 if (!wasChanged && !node2) {
60022 return continueTo(rightClickHouse);
60026 helpHtml("intro.buildings.square_building"),
60027 { duration: 0, padding: 50 }
60030 context.history().on("change.intro", function() {
60032 context.history().on("change.intro", null);
60033 timeout2(function() {
60034 if (context.history().undoAnnotation() === _t("operations.orthogonalize.annotation.feature", { n: 1 })) {
60035 continueTo(doneSquare);
60037 continueTo(retryClickSquare);
60041 function continueTo(nextStep) {
60042 context.on("enter.intro", null);
60043 context.map().on("move.intro", null);
60044 context.history().on("change.intro", null);
60048 function retryClickSquare() {
60049 context.enter(modeBrowse(context));
60050 revealHouse(house, helpHtml("intro.buildings.retry_square"), {
60051 buttonText: _t.html("intro.ok"),
60052 buttonCallback: function() {
60053 continueTo(rightClickHouse);
60056 function continueTo(nextStep) {
60060 function doneSquare() {
60061 context.history().checkpoint("doneSquare");
60062 revealHouse(house, helpHtml("intro.buildings.done_square"), {
60063 buttonText: _t.html("intro.ok"),
60064 buttonCallback: function() {
60065 continueTo(addTank);
60068 function continueTo(nextStep) {
60072 function addTank() {
60073 context.enter(modeBrowse(context));
60074 context.history().reset("doneSquare");
60076 var msec = transitionTime(tank, context.map().center());
60078 reveal(null, null, { duration: 0 });
60080 context.map().centerZoomEase(tank, 19.5, msec);
60081 timeout2(function() {
60084 helpHtml("intro.buildings.add_tank")
60086 context.on("enter.intro", function(mode) {
60087 if (mode.id !== "add-area")
60089 continueTo(startTank);
60092 function continueTo(nextStep) {
60093 context.on("enter.intro", null);
60097 function startTank() {
60098 if (context.mode().id !== "add-area") {
60099 return continueTo(addTank);
60102 timeout2(function() {
60103 var startString = helpHtml("intro.buildings.start_tank") + helpHtml("intro.buildings.tank_edge_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
60104 revealTank(tank, startString);
60105 context.map().on("move.intro drawn.intro", function() {
60106 revealTank(tank, startString, { duration: 0 });
60108 context.on("enter.intro", function(mode) {
60109 if (mode.id !== "draw-area")
60110 return chapter.restart();
60111 continueTo(continueTank);
60114 function continueTo(nextStep) {
60115 context.map().on("move.intro drawn.intro", null);
60116 context.on("enter.intro", null);
60120 function continueTank() {
60121 if (context.mode().id !== "draw-area") {
60122 return continueTo(addTank);
60125 var continueString = helpHtml("intro.buildings.continue_tank") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_tank");
60126 revealTank(tank, continueString);
60127 context.map().on("move.intro drawn.intro", function() {
60128 revealTank(tank, continueString, { duration: 0 });
60130 context.on("enter.intro", function(mode) {
60131 if (mode.id === "draw-area") {
60133 } else if (mode.id === "select") {
60134 _tankID = context.selectedIDs()[0];
60135 return continueTo(searchPresetTank);
60137 return continueTo(addTank);
60140 function continueTo(nextStep) {
60141 context.map().on("move.intro drawn.intro", null);
60142 context.on("enter.intro", null);
60146 function searchPresetTank() {
60147 if (!_tankID || !context.hasEntity(_tankID)) {
60150 var ids = context.selectedIDs();
60151 if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
60152 context.enter(modeSelect(context, [_tankID]));
60154 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
60155 timeout2(function() {
60156 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
60157 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
60159 ".preset-search-input",
60160 helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
60163 context.on("enter.intro", function(mode) {
60164 if (!_tankID || !context.hasEntity(_tankID)) {
60165 return continueTo(addTank);
60167 var ids2 = context.selectedIDs();
60168 if (mode.id !== "select" || !ids2.length || ids2[0] !== _tankID) {
60169 context.enter(modeSelect(context, [_tankID]));
60170 context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
60171 context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
60172 context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
60174 ".preset-search-input",
60175 helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
60177 context.history().on("change.intro", null);
60180 function checkPresetSearch() {
60181 var first = context.container().select(".preset-list-item:first-child");
60182 if (first.classed("preset-man_made-storage_tank")) {
60184 first.select(".preset-list-button").node(),
60185 helpHtml("intro.buildings.choose_tank", { preset: tankPreset.name() }),
60188 context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
60189 context.history().on("change.intro", function() {
60190 continueTo(closeEditorTank);
60194 function continueTo(nextStep) {
60195 context.container().select(".inspector-wrap").on("wheel.intro", null);
60196 context.on("enter.intro", null);
60197 context.history().on("change.intro", null);
60198 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
60202 function closeEditorTank() {
60203 if (!_tankID || !context.hasEntity(_tankID)) {
60206 var ids = context.selectedIDs();
60207 if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
60208 context.enter(modeSelect(context, [_tankID]));
60210 context.history().checkpoint("hasTank");
60211 context.on("exit.intro", function() {
60212 continueTo(rightClickTank);
60214 timeout2(function() {
60216 ".entity-editor-pane",
60217 helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
60220 function continueTo(nextStep) {
60221 context.on("exit.intro", null);
60225 function rightClickTank() {
60227 return continueTo(addTank);
60228 context.enter(modeBrowse(context));
60229 context.history().reset("hasTank");
60230 context.map().centerEase(tank, 500);
60231 timeout2(function() {
60232 context.on("enter.intro", function(mode) {
60233 if (mode.id !== "select")
60235 var ids = context.selectedIDs();
60236 if (ids.length !== 1 || ids[0] !== _tankID)
60238 timeout2(function() {
60239 var node = selectMenuItem(context, "circularize").node();
60242 continueTo(clickCircle);
60245 var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_tank" : "edit_menu_tank_touch"));
60246 revealTank(tank, rightclickString);
60247 context.map().on("move.intro drawn.intro", function() {
60248 revealTank(tank, rightclickString, { duration: 0 });
60250 context.history().on("change.intro", function() {
60251 continueTo(rightClickTank);
60254 function continueTo(nextStep) {
60255 context.on("enter.intro", null);
60256 context.map().on("move.intro drawn.intro", null);
60257 context.history().on("change.intro", null);
60261 function clickCircle() {
60263 return chapter.restart();
60264 var entity = context.hasEntity(_tankID);
60266 return continueTo(rightClickTank);
60267 var node = selectMenuItem(context, "circularize").node();
60269 return continueTo(rightClickTank);
60271 var wasChanged = false;
60274 helpHtml("intro.buildings.circle_tank"),
60277 context.on("enter.intro", function(mode) {
60278 if (mode.id === "browse") {
60279 continueTo(rightClickTank);
60280 } else if (mode.id === "move" || mode.id === "rotate") {
60281 continueTo(retryClickCircle);
60284 context.map().on("move.intro", function() {
60285 var node2 = selectMenuItem(context, "circularize").node();
60286 if (!wasChanged && !node2) {
60287 return continueTo(rightClickTank);
60291 helpHtml("intro.buildings.circle_tank"),
60292 { duration: 0, padding: 50 }
60295 context.history().on("change.intro", function() {
60297 context.history().on("change.intro", null);
60298 timeout2(function() {
60299 if (context.history().undoAnnotation() === _t("operations.circularize.annotation.feature", { n: 1 })) {
60302 continueTo(retryClickCircle);
60306 function continueTo(nextStep) {
60307 context.on("enter.intro", null);
60308 context.map().on("move.intro", null);
60309 context.history().on("change.intro", null);
60313 function retryClickCircle() {
60314 context.enter(modeBrowse(context));
60315 revealTank(tank, helpHtml("intro.buildings.retry_circle"), {
60316 buttonText: _t.html("intro.ok"),
60317 buttonCallback: function() {
60318 continueTo(rightClickTank);
60321 function continueTo(nextStep) {
60326 dispatch14.call("done");
60329 helpHtml("intro.buildings.play", { next: _t("intro.startediting.title") }),
60331 tooltipBox: ".intro-nav-wrap .chapter-startEditing",
60332 buttonText: _t.html("intro.ok"),
60333 buttonCallback: function() {
60334 reveal(".ideditor");
60339 chapter.enter = function() {
60342 chapter.exit = function() {
60343 timeouts.forEach(window.clearTimeout);
60344 context.on("enter.intro exit.intro", null);
60345 context.map().on("move.intro drawn.intro", null);
60346 context.history().on("change.intro", null);
60347 context.container().select(".inspector-wrap").on("wheel.intro", null);
60348 context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
60349 context.container().select(".more-fields .combobox-input").on("click.intro", null);
60351 chapter.restart = function() {
60355 return utilRebind(chapter, dispatch14, "on");
60358 // modules/ui/intro/start_editing.js
60359 function uiIntroStartEditing(context, reveal) {
60360 var dispatch14 = dispatch_default("done", "startEditing");
60361 var modalSelection = select_default2(null);
60363 title: "intro.startediting.title"
60365 function showHelp() {
60367 ".map-control.help-control",
60368 helpHtml("intro.startediting.help"),
60370 buttonText: _t.html("intro.ok"),
60371 buttonCallback: function() {
60377 function shortcuts() {
60379 ".map-control.help-control",
60380 helpHtml("intro.startediting.shortcuts"),
60382 buttonText: _t.html("intro.ok"),
60383 buttonCallback: function() {
60389 function showSave() {
60390 context.container().selectAll(".shaded").remove();
60392 ".top-toolbar button.save",
60393 helpHtml("intro.startediting.save"),
60395 buttonText: _t.html("intro.ok"),
60396 buttonCallback: function() {
60402 function showStart() {
60403 context.container().selectAll(".shaded").remove();
60404 modalSelection = uiModal(context.container());
60405 modalSelection.select(".modal").attr("class", "modal-splash modal");
60406 modalSelection.selectAll(".close").remove();
60407 var startbutton = modalSelection.select(".content").attr("class", "fillL").append("button").attr("class", "modal-section huge-modal-button").on("click", function() {
60408 modalSelection.remove();
60410 startbutton.append("svg").attr("class", "illustration").append("use").attr("xlink:href", "#iD-logo-walkthrough");
60411 startbutton.append("h2").call(_t.append("intro.startediting.start"));
60412 dispatch14.call("startEditing");
60414 chapter.enter = function() {
60417 chapter.exit = function() {
60418 modalSelection.remove();
60419 context.container().selectAll(".shaded").remove();
60421 return utilRebind(chapter, dispatch14, "on");
60424 // modules/ui/intro/intro.js
60426 welcome: uiIntroWelcome,
60427 navigation: uiIntroNavigation,
60428 point: uiIntroPoint,
60431 building: uiIntroBuilding,
60432 startEditing: uiIntroStartEditing
60434 var chapterFlow = [
60443 function uiIntro(context) {
60444 const INTRO_IMAGERY = "EsriWorldImageryClarity";
60445 let _introGraph = {};
60447 function intro(selection2) {
60448 _mainFileFetcher.get("intro_graph").then((dataIntroGraph) => {
60449 for (let id2 in dataIntroGraph) {
60450 if (!_introGraph[id2]) {
60451 _introGraph[id2] = osmEntity(localize(dataIntroGraph[id2]));
60454 selection2.call(startIntro);
60455 }).catch(function() {
60458 function startIntro(selection2) {
60459 context.enter(modeBrowse(context));
60460 let osm = context.connection();
60461 let history = context.history().toJSON();
60462 let hash = window.location.hash;
60463 let center = context.map().center();
60464 let zoom = context.map().zoom();
60465 let background = context.background().baseLayerSource();
60466 let overlays = context.background().overlayLayerSources();
60467 let opacity = context.container().selectAll(".main-map .layer-background").style("opacity");
60468 let caches = osm && osm.caches();
60469 let baseEntities = context.history().graph().base().entities;
60470 context.ui().sidebar.expand();
60471 context.container().selectAll("button.sidebar-toggle").classed("disabled", true);
60472 context.inIntro(true);
60474 osm.toggle(false).reset();
60476 context.history().reset();
60477 context.history().merge(Object.values(coreGraph().load(_introGraph).entities));
60478 context.history().checkpoint("initial");
60479 let imagery = context.background().findSource(INTRO_IMAGERY);
60481 context.background().baseLayerSource(imagery);
60483 context.background().bing();
60485 overlays.forEach((d2) => context.background().toggleOverlayLayer(d2));
60486 let layers = context.layers();
60487 layers.all().forEach((item) => {
60488 if (typeof item.layer.enabled === "function") {
60489 item.layer.enabled(item.id === "osm");
60492 context.container().selectAll(".main-map .layer-background").style("opacity", 1);
60493 let curtain = uiCurtain(context.container().node());
60494 selection2.call(curtain);
60495 corePreferences("walkthrough_started", "yes");
60496 let storedProgress = corePreferences("walkthrough_progress") || "";
60497 let progress = storedProgress.split(";").filter(Boolean);
60498 let chapters = chapterFlow.map((chapter, i3) => {
60499 let s2 = chapterUi[chapter](context, curtain.reveal).on("done", () => {
60500 buttons.filter((d2) => d2.title === s2.title).classed("finished", true);
60501 if (i3 < chapterFlow.length - 1) {
60502 const next = chapterFlow[i3 + 1];
60503 context.container().select(`button.chapter-${next}`).classed("next", true);
60505 progress.push(chapter);
60506 corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
60510 chapters[chapters.length - 1].on("startEditing", () => {
60511 progress.push("startEditing");
60512 corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
60513 let incomplete = utilArrayDifference(chapterFlow, progress);
60514 if (!incomplete.length) {
60515 corePreferences("walkthrough_completed", "yes");
60519 context.container().selectAll(".main-map .layer-background").style("opacity", opacity);
60520 context.container().selectAll("button.sidebar-toggle").classed("disabled", false);
60522 osm.toggle(true).reset().caches(caches);
60524 context.history().reset().merge(Object.values(baseEntities));
60525 context.background().baseLayerSource(background);
60526 overlays.forEach((d2) => context.background().toggleOverlayLayer(d2));
60528 context.history().fromJSON(history, false);
60530 context.map().centerZoom(center, zoom);
60531 window.location.replace(hash);
60532 context.inIntro(false);
60534 let navwrap = selection2.append("div").attr("class", "intro-nav-wrap fillD");
60535 navwrap.append("svg").attr("class", "intro-nav-wrap-logo").append("use").attr("xlink:href", "#iD-logo-walkthrough");
60536 let buttonwrap = navwrap.append("div").attr("class", "joined").selectAll("button.chapter");
60537 let buttons = buttonwrap.data(chapters).enter().append("button").attr("class", (d2, i3) => `chapter chapter-${chapterFlow[i3]}`).on("click", enterChapter);
60538 buttons.append("span").html((d2) => _t.html(d2.title));
60539 buttons.append("span").attr("class", "status").call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
60540 enterChapter(null, chapters[0]);
60541 function enterChapter(d3_event, newChapter) {
60542 if (_currChapter) {
60543 _currChapter.exit();
60545 context.enter(modeBrowse(context));
60546 _currChapter = newChapter;
60547 _currChapter.enter();
60548 buttons.classed("next", false).classed("active", (d2) => d2.title === _currChapter.title);
60554 // modules/ui/issues_info.js
60555 function uiIssuesInfo(context) {
60556 var warningsItem = {
60559 iconID: "iD-icon-alert",
60560 descriptionID: "issues.warnings_and_errors"
60562 var resolvedItem = {
60565 iconID: "iD-icon-apply",
60566 descriptionID: "issues.user_resolved_issues"
60568 function update(selection2) {
60569 var shownItems = [];
60570 var liveIssues = context.validator().getIssues({
60571 what: corePreferences("validate-what") || "edited",
60572 where: corePreferences("validate-where") || "all"
60574 if (liveIssues.length) {
60575 warningsItem.count = liveIssues.length;
60576 shownItems.push(warningsItem);
60578 if (corePreferences("validate-what") === "all") {
60579 var resolvedIssues = context.validator().getResolvedIssues();
60580 if (resolvedIssues.length) {
60581 resolvedItem.count = resolvedIssues.length;
60582 shownItems.push(resolvedItem);
60585 var chips = selection2.selectAll(".chip").data(shownItems, function(d2) {
60588 chips.exit().remove();
60589 var enter = chips.enter().append("a").attr("class", function(d2) {
60590 return "chip " + d2.id + "-count";
60591 }).attr("href", "#").each(function(d2) {
60592 var chipSelection = select_default2(this);
60593 var tooltipBehavior = uiTooltip().placement("top").title(() => _t.append(d2.descriptionID));
60594 chipSelection.call(tooltipBehavior).on("click", function(d3_event) {
60595 d3_event.preventDefault();
60596 tooltipBehavior.hide(select_default2(this));
60597 context.ui().togglePanes(context.container().select(".map-panes .issues-pane"));
60599 chipSelection.call(svgIcon("#" + d2.iconID));
60601 enter.append("span").attr("class", "count");
60602 enter.merge(chips).selectAll("span.count").text(function(d2) {
60603 return d2.count.toString();
60606 return function(selection2) {
60607 update(selection2);
60608 context.validator().on("validated.infobox", function() {
60609 update(selection2);
60614 // modules/ui/map_in_map.js
60615 function uiMapInMap(context) {
60616 function mapInMap(selection2) {
60617 var backgroundLayer = rendererTileLayer(context);
60618 var overlayLayers = {};
60619 var projection2 = geoRawMercator();
60620 var dataLayer = svgData(projection2, context).showLabels(false);
60621 var debugLayer = svgDebug(projection2, context);
60622 var zoom = zoom_default2().scaleExtent([geoZoomToScale(0.5), geoZoomToScale(24)]).on("start", zoomStarted).on("zoom", zoomed).on("end", zoomEnded);
60623 var wrap2 = select_default2(null);
60624 var tiles = select_default2(null);
60625 var viewport = select_default2(null);
60626 var _isTransformed = false;
60627 var _isHidden = true;
60628 var _skipEvents = false;
60629 var _gesture = null;
60636 function zoomStarted() {
60639 _tStart = _tCurr = projection2.transform();
60642 function zoomed(d3_event) {
60645 var x2 = d3_event.transform.x;
60646 var y2 = d3_event.transform.y;
60647 var k2 = d3_event.transform.k;
60648 var isZooming = k2 !== _tStart.k;
60649 var isPanning = x2 !== _tStart.x || y2 !== _tStart.y;
60650 if (!isZooming && !isPanning) {
60654 _gesture = isZooming ? "zoom" : "pan";
60656 var tMini = projection2.transform();
60658 if (_gesture === "zoom") {
60659 scale = k2 / tMini.k;
60660 tX = (_cMini[0] / scale - _cMini[0]) * scale;
60661 tY = (_cMini[1] / scale - _cMini[1]) * scale;
60668 utilSetTransform(tiles, tX, tY, scale);
60669 utilSetTransform(viewport, 0, 0, scale);
60670 _isTransformed = true;
60671 _tCurr = identity2.translate(x2, y2).scale(k2);
60672 var zMain = geoScaleToZoom(context.projection.scale());
60673 var zMini = geoScaleToZoom(k2);
60674 _zDiff = zMain - zMini;
60677 function zoomEnded() {
60680 if (_gesture !== "pan")
60682 updateProjection();
60684 context.map().center(projection2.invert(_cMini));
60686 function updateProjection() {
60687 var loc = context.map().center();
60688 var tMain = context.projection.transform();
60689 var zMain = geoScaleToZoom(tMain.k);
60690 var zMini = Math.max(zMain - _zDiff, 0.5);
60691 var kMini = geoZoomToScale(zMini);
60692 projection2.translate([tMain.x, tMain.y]).scale(kMini);
60693 var point2 = projection2(loc);
60694 var mouse = _gesture === "pan" ? geoVecSubtract([_tCurr.x, _tCurr.y], [_tStart.x, _tStart.y]) : [0, 0];
60695 var xMini = _cMini[0] - point2[0] + tMain.x + mouse[0];
60696 var yMini = _cMini[1] - point2[1] + tMain.y + mouse[1];
60697 projection2.translate([xMini, yMini]).clipExtent([[0, 0], _dMini]);
60698 _tCurr = projection2.transform();
60699 if (_isTransformed) {
60700 utilSetTransform(tiles, 0, 0);
60701 utilSetTransform(viewport, 0, 0);
60702 _isTransformed = false;
60704 zoom.scaleExtent([geoZoomToScale(0.5), geoZoomToScale(zMain - 3)]);
60705 _skipEvents = true;
60706 wrap2.call(zoom.transform, _tCurr);
60707 _skipEvents = false;
60709 function redraw() {
60710 clearTimeout(_timeoutID);
60713 updateProjection();
60714 var zMini = geoScaleToZoom(projection2.scale());
60715 tiles = wrap2.selectAll(".map-in-map-tiles").data([0]);
60716 tiles = tiles.enter().append("div").attr("class", "map-in-map-tiles").merge(tiles);
60717 backgroundLayer.source(context.background().baseLayerSource()).projection(projection2).dimensions(_dMini);
60718 var background = tiles.selectAll(".map-in-map-background").data([0]);
60719 background.enter().append("div").attr("class", "map-in-map-background").merge(background).call(backgroundLayer);
60720 var overlaySources = context.background().overlayLayerSources();
60721 var activeOverlayLayers = [];
60722 for (var i3 = 0; i3 < overlaySources.length; i3++) {
60723 if (overlaySources[i3].validZoom(zMini)) {
60724 if (!overlayLayers[i3])
60725 overlayLayers[i3] = rendererTileLayer(context);
60726 activeOverlayLayers.push(overlayLayers[i3].source(overlaySources[i3]).projection(projection2).dimensions(_dMini));
60729 var overlay = tiles.selectAll(".map-in-map-overlay").data([0]);
60730 overlay = overlay.enter().append("div").attr("class", "map-in-map-overlay").merge(overlay);
60731 var overlays = overlay.selectAll("div").data(activeOverlayLayers, function(d2) {
60732 return d2.source().name();
60734 overlays.exit().remove();
60735 overlays = overlays.enter().append("div").merge(overlays).each(function(layer) {
60736 select_default2(this).call(layer);
60738 var dataLayers = tiles.selectAll(".map-in-map-data").data([0]);
60739 dataLayers.exit().remove();
60740 dataLayers = dataLayers.enter().append("svg").attr("class", "map-in-map-data").merge(dataLayers).call(dataLayer).call(debugLayer);
60741 if (_gesture !== "pan") {
60742 var getPath = path_default(projection2);
60743 var bbox2 = { type: "Polygon", coordinates: [context.map().extent().polygon()] };
60744 viewport = wrap2.selectAll(".map-in-map-viewport").data([0]);
60745 viewport = viewport.enter().append("svg").attr("class", "map-in-map-viewport").merge(viewport);
60746 var path = viewport.selectAll(".map-in-map-bbox").data([bbox2]);
60747 path.enter().append("path").attr("class", "map-in-map-bbox").merge(path).attr("d", getPath).classed("thick", function(d2) {
60748 return getPath.area(d2) < 30;
60752 function queueRedraw() {
60753 clearTimeout(_timeoutID);
60754 _timeoutID = setTimeout(function() {
60758 function toggle(d3_event) {
60760 d3_event.preventDefault();
60761 _isHidden = !_isHidden;
60762 context.container().select(".minimap-toggle-item").classed("active", !_isHidden).select("input").property("checked", !_isHidden);
60764 wrap2.style("display", "block").style("opacity", "1").transition().duration(200).style("opacity", "0").on("end", function() {
60765 selection2.selectAll(".map-in-map").style("display", "none");
60768 wrap2.style("display", "block").style("opacity", "0").transition().duration(200).style("opacity", "1").on("end", function() {
60773 uiMapInMap.toggle = toggle;
60774 wrap2 = selection2.selectAll(".map-in-map").data([0]);
60775 wrap2 = wrap2.enter().append("div").attr("class", "map-in-map").style("display", _isHidden ? "none" : "block").call(zoom).on("dblclick.zoom", null).merge(wrap2);
60776 _dMini = [200, 150];
60777 _cMini = geoVecScale(_dMini, 0.5);
60778 context.map().on("drawn.map-in-map", function(drawn) {
60779 if (drawn.full === true) {
60784 context.keybinding().on(_t("background.minimap.key"), toggle);
60789 // modules/ui/notice.js
60790 function uiNotice(context) {
60791 return function(selection2) {
60792 var div = selection2.append("div").attr("class", "notice");
60793 var button = div.append("button").attr("class", "zoom-to notice fillD").on("click", function() {
60794 context.map().zoomEase(context.minEditableZoom());
60795 }).on("wheel", function(d3_event) {
60796 var e22 = new WheelEvent(d3_event.type, d3_event);
60797 context.surface().node().dispatchEvent(e22);
60799 button.call(svgIcon("#iD-icon-plus", "pre-text")).append("span").attr("class", "label").call(_t.append("zoom_in_edit"));
60800 function disableTooHigh() {
60801 var canEdit = context.map().zoom() >= context.minEditableZoom();
60802 div.style("display", canEdit ? "none" : "block");
60804 context.map().on("move.notice", debounce_default(disableTooHigh, 500));
60809 // modules/ui/photoviewer.js
60810 function uiPhotoviewer(context) {
60811 var dispatch14 = dispatch_default("resize");
60812 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
60813 function photoviewer(selection2) {
60814 selection2.append("button").attr("class", "thumb-hide").attr("title", _t("icons.close")).on("click", function() {
60815 if (services.streetside) {
60816 services.streetside.hideViewer(context);
60818 if (services.mapillary) {
60819 services.mapillary.hideViewer(context);
60821 if (services.kartaview) {
60822 services.kartaview.hideViewer(context);
60824 if (services.mapilio) {
60825 services.mapilio.hideViewer(context);
60827 if (services.vegbilder) {
60828 services.vegbilder.hideViewer(context);
60830 }).append("div").call(svgIcon("#iD-icon-close"));
60831 function preventDefault(d3_event) {
60832 d3_event.preventDefault();
60834 selection2.append("button").attr("class", "resize-handle-xy").on("touchstart touchdown touchend", preventDefault).on(
60835 _pointerPrefix + "down",
60836 buildResizeListener(selection2, "resize", dispatch14, { resizeOnX: true, resizeOnY: true })
60838 selection2.append("button").attr("class", "resize-handle-x").on("touchstart touchdown touchend", preventDefault).on(
60839 _pointerPrefix + "down",
60840 buildResizeListener(selection2, "resize", dispatch14, { resizeOnX: true })
60842 selection2.append("button").attr("class", "resize-handle-y").on("touchstart touchdown touchend", preventDefault).on(
60843 _pointerPrefix + "down",
60844 buildResizeListener(selection2, "resize", dispatch14, { resizeOnY: true })
60846 function buildResizeListener(target, eventName, dispatch15, options2) {
60847 var resizeOnX = !!options2.resizeOnX;
60848 var resizeOnY = !!options2.resizeOnY;
60849 var minHeight = options2.minHeight || 240;
60850 var minWidth = options2.minWidth || 320;
60856 function startResize(d3_event) {
60857 if (pointerId !== (d3_event.pointerId || "mouse"))
60859 d3_event.preventDefault();
60860 d3_event.stopPropagation();
60861 var mapSize = context.map().dimensions();
60863 var maxWidth = mapSize[0];
60864 var newWidth = clamp3(startWidth + d3_event.clientX - startX, minWidth, maxWidth);
60865 target.style("width", newWidth + "px");
60868 var maxHeight = mapSize[1] - 90;
60869 var newHeight = clamp3(startHeight + startY - d3_event.clientY, minHeight, maxHeight);
60870 target.style("height", newHeight + "px");
60872 dispatch15.call(eventName, target, subtractPadding(utilGetDimensions(target, true), target));
60874 function clamp3(num, min3, max3) {
60875 return Math.max(min3, Math.min(num, max3));
60877 function stopResize(d3_event) {
60878 if (pointerId !== (d3_event.pointerId || "mouse"))
60880 d3_event.preventDefault();
60881 d3_event.stopPropagation();
60882 select_default2(window).on("." + eventName, null);
60884 return function initResize(d3_event) {
60885 d3_event.preventDefault();
60886 d3_event.stopPropagation();
60887 pointerId = d3_event.pointerId || "mouse";
60888 startX = d3_event.clientX;
60889 startY = d3_event.clientY;
60890 var targetRect = target.node().getBoundingClientRect();
60891 startWidth = targetRect.width;
60892 startHeight = targetRect.height;
60893 select_default2(window).on(_pointerPrefix + "move." + eventName, startResize, false).on(_pointerPrefix + "up." + eventName, stopResize, false);
60894 if (_pointerPrefix === "pointer") {
60895 select_default2(window).on("pointercancel." + eventName, stopResize, false);
60900 photoviewer.onMapResize = function() {
60901 var photoviewer2 = context.container().select(".photoviewer");
60902 var content = context.container().select(".main-content");
60903 var mapDimensions = utilGetDimensions(content, true);
60904 var photoDimensions = utilGetDimensions(photoviewer2, true);
60905 if (photoDimensions[0] > mapDimensions[0] || photoDimensions[1] > mapDimensions[1] - 90) {
60906 var setPhotoDimensions = [
60907 Math.min(photoDimensions[0], mapDimensions[0]),
60908 Math.min(photoDimensions[1], mapDimensions[1] - 90)
60910 photoviewer2.style("width", setPhotoDimensions[0] + "px").style("height", setPhotoDimensions[1] + "px");
60911 dispatch14.call("resize", photoviewer2, subtractPadding(setPhotoDimensions, photoviewer2));
60914 function subtractPadding(dimensions, selection2) {
60916 dimensions[0] - parseFloat(selection2.style("padding-left")) - parseFloat(selection2.style("padding-right")),
60917 dimensions[1] - parseFloat(selection2.style("padding-top")) - parseFloat(selection2.style("padding-bottom"))
60920 return utilRebind(photoviewer, dispatch14, "on");
60923 // modules/ui/restore.js
60924 function uiRestore(context) {
60925 return function(selection2) {
60926 if (!context.history().hasRestorableChanges())
60928 let modalSelection = uiModal(selection2, true);
60929 modalSelection.select(".modal").attr("class", "modal fillL");
60930 let introModal = modalSelection.select(".content");
60931 introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("restore.heading"));
60932 introModal.append("div").attr("class", "modal-section").append("p").call(_t.append("restore.description"));
60933 let buttonWrap = introModal.append("div").attr("class", "modal-actions");
60934 let restore = buttonWrap.append("button").attr("class", "restore").on("click", () => {
60935 context.history().restore();
60936 modalSelection.remove();
60938 restore.append("svg").attr("class", "logo logo-restore").append("use").attr("xlink:href", "#iD-logo-restore");
60939 restore.append("div").call(_t.append("restore.restore"));
60940 let reset = buttonWrap.append("button").attr("class", "reset").on("click", () => {
60941 context.history().clearSaved();
60942 modalSelection.remove();
60944 reset.append("svg").attr("class", "logo logo-reset").append("use").attr("xlink:href", "#iD-logo-reset");
60945 reset.append("div").call(_t.append("restore.reset"));
60946 restore.node().focus();
60950 // modules/ui/scale.js
60951 function uiScale(context) {
60952 var projection2 = context.projection, isImperial = !_mainLocalizer.usesMetric(), maxLength = 180, tickHeight = 8;
60953 function scaleDefs(loc1, loc2) {
60954 var lat = (loc2[1] + loc1[1]) / 2, conversion = isImperial ? 3.28084 : 1, dist = geoLonToMeters(loc2[0] - loc1[0], lat) * conversion, scale = { dist: 0, px: 0, text: "" }, buckets, i3, val, dLon;
60956 buckets = [528e4, 528e3, 52800, 5280, 500, 50, 5, 1];
60958 buckets = [5e6, 5e5, 5e4, 5e3, 500, 50, 5, 1];
60960 for (i3 = 0; i3 < buckets.length; i3++) {
60963 scale.dist = Math.floor(dist / val) * val;
60966 scale.dist = +dist.toFixed(2);
60969 dLon = geoMetersToLon(scale.dist / conversion, lat);
60970 scale.px = Math.round(projection2([loc1[0] + dLon, loc1[1]])[0]);
60971 scale.text = displayLength(scale.dist / conversion, isImperial);
60974 function update(selection2) {
60975 var dims = context.map().dimensions(), loc1 = projection2.invert([0, dims[1]]), loc2 = projection2.invert([maxLength, dims[1]]), scale = scaleDefs(loc1, loc2);
60976 selection2.select(".scale-path").attr("d", "M0.5,0.5v" + tickHeight + "h" + scale.px + "v-" + tickHeight);
60977 selection2.select(".scale-text").style(_mainLocalizer.textDirection() === "ltr" ? "left" : "right", scale.px + 16 + "px").text(scale.text);
60979 return function(selection2) {
60980 function switchUnits() {
60981 isImperial = !isImperial;
60982 selection2.call(update);
60984 var scalegroup = selection2.append("svg").attr("class", "scale").on("click", switchUnits).append("g").attr("transform", "translate(10,11)");
60985 scalegroup.append("path").attr("class", "scale-path");
60986 selection2.append("div").attr("class", "scale-text");
60987 selection2.call(update);
60988 context.map().on("move.scale", function() {
60989 update(selection2);
60994 // modules/ui/shortcuts.js
60995 function uiShortcuts(context) {
60996 var detected = utilDetect();
60997 var _activeTab = 0;
60998 var _modalSelection;
60999 var _selection = select_default2(null);
61000 var _dataShortcuts;
61001 function shortcutsModal(_modalSelection2) {
61002 _modalSelection2.select(".modal").classed("modal-shortcuts", true);
61003 var content = _modalSelection2.select(".content");
61004 content.append("div").attr("class", "modal-section header").append("h2").call(_t.append("shortcuts.title"));
61005 _mainFileFetcher.get("shortcuts").then(function(data) {
61006 _dataShortcuts = data;
61007 content.call(render);
61008 }).catch(function() {
61011 function render(selection2) {
61012 if (!_dataShortcuts)
61014 var wrapper = selection2.selectAll(".wrapper").data([0]);
61015 var wrapperEnter = wrapper.enter().append("div").attr("class", "wrapper modal-section");
61016 var tabsBar = wrapperEnter.append("div").attr("class", "tabs-bar");
61017 var shortcutsList = wrapperEnter.append("div").attr("class", "shortcuts-list");
61018 wrapper = wrapper.merge(wrapperEnter);
61019 var tabs = tabsBar.selectAll(".tab").data(_dataShortcuts);
61020 var tabsEnter = tabs.enter().append("a").attr("class", "tab").attr("href", "#").on("click", function(d3_event, d2) {
61021 d3_event.preventDefault();
61022 var i3 = _dataShortcuts.indexOf(d2);
61024 render(selection2);
61026 tabsEnter.append("span").html(function(d2) {
61027 return _t.html(d2.text);
61029 wrapper.selectAll(".tab").classed("active", function(d2, i3) {
61030 return i3 === _activeTab;
61032 var shortcuts = shortcutsList.selectAll(".shortcut-tab").data(_dataShortcuts);
61033 var shortcutsEnter = shortcuts.enter().append("div").attr("class", function(d2) {
61034 return "shortcut-tab shortcut-tab-" + d2.tab;
61036 var columnsEnter = shortcutsEnter.selectAll(".shortcut-column").data(function(d2) {
61038 }).enter().append("table").attr("class", "shortcut-column");
61039 var rowsEnter = columnsEnter.selectAll(".shortcut-row").data(function(d2) {
61041 }).enter().append("tr").attr("class", "shortcut-row");
61042 var sectionRows = rowsEnter.filter(function(d2) {
61043 return !d2.shortcuts;
61045 sectionRows.append("td");
61046 sectionRows.append("td").attr("class", "shortcut-section").append("h3").html(function(d2) {
61047 return _t.html(d2.text);
61049 var shortcutRows = rowsEnter.filter(function(d2) {
61050 return d2.shortcuts;
61052 var shortcutKeys = shortcutRows.append("td").attr("class", "shortcut-keys");
61053 var modifierKeys = shortcutKeys.filter(function(d2) {
61054 return d2.modifiers;
61056 modifierKeys.selectAll("kbd.modifier").data(function(d2) {
61057 if (detected.os === "win" && d2.text === "shortcuts.editing.commands.redo") {
61059 } else if (detected.os !== "mac" && d2.text === "shortcuts.browsing.display_options.fullscreen") {
61062 return d2.modifiers;
61064 }).enter().each(function() {
61065 var selection3 = select_default2(this);
61066 selection3.append("kbd").attr("class", "modifier").text(function(d2) {
61067 return uiCmd.display(d2);
61069 selection3.append("span").text("+");
61071 shortcutKeys.selectAll("kbd.shortcut").data(function(d2) {
61072 var arr = d2.shortcuts;
61073 if (detected.os === "win" && d2.text === "shortcuts.editing.commands.redo") {
61075 } else if (detected.os !== "mac" && d2.text === "shortcuts.browsing.display_options.fullscreen") {
61078 arr = arr.map(function(s2) {
61079 return uiCmd.display(s2.indexOf(".") !== -1 ? _t(s2) : s2);
61081 return utilArrayUniq(arr).map(function(s2) {
61084 separator: d2.separator,
61088 }).enter().each(function(d2, i3, nodes) {
61089 var selection3 = select_default2(this);
61090 var click = d2.shortcut.toLowerCase().match(/(.*).click/);
61091 if (click && click[1]) {
61092 selection3.call(svgIcon("#iD-walkthrough-mouse-" + click[1], "operation"));
61093 } else if (d2.shortcut.toLowerCase() === "long-press") {
61094 selection3.call(svgIcon("#iD-walkthrough-longpress", "longpress operation"));
61095 } else if (d2.shortcut.toLowerCase() === "tap") {
61096 selection3.call(svgIcon("#iD-walkthrough-tap", "tap operation"));
61098 selection3.append("kbd").attr("class", "shortcut").text(function(d4) {
61099 return d4.shortcut;
61102 if (i3 < nodes.length - 1) {
61103 selection3.append("span").html(d2.separator || "\xA0" + _t.html("shortcuts.or") + "\xA0");
61104 } else if (i3 === nodes.length - 1 && d2.suffix) {
61105 selection3.append("span").text(d2.suffix);
61108 shortcutKeys.filter(function(d2) {
61110 }).each(function() {
61111 var selection3 = select_default2(this);
61112 selection3.append("span").text("+");
61113 selection3.append("span").attr("class", "gesture").html(function(d2) {
61114 return _t.html(d2.gesture);
61117 shortcutRows.append("td").attr("class", "shortcut-desc").html(function(d2) {
61118 return d2.text ? _t.html(d2.text) : "\xA0";
61120 wrapper.selectAll(".shortcut-tab").style("display", function(d2, i3) {
61121 return i3 === _activeTab ? "flex" : "none";
61124 return function(selection2, show) {
61125 _selection = selection2;
61127 _modalSelection = uiModal(selection2);
61128 _modalSelection.call(shortcutsModal);
61130 context.keybinding().on([_t("shortcuts.toggle.key"), "?"], function() {
61131 if (context.container().selectAll(".modal-shortcuts").size()) {
61132 if (_modalSelection) {
61133 _modalSelection.close();
61134 _modalSelection = null;
61137 _modalSelection = uiModal(_selection);
61138 _modalSelection.call(shortcutsModal);
61145 // modules/ui/data_header.js
61146 function uiDataHeader() {
61148 function dataHeader(selection2) {
61149 var header = selection2.selectAll(".data-header").data(
61150 _datum ? [_datum] : [],
61152 return d2.__featurehash__;
61155 header.exit().remove();
61156 var headerEnter = header.enter().append("div").attr("class", "data-header");
61157 var iconEnter = headerEnter.append("div").attr("class", "data-header-icon");
61158 iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-data", "note-fill"));
61159 headerEnter.append("div").attr("class", "data-header-label").call(_t.append("map_data.layers.custom.title"));
61161 dataHeader.datum = function(val) {
61162 if (!arguments.length)
61170 // modules/ui/combobox.js
61171 var _comboHideTimerID;
61172 function uiCombobox(context, klass) {
61173 var dispatch14 = dispatch_default("accept", "cancel", "update");
61174 var container = context.container();
61175 var _suggestions = [];
61178 var _selected = null;
61179 var _canAutocomplete = true;
61180 var _caseSensitive = false;
61181 var _cancelFetch = false;
61184 var _mouseEnterHandler, _mouseLeaveHandler;
61185 var _fetcher = function(val, cb) {
61186 cb(_data.filter(function(d2) {
61187 var terms = d2.terms || [];
61188 terms.push(d2.value);
61190 terms.push(d2.key);
61192 return terms.some(function(term) {
61193 return term.toString().toLowerCase().indexOf(val.toLowerCase()) !== -1;
61197 var combobox = function(input, attachTo) {
61198 if (!input || input.empty())
61200 input.classed("combobox-input", true).on("focus.combo-input", focus).on("blur.combo-input", blur).on("keydown.combo-input", keydown).on("keyup.combo-input", keyup).on("input.combo-input", change).on("mousedown.combo-input", mousedown).each(function() {
61201 var parent = this.parentNode;
61202 var sibling = this.nextSibling;
61203 select_default2(parent).selectAll(".combobox-caret").filter(function(d2) {
61204 return d2 === input.node();
61205 }).data([input.node()]).enter().insert("div", function() {
61207 }).attr("class", "combobox-caret").on("mousedown.combo-caret", function(d3_event) {
61208 d3_event.preventDefault();
61209 input.node().focus();
61210 mousedown(d3_event);
61211 }).on("mouseup.combo-caret", function(d3_event) {
61212 d3_event.preventDefault();
61216 function mousedown(d3_event) {
61217 if (d3_event.button !== 0)
61219 if (input.classed("disabled"))
61221 _tDown = +/* @__PURE__ */ new Date();
61222 var start2 = input.property("selectionStart");
61223 var end = input.property("selectionEnd");
61224 if (start2 !== end) {
61225 var val = utilGetSetValue(input);
61226 input.node().setSelectionRange(val.length, val.length);
61229 input.on("mouseup.combo-input", mouseup);
61231 function mouseup(d3_event) {
61232 input.on("mouseup.combo-input", null);
61233 if (d3_event.button !== 0)
61235 if (input.classed("disabled"))
61237 if (input.node() !== document.activeElement)
61239 var start2 = input.property("selectionStart");
61240 var end = input.property("selectionEnd");
61241 if (start2 !== end)
61243 var combo = container.selectAll(".combobox");
61244 if (combo.empty() || combo.datum() !== input.node()) {
61245 var tOrig = _tDown;
61246 window.setTimeout(function() {
61247 if (tOrig !== _tDown)
61249 fetchComboData("", function() {
61259 fetchComboData("");
61262 _comboHideTimerID = window.setTimeout(hide, 75);
61266 container.insert("div", ":first-child").datum(input.node()).attr("class", "combobox" + (klass ? " combobox-" + klass : "")).style("position", "absolute").style("display", "block").style("left", "0px").on("mousedown.combo-container", function(d3_event) {
61267 d3_event.preventDefault();
61269 container.on("scroll.combo-scroll", render, true);
61272 if (_comboHideTimerID) {
61273 window.clearTimeout(_comboHideTimerID);
61274 _comboHideTimerID = void 0;
61276 container.selectAll(".combobox").remove();
61277 container.on("scroll.combo-scroll", null);
61279 function keydown(d3_event) {
61280 var shown = !container.selectAll(".combobox").empty();
61281 var tagName = input.node() ? input.node().tagName.toLowerCase() : "";
61282 switch (d3_event.keyCode) {
61285 d3_event.stopPropagation();
61288 input.on("input.combo-input", function() {
61289 var start2 = input.property("selectionStart");
61290 input.node().setSelectionRange(start2, start2);
61291 input.on("input.combo-input", change);
61299 d3_event.preventDefault();
61300 d3_event.stopPropagation();
61304 if (tagName === "textarea" && !shown)
61306 d3_event.preventDefault();
61307 if (tagName === "input" && !shown) {
61313 if (tagName === "textarea" && !shown)
61315 d3_event.preventDefault();
61316 if (tagName === "input" && !shown) {
61323 function keyup(d3_event) {
61324 switch (d3_event.keyCode) {
61330 function change(doAutoComplete) {
61331 if (doAutoComplete === void 0)
61332 doAutoComplete = true;
61333 fetchComboData(value(), function() {
61335 var val = input.property("value");
61336 if (_suggestions.length) {
61337 if (doAutoComplete && input.property("selectionEnd") === val.length) {
61338 _selected = tryAutocomplete();
61345 var combo = container.selectAll(".combobox");
61346 if (combo.empty()) {
61355 function nav(dir) {
61356 if (_suggestions.length) {
61358 for (var i3 = 0; i3 < _suggestions.length; i3++) {
61359 if (_selected && _suggestions[i3].value === _selected) {
61364 index = Math.max(Math.min(index + dir, _suggestions.length - 1), 0);
61365 _selected = _suggestions[index].value;
61366 utilGetSetValue(input, _selected);
61367 dispatch14.call("update");
61372 function ensureVisible() {
61373 var combo = container.selectAll(".combobox");
61376 var containerRect = container.node().getBoundingClientRect();
61377 var comboRect = combo.node().getBoundingClientRect();
61378 if (comboRect.bottom > containerRect.bottom) {
61379 var node = attachTo ? attachTo.node() : input.node();
61380 node.scrollIntoView({ behavior: "instant", block: "center" });
61383 var selected = combo.selectAll(".combobox-option.selected").node();
61385 selected.scrollIntoView({ behavior: "smooth", block: "nearest" });
61389 var value2 = input.property("value");
61390 var start2 = input.property("selectionStart");
61391 var end = input.property("selectionEnd");
61392 if (start2 && end) {
61393 value2 = value2.substring(0, start2);
61397 function fetchComboData(v2, cb) {
61398 _cancelFetch = false;
61399 _fetcher.call(input, v2, function(results) {
61402 _suggestions = results;
61403 results.forEach(function(d2) {
61404 _fetched[d2.value] = d2;
61411 function tryAutocomplete() {
61412 if (!_canAutocomplete)
61414 var val = _caseSensitive ? value() : value().toLowerCase();
61419 const suggestionValues = [];
61420 _suggestions.forEach((s2) => {
61421 suggestionValues.push(s2.value);
61422 if (s2.key && s2.key !== s2.value) {
61423 suggestionValues.push(s2.key);
61426 var bestIndex = -1;
61427 for (var i3 = 0; i3 < suggestionValues.length; i3++) {
61428 var suggestion = suggestionValues[i3];
61429 var compare = _caseSensitive ? suggestion : suggestion.toLowerCase();
61430 if (compare === val) {
61433 } else if (bestIndex === -1 && compare.indexOf(val) === 0) {
61437 if (bestIndex !== -1) {
61438 var bestVal = suggestionValues[bestIndex];
61439 input.property("value", bestVal);
61440 input.node().setSelectionRange(val.length, bestVal.length);
61441 dispatch14.call("update");
61445 function render() {
61446 if (_suggestions.length < _minItems || document.activeElement !== input.node()) {
61450 var shown = !container.selectAll(".combobox").empty();
61453 var combo = container.selectAll(".combobox");
61454 var options2 = combo.selectAll(".combobox-option").data(_suggestions, function(d2) {
61457 options2.exit().remove();
61458 options2.enter().append("a").attr("class", function(d2) {
61459 return "combobox-option " + (d2.klass || "");
61460 }).attr("title", function(d2) {
61462 }).each(function(d2) {
61464 d2.display(select_default2(this));
61466 select_default2(this).text(d2.value);
61468 }).on("mouseenter", _mouseEnterHandler).on("mouseleave", _mouseLeaveHandler).merge(options2).classed("selected", function(d2) {
61469 return d2.value === _selected || d2.key === _selected;
61470 }).on("click.combo-option", accept).order();
61471 var node = attachTo ? attachTo.node() : input.node();
61472 var containerRect = container.node().getBoundingClientRect();
61473 var rect = node.getBoundingClientRect();
61474 combo.style("left", rect.left + 5 - containerRect.left + "px").style("width", rect.width - 10 + "px").style("top", rect.height + rect.top - containerRect.top + "px");
61476 function accept(d3_event, d2) {
61477 _cancelFetch = true;
61478 var thiz = input.node();
61480 utilGetSetValue(input, d2.value);
61481 utilTriggerEvent(input, "change");
61483 var val = utilGetSetValue(input);
61484 thiz.setSelectionRange(val.length, val.length);
61485 d2 = _fetched[val];
61486 dispatch14.call("accept", thiz, d2, val);
61489 function cancel() {
61490 _cancelFetch = true;
61491 var thiz = input.node();
61492 var val = utilGetSetValue(input);
61493 var start2 = input.property("selectionStart");
61494 var end = input.property("selectionEnd");
61495 val = val.slice(0, start2) + val.slice(end);
61496 utilGetSetValue(input, val);
61497 thiz.setSelectionRange(val.length, val.length);
61498 dispatch14.call("cancel", thiz);
61502 combobox.canAutocomplete = function(val) {
61503 if (!arguments.length)
61504 return _canAutocomplete;
61505 _canAutocomplete = val;
61508 combobox.caseSensitive = function(val) {
61509 if (!arguments.length)
61510 return _caseSensitive;
61511 _caseSensitive = val;
61514 combobox.data = function(val) {
61515 if (!arguments.length)
61520 combobox.fetcher = function(val) {
61521 if (!arguments.length)
61526 combobox.minItems = function(val) {
61527 if (!arguments.length)
61532 combobox.itemsMouseEnter = function(val) {
61533 if (!arguments.length)
61534 return _mouseEnterHandler;
61535 _mouseEnterHandler = val;
61538 combobox.itemsMouseLeave = function(val) {
61539 if (!arguments.length)
61540 return _mouseLeaveHandler;
61541 _mouseLeaveHandler = val;
61544 return utilRebind(combobox, dispatch14, "on");
61546 uiCombobox.off = function(input, context) {
61547 input.on("focus.combo-input", null).on("blur.combo-input", null).on("keydown.combo-input", null).on("keyup.combo-input", null).on("input.combo-input", null).on("mousedown.combo-input", null).on("mouseup.combo-input", null);
61548 context.container().on("scroll.combo-scroll", null);
61551 // modules/ui/disclosure.js
61552 function uiDisclosure(context, key, expandedDefault) {
61553 var dispatch14 = dispatch_default("toggled");
61555 var _label = utilFunctor("");
61556 var _updatePreference = true;
61557 var _content = function() {
61559 var disclosure = function(selection2) {
61560 if (_expanded === void 0 || _expanded === null) {
61561 var preference = corePreferences("disclosure." + key + ".expanded");
61562 _expanded = preference === null ? !!expandedDefault : preference === "true";
61564 var hideToggle = selection2.selectAll(".hide-toggle-" + key).data([0]);
61565 var hideToggleEnter = hideToggle.enter().append("h3").append("a").attr("role", "button").attr("href", "#").attr("class", "hide-toggle hide-toggle-" + key).call(svgIcon("", "pre-text", "hide-toggle-icon"));
61566 hideToggleEnter.append("span").attr("class", "hide-toggle-text");
61567 hideToggle = hideToggleEnter.merge(hideToggle);
61568 hideToggle.on("click", toggle).attr("title", _t(`icons.${_expanded ? "collapse" : "expand"}`)).attr("aria-expanded", _expanded).classed("expanded", _expanded);
61569 const label = _label();
61570 const labelSelection = hideToggle.selectAll(".hide-toggle-text");
61571 if (typeof label !== "function") {
61572 labelSelection.text(_label());
61574 labelSelection.text("").call(label);
61576 hideToggle.selectAll(".hide-toggle-icon").attr(
61578 _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
61580 var wrap2 = selection2.selectAll(".disclosure-wrap").data([0]);
61581 wrap2 = wrap2.enter().append("div").attr("class", "disclosure-wrap disclosure-wrap-" + key).merge(wrap2).classed("hide", !_expanded);
61583 wrap2.call(_content);
61585 function toggle(d3_event) {
61586 d3_event.preventDefault();
61587 _expanded = !_expanded;
61588 if (_updatePreference) {
61589 corePreferences("disclosure." + key + ".expanded", _expanded);
61591 hideToggle.classed("expanded", _expanded).attr("aria-expanded", _expanded).attr("title", _t(`icons.${_expanded ? "collapse" : "expand"}`));
61592 hideToggle.selectAll(".hide-toggle-icon").attr(
61594 _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
61596 wrap2.call(uiToggle(_expanded));
61598 wrap2.call(_content);
61600 dispatch14.call("toggled", this, _expanded);
61603 disclosure.label = function(val) {
61604 if (!arguments.length)
61606 _label = utilFunctor(val);
61609 disclosure.expanded = function(val) {
61610 if (!arguments.length)
61615 disclosure.updatePreference = function(val) {
61616 if (!arguments.length)
61617 return _updatePreference;
61618 _updatePreference = val;
61621 disclosure.content = function(val) {
61622 if (!arguments.length)
61627 return utilRebind(disclosure, dispatch14, "on");
61630 // modules/ui/section.js
61631 function uiSection(id2, context) {
61632 var _classes = utilFunctor("");
61633 var _shouldDisplay;
61637 var _expandedByDefault = utilFunctor(true);
61638 var _disclosureContent;
61639 var _disclosureExpanded;
61640 var _containerSelection = select_default2(null);
61644 section.classes = function(val) {
61645 if (!arguments.length)
61647 _classes = utilFunctor(val);
61650 section.label = function(val) {
61651 if (!arguments.length)
61653 _label = utilFunctor(val);
61656 section.expandedByDefault = function(val) {
61657 if (!arguments.length)
61658 return _expandedByDefault;
61659 _expandedByDefault = utilFunctor(val);
61662 section.shouldDisplay = function(val) {
61663 if (!arguments.length)
61664 return _shouldDisplay;
61665 _shouldDisplay = utilFunctor(val);
61668 section.content = function(val) {
61669 if (!arguments.length)
61674 section.disclosureContent = function(val) {
61675 if (!arguments.length)
61676 return _disclosureContent;
61677 _disclosureContent = val;
61680 section.disclosureExpanded = function(val) {
61681 if (!arguments.length)
61682 return _disclosureExpanded;
61683 _disclosureExpanded = val;
61686 section.render = function(selection2) {
61687 _containerSelection = selection2.selectAll(".section-" + id2).data([0]);
61688 var sectionEnter = _containerSelection.enter().append("div").attr("class", "section section-" + id2 + " " + (_classes && _classes() || ""));
61689 _containerSelection = sectionEnter.merge(_containerSelection);
61690 _containerSelection.call(renderContent);
61692 section.reRender = function() {
61693 _containerSelection.call(renderContent);
61695 section.selection = function() {
61696 return _containerSelection;
61698 section.disclosure = function() {
61699 return _disclosure;
61701 function renderContent(selection2) {
61702 if (_shouldDisplay) {
61703 var shouldDisplay = _shouldDisplay();
61704 selection2.classed("hide", !shouldDisplay);
61705 if (!shouldDisplay) {
61706 selection2.html("");
61710 if (_disclosureContent) {
61711 if (!_disclosure) {
61712 _disclosure = uiDisclosure(context, id2.replace(/-/g, "_"), _expandedByDefault()).label(_label || "").content(_disclosureContent);
61714 if (_disclosureExpanded !== void 0) {
61715 _disclosure.expanded(_disclosureExpanded);
61716 _disclosureExpanded = void 0;
61718 selection2.call(_disclosure);
61722 selection2.call(_content);
61728 // modules/ui/tag_reference.js
61729 function uiTagReference(what) {
61730 var wikibase = what.qid ? services.wikidata : services.osmWikibase;
61731 var tagReference = {};
61732 var _button = select_default2(null);
61733 var _body = select_default2(null);
61739 _button.classed("tag-reference-loading", true);
61740 wikibase.getDocs(what, gotDocs);
61742 function gotDocs(err, docs) {
61744 if (!docs || !docs.title) {
61745 _body.append("p").attr("class", "tag-reference-description").call(_t.append("inspector.no_documentation_key"));
61749 if (docs.imageURL) {
61750 _body.append("img").attr("class", "tag-reference-wiki-image").attr("alt", docs.description).attr("src", docs.imageURL).on("load", function() {
61752 }).on("error", function() {
61753 select_default2(this).remove();
61759 var tagReferenceDescription = _body.append("p").attr("class", "tag-reference-description").append("span");
61760 if (docs.description) {
61761 tagReferenceDescription = tagReferenceDescription.attr("class", "localized-text").attr("lang", docs.descriptionLocaleCode || "und").text(docs.description);
61763 tagReferenceDescription = tagReferenceDescription.call(_t.append("inspector.no_documentation_key"));
61765 tagReferenceDescription.append("a").attr("class", "tag-reference-edit").attr("target", "_blank").attr("title", _t("inspector.edit_reference")).attr("href", docs.editURL).call(svgIcon("#iD-icon-edit", "inline"));
61767 _body.append("a").attr("class", "tag-reference-link").attr("target", "_blank").attr("href", docs.wiki.url).call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append(docs.wiki.text));
61769 if (what.key === "comment") {
61770 _body.append("a").attr("class", "tag-reference-comment-link").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", _t("commit.about_changeset_comments_link")).append("span").call(_t.append("commit.about_changeset_comments"));
61775 _button.classed("tag-reference-loading", false);
61776 _body.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1");
61778 _button.selectAll("svg.icon use").each(function() {
61779 var iconUse = select_default2(this);
61780 if (iconUse.attr("href") === "#iD-icon-info") {
61781 iconUse.attr("href", "#iD-icon-info-filled");
61786 _body.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
61787 _body.classed("expanded", false);
61790 _button.selectAll("svg.icon use").each(function() {
61791 var iconUse = select_default2(this);
61792 if (iconUse.attr("href") === "#iD-icon-info-filled") {
61793 iconUse.attr("href", "#iD-icon-info");
61797 tagReference.button = function(selection2, klass, iconName) {
61798 _button = selection2.selectAll(".tag-reference-button").data([0]);
61799 _button = _button.enter().append("button").attr("class", "tag-reference-button " + (klass || "")).attr("title", _t("icons.information")).call(svgIcon("#iD-icon-" + (iconName || "inspect"))).merge(_button);
61800 _button.on("click", function(d3_event) {
61801 d3_event.stopPropagation();
61802 d3_event.preventDefault();
61806 } else if (_loaded) {
61813 tagReference.body = function(selection2) {
61814 var itemID = what.qid || what.key + "-" + (what.value || "");
61815 _body = selection2.selectAll(".tag-reference-body").data([itemID], function(d2) {
61818 _body.exit().remove();
61819 _body = _body.enter().append("div").attr("class", "tag-reference-body").style("max-height", "0").style("opacity", "0").merge(_body);
61820 if (_showing === false) {
61824 tagReference.showing = function(val) {
61825 if (!arguments.length)
61828 return tagReference;
61830 return tagReference;
61833 // modules/ui/field_help.js
61834 function uiFieldHelp(context, fieldName) {
61835 var fieldHelp = {};
61836 var _inspector = select_default2(null);
61837 var _wrap = select_default2(null);
61838 var _body = select_default2(null);
61839 var fieldHelpKeys = {
61867 "indirect_example",
61872 var fieldHelpHeadings = {};
61873 var replacements = {
61874 distField: { html: _t.html("restriction.controls.distance") },
61875 viaField: { html: _t.html("restriction.controls.via") },
61876 fromShadow: { html: icon("#iD-turn-shadow", "inline shadow from") },
61877 allowShadow: { html: icon("#iD-turn-shadow", "inline shadow allow") },
61878 restrictShadow: { html: icon("#iD-turn-shadow", "inline shadow restrict") },
61879 onlyShadow: { html: icon("#iD-turn-shadow", "inline shadow only") },
61880 allowTurn: { html: icon("#iD-turn-yes", "inline turn") },
61881 restrictTurn: { html: icon("#iD-turn-no", "inline turn") },
61882 onlyTurn: { html: icon("#iD-turn-only", "inline turn") }
61884 var docs = fieldHelpKeys[fieldName].map(function(key) {
61885 var helpkey = "help.field." + fieldName + "." + key[0];
61886 var text2 = key[1].reduce(function(all, part) {
61887 var subkey = helpkey + "." + part;
61888 var depth = fieldHelpHeadings[subkey];
61889 var hhh = depth ? Array(depth + 1).join("#") + " " : "";
61890 return all + hhh + _t.html(subkey, replacements) + "\n\n";
61894 title: _t.html(helpkey + ".title"),
61895 html: marked(text2.trim())
61900 _body.classed("hide", false).style("opacity", "0").transition().duration(200).style("opacity", "1");
61903 _body.classed("hide", true).transition().duration(200).style("opacity", "0").on("end", function() {
61904 _body.classed("hide", true);
61907 function clickHelp(index) {
61908 var d2 = docs[index];
61909 var tkeys = fieldHelpKeys[fieldName][index][1];
61910 _body.selectAll(".field-help-nav-item").classed("active", function(d4, i3) {
61911 return i3 === index;
61913 var content = _body.selectAll(".field-help-content").html(d2.html);
61914 content.selectAll("p").attr("class", function(d4, i3) {
61917 if (d2.key === "help.field.restrictions.inspecting") {
61918 content.insert("img", "p.from_shadow").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_inspect.gif"));
61919 } else if (d2.key === "help.field.restrictions.modifying") {
61920 content.insert("img", "p.allow_turn").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_modify.gif"));
61923 fieldHelp.button = function(selection2) {
61926 var button = selection2.selectAll(".field-help-button").data([0]);
61927 button.enter().append("button").attr("class", "field-help-button").call(svgIcon("#iD-icon-help")).merge(button).on("click", function(d3_event) {
61928 d3_event.stopPropagation();
61929 d3_event.preventDefault();
61930 if (_body.classed("hide")) {
61937 function updatePosition() {
61938 var wrap2 = _wrap.node();
61939 var inspector = _inspector.node();
61940 var wRect = wrap2.getBoundingClientRect();
61941 var iRect = inspector.getBoundingClientRect();
61942 _body.style("top", wRect.top + inspector.scrollTop - iRect.top + "px");
61944 fieldHelp.body = function(selection2) {
61945 _wrap = selection2.selectAll(".form-field-input-wrap");
61948 _inspector = context.container().select(".sidebar .entity-editor-pane .inspector-body");
61949 if (_inspector.empty())
61951 _body = _inspector.selectAll(".field-help-body").data([0]);
61952 var enter = _body.enter().append("div").attr("class", "field-help-body hide");
61953 var titleEnter = enter.append("div").attr("class", "field-help-title cf");
61954 titleEnter.append("h2").attr("class", _mainLocalizer.textDirection() === "rtl" ? "fr" : "fl").call(_t.append("help.field." + fieldName + ".title"));
61955 titleEnter.append("button").attr("class", "fr close").attr("title", _t("icons.close")).on("click", function(d3_event) {
61956 d3_event.stopPropagation();
61957 d3_event.preventDefault();
61959 }).call(svgIcon("#iD-icon-close"));
61960 var navEnter = enter.append("div").attr("class", "field-help-nav cf");
61961 var titles = docs.map(function(d2) {
61964 navEnter.selectAll(".field-help-nav-item").data(titles).enter().append("div").attr("class", "field-help-nav-item").html(function(d2) {
61966 }).on("click", function(d3_event, d2) {
61967 d3_event.stopPropagation();
61968 d3_event.preventDefault();
61969 clickHelp(titles.indexOf(d2));
61971 enter.append("div").attr("class", "field-help-content");
61972 _body = _body.merge(enter);
61978 // modules/ui/fields/check.js
61979 function uiFieldCheck(field, context) {
61980 var dispatch14 = dispatch_default("change");
61981 var options2 = field.options;
61985 var input = select_default2(null);
61986 var text2 = select_default2(null);
61987 var label = select_default2(null);
61988 var reverser = select_default2(null);
61990 var _entityIDs = [];
61992 var stringsField = field.resolveReference("stringsCrossReference");
61993 if (!options2 && stringsField.options) {
61994 options2 = stringsField.options;
61997 for (var i3 in options2) {
61998 var v2 = options2[i3];
61999 values.push(v2 === "undefined" ? void 0 : v2);
62000 texts.push(stringsField.t.html("options." + v2, { "default": v2 }));
62003 values = [void 0, "yes"];
62004 texts = [_t.html("inspector.unknown"), _t.html("inspector.check.yes")];
62005 if (field.type !== "defaultCheck") {
62007 texts.push(_t.html("inspector.check.no"));
62010 function checkImpliedYes() {
62011 _impliedYes = field.id === "oneway_yes";
62012 if (field.id === "oneway") {
62013 var entity = context.entity(_entityIDs[0]);
62014 for (var key in entity.tags) {
62015 if (key in osmOneWayTags && entity.tags[key] in osmOneWayTags[key]) {
62016 _impliedYes = true;
62017 texts[0] = _t.html("_tagging.presets.fields.oneway_yes.options.undefined");
62023 function reverserHidden() {
62024 if (!context.container().select("div.inspector-hover").empty())
62026 return !(_value === "yes" || _impliedYes && !_value);
62028 function reverserSetText(selection2) {
62029 var entity = _entityIDs.length && context.hasEntity(_entityIDs[0]);
62030 if (reverserHidden() || !entity)
62032 var first = entity.first();
62033 var last = entity.isClosed() ? entity.nodes[entity.nodes.length - 2] : entity.last();
62034 var pseudoDirection = first < last;
62035 var icon2 = pseudoDirection ? "#iD-icon-forward" : "#iD-icon-backward";
62036 selection2.selectAll(".reverser-span").html("").call(_t.append("inspector.check.reverser")).call(svgIcon(icon2, "inline"));
62039 var check = function(selection2) {
62041 label = selection2.selectAll(".form-field-input-wrap").data([0]);
62042 var enter = label.enter().append("label").attr("class", "form-field-input-wrap form-field-input-check");
62043 enter.append("input").property("indeterminate", field.type !== "defaultCheck").attr("type", "checkbox").attr("id", field.domId);
62044 enter.append("span").html(texts[0]).attr("class", "value");
62045 if (field.type === "onewayCheck") {
62046 enter.append("button").attr("class", "reverser" + (reverserHidden() ? " hide" : "")).append("span").attr("class", "reverser-span");
62048 label = label.merge(enter);
62049 input = label.selectAll("input");
62050 text2 = label.selectAll("span.value");
62051 input.on("click", function(d3_event) {
62052 d3_event.stopPropagation();
62054 if (Array.isArray(_tags[field.key])) {
62055 if (values.indexOf("yes") !== -1) {
62056 t2[field.key] = "yes";
62058 t2[field.key] = values[0];
62061 t2[field.key] = values[(values.indexOf(_value) + 1) % values.length];
62063 if (t2[field.key] === "reversible" || t2[field.key] === "alternating") {
62064 t2[field.key] = values[0];
62066 dispatch14.call("change", this, t2);
62068 if (field.type === "onewayCheck") {
62069 reverser = label.selectAll(".reverser");
62070 reverser.call(reverserSetText).on("click", function(d3_event) {
62071 d3_event.preventDefault();
62072 d3_event.stopPropagation();
62075 for (var i4 in _entityIDs) {
62076 graph = actionReverse(_entityIDs[i4])(graph);
62080 _t("operations.reverse.annotation.line", { n: 1 })
62082 context.validator().validate();
62083 select_default2(this).call(reverserSetText);
62087 check.entityIDs = function(val) {
62088 if (!arguments.length)
62093 check.tags = function(tags) {
62095 function isChecked(val) {
62096 return val !== "no" && val !== "" && val !== void 0 && val !== null;
62098 function textFor(val) {
62101 var index = values.indexOf(val);
62102 return index !== -1 ? texts[index] : '"' + val + '"';
62105 var isMixed = Array.isArray(tags[field.key]);
62106 _value = !isMixed && tags[field.key] && tags[field.key].toLowerCase();
62107 if (field.type === "onewayCheck" && (_value === "1" || _value === "-1")) {
62110 input.property("indeterminate", isMixed || field.type !== "defaultCheck" && !_value).property("checked", isChecked(_value));
62111 text2.html(isMixed ? _t.html("inspector.multiple_values") : textFor(_value)).classed("mixed", isMixed);
62112 label.classed("set", !!_value);
62113 if (field.type === "onewayCheck") {
62114 reverser.classed("hide", reverserHidden()).call(reverserSetText);
62117 check.focus = function() {
62118 input.node().focus();
62120 return utilRebind(check, dispatch14, "on");
62123 // modules/ui/length_indicator.js
62124 function uiLengthIndicator(maxChars) {
62125 var _wrap = select_default2(null);
62126 var _tooltip = uiPopover("tooltip max-length-warning").placement("bottom").hasArrow(true).content(() => (selection2) => {
62127 selection2.text("");
62128 selection2.call(svgIcon("#iD-icon-alert", "inline"));
62129 selection2.call(_t.append("inspector.max_length_reached", { maxChars }));
62131 var _silent = false;
62132 var lengthIndicator = function(selection2) {
62133 _wrap = selection2.selectAll("span.length-indicator-wrap").data([0]);
62134 _wrap = _wrap.enter().append("span").merge(_wrap).classed("length-indicator-wrap", true);
62135 selection2.call(_tooltip);
62137 lengthIndicator.update = function(val) {
62138 const strLen = utilUnicodeCharsCount(utilCleanOsmString(val, Number.POSITIVE_INFINITY));
62139 let indicator = _wrap.selectAll("span.length-indicator").data([strLen]);
62140 indicator.enter().append("span").merge(indicator).classed("length-indicator", true).classed("limit-reached", (d2) => d2 > maxChars).style("border-right-width", (d2) => `${Math.abs(maxChars - d2) * 2}px`).style("margin-right", (d2) => d2 > maxChars ? `${(maxChars - d2) * 2}px` : 0).style("opacity", (d2) => d2 > maxChars * 0.8 ? Math.min(1, (d2 / maxChars - 0.8) / (1 - 0.8)) : 0).style("pointer-events", (d2) => d2 > maxChars * 0.8 ? null : "none");
62143 if (strLen > maxChars) {
62149 lengthIndicator.silent = function(val) {
62150 if (!arguments.length)
62153 return lengthIndicator;
62155 return lengthIndicator;
62158 // modules/ui/fields/combo.js
62159 function uiFieldCombo(field, context) {
62160 var dispatch14 = dispatch_default("change");
62161 var _isMulti = field.type === "multiCombo" || field.type === "manyCombo";
62162 var _isNetwork = field.type === "networkCombo";
62163 var _isSemi = field.type === "semiCombo";
62164 var _showTagInfoSuggestions = field.type !== "manyCombo" && field.autoSuggestions !== false;
62165 var _allowCustomValues = field.type !== "manyCombo" && field.customValues !== false;
62166 var _snake_case = field.snake_case || field.snake_case === void 0;
62167 var _combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(field.caseSensitive).minItems(1);
62168 var _container = select_default2(null);
62169 var _inputWrap = select_default2(null);
62170 var _input = select_default2(null);
62171 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
62172 var _comboData = [];
62173 var _multiData = [];
62174 var _entityIDs = [];
62177 var _staticPlaceholder;
62178 var _dataDeprecated = [];
62179 _mainFileFetcher.get("deprecated").then(function(d2) {
62180 _dataDeprecated = d2;
62181 }).catch(function() {
62183 if (_isMulti && field.key && /[^:]$/.test(field.key)) {
62186 function snake(s2) {
62187 return s2.replace(/\s+/g, "_");
62189 function clean2(s2) {
62190 return s2.split(";").map(function(s3) {
62194 function tagValue(dval) {
62195 dval = clean2(dval || "");
62196 var found = getOptions(true).find(function(o2) {
62197 return o2.key && clean2(o2.value) === dval;
62201 if (field.type === "typeCombo" && !dval) {
62204 return restrictTagValueSpelling(dval) || void 0;
62206 function restrictTagValueSpelling(dval) {
62208 dval = snake(dval);
62210 if (!field.caseSensitive) {
62211 dval = dval.toLowerCase();
62215 function getLabelId(field2, v2) {
62216 return field2.hasTextForStringId(`options.${v2}.title`) ? `options.${v2}.title` : `options.${v2}`;
62218 function displayValue(tval) {
62220 var stringsField = field.resolveReference("stringsCrossReference");
62221 const labelId = getLabelId(stringsField, tval);
62222 if (stringsField.hasTextForStringId(labelId)) {
62223 return stringsField.t(labelId, { default: tval });
62225 if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
62230 function renderValue(tval) {
62232 var stringsField = field.resolveReference("stringsCrossReference");
62233 const labelId = getLabelId(stringsField, tval);
62234 if (stringsField.hasTextForStringId(labelId)) {
62235 return stringsField.t.append(labelId, { default: tval });
62237 if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
62240 return (selection2) => selection2.text(tval);
62242 function objectDifference(a2, b2) {
62243 return a2.filter(function(d1) {
62244 return !b2.some(function(d2) {
62245 return d1.value === d2.value;
62249 function initCombo(selection2, attachTo) {
62250 if (!_allowCustomValues) {
62251 selection2.attr("readonly", "readonly");
62253 if (_showTagInfoSuggestions && services.taginfo) {
62254 selection2.call(_combobox.fetcher(setTaginfoValues), attachTo);
62255 setTaginfoValues("", setPlaceholder);
62257 selection2.call(_combobox, attachTo);
62258 setTimeout(() => setStaticValues(setPlaceholder), 0);
62261 function getOptions(allOptions) {
62262 var stringsField = field.resolveReference("stringsCrossReference");
62263 if (!(field.options || stringsField.options))
62266 if (allOptions !== true) {
62267 options2 = field.options || stringsField.options;
62269 options2 = [].concat(field.options, stringsField.options).filter(Boolean);
62271 return options2.map(function(v2) {
62272 const labelId = getLabelId(stringsField, v2);
62275 value: stringsField.t(labelId, { default: v2 }),
62276 title: stringsField.t(`options.${v2}.description`, { default: v2 }),
62277 display: addComboboxIcons(stringsField.t.append(labelId, { default: v2 }), v2),
62278 klass: stringsField.hasTextForStringId(labelId) ? "" : "raw-option"
62282 function setStaticValues(callback, filter2) {
62283 _comboData = getOptions();
62284 if (filter2 !== void 0) {
62285 _comboData = _comboData.filter(filter2);
62287 _comboData = objectDifference(_comboData, _multiData);
62288 _combobox.data(_comboData);
62290 callback(_comboData);
62292 function setTaginfoValues(q2, callback) {
62293 var queryFilter = (d2) => d2.value.toLowerCase().includes(q2.toLowerCase()) || d2.key.toLowerCase().includes(q2.toLowerCase());
62294 setStaticValues(callback, queryFilter);
62295 var stringsField = field.resolveReference("stringsCrossReference");
62296 var fn = _isMulti ? "multikeys" : "values";
62297 var query = (_isMulti ? field.key : "") + q2;
62298 var hasCountryPrefix = _isNetwork && _countryCode && _countryCode.indexOf(q2.toLowerCase()) === 0;
62299 if (hasCountryPrefix) {
62300 query = _countryCode + ":";
62303 debounce: q2 !== "",
62307 if (_entityIDs.length) {
62308 params.geometry = context.graph().geometry(_entityIDs[0]);
62310 services.taginfo[fn](params, function(err, data) {
62313 data = data.filter((d2) => field.type !== "typeCombo" || d2.value !== "yes");
62314 data = data.filter((d2) => {
62315 var value = d2.value;
62317 value = value.slice(field.key.length);
62319 return value === restrictTagValueSpelling(value);
62321 var deprecatedValues = osmEntity.deprecatedTagValuesByKey(_dataDeprecated)[field.key];
62322 if (deprecatedValues) {
62323 data = data.filter((d2) => !deprecatedValues.includes(d2.value));
62325 if (hasCountryPrefix) {
62326 data = data.filter((d2) => d2.value.toLowerCase().indexOf(_countryCode + ":") === 0);
62328 const additionalOptions = (field.options || stringsField.options || []).filter((v2) => !data.some((dv) => dv.value === (_isMulti ? field.key + v2 : v2))).map((v2) => ({ value: v2 }));
62329 _container.classed("empty-combobox", data.length === 0);
62330 _comboData = data.concat(additionalOptions).map(function(d2) {
62333 v2 = v2.replace(field.key, "");
62334 const labelId = getLabelId(stringsField, v2);
62335 var isLocalizable = stringsField.hasTextForStringId(labelId);
62336 var label = stringsField.t(labelId, { default: v2 });
62340 title: stringsField.t(`options.${v2}.description`, { default: isLocalizable ? v2 : d2.title !== label ? d2.title : "" }),
62341 display: addComboboxIcons(stringsField.t.append(labelId, { default: v2 }), v2),
62342 klass: isLocalizable ? "" : "raw-option"
62345 _comboData = _comboData.filter(queryFilter);
62346 _comboData = objectDifference(_comboData, _multiData);
62348 callback(_comboData);
62351 function addComboboxIcons(disp, value) {
62352 const iconsField = field.resolveReference("iconsCrossReference");
62353 if (iconsField.icons) {
62354 return function(selection2) {
62355 var span = selection2.insert("span", ":first-child").attr("class", "tag-value-icon");
62356 if (iconsField.icons[value]) {
62357 span.call(svgIcon(`#${iconsField.icons[value]}`));
62359 disp.call(this, selection2);
62364 function setPlaceholder(values) {
62365 if (_isMulti || _isSemi) {
62366 _staticPlaceholder = field.placeholder() || _t("inspector.add");
62368 var vals = values.map(function(d2) {
62370 }).filter(function(s2) {
62371 return s2.length < 20;
62373 var placeholders = vals.length > 1 ? vals : values.map(function(d2) {
62376 _staticPlaceholder = field.placeholder() || placeholders.slice(0, 3).join(", ");
62378 if (!/(…|\.\.\.)$/.test(_staticPlaceholder)) {
62379 _staticPlaceholder += "\u2026";
62382 if (!_isMulti && !_isSemi && _tags && Array.isArray(_tags[field.key])) {
62383 ph = _t("inspector.multiple_values");
62385 ph = _staticPlaceholder;
62387 _container.selectAll("input").attr("placeholder", ph);
62388 var hideAdd = !_allowCustomValues && !values.length;
62389 _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
62391 function change() {
62394 if (_isMulti || _isSemi) {
62397 vals = [tagValue(utilGetSetValue(_input))];
62398 } else if (_isSemi) {
62399 val = tagValue(utilGetSetValue(_input)) || "";
62400 val = val.replace(/,/g, ";");
62401 vals = val.split(";");
62403 vals = vals.filter(Boolean);
62406 _container.classed("active", false);
62407 utilGetSetValue(_input, "");
62409 utilArrayUniq(vals).forEach(function(v2) {
62410 var key = (field.key || "") + v2;
62412 var old = _tags[key];
62413 if (typeof old === "string" && old.toLowerCase() !== "no")
62416 key = context.cleanTagKey(key);
62417 field.keys.push(key);
62420 } else if (_isSemi) {
62421 var arr = _multiData.map(function(d2) {
62424 arr = arr.concat(vals);
62425 t2[field.key] = context.cleanTagValue(utilArrayUniq(arr).filter(Boolean).join(";"));
62427 window.setTimeout(function() {
62428 _input.node().focus();
62431 var rawValue = utilGetSetValue(_input);
62432 if (!rawValue && Array.isArray(_tags[field.key]))
62434 val = context.cleanTagValue(tagValue(rawValue));
62435 t2[field.key] = val || void 0;
62437 dispatch14.call("change", this, t2);
62439 function removeMultikey(d3_event, d2) {
62440 d3_event.preventDefault();
62441 d3_event.stopPropagation();
62444 t2[d2.key] = void 0;
62445 } else if (_isSemi) {
62446 var arr = _multiData.map(function(md) {
62447 return md.key === d2.key ? null : md.key;
62448 }).filter(Boolean);
62449 arr = utilArrayUniq(arr);
62450 t2[field.key] = arr.length ? arr.join(";") : void 0;
62451 _lengthIndicator.update(t2[field.key]);
62453 dispatch14.call("change", this, t2);
62455 function invertMultikey(d3_event, d2) {
62456 d3_event.preventDefault();
62457 d3_event.stopPropagation();
62460 t2[d2.key] = _tags[d2.key] === "yes" ? "no" : "yes";
62462 dispatch14.call("change", this, t2);
62464 function combo(selection2) {
62465 _container = selection2.selectAll(".form-field-input-wrap").data([0]);
62466 var type2 = _isMulti || _isSemi ? "multicombo" : "combo";
62467 _container = _container.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + type2).merge(_container);
62468 if (_isMulti || _isSemi) {
62469 _container = _container.selectAll(".chiplist").data([0]);
62470 var listClass = "chiplist";
62471 if (field.key === "destination" || field.key === "via") {
62472 listClass += " full-line-chips";
62474 _container = _container.enter().append("ul").attr("class", listClass).on("click", function() {
62475 window.setTimeout(function() {
62476 _input.node().focus();
62478 }).merge(_container);
62479 _inputWrap = _container.selectAll(".input-wrap").data([0]);
62480 _inputWrap = _inputWrap.enter().append("li").attr("class", "input-wrap").merge(_inputWrap);
62481 var hideAdd = !_allowCustomValues && !_comboData.length;
62482 _inputWrap.style("display", hideAdd ? "none" : null);
62483 _input = _inputWrap.selectAll("input").data([0]);
62485 _input = _container.selectAll("input").data([0]);
62487 _input = _input.enter().append("input").attr("type", "text").attr("id", field.domId).call(utilNoAuto).call(initCombo, _container).merge(_input);
62489 _inputWrap.call(_lengthIndicator);
62490 } else if (!_isMulti) {
62491 _container.call(_lengthIndicator);
62494 var extent = combinedEntityExtent();
62495 var countryCode = extent && iso1A2Code(extent.center());
62496 _countryCode = countryCode && countryCode.toLowerCase();
62498 _input.on("change", change).on("blur", change).on("input", function() {
62499 let val = utilGetSetValue(_input);
62501 if (_isSemi && _tags[field.key]) {
62502 val += ";" + _tags[field.key];
62504 _lengthIndicator.update(val);
62506 _input.on("keydown.field", function(d3_event) {
62507 switch (d3_event.keyCode) {
62509 _input.node().blur();
62510 d3_event.stopPropagation();
62514 if (_isMulti || _isSemi) {
62515 _combobox.on("accept", function() {
62516 _input.node().blur();
62517 _input.node().focus();
62519 _input.on("focus", function() {
62520 _container.classed("active", true);
62523 _combobox.on("cancel", function() {
62524 _input.node().blur();
62525 }).on("update", function() {
62526 updateIcon(utilGetSetValue(_input));
62529 function updateIcon(value) {
62530 value = tagValue(value);
62531 let container = _container;
62532 if (field.type === "multiCombo" || field.type === "semiCombo") {
62533 container = _container.select(".input-wrap");
62535 const iconsField = field.resolveReference("iconsCrossReference");
62536 if (iconsField.icons) {
62537 container.selectAll(".tag-value-icon").remove();
62538 if (iconsField.icons[value]) {
62539 container.selectAll(".tag-value-icon").data([value]).enter().insert("div", "input").attr("class", "tag-value-icon").call(svgIcon(`#${iconsField.icons[value]}`));
62543 combo.tags = function(tags) {
62545 var stringsField = field.resolveReference("stringsCrossReference");
62546 var isMixed = Array.isArray(tags[field.key]);
62547 var showsValue = (value) => !isMixed && value && !(field.type === "typeCombo" && value === "yes");
62548 var isRawValue = (value) => showsValue(value) && !stringsField.hasTextForStringId(`options.${value}`) && !stringsField.hasTextForStringId(`options.${value}.title`);
62549 var isKnownValue = (value) => showsValue(value) && !isRawValue(value);
62550 var isReadOnly = !_allowCustomValues;
62551 if (_isMulti || _isSemi) {
62555 for (var k2 in tags) {
62556 if (field.key && k2.indexOf(field.key) !== 0)
62558 if (!field.key && field.keys.indexOf(k2) === -1)
62561 var suffix = field.key ? k2.slice(field.key.length) : k2;
62564 value: displayValue(suffix),
62565 display: addComboboxIcons(renderValue(suffix), suffix),
62566 state: typeof v2 === "string" ? v2.toLowerCase() : "",
62567 isMixed: Array.isArray(v2)
62571 field.keys = _multiData.map(function(d2) {
62574 maxLength = context.maxCharsForTagKey() - utilUnicodeCharsCount(field.key);
62576 maxLength = context.maxCharsForTagKey();
62578 } else if (_isSemi) {
62579 var allValues = [];
62581 if (Array.isArray(tags[field.key])) {
62582 tags[field.key].forEach(function(tagVal) {
62583 var thisVals = utilArrayUniq((tagVal || "").split(";")).filter(Boolean);
62584 allValues = allValues.concat(thisVals);
62585 if (!commonValues) {
62586 commonValues = thisVals;
62588 commonValues = commonValues.filter((value) => thisVals.includes(value));
62591 allValues = utilArrayUniq(allValues).filter(Boolean);
62593 allValues = utilArrayUniq((tags[field.key] || "").split(";")).filter(Boolean);
62594 commonValues = allValues;
62596 _multiData = allValues.map(function(v3) {
62599 value: displayValue(v3),
62600 display: addComboboxIcons(renderValue(v3), v3),
62601 isMixed: !commonValues.includes(v3)
62604 var currLength = utilUnicodeCharsCount(commonValues.join(";"));
62605 maxLength = context.maxCharsForTagValue() - currLength;
62606 if (currLength > 0) {
62610 maxLength = Math.max(0, maxLength);
62611 var hideAdd = maxLength <= 0 || !_allowCustomValues && !_comboData.length;
62612 _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
62613 var allowDragAndDrop = _isSemi && !Array.isArray(tags[field.key]);
62614 var chips = _container.selectAll(".chip").data(_multiData);
62615 chips.exit().remove();
62616 var enter = chips.enter().insert("li", ".input-wrap").attr("class", "chip");
62617 enter.append("span");
62619 chips = chips.merge(enter).order().classed("raw-value", function(d2) {
62622 k3 = k3.replace(field.key, "");
62623 return !stringsField.hasTextForStringId("options." + k3);
62624 }).classed("draggable", allowDragAndDrop).classed("mixed", function(d2) {
62626 }).attr("title", function(d2) {
62628 return _t("inspector.unshared_value_tooltip");
62630 if (!["yes", "no"].includes(d2.state)) {
62634 }).classed("negated", (d2) => d2.state === "no");
62636 chips.selectAll("input[type=checkbox]").remove();
62637 chips.insert("input", "span").attr("type", "checkbox").property("checked", (d2) => d2.state === "yes").property("indeterminate", (d2) => d2.isMixed || !["yes", "no"].includes(d2.state)).on("click", invertMultikey);
62639 if (allowDragAndDrop) {
62640 registerDragAndDrop(chips);
62642 chips.select("span").each(function(d2) {
62643 const selection2 = select_default2(this);
62645 selection2.text("");
62646 d2.display(selection2);
62648 selection2.text(d2.value);
62651 chips.select("a").attr("href", "#").on("click", removeMultikey).attr("class", "remove").text("\xD7");
62654 var mixedValues = isMixed && tags[field.key].map(function(val) {
62655 return displayValue(val);
62656 }).filter(Boolean);
62657 utilGetSetValue(_input, !isMixed ? displayValue(tags[field.key]) : "").data([tags[field.key]]).classed("raw-value", isRawValue).classed("known-value", isKnownValue).attr("readonly", isReadOnly ? "readonly" : void 0).attr("title", isMixed ? mixedValues.join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : _staticPlaceholder || "").classed("mixed", isMixed).on("keydown.deleteCapture", function(d3_event) {
62658 if (isReadOnly && isKnownValue(tags[field.key]) && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
62659 d3_event.preventDefault();
62660 d3_event.stopPropagation();
62662 t2[field.key] = void 0;
62663 dispatch14.call("change", this, t2);
62666 if (!Array.isArray(tags[field.key])) {
62667 updateIcon(tags[field.key]);
62670 _lengthIndicator.update(tags[field.key]);
62673 const refreshStyles = () => {
62674 _input.data([tagValue(utilGetSetValue(_input))]).classed("raw-value", isRawValue).classed("known-value", isKnownValue);
62676 _input.on("input.refreshStyles", refreshStyles);
62677 _combobox.on("update.refreshStyles", refreshStyles);
62680 function registerDragAndDrop(selection2) {
62681 var dragOrigin, targetIndex;
62683 drag_default().on("start", function(d3_event) {
62688 targetIndex = null;
62689 }).on("drag", function(d3_event) {
62690 var x2 = d3_event.x - dragOrigin.x, y2 = d3_event.y - dragOrigin.y;
62691 if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
62692 Math.sqrt(Math.pow(x2, 2) + Math.pow(y2, 2)) <= 5)
62694 var index = selection2.nodes().indexOf(this);
62695 select_default2(this).classed("dragging", true);
62696 targetIndex = null;
62697 var targetIndexOffsetTop = null;
62698 var draggedTagWidth = select_default2(this).node().offsetWidth;
62699 if (field.key === "destination" || field.key === "via") {
62700 _container.selectAll(".chip").style("transform", function(d2, index2) {
62701 var node = select_default2(this).node();
62702 if (index === index2) {
62703 return "translate(" + x2 + "px, " + y2 + "px)";
62704 } else if (index2 > index && d3_event.y > node.offsetTop) {
62705 if (targetIndex === null || index2 > targetIndex) {
62706 targetIndex = index2;
62708 return "translateY(-100%)";
62709 } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
62710 if (targetIndex === null || index2 < targetIndex) {
62711 targetIndex = index2;
62713 return "translateY(100%)";
62718 _container.selectAll(".chip").each(function(d2, index2) {
62719 var node = select_default2(this).node();
62720 if (index !== index2 && d3_event.x < node.offsetLeft + node.offsetWidth + 5 && d3_event.x > node.offsetLeft && d3_event.y < node.offsetTop + node.offsetHeight && d3_event.y > node.offsetTop) {
62721 targetIndex = index2;
62722 targetIndexOffsetTop = node.offsetTop;
62724 }).style("transform", function(d2, index2) {
62725 var node = select_default2(this).node();
62726 if (index === index2) {
62727 return "translate(" + x2 + "px, " + y2 + "px)";
62729 if (node.offsetTop === targetIndexOffsetTop) {
62730 if (index2 < index && index2 >= targetIndex) {
62731 return "translateX(" + draggedTagWidth + "px)";
62732 } else if (index2 > index && index2 <= targetIndex) {
62733 return "translateX(-" + draggedTagWidth + "px)";
62739 }).on("end", function() {
62740 if (!select_default2(this).classed("dragging")) {
62743 var index = selection2.nodes().indexOf(this);
62744 select_default2(this).classed("dragging", false);
62745 _container.selectAll(".chip").style("transform", null);
62746 if (typeof targetIndex === "number") {
62747 var element = _multiData[index];
62748 _multiData.splice(index, 1);
62749 _multiData.splice(targetIndex, 0, element);
62751 if (_multiData.length) {
62752 t2[field.key] = _multiData.map(function(element2) {
62753 return element2.key;
62756 t2[field.key] = void 0;
62758 dispatch14.call("change", this, t2);
62760 dragOrigin = void 0;
62761 targetIndex = void 0;
62765 combo.focus = function() {
62766 _input.node().focus();
62768 combo.entityIDs = function(val) {
62769 if (!arguments.length)
62774 function combinedEntityExtent() {
62775 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
62777 return utilRebind(combo, dispatch14, "on");
62780 // modules/ui/fields/input.js
62781 var likelyRawNumberFormat = /^-?(0\.\d*|\d*\.\d{0,2}(\d{4,})?|\d{4,}\.\d{3})$/;
62782 function uiFieldText(field, context) {
62783 var dispatch14 = dispatch_default("change");
62784 var input = select_default2(null);
62785 var outlinkButton = select_default2(null);
62786 var wrap2 = select_default2(null);
62787 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
62788 var _entityIDs = [];
62790 var _phoneFormats = {};
62791 const isDirectionField = field.key.split(":").some((keyPart) => keyPart === "direction");
62792 const formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
62793 const parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
62794 const countDecimalPlaces = _mainLocalizer.decimalPlaceCounter(_mainLocalizer.languageCode());
62795 if (field.type === "tel") {
62796 _mainFileFetcher.get("phone_formats").then(function(d2) {
62797 _phoneFormats = d2;
62798 updatePhonePlaceholder();
62799 }).catch(function() {
62802 function calcLocked() {
62803 var isLocked = (field.id === "brand" || field.id === "network" || field.id === "operator" || field.id === "flag") && _entityIDs.length && _entityIDs.some(function(entityID) {
62804 var entity = context.graph().hasEntity(entityID);
62807 if (entity.tags.wikidata)
62809 var preset = _mainPresetIndex.match(entity, context.graph());
62810 var isSuggestion = preset && preset.suggestion;
62811 var which = field.id;
62812 return isSuggestion && !!entity.tags[which] && !!entity.tags[which + ":wikidata"];
62814 field.locked(isLocked);
62816 function i3(selection2) {
62818 var isLocked = field.locked();
62819 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
62820 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
62821 input = wrap2.selectAll("input").data([0]);
62822 input = input.enter().append("input").attr("type", field.type === "identifier" ? "text" : field.type).attr("id", field.domId).classed(field.type, true).call(utilNoAuto).merge(input);
62823 input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
62824 wrap2.call(_lengthIndicator);
62825 if (field.type === "tel") {
62826 updatePhonePlaceholder();
62827 } else if (field.type === "number") {
62828 var rtl = _mainLocalizer.textDirection() === "rtl";
62829 input.attr("type", "text");
62830 var inc = field.increment;
62831 var buttons = wrap2.selectAll(".increment, .decrement").data(rtl ? [inc, -inc] : [-inc, inc]);
62832 buttons.enter().append("button").attr("class", function(d2) {
62833 var which = d2 > 0 ? "increment" : "decrement";
62834 return "form-field-button " + which;
62835 }).attr("title", function(d2) {
62836 var which = d2 > 0 ? "increment" : "decrement";
62837 return _t(`inspector.${which}`);
62838 }).merge(buttons).on("click", function(d3_event, d2) {
62839 d3_event.preventDefault();
62840 var isMixed = Array.isArray(_tags[field.key]);
62843 var raw_vals = input.node().value || "0";
62844 var vals = raw_vals.split(";");
62845 vals = vals.map(function(v2) {
62847 const isRawNumber = likelyRawNumberFormat.test(v2);
62848 var num = isRawNumber ? parseFloat(v2) : parseLocaleFloat(v2);
62849 if (isDirectionField) {
62850 const compassDir = cardinal[v2.toLowerCase()];
62851 if (compassDir !== void 0) {
62855 if (!isFinite(num))
62857 num = parseFloat(num);
62858 if (!isFinite(num))
62861 if (isDirectionField) {
62862 num = (num % 360 + 360) % 360;
62864 return formatFloat(clamped(num), isRawNumber ? v2.includes(".") ? v2.split(".")[1].length : 0 : countDecimalPlaces(v2));
62866 input.node().value = vals.join(";");
62869 } else if (field.type === "identifier" && field.urlFormat && field.pattern) {
62870 input.attr("type", "text");
62871 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
62872 outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", function() {
62873 var domainResults = /^https?:\/\/(.{1,}?)\//.exec(field.urlFormat);
62874 if (domainResults.length >= 2 && domainResults[1]) {
62875 var domain2 = domainResults[1];
62876 return _t("icons.view_on", { domain: domain2 });
62879 }).on("click", function(d3_event) {
62880 d3_event.preventDefault();
62881 var value = validIdentifierValueForLink();
62883 var url = field.urlFormat.replace(/{value}/, encodeURIComponent(value));
62884 window.open(url, "_blank");
62886 }).classed("disabled", () => !validIdentifierValueForLink()).merge(outlinkButton);
62887 } else if (field.type === "url") {
62888 input.attr("type", "text");
62889 outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
62890 outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", () => _t("icons.visit_website")).on("click", function(d3_event) {
62891 d3_event.preventDefault();
62892 const value = validIdentifierValueForLink();
62894 window.open(value, "_blank");
62895 }).merge(outlinkButton);
62896 } else if (field.type === "colour") {
62897 input.attr("type", "text");
62898 updateColourPreview();
62899 } else if (field.type === "date") {
62900 input.attr("type", "text");
62904 function updateColourPreview() {
62905 function isColourValid(colour2) {
62906 if (!colour2.match(/^(#([0-9a-fA-F]{3}){1,2}|\w+)$/)) {
62908 } else if (!CSS.supports("color", colour2) || ["unset", "inherit", "initial", "revert"].includes(colour2)) {
62913 wrap2.selectAll(".colour-preview").remove();
62914 const colour = utilGetSetValue(input);
62915 if (!isColourValid(colour) && colour !== "") {
62916 wrap2.selectAll("input.colour-selector").remove();
62917 wrap2.selectAll(".form-field-button").remove();
62920 var colourSelector = wrap2.selectAll(".colour-selector").data([0]);
62921 colourSelector.enter().append("input").attr("type", "color").attr("class", "colour-selector").on("input", debounce_default(function(d3_event) {
62922 d3_event.preventDefault();
62923 var colour2 = this.value;
62924 if (!isColourValid(colour2))
62926 utilGetSetValue(input, this.value);
62928 updateColourPreview();
62930 wrap2.selectAll("input.colour-selector").attr("value", colour);
62931 var chooserButton = wrap2.selectAll(".colour-preview").data([colour]);
62932 chooserButton = chooserButton.enter().append("div").attr("class", "form-field-button colour-preview").append("div").style("background-color", (d2) => d2).attr("class", "colour-box");
62933 if (colour === "") {
62934 chooserButton = chooserButton.call(svgIcon("#iD-icon-edit"));
62936 chooserButton.on("click", () => wrap2.select(".colour-selector").node().showPicker());
62938 function updateDateField() {
62939 function isDateValid(date2) {
62940 return date2.match(/^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$/);
62942 const date = utilGetSetValue(input);
62943 const now3 = /* @__PURE__ */ new Date();
62944 const today = new Date(now3.getTime() - now3.getTimezoneOffset() * 6e4).toISOString().split("T")[0];
62945 if ((field.key === "check_date" || field.key === "survey:date") && date !== today) {
62946 wrap2.selectAll(".date-set-today").data([0]).enter().append("button").attr("class", "form-field-button date-set-today").call(svgIcon("#fas-rotate")).call(uiTooltip().title(() => _t.append("inspector.set_today"))).on("click", () => {
62947 utilGetSetValue(input, today);
62952 wrap2.selectAll(".date-set-today").remove();
62954 if (!isDateValid(date) && date !== "") {
62955 wrap2.selectAll("input.date-selector").remove();
62956 wrap2.selectAll(".date-calendar").remove();
62959 if (utilDetect().browser !== "Safari") {
62960 var dateSelector = wrap2.selectAll(".date-selector").data([0]);
62961 dateSelector.enter().append("input").attr("type", "date").attr("class", "date-selector").on("input", debounce_default(function(d3_event) {
62962 d3_event.preventDefault();
62963 var date2 = this.value;
62964 if (!isDateValid(date2))
62966 utilGetSetValue(input, this.value);
62970 wrap2.selectAll("input.date-selector").attr("value", date);
62971 var calendarButton = wrap2.selectAll(".date-calendar").data([date]);
62972 calendarButton = calendarButton.enter().append("button").attr("class", "form-field-button date-calendar").call(svgIcon("#fas-calendar-days"));
62973 calendarButton.on("click", () => wrap2.select(".date-selector").node().showPicker());
62976 function updatePhonePlaceholder() {
62977 if (input.empty() || !Object.keys(_phoneFormats).length)
62979 var extent = combinedEntityExtent();
62980 var countryCode = extent && iso1A2Code(extent.center());
62981 var format2 = countryCode && _phoneFormats[countryCode.toLowerCase()];
62983 input.attr("placeholder", format2);
62985 function validIdentifierValueForLink() {
62986 const value = utilGetSetValue(input).trim();
62987 if (field.type === "url" && value) {
62989 return new URL(value).href;
62994 if (field.type === "identifier" && field.pattern) {
62995 return value && value.match(new RegExp(field.pattern))?.[0];
62999 function clamped(num) {
63000 if (field.minValue !== void 0) {
63001 num = Math.max(num, field.minValue);
63003 if (field.maxValue !== void 0) {
63004 num = Math.min(num, field.maxValue);
63008 function getVals(tags) {
63010 const multiSelection = context.selectedIDs();
63011 tags = multiSelection.length > 1 ? context.selectedIDs().map((id2) => context.graph().entity(id2)).map((entity) => entity.tags) : [tags];
63012 return tags.map((tags2) => new Set(field.keys.reduce((acc, key) => acc.concat(tags2[key]), []).filter(Boolean))).map((vals) => vals.size === 0 ? /* @__PURE__ */ new Set([void 0]) : vals).reduce((a2, b2) => /* @__PURE__ */ new Set([...a2, ...b2]));
63014 return new Set([].concat(tags[field.key]));
63017 function change(onInput) {
63018 return function() {
63020 var val = utilGetSetValue(input);
63022 val = context.cleanTagValue(val);
63023 if (!val && getVals(_tags).size > 1)
63025 var displayVal = val;
63026 if (field.type === "number" && val) {
63027 var numbers2 = val.split(";");
63028 numbers2 = numbers2.map(function(v2) {
63029 if (likelyRawNumberFormat.test(v2)) {
63032 var num = parseLocaleFloat(v2);
63033 const fractionDigits = countDecimalPlaces(v2);
63034 return isFinite(num) ? clamped(num).toFixed(fractionDigits) : v2;
63036 val = numbers2.join(";");
63039 utilGetSetValue(input, displayVal);
63040 t2[field.key] = val || void 0;
63042 dispatch14.call("change", this, (tags) => {
63043 if (field.keys.some((key) => tags[key])) {
63044 field.keys.filter((key) => tags[key]).forEach((key) => {
63045 tags[key] = val || void 0;
63048 tags[field.key] = val || void 0;
63053 dispatch14.call("change", this, t2, onInput);
63057 i3.entityIDs = function(val) {
63058 if (!arguments.length)
63063 i3.tags = function(tags) {
63065 const vals = getVals(tags);
63066 const isMixed = vals.size > 1;
63067 var val = vals.size === 1 ? [...vals][0] ?? "" : "";
63069 if (field.type === "number" && val) {
63070 var numbers2 = val.split(";");
63071 var oriNumbers = utilGetSetValue(input).split(";");
63072 if (numbers2.length !== oriNumbers.length)
63073 shouldUpdate = true;
63074 numbers2 = numbers2.map(function(v2) {
63076 var num = Number(v2);
63077 if (!isFinite(num) || v2 === "")
63079 const fractionDigits = v2.includes(".") ? v2.split(".")[1].length : 0;
63080 return formatFloat(num, fractionDigits);
63082 val = numbers2.join(";");
63083 shouldUpdate = (inputValue, setValue) => {
63084 const inputNums = inputValue.split(";").map(
63085 (setVal) => likelyRawNumberFormat.test(setVal) ? parseFloat(setVal) : parseLocaleFloat(setVal)
63087 const setNums = setValue.split(";").map(parseLocaleFloat);
63088 return !isEqual_default(inputNums, setNums);
63091 utilGetSetValue(input, val, shouldUpdate).attr("title", isMixed ? [...vals].join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder() || _t("inspector.unknown")).classed("mixed", isMixed);
63092 if (field.type === "number") {
63093 const buttons = wrap2.selectAll(".increment, .decrement");
63095 buttons.attr("disabled", "disabled").classed("disabled", true);
63097 var raw_vals = tags[field.key] || "0";
63098 const canIncDec = raw_vals.split(";").some((val2) => isFinite(Number(val2)) || isDirectionField && cardinal[val2.trim().toLowerCase()]);
63099 buttons.attr("disabled", canIncDec ? null : "disabled").classed("disabled", !canIncDec);
63102 if (field.type === "tel")
63103 updatePhonePlaceholder();
63104 if (field.type === "colour")
63105 updateColourPreview();
63106 if (field.type === "date")
63108 if (outlinkButton && !outlinkButton.empty()) {
63109 var disabled = !validIdentifierValueForLink();
63110 outlinkButton.classed("disabled", disabled);
63113 _lengthIndicator.update(tags[field.key]);
63116 i3.focus = function() {
63117 var node = input.node();
63121 function combinedEntityExtent() {
63122 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
63124 return utilRebind(i3, dispatch14, "on");
63127 // modules/ui/fields/access.js
63128 function uiFieldAccess(field, context) {
63129 var dispatch14 = dispatch_default("change");
63130 var items = select_default2(null);
63132 function access(selection2) {
63133 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63134 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63135 var list = wrap2.selectAll("ul").data([0]);
63136 list = list.enter().append("ul").attr("class", "rows").merge(list);
63137 items = list.selectAll("li").data(field.keys);
63138 var enter = items.enter().append("li").attr("class", function(d2) {
63139 return "labeled-input preset-access-" + d2;
63141 enter.append("span").attr("class", "label preset-label-access").attr("for", function(d2) {
63142 return "preset-input-access-" + d2;
63143 }).html(function(d2) {
63144 return field.t.html("types." + d2);
63146 enter.append("div").attr("class", "preset-input-access-wrap").append("input").attr("type", "text").attr("class", function(d2) {
63147 return "preset-input-access preset-input-access-" + d2;
63148 }).call(utilNoAuto).each(function(d2) {
63149 select_default2(this).call(
63150 uiCombobox(context, "access-" + d2).data(access.options(d2))
63153 items = items.merge(enter);
63154 wrap2.selectAll(".preset-input-access").on("change", change).on("blur", change);
63156 function change(d3_event, d2) {
63158 var value = context.cleanTagValue(utilGetSetValue(select_default2(this)));
63159 if (!value && typeof _tags[d2] !== "string")
63161 tag[d2] = value || void 0;
63162 dispatch14.call("change", this, tag);
63164 access.options = function(type2) {
63176 if (type2 === "access") {
63177 options2 = options2.filter((v2) => v2 !== "yes" && v2 !== "designated");
63179 if (type2 === "bicycle") {
63180 options2.splice(options2.length - 4, 0, "dismount");
63182 var stringsField = field.resolveReference("stringsCrossReference");
63183 return options2.map(function(option) {
63185 title: stringsField.t("options." + option + ".description"),
63190 const placeholdersByTag = {
63193 foot: "designated",
63194 motor_vehicle: "no"
63198 motor_vehicle: "no",
63204 motor_vehicle: "no"
63207 motor_vehicle: "no",
63208 bicycle: "designated"
63211 motor_vehicle: "no",
63212 horse: "designated"
63216 motor_vehicle: "no",
63222 motor_vehicle: "yes",
63227 motor_vehicle: "yes"
63231 motor_vehicle: "yes",
63237 motor_vehicle: "yes",
63243 motor_vehicle: "yes",
63249 motor_vehicle: "yes",
63255 motor_vehicle: "yes",
63261 motor_vehicle: "yes",
63267 motor_vehicle: "yes",
63272 motor_vehicle: "yes"
63276 motor_vehicle: "yes",
63282 motor_vehicle: "yes",
63288 motor_vehicle: "yes",
63303 motor_vehicle: "no",
63315 motor_vehicle: "no"
63332 motorcycle_barrier: {
63333 motor_vehicle: "no"
63340 access.tags = function(tags) {
63342 utilGetSetValue(items.selectAll(".preset-input-access"), function(d2) {
63343 return typeof tags[d2] === "string" ? tags[d2] : "";
63344 }).classed("mixed", function(d2) {
63345 return tags[d2] && Array.isArray(tags[d2]);
63346 }).attr("title", function(d2) {
63347 return tags[d2] && Array.isArray(tags[d2]) && tags[d2].filter(Boolean).join("\n");
63348 }).attr("placeholder", function(d2) {
63349 if (tags[d2] && Array.isArray(tags[d2])) {
63350 return _t("inspector.multiple_values");
63352 if (d2 === "bicycle" || d2 === "motor_vehicle") {
63353 if (tags.vehicle && typeof tags.vehicle === "string") {
63354 return tags.vehicle;
63357 if (tags.access && typeof tags.access === "string") {
63358 return tags.access;
63360 function getPlaceholdersByTag(key, placeholdersByKey) {
63361 if (typeof tags[key] === "string") {
63362 if (placeholdersByKey[tags[key]] && placeholdersByKey[tags[key]][d2]) {
63363 return placeholdersByKey[tags[key]][d2];
63366 var impliedAccesses = tags[key].filter(Boolean).map(function(val) {
63367 return placeholdersByKey[val] && placeholdersByKey[val][d2];
63368 }).filter(Boolean);
63369 if (impliedAccesses.length === tags[key].length && new Set(impliedAccesses).size === 1) {
63370 return impliedAccesses[0];
63374 for (const key in placeholdersByTag) {
63376 const impliedAccess = getPlaceholdersByTag(key, placeholdersByTag[key]);
63377 if (impliedAccess) {
63378 return impliedAccess;
63382 if (d2 === "access" && !tags.barrier) {
63385 return field.placeholder();
63388 access.focus = function() {
63389 items.selectAll(".preset-input-access").node().focus();
63391 return utilRebind(access, dispatch14, "on");
63394 // modules/ui/fields/address.js
63395 function uiFieldAddress(field, context) {
63396 var dispatch14 = dispatch_default("change");
63397 var _selection = select_default2(null);
63398 var _wrap = select_default2(null);
63399 var addrField = _mainPresetIndex.field("address");
63400 var _entityIDs = [];
63403 var _addressFormats = [{
63405 ["housenumber", "street"],
63406 ["city", "postcode"]
63409 _mainFileFetcher.get("address_formats").then(function(d2) {
63410 _addressFormats = d2;
63411 if (!_selection.empty()) {
63412 _selection.call(address);
63414 }).catch(function() {
63416 function getNear(isAddressable, type2, searchRadius, resultProp) {
63417 var extent = combinedEntityExtent();
63418 var l2 = extent.center();
63419 var box = geoExtent(l2).padByMeters(searchRadius);
63420 var features = context.history().intersects(box).filter(isAddressable).map((d2) => {
63421 let dist = geoSphericalDistance(d2.extent(context.graph()).center(), l2);
63422 if (d2.geometry(context.graph()) === "line") {
63423 var loc = context.projection([
63424 (extent[0][0] + extent[1][0]) / 2,
63425 (extent[0][1] + extent[1][1]) / 2
63427 var choice = geoChooseEdge(context.graph().childNodes(d2), loc, context.projection);
63428 dist = geoSphericalDistance(choice.loc, l2);
63430 const value = resultProp && d2.tags[resultProp] ? d2.tags[resultProp] : d2.tags.name;
63432 if (type2 === "street") {
63433 title = `${addrField.t("placeholders.street")}: ${title}`;
63434 } else if (type2 === "place") {
63435 title = `${addrField.t("placeholders.place")}: ${title}`;
63442 klass: `address-${type2}`
63444 }).sort(function(a2, b2) {
63445 return a2.dist - b2.dist;
63447 return utilArrayUniqBy(features, "value");
63449 function getNearStreets() {
63450 function isAddressable(d2) {
63451 return d2.tags.highway && d2.tags.name && d2.type === "way";
63453 return getNear(isAddressable, "street", 200);
63455 function getNearPlaces() {
63456 function isAddressable(d2) {
63457 if (d2.tags.name) {
63460 if (d2.tags.boundary === "administrative" && d2.tags.admin_level > 8)
63465 return getNear(isAddressable, "place", 200);
63467 function getNearCities() {
63468 function isAddressable(d2) {
63469 if (d2.tags.name) {
63470 if (d2.tags.boundary === "administrative" && d2.tags.admin_level === "8")
63472 if (d2.tags.border_type === "city")
63474 if (d2.tags.place === "city" || d2.tags.place === "town" || d2.tags.place === "village")
63477 if (d2.tags[`${field.key}:city`])
63481 return getNear(isAddressable, "city", 200, `${field.key}:city`);
63483 function getNearPostcodes() {
63484 return [...new Set([].concat(getNearValues("postcode")).concat(getNear((d2) => d2.tags.postal_code, "postcode", 200, "postal_code")))];
63486 function getNearValues(key) {
63487 const tagKey = `${field.key}:${key}`;
63488 function hasTag(d2) {
63489 return _entityIDs.indexOf(d2.id) === -1 && d2.tags[tagKey];
63491 return getNear(hasTag, key, 200, tagKey);
63493 function updateForCountryCode() {
63497 for (var i3 = 0; i3 < _addressFormats.length; i3++) {
63498 var format2 = _addressFormats[i3];
63499 if (!format2.countryCodes) {
63500 addressFormat = format2;
63501 } else if (format2.countryCodes.indexOf(_countryCode) !== -1) {
63502 addressFormat = format2;
63506 var dropdowns = addressFormat.dropdowns || [
63523 var widths = addressFormat.widths || {
63524 housenumber: 1 / 5,
63533 var total = r2.reduce(function(sum, key) {
63534 return sum + (widths[key] || 0.5);
63536 return r2.map(function(key) {
63539 width: (widths[key] || 0.5) / total
63543 var rows = _wrap.selectAll(".addr-row").data(addressFormat.format, function(d2) {
63544 return d2.toString();
63546 rows.exit().remove();
63547 rows.enter().append("div").attr("class", "addr-row").selectAll("input").data(row).enter().append("input").property("type", "text").call(updatePlaceholder).attr("class", function(d2) {
63548 return "addr-" + d2.id;
63549 }).call(utilNoAuto).each(addDropdown).style("width", function(d2) {
63550 return d2.width * 100 + "%";
63552 function addDropdown(d2) {
63553 if (dropdowns.indexOf(d2.id) === -1)
63558 nearValues = getNearStreets;
63561 nearValues = getNearPlaces;
63563 case "street+place":
63564 nearValues = () => [].concat(getNearStreets()).concat(getNearPlaces());
63565 d2.isAutoStreetPlace = true;
63566 d2.id = _tags[`${field.key}:place`] ? "place" : "street";
63569 nearValues = getNearCities;
63572 nearValues = getNearPostcodes;
63575 nearValues = getNearValues;
63577 select_default2(this).call(
63578 uiCombobox(context, `address-${d2.isAutoStreetPlace ? "street-place" : d2.id}`).minItems(1).caseSensitive(true).fetcher(function(typedValue, callback) {
63579 typedValue = typedValue.toLowerCase();
63580 callback(nearValues(d2.id).filter((v2) => v2.value.toLowerCase().indexOf(typedValue) !== -1));
63581 }).on("accept", function(selected) {
63582 if (d2.isAutoStreetPlace) {
63583 d2.id = selected ? selected.type : "street";
63588 _wrap.selectAll("input").on("blur", change()).on("change", change());
63589 _wrap.selectAll("input:not(.combobox-input)").on("input", change(true));
63593 function address(selection2) {
63594 _selection = selection2;
63595 _wrap = selection2.selectAll(".form-field-input-wrap").data([0]);
63596 _wrap = _wrap.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(_wrap);
63597 var extent = combinedEntityExtent();
63600 if (context.inIntro()) {
63601 countryCode = _t("intro.graph.countrycode");
63603 var center = extent.center();
63604 countryCode = iso1A2Code(center);
63607 _countryCode = countryCode.toLowerCase();
63608 updateForCountryCode();
63612 function change(onInput) {
63613 return function() {
63616 _wrap.selectAll("input").each(function(subfield) {
63617 var key = field.key + ":" + subfield.id;
63618 var value = this.value;
63620 value = context.cleanTagValue(value);
63621 if (Array.isArray(_tags[key]) && !value)
63623 if (subfield.isAutoStreetPlace) {
63624 if (subfield.id === "street") {
63625 tags[`${field.key}:place`] = void 0;
63626 } else if (subfield.id === "place") {
63627 tags[`${field.key}:street`] = void 0;
63630 tags[key] = value || void 0;
63632 Object.keys(tags).filter((k2) => tags[k2]).forEach((k2) => _tags[k2] = tags[k2]);
63633 dispatch14.call("change", this, tags, onInput);
63637 function updatePlaceholder(inputSelection) {
63638 return inputSelection.attr("placeholder", function(subfield) {
63639 if (_tags && Array.isArray(_tags[field.key + ":" + subfield.id])) {
63640 return _t("inspector.multiple_values");
63642 if (subfield.isAutoStreetPlace) {
63643 return `${getLocalPlaceholder("street")} / ${getLocalPlaceholder("place")}`;
63645 return getLocalPlaceholder(subfield.id);
63648 function getLocalPlaceholder(key) {
63649 if (_countryCode) {
63650 var localkey = key + "!" + _countryCode;
63651 var tkey = addrField.hasTextForStringId("placeholders." + localkey) ? localkey : key;
63652 return addrField.t("placeholders." + tkey);
63655 function updateTags(tags) {
63656 utilGetSetValue(_wrap.selectAll("input"), (subfield) => {
63658 if (subfield.isAutoStreetPlace) {
63659 const streetKey = `${field.key}:street`;
63660 const placeKey = `${field.key}:place`;
63661 if (tags[streetKey] !== void 0 || tags[placeKey] === void 0) {
63662 val = tags[streetKey];
63663 subfield.id = "street";
63665 val = tags[placeKey];
63666 subfield.id = "place";
63669 val = tags[`${field.key}:${subfield.id}`];
63671 return typeof val === "string" ? val : "";
63672 }).attr("title", function(subfield) {
63673 var val = tags[field.key + ":" + subfield.id];
63674 return val && Array.isArray(val) ? val.filter(Boolean).join("\n") : void 0;
63675 }).classed("mixed", function(subfield) {
63676 return Array.isArray(tags[field.key + ":" + subfield.id]);
63677 }).call(updatePlaceholder);
63679 function combinedEntityExtent() {
63680 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
63682 address.entityIDs = function(val) {
63683 if (!arguments.length)
63688 address.tags = function(tags) {
63692 address.focus = function() {
63693 var node = _wrap.selectAll("input").node();
63697 return utilRebind(address, dispatch14, "on");
63700 // modules/ui/fields/directional_combo.js
63701 function uiFieldDirectionalCombo(field, context) {
63702 var dispatch14 = dispatch_default("change");
63703 var items = select_default2(null);
63704 var wrap2 = select_default2(null);
63707 if (field.type === "cycleway") {
63710 key: field.keys[0],
63711 keys: field.keys.slice(1)
63714 function directionalCombo(selection2) {
63715 function stripcolon(s2) {
63716 return s2.replace(":", "");
63718 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63719 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63720 var div = wrap2.selectAll("ul").data([0]);
63721 div = div.enter().append("ul").attr("class", "rows").merge(div);
63722 items = div.selectAll("li").data(field.keys);
63723 var enter = items.enter().append("li").attr("class", function(d2) {
63724 return "labeled-input preset-directionalcombo-" + stripcolon(d2);
63726 enter.append("span").attr("class", "label preset-label-directionalcombo").attr("for", function(d2) {
63727 return "preset-input-directionalcombo-" + stripcolon(d2);
63728 }).html(function(d2) {
63729 return field.t.html("types." + d2);
63731 enter.append("div").attr("class", "preset-input-directionalcombo-wrap form-field-input-wrap").each(function(key) {
63737 const combo = uiFieldCombo(subField, context);
63738 combo.on("change", (t2) => change(key, t2[key]));
63739 _combos[key] = combo;
63740 select_default2(this).call(combo);
63742 items = items.merge(enter);
63743 wrap2.selectAll(".preset-input-directionalcombo").on("change", change).on("blur", change);
63745 function change(key, newValue) {
63746 const commonKey = field.key;
63747 const otherKey = key === field.keys[0] ? field.keys[1] : field.keys[0];
63748 dispatch14.call("change", this, (tags) => {
63749 const otherValue = tags[otherKey] || tags[commonKey];
63750 if (newValue === otherValue) {
63751 tags[commonKey] = newValue;
63753 delete tags[otherKey];
63755 tags[key] = newValue;
63756 delete tags[commonKey];
63757 tags[otherKey] = otherValue;
63762 directionalCombo.tags = function(tags) {
63764 const commonKey = field.key;
63765 for (let key in _combos) {
63766 const uniqueValues = [...new Set([].concat(_tags[commonKey]).concat(_tags[key]).filter(Boolean))];
63767 _combos[key].tags({ [key]: uniqueValues.length > 1 ? uniqueValues : uniqueValues[0] });
63770 directionalCombo.focus = function() {
63771 var node = wrap2.selectAll("input").node();
63775 return utilRebind(directionalCombo, dispatch14, "on");
63778 // modules/ui/fields/lanes.js
63779 function uiFieldLanes(field, context) {
63780 var dispatch14 = dispatch_default("change");
63781 var LANE_WIDTH = 40;
63782 var LANE_HEIGHT = 200;
63783 var _entityIDs = [];
63784 function lanes(selection2) {
63785 var lanesData = context.entity(_entityIDs[0]).lanes();
63786 if (!context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode) {
63787 selection2.call(lanes.off);
63790 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63791 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63792 var surface = wrap2.selectAll(".surface").data([0]);
63793 var d2 = utilGetDimensions(wrap2);
63794 var freeSpace = d2[0] - lanesData.lanes.length * LANE_WIDTH * 1.5 + LANE_WIDTH * 0.5;
63795 surface = surface.enter().append("svg").attr("width", d2[0]).attr("height", 300).attr("class", "surface").merge(surface);
63796 var lanesSelection = surface.selectAll(".lanes").data([0]);
63797 lanesSelection = lanesSelection.enter().append("g").attr("class", "lanes").merge(lanesSelection);
63798 lanesSelection.attr("transform", function() {
63799 return "translate(" + freeSpace / 2 + ", 0)";
63801 var lane = lanesSelection.selectAll(".lane").data(lanesData.lanes);
63802 lane.exit().remove();
63803 var enter = lane.enter().append("g").attr("class", "lane");
63804 enter.append("g").append("rect").attr("y", 50).attr("width", LANE_WIDTH).attr("height", LANE_HEIGHT);
63805 enter.append("g").attr("class", "forward").append("text").attr("y", 40).attr("x", 14).text("\u25B2");
63806 enter.append("g").attr("class", "bothways").append("text").attr("y", 40).attr("x", 14).text("\u25B2\u25BC");
63807 enter.append("g").attr("class", "backward").append("text").attr("y", 40).attr("x", 14).text("\u25BC");
63808 lane = lane.merge(enter);
63809 lane.attr("transform", function(d4) {
63810 return "translate(" + LANE_WIDTH * d4.index * 1.5 + ", 0)";
63812 lane.select(".forward").style("visibility", function(d4) {
63813 return d4.direction === "forward" ? "visible" : "hidden";
63815 lane.select(".bothways").style("visibility", function(d4) {
63816 return d4.direction === "bothways" ? "visible" : "hidden";
63818 lane.select(".backward").style("visibility", function(d4) {
63819 return d4.direction === "backward" ? "visible" : "hidden";
63822 lanes.entityIDs = function(val) {
63825 lanes.tags = function() {
63827 lanes.focus = function() {
63829 lanes.off = function() {
63831 return utilRebind(lanes, dispatch14, "on");
63833 uiFieldLanes.supportsMultiselection = false;
63835 // modules/ui/fields/localized.js
63836 var _languagesArray = [];
63837 function uiFieldLocalized(field, context) {
63838 var dispatch14 = dispatch_default("change", "input");
63839 var wikipedia = services.wikipedia;
63840 var input = select_default2(null);
63841 var localizedInputs = select_default2(null);
63842 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
63845 _mainFileFetcher.get("languages").then(loadLanguagesArray).catch(function() {
63847 var _territoryLanguages = {};
63848 _mainFileFetcher.get("territory_languages").then(function(d2) {
63849 _territoryLanguages = d2;
63850 }).catch(function() {
63852 var langCombo = uiCombobox(context, "localized-lang").fetcher(fetchLanguages).minItems(0);
63853 var _selection = select_default2(null);
63854 var _multilingual = [];
63855 var _buttonTip = uiTooltip().title(() => _t.append("translate.translate")).placement("left");
63857 var _entityIDs = [];
63858 function loadLanguagesArray(dataLanguages) {
63859 if (_languagesArray.length !== 0)
63861 var replacements = {
63863 // in OSM, `sr` implies Cyrillic
63865 // `sr-Cyrl` isn't used in OSM
63867 for (var code in dataLanguages) {
63868 if (replacements[code] === false)
63870 var metaCode = code;
63871 if (replacements[code])
63872 metaCode = replacements[code];
63873 _languagesArray.push({
63874 localName: _mainLocalizer.languageName(metaCode, { localOnly: true }),
63875 nativeName: dataLanguages[metaCode].nativeName,
63877 label: _mainLocalizer.languageName(metaCode)
63881 function calcLocked() {
63882 var isLocked = field.id === "name" && _entityIDs.length && _entityIDs.some(function(entityID) {
63883 var entity = context.graph().hasEntity(entityID);
63886 if (entity.tags.wikidata)
63888 if (entity.tags["name:etymology:wikidata"])
63890 var preset = _mainPresetIndex.match(entity, context.graph());
63892 var isSuggestion = preset.suggestion;
63893 var fields = preset.fields(entity.extent(context.graph()).center());
63894 var showsBrandField = fields.some(function(d2) {
63895 return d2.id === "brand";
63897 var showsOperatorField = fields.some(function(d2) {
63898 return d2.id === "operator";
63900 var setsName = preset.addTags.name;
63901 var setsBrandWikidata = preset.addTags["brand:wikidata"];
63902 var setsOperatorWikidata = preset.addTags["operator:wikidata"];
63903 return isSuggestion && setsName && (setsBrandWikidata && !showsBrandField || setsOperatorWikidata && !showsOperatorField);
63907 field.locked(isLocked);
63909 function calcMultilingual(tags) {
63910 var existingLangsOrdered = _multilingual.map(function(item2) {
63913 var existingLangs = new Set(existingLangsOrdered.filter(Boolean));
63914 for (var k2 in tags) {
63915 var m2 = k2.match(/^(.*):([a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?)$/);
63916 if (m2 && m2[1] === field.key && m2[2]) {
63917 var item = { lang: m2[2], value: tags[k2] };
63918 if (existingLangs.has(item.lang)) {
63919 _multilingual[existingLangsOrdered.indexOf(item.lang)].value = item.value;
63920 existingLangs.delete(item.lang);
63922 _multilingual.push(item);
63926 _multilingual.forEach(function(item2) {
63927 if (item2.lang && existingLangs.has(item2.lang)) {
63932 function localized(selection2) {
63933 _selection = selection2;
63935 var isLocked = field.locked();
63936 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
63937 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
63938 input = wrap2.selectAll(".localized-main").data([0]);
63939 input = input.enter().append("input").attr("type", "text").attr("id", field.domId).attr("class", "localized-main").call(utilNoAuto).merge(input);
63940 input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
63941 wrap2.call(_lengthIndicator);
63942 var translateButton = wrap2.selectAll(".localized-add").data([0]);
63943 translateButton = translateButton.enter().append("button").attr("class", "localized-add form-field-button").attr("aria-label", _t("icons.plus")).call(svgIcon("#iD-icon-plus")).merge(translateButton);
63944 translateButton.classed("disabled", !!isLocked).call(isLocked ? _buttonTip.destroy : _buttonTip).on("click", addNew);
63945 if (_tags && !_multilingual.length) {
63946 calcMultilingual(_tags);
63948 localizedInputs = selection2.selectAll(".localized-multilingual").data([0]);
63949 localizedInputs = localizedInputs.enter().append("div").attr("class", "localized-multilingual").merge(localizedInputs);
63950 localizedInputs.call(renderMultilingual);
63951 localizedInputs.selectAll("button, input").classed("disabled", !!isLocked).attr("readonly", isLocked || null);
63952 selection2.selectAll(".combobox-caret").classed("nope", true);
63953 function addNew(d3_event) {
63954 d3_event.preventDefault();
63955 if (field.locked())
63957 var defaultLang = _mainLocalizer.languageCode().toLowerCase();
63958 var langExists = _multilingual.find(function(datum2) {
63959 return datum2.lang === defaultLang;
63961 var isLangEn = defaultLang.indexOf("en") > -1;
63962 if (isLangEn || langExists) {
63964 langExists = _multilingual.find(function(datum2) {
63965 return datum2.lang === defaultLang;
63969 _multilingual.unshift({ lang: defaultLang, value: "" });
63970 localizedInputs.call(renderMultilingual);
63973 function change(onInput) {
63974 return function(d3_event) {
63975 if (field.locked()) {
63976 d3_event.preventDefault();
63979 var val = utilGetSetValue(select_default2(this));
63981 val = context.cleanTagValue(val);
63982 if (!val && Array.isArray(_tags[field.key]))
63985 t2[field.key] = val || void 0;
63986 dispatch14.call("change", this, t2, onInput);
63990 function key(lang) {
63991 return field.key + ":" + lang;
63993 function changeLang(d3_event, d2) {
63995 var lang = utilGetSetValue(select_default2(this)).toLowerCase();
63996 var language = _languagesArray.find(function(d4) {
63997 return d4.label.toLowerCase() === lang || d4.localName && d4.localName.toLowerCase() === lang || d4.nativeName && d4.nativeName.toLowerCase() === lang;
64000 lang = language.code;
64001 if (d2.lang && d2.lang !== lang) {
64002 tags[key(d2.lang)] = void 0;
64004 var newKey = lang && context.cleanTagKey(key(lang));
64005 var value = utilGetSetValue(select_default2(this.parentNode).selectAll(".localized-value"));
64006 if (newKey && value) {
64007 tags[newKey] = value;
64008 } else if (newKey && _wikiTitles && _wikiTitles[d2.lang]) {
64009 tags[newKey] = _wikiTitles[d2.lang];
64012 dispatch14.call("change", this, tags);
64014 function changeValue(d3_event, d2) {
64017 var value = context.cleanTagValue(utilGetSetValue(select_default2(this))) || void 0;
64018 if (!value && Array.isArray(d2.value))
64021 t2[key(d2.lang)] = value;
64023 dispatch14.call("change", this, t2);
64025 function fetchLanguages(value, cb) {
64026 var v2 = value.toLowerCase();
64027 var langCodes = [_mainLocalizer.localeCode(), _mainLocalizer.languageCode()];
64028 if (_countryCode && _territoryLanguages[_countryCode]) {
64029 langCodes = langCodes.concat(_territoryLanguages[_countryCode]);
64031 var langItems = [];
64032 langCodes.forEach(function(code) {
64033 var langItem = _languagesArray.find(function(item) {
64034 return item.code === code;
64037 langItems.push(langItem);
64039 langItems = utilArrayUniq(langItems.concat(_languagesArray));
64040 cb(langItems.filter(function(d2) {
64041 return d2.label.toLowerCase().indexOf(v2) >= 0 || d2.localName && d2.localName.toLowerCase().indexOf(v2) >= 0 || d2.nativeName && d2.nativeName.toLowerCase().indexOf(v2) >= 0 || d2.code.toLowerCase().indexOf(v2) >= 0;
64042 }).map(function(d2) {
64043 return { value: d2.label };
64046 function renderMultilingual(selection2) {
64047 var entries = selection2.selectAll("div.entry").data(_multilingual, function(d2) {
64050 entries.exit().style("top", "0").style("max-height", "240px").transition().duration(200).style("opacity", "0").style("max-height", "0px").remove();
64051 var entriesEnter = entries.enter().append("div").attr("class", "entry").each(function(_2, index) {
64052 var wrap2 = select_default2(this);
64053 var domId = utilUniqueDomId(index);
64054 var label = wrap2.append("label").attr("class", "field-label").attr("for", domId);
64055 var text2 = label.append("span").attr("class", "label-text");
64056 text2.append("span").attr("class", "label-textvalue").call(_t.append("translate.localized_translation_label"));
64057 text2.append("span").attr("class", "label-textannotation");
64058 label.append("button").attr("class", "remove-icon-multilingual").attr("title", _t("icons.remove")).on("click", function(d3_event, d2) {
64059 if (field.locked())
64061 d3_event.preventDefault();
64062 _multilingual.splice(_multilingual.indexOf(d2), 1);
64063 var langKey = d2.lang && key(d2.lang);
64064 if (langKey && langKey in _tags) {
64065 delete _tags[langKey];
64067 t2[langKey] = void 0;
64068 dispatch14.call("change", this, t2);
64071 renderMultilingual(selection2);
64072 }).call(svgIcon("#iD-operation-delete"));
64073 wrap2.append("input").attr("class", "localized-lang").attr("id", domId).attr("type", "text").attr("placeholder", _t("translate.localized_translation_language")).on("blur", changeLang).on("change", changeLang).call(langCombo);
64074 wrap2.append("input").attr("type", "text").attr("class", "localized-value").on("blur", changeValue).on("change", changeValue);
64076 entriesEnter.style("margin-top", "0px").style("max-height", "0px").style("opacity", "0").transition().duration(200).style("margin-top", "10px").style("max-height", "240px").style("opacity", "1").on("end", function() {
64077 select_default2(this).style("max-height", "").style("overflow", "visible");
64079 entries = entries.merge(entriesEnter);
64081 entries.classed("present", true);
64082 utilGetSetValue(entries.select(".localized-lang"), function(d2) {
64083 var langItem = _languagesArray.find(function(item) {
64084 return item.code === d2.lang;
64087 return langItem.label;
64090 utilGetSetValue(entries.select(".localized-value"), function(d2) {
64091 return typeof d2.value === "string" ? d2.value : "";
64092 }).attr("title", function(d2) {
64093 return Array.isArray(d2.value) ? d2.value.filter(Boolean).join("\n") : null;
64094 }).attr("placeholder", function(d2) {
64095 return Array.isArray(d2.value) ? _t("inspector.multiple_values") : _t("translate.localized_translation_name");
64096 }).classed("mixed", function(d2) {
64097 return Array.isArray(d2.value);
64100 localized.tags = function(tags) {
64102 if (typeof tags.wikipedia === "string" && !_wikiTitles) {
64104 var wm = tags.wikipedia.match(/([^:]+):(.+)/);
64105 if (wm && wm[0] && wm[1]) {
64106 wikipedia.translations(wm[1], wm[2], function(err, d2) {
64113 var isMixed = Array.isArray(tags[field.key]);
64114 utilGetSetValue(input, typeof tags[field.key] === "string" ? tags[field.key] : "").attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder()).classed("mixed", isMixed);
64115 calcMultilingual(tags);
64116 _selection.call(localized);
64118 _lengthIndicator.update(tags[field.key]);
64121 localized.focus = function() {
64122 input.node().focus();
64124 localized.entityIDs = function(val) {
64125 if (!arguments.length)
64128 _multilingual = [];
64132 function loadCountryCode() {
64133 var extent = combinedEntityExtent();
64134 var countryCode = extent && iso1A2Code(extent.center());
64135 _countryCode = countryCode && countryCode.toLowerCase();
64137 function combinedEntityExtent() {
64138 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64140 return utilRebind(localized, dispatch14, "on");
64143 // modules/ui/fields/roadheight.js
64144 function uiFieldRoadheight(field, context) {
64145 var dispatch14 = dispatch_default("change");
64146 var primaryUnitInput = select_default2(null);
64147 var primaryInput = select_default2(null);
64148 var secondaryInput = select_default2(null);
64149 var secondaryUnitInput = select_default2(null);
64150 var _entityIDs = [];
64153 var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
64154 var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
64155 var primaryUnits = [
64158 title: _t("inspector.roadheight.meter")
64162 title: _t("inspector.roadheight.foot")
64165 var unitCombo = uiCombobox(context, "roadheight-unit").data(primaryUnits);
64166 function roadheight(selection2) {
64167 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64168 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64169 primaryInput = wrap2.selectAll("input.roadheight-number").data([0]);
64170 primaryInput = primaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-number").attr("id", field.domId).call(utilNoAuto).merge(primaryInput);
64171 primaryInput.on("change", change).on("blur", change);
64172 var loc = combinedEntityExtent().center();
64173 _isImperial = roadHeightUnit(loc) === "ft";
64174 primaryUnitInput = wrap2.selectAll("input.roadheight-unit").data([0]);
64175 primaryUnitInput = primaryUnitInput.enter().append("input").attr("type", "text").attr("class", "roadheight-unit").call(unitCombo).merge(primaryUnitInput);
64176 primaryUnitInput.on("blur", changeUnits).on("change", changeUnits);
64177 secondaryInput = wrap2.selectAll("input.roadheight-secondary-number").data([0]);
64178 secondaryInput = secondaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-secondary-number").call(utilNoAuto).merge(secondaryInput);
64179 secondaryInput.on("change", change).on("blur", change);
64180 secondaryUnitInput = wrap2.selectAll("input.roadheight-secondary-unit").data([0]);
64181 secondaryUnitInput = secondaryUnitInput.enter().append("input").attr("type", "text").call(utilNoAuto).classed("disabled", true).classed("roadheight-secondary-unit", true).attr("readonly", "readonly").merge(secondaryUnitInput);
64182 function changeUnits() {
64183 var primaryUnit = utilGetSetValue(primaryUnitInput);
64184 if (primaryUnit === "m") {
64185 _isImperial = false;
64186 } else if (primaryUnit === "ft") {
64187 _isImperial = true;
64189 utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
64190 setUnitSuggestions();
64194 function setUnitSuggestions() {
64195 utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
64197 function change() {
64199 var primaryValue = utilGetSetValue(primaryInput).trim();
64200 var secondaryValue = utilGetSetValue(secondaryInput).trim();
64201 if (!primaryValue && !secondaryValue && Array.isArray(_tags[field.key]))
64203 if (!primaryValue && !secondaryValue) {
64204 tag[field.key] = void 0;
64206 var rawPrimaryValue = likelyRawNumberFormat.test(primaryValue) ? parseFloat(primaryValue) : parseLocaleFloat(primaryValue);
64207 if (isNaN(rawPrimaryValue))
64208 rawPrimaryValue = primaryValue;
64209 var rawSecondaryValue = likelyRawNumberFormat.test(secondaryValue) ? parseFloat(secondaryValue) : parseLocaleFloat(secondaryValue);
64210 if (isNaN(rawSecondaryValue))
64211 rawSecondaryValue = secondaryValue;
64212 if (isNaN(rawPrimaryValue) || isNaN(rawSecondaryValue) || !_isImperial) {
64213 tag[field.key] = context.cleanTagValue(rawPrimaryValue);
64215 if (rawPrimaryValue !== "") {
64216 rawPrimaryValue = rawPrimaryValue + "'";
64218 if (rawSecondaryValue !== "") {
64219 rawSecondaryValue = rawSecondaryValue + '"';
64221 tag[field.key] = context.cleanTagValue(rawPrimaryValue + rawSecondaryValue);
64224 dispatch14.call("change", this, tag);
64226 roadheight.tags = function(tags) {
64228 var primaryValue = tags[field.key];
64229 var secondaryValue;
64230 var isMixed = Array.isArray(primaryValue);
64232 if (primaryValue && (primaryValue.indexOf("'") >= 0 || primaryValue.indexOf('"') >= 0)) {
64233 secondaryValue = primaryValue.match(/(-?[\d.]+)"/);
64234 if (secondaryValue !== null) {
64235 secondaryValue = formatFloat(parseFloat(secondaryValue[1]));
64237 primaryValue = primaryValue.match(/(-?[\d.]+)'/);
64238 if (primaryValue !== null) {
64239 primaryValue = formatFloat(parseFloat(primaryValue[1]));
64241 _isImperial = true;
64242 } else if (primaryValue) {
64243 var rawValue = primaryValue;
64244 primaryValue = parseFloat(rawValue);
64245 if (isNaN(primaryValue)) {
64246 primaryValue = rawValue;
64248 primaryValue = formatFloat(primaryValue);
64250 _isImperial = false;
64253 setUnitSuggestions();
64254 var inchesPlaceholder = formatFloat(0);
64255 utilGetSetValue(primaryInput, typeof primaryValue === "string" ? primaryValue : "").attr("title", isMixed ? primaryValue.filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : _t("inspector.unknown")).classed("mixed", isMixed);
64256 utilGetSetValue(secondaryInput, typeof secondaryValue === "string" ? secondaryValue : "").attr("placeholder", isMixed ? _t("inspector.multiple_values") : _isImperial ? inchesPlaceholder : null).classed("mixed", isMixed).classed("disabled", !_isImperial).attr("readonly", _isImperial ? null : "readonly");
64257 secondaryUnitInput.attr("value", _isImperial ? _t("inspector.roadheight.inch") : null);
64259 roadheight.focus = function() {
64260 primaryInput.node().focus();
64262 roadheight.entityIDs = function(val) {
64265 function combinedEntityExtent() {
64266 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64268 return utilRebind(roadheight, dispatch14, "on");
64271 // modules/ui/fields/roadspeed.js
64272 function uiFieldRoadspeed(field, context) {
64273 var dispatch14 = dispatch_default("change");
64274 var unitInput = select_default2(null);
64275 var input = select_default2(null);
64276 var _entityIDs = [];
64279 var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
64280 var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
64281 var speedCombo = uiCombobox(context, "roadspeed");
64282 var unitCombo = uiCombobox(context, "roadspeed-unit").data(["km/h", "mph"].map(comboValues));
64283 var metricValues = [20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120];
64284 var imperialValues = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80];
64285 function roadspeed(selection2) {
64286 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64287 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64288 input = wrap2.selectAll("input.roadspeed-number").data([0]);
64289 input = input.enter().append("input").attr("type", "text").attr("class", "roadspeed-number").attr("id", field.domId).call(utilNoAuto).call(speedCombo).merge(input);
64290 input.on("change", change).on("blur", change);
64291 var loc = combinedEntityExtent().center();
64292 _isImperial = roadSpeedUnit(loc) === "mph";
64293 unitInput = wrap2.selectAll("input.roadspeed-unit").data([0]);
64294 unitInput = unitInput.enter().append("input").attr("type", "text").attr("class", "roadspeed-unit").attr("aria-label", _t("inspector.speed_unit")).call(unitCombo).merge(unitInput);
64295 unitInput.on("blur", changeUnits).on("change", changeUnits);
64296 function changeUnits() {
64297 var unit2 = utilGetSetValue(unitInput);
64298 if (unit2 === "km/h") {
64299 _isImperial = false;
64300 } else if (unit2 === "mph") {
64301 _isImperial = true;
64303 utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
64304 setUnitSuggestions();
64308 function setUnitSuggestions() {
64309 speedCombo.data((_isImperial ? imperialValues : metricValues).map(comboValues));
64310 utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
64312 function comboValues(d2) {
64314 value: formatFloat(d2),
64315 title: formatFloat(d2)
64318 function change() {
64320 var value = utilGetSetValue(input).trim();
64321 if (!value && Array.isArray(_tags[field.key]))
64324 tag[field.key] = void 0;
64326 var rawValue = likelyRawNumberFormat.test(value) ? parseFloat(value) : parseLocaleFloat(value);
64327 if (isNaN(rawValue))
64329 if (isNaN(rawValue) || !_isImperial) {
64330 tag[field.key] = context.cleanTagValue(rawValue);
64332 tag[field.key] = context.cleanTagValue(rawValue + " mph");
64335 dispatch14.call("change", this, tag);
64337 roadspeed.tags = function(tags) {
64339 var rawValue = tags[field.key];
64340 var value = rawValue;
64341 var isMixed = Array.isArray(value);
64343 if (rawValue && rawValue.indexOf("mph") >= 0) {
64344 _isImperial = true;
64345 } else if (rawValue) {
64346 _isImperial = false;
64348 value = parseInt(value, 10);
64349 if (isNaN(value)) {
64352 value = formatFloat(value);
64355 setUnitSuggestions();
64356 utilGetSetValue(input, typeof value === "string" ? value : "").attr("title", isMixed ? value.filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder()).classed("mixed", isMixed);
64358 roadspeed.focus = function() {
64359 input.node().focus();
64361 roadspeed.entityIDs = function(val) {
64364 function combinedEntityExtent() {
64365 return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
64367 return utilRebind(roadspeed, dispatch14, "on");
64370 // modules/ui/fields/radio.js
64371 function uiFieldRadio(field, context) {
64372 var dispatch14 = dispatch_default("change");
64373 var placeholder = select_default2(null);
64374 var wrap2 = select_default2(null);
64375 var labels = select_default2(null);
64376 var radios = select_default2(null);
64377 var radioData = (field.options || field.keys).slice();
64381 var _entityIDs = [];
64382 function selectedKey() {
64383 var node = wrap2.selectAll(".form-field-input-radio label.active input");
64384 return !node.empty() && node.datum();
64386 function radio(selection2) {
64387 selection2.classed("preset-radio", true);
64388 wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64389 var enter = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-radio");
64390 enter.append("span").attr("class", "placeholder");
64391 wrap2 = wrap2.merge(enter);
64392 placeholder = wrap2.selectAll(".placeholder");
64393 labels = wrap2.selectAll("label").data(radioData);
64394 enter = labels.enter().append("label");
64395 var stringsField = field.resolveReference("stringsCrossReference");
64396 enter.append("input").attr("type", "radio").attr("name", field.id).attr("value", function(d2) {
64397 return stringsField.t("options." + d2, { "default": d2 });
64398 }).attr("checked", false);
64399 enter.append("span").each(function(d2) {
64400 stringsField.t.append("options." + d2, { "default": d2 })(select_default2(this));
64402 labels = labels.merge(enter);
64403 radios = labels.selectAll("input").on("change", changeRadio);
64405 function structureExtras(selection2, tags) {
64406 var selected = selectedKey() || tags.layer !== void 0;
64407 var type2 = _mainPresetIndex.field(selected);
64408 var layer = _mainPresetIndex.field("layer");
64409 var showLayer = selected === "bridge" || selected === "tunnel" || tags.layer !== void 0;
64410 var extrasWrap = selection2.selectAll(".structure-extras-wrap").data(selected ? [0] : []);
64411 extrasWrap.exit().remove();
64412 extrasWrap = extrasWrap.enter().append("div").attr("class", "structure-extras-wrap").merge(extrasWrap);
64413 var list = extrasWrap.selectAll("ul").data([0]);
64414 list = list.enter().append("ul").attr("class", "rows").merge(list);
64416 if (!typeField || typeField.id !== selected) {
64417 typeField = uiField(context, type2, _entityIDs, { wrap: false }).on("change", changeType);
64419 typeField.tags(tags);
64423 var typeItem = list.selectAll(".structure-type-item").data(typeField ? [typeField] : [], function(d2) {
64426 typeItem.exit().remove();
64427 var typeEnter = typeItem.enter().insert("li", ":first-child").attr("class", "labeled-input structure-type-item");
64428 typeEnter.append("span").attr("class", "label structure-label-type").attr("for", "preset-input-" + selected).call(_t.append("inspector.radio.structure.type"));
64429 typeEnter.append("div").attr("class", "structure-input-type-wrap");
64430 typeItem = typeItem.merge(typeEnter);
64432 typeItem.selectAll(".structure-input-type-wrap").call(typeField.render);
64434 if (layer && showLayer) {
64436 layerField = uiField(context, layer, _entityIDs, { wrap: false }).on("change", changeLayer);
64438 layerField.tags(tags);
64439 field.keys = utilArrayUnion(field.keys, ["layer"]);
64442 field.keys = field.keys.filter(function(k2) {
64443 return k2 !== "layer";
64446 var layerItem = list.selectAll(".structure-layer-item").data(layerField ? [layerField] : []);
64447 layerItem.exit().remove();
64448 var layerEnter = layerItem.enter().append("li").attr("class", "labeled-input structure-layer-item");
64449 layerEnter.append("span").attr("class", "label structure-label-layer").attr("for", "preset-input-layer").call(_t.append("inspector.radio.structure.layer"));
64450 layerEnter.append("div").attr("class", "structure-input-layer-wrap");
64451 layerItem = layerItem.merge(layerEnter);
64453 layerItem.selectAll(".structure-input-layer-wrap").call(layerField.render);
64456 function changeType(t2, onInput) {
64457 var key = selectedKey();
64461 if (val !== "no") {
64462 _oldType[key] = val;
64464 if (field.type === "structureRadio") {
64465 if (val === "no" || key !== "bridge" && key !== "tunnel" || key === "tunnel" && val === "building_passage") {
64468 if (t2.layer === void 0) {
64469 if (key === "bridge" && val !== "no") {
64472 if (key === "tunnel" && val !== "no" && val !== "building_passage") {
64477 dispatch14.call("change", this, t2, onInput);
64479 function changeLayer(t2, onInput) {
64480 if (t2.layer === "0") {
64483 dispatch14.call("change", this, t2, onInput);
64485 function changeRadio() {
64489 t2[field.key] = void 0;
64491 radios.each(function(d2) {
64492 var active = select_default2(this).property("checked");
64497 t2[field.key] = d2;
64499 var val = _oldType[activeKey] || "yes";
64500 t2[d2] = active ? val : void 0;
64503 if (field.type === "structureRadio") {
64504 if (activeKey === "bridge") {
64506 } else if (activeKey === "tunnel" && t2.tunnel !== "building_passage") {
64512 dispatch14.call("change", this, t2);
64514 radio.tags = function(tags) {
64515 function isOptionChecked(d2) {
64517 return tags[field.key] === d2;
64519 return !!(typeof tags[d2] === "string" && tags[d2].toLowerCase() !== "no");
64521 function isMixed(d2) {
64523 return Array.isArray(tags[field.key]) && tags[field.key].includes(d2);
64525 return Array.isArray(tags[d2]);
64527 radios.property("checked", function(d2) {
64528 return isOptionChecked(d2) && (field.key || field.options.filter(isOptionChecked).length === 1);
64530 labels.classed("active", function(d2) {
64532 return Array.isArray(tags[field.key]) && tags[field.key].includes(d2) || tags[field.key] === d2;
64534 return Array.isArray(tags[d2]) && tags[d2].some((v2) => typeof v2 === "string" && v2.toLowerCase() !== "no") || !!(typeof tags[d2] === "string" && tags[d2].toLowerCase() !== "no");
64535 }).classed("mixed", isMixed).attr("title", function(d2) {
64536 return isMixed(d2) ? _t("inspector.unshared_value_tooltip") : null;
64538 var selection2 = radios.filter(function() {
64539 return this.checked;
64541 if (selection2.empty()) {
64542 placeholder.text("");
64543 placeholder.call(_t.append("inspector.none"));
64545 placeholder.text(selection2.attr("value"));
64546 _oldType[selection2.datum()] = tags[selection2.datum()];
64548 if (field.type === "structureRadio") {
64549 if (!!tags.waterway && !_oldType.tunnel) {
64550 _oldType.tunnel = "culvert";
64552 wrap2.call(structureExtras, tags);
64555 radio.focus = function() {
64556 radios.node().focus();
64558 radio.entityIDs = function(val) {
64559 if (!arguments.length)
64565 radio.isAllowed = function() {
64566 return _entityIDs.length === 1;
64568 return utilRebind(radio, dispatch14, "on");
64571 // modules/ui/fields/restrictions.js
64572 function uiFieldRestrictions(field, context) {
64573 var dispatch14 = dispatch_default("change");
64574 var breathe = behaviorBreathe(context);
64575 corePreferences("turn-restriction-via-way", null);
64576 var storedViaWay = corePreferences("turn-restriction-via-way0");
64577 var storedDistance = corePreferences("turn-restriction-distance");
64578 var _maxViaWay = storedViaWay !== null ? +storedViaWay : 0;
64579 var _maxDistance = storedDistance ? +storedDistance : 30;
64580 var _initialized3 = false;
64581 var _parent = select_default2(null);
64582 var _container = select_default2(null);
64589 function restrictions(selection2) {
64590 _parent = selection2;
64591 if (_vertexID && (context.graph() !== _graph || !_intersection)) {
64592 _graph = context.graph();
64593 _intersection = osmIntersection(_graph, _vertexID, _maxDistance);
64595 var isOK = _intersection && _intersection.vertices.length && // has vertices
64596 _intersection.vertices.filter(function(vertex) {
64597 return vertex.id === _vertexID;
64598 }).length && _intersection.ways.length > 2 && // has more than 2 ways
64599 _intersection.ways.filter(function(way) {
64602 select_default2(selection2.node().parentNode).classed("hide", !isOK);
64603 if (!isOK || !context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode || !selection2.node().parentNode.parentNode) {
64604 selection2.call(restrictions.off);
64607 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64608 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
64609 var container = wrap2.selectAll(".restriction-container").data([0]);
64610 var containerEnter = container.enter().append("div").attr("class", "restriction-container");
64611 containerEnter.append("div").attr("class", "restriction-help");
64612 _container = containerEnter.merge(container).call(renderViewer);
64613 var controls = wrap2.selectAll(".restriction-controls").data([0]);
64614 controls.enter().append("div").attr("class", "restriction-controls-container").append("div").attr("class", "restriction-controls").merge(controls).call(renderControls);
64616 function renderControls(selection2) {
64617 var distControl = selection2.selectAll(".restriction-distance").data([0]);
64618 distControl.exit().remove();
64619 var distControlEnter = distControl.enter().append("div").attr("class", "restriction-control restriction-distance");
64620 distControlEnter.append("span").attr("class", "restriction-control-label restriction-distance-label").call(_t.append("restriction.controls.distance", { suffix: ":" }));
64621 distControlEnter.append("input").attr("class", "restriction-distance-input").attr("type", "range").attr("min", "20").attr("max", "50").attr("step", "5");
64622 distControlEnter.append("span").attr("class", "restriction-distance-text");
64623 selection2.selectAll(".restriction-distance-input").property("value", _maxDistance).on("input", function() {
64624 var val = select_default2(this).property("value");
64625 _maxDistance = +val;
64626 _intersection = null;
64627 _container.selectAll(".layer-osm .layer-turns *").remove();
64628 corePreferences("turn-restriction-distance", _maxDistance);
64629 _parent.call(restrictions);
64631 selection2.selectAll(".restriction-distance-text").call(displayMaxDistance(_maxDistance));
64632 var viaControl = selection2.selectAll(".restriction-via-way").data([0]);
64633 viaControl.exit().remove();
64634 var viaControlEnter = viaControl.enter().append("div").attr("class", "restriction-control restriction-via-way");
64635 viaControlEnter.append("span").attr("class", "restriction-control-label restriction-via-way-label").call(_t.append("restriction.controls.via", { suffix: ":" }));
64636 viaControlEnter.append("input").attr("class", "restriction-via-way-input").attr("type", "range").attr("min", "0").attr("max", "2").attr("step", "1");
64637 viaControlEnter.append("span").attr("class", "restriction-via-way-text");
64638 selection2.selectAll(".restriction-via-way-input").property("value", _maxViaWay).on("input", function() {
64639 var val = select_default2(this).property("value");
64641 _container.selectAll(".layer-osm .layer-turns *").remove();
64642 corePreferences("turn-restriction-via-way0", _maxViaWay);
64643 _parent.call(restrictions);
64645 selection2.selectAll(".restriction-via-way-text").call(displayMaxVia(_maxViaWay));
64647 function renderViewer(selection2) {
64648 if (!_intersection)
64650 var vgraph = _intersection.graph;
64651 var filter2 = utilFunctor(true);
64652 var projection2 = geoRawMercator();
64653 var sdims = utilGetDimensions(context.container().select(".sidebar"));
64654 var d2 = [sdims[0] - 50, 370];
64655 var c2 = geoVecScale(d2, 0.5);
64657 projection2.scale(geoZoomToScale(z2));
64658 var extent = geoExtent();
64659 for (var i3 = 0; i3 < _intersection.vertices.length; i3++) {
64660 extent._extend(_intersection.vertices[i3].extent());
64663 if (_intersection.vertices.length > 1) {
64664 var hPadding = Math.min(160, Math.max(110, d2[0] * 0.4));
64665 var vPadding = 160;
64666 var tl = projection2([extent[0][0], extent[1][1]]);
64667 var br = projection2([extent[1][0], extent[0][1]]);
64668 var hFactor = (br[0] - tl[0]) / (d2[0] - hPadding);
64669 var vFactor = (br[1] - tl[1]) / (d2[1] - vPadding - padTop);
64670 var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
64671 var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
64672 z2 = z2 - Math.max(hZoomDiff, vZoomDiff);
64673 projection2.scale(geoZoomToScale(z2));
64675 var extentCenter = projection2(extent.center());
64676 extentCenter[1] = extentCenter[1] - padTop / 2;
64677 projection2.translate(geoVecSubtract(c2, extentCenter)).clipExtent([[0, 0], d2]);
64678 var drawLayers = svgLayers(projection2, context).only(["osm", "touch"]).dimensions(d2);
64679 var drawVertices = svgVertices(projection2, context);
64680 var drawLines = svgLines(projection2, context);
64681 var drawTurns = svgTurns(projection2, context);
64682 var firstTime = selection2.selectAll(".surface").empty();
64683 selection2.call(drawLayers);
64684 var surface = selection2.selectAll(".surface").classed("tr", true);
64686 _initialized3 = true;
64687 surface.call(breathe);
64689 if (_fromWayID && !vgraph.hasEntity(_fromWayID)) {
64693 surface.call(utilSetDimensions, d2).call(drawVertices, vgraph, _intersection.vertices, filter2, extent, z2).call(drawLines, vgraph, _intersection.ways, filter2).call(drawTurns, vgraph, _intersection.turns(_fromWayID, _maxViaWay));
64694 surface.on("click.restrictions", click).on("mouseover.restrictions", mouseover);
64695 surface.selectAll(".selected").classed("selected", false);
64696 surface.selectAll(".related").classed("related", false);
64699 way = vgraph.entity(_fromWayID);
64700 surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
64702 document.addEventListener("resizeWindow", function() {
64703 utilSetDimensions(_container, null);
64707 function click(d3_event) {
64708 surface.call(breathe.off).call(breathe);
64709 var datum2 = d3_event.target.__data__;
64710 var entity = datum2 && datum2.properties && datum2.properties.entity;
64714 if (datum2 instanceof osmWay && (datum2.__from || datum2.__via)) {
64715 _fromWayID = datum2.id;
64718 } else if (datum2 instanceof osmTurn) {
64719 var actions, extraActions, turns, i4;
64720 var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
64721 if (datum2.restrictionID && !datum2.direct) {
64723 } else if (datum2.restrictionID && !datum2.only) {
64725 var datumOnly = JSON.parse(JSON.stringify(datum2));
64726 datumOnly.only = true;
64727 restrictionType = restrictionType.replace(/^no/, "only");
64728 turns = _intersection.turns(_fromWayID, 2);
64731 for (i4 = 0; i4 < turns.length; i4++) {
64732 var turn = turns[i4];
64733 if (seen[turn.restrictionID])
64735 if (turn.direct && turn.path[1] === datum2.path[1]) {
64736 seen[turns[i4].restrictionID] = true;
64737 turn.restrictionType = osmInferRestriction(vgraph, turn, projection2);
64738 _oldTurns.push(turn);
64739 extraActions.push(actionUnrestrictTurn(turn));
64742 actions = _intersection.actions.concat(extraActions, [
64743 actionRestrictTurn(datumOnly, restrictionType),
64744 _t("operations.restriction.annotation.create")
64746 } else if (datum2.restrictionID) {
64747 turns = _oldTurns || [];
64749 for (i4 = 0; i4 < turns.length; i4++) {
64750 if (turns[i4].key !== datum2.key) {
64751 extraActions.push(actionRestrictTurn(turns[i4], turns[i4].restrictionType));
64755 actions = _intersection.actions.concat(extraActions, [
64756 actionUnrestrictTurn(datum2),
64757 _t("operations.restriction.annotation.delete")
64760 actions = _intersection.actions.concat([
64761 actionRestrictTurn(datum2, restrictionType),
64762 _t("operations.restriction.annotation.create")
64765 context.perform.apply(context, actions);
64766 var s2 = surface.selectAll("." + datum2.key);
64767 datum2 = s2.empty() ? null : s2.datum();
64768 updateHints(datum2);
64775 function mouseover(d3_event) {
64776 var datum2 = d3_event.target.__data__;
64777 updateHints(datum2);
64779 _lastXPos = _lastXPos || sdims[0];
64780 function redraw(minChange) {
64783 xPos = utilGetDimensions(context.container().select(".sidebar"))[0];
64785 if (!minChange || minChange && Math.abs(xPos - _lastXPos) >= minChange) {
64786 if (context.hasEntity(_vertexID)) {
64788 _container.call(renderViewer);
64792 function highlightPathsFrom(wayID) {
64793 surface.selectAll(".related").classed("related", false).classed("allow", false).classed("restrict", false).classed("only", false);
64794 surface.selectAll("." + wayID).classed("related", true);
64796 var turns = _intersection.turns(wayID, _maxViaWay);
64797 for (var i4 = 0; i4 < turns.length; i4++) {
64798 var turn = turns[i4];
64799 var ids = [turn.to.way];
64800 var klass = turn.no ? "restrict" : turn.only ? "only" : "allow";
64801 if (turn.only || turns.length === 1) {
64802 if (turn.via.ways) {
64803 ids = ids.concat(turn.via.ways);
64805 } else if (turn.to.way === wayID) {
64808 surface.selectAll(utilEntitySelector(ids)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
64812 function updateHints(datum2) {
64813 var help = _container.selectAll(".restriction-help").html("");
64814 var placeholders = {};
64815 ["from", "via", "to"].forEach(function(k2) {
64816 placeholders[k2] = { html: '<span class="qualifier">' + _t("restriction.help." + k2) + "</span>" };
64818 var entity = datum2 && datum2.properties && datum2.properties.entity;
64823 way = vgraph.entity(_fromWayID);
64824 surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
64826 if (datum2 instanceof osmWay && datum2.__from) {
64828 highlightPathsFrom(_fromWayID ? null : way.id);
64829 surface.selectAll("." + way.id).classed("related", true);
64830 var clickSelect = !_fromWayID || _fromWayID !== way.id;
64831 help.append("div").html(_t.html("restriction.help." + (clickSelect ? "select_from_name" : "from_name"), {
64832 from: placeholders.from,
64833 fromName: displayName(way.id, vgraph)
64835 } else if (datum2 instanceof osmTurn) {
64836 var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
64837 var turnType = restrictionType.replace(/^(only|no)\_/, "");
64838 var indirect = datum2.direct === false ? _t.html("restriction.help.indirect") : "";
64839 var klass, turnText, nextText;
64841 klass = "restrict";
64842 turnText = _t.html("restriction.help.turn.no_" + turnType, { indirect: { html: indirect } });
64843 nextText = _t.html("restriction.help.turn.only_" + turnType, { indirect: "" });
64844 } else if (datum2.only) {
64846 turnText = _t.html("restriction.help.turn.only_" + turnType, { indirect: { html: indirect } });
64847 nextText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: "" });
64850 turnText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: { html: indirect } });
64851 nextText = _t.html("restriction.help.turn.no_" + turnType, { indirect: "" });
64853 help.append("div").attr("class", "qualifier " + klass).html(turnText);
64854 help.append("div").html(_t.html("restriction.help.from_name_to_name", {
64855 from: placeholders.from,
64856 fromName: displayName(datum2.from.way, vgraph),
64857 to: placeholders.to,
64858 toName: displayName(datum2.to.way, vgraph)
64860 if (datum2.via.ways && datum2.via.ways.length) {
64862 for (var i4 = 0; i4 < datum2.via.ways.length; i4++) {
64863 var prev = names[names.length - 1];
64864 var curr = displayName(datum2.via.ways[i4], vgraph);
64865 if (!prev || curr !== prev) {
64869 help.append("div").html(_t.html("restriction.help.via_names", {
64870 via: placeholders.via,
64871 viaNames: names.join(", ")
64875 help.append("div").html(_t.html("restriction.help.toggle", { turn: { html: nextText.trim() } }));
64877 highlightPathsFrom(null);
64878 var alongIDs = datum2.path.slice();
64879 surface.selectAll(utilEntitySelector(alongIDs)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
64881 highlightPathsFrom(null);
64883 help.append("div").html(_t.html("restriction.help.from_name", {
64884 from: placeholders.from,
64885 fromName: displayName(_fromWayID, vgraph)
64888 help.append("div").html(_t.html("restriction.help.select_from", {
64889 from: placeholders.from
64895 function displayMaxDistance(maxDist) {
64896 return (selection2) => {
64897 var isImperial = !_mainLocalizer.usesMetric();
64901 // imprecise conversion for prettier display
64910 opts = { distance: _t("units.feet", { quantity: distToFeet }) };
64912 opts = { distance: _t("units.meters", { quantity: maxDist }) };
64914 return selection2.html("").call(_t.append("restriction.controls.distance_up_to", opts));
64917 function displayMaxVia(maxVia) {
64918 return (selection2) => {
64919 selection2 = selection2.html("");
64920 return maxVia === 0 ? selection2.call(_t.append("restriction.controls.via_node_only")) : maxVia === 1 ? selection2.call(_t.append("restriction.controls.via_up_to_one")) : selection2.call(_t.append("restriction.controls.via_up_to_two"));
64923 function displayName(entityID, graph) {
64924 var entity = graph.entity(entityID);
64925 var name = utilDisplayName(entity) || "";
64926 var matched = _mainPresetIndex.match(entity, graph);
64927 var type2 = matched && matched.name() || utilDisplayType(entity.id);
64928 return name || type2;
64930 restrictions.entityIDs = function(val) {
64931 _intersection = null;
64934 _vertexID = val[0];
64936 restrictions.tags = function() {
64938 restrictions.focus = function() {
64940 restrictions.off = function(selection2) {
64941 if (!_initialized3)
64943 selection2.selectAll(".surface").call(breathe.off).on("click.restrictions", null).on("mouseover.restrictions", null);
64944 select_default2(window).on("resize.restrictions", null);
64946 return utilRebind(restrictions, dispatch14, "on");
64948 uiFieldRestrictions.supportsMultiselection = false;
64950 // modules/ui/fields/textarea.js
64951 function uiFieldTextarea(field, context) {
64952 var dispatch14 = dispatch_default("change");
64953 var input = select_default2(null);
64954 var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue()).silent(field.usage === "changeset" && field.key === "comment");
64956 function textarea(selection2) {
64957 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
64958 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).style("position", "relative").merge(wrap2);
64959 input = wrap2.selectAll("textarea").data([0]);
64960 input = input.enter().append("textarea").attr("id", field.domId).call(utilNoAuto).on("input", change(true)).on("blur", change()).on("change", change()).merge(input);
64961 wrap2.call(_lengthIndicator);
64962 function change(onInput) {
64963 return function() {
64964 var val = utilGetSetValue(input);
64966 val = context.cleanTagValue(val);
64967 if (!val && Array.isArray(_tags[field.key]))
64970 t2[field.key] = val || void 0;
64971 dispatch14.call("change", this, t2, onInput);
64975 textarea.tags = function(tags) {
64977 var isMixed = Array.isArray(tags[field.key]);
64978 utilGetSetValue(input, !isMixed && tags[field.key] ? tags[field.key] : "").attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : void 0).attr("placeholder", isMixed ? _t("inspector.multiple_values") : field.placeholder() || _t("inspector.unknown")).classed("mixed", isMixed);
64980 _lengthIndicator.update(tags[field.key]);
64983 textarea.focus = function() {
64984 input.node().focus();
64986 return utilRebind(textarea, dispatch14, "on");
64989 // modules/ui/fields/wikidata.js
64990 function uiFieldWikidata(field, context) {
64991 var wikidata = services.wikidata;
64992 var dispatch14 = dispatch_default("change");
64993 var _selection = select_default2(null);
64994 var _searchInput = select_default2(null);
64996 var _wikidataEntity = null;
64998 var _entityIDs = [];
64999 var _wikipediaKey = field.keys && field.keys.find(function(key) {
65000 return key.includes("wikipedia");
65002 var _hintKey = field.key === "wikidata" ? "name" : field.key.split(":")[0];
65003 var combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(true).minItems(1);
65004 function wiki(selection2) {
65005 _selection = selection2;
65006 var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
65007 wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
65008 var list = wrap2.selectAll("ul").data([0]);
65009 list = list.enter().append("ul").attr("class", "rows").merge(list);
65010 var searchRow = list.selectAll("li.wikidata-search").data([0]);
65011 var searchRowEnter = searchRow.enter().append("li").attr("class", "wikidata-search");
65012 searchRowEnter.append("input").attr("type", "text").attr("id", field.domId).style("flex", "1").call(utilNoAuto).on("focus", function() {
65013 var node = select_default2(this).node();
65014 node.setSelectionRange(0, node.value.length);
65015 }).on("blur", function() {
65016 setLabelForEntity();
65017 }).call(combobox.fetcher(fetchWikidataItems));
65018 combobox.on("accept", function(d2) {
65023 }).on("cancel", function() {
65024 setLabelForEntity();
65026 searchRowEnter.append("button").attr("class", "form-field-button wiki-link").attr("title", _t("icons.view_on", { domain: "wikidata.org" })).call(svgIcon("#iD-icon-out-link")).on("click", function(d3_event) {
65027 d3_event.preventDefault();
65029 window.open(_wikiURL, "_blank");
65031 searchRow = searchRow.merge(searchRowEnter);
65032 _searchInput = searchRow.select("input");
65033 var wikidataProperties = ["description", "identifier"];
65034 var items = list.selectAll("li.labeled-input").data(wikidataProperties);
65035 var enter = items.enter().append("li").attr("class", function(d2) {
65036 return "labeled-input preset-wikidata-" + d2;
65038 enter.append("span").attr("class", "label").html(function(d2) {
65039 return _t.html("wikidata." + d2);
65041 enter.append("input").attr("type", "text").call(utilNoAuto).classed("disabled", "true").attr("readonly", "true");
65042 enter.append("button").attr("class", "form-field-button").attr("title", _t("icons.copy")).call(svgIcon("#iD-operation-copy")).on("click", function(d3_event) {
65043 d3_event.preventDefault();
65044 select_default2(this.parentNode).select("input").node().select();
65045 document.execCommand("copy");
65048 function fetchWikidataItems(q2, callback) {
65049 if (!q2 && _hintKey) {
65050 for (var i3 in _entityIDs) {
65051 var entity = context.hasEntity(_entityIDs[i3]);
65052 if (entity.tags[_hintKey]) {
65053 q2 = entity.tags[_hintKey];
65058 wikidata.itemsForSearchQuery(q2, function(err, data) {
65060 if (err !== "No query")
65061 console.error(err);
65064 var result = data.map(function(item) {
65067 value: item.display.label.value + " (" + item.id + ")",
65068 display: (selection2) => selection2.append("span").attr("class", "localized-text").attr("lang", item.display.label.language).text(item.display.label.value),
65069 title: item.display.description && item.display.description.value,
65070 terms: item.aliases
65077 function change() {
65079 syncTags[field.key] = _qid;
65080 dispatch14.call("change", this, syncTags);
65081 var initGraph = context.graph();
65082 var initEntityIDs = _entityIDs;
65083 wikidata.entityByQID(_qid, function(err, entity) {
65086 if (context.graph() !== initGraph)
65088 if (!entity.sitelinks)
65090 var langs = wikidata.languagesToQuery();
65091 ["labels", "descriptions"].forEach(function(key) {
65094 var valueLangs = Object.keys(entity[key]);
65095 if (valueLangs.length === 0)
65097 var valueLang = valueLangs[0];
65098 if (langs.indexOf(valueLang) === -1) {
65099 langs.push(valueLang);
65102 var newWikipediaValue;
65103 if (_wikipediaKey) {
65104 var foundPreferred;
65105 for (var i3 in langs) {
65106 var lang = langs[i3];
65107 var siteID = lang.replace("-", "_") + "wiki";
65108 if (entity.sitelinks[siteID]) {
65109 foundPreferred = true;
65110 newWikipediaValue = lang + ":" + entity.sitelinks[siteID].title;
65114 if (!foundPreferred) {
65115 var wikiSiteKeys = Object.keys(entity.sitelinks).filter(function(site) {
65116 return site.endsWith("wiki");
65118 if (wikiSiteKeys.length === 0) {
65119 newWikipediaValue = null;
65121 var wikiLang = wikiSiteKeys[0].slice(0, -4).replace("_", "-");
65122 var wikiTitle = entity.sitelinks[wikiSiteKeys[0]].title;
65123 newWikipediaValue = wikiLang + ":" + wikiTitle;
65127 if (newWikipediaValue) {
65128 newWikipediaValue = context.cleanTagValue(newWikipediaValue);
65130 if (typeof newWikipediaValue === "undefined")
65132 var actions = initEntityIDs.map(function(entityID) {
65133 var entity2 = context.hasEntity(entityID);
65136 var currTags = Object.assign({}, entity2.tags);
65137 if (newWikipediaValue === null) {
65138 if (!currTags[_wikipediaKey])
65140 delete currTags[_wikipediaKey];
65142 currTags[_wikipediaKey] = newWikipediaValue;
65144 return actionChangeTags(entityID, currTags);
65145 }).filter(Boolean);
65146 if (!actions.length)
65149 function actionUpdateWikipediaTags(graph) {
65150 actions.forEach(function(action) {
65151 graph = action(graph);
65155 context.history().undoAnnotation()
65159 function setLabelForEntity() {
65161 if (_wikidataEntity) {
65162 label = entityPropertyForDisplay(_wikidataEntity, "labels");
65163 if (label.length === 0) {
65164 label = _wikidataEntity.id.toString();
65167 utilGetSetValue(_searchInput, label);
65169 wiki.tags = function(tags) {
65170 var isMixed = Array.isArray(tags[field.key]);
65171 _searchInput.attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : "").classed("mixed", isMixed);
65172 _qid = typeof tags[field.key] === "string" && tags[field.key] || "";
65173 if (!/^Q[0-9]*$/.test(_qid)) {
65177 _wikiURL = "https://wikidata.org/wiki/" + _qid;
65178 wikidata.entityByQID(_qid, function(err, entity) {
65183 _wikidataEntity = entity;
65184 setLabelForEntity();
65185 var description = entityPropertyForDisplay(entity, "descriptions");
65186 _selection.select("button.wiki-link").classed("disabled", false);
65187 _selection.select(".preset-wikidata-description").style("display", function() {
65188 return description.length > 0 ? "flex" : "none";
65189 }).select("input").attr("value", description);
65190 _selection.select(".preset-wikidata-identifier").style("display", function() {
65191 return entity.id ? "flex" : "none";
65192 }).select("input").attr("value", entity.id);
65194 function unrecognized() {
65195 _wikidataEntity = null;
65196 setLabelForEntity();
65197 _selection.select(".preset-wikidata-description").style("display", "none");
65198 _selection.select(".preset-wikidata-identifier").style("display", "none");
65199 _selection.select("button.wiki-link").classed("disabled", true);
65200 if (_qid && _qid !== "") {
65201 _wikiURL = "https://wikidata.org/wiki/Special:Search?search=" + _qid;
65207 function entityPropertyForDisplay(wikidataEntity, propKey) {
65208 if (!wikidataEntity[propKey])
65210 var propObj = wikidataEntity[propKey];
65211 var langKeys = Object.keys(propObj);
65212 if (langKeys.length === 0)
65214 var langs = wikidata.languagesToQuery();
65215 for (var i3 in langs) {
65216 var lang = langs[i3];
65217 var valueObj = propObj[lang];
65218 if (valueObj && valueObj.value && valueObj.value.length > 0)
65219 return valueObj.value;
65221 return propObj[langKeys[0]].value;
65223 wiki.entityIDs = function(val) {
65224 if (!arguments.length)
65229 wiki.focus = function() {
65230 _searchInput.node().focus();
65232 return utilRebind(wiki, dispatch14, "on");
65235 // modules/ui/fields/wikipedia.js
65236 function uiFieldWikipedia(field, context) {
65237 const dispatch14 = dispatch_default("change");
65238 const wikipedia = services.wikipedia;
65239 const wikidata = services.wikidata;
65240 let _langInput = select_default2(null);
65241 let _titleInput = select_default2(null);
65245 let _dataWikipedia = [];
65246 _mainFileFetcher.get("wmf_sitematrix").then((d2) => {
65247 _dataWikipedia = d2;
65249 updateForTags(_tags);
65252 const langCombo = uiCombobox(context, "wikipedia-lang").fetcher((value, callback) => {
65253 const v2 = value.toLowerCase();
65255 _dataWikipedia.filter((d2) => {
65256 return d2[0].toLowerCase().indexOf(v2) >= 0 || d2[1].toLowerCase().indexOf(v2) >= 0 || d2[2].toLowerCase().indexOf(v2) >= 0;
65257 }).map((d2) => ({ value: d2[1] }))
65260 const titleCombo = uiCombobox(context, "wikipedia-title").fetcher((value, callback) => {
65263 for (let i3 in _entityIDs) {
65264 let entity = context.hasEntity(_entityIDs[i3]);
65265 if (entity.tags.name) {
65266 value = entity.tags.name;
65271 const searchfn = value.length > 7 ? wikipedia.search : wikipedia.suggestions;
65272 searchfn(language()[2], value, (query, data) => {
65273 callback(data.map((d2) => ({ value: d2 })));
65276 function wiki(selection2) {
65277 let wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
65278 wrap2 = wrap2.enter().append("div").attr("class", `form-field-input-wrap form-field-input-${field.type}`).merge(wrap2);
65279 let langContainer = wrap2.selectAll(".wiki-lang-container").data([0]);
65280 langContainer = langContainer.enter().append("div").attr("class", "wiki-lang-container").merge(langContainer);
65281 _langInput = langContainer.selectAll("input.wiki-lang").data([0]);
65282 _langInput = _langInput.enter().append("input").attr("type", "text").attr("class", "wiki-lang").attr("placeholder", _t("translate.localized_translation_language")).call(utilNoAuto).call(langCombo).merge(_langInput);
65283 _langInput.on("blur", changeLang).on("change", changeLang);
65284 let titleContainer = wrap2.selectAll(".wiki-title-container").data([0]);
65285 titleContainer = titleContainer.enter().append("div").attr("class", "wiki-title-container").merge(titleContainer);
65286 _titleInput = titleContainer.selectAll("input.wiki-title").data([0]);
65287 _titleInput = _titleInput.enter().append("input").attr("type", "text").attr("class", "wiki-title").attr("id", field.domId).call(utilNoAuto).call(titleCombo).merge(_titleInput);
65288 _titleInput.on("blur", function() {
65290 }).on("change", function() {
65293 let link2 = titleContainer.selectAll(".wiki-link").data([0]);
65294 link2 = link2.enter().append("button").attr("class", "form-field-button wiki-link").attr("title", _t("icons.view_on", { domain: "wikipedia.org" })).call(svgIcon("#iD-icon-out-link")).merge(link2);
65295 link2.on("click", (d3_event) => {
65296 d3_event.preventDefault();
65298 window.open(_wikiURL, "_blank");
65301 function defaultLanguageInfo(skipEnglishFallback) {
65302 const langCode = _mainLocalizer.languageCode().toLowerCase();
65303 for (let i3 in _dataWikipedia) {
65304 let d2 = _dataWikipedia[i3];
65305 if (d2[2] === langCode)
65308 return skipEnglishFallback ? ["", "", ""] : ["English", "English", "en"];
65310 function language(skipEnglishFallback) {
65311 const value = utilGetSetValue(_langInput).toLowerCase();
65312 for (let i3 in _dataWikipedia) {
65313 let d2 = _dataWikipedia[i3];
65314 if (d2[0].toLowerCase() === value || d2[1].toLowerCase() === value || d2[2] === value)
65317 return defaultLanguageInfo(skipEnglishFallback);
65319 function changeLang() {
65320 utilGetSetValue(_langInput, language()[1]);
65323 function change(skipWikidata) {
65324 let value = utilGetSetValue(_titleInput);
65325 const m2 = value.match(/https?:\/\/([-a-z]+)\.wikipedia\.org\/(?:wiki|\1-[-a-z]+)\/([^#]+)(?:#(.+))?/);
65326 const langInfo = m2 && _dataWikipedia.find((d2) => m2[1] === d2[2]);
65329 const nativeLangName = langInfo[1];
65330 value = decodeURIComponent(m2[2]).replace(/_/g, " ");
65333 anchor = decodeURIComponent(m2[3]);
65334 value += "#" + anchor.replace(/_/g, " ");
65336 value = value.slice(0, 1).toUpperCase() + value.slice(1);
65337 utilGetSetValue(_langInput, nativeLangName);
65338 utilGetSetValue(_titleInput, value);
65341 syncTags.wikipedia = context.cleanTagValue(language()[2] + ":" + value);
65343 syncTags.wikipedia = void 0;
65345 dispatch14.call("change", this, syncTags);
65346 if (skipWikidata || !value || !language()[2])
65348 const initGraph = context.graph();
65349 const initEntityIDs = _entityIDs;
65350 wikidata.itemsByTitle(language()[2], value, (err, data) => {
65351 if (err || !data || !Object.keys(data).length)
65353 if (context.graph() !== initGraph)
65355 const qids = Object.keys(data);
65356 const value2 = qids && qids.find((id2) => id2.match(/^Q\d+$/));
65357 let actions = initEntityIDs.map((entityID) => {
65358 let entity = context.entity(entityID).tags;
65359 let currTags = Object.assign({}, entity);
65360 if (currTags.wikidata !== value2) {
65361 currTags.wikidata = value2;
65362 return actionChangeTags(entityID, currTags);
65365 }).filter(Boolean);
65366 if (!actions.length)
65369 function actionUpdateWikidataTags(graph) {
65370 actions.forEach(function(action) {
65371 graph = action(graph);
65375 context.history().undoAnnotation()
65379 wiki.tags = (tags) => {
65381 updateForTags(tags);
65383 function updateForTags(tags) {
65384 const value = typeof tags[field.key] === "string" ? tags[field.key] : "";
65385 const m2 = value.match(/([^:]+):([^#]+)(?:#(.+))?/);
65386 const tagLang = m2 && m2[1];
65387 const tagArticleTitle = m2 && m2[2];
65388 let anchor = m2 && m2[3];
65389 const tagLangInfo = tagLang && _dataWikipedia.find((d2) => tagLang === d2[2]);
65391 const nativeLangName = tagLangInfo[1];
65392 utilGetSetValue(_langInput, nativeLangName);
65393 utilGetSetValue(_titleInput, tagArticleTitle + (anchor ? "#" + anchor : ""));
65396 anchor = encodeURIComponent(anchor.replace(/ /g, "_")).replace(/%/g, ".");
65398 anchor = anchor.replace(/ /g, "_");
65401 _wikiURL = "https://" + tagLang + ".wikipedia.org/wiki/" + tagArticleTitle.replace(/ /g, "_") + (anchor ? "#" + anchor : "");
65403 utilGetSetValue(_titleInput, value);
65404 if (value && value !== "") {
65405 utilGetSetValue(_langInput, "");
65406 const defaultLangInfo = defaultLanguageInfo();
65407 _wikiURL = `https://${defaultLangInfo[2]}.wikipedia.org/w/index.php?fulltext=1&search=${value}`;
65409 const shownOrDefaultLangInfo = language(
65411 /* skipEnglishFallback */
65413 utilGetSetValue(_langInput, shownOrDefaultLangInfo[1]);
65418 wiki.entityIDs = (val) => {
65419 if (!arguments.length)
65424 wiki.focus = () => {
65425 _titleInput.node().focus();
65427 return utilRebind(wiki, dispatch14, "on");
65429 uiFieldWikipedia.supportsMultiselection = false;
65431 // modules/ui/fields/index.js
65433 access: uiFieldAccess,
65434 address: uiFieldAddress,
65435 check: uiFieldCheck,
65436 colour: uiFieldText,
65437 combo: uiFieldCombo,
65438 cycleway: uiFieldDirectionalCombo,
65440 defaultCheck: uiFieldCheck,
65441 directionalCombo: uiFieldDirectionalCombo,
65442 email: uiFieldText,
65443 identifier: uiFieldText,
65444 lanes: uiFieldLanes,
65445 localized: uiFieldLocalized,
65446 roadheight: uiFieldRoadheight,
65447 roadspeed: uiFieldRoadspeed,
65448 manyCombo: uiFieldCombo,
65449 multiCombo: uiFieldCombo,
65450 networkCombo: uiFieldCombo,
65451 number: uiFieldText,
65452 onewayCheck: uiFieldCheck,
65453 radio: uiFieldRadio,
65454 restrictions: uiFieldRestrictions,
65455 semiCombo: uiFieldCombo,
65456 structureRadio: uiFieldRadio,
65459 textarea: uiFieldTextarea,
65460 typeCombo: uiFieldCombo,
65462 wikidata: uiFieldWikidata,
65463 wikipedia: uiFieldWikipedia
65466 // modules/ui/field.js
65467 function uiField(context, presetField2, entityIDs, options2) {
65468 options2 = Object.assign({
65475 var dispatch14 = dispatch_default("change", "revert");
65476 var field = Object.assign({}, presetField2);
65477 field.domId = utilUniqueDomId("form-field-" + field.safeid);
65478 var _show = options2.show;
65482 if (entityIDs && entityIDs.length) {
65483 _entityExtent = entityIDs.reduce(function(extent, entityID) {
65484 var entity = context.graph().entity(entityID);
65485 return extent.extend(entity.extent(context.graph()));
65488 var _locked = false;
65489 var _lockedTip = uiTooltip().title(() => _t.append("inspector.lock.suggestion", { label: field.title })).placement("bottom");
65490 if (_show && !field.impl) {
65493 function createField() {
65494 field.impl = uiFields[field.type](field, context).on("change", function(t2, onInput) {
65495 dispatch14.call("change", field, t2, onInput);
65498 field.entityIDs = entityIDs;
65499 if (field.impl.entityIDs) {
65500 field.impl.entityIDs(entityIDs);
65504 function allKeys() {
65505 let keys2 = field.keys || [field.key];
65506 if (field.type === "directionalCombo" && field.key) {
65507 keys2 = keys2.concat(field.key);
65511 function isModified() {
65512 if (!entityIDs || !entityIDs.length)
65514 return entityIDs.some(function(entityID) {
65515 var original = context.graph().base().entities[entityID];
65516 var latest = context.graph().entity(entityID);
65517 return allKeys().some(function(key) {
65518 return original ? latest.tags[key] !== original.tags[key] : latest.tags[key];
65522 function tagsContainFieldKey() {
65523 return allKeys().some(function(key) {
65524 if (field.type === "multiCombo") {
65525 for (var tagKey in _tags) {
65526 if (tagKey.indexOf(key) === 0) {
65532 return _tags[key] !== void 0;
65535 function revert(d3_event, d2) {
65536 d3_event.stopPropagation();
65537 d3_event.preventDefault();
65538 if (!entityIDs || _locked)
65540 dispatch14.call("revert", d2, allKeys());
65542 function remove2(d3_event, d2) {
65543 d3_event.stopPropagation();
65544 d3_event.preventDefault();
65548 allKeys().forEach(function(key) {
65551 dispatch14.call("change", d2, t2);
65553 field.render = function(selection2) {
65554 var container = selection2.selectAll(".form-field").data([field]);
65555 var enter = container.enter().append("div").attr("class", function(d2) {
65556 return "form-field form-field-" + d2.safeid;
65557 }).classed("nowrap", !options2.wrap);
65558 if (options2.wrap) {
65559 var labelEnter = enter.append("label").attr("class", "field-label").attr("for", function(d2) {
65562 var textEnter = labelEnter.append("span").attr("class", "label-text");
65563 textEnter.append("span").attr("class", "label-textvalue").each(function(d2) {
65564 d2.label()(select_default2(this));
65566 textEnter.append("span").attr("class", "label-textannotation");
65567 if (options2.remove) {
65568 labelEnter.append("button").attr("class", "remove-icon").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
65570 if (options2.revert) {
65571 labelEnter.append("button").attr("class", "modified-icon").attr("title", _t("icons.undo")).call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo"));
65574 container = container.merge(enter);
65575 container.select(".field-label > .remove-icon").on("click", remove2);
65576 container.select(".field-label > .modified-icon").on("click", revert);
65577 container.each(function(d2) {
65578 var selection3 = select_default2(this);
65582 var reference, help;
65583 if (options2.wrap && field.type === "restrictions") {
65584 help = uiFieldHelp(context, "restrictions");
65586 if (options2.wrap && options2.info) {
65587 var referenceKey = d2.key || "";
65588 if (d2.type === "multiCombo") {
65589 referenceKey = referenceKey.replace(/:$/, "");
65591 var referenceOptions = d2.reference || {
65593 value: _tags[referenceKey]
65595 reference = uiTagReference(referenceOptions, context);
65596 if (_state === "hover") {
65597 reference.showing(false);
65600 selection3.call(d2.impl);
65602 selection3.call(help.body).select(".field-label").call(help.button);
65605 selection3.call(reference.body).select(".field-label").call(reference.button);
65607 d2.impl.tags(_tags);
65609 container.classed("locked", _locked).classed("modified", isModified()).classed("present", tagsContainFieldKey());
65610 var annotation = container.selectAll(".field-label .label-textannotation");
65611 var icon2 = annotation.selectAll(".icon").data(_locked ? [0] : []);
65612 icon2.exit().remove();
65613 icon2.enter().append("svg").attr("class", "icon").append("use").attr("xlink:href", "#fas-lock");
65614 container.call(_locked ? _lockedTip : _lockedTip.destroy);
65616 field.state = function(val) {
65617 if (!arguments.length)
65622 field.tags = function(val) {
65623 if (!arguments.length)
65626 if (tagsContainFieldKey() && !_show) {
65634 field.locked = function(val) {
65635 if (!arguments.length)
65640 field.show = function() {
65645 if (field.default && field.key && _tags[field.key] !== field.default) {
65647 t2[field.key] = field.default;
65648 dispatch14.call("change", this, t2);
65651 field.isShown = function() {
65654 field.isAllowed = function() {
65655 if (entityIDs && entityIDs.length > 1 && uiFields[field.type].supportsMultiselection === false)
65657 if (field.geometry && !entityIDs.every(function(entityID) {
65658 return field.matchGeometry(context.graph().geometry(entityID));
65661 if (entityIDs && _entityExtent && field.locationSetID) {
65662 var validHere = _sharedLocationManager.locationSetsAt(_entityExtent.center());
65663 if (!validHere[field.locationSetID])
65666 var prerequisiteTag = field.prerequisiteTag;
65667 if (entityIDs && !tagsContainFieldKey() && // ignore tagging prerequisites if a value is already present
65669 if (!entityIDs.every(function(entityID) {
65670 var entity = context.graph().entity(entityID);
65671 if (prerequisiteTag.key) {
65672 var value = entity.tags[prerequisiteTag.key];
65675 if (prerequisiteTag.valueNot) {
65676 return prerequisiteTag.valueNot !== value;
65678 if (prerequisiteTag.value) {
65679 return prerequisiteTag.value === value;
65681 } else if (prerequisiteTag.keyNot) {
65682 if (entity.tags[prerequisiteTag.keyNot])
65691 field.focus = function() {
65693 field.impl.focus();
65696 return utilRebind(field, dispatch14, "on");
65699 // modules/ui/form_fields.js
65700 function uiFormFields(context) {
65701 var moreCombo = uiCombobox(context, "more-fields").minItems(1);
65702 var _fieldsArr = [];
65703 var _lastPlaceholder = "";
65706 function formFields(selection2) {
65707 var allowedFields = _fieldsArr.filter(function(field) {
65708 return field.isAllowed();
65710 var shown = allowedFields.filter(function(field) {
65711 return field.isShown();
65713 var notShown = allowedFields.filter(function(field) {
65714 return !field.isShown();
65716 var container = selection2.selectAll(".form-fields-container").data([0]);
65717 container = container.enter().append("div").attr("class", "form-fields-container " + (_klass || "")).merge(container);
65718 var fields = container.selectAll(".wrap-form-field").data(shown, function(d2) {
65719 return d2.id + (d2.entityIDs ? d2.entityIDs.join() : "");
65721 fields.exit().remove();
65722 var enter = fields.enter().append("div").attr("class", function(d2) {
65723 return "wrap-form-field wrap-form-field-" + d2.safeid;
65725 fields = fields.merge(enter);
65726 fields.order().each(function(d2) {
65727 select_default2(this).call(d2.render);
65730 var moreFields = notShown.map(function(field) {
65731 var title = field.title();
65732 titles.push(title);
65733 var terms = field.terms();
65735 terms.push(field.key);
65737 terms = terms.concat(field.keys);
65739 display: field.label(),
65746 var placeholder = titles.slice(0, 3).join(", ") + (titles.length > 3 ? "\u2026" : "");
65747 var more = selection2.selectAll(".more-fields").data(_state === "hover" || moreFields.length === 0 ? [] : [0]);
65748 more.exit().remove();
65749 var moreEnter = more.enter().append("div").attr("class", "more-fields").append("label");
65750 moreEnter.append("span").call(_t.append("inspector.add_fields"));
65751 more = moreEnter.merge(more);
65752 var input = more.selectAll(".value").data([0]);
65753 input.exit().remove();
65754 input = input.enter().append("input").attr("class", "value").attr("type", "text").attr("placeholder", placeholder).call(utilNoAuto).merge(input);
65755 input.call(utilGetSetValue, "").call(
65756 moreCombo.data(moreFields).on("accept", function(d2) {
65759 var field = d2.field;
65761 selection2.call(formFields);
65765 if (_lastPlaceholder !== placeholder) {
65766 input.attr("placeholder", placeholder);
65767 _lastPlaceholder = placeholder;
65770 formFields.fieldsArr = function(val) {
65771 if (!arguments.length)
65773 _fieldsArr = val || [];
65776 formFields.state = function(val) {
65777 if (!arguments.length)
65782 formFields.klass = function(val) {
65783 if (!arguments.length)
65791 // modules/ui/changeset_editor.js
65792 function uiChangesetEditor(context) {
65793 var dispatch14 = dispatch_default("change");
65794 var formFields = uiFormFields(context);
65795 var commentCombo = uiCombobox(context, "comment").caseSensitive(true);
65799 function changesetEditor(selection2) {
65800 render(selection2);
65802 function render(selection2) {
65803 var initial = false;
65806 var presets = _mainPresetIndex;
65808 uiField(context, presets.field("comment"), null, { show: true, revert: false }),
65809 uiField(context, presets.field("source"), null, { show: false, revert: false }),
65810 uiField(context, presets.field("hashtags"), null, { show: false, revert: false })
65812 _fieldsArr.forEach(function(field) {
65813 field.on("change", function(t2, onInput) {
65814 dispatch14.call("change", field, void 0, t2, onInput);
65818 _fieldsArr.forEach(function(field) {
65821 selection2.call(formFields.fieldsArr(_fieldsArr));
65823 var commentField = selection2.select(".form-field-comment textarea");
65824 var commentNode = commentField.node();
65826 commentNode.focus();
65827 commentNode.select();
65829 utilTriggerEvent(commentField, "blur");
65830 var osm = context.connection();
65832 osm.userChangesets(function(err, changesets) {
65835 var comments = changesets.map(function(changeset) {
65836 var comment = changeset.tags.comment;
65837 return comment ? { title: comment, value: comment } : null;
65838 }).filter(Boolean);
65840 commentCombo.data(utilArrayUniqBy(comments, "title"))
65845 const warnings = [];
65846 if (_tags.comment.match(/google/i)) {
65848 id: 'contains "google"',
65849 msg: _t.append("commit.google_warning"),
65850 link: _t("commit.google_warning_link")
65853 const maxChars = context.maxCharsForTagValue();
65854 const strLen = utilUnicodeCharsCount(utilCleanOsmString(_tags.comment, Number.POSITIVE_INFINITY));
65855 if (strLen > maxChars || false) {
65857 id: "message too long",
65858 msg: _t.append("commit.changeset_comment_length_warning", { maxChars })
65861 var commentWarning = selection2.select(".form-field-comment").selectAll(".comment-warning").data(warnings, (d2) => d2.id);
65862 commentWarning.exit().transition().duration(200).style("opacity", 0).remove();
65863 var commentEnter = commentWarning.enter().insert("div", ".comment-warning").attr("class", "comment-warning field-warning").style("opacity", 0);
65864 commentEnter.call(svgIcon("#iD-icon-alert", "inline")).append("span");
65865 commentEnter.transition().duration(200).style("opacity", 1);
65866 commentWarning.merge(commentEnter).selectAll("div > span").text("").each(function(d2) {
65867 let selection3 = select_default2(this);
65869 selection3 = selection3.append("a").attr("target", "_blank").attr("href", d2.link);
65871 selection3.call(d2.msg);
65874 changesetEditor.tags = function(_2) {
65875 if (!arguments.length)
65878 return changesetEditor;
65880 changesetEditor.changesetID = function(_2) {
65881 if (!arguments.length)
65882 return _changesetID;
65883 if (_changesetID === _2)
65884 return changesetEditor;
65887 return changesetEditor;
65889 return utilRebind(changesetEditor, dispatch14, "on");
65892 // modules/ui/commit.js
65893 var import_fast_deep_equal9 = __toESM(require_fast_deep_equal());
65895 // modules/util/jxon.js
65896 var JXON = new function() {
65897 var sValueProp = "keyValue", sAttributesProp = "keyAttributes", sAttrPref = "@", aCache = [], rIsNull = /^\s*$/, rIsBool = /^(?:true|false)$/i;
65898 function parseText(sValue) {
65899 if (rIsNull.test(sValue)) {
65902 if (rIsBool.test(sValue)) {
65903 return sValue.toLowerCase() === "true";
65905 if (isFinite(sValue)) {
65906 return parseFloat(sValue);
65908 if (isFinite(Date.parse(sValue))) {
65909 return new Date(sValue);
65913 function EmptyTree() {
65915 EmptyTree.prototype.toString = function() {
65918 EmptyTree.prototype.valueOf = function() {
65921 function objectify(vValue) {
65922 return vValue === null ? new EmptyTree() : vValue instanceof Object ? vValue : new vValue.constructor(vValue);
65924 function createObjTree(oParentNode, nVerb, bFreeze, bNesteAttr) {
65925 var nLevelStart = aCache.length, bChildren = oParentNode.hasChildNodes(), bAttributes = oParentNode.hasAttributes(), bHighVerb = Boolean(nVerb & 2);
65926 var sProp, vContent, nLength = 0, sCollectedTxt = "", vResult = bHighVerb ? {} : (
65927 /* put here the default value for empty nodes: */
65931 for (var oNode, nItem = 0; nItem < oParentNode.childNodes.length; nItem++) {
65932 oNode = oParentNode.childNodes.item(nItem);
65933 if (oNode.nodeType === 4) {
65934 sCollectedTxt += oNode.nodeValue;
65935 } else if (oNode.nodeType === 3) {
65936 sCollectedTxt += oNode.nodeValue.trim();
65937 } else if (oNode.nodeType === 1 && !oNode.prefix) {
65938 aCache.push(oNode);
65942 var nLevelEnd = aCache.length, vBuiltVal = parseText(sCollectedTxt);
65943 if (!bHighVerb && (bChildren || bAttributes)) {
65944 vResult = nVerb === 0 ? objectify(vBuiltVal) : {};
65946 for (var nElId = nLevelStart; nElId < nLevelEnd; nElId++) {
65947 sProp = aCache[nElId].nodeName.toLowerCase();
65948 vContent = createObjTree(aCache[nElId], nVerb, bFreeze, bNesteAttr);
65949 if (vResult.hasOwnProperty(sProp)) {
65950 if (vResult[sProp].constructor !== Array) {
65951 vResult[sProp] = [vResult[sProp]];
65953 vResult[sProp].push(vContent);
65955 vResult[sProp] = vContent;
65960 var nAttrLen = oParentNode.attributes.length, sAPrefix = bNesteAttr ? "" : sAttrPref, oAttrParent = bNesteAttr ? {} : vResult;
65961 for (var oAttrib, nAttrib = 0; nAttrib < nAttrLen; nLength++, nAttrib++) {
65962 oAttrib = oParentNode.attributes.item(nAttrib);
65963 oAttrParent[sAPrefix + oAttrib.name.toLowerCase()] = parseText(oAttrib.value.trim());
65967 Object.freeze(oAttrParent);
65969 vResult[sAttributesProp] = oAttrParent;
65970 nLength -= nAttrLen - 1;
65973 if (nVerb === 3 || (nVerb === 2 || nVerb === 1 && nLength > 0) && sCollectedTxt) {
65974 vResult[sValueProp] = vBuiltVal;
65975 } else if (!bHighVerb && nLength === 0 && sCollectedTxt) {
65976 vResult = vBuiltVal;
65978 if (bFreeze && (bHighVerb || nLength > 0)) {
65979 Object.freeze(vResult);
65981 aCache.length = nLevelStart;
65984 function loadObjTree(oXMLDoc, oParentEl, oParentObj) {
65985 var vValue, oChild;
65986 if (oParentObj instanceof String || oParentObj instanceof Number || oParentObj instanceof Boolean) {
65987 oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toString()));
65988 } else if (oParentObj.constructor === Date) {
65989 oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString()));
65991 for (var sName in oParentObj) {
65992 vValue = oParentObj[sName];
65993 if (isFinite(sName) || vValue instanceof Function) {
65996 if (sName === sValueProp) {
65997 if (vValue !== null && vValue !== true) {
65998 oParentEl.appendChild(oXMLDoc.createTextNode(vValue.constructor === Date ? vValue.toGMTString() : String(vValue)));
66000 } else if (sName === sAttributesProp) {
66001 for (var sAttrib in vValue) {
66002 oParentEl.setAttribute(sAttrib, vValue[sAttrib]);
66004 } else if (sName.charAt(0) === sAttrPref) {
66005 oParentEl.setAttribute(sName.slice(1), vValue);
66006 } else if (vValue.constructor === Array) {
66007 for (var nItem = 0; nItem < vValue.length; nItem++) {
66008 oChild = oXMLDoc.createElement(sName);
66009 loadObjTree(oXMLDoc, oChild, vValue[nItem]);
66010 oParentEl.appendChild(oChild);
66013 oChild = oXMLDoc.createElement(sName);
66014 if (vValue instanceof Object) {
66015 loadObjTree(oXMLDoc, oChild, vValue);
66016 } else if (vValue !== null && vValue !== true) {
66017 oChild.appendChild(oXMLDoc.createTextNode(vValue.toString()));
66019 oParentEl.appendChild(oChild);
66023 this.build = function(oXMLParent, nVerbosity, bFreeze, bNesteAttributes) {
66024 var _nVerb = arguments.length > 1 && typeof nVerbosity === "number" ? nVerbosity & 3 : (
66025 /* put here the default verbosity level: */
66028 return createObjTree(oXMLParent, _nVerb, bFreeze || false, arguments.length > 3 ? bNesteAttributes : _nVerb === 3);
66030 this.unbuild = function(oObjTree) {
66031 var oNewDoc = document.implementation.createDocument("", "", null);
66032 loadObjTree(oNewDoc, oNewDoc, oObjTree);
66035 this.stringify = function(oObjTree) {
66036 return new XMLSerializer().serializeToString(JXON.unbuild(oObjTree));
66040 // modules/ui/sections/changes.js
66041 function uiSectionChanges(context) {
66042 var _discardTags = {};
66043 _mainFileFetcher.get("discarded").then(function(d2) {
66045 }).catch(function() {
66047 var section = uiSection("changes-list", context).label(function() {
66048 var history = context.history();
66049 var summary = history.difference().summary();
66050 return _t.append("inspector.title_count", { title: _t("commit.changes"), count: summary.length });
66051 }).disclosureContent(renderDisclosureContent);
66052 function renderDisclosureContent(selection2) {
66053 var history = context.history();
66054 var summary = history.difference().summary();
66055 var container = selection2.selectAll(".commit-section").data([0]);
66056 var containerEnter = container.enter().append("div").attr("class", "commit-section");
66057 containerEnter.append("ul").attr("class", "changeset-list");
66058 container = containerEnter.merge(container);
66059 var items = container.select("ul").selectAll("li").data(summary);
66060 var itemsEnter = items.enter().append("li").attr("class", "change-item");
66061 var buttons = itemsEnter.append("button").on("mouseover", mouseover).on("mouseout", mouseout).on("click", click);
66062 buttons.each(function(d2) {
66063 select_default2(this).call(svgIcon("#iD-icon-" + d2.entity.geometry(d2.graph), "pre-text " + d2.changeType));
66065 buttons.append("span").attr("class", "change-type").html(function(d2) {
66066 return _t.html("commit." + d2.changeType) + " ";
66068 buttons.append("strong").attr("class", "entity-type").text(function(d2) {
66069 var matched = _mainPresetIndex.match(d2.entity, d2.graph);
66070 return matched && matched.name() || utilDisplayType(d2.entity.id);
66072 buttons.append("span").attr("class", "entity-name").text(function(d2) {
66073 var name = utilDisplayName(d2.entity) || "", string = "";
66077 return string += " " + name;
66079 items = itemsEnter.merge(items);
66080 var changeset = new osmChangeset().update({ id: void 0 });
66081 var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
66082 delete changeset.id;
66083 var data = JXON.stringify(changeset.osmChangeJXON(changes));
66084 var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
66085 var fileName = "changes.osc";
66086 var linkEnter = container.selectAll(".download-changes").data([0]).enter().append("a").attr("class", "download-changes");
66087 linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
66088 linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("commit.download_changes"));
66089 function mouseover(d2) {
66091 context.surface().selectAll(
66092 utilEntityOrMemberSelector([d2.entity.id], context.graph())
66093 ).classed("hover", true);
66096 function mouseout() {
66097 context.surface().selectAll(".hover").classed("hover", false);
66099 function click(d3_event, change) {
66100 if (change.changeType !== "deleted") {
66101 var entity = change.entity;
66102 context.map().zoomToEase(entity);
66103 context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
66110 // modules/ui/commit_warnings.js
66111 function uiCommitWarnings(context) {
66112 function commitWarnings(selection2) {
66113 var issuesBySeverity = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeDisabledRules: true });
66114 for (var severity in issuesBySeverity) {
66115 var issues = issuesBySeverity[severity];
66116 if (severity !== "error") {
66117 issues = issues.filter(function(issue) {
66118 return issue.type !== "help_request";
66121 var section = severity + "-section";
66122 var issueItem = severity + "-item";
66123 var container = selection2.selectAll("." + section).data(issues.length ? [0] : []);
66124 container.exit().remove();
66125 var containerEnter = container.enter().append("div").attr("class", "modal-section " + section + " fillL2");
66126 containerEnter.append("h3").call(severity === "warning" ? _t.append("commit.warnings") : _t.append("commit.errors"));
66127 containerEnter.append("ul").attr("class", "changeset-list");
66128 container = containerEnter.merge(container);
66129 var items = container.select("ul").selectAll("li").data(issues, function(d2) {
66132 items.exit().remove();
66133 var itemsEnter = items.enter().append("li").attr("class", issueItem);
66134 var buttons = itemsEnter.append("button").on("mouseover", function(d3_event, d2) {
66135 if (d2.entityIds) {
66136 context.surface().selectAll(
66137 utilEntityOrMemberSelector(
66141 ).classed("hover", true);
66143 }).on("mouseout", function() {
66144 context.surface().selectAll(".hover").classed("hover", false);
66145 }).on("click", function(d3_event, d2) {
66146 context.validator().focusIssue(d2);
66148 buttons.call(svgIcon("#iD-icon-alert", "pre-text"));
66149 buttons.append("strong").attr("class", "issue-message");
66150 buttons.filter(function(d2) {
66153 uiTooltip().title(function(d2) {
66155 }).placement("top")
66157 items = itemsEnter.merge(items);
66158 items.selectAll(".issue-message").text("").each(function(d2) {
66159 return d2.message(context)(select_default2(this));
66163 return commitWarnings;
66166 // modules/ui/commit.js
66167 var readOnlyTags = [
66168 /^changesets_count$/,
66177 /^closed:keepright$/,
66178 /^closed:improveosm:/,
66181 var hashtagRegex = /(#[^\u2000-\u206F\u2E00-\u2E7F\s\\'!"#$%()*,.\/:;<=>?@\[\]^`{|}~]+)/g;
66182 function uiCommit(context) {
66183 var dispatch14 = dispatch_default("cancel");
66186 var changesetEditor = uiChangesetEditor(context).on("change", changeTags);
66187 var rawTagEditor = uiSectionRawTagEditor("changeset-tag-editor", context).on("change", changeTags).readOnlyTags(readOnlyTags);
66188 var commitChanges = uiSectionChanges(context);
66189 var commitWarnings = uiCommitWarnings(context);
66190 function commit(selection2) {
66191 _selection = selection2;
66192 if (!context.changeset)
66194 loadDerivedChangesetTags();
66195 selection2.call(render);
66197 function initChangeset() {
66198 var commentDate = +corePreferences("commentDate") || 0;
66199 var currDate = Date.now();
66200 var cutoff = 2 * 86400 * 1e3;
66201 if (commentDate > currDate || currDate - commentDate > cutoff) {
66202 corePreferences("comment", null);
66203 corePreferences("hashtags", null);
66204 corePreferences("source", null);
66206 if (context.defaultChangesetComment()) {
66207 corePreferences("comment", context.defaultChangesetComment());
66208 corePreferences("commentDate", Date.now());
66210 if (context.defaultChangesetSource()) {
66211 corePreferences("source", context.defaultChangesetSource());
66212 corePreferences("commentDate", Date.now());
66214 if (context.defaultChangesetHashtags()) {
66215 corePreferences("hashtags", context.defaultChangesetHashtags());
66216 corePreferences("commentDate", Date.now());
66218 var detected = utilDetect();
66220 comment: corePreferences("comment") || "",
66221 created_by: context.cleanTagValue("iD " + context.version),
66222 host: context.cleanTagValue(detected.host),
66223 locale: context.cleanTagValue(_mainLocalizer.localeCode())
66225 findHashtags(tags, true);
66226 var hashtags = corePreferences("hashtags");
66228 tags.hashtags = hashtags;
66230 var source = corePreferences("source");
66232 tags.source = source;
66234 var photoOverlaysUsed = context.history().photoOverlaysUsed();
66235 if (photoOverlaysUsed.length) {
66236 var sources = (tags.source || "").split(";");
66237 if (sources.indexOf("streetlevel imagery") === -1) {
66238 sources.push("streetlevel imagery");
66240 photoOverlaysUsed.forEach(function(photoOverlay) {
66241 if (sources.indexOf(photoOverlay) === -1) {
66242 sources.push(photoOverlay);
66245 tags.source = context.cleanTagValue(sources.join(";"));
66247 context.changeset = new osmChangeset({ tags });
66249 function loadDerivedChangesetTags() {
66250 var osm = context.connection();
66253 var tags = Object.assign({}, context.changeset.tags);
66254 var imageryUsed = context.cleanTagValue(context.history().imageryUsed().join(";"));
66255 tags.imagery_used = imageryUsed || "None";
66256 var osmClosed = osm.getClosedIDs();
66258 if (osmClosed.length) {
66259 tags["closed:note"] = context.cleanTagValue(osmClosed.join(";"));
66261 if (services.keepRight) {
66262 var krClosed = services.keepRight.getClosedIDs();
66263 if (krClosed.length) {
66264 tags["closed:keepright"] = context.cleanTagValue(krClosed.join(";"));
66267 if (services.improveOSM) {
66268 var iOsmClosed = services.improveOSM.getClosedCounts();
66269 for (itemType in iOsmClosed) {
66270 tags["closed:improveosm:" + itemType] = context.cleanTagValue(iOsmClosed[itemType].toString());
66273 if (services.osmose) {
66274 var osmoseClosed = services.osmose.getClosedCounts();
66275 for (itemType in osmoseClosed) {
66276 tags["closed:osmose:" + itemType] = context.cleanTagValue(osmoseClosed[itemType].toString());
66279 for (var key in tags) {
66280 if (key.match(/(^warnings:)|(^resolved:)/)) {
66284 function addIssueCounts(issues, prefix) {
66285 var issuesByType = utilArrayGroupBy(issues, "type");
66286 for (var issueType in issuesByType) {
66287 var issuesOfType = issuesByType[issueType];
66288 if (issuesOfType[0].subtype) {
66289 var issuesBySubtype = utilArrayGroupBy(issuesOfType, "subtype");
66290 for (var issueSubtype in issuesBySubtype) {
66291 var issuesOfSubtype = issuesBySubtype[issueSubtype];
66292 tags[prefix + ":" + issueType + ":" + issueSubtype] = context.cleanTagValue(issuesOfSubtype.length.toString());
66295 tags[prefix + ":" + issueType] = context.cleanTagValue(issuesOfType.length.toString());
66299 var warnings = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeIgnored: true, includeDisabledRules: true }).warning.filter(function(issue) {
66300 return issue.type !== "help_request";
66302 addIssueCounts(warnings, "warnings");
66303 var resolvedIssues = context.validator().getResolvedIssues();
66304 addIssueCounts(resolvedIssues, "resolved");
66305 context.changeset = context.changeset.update({ tags });
66307 function render(selection2) {
66308 var osm = context.connection();
66311 var header = selection2.selectAll(".header").data([0]);
66312 var headerTitle = header.enter().append("div").attr("class", "header fillL");
66313 headerTitle.append("div").append("h2").call(_t.append("commit.title"));
66314 headerTitle.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
66315 dispatch14.call("cancel", this);
66316 }).call(svgIcon("#iD-icon-close"));
66317 var body = selection2.selectAll(".body").data([0]);
66318 body = body.enter().append("div").attr("class", "body").merge(body);
66319 var changesetSection = body.selectAll(".changeset-editor").data([0]);
66320 changesetSection = changesetSection.enter().append("div").attr("class", "modal-section changeset-editor").merge(changesetSection);
66321 changesetSection.call(
66322 changesetEditor.changesetID(context.changeset.id).tags(context.changeset.tags)
66324 body.call(commitWarnings);
66325 var saveSection = body.selectAll(".save-section").data([0]);
66326 saveSection = saveSection.enter().append("div").attr("class", "modal-section save-section fillL").merge(saveSection);
66327 var prose = saveSection.selectAll(".commit-info").data([0]);
66328 if (prose.enter().size()) {
66329 _userDetails2 = null;
66331 prose = prose.enter().append("p").attr("class", "commit-info").call(_t.append("commit.upload_explanation")).merge(prose);
66332 osm.userDetails(function(err, user) {
66335 if (_userDetails2 === user)
66337 _userDetails2 = user;
66338 var userLink = select_default2(document.createElement("div"));
66339 if (user.image_url) {
66340 userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
66342 userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
66343 prose.html(_t.html("commit.upload_explanation_with_user", { user: { html: userLink.html() } }));
66345 var requestReview = saveSection.selectAll(".request-review").data([0]);
66346 var requestReviewEnter = requestReview.enter().append("div").attr("class", "request-review");
66347 var requestReviewDomId = utilUniqueDomId("commit-input-request-review");
66348 var labelEnter = requestReviewEnter.append("label").attr("for", requestReviewDomId);
66349 if (!labelEnter.empty()) {
66350 labelEnter.call(uiTooltip().title(() => _t.append("commit.request_review_info")).placement("top"));
66352 labelEnter.append("input").attr("type", "checkbox").attr("id", requestReviewDomId);
66353 labelEnter.append("span").call(_t.append("commit.request_review"));
66354 requestReview = requestReview.merge(requestReviewEnter);
66355 var requestReviewInput = requestReview.selectAll("input").property("checked", isReviewRequested(context.changeset.tags)).on("change", toggleRequestReview);
66356 var buttonSection = saveSection.selectAll(".buttons").data([0]);
66357 var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons fillL");
66358 buttonEnter.append("button").attr("class", "secondary-action button cancel-button").append("span").attr("class", "label").call(_t.append("commit.cancel"));
66359 var uploadButton = buttonEnter.append("button").attr("class", "action button save-button");
66360 uploadButton.append("span").attr("class", "label").call(_t.append("commit.save"));
66361 var uploadBlockerTooltipText = getUploadBlockerMessage();
66362 buttonSection = buttonSection.merge(buttonEnter);
66363 buttonSection.selectAll(".cancel-button").on("click.cancel", function() {
66364 dispatch14.call("cancel", this);
66366 buttonSection.selectAll(".save-button").classed("disabled", uploadBlockerTooltipText !== null).on("click.save", function() {
66367 if (!select_default2(this).classed("disabled")) {
66369 for (var key in context.changeset.tags) {
66371 delete context.changeset.tags[key];
66373 context.uploader().save(context.changeset);
66376 uiTooltip().destroyAny(buttonSection.selectAll(".save-button"));
66377 if (uploadBlockerTooltipText) {
66378 buttonSection.selectAll(".save-button").call(uiTooltip().title(() => uploadBlockerTooltipText).placement("top"));
66380 var tagSection = body.selectAll(".tag-section.raw-tag-editor").data([0]);
66381 tagSection = tagSection.enter().append("div").attr("class", "modal-section tag-section raw-tag-editor").merge(tagSection);
66383 rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
66385 var changesSection = body.selectAll(".commit-changes-section").data([0]);
66386 changesSection = changesSection.enter().append("div").attr("class", "modal-section commit-changes-section").merge(changesSection);
66387 changesSection.call(commitChanges.render);
66388 function toggleRequestReview() {
66389 var rr = requestReviewInput.property("checked");
66390 updateChangeset({ review_requested: rr ? "yes" : void 0 });
66392 rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
66396 function getUploadBlockerMessage() {
66397 var errors = context.validator().getIssuesBySeverity({ what: "edited", where: "all" }).error;
66398 if (errors.length) {
66399 return _t.append("commit.outstanding_errors_message", { count: errors.length });
66401 var hasChangesetComment = context.changeset && context.changeset.tags.comment && context.changeset.tags.comment.trim().length;
66402 if (!hasChangesetComment) {
66403 return _t.append("commit.comment_needed_message");
66408 function changeTags(_2, changed, onInput) {
66409 if (changed.hasOwnProperty("comment")) {
66410 if (changed.comment === void 0) {
66411 changed.comment = "";
66414 corePreferences("comment", changed.comment);
66415 corePreferences("commentDate", Date.now());
66418 if (changed.hasOwnProperty("source")) {
66419 if (changed.source === void 0) {
66420 corePreferences("source", null);
66421 } else if (!onInput) {
66422 corePreferences("source", changed.source);
66423 corePreferences("commentDate", Date.now());
66426 updateChangeset(changed, onInput);
66428 _selection.call(render);
66431 function findHashtags(tags, commentOnly) {
66432 var detectedHashtags = commentHashtags();
66433 if (detectedHashtags.length) {
66434 corePreferences("hashtags", null);
66436 if (!detectedHashtags.length || !commentOnly) {
66437 detectedHashtags = detectedHashtags.concat(hashtagHashtags());
66439 var allLowerCase = /* @__PURE__ */ new Set();
66440 return detectedHashtags.filter(function(hashtag) {
66441 var lowerCase = hashtag.toLowerCase();
66442 if (!allLowerCase.has(lowerCase)) {
66443 allLowerCase.add(lowerCase);
66448 function commentHashtags() {
66449 var matches = (tags.comment || "").replace(/http\S*/g, "").match(hashtagRegex);
66450 return matches || [];
66452 function hashtagHashtags() {
66453 var matches = (tags.hashtags || "").split(/[,;\s]+/).map(function(s2) {
66454 if (s2[0] !== "#") {
66457 var matched = s2.match(hashtagRegex);
66458 return matched && matched[0];
66459 }).filter(Boolean);
66460 return matches || [];
66463 function isReviewRequested(tags) {
66464 var rr = tags.review_requested;
66467 rr = rr.trim().toLowerCase();
66468 return !(rr === "" || rr === "no");
66470 function updateChangeset(changed, onInput) {
66471 var tags = Object.assign({}, context.changeset.tags);
66472 Object.keys(changed).forEach(function(k2) {
66473 var v2 = changed[k2];
66474 k2 = context.cleanTagKey(k2);
66475 if (readOnlyTags.indexOf(k2) !== -1)
66477 if (v2 === void 0) {
66479 } else if (onInput) {
66482 tags[k2] = context.cleanTagValue(v2);
66486 var commentOnly = changed.hasOwnProperty("comment") && changed.comment !== "";
66487 var arr = findHashtags(tags, commentOnly);
66489 tags.hashtags = context.cleanTagValue(arr.join(";"));
66490 corePreferences("hashtags", tags.hashtags);
66492 delete tags.hashtags;
66493 corePreferences("hashtags", null);
66496 if (_userDetails2 && _userDetails2.changesets_count !== void 0) {
66497 var changesetsCount = parseInt(_userDetails2.changesets_count, 10) + 1;
66498 tags.changesets_count = String(changesetsCount);
66499 if (changesetsCount <= 100) {
66501 s2 = corePreferences("walkthrough_completed");
66503 tags["ideditor:walkthrough_completed"] = s2;
66505 s2 = corePreferences("walkthrough_progress");
66507 tags["ideditor:walkthrough_progress"] = s2;
66509 s2 = corePreferences("walkthrough_started");
66511 tags["ideditor:walkthrough_started"] = s2;
66515 delete tags.changesets_count;
66517 if (!(0, import_fast_deep_equal9.default)(context.changeset.tags, tags)) {
66518 context.changeset = context.changeset.update({ tags });
66521 commit.reset = function() {
66522 context.changeset = null;
66524 return utilRebind(commit, dispatch14, "on");
66527 // modules/ui/confirm.js
66528 function uiConfirm(selection2) {
66529 var modalSelection = uiModal(selection2);
66530 modalSelection.select(".modal").classed("modal-alert", true);
66531 var section = modalSelection.select(".content");
66532 section.append("div").attr("class", "modal-section header");
66533 section.append("div").attr("class", "modal-section message-text");
66534 var buttons = section.append("div").attr("class", "modal-section buttons cf");
66535 modalSelection.okButton = function() {
66536 buttons.append("button").attr("class", "button ok-button action").on("click.confirm", function() {
66537 modalSelection.remove();
66538 }).call(_t.append("confirm.okay")).node().focus();
66539 return modalSelection;
66541 return modalSelection;
66544 // modules/ui/conflicts.js
66545 function uiConflicts(context) {
66546 var dispatch14 = dispatch_default("cancel", "save");
66547 var keybinding = utilKeybinding("conflicts");
66550 var _shownConflictIndex;
66551 function keybindingOn() {
66552 select_default2(document).call(keybinding.on("\u238B", cancel, true));
66554 function keybindingOff() {
66555 select_default2(document).call(keybinding.unbind);
66557 function tryAgain() {
66559 dispatch14.call("save");
66561 function cancel() {
66563 dispatch14.call("cancel");
66565 function conflicts(selection2) {
66567 var headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
66568 headerEnter.append("button").attr("class", "fr").attr("title", _t("icons.close")).on("click", cancel).call(svgIcon("#iD-icon-close"));
66569 headerEnter.append("h2").call(_t.append("save.conflict.header"));
66570 var bodyEnter = selection2.selectAll(".body").data([0]).enter().append("div").attr("class", "body fillL");
66571 var conflictsHelpEnter = bodyEnter.append("div").attr("class", "conflicts-help").call(_t.append("save.conflict.help"));
66572 var changeset = new osmChangeset();
66573 delete changeset.id;
66574 var data = JXON.stringify(changeset.osmChangeJXON(_origChanges));
66575 var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
66576 var fileName = "changes.osc";
66577 var linkEnter = conflictsHelpEnter.selectAll(".download-changes").append("a").attr("class", "download-changes");
66578 linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
66579 linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("save.conflict.download_changes"));
66580 bodyEnter.append("div").attr("class", "conflict-container fillL3").call(showConflict, 0);
66581 bodyEnter.append("div").attr("class", "conflicts-done").attr("opacity", 0).style("display", "none").call(_t.append("save.conflict.done"));
66582 var buttonsEnter = bodyEnter.append("div").attr("class", "buttons col12 joined conflicts-buttons");
66583 buttonsEnter.append("button").attr("disabled", _conflictList.length > 1).attr("class", "action conflicts-button col6").call(_t.append("save.title")).on("click.try_again", tryAgain);
66584 buttonsEnter.append("button").attr("class", "secondary-action conflicts-button col6").call(_t.append("confirm.cancel")).on("click.cancel", cancel);
66586 function showConflict(selection2, index) {
66587 index = utilWrap(index, _conflictList.length);
66588 _shownConflictIndex = index;
66589 var parent = select_default2(selection2.node().parentNode);
66590 if (index === _conflictList.length - 1) {
66591 window.setTimeout(function() {
66592 parent.select(".conflicts-button").attr("disabled", null);
66593 parent.select(".conflicts-done").transition().attr("opacity", 1).style("display", "block");
66596 var conflict = selection2.selectAll(".conflict").data([_conflictList[index]]);
66597 conflict.exit().remove();
66598 var conflictEnter = conflict.enter().append("div").attr("class", "conflict");
66599 conflictEnter.append("h4").attr("class", "conflict-count").call(_t.append("save.conflict.count", { num: index + 1, total: _conflictList.length }));
66600 conflictEnter.append("a").attr("class", "conflict-description").attr("href", "#").text(function(d2) {
66602 }).on("click", function(d3_event, d2) {
66603 d3_event.preventDefault();
66604 zoomToEntity(d2.id);
66606 var details = conflictEnter.append("div").attr("class", "conflict-detail-container");
66607 details.append("ul").attr("class", "conflict-detail-list").selectAll("li").data(function(d2) {
66608 return d2.details || [];
66609 }).enter().append("li").attr("class", "conflict-detail-item").html(function(d2) {
66612 details.append("div").attr("class", "conflict-choices").call(addChoices);
66613 details.append("div").attr("class", "conflict-nav-buttons joined cf").selectAll("button").data(["previous", "next"]).enter().append("button").attr("class", "conflict-nav-button action col6").attr("disabled", function(d2, i3) {
66614 return i3 === 0 && index === 0 || i3 === 1 && index === _conflictList.length - 1 || null;
66615 }).on("click", function(d3_event, d2) {
66616 d3_event.preventDefault();
66617 var container = parent.selectAll(".conflict-container");
66618 var sign2 = d2 === "previous" ? -1 : 1;
66619 container.selectAll(".conflict").remove();
66620 container.call(showConflict, index + sign2);
66621 }).each(function(d2) {
66622 _t.append("save.conflict." + d2)(select_default2(this));
66625 function addChoices(selection2) {
66626 var choices = selection2.append("ul").attr("class", "layer-list").selectAll("li").data(function(d2) {
66627 return d2.choices || [];
66629 var choicesEnter = choices.enter().append("li").attr("class", "layer");
66630 var labelEnter = choicesEnter.append("label");
66631 labelEnter.append("input").attr("type", "radio").attr("name", function(d2) {
66633 }).on("change", function(d3_event, d2) {
66634 var ul = this.parentNode.parentNode.parentNode;
66635 ul.__data__.chosen = d2.id;
66636 choose(d3_event, ul, d2);
66638 labelEnter.append("span").text(function(d2) {
66641 choicesEnter.merge(choices).each(function(d2) {
66642 var ul = this.parentNode;
66643 if (ul.__data__.chosen === d2.id) {
66644 choose(null, ul, d2);
66648 function choose(d3_event, ul, datum2) {
66650 d3_event.preventDefault();
66651 select_default2(ul).selectAll("li").classed("active", function(d2) {
66652 return d2 === datum2;
66653 }).selectAll("input").property("checked", function(d2) {
66654 return d2 === datum2;
66656 var extent = geoExtent();
66658 entity = context.graph().hasEntity(datum2.id);
66660 extent._extend(entity.extent(context.graph()));
66662 entity = context.graph().hasEntity(datum2.id);
66664 extent._extend(entity.extent(context.graph()));
66665 zoomToEntity(datum2.id, extent);
66667 function zoomToEntity(id2, extent) {
66668 context.surface().selectAll(".hover").classed("hover", false);
66669 var entity = context.graph().hasEntity(id2);
66672 context.map().trimmedExtent(extent);
66674 context.map().zoomToEase(entity);
66676 context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
66679 conflicts.conflictList = function(_2) {
66680 if (!arguments.length)
66681 return _conflictList;
66682 _conflictList = _2;
66685 conflicts.origChanges = function(_2) {
66686 if (!arguments.length)
66687 return _origChanges;
66691 conflicts.shownEntityIds = function() {
66692 if (_conflictList && typeof _shownConflictIndex === "number") {
66693 return [_conflictList[_shownConflictIndex].id];
66697 return utilRebind(conflicts, dispatch14, "on");
66700 // modules/ui/entity_editor.js
66701 var import_fast_deep_equal10 = __toESM(require_fast_deep_equal());
66703 // modules/ui/sections/entity_issues.js
66704 function uiSectionEntityIssues(context) {
66705 var preference = corePreferences("entity-issues.reference.expanded");
66706 var _expanded = preference === null ? true : preference === "true";
66707 var _entityIDs = [];
66709 var _activeIssueID;
66710 var section = uiSection("entity-issues", context).shouldDisplay(function() {
66711 return _issues.length > 0;
66712 }).label(function() {
66713 return _t.append("inspector.title_count", { title: _t("issues.list_title"), count: _issues.length });
66714 }).disclosureContent(renderDisclosureContent);
66715 context.validator().on("validated.entity_issues", function() {
66717 section.reRender();
66718 }).on("focusedIssue.entity_issues", function(issue) {
66719 makeActiveIssue(issue.id);
66721 function reloadIssues() {
66722 _issues = context.validator().getSharedEntityIssues(_entityIDs, { includeDisabledRules: true });
66724 function makeActiveIssue(issueID) {
66725 _activeIssueID = issueID;
66726 section.selection().selectAll(".issue-container").classed("active", function(d2) {
66727 return d2.id === _activeIssueID;
66730 function renderDisclosureContent(selection2) {
66731 selection2.classed("grouped-items-area", true);
66732 _activeIssueID = _issues.length > 0 ? _issues[0].id : null;
66733 var containers = selection2.selectAll(".issue-container").data(_issues, function(d2) {
66736 containers.exit().remove();
66737 var containersEnter = containers.enter().append("div").attr("class", "issue-container");
66738 var itemsEnter = containersEnter.append("div").attr("class", function(d2) {
66739 return "issue severity-" + d2.severity;
66740 }).on("mouseover.highlight", function(d3_event, d2) {
66741 var ids = d2.entityIds.filter(function(e3) {
66742 return _entityIDs.indexOf(e3) === -1;
66744 utilHighlightEntities(ids, true, context);
66745 }).on("mouseout.highlight", function(d3_event, d2) {
66746 var ids = d2.entityIds.filter(function(e3) {
66747 return _entityIDs.indexOf(e3) === -1;
66749 utilHighlightEntities(ids, false, context);
66751 var labelsEnter = itemsEnter.append("div").attr("class", "issue-label");
66752 var textEnter = labelsEnter.append("button").attr("class", "issue-text").on("click", function(d3_event, d2) {
66753 makeActiveIssue(d2.id);
66754 var extent = d2.extent(context.graph());
66756 var setZoom = Math.max(context.map().zoom(), 19);
66757 context.map().unobscuredCenterZoomEase(extent.center(), setZoom);
66760 textEnter.each(function(d2) {
66761 var iconName = "#iD-icon-" + (d2.severity === "warning" ? "alert" : "error");
66762 select_default2(this).call(svgIcon(iconName, "issue-icon"));
66764 textEnter.append("span").attr("class", "issue-message");
66765 var infoButton = labelsEnter.append("button").attr("class", "issue-info-button").attr("title", _t("icons.information")).call(svgIcon("#iD-icon-inspect"));
66766 infoButton.on("click", function(d3_event) {
66767 d3_event.stopPropagation();
66768 d3_event.preventDefault();
66770 var container = select_default2(this.parentNode.parentNode.parentNode);
66771 var info = container.selectAll(".issue-info");
66772 var isExpanded = info.classed("expanded");
66773 _expanded = !isExpanded;
66774 corePreferences("entity-issues.reference.expanded", _expanded);
66776 info.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
66777 info.classed("expanded", false);
66780 info.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1").on("end", function() {
66781 info.style("max-height", null);
66785 itemsEnter.append("ul").attr("class", "issue-fix-list");
66786 containersEnter.append("div").attr("class", "issue-info" + (_expanded ? " expanded" : "")).style("max-height", _expanded ? null : "0").style("opacity", _expanded ? "1" : "0").each(function(d2) {
66787 if (typeof d2.reference === "function") {
66788 select_default2(this).call(d2.reference);
66790 select_default2(this).call(_t.append("inspector.no_documentation_key"));
66793 containers = containers.merge(containersEnter).classed("active", function(d2) {
66794 return d2.id === _activeIssueID;
66796 containers.selectAll(".issue-message").text("").each(function(d2) {
66797 return d2.message(context)(select_default2(this));
66799 var fixLists = containers.selectAll(".issue-fix-list");
66800 var fixes = fixLists.selectAll(".issue-fix-item").data(function(d2) {
66801 return d2.fixes ? d2.fixes(context) : [];
66805 fixes.exit().remove();
66806 var fixesEnter = fixes.enter().append("li").attr("class", "issue-fix-item");
66807 var buttons = fixesEnter.append("button").on("click", function(d3_event, d2) {
66808 if (select_default2(this).attr("disabled") || !d2.onClick)
66810 if (d2.issue.dateLastRanFix && /* @__PURE__ */ new Date() - d2.issue.dateLastRanFix < 1e3)
66812 d2.issue.dateLastRanFix = /* @__PURE__ */ new Date();
66813 utilHighlightEntities(d2.issue.entityIds.concat(d2.entityIds), false, context);
66814 new Promise(function(resolve, reject) {
66815 d2.onClick(context, resolve, reject);
66816 if (d2.onClick.length <= 1) {
66819 }).then(function() {
66820 context.validator().validate();
66822 }).on("mouseover.highlight", function(d3_event, d2) {
66823 utilHighlightEntities(d2.entityIds, true, context);
66824 }).on("mouseout.highlight", function(d3_event, d2) {
66825 utilHighlightEntities(d2.entityIds, false, context);
66827 buttons.each(function(d2) {
66828 var iconName = d2.icon || "iD-icon-wrench";
66829 if (iconName.startsWith("maki")) {
66832 select_default2(this).call(svgIcon("#" + iconName, "fix-icon"));
66834 buttons.append("span").attr("class", "fix-message").each(function(d2) {
66835 return d2.title(select_default2(this));
66837 fixesEnter.merge(fixes).selectAll("button").classed("actionable", function(d2) {
66839 }).attr("disabled", function(d2) {
66840 return d2.onClick ? null : "true";
66841 }).attr("title", function(d2) {
66842 if (d2.disabledReason) {
66843 return d2.disabledReason;
66848 section.entityIDs = function(val) {
66849 if (!arguments.length)
66851 if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
66853 _activeIssueID = null;
66861 // modules/ui/preset_icon.js
66862 function uiPresetIcon() {
66865 function presetIcon(selection2) {
66866 selection2.each(render);
66868 function getIcon(p2, geom) {
66869 if (p2.isFallback && p2.isFallback())
66870 return geom === "vertex" ? "" : "iD-icon-" + p2.id;
66873 if (geom === "line")
66874 return "iD-other-line";
66875 if (geom === "vertex")
66876 return "temaki-vertex";
66877 return "maki-marker-stroked";
66879 function renderPointBorder(container, drawPoint) {
66880 let pointBorder = container.selectAll(".preset-icon-point-border").data(drawPoint ? [0] : []);
66881 pointBorder.exit().remove();
66882 let pointBorderEnter = pointBorder.enter();
66885 pointBorderEnter.append("svg").attr("class", "preset-icon-fill preset-icon-point-border").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`).append("path").attr("transform", "translate(11.5, 8)").attr("d", "M 17,8 C 17,13 11,21 8.5,23.5 C 6,21 0,13 0,8 C 0,4 4,-0.5 8.5,-0.5 C 13,-0.5 17,4 17,8 z");
66886 pointBorder = pointBorderEnter.merge(pointBorder);
66888 function renderCategoryBorder(container, category) {
66889 let categoryBorder = container.selectAll(".preset-icon-category-border").data(category ? [0] : []);
66890 categoryBorder.exit().remove();
66891 let categoryBorderEnter = categoryBorder.enter();
66893 let svgEnter = categoryBorderEnter.append("svg").attr("class", "preset-icon-fill preset-icon-category-border").attr("width", d2).attr("height", d2).attr("viewBox", `0 0 ${d2} ${d2}`);
66894 svgEnter.append("path").attr("class", "area").attr("d", "M9.5,7.5 L25.5,7.5 L28.5,12.5 L49.5,12.5 C51.709139,12.5 53.5,14.290861 53.5,16.5 L53.5,43.5 C53.5,45.709139 51.709139,47.5 49.5,47.5 L10.5,47.5 C8.290861,47.5 6.5,45.709139 6.5,43.5 L6.5,12.5 L9.5,7.5 Z");
66895 categoryBorder = categoryBorderEnter.merge(categoryBorder);
66897 categoryBorder.selectAll("path").attr("class", `area ${category.id}`);
66900 function renderCircleFill(container, drawVertex) {
66901 let vertexFill = container.selectAll(".preset-icon-fill-vertex").data(drawVertex ? [0] : []);
66902 vertexFill.exit().remove();
66903 let vertexFillEnter = vertexFill.enter();
66907 vertexFillEnter.append("svg").attr("class", "preset-icon-fill preset-icon-fill-vertex").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`).append("circle").attr("cx", w2 / 2).attr("cy", h2 / 2).attr("r", d2 / 2);
66908 vertexFill = vertexFillEnter.merge(vertexFill);
66910 function renderSquareFill(container, drawArea, tagClasses) {
66911 let fill = container.selectAll(".preset-icon-fill-area").data(drawArea ? [0] : []);
66912 fill.exit().remove();
66913 let fillEnter = fill.enter();
66917 const l2 = d2 * 2 / 3;
66918 const c1 = (w2 - l2) / 2;
66919 const c2 = c1 + l2;
66920 fillEnter = fillEnter.append("svg").attr("class", "preset-icon-fill preset-icon-fill-area").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`);
66921 ["fill", "stroke"].forEach((klass) => {
66922 fillEnter.append("path").attr("d", `M${c1} ${c1} L${c1} ${c2} L${c2} ${c2} L${c2} ${c1} Z`).attr("class", `area ${klass}`);
66924 const rVertex = 2.5;
66925 [[c1, c1], [c1, c2], [c2, c2], [c2, c1]].forEach((point2) => {
66926 fillEnter.append("circle").attr("class", "vertex").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", rVertex);
66928 const rMidpoint = 1.25;
66929 [[c1, w2 / 2], [c2, w2 / 2], [h2 / 2, c1], [h2 / 2, c2]].forEach((point2) => {
66930 fillEnter.append("circle").attr("class", "midpoint").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", rMidpoint);
66932 fill = fillEnter.merge(fill);
66933 fill.selectAll("path.stroke").attr("class", `area stroke ${tagClasses}`);
66934 fill.selectAll("path.fill").attr("class", `area fill ${tagClasses}`);
66936 function renderLine(container, drawLine, tagClasses) {
66937 let line = container.selectAll(".preset-icon-line").data(drawLine ? [0] : []);
66938 line.exit().remove();
66939 let lineEnter = line.enter();
66943 const y2 = Math.round(d2 * 0.72);
66944 const l2 = Math.round(d2 * 0.6);
66946 const x12 = (w2 - l2) / 2;
66947 const x2 = x12 + l2;
66948 lineEnter = lineEnter.append("svg").attr("class", "preset-icon-line").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`);
66949 ["casing", "stroke"].forEach((klass) => {
66950 lineEnter.append("path").attr("d", `M${x12} ${y2} L${x2} ${y2}`).attr("class", `line ${klass}`);
66952 [[x12 - 1, y2], [x2 + 1, y2]].forEach((point2) => {
66953 lineEnter.append("circle").attr("class", "vertex").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", r2);
66955 line = lineEnter.merge(line);
66956 line.selectAll("path.stroke").attr("class", `line stroke ${tagClasses}`);
66957 line.selectAll("path.casing").attr("class", `line casing ${tagClasses}`);
66959 function renderRoute(container, drawRoute, p2) {
66960 let route = container.selectAll(".preset-icon-route").data(drawRoute ? [0] : []);
66961 route.exit().remove();
66962 let routeEnter = route.enter();
66966 const y12 = Math.round(d2 * 0.8);
66967 const y2 = Math.round(d2 * 0.68);
66968 const l2 = Math.round(d2 * 0.6);
66970 const x12 = (w2 - l2) / 2;
66971 const x2 = x12 + l2 / 3;
66972 const x3 = x2 + l2 / 3;
66973 const x4 = x3 + l2 / 3;
66974 routeEnter = routeEnter.append("svg").attr("class", "preset-icon-route").attr("width", w2).attr("height", h2).attr("viewBox", `0 0 ${w2} ${h2}`);
66975 ["casing", "stroke"].forEach((klass) => {
66976 routeEnter.append("path").attr("d", `M${x12} ${y12} L${x2} ${y2}`).attr("class", `segment0 line ${klass}`);
66977 routeEnter.append("path").attr("d", `M${x2} ${y2} L${x3} ${y12}`).attr("class", `segment1 line ${klass}`);
66978 routeEnter.append("path").attr("d", `M${x3} ${y12} L${x4} ${y2}`).attr("class", `segment2 line ${klass}`);
66980 [[x12, y12], [x2, y2], [x3, y12], [x4, y2]].forEach((point2) => {
66981 routeEnter.append("circle").attr("class", "vertex").attr("cx", point2[0]).attr("cy", point2[1]).attr("r", r2);
66983 route = routeEnter.merge(route);
66985 let routeType = p2.tags.type === "waterway" ? "waterway" : p2.tags.route;
66986 const segmentPresetIDs = routeSegments[routeType];
66987 for (let i3 in segmentPresetIDs) {
66988 const segmentPreset = _mainPresetIndex.item(segmentPresetIDs[i3]);
66989 const segmentTagClasses = svgTagClasses().getClassesString(segmentPreset.tags, "");
66990 route.selectAll(`path.stroke.segment${i3}`).attr("class", `segment${i3} line stroke ${segmentTagClasses}`);
66991 route.selectAll(`path.casing.segment${i3}`).attr("class", `segment${i3} line casing ${segmentTagClasses}`);
66995 function renderSvgIcon(container, picon, geom, isFramed, category, tagClasses) {
66996 const isMaki = picon && /^maki-/.test(picon);
66997 const isTemaki = picon && /^temaki-/.test(picon);
66998 const isFa = picon && /^fa[srb]-/.test(picon);
66999 const isR\u00F6ntgen = picon && /^roentgen-/.test(picon);
67000 const isiDIcon = picon && !(isMaki || isTemaki || isFa || isR\u00F6ntgen);
67001 let icon2 = container.selectAll(".preset-icon").data(picon ? [0] : []);
67002 icon2.exit().remove();
67003 icon2 = icon2.enter().append("div").attr("class", "preset-icon").call(svgIcon("")).merge(icon2);
67004 icon2.attr("class", "preset-icon " + (geom ? geom + "-geom" : "")).classed("category", category).classed("framed", isFramed).classed("preset-icon-iD", isiDIcon);
67005 icon2.selectAll("svg").attr("class", "icon " + picon + " " + (!isiDIcon && geom !== "line" ? "" : tagClasses));
67006 icon2.selectAll("use").attr("href", "#" + picon);
67008 function renderImageIcon(container, imageURL) {
67009 let imageIcon = container.selectAll("img.image-icon").data(imageURL ? [0] : []);
67010 imageIcon.exit().remove();
67011 imageIcon = imageIcon.enter().append("img").attr("class", "image-icon").on("load", () => container.classed("showing-img", true)).on("error", () => container.classed("showing-img", false)).merge(imageIcon);
67012 imageIcon.attr("src", imageURL);
67014 const routeSegments = {
67015 bicycle: ["highway/cycleway", "highway/cycleway", "highway/cycleway"],
67016 bus: ["highway/unclassified", "highway/secondary", "highway/primary"],
67017 trolleybus: ["highway/unclassified", "highway/secondary", "highway/primary"],
67018 detour: ["highway/tertiary", "highway/residential", "highway/unclassified"],
67019 ferry: ["route/ferry", "route/ferry", "route/ferry"],
67020 foot: ["highway/footway", "highway/footway", "highway/footway"],
67021 hiking: ["highway/path", "highway/path", "highway/path"],
67022 horse: ["highway/bridleway", "highway/bridleway", "highway/bridleway"],
67023 light_rail: ["railway/light_rail", "railway/light_rail", "railway/light_rail"],
67024 monorail: ["railway/monorail", "railway/monorail", "railway/monorail"],
67025 mtb: ["highway/path", "highway/track", "highway/bridleway"],
67026 pipeline: ["man_made/pipeline", "man_made/pipeline", "man_made/pipeline"],
67027 piste: ["piste/downhill", "piste/hike", "piste/nordic"],
67028 power: ["power/line", "power/line", "power/line"],
67029 road: ["highway/secondary", "highway/primary", "highway/trunk"],
67030 subway: ["railway/subway", "railway/subway", "railway/subway"],
67031 train: ["railway/rail", "railway/rail", "railway/rail"],
67032 tram: ["railway/tram", "railway/tram", "railway/tram"],
67033 waterway: ["waterway/stream", "waterway/stream", "waterway/stream"]
67035 function render() {
67036 let p2 = _preset.apply(this, arguments);
67037 let geom = _geometry ? _geometry.apply(this, arguments) : null;
67038 if (geom === "relation" && p2.tags && (p2.tags.type === "route" && p2.tags.route && routeSegments[p2.tags.route] || p2.tags.type === "waterway")) {
67041 const showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
67042 const isFallback = p2.isFallback && p2.isFallback();
67043 const imageURL = showThirdPartyIcons === "true" && p2.imageURL;
67044 const picon = getIcon(p2, geom);
67045 const isCategory = !p2.setTags;
67046 const drawPoint = false;
67047 const drawVertex = picon !== null && geom === "vertex";
67048 const drawLine = picon && geom === "line" && !isFallback && !isCategory;
67049 const drawArea = picon && geom === "area" && !isFallback && !isCategory;
67050 const drawRoute = picon && geom === "route";
67051 const isFramed = drawVertex || drawArea || drawLine || drawRoute || isCategory;
67052 let tags = !isCategory ? p2.setTags({}, geom) : {};
67053 for (let k2 in tags) {
67054 if (tags[k2] === "*") {
67058 let tagClasses = svgTagClasses().getClassesString(tags, "");
67059 let selection2 = select_default2(this);
67060 let container = selection2.selectAll(".preset-icon-container").data([0]);
67061 container = container.enter().append("div").attr("class", "preset-icon-container").merge(container);
67062 container.classed("showing-img", !!imageURL).classed("fallback", isFallback);
67063 renderCategoryBorder(container, isCategory && p2);
67064 renderPointBorder(container, drawPoint);
67065 renderCircleFill(container, drawVertex);
67066 renderSquareFill(container, drawArea, tagClasses);
67067 renderLine(container, drawLine, tagClasses);
67068 renderRoute(container, drawRoute, p2);
67069 renderSvgIcon(container, picon, geom, isFramed, isCategory, tagClasses);
67070 renderImageIcon(container, imageURL);
67072 presetIcon.preset = function(val) {
67073 if (!arguments.length)
67075 _preset = utilFunctor(val);
67078 presetIcon.geometry = function(val) {
67079 if (!arguments.length)
67081 _geometry = utilFunctor(val);
67087 // modules/ui/sections/feature_type.js
67088 function uiSectionFeatureType(context) {
67089 var dispatch14 = dispatch_default("choose");
67090 var _entityIDs = [];
67093 var section = uiSection("feature-type", context).label(() => _t.append("inspector.feature_type")).disclosureContent(renderDisclosureContent);
67094 function renderDisclosureContent(selection2) {
67095 selection2.classed("preset-list-item", true);
67096 selection2.classed("mixed-types", _presets.length > 1);
67097 var presetButtonWrap = selection2.selectAll(".preset-list-button-wrap").data([0]).enter().append("div").attr("class", "preset-list-button-wrap");
67098 var presetButton = presetButtonWrap.append("button").attr("class", "preset-list-button preset-reset").call(
67099 uiTooltip().title(() => _t.append("inspector.back_tooltip")).placement("bottom")
67101 presetButton.append("div").attr("class", "preset-icon-container");
67102 presetButton.append("div").attr("class", "label").append("div").attr("class", "label-inner");
67103 presetButtonWrap.append("div").attr("class", "accessory-buttons");
67104 var tagReferenceBodyWrap = selection2.selectAll(".tag-reference-body-wrap").data([0]);
67105 tagReferenceBodyWrap = tagReferenceBodyWrap.enter().append("div").attr("class", "tag-reference-body-wrap").merge(tagReferenceBodyWrap);
67106 if (_tagReference) {
67107 selection2.selectAll(".preset-list-button-wrap .accessory-buttons").style("display", _presets.length === 1 ? null : "none").call(_tagReference.button);
67108 tagReferenceBodyWrap.style("display", _presets.length === 1 ? null : "none").call(_tagReference.body);
67110 selection2.selectAll(".preset-reset").on("click", function() {
67111 dispatch14.call("choose", this, _presets);
67112 }).on("pointerdown pointerup mousedown mouseup", function(d3_event) {
67113 d3_event.preventDefault();
67114 d3_event.stopPropagation();
67116 var geometries = entityGeometries();
67117 selection2.select(".preset-list-item button").call(
67118 uiPresetIcon().geometry(_presets.length === 1 ? geometries.length === 1 && geometries[0] : null).preset(_presets.length === 1 ? _presets[0] : _mainPresetIndex.item("point"))
67120 var names = _presets.length === 1 ? [
67121 _presets[0].nameLabel(),
67122 _presets[0].subtitleLabel()
67123 ].filter(Boolean) : [_t.append("inspector.multiple_types")];
67124 var label = selection2.select(".label-inner");
67125 var nameparts = label.selectAll(".namepart").data(names, (d2) => d2.stringId);
67126 nameparts.exit().remove();
67127 nameparts.enter().append("div").attr("class", "namepart").text("").each(function(d2) {
67128 d2(select_default2(this));
67131 section.entityIDs = function(val) {
67132 if (!arguments.length)
67137 section.presets = function(val) {
67138 if (!arguments.length)
67140 if (!utilArrayIdentical(val, _presets)) {
67142 if (_presets.length === 1) {
67143 _tagReference = uiTagReference(_presets[0].reference(), context).showing(false);
67148 function entityGeometries() {
67150 for (var i3 in _entityIDs) {
67151 var geometry = context.graph().geometry(_entityIDs[i3]);
67152 if (!counts[geometry])
67153 counts[geometry] = 0;
67154 counts[geometry] += 1;
67156 return Object.keys(counts).sort(function(geom1, geom2) {
67157 return counts[geom2] - counts[geom1];
67160 return utilRebind(section, dispatch14, "on");
67163 // modules/ui/sections/preset_fields.js
67164 function uiSectionPresetFields(context) {
67165 var section = uiSection("preset-fields", context).label(() => _t.append("inspector.fields")).disclosureContent(renderDisclosureContent);
67166 var dispatch14 = dispatch_default("change", "revert");
67167 var formFields = uiFormFields(context);
67173 function renderDisclosureContent(selection2) {
67175 var graph = context.graph();
67176 var geometries = Object.keys(_entityIDs.reduce(function(geoms, entityID) {
67177 geoms[graph.entity(entityID).geometry(graph)] = true;
67180 const loc = _entityIDs.reduce(function(extent, entityID) {
67181 var entity = context.graph().entity(entityID);
67182 return extent.extend(entity.extent(context.graph()));
67183 }, geoExtent()).center();
67184 var presetsManager = _mainPresetIndex;
67185 var allFields = [];
67186 var allMoreFields = [];
67187 var sharedTotalFields;
67188 _presets.forEach(function(preset) {
67189 var fields = preset.fields(loc);
67190 var moreFields = preset.moreFields(loc);
67191 allFields = utilArrayUnion(allFields, fields);
67192 allMoreFields = utilArrayUnion(allMoreFields, moreFields);
67193 if (!sharedTotalFields) {
67194 sharedTotalFields = utilArrayUnion(fields, moreFields);
67196 sharedTotalFields = sharedTotalFields.filter(function(field) {
67197 return fields.indexOf(field) !== -1 || moreFields.indexOf(field) !== -1;
67201 var sharedFields = allFields.filter(function(field) {
67202 return sharedTotalFields.indexOf(field) !== -1;
67204 var sharedMoreFields = allMoreFields.filter(function(field) {
67205 return sharedTotalFields.indexOf(field) !== -1;
67208 sharedFields.forEach(function(field) {
67209 if (field.matchAllGeometry(geometries)) {
67211 uiField(context, field, _entityIDs)
67215 var singularEntity = _entityIDs.length === 1 && graph.hasEntity(_entityIDs[0]);
67216 if (singularEntity && singularEntity.isHighwayIntersection(graph) && presetsManager.field("restrictions")) {
67218 uiField(context, presetsManager.field("restrictions"), _entityIDs)
67221 var additionalFields = utilArrayUnion(sharedMoreFields, presetsManager.universal());
67222 additionalFields.sort(function(field1, field2) {
67223 return field1.title().localeCompare(field2.title(), _mainLocalizer.localeCode());
67225 additionalFields.forEach(function(field) {
67226 if (sharedFields.indexOf(field) === -1 && field.matchAllGeometry(geometries)) {
67228 uiField(context, field, _entityIDs, { show: false })
67232 _fieldsArr.forEach(function(field) {
67233 field.on("change", function(t2, onInput) {
67234 dispatch14.call("change", field, _entityIDs, t2, onInput);
67235 }).on("revert", function(keys2) {
67236 dispatch14.call("revert", field, keys2);
67240 _fieldsArr.forEach(function(field) {
67241 field.state(_state).tags(_tags);
67244 formFields.fieldsArr(_fieldsArr).state(_state).klass("grouped-items-area")
67247 section.presets = function(val) {
67248 if (!arguments.length)
67250 if (!_presets || !val || !utilArrayIdentical(_presets, val)) {
67256 section.state = function(val) {
67257 if (!arguments.length)
67262 section.tags = function(val) {
67263 if (!arguments.length)
67268 section.entityIDs = function(val) {
67269 if (!arguments.length)
67271 if (!val || !_entityIDs || !utilArrayIdentical(_entityIDs, val)) {
67277 return utilRebind(section, dispatch14, "on");
67280 // modules/ui/sections/raw_member_editor.js
67281 function uiSectionRawMemberEditor(context) {
67282 var section = uiSection("raw-member-editor", context).shouldDisplay(function() {
67283 if (!_entityIDs || _entityIDs.length !== 1)
67285 var entity = context.hasEntity(_entityIDs[0]);
67286 return entity && entity.type === "relation";
67287 }).label(function() {
67288 var entity = context.hasEntity(_entityIDs[0]);
67291 var gt2 = entity.members.length > _maxMembers ? ">" : "";
67292 var count = gt2 + entity.members.slice(0, _maxMembers).length;
67293 return _t.append("inspector.title_count", { title: _t("inspector.members"), count });
67294 }).disclosureContent(renderDisclosureContent);
67295 var taginfo = services.taginfo;
67297 var _maxMembers = 1e3;
67298 function downloadMember(d3_event, d2) {
67299 d3_event.preventDefault();
67300 select_default2(this.parentNode).classed("tag-reference-loading", true);
67301 context.loadEntity(d2.id, function() {
67302 section.reRender();
67305 function zoomToMember(d3_event, d2) {
67306 d3_event.preventDefault();
67307 var entity = context.entity(d2.id);
67308 context.map().zoomToEase(entity);
67309 utilHighlightEntities([d2.id], true, context);
67311 function selectMember(d3_event, d2) {
67312 d3_event.preventDefault();
67313 utilHighlightEntities([d2.id], false, context);
67314 var entity = context.entity(d2.id);
67315 var mapExtent = context.map().extent();
67316 if (!entity.intersects(mapExtent, context.graph())) {
67317 context.map().zoomToEase(entity);
67319 context.enter(modeSelect(context, [d2.id]));
67321 function changeRole(d3_event, d2) {
67322 var oldRole = d2.role;
67323 var newRole = context.cleanRelationRole(select_default2(this).property("value"));
67324 if (oldRole !== newRole) {
67325 var member = { id: d2.id, type: d2.type, role: newRole };
67327 actionChangeMember(d2.relation.id, member, d2.index),
67328 _t("operations.change_role.annotation", {
67332 context.validator().validate();
67335 function deleteMember(d3_event, d2) {
67336 utilHighlightEntities([d2.id], false, context);
67338 actionDeleteMember(d2.relation.id, d2.index),
67339 _t("operations.delete_member.annotation", {
67343 if (!context.hasEntity(d2.relation.id)) {
67344 context.enter(modeBrowse(context));
67346 context.validator().validate();
67349 function renderDisclosureContent(selection2) {
67350 var entityID = _entityIDs[0];
67351 var memberships = [];
67352 var entity = context.entity(entityID);
67353 entity.members.slice(0, _maxMembers).forEach(function(member, index) {
67360 member: context.hasEntity(member.id),
67361 domId: utilUniqueDomId(entityID + "-member-" + index)
67364 var list = selection2.selectAll(".member-list").data([0]);
67365 list = list.enter().append("ul").attr("class", "member-list").merge(list);
67366 var items = list.selectAll("li").data(memberships, function(d2) {
67367 return osmEntity.key(d2.relation) + "," + d2.index + "," + (d2.member ? osmEntity.key(d2.member) : "incomplete");
67369 items.exit().each(unbind).remove();
67370 var itemsEnter = items.enter().append("li").attr("class", "member-row form-field").classed("member-incomplete", function(d2) {
67373 itemsEnter.each(function(d2) {
67374 var item = select_default2(this);
67375 var label = item.append("label").attr("class", "field-label").attr("for", d2.domId);
67377 item.on("mouseover", function() {
67378 utilHighlightEntities([d2.id], true, context);
67379 }).on("mouseout", function() {
67380 utilHighlightEntities([d2.id], false, context);
67382 var labelLink = label.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectMember);
67383 labelLink.append("span").attr("class", "member-entity-type").text(function(d4) {
67384 var matched = _mainPresetIndex.match(d4.member, context.graph());
67385 return matched && matched.name() || utilDisplayType(d4.member.id);
67387 labelLink.append("span").attr("class", "member-entity-name").text(function(d4) {
67388 return utilDisplayName(d4.member);
67390 label.append("button").attr("title", _t("icons.remove")).attr("class", "remove member-delete").call(svgIcon("#iD-operation-delete"));
67391 label.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToMember);
67393 var labelText = label.append("span").attr("class", "label-text");
67394 labelText.append("span").attr("class", "member-entity-type").call(_t.append("inspector." + d2.type, { id: d2.id }));
67395 labelText.append("span").attr("class", "member-entity-name").call(_t.append("inspector.incomplete", { id: d2.id }));
67396 label.append("button").attr("class", "member-download").attr("title", _t("icons.download")).call(svgIcon("#iD-icon-load")).on("click", downloadMember);
67399 var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
67400 wrapEnter.append("input").attr("class", "member-role").attr("id", function(d2) {
67402 }).property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
67404 wrapEnter.each(bindTypeahead);
67406 items = items.merge(itemsEnter).order();
67407 items.select("input.member-role").property("value", function(d2) {
67409 }).on("blur", changeRole).on("change", changeRole);
67410 items.select("button.member-delete").on("click", deleteMember);
67411 var dragOrigin, targetIndex;
67413 drag_default().on("start", function(d3_event) {
67418 targetIndex = null;
67419 }).on("drag", function(d3_event) {
67420 var x2 = d3_event.x - dragOrigin.x, y2 = d3_event.y - dragOrigin.y;
67421 if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
67422 Math.sqrt(Math.pow(x2, 2) + Math.pow(y2, 2)) <= 5)
67424 var index = items.nodes().indexOf(this);
67425 select_default2(this).classed("dragging", true);
67426 targetIndex = null;
67427 selection2.selectAll("li.member-row").style("transform", function(d2, index2) {
67428 var node = select_default2(this).node();
67429 if (index === index2) {
67430 return "translate(" + x2 + "px, " + y2 + "px)";
67431 } else if (index2 > index && d3_event.y > node.offsetTop) {
67432 if (targetIndex === null || index2 > targetIndex) {
67433 targetIndex = index2;
67435 return "translateY(-100%)";
67436 } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
67437 if (targetIndex === null || index2 < targetIndex) {
67438 targetIndex = index2;
67440 return "translateY(100%)";
67444 }).on("end", function(d3_event, d2) {
67445 if (!select_default2(this).classed("dragging"))
67447 var index = items.nodes().indexOf(this);
67448 select_default2(this).classed("dragging", false);
67449 selection2.selectAll("li.member-row").style("transform", null);
67450 if (targetIndex !== null) {
67452 actionMoveMember(d2.relation.id, index, targetIndex),
67453 _t("operations.reorder_members.annotation")
67455 context.validator().validate();
67459 function bindTypeahead(d2) {
67460 var row = select_default2(this);
67461 var role = row.selectAll("input.member-role");
67462 var origValue = role.property("value");
67463 function sort(value, data) {
67464 var sameletter = [];
67466 for (var i3 = 0; i3 < data.length; i3++) {
67467 if (data[i3].value.substring(0, value.length) === value) {
67468 sameletter.push(data[i3]);
67470 other.push(data[i3]);
67473 return sameletter.concat(other);
67476 uiCombobox(context, "member-role").fetcher(function(role2, callback) {
67479 geometry = context.graph().geometry(d2.member.id);
67480 } else if (d2.type === "relation") {
67481 geometry = "relation";
67482 } else if (d2.type === "way") {
67485 geometry = "point";
67487 var rtype = entity.tags.type;
67490 rtype: rtype || "",
67493 }, function(err, data) {
67495 callback(sort(role2, data));
67497 }).on("cancel", function() {
67498 role.property("value", origValue);
67502 function unbind() {
67503 var row = select_default2(this);
67504 row.selectAll("input.member-role").call(uiCombobox.off, context);
67507 section.entityIDs = function(val) {
67508 if (!arguments.length)
67516 // modules/actions/delete_members.js
67517 function actionDeleteMembers(relationId, memberIndexes) {
67518 return function(graph) {
67519 memberIndexes.sort((a2, b2) => b2 - a2);
67520 for (var i3 in memberIndexes) {
67521 graph = actionDeleteMember(relationId, memberIndexes[i3])(graph);
67527 // modules/ui/sections/raw_membership_editor.js
67528 function uiSectionRawMembershipEditor(context) {
67529 var section = uiSection("raw-membership-editor", context).shouldDisplay(function() {
67530 return _entityIDs && _entityIDs.length;
67531 }).label(function() {
67532 var parents = getSharedParentRelations();
67533 var gt2 = parents.length > _maxMemberships ? ">" : "";
67534 var count = gt2 + parents.slice(0, _maxMemberships).length;
67535 return _t.append("inspector.title_count", { title: _t("inspector.relations"), count });
67536 }).disclosureContent(renderDisclosureContent);
67537 var taginfo = services.taginfo;
67538 var nearbyCombo = uiCombobox(context, "parent-relation").minItems(1).fetcher(fetchNearbyRelations).itemsMouseEnter(function(d3_event, d2) {
67540 utilHighlightEntities([d2.relation.id], true, context);
67541 }).itemsMouseLeave(function(d3_event, d2) {
67543 utilHighlightEntities([d2.relation.id], false, context);
67545 var _inChange = false;
67546 var _entityIDs = [];
67548 var _maxMemberships = 1e3;
67549 function getSharedParentRelations() {
67551 for (var i3 = 0; i3 < _entityIDs.length; i3++) {
67552 var entity = context.graph().hasEntity(_entityIDs[i3]);
67556 parents = context.graph().parentRelations(entity);
67558 parents = utilArrayIntersection(parents, context.graph().parentRelations(entity));
67560 if (!parents.length)
67565 function getMemberships() {
67566 var memberships = [];
67567 var relations = getSharedParentRelations().slice(0, _maxMemberships);
67568 var isMultiselect = _entityIDs.length > 1;
67569 var i3, relation, membership, index, member, indexedMember;
67570 for (i3 = 0; i3 < relations.length; i3++) {
67571 relation = relations[i3];
67575 hash: osmEntity.key(relation)
67577 for (index = 0; index < relation.members.length; index++) {
67578 member = relation.members[index];
67579 if (_entityIDs.indexOf(member.id) !== -1) {
67580 indexedMember = Object.assign({}, member, { index });
67581 membership.members.push(indexedMember);
67582 membership.hash += "," + index.toString();
67583 if (!isMultiselect) {
67584 memberships.push(membership);
67588 hash: osmEntity.key(relation)
67593 if (membership.members.length)
67594 memberships.push(membership);
67596 memberships.forEach(function(membership2) {
67597 membership2.domId = utilUniqueDomId("membership-" + membership2.relation.id);
67599 membership2.members.forEach(function(member2) {
67600 if (roles.indexOf(member2.role) === -1)
67601 roles.push(member2.role);
67603 membership2.role = roles.length === 1 ? roles[0] : roles;
67605 return memberships;
67607 function selectRelation(d3_event, d2) {
67608 d3_event.preventDefault();
67609 utilHighlightEntities([d2.relation.id], false, context);
67610 context.enter(modeSelect(context, [d2.relation.id]));
67612 function zoomToRelation(d3_event, d2) {
67613 d3_event.preventDefault();
67614 var entity = context.entity(d2.relation.id);
67615 context.map().zoomToEase(entity);
67616 utilHighlightEntities([d2.relation.id], true, context);
67618 function changeRole(d3_event, d2) {
67623 var newRole = context.cleanRelationRole(select_default2(this).property("value"));
67624 if (!newRole.trim() && typeof d2.role !== "string")
67626 var membersToUpdate = d2.members.filter(function(member) {
67627 return member.role !== newRole;
67629 if (membersToUpdate.length) {
67632 function actionChangeMemberRoles(graph) {
67633 membersToUpdate.forEach(function(member) {
67634 var newMember = Object.assign({}, member, { role: newRole });
67635 delete newMember.index;
67636 graph = actionChangeMember(d2.relation.id, newMember, member.index)(graph);
67640 _t("operations.change_role.annotation", {
67641 n: membersToUpdate.length
67644 context.validator().validate();
67648 function addMembership(d2, role) {
67650 _showBlank = false;
67651 function actionAddMembers(relationId, ids, role2) {
67652 return function(graph) {
67653 for (var i3 in ids) {
67654 var member = { id: ids[i3], type: graph.entity(ids[i3]).type, role: role2 };
67655 graph = actionAddMember(relationId, member)(graph);
67662 actionAddMembers(d2.relation.id, _entityIDs, role),
67663 _t("operations.add_member.annotation", {
67664 n: _entityIDs.length
67667 context.validator().validate();
67669 var relation = osmRelation();
67671 actionAddEntity(relation),
67672 actionAddMembers(relation.id, _entityIDs, role),
67673 _t("operations.add.annotation.relation")
67675 context.enter(modeSelect(context, [relation.id]).newFeature(true));
67678 function deleteMembership(d3_event, d2) {
67682 utilHighlightEntities([d2.relation.id], false, context);
67683 var indexes = d2.members.map(function(member) {
67684 return member.index;
67687 actionDeleteMembers(d2.relation.id, indexes),
67688 _t("operations.delete_member.annotation", {
67689 n: _entityIDs.length
67692 context.validator().validate();
67694 function fetchNearbyRelations(q2, callback) {
67695 var newRelation = {
67697 value: _t("inspector.new_relation"),
67698 display: _t.append("inspector.new_relation")
67700 var entityID = _entityIDs[0];
67702 var graph = context.graph();
67703 function baseDisplayLabel(entity) {
67704 var matched = _mainPresetIndex.match(entity, graph);
67705 var presetName = matched && matched.name() || _t("inspector.relation");
67706 var entityName = utilDisplayName(entity) || "";
67707 return presetName + " " + entityName;
67709 var explicitRelation = q2 && context.hasEntity(q2.toLowerCase());
67710 if (explicitRelation && explicitRelation.type === "relation" && explicitRelation.id !== entityID) {
67712 relation: explicitRelation,
67713 value: baseDisplayLabel(explicitRelation) + " " + explicitRelation.id
67716 context.history().intersects(context.map().extent()).forEach(function(entity) {
67717 if (entity.type !== "relation" || entity.id === entityID)
67719 var value = baseDisplayLabel(entity);
67720 if (q2 && (value + " " + entity.id).toLowerCase().indexOf(q2.toLowerCase()) === -1)
67722 result.push({ relation: entity, value });
67724 result.sort(function(a2, b2) {
67725 return osmRelation.creationOrder(a2.relation, b2.relation);
67727 var dupeGroups = Object.values(utilArrayGroupBy(result, "value")).filter(function(v2) {
67728 return v2.length > 1;
67730 dupeGroups.forEach(function(group) {
67731 group.forEach(function(obj) {
67732 obj.value += " " + obj.relation.id;
67736 result.forEach(function(obj) {
67737 obj.title = obj.value;
67739 result.unshift(newRelation);
67742 function renderDisclosureContent(selection2) {
67743 var memberships = getMemberships();
67744 var list = selection2.selectAll(".member-list").data([0]);
67745 list = list.enter().append("ul").attr("class", "member-list").merge(list);
67746 var items = list.selectAll("li.member-row-normal").data(memberships, function(d2) {
67749 items.exit().each(unbind).remove();
67750 var itemsEnter = items.enter().append("li").attr("class", "member-row member-row-normal form-field");
67751 itemsEnter.on("mouseover", function(d3_event, d2) {
67752 utilHighlightEntities([d2.relation.id], true, context);
67753 }).on("mouseout", function(d3_event, d2) {
67754 utilHighlightEntities([d2.relation.id], false, context);
67756 var labelEnter = itemsEnter.append("label").attr("class", "field-label").attr("for", function(d2) {
67759 var labelLink = labelEnter.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectRelation);
67760 labelLink.append("span").attr("class", "member-entity-type").text(function(d2) {
67761 var matched = _mainPresetIndex.match(d2.relation, context.graph());
67762 return matched && matched.name() || _t.html("inspector.relation");
67764 labelLink.append("span").attr("class", "member-entity-name").text(function(d2) {
67765 return utilDisplayName(d2.relation);
67767 labelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", deleteMembership);
67768 labelEnter.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToRelation);
67769 var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
67770 wrapEnter.append("input").attr("class", "member-role").attr("id", function(d2) {
67772 }).property("type", "text").property("value", function(d2) {
67773 return typeof d2.role === "string" ? d2.role : "";
67774 }).attr("title", function(d2) {
67775 return Array.isArray(d2.role) ? d2.role.filter(Boolean).join("\n") : d2.role;
67776 }).attr("placeholder", function(d2) {
67777 return Array.isArray(d2.role) ? _t("inspector.multiple_roles") : _t("inspector.role");
67778 }).classed("mixed", function(d2) {
67779 return Array.isArray(d2.role);
67780 }).call(utilNoAuto).on("blur", changeRole).on("change", changeRole);
67782 wrapEnter.each(bindTypeahead);
67784 var newMembership = list.selectAll(".member-row-new").data(_showBlank ? [0] : []);
67785 newMembership.exit().remove();
67786 var newMembershipEnter = newMembership.enter().append("li").attr("class", "member-row member-row-new form-field");
67787 var newLabelEnter = newMembershipEnter.append("label").attr("class", "field-label");
67788 newLabelEnter.append("input").attr("placeholder", _t("inspector.choose_relation")).attr("type", "text").attr("class", "member-entity-input").call(utilNoAuto);
67789 newLabelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", function() {
67790 list.selectAll(".member-row-new").remove();
67792 var newWrapEnter = newMembershipEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
67793 newWrapEnter.append("input").attr("class", "member-role").property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
67794 newMembership = newMembership.merge(newMembershipEnter);
67795 newMembership.selectAll(".member-entity-input").on("blur", cancelEntity).call(
67796 nearbyCombo.on("accept", acceptEntity).on("cancel", cancelEntity)
67798 var addRow = selection2.selectAll(".add-row").data([0]);
67799 var addRowEnter = addRow.enter().append("div").attr("class", "add-row");
67800 var addRelationButton = addRowEnter.append("button").attr("class", "add-relation").attr("aria-label", _t("inspector.add_to_relation"));
67801 addRelationButton.call(svgIcon("#iD-icon-plus", "light"));
67802 addRelationButton.call(uiTooltip().title(() => _t.append("inspector.add_to_relation")).placement(_mainLocalizer.textDirection() === "ltr" ? "right" : "left"));
67803 addRowEnter.append("div").attr("class", "space-value");
67804 addRowEnter.append("div").attr("class", "space-buttons");
67805 addRow = addRow.merge(addRowEnter);
67806 addRow.select(".add-relation").on("click", function() {
67808 section.reRender();
67809 list.selectAll(".member-entity-input").node().focus();
67811 function acceptEntity(d2) {
67817 utilHighlightEntities([d2.relation.id], false, context);
67818 var role = context.cleanRelationRole(list.selectAll(".member-row-new .member-role").property("value"));
67819 addMembership(d2, role);
67821 function cancelEntity() {
67822 var input = newMembership.selectAll(".member-entity-input");
67823 input.property("value", "");
67824 context.surface().selectAll(".highlighted").classed("highlighted", false);
67826 function bindTypeahead(d2) {
67827 var row = select_default2(this);
67828 var role = row.selectAll("input.member-role");
67829 var origValue = role.property("value");
67830 function sort(value, data) {
67831 var sameletter = [];
67833 for (var i3 = 0; i3 < data.length; i3++) {
67834 if (data[i3].value.substring(0, value.length) === value) {
67835 sameletter.push(data[i3]);
67837 other.push(data[i3]);
67840 return sameletter.concat(other);
67843 uiCombobox(context, "member-role").fetcher(function(role2, callback) {
67844 var rtype = d2.relation.tags.type;
67847 rtype: rtype || "",
67848 geometry: context.graph().geometry(_entityIDs[0]),
67850 }, function(err, data) {
67852 callback(sort(role2, data));
67854 }).on("cancel", function() {
67855 role.property("value", origValue);
67859 function unbind() {
67860 var row = select_default2(this);
67861 row.selectAll("input.member-role").call(uiCombobox.off, context);
67864 section.entityIDs = function(val) {
67865 if (!arguments.length)
67868 _showBlank = false;
67874 // modules/ui/sections/selection_list.js
67875 function uiSectionSelectionList(context) {
67876 var _selectedIDs = [];
67877 var section = uiSection("selected-features", context).shouldDisplay(function() {
67878 return _selectedIDs.length > 1;
67879 }).label(function() {
67880 return _t.append("inspector.title_count", { title: _t("inspector.features"), count: _selectedIDs.length });
67881 }).disclosureContent(renderDisclosureContent);
67882 context.history().on("change.selectionList", function(difference) {
67884 section.reRender();
67887 section.entityIDs = function(val) {
67888 if (!arguments.length)
67889 return _selectedIDs;
67890 _selectedIDs = val;
67893 function selectEntity(d3_event, entity) {
67894 context.enter(modeSelect(context, [entity.id]));
67896 function deselectEntity(d3_event, entity) {
67897 var selectedIDs = _selectedIDs.slice();
67898 var index = selectedIDs.indexOf(entity.id);
67900 selectedIDs.splice(index, 1);
67901 context.enter(modeSelect(context, selectedIDs));
67904 function renderDisclosureContent(selection2) {
67905 var list = selection2.selectAll(".feature-list").data([0]);
67906 list = list.enter().append("ul").attr("class", "feature-list").merge(list);
67907 var entities = _selectedIDs.map(function(id2) {
67908 return context.hasEntity(id2);
67909 }).filter(Boolean);
67910 var items = list.selectAll(".feature-list-item").data(entities, osmEntity.key);
67911 items.exit().remove();
67912 var enter = items.enter().append("li").attr("class", "feature-list-item").each(function(d2) {
67913 select_default2(this).on("mouseover", function() {
67914 utilHighlightEntities([d2.id], true, context);
67915 }).on("mouseout", function() {
67916 utilHighlightEntities([d2.id], false, context);
67919 var label = enter.append("button").attr("class", "label").on("click", selectEntity);
67920 label.append("span").attr("class", "entity-geom-icon").call(svgIcon("", "pre-text"));
67921 label.append("span").attr("class", "entity-type");
67922 label.append("span").attr("class", "entity-name");
67923 enter.append("button").attr("class", "close").attr("title", _t("icons.deselect")).on("click", deselectEntity).call(svgIcon("#iD-icon-close"));
67924 items = items.merge(enter);
67925 items.selectAll(".entity-geom-icon use").attr("href", function() {
67926 var entity = this.parentNode.parentNode.__data__;
67927 return "#iD-icon-" + entity.geometry(context.graph());
67929 items.selectAll(".entity-type").text(function(entity) {
67930 return _mainPresetIndex.match(entity, context.graph()).name();
67932 items.selectAll(".entity-name").text(function(d2) {
67933 var entity = context.entity(d2.id);
67934 return utilDisplayName(entity);
67940 // modules/ui/entity_editor.js
67941 function uiEntityEditor(context) {
67942 var dispatch14 = dispatch_default("choose");
67943 var _state = "select";
67944 var _coalesceChanges = false;
67945 var _modified = false;
67948 var _activePresets = [];
67951 function entityEditor(selection2) {
67952 var combinedTags = utilCombinedTags(_entityIDs, context.graph());
67953 var header = selection2.selectAll(".header").data([0]);
67954 var headerEnter = header.enter().append("div").attr("class", "header fillL");
67955 var direction = _mainLocalizer.textDirection() === "rtl" ? "forward" : "backward";
67956 headerEnter.append("button").attr("class", "preset-reset preset-choose").attr("title", _t("inspector.back_tooltip")).call(svgIcon(`#iD-icon-${direction}`));
67957 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
67958 context.enter(modeBrowse(context));
67959 }).call(svgIcon(_modified ? "#iD-icon-apply" : "#iD-icon-close"));
67960 headerEnter.append("h2");
67961 header = header.merge(headerEnter);
67962 header.selectAll("h2").text("").call(_entityIDs.length === 1 ? _t.append("inspector.edit") : _t.append("inspector.edit_features"));
67963 header.selectAll(".preset-reset").on("click", function() {
67964 dispatch14.call("choose", this, _activePresets);
67966 var body = selection2.selectAll(".inspector-body").data([0]);
67967 var bodyEnter = body.enter().append("div").attr("class", "entity-editor inspector-body sep-top");
67968 body = body.merge(bodyEnter);
67971 uiSectionSelectionList(context),
67972 uiSectionFeatureType(context).on("choose", function(presets) {
67973 dispatch14.call("choose", this, presets);
67975 uiSectionEntityIssues(context),
67976 uiSectionPresetFields(context).on("change", changeTags).on("revert", revertTags),
67977 uiSectionRawTagEditor("raw-tag-editor", context).on("change", changeTags),
67978 uiSectionRawMemberEditor(context),
67979 uiSectionRawMembershipEditor(context)
67982 _sections.forEach(function(section) {
67983 if (section.entityIDs) {
67984 section.entityIDs(_entityIDs);
67986 if (section.presets) {
67987 section.presets(_activePresets);
67989 if (section.tags) {
67990 section.tags(combinedTags);
67992 if (section.state) {
67993 section.state(_state);
67995 body.call(section.render);
67997 context.history().on("change.entity-editor", historyChanged);
67998 function historyChanged(difference) {
67999 if (selection2.selectAll(".entity-editor").empty())
68001 if (_state === "hide")
68003 var significant = !difference || difference.didChange.properties || difference.didChange.addition || difference.didChange.deletion;
68006 _entityIDs = _entityIDs.filter(context.hasEntity);
68007 if (!_entityIDs.length)
68009 var priorActivePreset = _activePresets.length === 1 && _activePresets[0];
68010 loadActivePresets();
68011 var graph = context.graph();
68012 entityEditor.modified(_base !== graph);
68013 entityEditor(selection2);
68014 if (priorActivePreset && _activePresets.length === 1 && priorActivePreset !== _activePresets[0]) {
68015 context.container().selectAll(".entity-editor button.preset-reset .label").style("background-color", "#fff").transition().duration(750).style("background-color", null);
68019 function changeTags(entityIDs, changed, onInput) {
68021 for (var i3 in entityIDs) {
68022 var entityID = entityIDs[i3];
68023 var entity = context.entity(entityID);
68024 var tags = Object.assign({}, entity.tags);
68025 if (typeof changed === "function") {
68026 tags = changed(tags);
68028 for (var k2 in changed) {
68031 var v2 = changed[k2];
68032 if (typeof v2 === "object") {
68033 tags[k2] = tags[v2.oldKey];
68034 } else if (v2 !== void 0 || tags.hasOwnProperty(k2)) {
68040 tags = utilCleanTags(tags);
68042 if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
68043 actions.push(actionChangeTags(entityID, tags));
68046 if (actions.length) {
68047 var combinedAction = function(graph) {
68048 actions.forEach(function(action) {
68049 graph = action(graph);
68053 var annotation = _t("operations.change_tags.annotation");
68054 if (_coalesceChanges) {
68055 context.overwrite(combinedAction, annotation);
68057 context.perform(combinedAction, annotation);
68058 _coalesceChanges = !!onInput;
68062 context.validator().validate();
68065 function revertTags(keys2) {
68067 for (var i3 in _entityIDs) {
68068 var entityID = _entityIDs[i3];
68069 var original = context.graph().base().entities[entityID];
68071 for (var j3 in keys2) {
68072 var key = keys2[j3];
68073 changed[key] = original ? original.tags[key] : void 0;
68075 var entity = context.entity(entityID);
68076 var tags = Object.assign({}, entity.tags);
68077 for (var k2 in changed) {
68080 var v2 = changed[k2];
68081 if (v2 !== void 0 || tags.hasOwnProperty(k2)) {
68085 tags = utilCleanTags(tags);
68086 if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
68087 actions.push(actionChangeTags(entityID, tags));
68090 if (actions.length) {
68091 var combinedAction = function(graph) {
68092 actions.forEach(function(action) {
68093 graph = action(graph);
68097 var annotation = _t("operations.change_tags.annotation");
68098 if (_coalesceChanges) {
68099 context.overwrite(combinedAction, annotation);
68101 context.perform(combinedAction, annotation);
68102 _coalesceChanges = false;
68105 context.validator().validate();
68107 entityEditor.modified = function(val) {
68108 if (!arguments.length)
68111 return entityEditor;
68113 entityEditor.state = function(val) {
68114 if (!arguments.length)
68117 return entityEditor;
68119 entityEditor.entityIDs = function(val) {
68120 if (!arguments.length)
68122 _base = context.graph();
68123 _coalesceChanges = false;
68124 if (val && _entityIDs && utilArrayIdentical(_entityIDs, val))
68125 return entityEditor;
68127 loadActivePresets(true);
68128 return entityEditor.modified(false);
68130 entityEditor.newFeature = function(val) {
68131 if (!arguments.length)
68132 return _newFeature;
68134 return entityEditor;
68136 function loadActivePresets(isForNewSelection) {
68137 var graph = context.graph();
68139 for (var i3 in _entityIDs) {
68140 var entity = graph.hasEntity(_entityIDs[i3]);
68143 var match = _mainPresetIndex.match(entity, graph);
68144 if (!counts[match.id])
68145 counts[match.id] = 0;
68146 counts[match.id] += 1;
68148 var matches = Object.keys(counts).sort(function(p1, p2) {
68149 return counts[p2] - counts[p1];
68150 }).map(function(pID) {
68151 return _mainPresetIndex.item(pID);
68153 if (!isForNewSelection) {
68154 var weakPreset = _activePresets.length === 1 && !_activePresets[0].isFallback() && Object.keys(_activePresets[0].addTags || {}).length === 0;
68155 if (weakPreset && matches.length === 1 && matches[0].isFallback())
68158 entityEditor.presets(matches);
68160 entityEditor.presets = function(val) {
68161 if (!arguments.length)
68162 return _activePresets;
68163 if (!utilArrayIdentical(val, _activePresets)) {
68164 _activePresets = val;
68166 return entityEditor;
68168 return utilRebind(entityEditor, dispatch14, "on");
68171 // modules/ui/feature_list.js
68172 var sexagesimal = __toESM(require_sexagesimal());
68173 function uiFeatureList(context) {
68174 var _geocodeResults;
68175 function featureList(selection2) {
68176 var header = selection2.append("div").attr("class", "header fillL");
68177 header.append("h2").call(_t.append("inspector.feature_list"));
68178 var searchWrap = selection2.append("div").attr("class", "search-header");
68179 searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
68180 var search = searchWrap.append("input").attr("placeholder", _t("inspector.search")).attr("type", "search").call(utilNoAuto).on("keypress", keypress).on("keydown", keydown).on("input", inputevent);
68181 var listWrap = selection2.append("div").attr("class", "inspector-body");
68182 var list = listWrap.append("div").attr("class", "feature-list");
68183 context.on("exit.feature-list", clearSearch);
68184 context.map().on("drawn.feature-list", mapDrawn);
68185 context.keybinding().on(uiCmd("\u2318F"), focusSearch);
68186 function focusSearch(d3_event) {
68187 var mode = context.mode() && context.mode().id;
68188 if (mode !== "browse")
68190 d3_event.preventDefault();
68191 search.node().focus();
68193 function keydown(d3_event) {
68194 if (d3_event.keyCode === 27) {
68195 search.node().blur();
68198 function keypress(d3_event) {
68199 var q2 = search.property("value"), items = list.selectAll(".feature-list-item");
68200 if (d3_event.keyCode === 13 && // ↩ Return
68201 q2.length && items.size()) {
68202 click(d3_event, items.datum());
68205 function inputevent() {
68206 _geocodeResults = void 0;
68209 function clearSearch() {
68210 search.property("value", "");
68213 function mapDrawn(e3) {
68218 function features() {
68220 var graph = context.graph();
68221 var visibleCenter = context.map().extent().center();
68222 var q2 = search.property("value").toLowerCase();
68225 var locationMatch = sexagesimal.pair(q2.toUpperCase()) || q2.match(/^(-?\d+\.?\d*)\s+(-?\d+\.?\d*)$/);
68226 if (locationMatch) {
68227 var loc = [Number(locationMatch[0]), Number(locationMatch[1])];
68231 type: _t("inspector.location"),
68232 name: dmsCoordinatePair([loc[1], loc[0]]),
68236 var idMatch = !locationMatch && q2.match(/(?:^|\W)(node|way|relation|[nwr])\W{0,2}0*([1-9]\d*)(?:\W|$)/i);
68238 var elemType = idMatch[1].charAt(0);
68239 var elemId = idMatch[2];
68241 id: elemType + elemId,
68242 geometry: elemType === "n" ? "point" : elemType === "w" ? "line" : "relation",
68243 type: elemType === "n" ? _t("inspector.node") : elemType === "w" ? _t("inspector.way") : _t("inspector.relation"),
68247 var allEntities = graph.entities;
68248 var localResults = [];
68249 for (var id2 in allEntities) {
68250 var entity = allEntities[id2];
68253 var name = utilDisplayName(entity) || "";
68254 if (name.toLowerCase().indexOf(q2) < 0)
68256 var matched = _mainPresetIndex.match(entity, graph);
68257 var type2 = matched && matched.name() || utilDisplayType(entity.id);
68258 var extent = entity.extent(graph);
68259 var distance = extent ? geoSphericalDistance(visibleCenter, extent.center()) : 0;
68260 localResults.push({
68263 geometry: entity.geometry(graph),
68268 if (localResults.length > 100)
68271 localResults = localResults.sort(function byDistance(a2, b2) {
68272 return a2.distance - b2.distance;
68274 result = result.concat(localResults);
68275 (_geocodeResults || []).forEach(function(d2) {
68276 if (d2.osm_type && d2.osm_id) {
68277 var id3 = osmEntity.id.fromOSM(d2.osm_type, d2.osm_id);
68279 tags[d2.class] = d2.type;
68280 var attrs = { id: id3, type: d2.osm_type, tags };
68281 if (d2.osm_type === "way") {
68282 attrs.nodes = ["a", "a"];
68284 var tempEntity = osmEntity(attrs);
68285 var tempGraph = coreGraph([tempEntity]);
68286 var matched2 = _mainPresetIndex.match(tempEntity, tempGraph);
68287 var type3 = matched2 && matched2.name() || utilDisplayType(id3);
68290 geometry: tempEntity.geometry(tempGraph),
68292 name: d2.display_name,
68293 extent: new geoExtent(
68294 [Number(d2.boundingbox[3]), Number(d2.boundingbox[0])],
68295 [Number(d2.boundingbox[2]), Number(d2.boundingbox[1])]
68300 if (q2.match(/^[0-9]+$/)) {
68304 type: _t("inspector.node"),
68310 type: _t("inspector.way"),
68315 geometry: "relation",
68316 type: _t("inspector.relation"),
68322 function drawList() {
68323 var value = search.property("value");
68324 var results = features();
68325 list.classed("filtered", value.length);
68326 var resultsIndicator = list.selectAll(".no-results-item").data([0]).enter().append("button").property("disabled", true).attr("class", "no-results-item").call(svgIcon("#iD-icon-alert", "pre-text"));
68327 resultsIndicator.append("span").attr("class", "entity-name");
68328 list.selectAll(".no-results-item .entity-name").html("").call(_t.append("geocoder.no_results_worldwide"));
68329 if (services.geocoder) {
68330 list.selectAll(".geocode-item").data([0]).enter().append("button").attr("class", "geocode-item secondary-action").on("click", geocoderSearch).append("div").attr("class", "label").append("span").attr("class", "entity-name").call(_t.append("geocoder.search"));
68332 list.selectAll(".no-results-item").style("display", value.length && !results.length ? "block" : "none");
68333 list.selectAll(".geocode-item").style("display", value && _geocodeResults === void 0 ? "block" : "none");
68334 list.selectAll(".feature-list-item").data([-1]).remove();
68335 var items = list.selectAll(".feature-list-item").data(results, function(d2) {
68338 var enter = items.enter().insert("button", ".geocode-item").attr("class", "feature-list-item").on("mouseover", mouseover).on("mouseout", mouseout).on("click", click);
68339 var label = enter.append("div").attr("class", "label");
68340 label.each(function(d2) {
68341 select_default2(this).call(svgIcon("#iD-icon-" + d2.geometry, "pre-text"));
68343 label.append("span").attr("class", "entity-type").text(function(d2) {
68346 label.append("span").attr("class", "entity-name").text(function(d2) {
68349 enter.style("opacity", 0).transition().style("opacity", 1);
68351 items.exit().remove();
68353 function mouseover(d3_event, d2) {
68356 utilHighlightEntities([d2.id], true, context);
68358 function mouseout(d3_event, d2) {
68361 utilHighlightEntities([d2.id], false, context);
68363 function click(d3_event, d2) {
68364 d3_event.preventDefault();
68366 context.map().centerZoomEase([d2.location[1], d2.location[0]], 19);
68367 } else if (d2.entity) {
68368 utilHighlightEntities([d2.id], false, context);
68369 context.enter(modeSelect(context, [d2.entity.id]));
68370 context.map().zoomToEase(d2.entity);
68372 context.zoomToEntity(d2.id);
68375 function geocoderSearch() {
68376 services.geocoder.search(search.property("value"), function(err, resp) {
68377 _geocodeResults = resp || [];
68382 return featureList;
68385 // modules/ui/improveOSM_comments.js
68386 function uiImproveOsmComments() {
68388 function issueComments(selection2) {
68389 let comments = selection2.selectAll(".comments-container").data([0]);
68390 comments = comments.enter().append("div").attr("class", "comments-container").merge(comments);
68391 services.improveOSM.getComments(_qaItem).then((d2) => {
68394 const commentEnter = comments.selectAll(".comment").data(d2.comments).enter().append("div").attr("class", "comment");
68395 commentEnter.append("div").attr("class", "comment-avatar").call(svgIcon("#iD-icon-avatar", "comment-avatar-icon"));
68396 const mainEnter = commentEnter.append("div").attr("class", "comment-main");
68397 const metadataEnter = mainEnter.append("div").attr("class", "comment-metadata");
68398 metadataEnter.append("div").attr("class", "comment-author").each(function(d4) {
68399 const osm = services.osm;
68400 let selection3 = select_default2(this);
68401 if (osm && d4.username) {
68402 selection3 = selection3.append("a").attr("class", "comment-author-link").attr("href", osm.userURL(d4.username)).attr("target", "_blank");
68404 selection3.text((d5) => d5.username);
68406 metadataEnter.append("div").attr("class", "comment-date").html((d4) => _t.html("note.status.commented", { when: localeDateString2(d4.timestamp) }));
68407 mainEnter.append("div").attr("class", "comment-text").append("p").text((d4) => d4.text);
68408 }).catch((err) => {
68412 function localeDateString2(s2) {
68415 const options2 = { day: "numeric", month: "short", year: "numeric" };
68416 const d2 = new Date(s2 * 1e3);
68417 if (isNaN(d2.getTime()))
68419 return d2.toLocaleDateString(_mainLocalizer.localeCode(), options2);
68421 issueComments.issue = function(val) {
68422 if (!arguments.length)
68425 return issueComments;
68427 return issueComments;
68430 // modules/ui/improveOSM_details.js
68431 function uiImproveOsmDetails(context) {
68433 function issueDetail(d2) {
68436 const issueKey = d2.issueKey;
68437 d2.replacements = d2.replacements || {};
68438 d2.replacements.default = { html: _t.html("inspector.unknown") };
68439 return _t.html(`QA.improveOSM.error_types.${issueKey}.description`, d2.replacements);
68441 function improveOsmDetails(selection2) {
68442 const details = selection2.selectAll(".error-details").data(
68443 _qaItem ? [_qaItem] : [],
68444 (d2) => `${d2.id}-${d2.status || 0}`
68446 details.exit().remove();
68447 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
68448 const descriptionEnter = detailsEnter.append("div").attr("class", "qa-details-subsection");
68449 descriptionEnter.append("h4").call(_t.append("QA.keepRight.detail_description"));
68450 descriptionEnter.append("div").attr("class", "qa-details-description-text").html(issueDetail);
68451 let relatedEntities = [];
68452 descriptionEnter.selectAll(".error_entity_link, .error_object_link").attr("href", "#").each(function() {
68453 const link2 = select_default2(this);
68454 const isObjectLink = link2.classed("error_object_link");
68455 const entityID = isObjectLink ? utilEntityRoot(_qaItem.objectType) + _qaItem.objectId : this.textContent;
68456 const entity = context.hasEntity(entityID);
68457 relatedEntities.push(entityID);
68458 link2.on("mouseenter", () => {
68459 utilHighlightEntities([entityID], true, context);
68460 }).on("mouseleave", () => {
68461 utilHighlightEntities([entityID], false, context);
68462 }).on("click", (d3_event) => {
68463 d3_event.preventDefault();
68464 utilHighlightEntities([entityID], false, context);
68465 const osmlayer = context.layers().layer("osm");
68466 if (!osmlayer.enabled()) {
68467 osmlayer.enabled(true);
68469 context.map().centerZoom(_qaItem.loc, 20);
68471 context.enter(modeSelect(context, [entityID]));
68473 context.loadEntity(entityID, (err, result) => {
68476 const entity2 = result.data.find((e3) => e3.id === entityID);
68478 context.enter(modeSelect(context, [entityID]));
68483 let name = utilDisplayName(entity);
68484 if (!name && !isObjectLink) {
68485 const preset = _mainPresetIndex.match(entity, context.graph());
68486 name = preset && !preset.isFallback() && preset.name();
68489 this.innerText = name;
68493 context.features().forceVisible(relatedEntities);
68494 context.map().pan([0, 0]);
68496 improveOsmDetails.issue = function(val) {
68497 if (!arguments.length)
68500 return improveOsmDetails;
68502 return improveOsmDetails;
68505 // modules/ui/improveOSM_header.js
68506 function uiImproveOsmHeader() {
68508 function issueTitle(d2) {
68509 const issueKey = d2.issueKey;
68510 d2.replacements = d2.replacements || {};
68511 d2.replacements.default = { html: _t.html("inspector.unknown") };
68512 return _t.html(`QA.improveOSM.error_types.${issueKey}.title`, d2.replacements);
68514 function improveOsmHeader(selection2) {
68515 const header = selection2.selectAll(".qa-header").data(
68516 _qaItem ? [_qaItem] : [],
68517 (d2) => `${d2.id}-${d2.status || 0}`
68519 header.exit().remove();
68520 const headerEnter = header.enter().append("div").attr("class", "qa-header");
68521 const svgEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d2) => d2.id < 0).append("svg").attr("width", "20px").attr("height", "30px").attr("viewbox", "0 0 20 30").attr("class", (d2) => `preset-icon-28 qaItem ${d2.service} itemId-${d2.id} itemType-${d2.itemType}`);
68522 svgEnter.append("polygon").attr("fill", "currentColor").attr("class", "qaItem-fill").attr("points", "16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6");
68523 svgEnter.append("use").attr("class", "icon-annotation").attr("width", "12px").attr("height", "12px").attr("transform", "translate(4, 5.5)").attr("xlink:href", (d2) => d2.icon ? "#" + d2.icon : "");
68524 headerEnter.append("div").attr("class", "qa-header-label").html(issueTitle);
68526 improveOsmHeader.issue = function(val) {
68527 if (!arguments.length)
68530 return improveOsmHeader;
68532 return improveOsmHeader;
68535 // modules/ui/improveOSM_editor.js
68536 function uiImproveOsmEditor(context) {
68537 const dispatch14 = dispatch_default("change");
68538 const qaDetails = uiImproveOsmDetails(context);
68539 const qaComments = uiImproveOsmComments(context);
68540 const qaHeader = uiImproveOsmHeader(context);
68542 function improveOsmEditor(selection2) {
68543 const headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
68544 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
68545 headerEnter.append("h2").call(_t.append("QA.improveOSM.title"));
68546 let body = selection2.selectAll(".body").data([0]);
68547 body = body.enter().append("div").attr("class", "body").merge(body);
68548 const editor = body.selectAll(".qa-editor").data([0]);
68549 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(qaComments.issue(_qaItem)).call(improveOsmSaveSection);
68551 function improveOsmSaveSection(selection2) {
68552 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
68553 const isShown = _qaItem && (isSelected || _qaItem.newComment || _qaItem.comment);
68554 let saveSection = selection2.selectAll(".qa-save").data(
68555 isShown ? [_qaItem] : [],
68556 (d2) => `${d2.id}-${d2.status || 0}`
68558 saveSection.exit().remove();
68559 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
68560 saveSectionEnter.append("h4").attr("class", ".qa-save-header").call(_t.append("note.newComment"));
68561 saveSectionEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("QA.keepRight.comment_placeholder")).attr("maxlength", 1e3).property("value", (d2) => d2.newComment).call(utilNoAuto).on("input", changeInput).on("blur", changeInput);
68562 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
68563 function changeInput() {
68564 const input = select_default2(this);
68565 let val = input.property("value").trim();
68569 _qaItem = _qaItem.update({ newComment: val });
68570 const qaService = services.improveOSM;
68572 qaService.replaceItem(_qaItem);
68574 saveSection.call(qaSaveButtons);
68577 function qaSaveButtons(selection2) {
68578 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
68579 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
68580 buttonSection.exit().remove();
68581 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
68582 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("QA.keepRight.save_comment"));
68583 buttonEnter.append("button").attr("class", "button close-button action");
68584 buttonEnter.append("button").attr("class", "button ignore-button action");
68585 buttonSection = buttonSection.merge(buttonEnter);
68586 buttonSection.select(".comment-button").attr("disabled", (d2) => d2.newComment ? null : true).on("click.comment", function(d3_event, d2) {
68588 const qaService = services.improveOSM;
68590 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
68593 buttonSection.select(".close-button").html((d2) => {
68594 const andComment = d2.newComment ? "_comment" : "";
68595 return _t.html(`QA.keepRight.close${andComment}`);
68596 }).on("click.close", function(d3_event, d2) {
68598 const qaService = services.improveOSM;
68600 d2.newStatus = "SOLVED";
68601 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
68604 buttonSection.select(".ignore-button").html((d2) => {
68605 const andComment = d2.newComment ? "_comment" : "";
68606 return _t.html(`QA.keepRight.ignore${andComment}`);
68607 }).on("click.ignore", function(d3_event, d2) {
68609 const qaService = services.improveOSM;
68611 d2.newStatus = "INVALID";
68612 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
68616 improveOsmEditor.error = function(val) {
68617 if (!arguments.length)
68620 return improveOsmEditor;
68622 return utilRebind(improveOsmEditor, dispatch14, "on");
68625 // modules/ui/preset_list.js
68626 function uiPresetList(context) {
68627 var dispatch14 = dispatch_default("cancel", "choose");
68630 var _currentPresets;
68631 var _autofocus = false;
68632 function presetList(selection2) {
68635 var presets = _mainPresetIndex.matchAllGeometry(entityGeometries());
68636 selection2.html("");
68637 var messagewrap = selection2.append("div").attr("class", "header fillL");
68638 var message = messagewrap.append("h2").call(_t.append("inspector.choose"));
68639 var direction = _mainLocalizer.textDirection() === "rtl" ? "backward" : "forward";
68640 messagewrap.append("button").attr("class", "preset-choose").attr("title", _entityIDs.length === 1 ? _t("inspector.edit") : _t("inspector.edit_features")).on("click", function() {
68641 dispatch14.call("cancel", this);
68642 }).call(svgIcon(`#iD-icon-${direction}`));
68643 function initialKeydown(d3_event) {
68644 if (search.property("value").length === 0 && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
68645 d3_event.preventDefault();
68646 d3_event.stopPropagation();
68647 operationDelete(context, _entityIDs)();
68648 } else if (search.property("value").length === 0 && (d3_event.ctrlKey || d3_event.metaKey) && d3_event.keyCode === utilKeybinding.keyCodes.z) {
68649 d3_event.preventDefault();
68650 d3_event.stopPropagation();
68652 } else if (!d3_event.ctrlKey && !d3_event.metaKey) {
68653 select_default2(this).on("keydown", keydown);
68654 keydown.call(this, d3_event);
68657 function keydown(d3_event) {
68658 if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"] && // if insertion point is at the end of the string
68659 search.node().selectionStart === search.property("value").length) {
68660 d3_event.preventDefault();
68661 d3_event.stopPropagation();
68662 var buttons = list.selectAll(".preset-list-button");
68663 if (!buttons.empty())
68664 buttons.nodes()[0].focus();
68667 function keypress(d3_event) {
68668 var value = search.property("value");
68669 if (d3_event.keyCode === 13 && // ↩ Return
68671 list.selectAll(".preset-list-item:first-child").each(function(d2) {
68672 d2.choose.call(this);
68676 function inputevent() {
68677 var value = search.property("value");
68678 list.classed("filtered", value.length);
68679 var results, messageText;
68680 if (value.length) {
68681 results = presets.search(value, entityGeometries()[0], _currLoc);
68682 messageText = _t.html("inspector.results", {
68683 n: results.collection.length,
68687 var entityPresets2 = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
68688 results = _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets2);
68689 messageText = _t.html("inspector.choose");
68691 list.call(drawList, results);
68692 message.html(messageText);
68694 var searchWrap = selection2.append("div").attr("class", "search-header");
68695 searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
68696 var search = searchWrap.append("input").attr("class", "preset-search-input").attr("placeholder", _t("inspector.search")).attr("type", "search").call(utilNoAuto).on("keydown", initialKeydown).on("keypress", keypress).on("input", debounce_default(inputevent));
68698 search.node().focus();
68699 setTimeout(function() {
68700 search.node().focus();
68703 var listWrap = selection2.append("div").attr("class", "inspector-body");
68704 var entityPresets = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
68705 var list = listWrap.append("div").attr("class", "preset-list").call(drawList, _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets));
68706 context.features().on("change.preset-list", updateForFeatureHiddenState);
68708 function drawList(list, presets) {
68709 presets = presets.matchAllGeometry(entityGeometries());
68710 var collection = presets.collection.reduce(function(collection2, preset) {
68712 return collection2;
68713 if (preset.members) {
68714 if (preset.members.collection.filter(function(preset2) {
68715 return preset2.addable();
68717 collection2.push(CategoryItem(preset));
68719 } else if (preset.addable()) {
68720 collection2.push(PresetItem(preset));
68722 return collection2;
68724 var items = list.selectAll(".preset-list-item").data(collection, function(d2) {
68725 return d2.preset.id;
68728 items.exit().remove();
68729 items.enter().append("div").attr("class", function(item) {
68730 return "preset-list-item preset-" + item.preset.id.replace("/", "-");
68731 }).classed("current", function(item) {
68732 return _currentPresets.indexOf(item.preset) !== -1;
68733 }).each(function(item) {
68734 select_default2(this).call(item);
68735 }).style("opacity", 0).transition().style("opacity", 1);
68736 updateForFeatureHiddenState();
68738 function itemKeydown(d3_event) {
68739 var item = select_default2(this.closest(".preset-list-item"));
68740 var parentItem = select_default2(item.node().parentNode.closest(".preset-list-item"));
68741 if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"]) {
68742 d3_event.preventDefault();
68743 d3_event.stopPropagation();
68744 var nextItem = select_default2(item.node().nextElementSibling);
68745 if (nextItem.empty()) {
68746 if (!parentItem.empty()) {
68747 nextItem = select_default2(parentItem.node().nextElementSibling);
68749 } else if (select_default2(this).classed("expanded")) {
68750 nextItem = item.select(".subgrid .preset-list-item:first-child");
68752 if (!nextItem.empty()) {
68753 nextItem.select(".preset-list-button").node().focus();
68755 } else if (d3_event.keyCode === utilKeybinding.keyCodes["\u2191"]) {
68756 d3_event.preventDefault();
68757 d3_event.stopPropagation();
68758 var previousItem = select_default2(item.node().previousElementSibling);
68759 if (previousItem.empty()) {
68760 if (!parentItem.empty()) {
68761 previousItem = parentItem;
68763 } else if (previousItem.select(".preset-list-button").classed("expanded")) {
68764 previousItem = previousItem.select(".subgrid .preset-list-item:last-child");
68766 if (!previousItem.empty()) {
68767 previousItem.select(".preset-list-button").node().focus();
68769 var search = select_default2(this.closest(".preset-list-pane")).select(".preset-search-input");
68770 search.node().focus();
68772 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
68773 d3_event.preventDefault();
68774 d3_event.stopPropagation();
68775 if (!parentItem.empty()) {
68776 parentItem.select(".preset-list-button").node().focus();
68778 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
68779 d3_event.preventDefault();
68780 d3_event.stopPropagation();
68781 item.datum().choose.call(select_default2(this).node());
68784 function CategoryItem(preset) {
68785 var box, sublist, shown = false;
68786 function item(selection2) {
68787 var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap category");
68789 var isExpanded = select_default2(this).classed("expanded");
68790 var iconName = isExpanded ? _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward" : "#iD-icon-down";
68791 select_default2(this).classed("expanded", !isExpanded).attr("title", !isExpanded ? _t("icons.collapse") : _t("icons.expand"));
68792 select_default2(this).selectAll("div.label-inner svg.icon use").attr("href", iconName);
68795 var geometries = entityGeometries();
68796 var button = wrap2.append("button").attr("class", "preset-list-button").attr("title", _t("icons.expand")).classed("expanded", false).call(uiPresetIcon().geometry(geometries.length === 1 && geometries[0]).preset(preset)).on("click", click).on("keydown", function(d3_event) {
68797 if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
68798 d3_event.preventDefault();
68799 d3_event.stopPropagation();
68800 if (!select_default2(this).classed("expanded")) {
68801 click.call(this, d3_event);
68803 } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
68804 d3_event.preventDefault();
68805 d3_event.stopPropagation();
68806 if (select_default2(this).classed("expanded")) {
68807 click.call(this, d3_event);
68810 itemKeydown.call(this, d3_event);
68813 var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
68814 label.append("div").attr("class", "namepart").call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward", "inline")).append("span").call(preset.nameLabel()).append("span").text("\u2026");
68815 box = selection2.append("div").attr("class", "subgrid").style("max-height", "0px").style("opacity", 0);
68816 box.append("div").attr("class", "arrow");
68817 sublist = box.append("div").attr("class", "preset-list fillL3");
68819 item.choose = function() {
68820 if (!box || !sublist)
68824 box.transition().duration(200).style("opacity", "0").style("max-height", "0px").style("padding-bottom", "0px");
68827 var members = preset.members.matchAllGeometry(entityGeometries());
68828 sublist.call(drawList, members);
68829 box.transition().duration(200).style("opacity", "1").style("max-height", 200 + members.collection.length * 190 + "px").style("padding-bottom", "10px");
68832 item.preset = preset;
68835 function PresetItem(preset) {
68836 function item(selection2) {
68837 var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap");
68838 var geometries = entityGeometries();
68839 var button = wrap2.append("button").attr("class", "preset-list-button").call(uiPresetIcon().geometry(geometries.length === 1 && geometries[0]).preset(preset)).on("click", item.choose).on("keydown", itemKeydown);
68840 var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
68842 preset.nameLabel(),
68843 preset.subtitleLabel()
68845 label.selectAll(".namepart").data(nameparts, (d2) => d2.stringId).enter().append("div").attr("class", "namepart").text("").each(function(d2) {
68846 d2(select_default2(this));
68848 wrap2.call(item.reference.button);
68849 selection2.call(item.reference.body);
68851 item.choose = function() {
68852 if (select_default2(this).classed("disabled"))
68854 if (!context.inIntro()) {
68855 _mainPresetIndex.setMostRecent(preset, entityGeometries()[0]);
68859 for (var i3 in _entityIDs) {
68860 var entityID = _entityIDs[i3];
68861 var oldPreset = _mainPresetIndex.match(graph.entity(entityID), graph);
68862 graph = actionChangePreset(entityID, oldPreset, preset)(graph);
68866 _t("operations.change_tags.annotation")
68868 context.validator().validate();
68869 dispatch14.call("choose", this, preset);
68871 item.help = function(d3_event) {
68872 d3_event.stopPropagation();
68873 item.reference.toggle();
68875 item.preset = preset;
68876 item.reference = uiTagReference(preset.reference(), context);
68879 function updateForFeatureHiddenState() {
68880 if (!_entityIDs.every(context.hasEntity))
68882 var geometries = entityGeometries();
68883 var button = context.container().selectAll(".preset-list .preset-list-button");
68884 button.call(uiTooltip().destroyAny);
68885 button.each(function(item, index) {
68886 var hiddenPresetFeaturesId;
68887 for (var i3 in geometries) {
68888 hiddenPresetFeaturesId = context.features().isHiddenPreset(item.preset, geometries[i3]);
68889 if (hiddenPresetFeaturesId)
68892 var isHiddenPreset = !context.inIntro() && !!hiddenPresetFeaturesId && (_currentPresets.length !== 1 || item.preset !== _currentPresets[0]);
68893 select_default2(this).classed("disabled", isHiddenPreset);
68894 if (isHiddenPreset) {
68895 var isAutoHidden = context.features().autoHidden(hiddenPresetFeaturesId);
68896 select_default2(this).call(
68897 uiTooltip().title(() => _t.append("inspector.hidden_preset." + (isAutoHidden ? "zoom" : "manual"), {
68898 features: _t("feature." + hiddenPresetFeaturesId + ".description")
68899 })).placement(index < 2 ? "bottom" : "top")
68904 presetList.autofocus = function(val) {
68905 if (!arguments.length)
68910 presetList.entityIDs = function(val) {
68911 if (!arguments.length)
68915 if (_entityIDs && _entityIDs.length) {
68916 const extent = _entityIDs.reduce(function(extent2, entityID) {
68917 var entity = context.graph().entity(entityID);
68918 return extent2.extend(entity.extent(context.graph()));
68920 _currLoc = extent.center();
68921 var presets = _entityIDs.map(function(entityID) {
68922 return _mainPresetIndex.match(context.entity(entityID), context.graph());
68924 presetList.presets(presets);
68928 presetList.presets = function(val) {
68929 if (!arguments.length)
68930 return _currentPresets;
68931 _currentPresets = val;
68934 function entityGeometries() {
68936 for (var i3 in _entityIDs) {
68937 var entityID = _entityIDs[i3];
68938 var entity = context.entity(entityID);
68939 var geometry = entity.geometry(context.graph());
68940 if (geometry === "vertex" && entity.isOnAddressLine(context.graph())) {
68941 geometry = "point";
68943 if (!counts[geometry])
68944 counts[geometry] = 0;
68945 counts[geometry] += 1;
68947 return Object.keys(counts).sort(function(geom1, geom2) {
68948 return counts[geom2] - counts[geom1];
68951 return utilRebind(presetList, dispatch14, "on");
68954 // modules/ui/view_on_osm.js
68955 function uiViewOnOSM(context) {
68957 function viewOnOSM(selection2) {
68959 if (_what instanceof osmEntity) {
68960 url = context.connection().entityURL(_what);
68961 } else if (_what instanceof osmNote) {
68962 url = context.connection().noteURL(_what);
68964 var data = !_what || _what.isNew() ? [] : [_what];
68965 var link2 = selection2.selectAll(".view-on-osm").data(data, function(d2) {
68968 link2.exit().remove();
68969 var linkEnter = link2.enter().append("a").attr("class", "view-on-osm").attr("target", "_blank").attr("href", url).call(svgIcon("#iD-icon-out-link", "inline"));
68970 linkEnter.append("span").call(_t.append("inspector.view_on_osm"));
68972 viewOnOSM.what = function(_2) {
68973 if (!arguments.length)
68981 // modules/ui/inspector.js
68982 function uiInspector(context) {
68983 var presetList = uiPresetList(context);
68984 var entityEditor = uiEntityEditor(context);
68985 var wrap2 = select_default2(null), presetPane = select_default2(null), editorPane = select_default2(null);
68986 var _state = "select";
68988 var _newFeature = false;
68989 function inspector(selection2) {
68990 presetList.entityIDs(_entityIDs).autofocus(_newFeature).on("choose", inspector.setPreset).on("cancel", function() {
68991 inspector.setPreset();
68993 entityEditor.state(_state).entityIDs(_entityIDs).on("choose", inspector.showList);
68994 wrap2 = selection2.selectAll(".panewrap").data([0]);
68995 var enter = wrap2.enter().append("div").attr("class", "panewrap");
68996 enter.append("div").attr("class", "preset-list-pane pane");
68997 enter.append("div").attr("class", "entity-editor-pane pane");
68998 wrap2 = wrap2.merge(enter);
68999 presetPane = wrap2.selectAll(".preset-list-pane");
69000 editorPane = wrap2.selectAll(".entity-editor-pane");
69001 function shouldDefaultToPresetList() {
69002 if (_state !== "select")
69004 if (_entityIDs.length !== 1)
69006 var entityID = _entityIDs[0];
69007 var entity = context.hasEntity(entityID);
69010 if (entity.hasNonGeometryTags())
69014 if (entity.geometry(context.graph()) !== "vertex")
69016 if (context.graph().parentRelations(entity).length)
69018 if (context.validator().getEntityIssues(entityID).length)
69020 if (entity.isHighwayIntersection(context.graph()))
69024 if (shouldDefaultToPresetList()) {
69025 wrap2.style("right", "-100%");
69026 editorPane.classed("hide", true);
69027 presetPane.classed("hide", false).call(presetList);
69029 wrap2.style("right", "0%");
69030 presetPane.classed("hide", true);
69031 editorPane.classed("hide", false).call(entityEditor);
69033 var footer = selection2.selectAll(".footer").data([0]);
69034 footer = footer.enter().append("div").attr("class", "footer").merge(footer);
69036 uiViewOnOSM(context).what(context.hasEntity(_entityIDs.length === 1 && _entityIDs[0]))
69039 inspector.showList = function(presets) {
69040 presetPane.classed("hide", false);
69041 wrap2.transition().styleTween("right", function() {
69042 return value_default("0%", "-100%");
69043 }).on("end", function() {
69044 editorPane.classed("hide", true);
69047 presetList.presets(presets);
69049 presetPane.call(presetList.autofocus(true));
69051 inspector.setPreset = function(preset) {
69052 if (preset && preset.id === "type/multipolygon") {
69053 presetPane.call(presetList.autofocus(true));
69055 editorPane.classed("hide", false);
69056 wrap2.transition().styleTween("right", function() {
69057 return value_default("-100%", "0%");
69058 }).on("end", function() {
69059 presetPane.classed("hide", true);
69062 entityEditor.presets([preset]);
69064 editorPane.call(entityEditor);
69067 inspector.state = function(val) {
69068 if (!arguments.length)
69071 entityEditor.state(_state);
69072 context.container().selectAll(".field-help-body").remove();
69075 inspector.entityIDs = function(val) {
69076 if (!arguments.length)
69081 inspector.newFeature = function(val) {
69082 if (!arguments.length)
69083 return _newFeature;
69090 // modules/ui/keepRight_details.js
69091 function uiKeepRightDetails(context) {
69093 function issueDetail(d2) {
69094 const { itemType, parentIssueType } = d2;
69095 const unknown = { html: _t.html("inspector.unknown") };
69096 let replacements = d2.replacements || {};
69097 replacements.default = unknown;
69098 if (_mainLocalizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
69099 return _t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
69101 return _t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
69104 function keepRightDetails(selection2) {
69105 const details = selection2.selectAll(".error-details").data(
69106 _qaItem ? [_qaItem] : [],
69107 (d2) => `${d2.id}-${d2.status || 0}`
69109 details.exit().remove();
69110 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
69111 const descriptionEnter = detailsEnter.append("div").attr("class", "qa-details-subsection");
69112 descriptionEnter.append("h4").call(_t.append("QA.keepRight.detail_description"));
69113 descriptionEnter.append("div").attr("class", "qa-details-description-text").html(issueDetail);
69114 let relatedEntities = [];
69115 descriptionEnter.selectAll(".error_entity_link, .error_object_link").attr("href", "#").each(function() {
69116 const link2 = select_default2(this);
69117 const isObjectLink = link2.classed("error_object_link");
69118 const entityID = isObjectLink ? utilEntityRoot(_qaItem.objectType) + _qaItem.objectId : this.textContent;
69119 const entity = context.hasEntity(entityID);
69120 relatedEntities.push(entityID);
69121 link2.on("mouseenter", () => {
69122 utilHighlightEntities([entityID], true, context);
69123 }).on("mouseleave", () => {
69124 utilHighlightEntities([entityID], false, context);
69125 }).on("click", (d3_event) => {
69126 d3_event.preventDefault();
69127 utilHighlightEntities([entityID], false, context);
69128 const osmlayer = context.layers().layer("osm");
69129 if (!osmlayer.enabled()) {
69130 osmlayer.enabled(true);
69132 context.map().centerZoomEase(_qaItem.loc, 20);
69134 context.enter(modeSelect(context, [entityID]));
69136 context.loadEntity(entityID, (err, result) => {
69139 const entity2 = result.data.find((e3) => e3.id === entityID);
69141 context.enter(modeSelect(context, [entityID]));
69146 let name = utilDisplayName(entity);
69147 if (!name && !isObjectLink) {
69148 const preset = _mainPresetIndex.match(entity, context.graph());
69149 name = preset && !preset.isFallback() && preset.name();
69152 this.innerText = name;
69156 context.features().forceVisible(relatedEntities);
69157 context.map().pan([0, 0]);
69159 keepRightDetails.issue = function(val) {
69160 if (!arguments.length)
69163 return keepRightDetails;
69165 return keepRightDetails;
69168 // modules/ui/keepRight_header.js
69169 function uiKeepRightHeader() {
69171 function issueTitle(d2) {
69172 const { itemType, parentIssueType } = d2;
69173 const unknown = _t.html("inspector.unknown");
69174 let replacements = d2.replacements || {};
69175 replacements.default = { html: unknown };
69176 if (_mainLocalizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
69177 return _t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
69179 return _t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
69182 function keepRightHeader(selection2) {
69183 const header = selection2.selectAll(".qa-header").data(
69184 _qaItem ? [_qaItem] : [],
69185 (d2) => `${d2.id}-${d2.status || 0}`
69187 header.exit().remove();
69188 const headerEnter = header.enter().append("div").attr("class", "qa-header");
69189 const iconEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d2) => d2.id < 0);
69190 iconEnter.append("div").attr("class", (d2) => `preset-icon-28 qaItem ${d2.service} itemId-${d2.id} itemType-${d2.parentIssueType}`).call(svgIcon("#iD-icon-bolt", "qaItem-fill"));
69191 headerEnter.append("div").attr("class", "qa-header-label").html(issueTitle);
69193 keepRightHeader.issue = function(val) {
69194 if (!arguments.length)
69197 return keepRightHeader;
69199 return keepRightHeader;
69202 // modules/ui/view_on_keepRight.js
69203 function uiViewOnKeepRight() {
69205 function viewOnKeepRight(selection2) {
69207 if (services.keepRight && _qaItem instanceof QAItem) {
69208 url = services.keepRight.issueURL(_qaItem);
69210 const link2 = selection2.selectAll(".view-on-keepRight").data(url ? [url] : []);
69211 link2.exit().remove();
69212 const linkEnter = link2.enter().append("a").attr("class", "view-on-keepRight").attr("target", "_blank").attr("rel", "noopener").attr("href", (d2) => d2).call(svgIcon("#iD-icon-out-link", "inline"));
69213 linkEnter.append("span").call(_t.append("inspector.view_on_keepRight"));
69215 viewOnKeepRight.what = function(val) {
69216 if (!arguments.length)
69219 return viewOnKeepRight;
69221 return viewOnKeepRight;
69224 // modules/ui/keepRight_editor.js
69225 function uiKeepRightEditor(context) {
69226 const dispatch14 = dispatch_default("change");
69227 const qaDetails = uiKeepRightDetails(context);
69228 const qaHeader = uiKeepRightHeader(context);
69230 function keepRightEditor(selection2) {
69231 const headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
69232 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
69233 headerEnter.append("h2").call(_t.append("QA.keepRight.title"));
69234 let body = selection2.selectAll(".body").data([0]);
69235 body = body.enter().append("div").attr("class", "body").merge(body);
69236 const editor = body.selectAll(".qa-editor").data([0]);
69237 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(keepRightSaveSection);
69238 const footer = selection2.selectAll(".footer").data([0]);
69239 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnKeepRight(context).what(_qaItem));
69241 function keepRightSaveSection(selection2) {
69242 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
69243 const isShown = _qaItem && (isSelected || _qaItem.newComment || _qaItem.comment);
69244 let saveSection = selection2.selectAll(".qa-save").data(
69245 isShown ? [_qaItem] : [],
69246 (d2) => `${d2.id}-${d2.status || 0}`
69248 saveSection.exit().remove();
69249 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
69250 saveSectionEnter.append("h4").attr("class", ".qa-save-header").call(_t.append("QA.keepRight.comment"));
69251 saveSectionEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("QA.keepRight.comment_placeholder")).attr("maxlength", 1e3).property("value", (d2) => d2.newComment || d2.comment).call(utilNoAuto).on("input", changeInput).on("blur", changeInput);
69252 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
69253 function changeInput() {
69254 const input = select_default2(this);
69255 let val = input.property("value").trim();
69256 if (val === _qaItem.comment) {
69259 _qaItem = _qaItem.update({ newComment: val });
69260 const qaService = services.keepRight;
69262 qaService.replaceItem(_qaItem);
69264 saveSection.call(qaSaveButtons);
69267 function qaSaveButtons(selection2) {
69268 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
69269 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
69270 buttonSection.exit().remove();
69271 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
69272 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("QA.keepRight.save_comment"));
69273 buttonEnter.append("button").attr("class", "button close-button action");
69274 buttonEnter.append("button").attr("class", "button ignore-button action");
69275 buttonSection = buttonSection.merge(buttonEnter);
69276 buttonSection.select(".comment-button").attr("disabled", (d2) => d2.newComment ? null : true).on("click.comment", function(d3_event, d2) {
69278 const qaService = services.keepRight;
69280 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
69283 buttonSection.select(".close-button").html((d2) => {
69284 const andComment = d2.newComment ? "_comment" : "";
69285 return _t.html(`QA.keepRight.close${andComment}`);
69286 }).on("click.close", function(d3_event, d2) {
69288 const qaService = services.keepRight;
69290 d2.newStatus = "ignore_t";
69291 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
69294 buttonSection.select(".ignore-button").html((d2) => {
69295 const andComment = d2.newComment ? "_comment" : "";
69296 return _t.html(`QA.keepRight.ignore${andComment}`);
69297 }).on("click.ignore", function(d3_event, d2) {
69299 const qaService = services.keepRight;
69301 d2.newStatus = "ignore";
69302 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
69306 keepRightEditor.error = function(val) {
69307 if (!arguments.length)
69310 return keepRightEditor;
69312 return utilRebind(keepRightEditor, dispatch14, "on");
69315 // modules/ui/lasso.js
69316 function uiLasso(context) {
69317 var group, polygon2;
69318 lasso.coordinates = [];
69319 function lasso(selection2) {
69320 context.container().classed("lasso", true);
69321 group = selection2.append("g").attr("class", "lasso hide");
69322 polygon2 = group.append("path").attr("class", "lasso-path");
69323 group.call(uiToggle(true));
69327 polygon2.data([lasso.coordinates]).attr("d", function(d2) {
69328 return "M" + d2.join(" L") + " Z";
69332 lasso.extent = function() {
69333 return lasso.coordinates.reduce(function(extent, point2) {
69334 return extent.extend(geoExtent(point2));
69337 lasso.p = function(_2) {
69338 if (!arguments.length)
69340 lasso.coordinates.push(_2);
69344 lasso.close = function() {
69346 group.call(uiToggle(false, function() {
69347 select_default2(this).remove();
69350 context.container().classed("lasso", false);
69355 // modules/ui/note_comments.js
69356 function uiNoteComments() {
69358 function noteComments(selection2) {
69361 var comments = selection2.selectAll(".comments-container").data([0]);
69362 comments = comments.enter().append("div").attr("class", "comments-container").merge(comments);
69363 var commentEnter = comments.selectAll(".comment").data(_note.comments).enter().append("div").attr("class", "comment");
69364 commentEnter.append("div").attr("class", function(d2) {
69365 return "comment-avatar user-" + d2.uid;
69366 }).call(svgIcon("#iD-icon-avatar", "comment-avatar-icon"));
69367 var mainEnter = commentEnter.append("div").attr("class", "comment-main");
69368 var metadataEnter = mainEnter.append("div").attr("class", "comment-metadata");
69369 metadataEnter.append("div").attr("class", "comment-author").each(function(d2) {
69370 var selection3 = select_default2(this);
69371 var osm = services.osm;
69372 if (osm && d2.user) {
69373 selection3 = selection3.append("a").attr("class", "comment-author-link").attr("href", osm.userURL(d2.user)).attr("target", "_blank");
69376 selection3.text(d2.user);
69378 selection3.call(_t.append("note.anonymous"));
69381 metadataEnter.append("div").attr("class", "comment-date").html(function(d2) {
69382 return _t.html("note.status." + d2.action, { when: localeDateString2(d2.date) });
69384 mainEnter.append("div").attr("class", "comment-text").html(function(d2) {
69386 }).selectAll("a").attr("rel", "noopener nofollow").attr("target", "_blank");
69387 comments.call(replaceAvatars);
69389 function replaceAvatars(selection2) {
69390 var showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
69391 var osm = services.osm;
69392 if (showThirdPartyIcons !== "true" || !osm)
69395 _note.comments.forEach(function(d2) {
69397 uids[d2.uid] = true;
69399 Object.keys(uids).forEach(function(uid) {
69400 osm.loadUser(uid, function(err, user) {
69401 if (!user || !user.image_url)
69403 selection2.selectAll(".comment-avatar.user-" + uid).html("").append("img").attr("class", "icon comment-avatar-icon").attr("src", user.image_url).attr("alt", user.display_name);
69407 function localeDateString2(s2) {
69410 var options2 = { day: "numeric", month: "short", year: "numeric" };
69411 s2 = s2.replace(/-/g, "/");
69412 var d2 = new Date(s2);
69413 if (isNaN(d2.getTime()))
69415 return d2.toLocaleDateString(_mainLocalizer.localeCode(), options2);
69417 noteComments.note = function(val) {
69418 if (!arguments.length)
69421 return noteComments;
69423 return noteComments;
69426 // modules/ui/note_header.js
69427 function uiNoteHeader() {
69429 function noteHeader(selection2) {
69430 var header = selection2.selectAll(".note-header").data(
69431 _note ? [_note] : [],
69433 return d2.status + d2.id;
69436 header.exit().remove();
69437 var headerEnter = header.enter().append("div").attr("class", "note-header");
69438 var iconEnter = headerEnter.append("div").attr("class", function(d2) {
69439 return "note-header-icon " + d2.status;
69440 }).classed("new", function(d2) {
69443 iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-note", "note-fill"));
69444 iconEnter.each(function(d2) {
69447 statusIcon = "#iD-icon-plus";
69448 } else if (d2.status === "open") {
69449 statusIcon = "#iD-icon-close";
69451 statusIcon = "#iD-icon-apply";
69453 iconEnter.append("div").attr("class", "note-icon-annotation").attr("title", _t("icons.close")).call(svgIcon(statusIcon, "icon-annotation"));
69455 headerEnter.append("div").attr("class", "note-header-label").html(function(d2) {
69456 if (_note.isNew()) {
69457 return _t.html("note.new");
69459 return _t.html("note.note") + " " + d2.id + " " + (d2.status === "closed" ? _t.html("note.closed") : "");
69462 noteHeader.note = function(val) {
69463 if (!arguments.length)
69471 // modules/ui/note_report.js
69472 function uiNoteReport() {
69474 function noteReport(selection2) {
69476 if (services.osm && _note instanceof osmNote && !_note.isNew()) {
69477 url = services.osm.noteReportURL(_note);
69479 var link2 = selection2.selectAll(".note-report").data(url ? [url] : []);
69480 link2.exit().remove();
69481 var linkEnter = link2.enter().append("a").attr("class", "note-report").attr("target", "_blank").attr("href", function(d2) {
69483 }).call(svgIcon("#iD-icon-out-link", "inline"));
69484 linkEnter.append("span").call(_t.append("note.report"));
69486 noteReport.note = function(val) {
69487 if (!arguments.length)
69495 // modules/ui/note_editor.js
69496 function uiNoteEditor(context) {
69497 var dispatch14 = dispatch_default("change");
69498 var noteComments = uiNoteComments(context);
69499 var noteHeader = uiNoteHeader();
69502 function noteEditor(selection2) {
69503 var header = selection2.selectAll(".header").data([0]);
69504 var headerEnter = header.enter().append("div").attr("class", "header fillL");
69505 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
69506 context.enter(modeBrowse(context));
69507 }).call(svgIcon("#iD-icon-close"));
69508 headerEnter.append("h2").call(_t.append("note.title"));
69509 var body = selection2.selectAll(".body").data([0]);
69510 body = body.enter().append("div").attr("class", "body").merge(body);
69511 var editor = body.selectAll(".note-editor").data([0]);
69512 editor.enter().append("div").attr("class", "modal-section note-editor").merge(editor).call(noteHeader.note(_note)).call(noteComments.note(_note)).call(noteSaveSection);
69513 var footer = selection2.selectAll(".footer").data([0]);
69514 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOSM(context).what(_note)).call(uiNoteReport(context).note(_note));
69515 var osm = services.osm;
69517 osm.on("change.note-save", function() {
69518 selection2.call(noteEditor);
69522 function noteSaveSection(selection2) {
69523 var isSelected = _note && _note.id === context.selectedNoteID();
69524 var noteSave = selection2.selectAll(".note-save").data(isSelected ? [_note] : [], function(d2) {
69525 return d2.status + d2.id;
69527 noteSave.exit().remove();
69528 var noteSaveEnter = noteSave.enter().append("div").attr("class", "note-save save-section cf");
69529 noteSaveEnter.append("h4").attr("class", ".note-save-header").html(function() {
69530 return _note.isNew() ? _t.html("note.newDescription") : _t.html("note.newComment");
69532 var commentTextarea = noteSaveEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("note.inputPlaceholder")).attr("maxlength", 1e3).property("value", function(d2) {
69533 return d2.newComment;
69534 }).call(utilNoAuto).on("keydown.note-input", keydown).on("input.note-input", changeInput).on("blur.note-input", changeInput);
69535 if (!commentTextarea.empty() && _newNote) {
69536 commentTextarea.node().focus();
69538 noteSave = noteSaveEnter.merge(noteSave).call(userDetails).call(noteSaveButtons);
69539 function keydown(d3_event) {
69540 if (!(d3_event.keyCode === 13 && // ↩ Return
69543 var osm = services.osm;
69546 var hasAuth = osm.authenticated();
69549 if (!_note.newComment)
69551 d3_event.preventDefault();
69552 select_default2(this).on("keydown.note-input", null);
69553 window.setTimeout(function() {
69554 if (_note.isNew()) {
69555 noteSave.selectAll(".save-button").node().focus();
69558 noteSave.selectAll(".comment-button").node().focus();
69559 clickComment(_note);
69563 function changeInput() {
69564 var input = select_default2(this);
69565 var val = input.property("value").trim() || void 0;
69566 _note = _note.update({ newComment: val });
69567 var osm = services.osm;
69569 osm.replaceNote(_note);
69571 noteSave.call(noteSaveButtons);
69574 function userDetails(selection2) {
69575 var detailSection = selection2.selectAll(".detail-section").data([0]);
69576 detailSection = detailSection.enter().append("div").attr("class", "detail-section").merge(detailSection);
69577 var osm = services.osm;
69580 var hasAuth = osm.authenticated();
69581 var authWarning = detailSection.selectAll(".auth-warning").data(hasAuth ? [] : [0]);
69582 authWarning.exit().transition().duration(200).style("opacity", 0).remove();
69583 var authEnter = authWarning.enter().insert("div", ".tag-reference-body").attr("class", "field-warning auth-warning").style("opacity", 0);
69584 authEnter.call(svgIcon("#iD-icon-alert", "inline"));
69585 authEnter.append("span").call(_t.append("note.login"));
69586 authEnter.append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("login")).on("click.note-login", function(d3_event) {
69587 d3_event.preventDefault();
69588 osm.authenticate();
69590 authEnter.transition().duration(200).style("opacity", 1);
69591 var prose = detailSection.selectAll(".note-save-prose").data(hasAuth ? [0] : []);
69592 prose.exit().remove();
69593 prose = prose.enter().append("p").attr("class", "note-save-prose").call(_t.append("note.upload_explanation")).merge(prose);
69594 osm.userDetails(function(err, user) {
69597 var userLink = select_default2(document.createElement("div"));
69598 if (user.image_url) {
69599 userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
69601 userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
69602 prose.html(_t.html("note.upload_explanation_with_user", { user: { html: userLink.html() } }));
69605 function noteSaveButtons(selection2) {
69606 var osm = services.osm;
69607 var hasAuth = osm && osm.authenticated();
69608 var isSelected = _note && _note.id === context.selectedNoteID();
69609 var buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_note] : [], function(d2) {
69610 return d2.status + d2.id;
69612 buttonSection.exit().remove();
69613 var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
69614 if (_note.isNew()) {
69615 buttonEnter.append("button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
69616 buttonEnter.append("button").attr("class", "button save-button action").call(_t.append("note.save"));
69618 buttonEnter.append("button").attr("class", "button status-button action");
69619 buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("note.comment"));
69621 buttonSection = buttonSection.merge(buttonEnter);
69622 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
69623 buttonSection.select(".save-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
69624 buttonSection.select(".status-button").attr("disabled", hasAuth ? null : true).html(function(d2) {
69625 var action = d2.status === "open" ? "close" : "open";
69626 var andComment = d2.newComment ? "_comment" : "";
69627 return _t.html("note." + action + andComment);
69628 }).on("click.status", clickStatus);
69629 buttonSection.select(".comment-button").attr("disabled", isSaveDisabled).on("click.comment", clickComment);
69630 function isSaveDisabled(d2) {
69631 return hasAuth && d2.status === "open" && d2.newComment ? null : true;
69634 function clickCancel(d3_event, d2) {
69636 var osm = services.osm;
69638 osm.removeNote(d2);
69640 context.enter(modeBrowse(context));
69641 dispatch14.call("change");
69643 function clickSave(d3_event, d2) {
69645 var osm = services.osm;
69647 osm.postNoteCreate(d2, function(err, note) {
69648 dispatch14.call("change", note);
69652 function clickStatus(d3_event, d2) {
69654 var osm = services.osm;
69656 var setStatus = d2.status === "open" ? "closed" : "open";
69657 osm.postNoteUpdate(d2, setStatus, function(err, note) {
69658 dispatch14.call("change", note);
69662 function clickComment(d3_event, d2) {
69664 var osm = services.osm;
69666 osm.postNoteUpdate(d2, d2.status, function(err, note) {
69667 dispatch14.call("change", note);
69671 noteEditor.note = function(val) {
69672 if (!arguments.length)
69677 noteEditor.newNote = function(val) {
69678 if (!arguments.length)
69683 return utilRebind(noteEditor, dispatch14, "on");
69686 // modules/ui/source_switch.js
69687 function uiSourceSwitch(context) {
69689 function click(d3_event) {
69690 d3_event.preventDefault();
69691 var osm = context.connection();
69694 if (context.inIntro())
69696 if (context.history().hasChanges() && !window.confirm(_t("source_switch.lose_changes")))
69698 var isLive = select_default2(this).classed("live");
69700 context.enter(modeBrowse(context));
69701 context.history().clearSaved();
69703 select_default2(this).html(isLive ? _t.html("source_switch.live") : _t.html("source_switch.dev")).classed("live", isLive).classed("chip", isLive);
69704 osm.switch(isLive ? keys2[0] : keys2[1]);
69706 var sourceSwitch = function(selection2) {
69707 selection2.append("a").attr("href", "#").call(_t.append("source_switch.live")).attr("class", "live chip").on("click", click);
69709 sourceSwitch.keys = function(_2) {
69710 if (!arguments.length)
69713 return sourceSwitch;
69715 return sourceSwitch;
69718 // modules/ui/spinner.js
69719 function uiSpinner(context) {
69720 var osm = context.connection();
69721 return function(selection2) {
69722 var img = selection2.append("img").attr("src", context.imagePath("loader-black.gif")).style("opacity", 0);
69724 osm.on("loading.spinner", function() {
69725 img.transition().style("opacity", 1);
69726 }).on("loaded.spinner", function() {
69727 img.transition().style("opacity", 0);
69733 // modules/ui/sections/privacy.js
69734 function uiSectionPrivacy(context) {
69735 let section = uiSection("preferences-third-party", context).label(() => _t.append("preferences.privacy.title")).disclosureContent(renderDisclosureContent);
69736 function renderDisclosureContent(selection2) {
69737 selection2.selectAll(".privacy-options-list").data([0]).enter().append("ul").attr("class", "layer-list privacy-options-list");
69738 let thirdPartyIconsEnter = selection2.select(".privacy-options-list").selectAll(".privacy-third-party-icons-item").data([corePreferences("preferences.privacy.thirdpartyicons") || "true"]).enter().append("li").attr("class", "privacy-third-party-icons-item").append("label").call(
69739 uiTooltip().title(() => _t.append("preferences.privacy.third_party_icons.tooltip")).placement("bottom")
69741 thirdPartyIconsEnter.append("input").attr("type", "checkbox").on("change", (d3_event, d2) => {
69742 d3_event.preventDefault();
69743 corePreferences("preferences.privacy.thirdpartyicons", d2 === "true" ? "false" : "true");
69745 thirdPartyIconsEnter.append("span").call(_t.append("preferences.privacy.third_party_icons.description"));
69746 selection2.selectAll(".privacy-third-party-icons-item").classed("active", (d2) => d2 === "true").select("input").property("checked", (d2) => d2 === "true");
69747 selection2.selectAll(".privacy-link").data([0]).enter().append("div").attr("class", "privacy-link").append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/openstreetmap/iD/blob/release/PRIVACY.md").append("span").call(_t.append("preferences.privacy.privacy_link"));
69749 corePreferences.onChange("preferences.privacy.thirdpartyicons", section.reRender);
69753 // modules/ui/splash.js
69754 function uiSplash(context) {
69755 return (selection2) => {
69756 if (context.history().hasRestorableChanges())
69758 let updateMessage = "";
69759 const sawPrivacyVersion = corePreferences("sawPrivacyVersion");
69760 let showSplash = !corePreferences("sawSplash");
69761 if (sawPrivacyVersion !== context.privacyVersion) {
69762 updateMessage = _t("splash.privacy_update");
69767 corePreferences("sawSplash", true);
69768 corePreferences("sawPrivacyVersion", context.privacyVersion);
69769 _mainFileFetcher.get("intro_graph");
69770 let modalSelection = uiModal(selection2);
69771 modalSelection.select(".modal").attr("class", "modal-splash modal");
69772 let introModal = modalSelection.select(".content").append("div").attr("class", "fillL");
69773 introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("splash.welcome"));
69774 let modalSection = introModal.append("div").attr("class", "modal-section");
69775 modalSection.append("p").html(_t.html("splash.text", {
69776 version: context.version,
69777 website: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/develop/CHANGELOG.md#whats-new">' + _t.html("splash.changelog") + "</a>" },
69778 github: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/issues">github.com</a>' }
69780 modalSection.append("p").html(_t.html("splash.privacy", {
69782 privacyLink: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/release/PRIVACY.md">' + _t("splash.privacy_policy") + "</a>" }
69784 uiSectionPrivacy(context).label(() => _t.append("splash.privacy_settings")).render(modalSection);
69785 let buttonWrap = introModal.append("div").attr("class", "modal-actions");
69786 let walkthrough = buttonWrap.append("button").attr("class", "walkthrough").on("click", () => {
69787 context.container().call(uiIntro(context));
69788 modalSelection.close();
69790 walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
69791 walkthrough.append("div").call(_t.append("splash.walkthrough"));
69792 let startEditing = buttonWrap.append("button").attr("class", "start-editing").on("click", modalSelection.close);
69793 startEditing.append("svg").attr("class", "logo logo-features").append("use").attr("xlink:href", "#iD-logo-features");
69794 startEditing.append("div").call(_t.append("splash.start"));
69795 modalSelection.select("button.close").attr("class", "hide");
69799 // modules/ui/status.js
69800 function uiStatus(context) {
69801 var osm = context.connection();
69802 return function(selection2) {
69805 function update(err, apiStatus) {
69806 selection2.html("");
69808 if (apiStatus === "connectionSwitched") {
69810 } else if (apiStatus === "rateLimited") {
69811 selection2.call(_t.append("osm_api_status.message.rateLimit")).append("a").attr("href", "#").attr("class", "api-status-login").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("login")).on("click.login", function(d3_event) {
69812 d3_event.preventDefault();
69813 osm.authenticate();
69816 var throttledRetry = throttle_default(function() {
69817 context.loadTiles(context.projection);
69818 osm.reloadApiStatus();
69820 selection2.call(_t.append("osm_api_status.message.error", { suffix: " " })).append("a").attr("href", "#").call(_t.append("osm_api_status.retry")).on("click.retry", function(d3_event) {
69821 d3_event.preventDefault();
69825 } else if (apiStatus === "readonly") {
69826 selection2.call(_t.append("osm_api_status.message.readonly"));
69827 } else if (apiStatus === "offline") {
69828 selection2.call(_t.append("osm_api_status.message.offline"));
69830 selection2.attr("class", "api-status " + (err ? "error" : apiStatus));
69832 osm.on("apiStatusChange.uiStatus", update);
69833 context.history().on("storage_error", () => {
69834 selection2.selectAll("span.local-storage-full").remove();
69835 selection2.append("span").attr("class", "local-storage-full").call(_t.append("osm_api_status.message.local_storage_full"));
69836 selection2.classed("error", true);
69838 window.setInterval(function() {
69839 osm.reloadApiStatus();
69841 osm.reloadApiStatus();
69845 // node_modules/osm-community-index/lib/simplify.js
69846 var import_diacritics2 = __toESM(require_diacritics(), 1);
69847 function simplify(str2) {
69848 if (typeof str2 !== "string")
69850 return import_diacritics2.default.remove(
69851 str2.replace(/&/g, "and").replace(/(İ|i̇)/ig, "i").replace(/[\s\-=_!"#%'*{},.\/:;?\(\)\[\]@\\$\^*+<>«»~`’\u00a1\u00a7\u00b6\u00b7\u00bf\u037e\u0387\u055a-\u055f\u0589\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0af0\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f14\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1360-\u1368\u166d\u166e\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u1805\u1807-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cc0-\u1cc7\u1cd3\u2000-\u206f\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e7f\u3001-\u3003\u303d\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uaaf0\uaaf1\uabeb\ufe10-\ufe16\ufe19\ufe30\ufe45\ufe46\ufe49-\ufe4c\ufe50-\ufe52\ufe54-\ufe57\ufe5f-\ufe61\ufe68\ufe6a\ufe6b\ufeff\uff01-\uff03\uff05-\uff07\uff0a\uff0c\uff0e\uff0f\uff1a\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65]+/g, "").toLowerCase()
69855 // node_modules/osm-community-index/lib/resolve_strings.js
69856 function resolveStrings(item, defaults, localizerFn) {
69857 let itemStrings = Object.assign({}, item.strings);
69858 let defaultStrings = Object.assign({}, defaults[item.type]);
69859 const anyToken = new RegExp(/(\{\w+\})/, "gi");
69861 if (itemStrings.community) {
69862 const communityID = simplify(itemStrings.community);
69863 itemStrings.community = localizerFn(`_communities.${communityID}`);
69865 ["name", "description", "extendedDescription"].forEach((prop) => {
69866 if (defaultStrings[prop])
69867 defaultStrings[prop] = localizerFn(`_defaults.${item.type}.${prop}`);
69868 if (itemStrings[prop])
69869 itemStrings[prop] = localizerFn(`${item.id}.${prop}`);
69872 let replacements = {
69873 account: item.account,
69874 community: itemStrings.community,
69875 signupUrl: itemStrings.signupUrl,
69876 url: itemStrings.url
69878 if (!replacements.signupUrl) {
69879 replacements.signupUrl = resolve(itemStrings.signupUrl || defaultStrings.signupUrl);
69881 if (!replacements.url) {
69882 replacements.url = resolve(itemStrings.url || defaultStrings.url);
69885 name: resolve(itemStrings.name || defaultStrings.name),
69886 url: resolve(itemStrings.url || defaultStrings.url),
69887 signupUrl: resolve(itemStrings.signupUrl || defaultStrings.signupUrl),
69888 description: resolve(itemStrings.description || defaultStrings.description),
69889 extendedDescription: resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription)
69891 resolved.nameHTML = linkify(resolved.url, resolved.name);
69892 resolved.urlHTML = linkify(resolved.url);
69893 resolved.signupUrlHTML = linkify(resolved.signupUrl);
69894 resolved.descriptionHTML = resolve(itemStrings.description || defaultStrings.description, true);
69895 resolved.extendedDescriptionHTML = resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription, true);
69897 function resolve(s2, addLinks) {
69901 for (let key in replacements) {
69902 const token = `{${key}}`;
69903 const regex = new RegExp(token, "g");
69904 if (regex.test(result)) {
69905 let replacement = replacements[key];
69906 if (!replacement) {
69907 throw new Error(`Cannot resolve token: ${token}`);
69909 if (addLinks && (key === "signupUrl" || key === "url")) {
69910 replacement = linkify(replacement);
69912 result = result.replace(regex, replacement);
69916 const leftovers = result.match(anyToken);
69918 throw new Error(`Cannot resolve tokens: ${leftovers}`);
69920 if (addLinks && item.type === "reddit") {
69921 result = result.replace(/(\/r\/\w+\/*)/i, (match) => linkify(resolved.url, match));
69925 function linkify(url, text2) {
69928 text2 = text2 || url;
69929 return `<a target="_blank" href="${url}">${text2}</a>`;
69933 // modules/ui/success.js
69935 function uiSuccess(context) {
69936 const MAXEVENTS = 2;
69937 const dispatch14 = dispatch_default("cancel");
69940 ensureOSMCommunityIndex();
69941 function ensureOSMCommunityIndex() {
69942 const data = _mainFileFetcher;
69943 return Promise.all([
69944 data.get("oci_features"),
69945 data.get("oci_resources"),
69946 data.get("oci_defaults")
69947 ]).then((vals) => {
69950 if (vals[0] && Array.isArray(vals[0].features)) {
69951 _sharedLocationManager.mergeCustomGeoJSON(vals[0]);
69953 let ociResources = Object.values(vals[1].resources);
69954 if (ociResources.length) {
69955 return _sharedLocationManager.mergeLocationSets(ociResources).then(() => {
69957 resources: ociResources,
69958 defaults: vals[2].defaults
69966 defaults: vals[2].defaults
69972 function parseEventDate(when) {
69975 let raw = when.trim();
69978 if (!/Z$/.test(raw)) {
69981 const parsed = new Date(raw);
69982 return new Date(parsed.toUTCString().slice(0, 25));
69984 function success(selection2) {
69985 let header = selection2.append("div").attr("class", "header fillL");
69986 header.append("h2").call(_t.append("success.just_edited"));
69987 header.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => dispatch14.call("cancel")).call(svgIcon("#iD-icon-close"));
69988 let body = selection2.append("div").attr("class", "body save-success fillL");
69989 let summary = body.append("div").attr("class", "save-summary");
69990 summary.append("h3").call(_t.append("success.thank_you" + (_location ? "_location" : ""), { where: _location }));
69991 summary.append("p").call(_t.append("success.help_html")).append("a").attr("class", "link-out").attr("target", "_blank").attr("href", _t("success.help_link_url")).call(svgIcon("#iD-icon-out-link", "inline")).append("span").call(_t.append("success.help_link_text"));
69992 let osm = context.connection();
69995 let changesetURL = osm.changesetURL(_changeset2.id);
69996 let table = summary.append("table").attr("class", "summary-table");
69997 let row = table.append("tr").attr("class", "summary-row");
69998 row.append("td").attr("class", "cell-icon summary-icon").append("a").attr("target", "_blank").attr("href", changesetURL).append("svg").attr("class", "logo-small").append("use").attr("xlink:href", "#iD-logo-osm");
69999 let summaryDetail = row.append("td").attr("class", "cell-detail summary-detail");
70000 summaryDetail.append("a").attr("class", "cell-detail summary-view-on-osm").attr("target", "_blank").attr("href", changesetURL).call(_t.append("success.view_on_osm"));
70001 summaryDetail.append("div").html(_t.html("success.changeset_id", {
70002 changeset_id: { html: `<a href="${changesetURL}" target="_blank">${_changeset2.id}</a>` }
70004 ensureOSMCommunityIndex().then((oci) => {
70005 const loc = context.map().center();
70006 const validHere = _sharedLocationManager.locationSetsAt(loc);
70007 let communities = [];
70008 oci.resources.forEach((resource) => {
70009 let area = validHere[resource.locationSetID];
70012 const localizer = (stringID) => _t.html(`community.${stringID}`);
70013 resource.resolved = resolveStrings(resource, oci.defaults, localizer);
70016 order: resource.order || 0,
70020 communities.sort((a2, b2) => a2.area - b2.area || b2.order - a2.order);
70021 body.call(showCommunityLinks, communities.map((c2) => c2.resource));
70024 function showCommunityLinks(selection2, resources) {
70025 let communityLinks = selection2.append("div").attr("class", "save-communityLinks");
70026 communityLinks.append("h3").call(_t.append("success.like_osm"));
70027 let table = communityLinks.append("table").attr("class", "community-table");
70028 let row = table.selectAll(".community-row").data(resources);
70029 let rowEnter = row.enter().append("tr").attr("class", "community-row");
70030 rowEnter.append("td").attr("class", "cell-icon community-icon").append("a").attr("target", "_blank").attr("href", (d2) => d2.resolved.url).append("svg").attr("class", "logo-small").append("use").attr("xlink:href", (d2) => `#community-${d2.type}`);
70031 let communityDetail = rowEnter.append("td").attr("class", "cell-detail community-detail");
70032 communityDetail.each(showCommunityDetails);
70033 communityLinks.append("div").attr("class", "community-missing").call(_t.append("success.missing")).append("a").attr("class", "link-out").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/osmlab/osm-community-index/issues").append("span").call(_t.append("success.tell_us"));
70035 function showCommunityDetails(d2) {
70036 let selection2 = select_default2(this);
70037 let communityID = d2.id;
70038 selection2.append("div").attr("class", "community-name").html(d2.resolved.nameHTML);
70039 selection2.append("div").attr("class", "community-description").html(d2.resolved.descriptionHTML);
70040 if (d2.resolved.extendedDescriptionHTML || d2.languageCodes && d2.languageCodes.length) {
70041 selection2.append("div").call(
70042 uiDisclosure(context, `community-more-${d2.id}`, false).expanded(false).updatePreference(false).label(() => _t.append("success.more")).content(showMore)
70045 let nextEvents = (d2.events || []).map((event) => {
70046 event.date = parseEventDate(event.when);
70048 }).filter((event) => {
70049 const t2 = event.date.getTime();
70050 const now3 = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
70051 return !isNaN(t2) && t2 >= now3;
70052 }).sort((a2, b2) => {
70053 return a2.date < b2.date ? -1 : a2.date > b2.date ? 1 : 0;
70054 }).slice(0, MAXEVENTS);
70055 if (nextEvents.length) {
70056 selection2.append("div").call(
70057 uiDisclosure(context, `community-events-${d2.id}`, false).expanded(false).updatePreference(false).label(_t.html("success.events")).content(showNextEvents)
70058 ).select(".hide-toggle").append("span").attr("class", "badge-text").text(nextEvents.length);
70060 function showMore(selection3) {
70061 let more = selection3.selectAll(".community-more").data([0]);
70062 let moreEnter = more.enter().append("div").attr("class", "community-more");
70063 if (d2.resolved.extendedDescriptionHTML) {
70064 moreEnter.append("div").attr("class", "community-extended-description").html(d2.resolved.extendedDescriptionHTML);
70066 if (d2.languageCodes && d2.languageCodes.length) {
70067 const languageList = d2.languageCodes.map((code) => _mainLocalizer.languageName(code)).join(", ");
70068 moreEnter.append("div").attr("class", "community-languages").call(_t.append("success.languages", { languages: languageList }));
70071 function showNextEvents(selection3) {
70072 let events = selection3.append("div").attr("class", "community-events");
70073 let item = events.selectAll(".community-event").data(nextEvents);
70074 let itemEnter = item.enter().append("div").attr("class", "community-event");
70075 itemEnter.append("div").attr("class", "community-event-name").append("a").attr("target", "_blank").attr("href", (d4) => d4.url).text((d4) => {
70076 let name = d4.name;
70077 if (d4.i18n && d4.id) {
70078 name = _t(`community.${communityID}.events.${d4.id}.name`, { default: name });
70082 itemEnter.append("div").attr("class", "community-event-when").text((d4) => {
70083 let options2 = { weekday: "short", day: "numeric", month: "short", year: "numeric" };
70084 if (d4.date.getHours() || d4.date.getMinutes()) {
70085 options2.hour = "numeric";
70086 options2.minute = "numeric";
70088 return d4.date.toLocaleString(_mainLocalizer.localeCode(), options2);
70090 itemEnter.append("div").attr("class", "community-event-where").text((d4) => {
70091 let where = d4.where;
70092 if (d4.i18n && d4.id) {
70093 where = _t(`community.${communityID}.events.${d4.id}.where`, { default: where });
70097 itemEnter.append("div").attr("class", "community-event-description").text((d4) => {
70098 let description = d4.description;
70099 if (d4.i18n && d4.id) {
70100 description = _t(`community.${communityID}.events.${d4.id}.description`, { default: description });
70102 return description;
70106 success.changeset = function(val) {
70107 if (!arguments.length)
70108 return _changeset2;
70112 success.location = function(val) {
70113 if (!arguments.length)
70118 return utilRebind(success, dispatch14, "on");
70121 // modules/ui/version.js
70122 var sawVersion = null;
70123 var isNewVersion = false;
70124 var isNewUser = false;
70125 function uiVersion(context) {
70126 var currVersion = context.version;
70127 var matchedVersion = currVersion.match(/\d+\.\d+\.\d+.*/);
70128 if (sawVersion === null && matchedVersion !== null) {
70129 if (corePreferences("sawVersion")) {
70131 isNewVersion = corePreferences("sawVersion") !== currVersion && currVersion.indexOf("-") === -1;
70134 isNewVersion = true;
70136 corePreferences("sawVersion", currVersion);
70137 sawVersion = currVersion;
70139 return function(selection2) {
70140 selection2.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD").text(currVersion);
70141 if (isNewVersion && !isNewUser) {
70142 selection2.append("a").attr("class", "badge").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD/blob/release/CHANGELOG.md#whats-new").call(svgIcon("#maki-gift")).call(
70143 uiTooltip().title(() => _t.append("version.whats_new", { version: currVersion })).placement("top").scrollContainer(context.container().select(".main-footer-wrap"))
70149 // modules/ui/zoom.js
70150 function uiZoom(context) {
70153 icon: "iD-icon-plus",
70154 title: _t.append("zoom.in"),
70156 disabled: function() {
70157 return !context.map().canZoomIn();
70159 disabledTitle: _t.append("zoom.disabled.in"),
70163 icon: "iD-icon-minus",
70164 title: _t.append("zoom.out"),
70166 disabled: function() {
70167 return !context.map().canZoomOut();
70169 disabledTitle: _t.append("zoom.disabled.out"),
70172 function zoomIn(d3_event) {
70173 if (d3_event.shiftKey)
70175 d3_event.preventDefault();
70176 context.map().zoomIn();
70178 function zoomOut(d3_event) {
70179 if (d3_event.shiftKey)
70181 d3_event.preventDefault();
70182 context.map().zoomOut();
70184 function zoomInFurther(d3_event) {
70185 if (d3_event.shiftKey)
70187 d3_event.preventDefault();
70188 context.map().zoomInFurther();
70190 function zoomOutFurther(d3_event) {
70191 if (d3_event.shiftKey)
70193 d3_event.preventDefault();
70194 context.map().zoomOutFurther();
70196 return function(selection2) {
70197 var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function(d2) {
70198 if (d2.disabled()) {
70199 return d2.disabledTitle;
70202 }).keys(function(d2) {
70205 var lastPointerUpType;
70206 var buttons = selection2.selectAll("button").data(zooms).enter().append("button").attr("class", function(d2) {
70208 }).on("pointerup.editor", function(d3_event) {
70209 lastPointerUpType = d3_event.pointerType;
70210 }).on("click.editor", function(d3_event, d2) {
70211 if (!d2.disabled()) {
70212 d2.action(d3_event);
70213 } else if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
70214 context.ui().flash.duration(2e3).iconName("#" + d2.icon).iconClass("disabled").label(d2.disabledTitle)();
70216 lastPointerUpType = null;
70217 }).call(tooltipBehavior);
70218 buttons.each(function(d2) {
70219 select_default2(this).call(svgIcon("#" + d2.icon, "light"));
70221 utilKeybinding.plusKeys.forEach(function(key) {
70222 context.keybinding().on([key], zoomIn);
70223 context.keybinding().on([uiCmd("\u2325" + key)], zoomInFurther);
70225 utilKeybinding.minusKeys.forEach(function(key) {
70226 context.keybinding().on([key], zoomOut);
70227 context.keybinding().on([uiCmd("\u2325" + key)], zoomOutFurther);
70229 function updateButtonStates() {
70230 buttons.classed("disabled", function(d2) {
70231 return d2.disabled();
70232 }).each(function() {
70233 var selection3 = select_default2(this);
70234 if (!selection3.select(".tooltip.in").empty()) {
70235 selection3.call(tooltipBehavior.updateContent);
70239 updateButtonStates();
70240 context.map().on("move.uiZoom", updateButtonStates);
70244 // modules/ui/sections/raw_tag_editor.js
70245 function uiSectionRawTagEditor(id2, context) {
70246 var section = uiSection(id2, context).classes("raw-tag-editor").label(function() {
70247 var count = Object.keys(_tags).filter(function(d2) {
70250 return _t.append("inspector.title_count", { title: _t("inspector.tags"), count });
70251 }).expandedByDefault(false).disclosureContent(renderDisclosureContent);
70252 var taginfo = services.taginfo;
70253 var dispatch14 = dispatch_default("change");
70254 var availableViews = [
70255 { id: "list", icon: "#fas-th-list" },
70256 { id: "text", icon: "#fas-i-cursor" }
70258 let _discardTags = {};
70259 _mainFileFetcher.get("discarded").then((d2) => {
70263 var _tagView = corePreferences("raw-tag-editor-view") || "list";
70264 var _readOnlyTags = [];
70265 var _orderedKeys = [];
70266 var _showBlank = false;
70267 var _pendingChange = null;
70272 var _didInteract = false;
70273 function interacted() {
70274 _didInteract = true;
70276 function renderDisclosureContent(wrap2) {
70277 _orderedKeys = _orderedKeys.filter(function(key) {
70278 return _tags[key] !== void 0;
70280 var all = Object.keys(_tags).sort();
70281 var missingKeys = utilArrayDifference(all, _orderedKeys);
70282 for (var i3 in missingKeys) {
70283 _orderedKeys.push(missingKeys[i3]);
70285 var rowData = _orderedKeys.map(function(key, i4) {
70286 return { index: i4, key, value: _tags[key] };
70288 if (!rowData.length || _showBlank) {
70289 _showBlank = false;
70290 rowData.push({ index: rowData.length, key: "", value: "" });
70292 var options2 = wrap2.selectAll(".raw-tag-options").data([0]);
70293 options2.exit().remove();
70294 var optionsEnter = options2.enter().insert("div", ":first-child").attr("class", "raw-tag-options").attr("role", "tablist");
70295 var optionEnter = optionsEnter.selectAll(".raw-tag-option").data(availableViews, function(d2) {
70298 optionEnter.append("button").attr("class", function(d2) {
70299 return "raw-tag-option raw-tag-option-" + d2.id + (_tagView === d2.id ? " selected" : "");
70300 }).attr("aria-selected", function(d2) {
70301 return _tagView === d2.id;
70302 }).attr("role", "tab").attr("title", function(d2) {
70303 return _t("icons." + d2.id);
70304 }).on("click", function(d3_event, d2) {
70306 corePreferences("raw-tag-editor-view", d2.id);
70307 wrap2.selectAll(".raw-tag-option").classed("selected", function(datum2) {
70308 return datum2 === d2;
70309 }).attr("aria-selected", function(datum2) {
70310 return datum2 === d2;
70312 wrap2.selectAll(".tag-text").classed("hide", d2.id !== "text").each(setTextareaHeight);
70313 wrap2.selectAll(".tag-list, .add-row").classed("hide", d2.id !== "list");
70314 }).each(function(d2) {
70315 select_default2(this).call(svgIcon(d2.icon));
70317 var textData = rowsToText(rowData);
70318 var textarea = wrap2.selectAll(".tag-text").data([0]);
70319 textarea = textarea.enter().append("textarea").attr("class", "tag-text" + (_tagView !== "text" ? " hide" : "")).call(utilNoAuto).attr("placeholder", _t("inspector.key_value")).attr("spellcheck", "false").merge(textarea);
70320 textarea.call(utilGetSetValue, textData).each(setTextareaHeight).on("input", setTextareaHeight).on("focus", interacted).on("blur", textChanged).on("change", textChanged);
70321 var list = wrap2.selectAll(".tag-list").data([0]);
70322 list = list.enter().append("ul").attr("class", "tag-list" + (_tagView !== "list" ? " hide" : "")).merge(list);
70323 var addRowEnter = wrap2.selectAll(".add-row").data([0]).enter().append("div").attr("class", "add-row" + (_tagView !== "list" ? " hide" : ""));
70324 addRowEnter.append("button").attr("class", "add-tag").attr("aria-label", _t("inspector.add_to_tag")).call(svgIcon("#iD-icon-plus", "light")).call(uiTooltip().title(() => _t.append("inspector.add_to_tag")).placement(_mainLocalizer.textDirection() === "ltr" ? "right" : "left")).on("click", addTag);
70325 addRowEnter.append("div").attr("class", "space-value");
70326 addRowEnter.append("div").attr("class", "space-buttons");
70327 var items = list.selectAll(".tag-row").data(rowData, function(d2) {
70330 items.exit().each(unbind).remove();
70331 var itemsEnter = items.enter().append("li").attr("class", "tag-row").classed("readonly", isReadOnly);
70332 var innerWrap = itemsEnter.append("div").attr("class", "inner-wrap");
70333 innerWrap.append("div").attr("class", "key-wrap").append("input").property("type", "text").attr("class", "key").call(utilNoAuto).on("focus", interacted).on("blur", keyChange).on("change", keyChange);
70334 innerWrap.append("div").attr("class", "value-wrap").append("input").property("type", "text").attr("class", "value").call(utilNoAuto).on("focus", interacted).on("blur", valueChange).on("change", valueChange).on("keydown.push-more", pushMore);
70335 innerWrap.append("button").attr("class", "form-field-button remove").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
70336 items = items.merge(itemsEnter).sort(function(a2, b2) {
70337 return a2.index - b2.index;
70339 items.each(function(d2) {
70340 var row = select_default2(this);
70341 var key = row.select("input.key");
70342 var value = row.select("input.value");
70343 if (_entityIDs && taginfo && _state !== "hover") {
70344 bindTypeahead(key, value);
70346 var referenceOptions = { key: d2.key };
70347 if (typeof d2.value === "string") {
70348 referenceOptions.value = d2.value;
70350 var reference = uiTagReference(referenceOptions, context);
70351 if (_state === "hover") {
70352 reference.showing(false);
70354 row.select(".inner-wrap").call(reference.button);
70355 row.call(reference.body);
70356 row.select("button.remove");
70358 items.selectAll("input.key").attr("title", function(d2) {
70360 }).call(utilGetSetValue, function(d2) {
70362 }).attr("readonly", function(d2) {
70363 return isReadOnly(d2) || null;
70365 items.selectAll("input.value").attr("title", function(d2) {
70366 return Array.isArray(d2.value) ? d2.value.filter(Boolean).join("\n") : d2.value;
70367 }).classed("mixed", function(d2) {
70368 return Array.isArray(d2.value);
70369 }).attr("placeholder", function(d2) {
70370 return typeof d2.value === "string" ? null : _t("inspector.multiple_values");
70371 }).call(utilGetSetValue, function(d2) {
70372 return typeof d2.value === "string" ? d2.value : "";
70373 }).attr("readonly", function(d2) {
70374 return isReadOnly(d2) || null;
70376 items.selectAll("button.remove").on(
70377 ("PointerEvent" in window ? "pointer" : "mouse") + "down",
70378 // 'click' fires too late - #5878
70379 (d3_event, d2) => {
70380 if (d3_event.button !== 0)
70382 removeTag(d3_event, d2);
70386 function isReadOnly(d2) {
70387 for (var i3 = 0; i3 < _readOnlyTags.length; i3++) {
70388 if (d2.key.match(_readOnlyTags[i3]) !== null) {
70394 function setTextareaHeight() {
70395 if (_tagView !== "text")
70397 var selection2 = select_default2(this);
70398 var matches = selection2.node().value.match(/\n/g);
70399 var lineCount = 2 + Number(matches && matches.length);
70400 var lineHeight = 20;
70401 selection2.style("height", lineCount * lineHeight + "px");
70403 function stringify3(s2) {
70404 return JSON.stringify(s2).slice(1, -1);
70406 function unstringify(s2) {
70409 if (s2.length < 1 || s2.charAt(0) !== '"') {
70412 if (s2.length < 2 || s2.charAt(s2.length - 1) !== '"' || s2.charAt(s2.length - 1) === '"' && s2.charAt(s2.length - 2) === "\\") {
70415 return JSON.parse(leading + s2 + trailing);
70417 function rowsToText(rows) {
70418 var str2 = rows.filter(function(row) {
70419 return row.key && row.key.trim() !== "";
70420 }).map(function(row) {
70421 var rawVal = row.value;
70422 if (typeof rawVal !== "string")
70424 var val = rawVal ? stringify3(rawVal) : "";
70425 return stringify3(row.key) + "=" + val;
70427 if (_state !== "hover" && str2.length) {
70428 return str2 + "\n";
70432 function textChanged() {
70433 var newText = this.value.trim();
70435 newText.split("\n").forEach(function(row) {
70436 var m2 = row.match(/^\s*([^=]+)=(.*)$/);
70438 var k2 = context.cleanTagKey(unstringify(m2[1].trim()));
70439 var v2 = context.cleanTagValue(unstringify(m2[2].trim()));
70443 var tagDiff = utilTagDiff(_tags, newTags);
70444 if (!tagDiff.length)
70446 _pendingChange = _pendingChange || {};
70447 tagDiff.forEach(function(change) {
70448 if (isReadOnly({ key: change.key }))
70450 if (change.newVal === "*" && typeof change.oldVal !== "string")
70452 if (change.type === "-") {
70453 _pendingChange[change.key] = void 0;
70454 } else if (change.type === "+") {
70455 _pendingChange[change.key] = change.newVal || "";
70458 if (Object.keys(_pendingChange).length === 0) {
70459 _pendingChange = null;
70464 function pushMore(d3_event) {
70465 if (d3_event.keyCode === 9 && !d3_event.shiftKey && section.selection().selectAll(".tag-list li:last-child input.value").node() === this && utilGetSetValue(select_default2(this))) {
70469 function bindTypeahead(key, value) {
70470 if (isReadOnly(key.datum()))
70472 if (Array.isArray(value.datum().value)) {
70473 value.call(uiCombobox(context, "tag-value").minItems(1).fetcher(function(value2, callback) {
70474 var keyString = utilGetSetValue(key);
70475 if (!_tags[keyString])
70477 var data = _tags[keyString].filter(Boolean).map(function(tagValue) {
70487 var geometry = context.graph().geometry(_entityIDs[0]);
70488 key.call(uiCombobox(context, "tag-key").fetcher(function(value2, callback) {
70493 }, function(err, data) {
70495 const filtered = data.filter((d2) => _tags[d2.value] === void 0).filter((d2) => !(d2.value in _discardTags)).filter((d2) => d2.value.toLowerCase().includes(value2.toLowerCase()));
70496 callback(sort(value2, filtered));
70500 value.call(uiCombobox(context, "tag-value").fetcher(function(value2, callback) {
70503 key: utilGetSetValue(key),
70506 }, function(err, data) {
70508 const filtered = data.filter((d2) => d2.value.toLowerCase().includes(value2.toLowerCase()));
70509 callback(sort(value2, filtered));
70512 }).caseSensitive(allowUpperCaseTagValues.test(utilGetSetValue(key))));
70513 function sort(value2, data) {
70514 var sameletter = [];
70516 for (var i3 = 0; i3 < data.length; i3++) {
70517 if (data[i3].value.substring(0, value2.length) === value2) {
70518 sameletter.push(data[i3]);
70520 other.push(data[i3]);
70523 return sameletter.concat(other);
70526 function unbind() {
70527 var row = select_default2(this);
70528 row.selectAll("input.key").call(uiCombobox.off, context);
70529 row.selectAll("input.value").call(uiCombobox.off, context);
70531 function keyChange(d3_event, d2) {
70532 if (select_default2(this).attr("readonly"))
70535 if (_pendingChange && _pendingChange.hasOwnProperty(kOld) && _pendingChange[kOld] === void 0)
70537 var kNew = context.cleanTagKey(this.value.trim());
70538 if (isReadOnly({ key: kNew })) {
70542 if (kNew && kNew !== kOld && _tags[kNew] !== void 0) {
70544 section.selection().selectAll(".tag-list input.value").each(function(d4) {
70545 if (d4.key === kNew) {
70546 var input = select_default2(this).node();
70553 _pendingChange = _pendingChange || {};
70557 _pendingChange[kNew] = _pendingChange[kOld] || { oldKey: kOld };
70558 _pendingChange[kOld] = void 0;
70560 let row = this.parentNode.parentNode;
70561 let inputVal = select_default2(row).selectAll("input.value");
70562 let vNew = context.cleanTagValue(utilGetSetValue(inputVal));
70563 _pendingChange[kNew] = vNew;
70564 utilGetSetValue(inputVal, vNew);
70566 var existingKeyIndex = _orderedKeys.indexOf(kOld);
70567 if (existingKeyIndex !== -1)
70568 _orderedKeys[existingKeyIndex] = kNew;
70573 function valueChange(d3_event, d2) {
70574 if (isReadOnly(d2))
70576 if (typeof d2.value !== "string" && !this.value)
70578 if (_pendingChange && _pendingChange.hasOwnProperty(d2.key) && _pendingChange[d2.key] === void 0)
70580 _pendingChange = _pendingChange || {};
70581 _pendingChange[d2.key] = context.cleanTagValue(this.value);
70584 function removeTag(d3_event, d2) {
70585 if (isReadOnly(d2))
70587 if (d2.key === "") {
70588 _showBlank = false;
70589 section.reRender();
70591 _orderedKeys = _orderedKeys.filter(function(key) {
70592 return key !== d2.key;
70594 _pendingChange = _pendingChange || {};
70595 _pendingChange[d2.key] = void 0;
70599 function addTag() {
70600 window.setTimeout(function() {
70602 section.reRender();
70603 section.selection().selectAll(".tag-list li:last-child input.key").node().focus();
70606 function scheduleChange() {
70607 var entityIDs = _entityIDs;
70608 window.setTimeout(function() {
70609 if (!_pendingChange)
70611 dispatch14.call("change", this, entityIDs, _pendingChange);
70612 _pendingChange = null;
70615 section.state = function(val) {
70616 if (!arguments.length)
70618 if (_state !== val) {
70624 section.presets = function(val) {
70625 if (!arguments.length)
70628 if (_presets && _presets.length && _presets[0].isFallback()) {
70629 section.disclosureExpanded(true);
70630 } else if (!_didInteract) {
70631 section.disclosureExpanded(null);
70635 section.tags = function(val) {
70636 if (!arguments.length)
70641 section.entityIDs = function(val) {
70642 if (!arguments.length)
70644 if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
70650 section.readOnlyTags = function(val) {
70651 if (!arguments.length)
70652 return _readOnlyTags;
70653 _readOnlyTags = val;
70656 return utilRebind(section, dispatch14, "on");
70659 // modules/ui/data_editor.js
70660 function uiDataEditor(context) {
70661 var dataHeader = uiDataHeader();
70662 var rawTagEditor = uiSectionRawTagEditor("custom-data-tag-editor", context).expandedByDefault(true).readOnlyTags([/./]);
70664 function dataEditor(selection2) {
70665 var header = selection2.selectAll(".header").data([0]);
70666 var headerEnter = header.enter().append("div").attr("class", "header fillL");
70667 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
70668 context.enter(modeBrowse(context));
70669 }).call(svgIcon("#iD-icon-close"));
70670 headerEnter.append("h2").call(_t.append("map_data.title"));
70671 var body = selection2.selectAll(".body").data([0]);
70672 body = body.enter().append("div").attr("class", "body").merge(body);
70673 var editor = body.selectAll(".data-editor").data([0]);
70674 editor.enter().append("div").attr("class", "modal-section data-editor").merge(editor).call(dataHeader.datum(_datum));
70675 var rte = body.selectAll(".raw-tag-editor").data([0]);
70676 rte.enter().append("div").attr("class", "raw-tag-editor data-editor").merge(rte).call(
70677 rawTagEditor.tags(_datum && _datum.properties || {}).state("hover").render
70678 ).selectAll("textarea.tag-text").attr("readonly", true).classed("readonly", true);
70680 dataEditor.datum = function(val) {
70681 if (!arguments.length)
70689 // modules/ui/osmose_details.js
70690 function uiOsmoseDetails(context) {
70692 function issueString(d2, type2) {
70695 const s2 = services.osmose.getStrings(d2.itemType);
70696 return type2 in s2 ? s2[type2] : "";
70698 function osmoseDetails(selection2) {
70699 const details = selection2.selectAll(".error-details").data(
70700 _qaItem ? [_qaItem] : [],
70701 (d2) => `${d2.id}-${d2.status || 0}`
70703 details.exit().remove();
70704 const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
70705 if (issueString(_qaItem, "detail")) {
70706 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
70707 div.append("h4").call(_t.append("QA.keepRight.detail_description"));
70708 div.append("p").attr("class", "qa-details-description-text").html((d2) => issueString(d2, "detail")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70710 const detailsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
70711 const elemsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
70712 if (issueString(_qaItem, "fix")) {
70713 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
70714 div.append("h4").call(_t.append("QA.osmose.fix_title"));
70715 div.append("p").html((d2) => issueString(d2, "fix")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70717 if (issueString(_qaItem, "trap")) {
70718 const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
70719 div.append("h4").call(_t.append("QA.osmose.trap_title"));
70720 div.append("p").html((d2) => issueString(d2, "trap")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70722 const thisItem = _qaItem;
70723 services.osmose.loadIssueDetail(_qaItem).then((d2) => {
70724 if (!d2.elems || d2.elems.length === 0)
70726 if (context.selectedErrorID() !== thisItem.id && context.container().selectAll(`.qaItem.osmose.hover.itemId-${thisItem.id}`).empty())
70729 detailsDiv.append("h4").call(_t.append("QA.osmose.detail_title"));
70730 detailsDiv.append("p").html((d4) => d4.detail).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
70732 elemsDiv.append("h4").call(_t.append("QA.osmose.elems_title"));
70733 elemsDiv.append("ul").selectAll("li").data(d2.elems).enter().append("li").append("a").attr("href", "#").attr("class", "error_entity_link").text((d4) => d4).each(function() {
70734 const link2 = select_default2(this);
70735 const entityID = this.textContent;
70736 const entity = context.hasEntity(entityID);
70737 link2.on("mouseenter", () => {
70738 utilHighlightEntities([entityID], true, context);
70739 }).on("mouseleave", () => {
70740 utilHighlightEntities([entityID], false, context);
70741 }).on("click", (d3_event) => {
70742 d3_event.preventDefault();
70743 utilHighlightEntities([entityID], false, context);
70744 const osmlayer = context.layers().layer("osm");
70745 if (!osmlayer.enabled()) {
70746 osmlayer.enabled(true);
70748 context.map().centerZoom(d2.loc, 20);
70750 context.enter(modeSelect(context, [entityID]));
70752 context.loadEntity(entityID, (err, result) => {
70755 const entity2 = result.data.find((e3) => e3.id === entityID);
70757 context.enter(modeSelect(context, [entityID]));
70762 let name = utilDisplayName(entity);
70764 const preset = _mainPresetIndex.match(entity, context.graph());
70765 name = preset && !preset.isFallback() && preset.name();
70768 this.innerText = name;
70772 context.features().forceVisible(d2.elems);
70773 context.map().pan([0, 0]);
70774 }).catch((err) => {
70778 osmoseDetails.issue = function(val) {
70779 if (!arguments.length)
70782 return osmoseDetails;
70784 return osmoseDetails;
70787 // modules/ui/osmose_header.js
70788 function uiOsmoseHeader() {
70790 function issueTitle(d2) {
70791 const unknown = _t("inspector.unknown");
70794 const s2 = services.osmose.getStrings(d2.itemType);
70795 return "title" in s2 ? s2.title : unknown;
70797 function osmoseHeader(selection2) {
70798 const header = selection2.selectAll(".qa-header").data(
70799 _qaItem ? [_qaItem] : [],
70800 (d2) => `${d2.id}-${d2.status || 0}`
70802 header.exit().remove();
70803 const headerEnter = header.enter().append("div").attr("class", "qa-header");
70804 const svgEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d2) => d2.id < 0).append("svg").attr("width", "20px").attr("height", "30px").attr("viewbox", "0 0 20 30").attr("class", (d2) => `preset-icon-28 qaItem ${d2.service} itemId-${d2.id} itemType-${d2.itemType}`);
70805 svgEnter.append("polygon").attr("fill", (d2) => services.osmose.getColor(d2.item)).attr("class", "qaItem-fill").attr("points", "16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6");
70806 svgEnter.append("use").attr("class", "icon-annotation").attr("width", "12px").attr("height", "12px").attr("transform", "translate(4, 5.5)").attr("xlink:href", (d2) => d2.icon ? "#" + d2.icon : "");
70807 headerEnter.append("div").attr("class", "qa-header-label").text(issueTitle);
70809 osmoseHeader.issue = function(val) {
70810 if (!arguments.length)
70813 return osmoseHeader;
70815 return osmoseHeader;
70818 // modules/ui/view_on_osmose.js
70819 function uiViewOnOsmose() {
70821 function viewOnOsmose(selection2) {
70823 if (services.osmose && _qaItem instanceof QAItem) {
70824 url = services.osmose.itemURL(_qaItem);
70826 const link2 = selection2.selectAll(".view-on-osmose").data(url ? [url] : []);
70827 link2.exit().remove();
70828 const linkEnter = link2.enter().append("a").attr("class", "view-on-osmose").attr("target", "_blank").attr("rel", "noopener").attr("href", (d2) => d2).call(svgIcon("#iD-icon-out-link", "inline"));
70829 linkEnter.append("span").call(_t.append("inspector.view_on_osmose"));
70831 viewOnOsmose.what = function(val) {
70832 if (!arguments.length)
70835 return viewOnOsmose;
70837 return viewOnOsmose;
70840 // modules/ui/osmose_editor.js
70841 function uiOsmoseEditor(context) {
70842 const dispatch14 = dispatch_default("change");
70843 const qaDetails = uiOsmoseDetails(context);
70844 const qaHeader = uiOsmoseHeader(context);
70846 function osmoseEditor(selection2) {
70847 const header = selection2.selectAll(".header").data([0]);
70848 const headerEnter = header.enter().append("div").attr("class", "header fillL");
70849 headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
70850 headerEnter.append("h2").call(_t.append("QA.osmose.title"));
70851 let body = selection2.selectAll(".body").data([0]);
70852 body = body.enter().append("div").attr("class", "body").merge(body);
70853 let editor = body.selectAll(".qa-editor").data([0]);
70854 editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(osmoseSaveSection);
70855 const footer = selection2.selectAll(".footer").data([0]);
70856 footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOsmose(context).what(_qaItem));
70858 function osmoseSaveSection(selection2) {
70859 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
70860 const isShown = _qaItem && isSelected;
70861 let saveSection = selection2.selectAll(".qa-save").data(
70862 isShown ? [_qaItem] : [],
70863 (d2) => `${d2.id}-${d2.status || 0}`
70865 saveSection.exit().remove();
70866 const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
70867 saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
70869 function qaSaveButtons(selection2) {
70870 const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
70871 let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
70872 buttonSection.exit().remove();
70873 const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
70874 buttonEnter.append("button").attr("class", "button close-button action");
70875 buttonEnter.append("button").attr("class", "button ignore-button action");
70876 buttonSection = buttonSection.merge(buttonEnter);
70877 buttonSection.select(".close-button").call(_t.append("QA.keepRight.close")).on("click.close", function(d3_event, d2) {
70879 const qaService = services.osmose;
70881 d2.newStatus = "done";
70882 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
70885 buttonSection.select(".ignore-button").call(_t.append("QA.keepRight.ignore")).on("click.ignore", function(d3_event, d2) {
70887 const qaService = services.osmose;
70889 d2.newStatus = "false";
70890 qaService.postUpdate(d2, (err, item) => dispatch14.call("change", item));
70894 osmoseEditor.error = function(val) {
70895 if (!arguments.length)
70898 return osmoseEditor;
70900 return utilRebind(osmoseEditor, dispatch14, "on");
70903 // modules/ui/sidebar.js
70904 function uiSidebar(context) {
70905 var inspector = uiInspector(context);
70906 var dataEditor = uiDataEditor(context);
70907 var noteEditor = uiNoteEditor(context);
70908 var improveOsmEditor = uiImproveOsmEditor(context);
70909 var keepRightEditor = uiKeepRightEditor(context);
70910 var osmoseEditor = uiOsmoseEditor(context);
70912 var _wasData = false;
70913 var _wasNote = false;
70914 var _wasQaItem = false;
70915 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
70916 function sidebar(selection2) {
70917 var container = context.container();
70918 var minWidth = 240;
70920 var containerWidth;
70922 selection2.style("min-width", minWidth + "px").style("max-width", "400px").style("width", "33.3333%");
70923 var resizer = selection2.append("div").attr("class", "sidebar-resizer").on(_pointerPrefix + "down.sidebar-resizer", pointerdown);
70924 var downPointerId, lastClientX, containerLocGetter;
70925 function pointerdown(d3_event) {
70928 if ("button" in d3_event && d3_event.button !== 0)
70930 downPointerId = d3_event.pointerId || "mouse";
70931 lastClientX = d3_event.clientX;
70932 containerLocGetter = utilFastMouse(container.node());
70933 dragOffset = utilFastMouse(resizer.node())(d3_event)[0] - 1;
70934 sidebarWidth = selection2.node().getBoundingClientRect().width;
70935 containerWidth = container.node().getBoundingClientRect().width;
70936 var widthPct = sidebarWidth / containerWidth * 100;
70937 selection2.style("width", widthPct + "%").style("max-width", "85%");
70938 resizer.classed("dragging", true);
70939 select_default2(window).on("touchmove.sidebar-resizer", function(d3_event2) {
70940 d3_event2.preventDefault();
70941 }, { passive: false }).on(_pointerPrefix + "move.sidebar-resizer", pointermove).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", pointerup);
70943 function pointermove(d3_event) {
70944 if (downPointerId !== (d3_event.pointerId || "mouse"))
70946 d3_event.preventDefault();
70947 var dx = d3_event.clientX - lastClientX;
70948 lastClientX = d3_event.clientX;
70949 var isRTL = _mainLocalizer.textDirection() === "rtl";
70950 var scaleX = isRTL ? 0 : 1;
70951 var xMarginProperty = isRTL ? "margin-right" : "margin-left";
70952 var x2 = containerLocGetter(d3_event)[0] - dragOffset;
70953 sidebarWidth = isRTL ? containerWidth - x2 : x2;
70954 var isCollapsed = selection2.classed("collapsed");
70955 var shouldCollapse = sidebarWidth < minWidth;
70956 selection2.classed("collapsed", shouldCollapse);
70957 if (shouldCollapse) {
70958 if (!isCollapsed) {
70959 selection2.style(xMarginProperty, "-400px").style("width", "400px");
70960 context.ui().onResize([(sidebarWidth - dx) * scaleX, 0]);
70963 var widthPct = sidebarWidth / containerWidth * 100;
70964 selection2.style(xMarginProperty, null).style("width", widthPct + "%");
70966 context.ui().onResize([-sidebarWidth * scaleX, 0]);
70968 context.ui().onResize([-dx * scaleX, 0]);
70972 function pointerup(d3_event) {
70973 if (downPointerId !== (d3_event.pointerId || "mouse"))
70975 downPointerId = null;
70976 resizer.classed("dragging", false);
70977 select_default2(window).on("touchmove.sidebar-resizer", null).on(_pointerPrefix + "move.sidebar-resizer", null).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", null);
70979 var featureListWrap = selection2.append("div").attr("class", "feature-list-pane").call(uiFeatureList(context));
70980 var inspectorWrap = selection2.append("div").attr("class", "inspector-hidden inspector-wrap");
70981 var hoverModeSelect = function(targets) {
70982 context.container().selectAll(".feature-list-item button").classed("hover", false);
70983 if (context.selectedIDs().length > 1 && targets && targets.length) {
70984 var elements = context.container().selectAll(".feature-list-item button").filter(function(node) {
70985 return targets.indexOf(node) !== -1;
70987 if (!elements.empty()) {
70988 elements.classed("hover", true);
70992 sidebar.hoverModeSelect = throttle_default(hoverModeSelect, 200);
70993 function hover(targets) {
70994 var datum2 = targets && targets.length && targets[0];
70995 if (datum2 && datum2.__featurehash__) {
70997 sidebar.show(dataEditor.datum(datum2));
70998 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
70999 } else if (datum2 instanceof osmNote) {
71000 if (context.mode().id === "drag-note")
71003 var osm = services.osm;
71005 datum2 = osm.getNote(datum2.id);
71007 sidebar.show(noteEditor.note(datum2));
71008 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
71009 } else if (datum2 instanceof QAItem) {
71011 var errService = services[datum2.service];
71013 datum2 = errService.getError(datum2.id);
71016 if (datum2.service === "keepRight") {
71017 errEditor = keepRightEditor;
71018 } else if (datum2.service === "osmose") {
71019 errEditor = osmoseEditor;
71021 errEditor = improveOsmEditor;
71023 context.container().selectAll(".qaItem." + datum2.service).classed("hover", function(d2) {
71024 return d2.id === datum2.id;
71026 sidebar.show(errEditor.error(datum2));
71027 selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
71028 } else if (!_current && datum2 instanceof osmEntity) {
71029 featureListWrap.classed("inspector-hidden", true);
71030 inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", true);
71031 if (!inspector.entityIDs() || !utilArrayIdentical(inspector.entityIDs(), [datum2.id]) || inspector.state() !== "hover") {
71032 inspector.state("hover").entityIDs([datum2.id]).newFeature(false);
71033 inspectorWrap.call(inspector);
71035 } else if (!_current) {
71036 featureListWrap.classed("inspector-hidden", false);
71037 inspectorWrap.classed("inspector-hidden", true);
71038 inspector.state("hide");
71039 } else if (_wasData || _wasNote || _wasQaItem) {
71042 _wasQaItem = false;
71043 context.container().selectAll(".note").classed("hover", false);
71044 context.container().selectAll(".qaItem").classed("hover", false);
71048 sidebar.hover = throttle_default(hover, 200);
71049 sidebar.intersects = function(extent) {
71050 var rect = selection2.node().getBoundingClientRect();
71051 return extent.intersects([
71052 context.projection.invert([0, rect.height]),
71053 context.projection.invert([rect.width, 0])
71056 sidebar.select = function(ids, newFeature) {
71058 if (ids && ids.length) {
71059 var entity = ids.length === 1 && context.entity(ids[0]);
71060 if (entity && newFeature && selection2.classed("collapsed")) {
71061 var extent = entity.extent(context.graph());
71062 sidebar.expand(sidebar.intersects(extent));
71064 featureListWrap.classed("inspector-hidden", true);
71065 inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", false);
71066 inspector.state("select").entityIDs(ids).newFeature(newFeature);
71067 inspectorWrap.call(inspector);
71069 inspector.state("hide");
71072 sidebar.showPresetList = function() {
71073 inspector.showList();
71075 sidebar.show = function(component, element) {
71076 featureListWrap.classed("inspector-hidden", true);
71077 inspectorWrap.classed("inspector-hidden", true);
71080 _current = selection2.append("div").attr("class", "sidebar-component").call(component, element);
71082 sidebar.hide = function() {
71083 featureListWrap.classed("inspector-hidden", false);
71084 inspectorWrap.classed("inspector-hidden", true);
71089 sidebar.expand = function(moveMap) {
71090 if (selection2.classed("collapsed")) {
71091 sidebar.toggle(moveMap);
71094 sidebar.collapse = function(moveMap) {
71095 if (!selection2.classed("collapsed")) {
71096 sidebar.toggle(moveMap);
71099 sidebar.toggle = function(moveMap) {
71100 if (context.inIntro())
71102 var isCollapsed = selection2.classed("collapsed");
71103 var isCollapsing = !isCollapsed;
71104 var isRTL = _mainLocalizer.textDirection() === "rtl";
71105 var scaleX = isRTL ? 0 : 1;
71106 var xMarginProperty = isRTL ? "margin-right" : "margin-left";
71107 sidebarWidth = selection2.node().getBoundingClientRect().width;
71108 selection2.style("width", sidebarWidth + "px");
71109 var startMargin, endMargin, lastMargin;
71110 if (isCollapsing) {
71111 startMargin = lastMargin = 0;
71112 endMargin = -sidebarWidth;
71114 startMargin = lastMargin = -sidebarWidth;
71117 if (!isCollapsing) {
71118 selection2.classed("collapsed", isCollapsing);
71120 selection2.transition().style(xMarginProperty, endMargin + "px").tween("panner", function() {
71121 var i3 = number_default(startMargin, endMargin);
71122 return function(t2) {
71123 var dx = lastMargin - Math.round(i3(t2));
71124 lastMargin = lastMargin - dx;
71125 context.ui().onResize(moveMap ? void 0 : [dx * scaleX, 0]);
71127 }).on("end", function() {
71128 if (isCollapsing) {
71129 selection2.classed("collapsed", isCollapsing);
71131 if (!isCollapsing) {
71132 var containerWidth2 = container.node().getBoundingClientRect().width;
71133 var widthPct = sidebarWidth / containerWidth2 * 100;
71134 selection2.style(xMarginProperty, null).style("width", widthPct + "%");
71138 resizer.on("dblclick", function(d3_event) {
71139 d3_event.preventDefault();
71140 if (d3_event.sourceEvent) {
71141 d3_event.sourceEvent.preventDefault();
71145 context.map().on("crossEditableZoom.sidebar", function(within) {
71146 if (!within && !selection2.select(".inspector-hover").empty()) {
71151 sidebar.showPresetList = function() {
71153 sidebar.hover = function() {
71155 sidebar.hover.cancel = function() {
71157 sidebar.intersects = function() {
71159 sidebar.select = function() {
71161 sidebar.show = function() {
71163 sidebar.hide = function() {
71165 sidebar.expand = function() {
71167 sidebar.collapse = function() {
71169 sidebar.toggle = function() {
71174 // modules/modes/draw_area.js
71175 function modeDrawArea(context, wayID, startGraph, button) {
71180 var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawArea", function() {
71181 context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.areas"))();
71183 mode.wayID = wayID;
71184 mode.enter = function() {
71185 context.install(behavior);
71187 mode.exit = function() {
71188 context.uninstall(behavior);
71190 mode.selectedIDs = function() {
71193 mode.activeID = function() {
71194 return behavior && behavior.activeID() || [];
71199 // modules/modes/add_area.js
71200 function modeAddArea(context, mode) {
71201 mode.id = "add-area";
71202 var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
71203 function defaultTags(loc) {
71204 var defaultTags2 = { area: "yes" };
71206 defaultTags2 = mode.preset.setTags(defaultTags2, "area", false, loc);
71207 return defaultTags2;
71209 function actionClose(wayId) {
71210 return function(graph) {
71211 return graph.replace(graph.entity(wayId).close());
71214 function start2(loc) {
71215 var startGraph = context.graph();
71216 var node = osmNode({ loc });
71217 var way = osmWay({ tags: defaultTags(loc) });
71219 actionAddEntity(node),
71220 actionAddEntity(way),
71221 actionAddVertex(way.id, node.id),
71222 actionClose(way.id)
71224 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
71226 function startFromWay(loc, edge) {
71227 var startGraph = context.graph();
71228 var node = osmNode({ loc });
71229 var way = osmWay({ tags: defaultTags(loc) });
71231 actionAddEntity(node),
71232 actionAddEntity(way),
71233 actionAddVertex(way.id, node.id),
71234 actionClose(way.id),
71235 actionAddMidpoint({ loc, edge }, node)
71237 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
71239 function startFromNode(node) {
71240 var startGraph = context.graph();
71241 var way = osmWay({ tags: defaultTags(node.loc) });
71243 actionAddEntity(way),
71244 actionAddVertex(way.id, node.id),
71245 actionClose(way.id)
71247 context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
71249 mode.enter = function() {
71250 context.install(behavior);
71252 mode.exit = function() {
71253 context.uninstall(behavior);
71258 // modules/modes/add_line.js
71259 function modeAddLine(context, mode) {
71260 mode.id = "add-line";
71261 var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
71262 function defaultTags(loc) {
71263 var defaultTags2 = {};
71265 defaultTags2 = mode.preset.setTags(defaultTags2, "line", false, loc);
71266 return defaultTags2;
71268 function start2(loc) {
71269 var startGraph = context.graph();
71270 var node = osmNode({ loc });
71271 var way = osmWay({ tags: defaultTags(loc) });
71273 actionAddEntity(node),
71274 actionAddEntity(way),
71275 actionAddVertex(way.id, node.id)
71277 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
71279 function startFromWay(loc, edge) {
71280 var startGraph = context.graph();
71281 var node = osmNode({ loc });
71282 var way = osmWay({ tags: defaultTags(loc) });
71284 actionAddEntity(node),
71285 actionAddEntity(way),
71286 actionAddVertex(way.id, node.id),
71287 actionAddMidpoint({ loc, edge }, node)
71289 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
71291 function startFromNode(node) {
71292 var startGraph = context.graph();
71293 var way = osmWay({ tags: defaultTags(node.loc) });
71295 actionAddEntity(way),
71296 actionAddVertex(way.id, node.id)
71298 context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
71300 mode.enter = function() {
71301 context.install(behavior);
71303 mode.exit = function() {
71304 context.uninstall(behavior);
71309 // modules/modes/add_point.js
71310 function modeAddPoint(context, mode) {
71311 mode.id = "add-point";
71312 var behavior = behaviorDraw(context).on("click", add).on("clickWay", addWay).on("clickNode", addNode).on("cancel", cancel).on("finish", cancel);
71313 function defaultTags(loc) {
71314 var defaultTags2 = {};
71316 defaultTags2 = mode.preset.setTags(defaultTags2, "point", false, loc);
71317 return defaultTags2;
71319 function add(loc) {
71320 var node = osmNode({ loc, tags: defaultTags(loc) });
71322 actionAddEntity(node),
71323 _t("operations.add.annotation.point")
71325 enterSelectMode(node);
71327 function addWay(loc, edge) {
71328 var node = osmNode({ tags: defaultTags(loc) });
71330 actionAddMidpoint({ loc, edge }, node),
71331 _t("operations.add.annotation.vertex")
71333 enterSelectMode(node);
71335 function enterSelectMode(node) {
71337 modeSelect(context, [node.id]).newFeature(true)
71340 function addNode(node) {
71341 const _defaultTags = defaultTags(node.loc);
71342 if (Object.keys(_defaultTags).length === 0) {
71343 enterSelectMode(node);
71346 var tags = Object.assign({}, node.tags);
71347 for (var key in _defaultTags) {
71348 tags[key] = _defaultTags[key];
71351 actionChangeTags(node.id, tags),
71352 _t("operations.add.annotation.point")
71354 enterSelectMode(node);
71356 function cancel() {
71357 context.enter(modeBrowse(context));
71359 mode.enter = function() {
71360 context.install(behavior);
71362 mode.exit = function() {
71363 context.uninstall(behavior);
71368 // modules/modes/select_note.js
71369 function modeSelectNote(context, selectedNoteID) {
71374 var _keybinding = utilKeybinding("select-note");
71375 var _noteEditor = uiNoteEditor(context).on("change", function() {
71376 context.map().pan([0, 0]);
71377 var note = checkSelectedID();
71380 context.ui().sidebar.show(_noteEditor.note(note));
71383 behaviorBreathe(context),
71384 behaviorHover(context),
71385 behaviorSelect(context),
71386 behaviorLasso(context),
71387 modeDragNode(context).behavior,
71388 modeDragNote(context).behavior
71390 var _newFeature = false;
71391 function checkSelectedID() {
71394 var note = services.osm.getNote(selectedNoteID);
71396 context.enter(modeBrowse(context));
71400 function selectNote(d3_event, drawn) {
71401 if (!checkSelectedID())
71403 var selection2 = context.surface().selectAll(".layer-notes .note-" + selectedNoteID);
71404 if (selection2.empty()) {
71405 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
71406 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
71407 context.enter(modeBrowse(context));
71410 selection2.classed("selected", true);
71411 context.selectedNoteID(selectedNoteID);
71415 if (context.container().select(".combobox").size())
71417 context.enter(modeBrowse(context));
71419 mode.zoomToSelected = function() {
71422 var note = services.osm.getNote(selectedNoteID);
71424 context.map().centerZoomEase(note.loc, 20);
71427 mode.newFeature = function(val) {
71428 if (!arguments.length)
71429 return _newFeature;
71433 mode.enter = function() {
71434 var note = checkSelectedID();
71437 _behaviors.forEach(context.install);
71438 _keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
71439 select_default2(document).call(_keybinding);
71441 var sidebar = context.ui().sidebar;
71442 sidebar.show(_noteEditor.note(note).newNote(_newFeature));
71443 sidebar.expand(sidebar.intersects(note.extent()));
71444 context.map().on("drawn.select", selectNote);
71446 mode.exit = function() {
71447 _behaviors.forEach(context.uninstall);
71448 select_default2(document).call(_keybinding.unbind);
71449 context.surface().selectAll(".layer-notes .selected").classed("selected hover", false);
71450 context.map().on("drawn.select", null);
71451 context.ui().sidebar.hide();
71452 context.selectedNoteID(null);
71457 // modules/modes/add_note.js
71458 function modeAddNote(context) {
71462 description: _t.append("modes.add_note.description"),
71463 key: _t("modes.add_note.key")
71465 var behavior = behaviorDraw(context).on("click", add).on("cancel", cancel).on("finish", cancel);
71466 function add(loc) {
71467 var osm = services.osm;
71470 var note = osmNote({ loc, status: "open", comments: [] });
71471 osm.replaceNote(note);
71472 context.map().pan([0, 0]);
71473 context.selectedNoteID(note.id).enter(modeSelectNote(context, note.id).newFeature(true));
71475 function cancel() {
71476 context.enter(modeBrowse(context));
71478 mode.enter = function() {
71479 context.install(behavior);
71481 mode.exit = function() {
71482 context.uninstall(behavior);
71487 // modules/modes/save.js
71488 function modeSave(context) {
71489 var mode = { id: "save" };
71490 var keybinding = utilKeybinding("modeSave");
71491 var commit = uiCommit(context).on("cancel", cancel);
71495 var uploader = context.uploader().on("saveStarted.modeSave", function() {
71497 }).on("willAttemptUpload.modeSave", prepareForSuccess).on("progressChanged.modeSave", showProgress).on("resultNoChanges.modeSave", function() {
71499 }).on("resultErrors.modeSave", showErrors).on("resultConflicts.modeSave", showConflicts).on("resultSuccess.modeSave", showSuccess);
71500 function cancel() {
71501 context.enter(modeBrowse(context));
71503 function showProgress(num, total) {
71504 var modal = context.container().select(".loading-modal .modal-section");
71505 var progress = modal.selectAll(".progress").data([0]);
71506 progress.enter().append("div").attr("class", "progress").merge(progress).text(_t("save.conflict_progress", { num, total }));
71508 function showConflicts(changeset, conflicts, origChanges) {
71509 var selection2 = context.container().select(".sidebar").append("div").attr("class", "sidebar-component");
71510 context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
71511 _conflictsUi = uiConflicts(context).conflictList(conflicts).origChanges(origChanges).on("cancel", function() {
71512 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
71513 selection2.remove();
71515 uploader.cancelConflictResolution();
71516 }).on("save", function() {
71517 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
71518 selection2.remove();
71519 uploader.processResolvedConflicts(changeset);
71521 selection2.call(_conflictsUi);
71523 function showErrors(errors) {
71525 var selection2 = uiConfirm(context.container());
71526 selection2.select(".modal-section.header").append("h3").text(_t("save.error"));
71527 addErrors(selection2, errors);
71528 selection2.okButton();
71530 function addErrors(selection2, data) {
71531 var message = selection2.select(".modal-section.message-text");
71532 var items = message.selectAll(".error-container").data(data);
71533 var enter = items.enter().append("div").attr("class", "error-container");
71534 enter.append("a").attr("class", "error-description").attr("href", "#").classed("hide-toggle", true).text(function(d2) {
71535 return d2.msg || _t("save.unknown_error_details");
71536 }).on("click", function(d3_event) {
71537 d3_event.preventDefault();
71538 var error = select_default2(this);
71539 var detail = select_default2(this.nextElementSibling);
71540 var exp2 = error.classed("expanded");
71541 detail.style("display", exp2 ? "none" : "block");
71542 error.classed("expanded", !exp2);
71544 var details = enter.append("div").attr("class", "error-detail-container").style("display", "none");
71545 details.append("ul").attr("class", "error-detail-list").selectAll("li").data(function(d2) {
71546 return d2.details || [];
71547 }).enter().append("li").attr("class", "error-detail-item").text(function(d2) {
71550 items.exit().remove();
71552 function showSuccess(changeset) {
71554 var ui = _success.changeset(changeset).location(_location).on("cancel", function() {
71555 context.ui().sidebar.hide();
71557 context.enter(modeBrowse(context).sidebar(ui));
71559 function keybindingOn() {
71560 select_default2(document).call(keybinding.on("\u238B", cancel, true));
71562 function keybindingOff() {
71563 select_default2(document).call(keybinding.unbind);
71565 function prepareForSuccess() {
71566 _success = uiSuccess(context);
71568 if (!services.geocoder)
71570 services.geocoder.reverse(context.map().center(), function(err, result) {
71571 if (err || !result || !result.address)
71573 var addr = result.address;
71574 var place = addr && (addr.town || addr.city || addr.county) || "";
71575 var region = addr && (addr.state || addr.country) || "";
71576 var separator = place && region ? _t("success.thank_you_where.separator") : "";
71578 "success.thank_you_where.format",
71579 { place, separator, region }
71583 mode.selectedIDs = function() {
71584 return _conflictsUi ? _conflictsUi.shownEntityIds() : [];
71586 mode.enter = function() {
71587 context.ui().sidebar.expand();
71589 context.ui().sidebar.show(commit);
71592 context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
71593 var osm = context.connection();
71598 if (osm.authenticated()) {
71601 osm.authenticate(function(err) {
71610 mode.exit = function() {
71612 context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
71613 context.ui().sidebar.hide();
71618 // modules/modes/select_error.js
71619 function modeSelectError(context, selectedErrorID, selectedErrorService) {
71621 id: "select-error",
71624 var keybinding = utilKeybinding("select-error");
71625 var errorService = services[selectedErrorService];
71627 switch (selectedErrorService) {
71629 errorEditor = uiImproveOsmEditor(context).on("change", function() {
71630 context.map().pan([0, 0]);
71631 var error = checkSelectedID();
71634 context.ui().sidebar.show(errorEditor.error(error));
71638 errorEditor = uiKeepRightEditor(context).on("change", function() {
71639 context.map().pan([0, 0]);
71640 var error = checkSelectedID();
71643 context.ui().sidebar.show(errorEditor.error(error));
71647 errorEditor = uiOsmoseEditor(context).on("change", function() {
71648 context.map().pan([0, 0]);
71649 var error = checkSelectedID();
71652 context.ui().sidebar.show(errorEditor.error(error));
71657 behaviorBreathe(context),
71658 behaviorHover(context),
71659 behaviorSelect(context),
71660 behaviorLasso(context),
71661 modeDragNode(context).behavior,
71662 modeDragNote(context).behavior
71664 function checkSelectedID() {
71667 var error = errorService.getError(selectedErrorID);
71669 context.enter(modeBrowse(context));
71673 mode.zoomToSelected = function() {
71676 var error = errorService.getError(selectedErrorID);
71678 context.map().centerZoomEase(error.loc, 20);
71681 mode.enter = function() {
71682 var error = checkSelectedID();
71685 behaviors.forEach(context.install);
71686 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
71687 select_default2(document).call(keybinding);
71689 var sidebar = context.ui().sidebar;
71690 sidebar.show(errorEditor.error(error));
71691 context.map().on("drawn.select-error", selectError);
71692 function selectError(d3_event, drawn) {
71693 if (!checkSelectedID())
71695 var selection2 = context.surface().selectAll(".itemId-" + selectedErrorID + "." + selectedErrorService);
71696 if (selection2.empty()) {
71697 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
71698 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
71699 context.enter(modeBrowse(context));
71702 selection2.classed("selected", true);
71703 context.selectedErrorID(selectedErrorID);
71707 if (context.container().select(".combobox").size())
71709 context.enter(modeBrowse(context));
71712 mode.exit = function() {
71713 behaviors.forEach(context.uninstall);
71714 select_default2(document).call(keybinding.unbind);
71715 context.surface().selectAll(".qaItem.selected").classed("selected hover", false);
71716 context.map().on("drawn.select-error", null);
71717 context.ui().sidebar.hide();
71718 context.selectedErrorID(null);
71719 context.features().forceVisible([]);
71724 // modules/ui/tools/modes.js
71725 function uiToolDrawModes(context) {
71728 label: _t.append("toolbar.add_feature")
71731 modeAddPoint(context, {
71732 title: _t.append("modes.add_point.title"),
71734 description: _t.append("modes.add_point.description"),
71735 preset: _mainPresetIndex.item("point"),
71738 modeAddLine(context, {
71739 title: _t.append("modes.add_line.title"),
71741 description: _t.append("modes.add_line.description"),
71742 preset: _mainPresetIndex.item("line"),
71745 modeAddArea(context, {
71746 title: _t.append("modes.add_area.title"),
71748 description: _t.append("modes.add_area.description"),
71749 preset: _mainPresetIndex.item("area"),
71753 function enabled(_mode) {
71754 return osmEditable();
71756 function osmEditable() {
71757 return context.editable();
71759 modes.forEach(function(mode) {
71760 context.keybinding().on(mode.key, function() {
71761 if (!enabled(mode))
71763 if (mode.id === context.mode().id) {
71764 context.enter(modeBrowse(context));
71766 context.enter(mode);
71770 tool.render = function(selection2) {
71771 var wrap2 = selection2.append("div").attr("class", "joined").style("display", "flex");
71772 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
71773 context.map().on("move.modes", debouncedUpdate).on("drawn.modes", debouncedUpdate);
71774 context.on("enter.modes", update);
71776 function update() {
71777 var buttons = wrap2.selectAll("button.add-button").data(modes, function(d2) {
71780 buttons.exit().remove();
71781 var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
71782 return d2.id + " add-button bar-button";
71783 }).on("click.mode-buttons", function(d3_event, d2) {
71786 var currMode = context.mode().id;
71787 if (/^draw/.test(currMode))
71789 if (d2.id === currMode) {
71790 context.enter(modeBrowse(context));
71795 uiTooltip().placement("bottom").title(function(d2) {
71796 return d2.description;
71797 }).keys(function(d2) {
71799 }).scrollContainer(context.container().select(".top-toolbar"))
71801 buttonsEnter.each(function(d2) {
71802 select_default2(this).call(svgIcon("#iD-icon-" + d2.button));
71804 buttonsEnter.append("span").attr("class", "label").text("").each(function(mode) {
71805 mode.title(select_default2(this));
71807 if (buttons.enter().size() || buttons.exit().size()) {
71808 context.ui().checkOverflow(".top-toolbar", true);
71810 buttons = buttons.merge(buttonsEnter).attr("aria-disabled", function(d2) {
71811 return !enabled(d2);
71812 }).classed("disabled", function(d2) {
71813 return !enabled(d2);
71814 }).attr("aria-pressed", function(d2) {
71815 return context.mode() && context.mode().button === d2.button;
71816 }).classed("active", function(d2) {
71817 return context.mode() && context.mode().button === d2.button;
71824 // modules/ui/tools/notes.js
71825 function uiToolNotes(context) {
71828 label: _t.append("modes.add_note.label")
71830 var mode = modeAddNote(context);
71831 function enabled() {
71832 return notesEnabled() && notesEditable();
71834 function notesEnabled() {
71835 var noteLayer = context.layers().layer("notes");
71836 return noteLayer && noteLayer.enabled();
71838 function notesEditable() {
71839 var mode2 = context.mode();
71840 return context.map().notesEditable() && mode2 && mode2.id !== "save";
71842 context.keybinding().on(mode.key, function() {
71845 if (mode.id === context.mode().id) {
71846 context.enter(modeBrowse(context));
71848 context.enter(mode);
71851 tool.render = function(selection2) {
71852 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
71853 context.map().on("move.notes", debouncedUpdate).on("drawn.notes", debouncedUpdate);
71854 context.on("enter.notes", update);
71856 function update() {
71857 var showNotes = notesEnabled();
71858 var data = showNotes ? [mode] : [];
71859 var buttons = selection2.selectAll("button.add-button").data(data, function(d2) {
71862 buttons.exit().remove();
71863 var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
71864 return d2.id + " add-button bar-button";
71865 }).on("click.notes", function(d3_event, d2) {
71868 var currMode = context.mode().id;
71869 if (/^draw/.test(currMode))
71871 if (d2.id === currMode) {
71872 context.enter(modeBrowse(context));
71877 uiTooltip().placement("bottom").title(function(d2) {
71878 return d2.description;
71879 }).keys(function(d2) {
71881 }).scrollContainer(context.container().select(".top-toolbar"))
71883 buttonsEnter.each(function(d2) {
71884 select_default2(this).call(svgIcon(d2.icon || "#iD-icon-" + d2.button));
71886 if (buttons.enter().size() || buttons.exit().size()) {
71887 context.ui().checkOverflow(".top-toolbar", true);
71889 buttons = buttons.merge(buttonsEnter).classed("disabled", function() {
71891 }).attr("aria-disabled", function() {
71893 }).classed("active", function(d2) {
71894 return context.mode() && context.mode().button === d2.button;
71895 }).attr("aria-pressed", function(d2) {
71896 return context.mode() && context.mode().button === d2.button;
71900 tool.uninstall = function() {
71901 context.on("enter.editor.notes", null).on("exit.editor.notes", null).on("enter.notes", null);
71902 context.map().on("move.notes", null).on("drawn.notes", null);
71907 // modules/ui/tools/save.js
71908 function uiToolSave(context) {
71911 label: _t.append("save.title")
71914 var tooltipBehavior = null;
71915 var history = context.history();
71916 var key = uiCmd("\u2318S");
71917 var _numChanges = 0;
71918 function isSaving() {
71919 var mode = context.mode();
71920 return mode && mode.id === "save";
71922 function isDisabled() {
71923 return _numChanges === 0 || isSaving();
71925 function save(d3_event) {
71926 d3_event.preventDefault();
71927 if (!context.inIntro() && !isSaving() && history.hasChanges()) {
71928 context.enter(modeSave(context));
71931 function bgColor(numChanges) {
71933 if (numChanges === 0) {
71935 } else if (numChanges <= 50) {
71936 step = numChanges / 50;
71937 return rgb_default("#fff", "#ff8")(step);
71939 step = Math.min((numChanges - 50) / 50, 1);
71940 return rgb_default("#ff8", "#f88")(step);
71943 function updateCount() {
71944 var val = history.difference().summary().length;
71945 if (val === _numChanges)
71948 if (tooltipBehavior) {
71949 tooltipBehavior.title(() => _t.append(_numChanges > 0 ? "save.help" : "save.no_changes")).keys([key]);
71952 button.classed("disabled", isDisabled()).style("background", bgColor(_numChanges));
71953 button.select("span.count").text(_numChanges);
71956 tool.render = function(selection2) {
71957 tooltipBehavior = uiTooltip().placement("bottom").title(() => _t.append("save.no_changes")).keys([key]).scrollContainer(context.container().select(".top-toolbar"));
71958 var lastPointerUpType;
71959 button = selection2.append("button").attr("class", "save disabled bar-button").on("pointerup", function(d3_event) {
71960 lastPointerUpType = d3_event.pointerType;
71961 }).on("click", function(d3_event) {
71963 if (_numChanges === 0 && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
71964 context.ui().flash.duration(2e3).iconName("#iD-icon-save").iconClass("disabled").label(_t.append("save.no_changes"))();
71966 lastPointerUpType = null;
71967 }).call(tooltipBehavior);
71968 button.call(svgIcon("#iD-icon-save"));
71969 button.append("span").attr("class", "count").attr("aria-hidden", "true").text("0");
71971 context.keybinding().on(key, save, true);
71972 context.history().on("change.save", updateCount);
71973 context.on("enter.save", function() {
71975 button.classed("disabled", isDisabled());
71977 button.call(tooltipBehavior.hide);
71982 tool.uninstall = function() {
71983 context.keybinding().off(key, true);
71984 context.history().on("change.save", null);
71985 context.on("enter.save", null);
71987 tooltipBehavior = null;
71992 // modules/ui/tools/sidebar_toggle.js
71993 function uiToolSidebarToggle(context) {
71995 id: "sidebar_toggle",
71996 label: _t.append("toolbar.inspect")
71998 tool.render = function(selection2) {
71999 selection2.append("button").attr("class", "bar-button").attr("aria-label", _t("sidebar.tooltip")).on("click", function() {
72000 context.ui().sidebar.toggle();
72002 uiTooltip().placement("bottom").title(() => _t.append("sidebar.tooltip")).keys([_t("sidebar.key")]).scrollContainer(context.container().select(".top-toolbar"))
72003 ).call(svgIcon("#iD-icon-sidebar-" + (_mainLocalizer.textDirection() === "rtl" ? "right" : "left")));
72008 // modules/ui/tools/undo_redo.js
72009 function uiToolUndoRedo(context) {
72012 label: _t.append("toolbar.undo_redo")
72016 cmd: uiCmd("\u2318Z"),
72017 action: function() {
72020 annotation: function() {
72021 return context.history().undoAnnotation();
72023 icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")
72026 cmd: uiCmd("\u2318\u21E7Z"),
72027 action: function() {
72030 annotation: function() {
72031 return context.history().redoAnnotation();
72033 icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "undo" : "redo")
72035 function editable() {
72036 return context.mode() && context.mode().id !== "save" && context.map().editableDataEnabled(
72038 /* ignore min zoom */
72041 tool.render = function(selection2) {
72042 var tooltipBehavior = uiTooltip().placement("bottom").title(function(d2) {
72043 return d2.annotation() ? _t.append(d2.id + ".tooltip", { action: d2.annotation() }) : _t.append(d2.id + ".nothing");
72044 }).keys(function(d2) {
72046 }).scrollContainer(context.container().select(".top-toolbar"));
72047 var lastPointerUpType;
72048 var buttons = selection2.selectAll("button").data(commands).enter().append("button").attr("class", function(d2) {
72049 return "disabled " + d2.id + "-button bar-button";
72050 }).on("pointerup", function(d3_event) {
72051 lastPointerUpType = d3_event.pointerType;
72052 }).on("click", function(d3_event, d2) {
72053 d3_event.preventDefault();
72054 var annotation = d2.annotation();
72055 if (editable() && annotation) {
72058 if (editable() && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
72059 var label = annotation ? _t.append(d2.id + ".tooltip", { action: annotation }) : _t.append(d2.id + ".nothing");
72060 context.ui().flash.duration(2e3).iconName("#" + d2.icon).iconClass(annotation ? "" : "disabled").label(label)();
72062 lastPointerUpType = null;
72063 }).call(tooltipBehavior);
72064 buttons.each(function(d2) {
72065 select_default2(this).call(svgIcon("#" + d2.icon));
72067 context.keybinding().on(commands[0].cmd, function(d3_event) {
72068 d3_event.preventDefault();
72070 commands[0].action();
72071 }).on(commands[1].cmd, function(d3_event) {
72072 d3_event.preventDefault();
72074 commands[1].action();
72076 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
72077 context.map().on("move.undo_redo", debouncedUpdate).on("drawn.undo_redo", debouncedUpdate);
72078 context.history().on("change.undo_redo", function(difference) {
72082 context.on("enter.undo_redo", update);
72083 function update() {
72084 buttons.classed("disabled", function(d2) {
72085 return !editable() || !d2.annotation();
72086 }).each(function() {
72087 var selection3 = select_default2(this);
72088 if (!selection3.select(".tooltip.in").empty()) {
72089 selection3.call(tooltipBehavior.updateContent);
72094 tool.uninstall = function() {
72095 context.keybinding().off(commands[0].cmd).off(commands[1].cmd);
72096 context.map().on("move.undo_redo", null).on("drawn.undo_redo", null);
72097 context.history().on("change.undo_redo", null);
72098 context.on("enter.undo_redo", null);
72103 // modules/ui/top_toolbar.js
72104 function uiTopToolbar(context) {
72105 var sidebarToggle = uiToolSidebarToggle(context), modes = uiToolDrawModes(context), notes = uiToolNotes(context), undoRedo = uiToolUndoRedo(context), save = uiToolSave(context);
72106 function notesEnabled() {
72107 var noteLayer = context.layers().layer("notes");
72108 return noteLayer && noteLayer.enabled();
72110 function topToolbar(bar) {
72111 bar.on("wheel.topToolbar", function(d3_event) {
72112 if (!d3_event.deltaX) {
72113 bar.node().scrollLeft += d3_event.deltaY;
72116 var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
72117 context.layers().on("change.topToolbar", debouncedUpdate);
72119 function update() {
72125 tools.push("spacer");
72126 if (notesEnabled()) {
72127 tools = tools.concat([notes, "spacer"]);
72129 tools = tools.concat([undoRedo, save]);
72130 var toolbarItems = bar.selectAll(".toolbar-item").data(tools, function(d2) {
72131 return d2.id || d2;
72133 toolbarItems.exit().each(function(d2) {
72134 if (d2.uninstall) {
72138 var itemsEnter = toolbarItems.enter().append("div").attr("class", function(d2) {
72139 var classes = "toolbar-item " + (d2.id || d2).replace("_", "-");
72141 classes += " " + d2.klass;
72144 var actionableItems = itemsEnter.filter(function(d2) {
72145 return d2 !== "spacer";
72147 actionableItems.append("div").attr("class", "item-content").each(function(d2) {
72148 select_default2(this).call(d2.render, bar);
72150 actionableItems.append("div").attr("class", "item-label").each(function(d2) {
72151 d2.label(select_default2(this));
72158 // modules/ui/zoom_to_selection.js
72159 function uiZoomToSelection(context) {
72160 function isDisabled() {
72161 var mode = context.mode();
72162 return !mode || !mode.zoomToSelected;
72164 var _lastPointerUpType;
72165 function pointerup(d3_event) {
72166 _lastPointerUpType = d3_event.pointerType;
72168 function click(d3_event) {
72169 d3_event.preventDefault();
72170 if (isDisabled()) {
72171 if (_lastPointerUpType === "touch" || _lastPointerUpType === "pen") {
72172 context.ui().flash.duration(2e3).iconName("#iD-icon-framed-dot").iconClass("disabled").label(_t.append("inspector.zoom_to.no_selection"))();
72175 var mode = context.mode();
72176 if (mode && mode.zoomToSelected) {
72177 mode.zoomToSelected();
72180 _lastPointerUpType = null;
72182 return function(selection2) {
72183 var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function() {
72184 if (isDisabled()) {
72185 return _t.append("inspector.zoom_to.no_selection");
72187 return _t.append("inspector.zoom_to.title");
72188 }).keys([_t("inspector.zoom_to.key")]);
72189 var button = selection2.append("button").on("pointerup", pointerup).on("click", click).call(svgIcon("#iD-icon-framed-dot", "light")).call(tooltipBehavior);
72190 function setEnabledState() {
72191 button.classed("disabled", isDisabled());
72192 if (!button.select(".tooltip.in").empty()) {
72193 button.call(tooltipBehavior.updateContent);
72196 context.on("enter.uiZoomToSelection", setEnabledState);
72201 // modules/ui/pane.js
72202 function uiPane(id2, context) {
72205 var _description = "";
72206 var _iconName = "";
72208 var _paneSelection = select_default2(null);
72213 pane.label = function(val) {
72214 if (!arguments.length)
72219 pane.key = function(val) {
72220 if (!arguments.length)
72225 pane.description = function(val) {
72226 if (!arguments.length)
72227 return _description;
72228 _description = val;
72231 pane.iconName = function(val) {
72232 if (!arguments.length)
72237 pane.sections = function(val) {
72238 if (!arguments.length)
72243 pane.selection = function() {
72244 return _paneSelection;
72246 function hidePane() {
72247 context.ui().togglePanes();
72249 pane.togglePane = function(d3_event) {
72251 d3_event.preventDefault();
72252 _paneTooltip.hide();
72253 context.ui().togglePanes(!_paneSelection.classed("shown") ? _paneSelection : void 0);
72255 pane.renderToggleButton = function(selection2) {
72256 if (!_paneTooltip) {
72257 _paneTooltip = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _description).keys([_key]);
72259 selection2.append("button").on("click", pane.togglePane).call(svgIcon("#" + _iconName, "light")).call(_paneTooltip);
72261 pane.renderContent = function(selection2) {
72263 _sections.forEach(function(section) {
72264 selection2.call(section.render);
72268 pane.renderPane = function(selection2) {
72269 _paneSelection = selection2.append("div").attr("class", "fillL map-pane hide " + id2 + "-pane").attr("pane", id2);
72270 var heading = _paneSelection.append("div").attr("class", "pane-heading");
72271 heading.append("h2").text("").call(_label);
72272 heading.append("button").attr("title", _t("icons.close")).on("click", hidePane).call(svgIcon("#iD-icon-close"));
72273 _paneSelection.append("div").attr("class", "pane-content").call(pane.renderContent);
72275 context.keybinding().on(_key, pane.togglePane);
72281 // modules/ui/sections/background_display_options.js
72282 function uiSectionBackgroundDisplayOptions(context) {
72283 var section = uiSection("background-display-options", context).label(() => _t.append("background.display_options")).disclosureContent(renderDisclosureContent);
72284 var _storedOpacity = corePreferences("background-opacity");
72287 var _sliders = ["brightness", "contrast", "saturation", "sharpness"];
72289 brightness: _storedOpacity !== null ? +_storedOpacity : 1,
72294 function clamp3(x2, min3, max3) {
72295 return Math.max(min3, Math.min(x2, max3));
72297 function updateValue(d2, val) {
72298 val = clamp3(val, _minVal, _maxVal);
72299 _options[d2] = val;
72300 context.background()[d2](val);
72301 if (d2 === "brightness") {
72302 corePreferences("background-opacity", val);
72304 section.reRender();
72306 function renderDisclosureContent(selection2) {
72307 var container = selection2.selectAll(".display-options-container").data([0]);
72308 var containerEnter = container.enter().append("div").attr("class", "display-options-container controls-list");
72309 var slidersEnter = containerEnter.selectAll(".display-control").data(_sliders).enter().append("label").attr("class", function(d2) {
72310 return "display-control display-control-" + d2;
72312 slidersEnter.html(function(d2) {
72313 return _t.html("background." + d2);
72314 }).append("span").attr("class", function(d2) {
72315 return "display-option-value display-option-value-" + d2;
72317 var sildersControlEnter = slidersEnter.append("div").attr("class", "control-wrap");
72318 sildersControlEnter.append("input").attr("class", function(d2) {
72319 return "display-option-input display-option-input-" + d2;
72320 }).attr("type", "range").attr("min", _minVal).attr("max", _maxVal).attr("step", "0.05").on("input", function(d3_event, d2) {
72321 var val = select_default2(this).property("value");
72322 if (!val && d3_event && d3_event.target) {
72323 val = d3_event.target.value;
72325 updateValue(d2, val);
72327 sildersControlEnter.append("button").attr("title", function(d2) {
72328 return `${_t("background.reset")} ${_t("background." + d2)}`;
72329 }).attr("class", function(d2) {
72330 return "display-option-reset display-option-reset-" + d2;
72331 }).on("click", function(d3_event, d2) {
72332 if (d3_event.button !== 0)
72334 updateValue(d2, 1);
72335 }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
72336 containerEnter.append("a").attr("class", "display-option-resetlink").attr("role", "button").attr("href", "#").call(_t.append("background.reset_all")).on("click", function(d3_event) {
72337 d3_event.preventDefault();
72338 for (var i3 = 0; i3 < _sliders.length; i3++) {
72339 updateValue(_sliders[i3], 1);
72342 container = containerEnter.merge(container);
72343 container.selectAll(".display-option-input").property("value", function(d2) {
72344 return _options[d2];
72346 container.selectAll(".display-option-value").text(function(d2) {
72347 return Math.floor(_options[d2] * 100) + "%";
72349 container.selectAll(".display-option-reset").classed("disabled", function(d2) {
72350 return _options[d2] === 1;
72352 if (containerEnter.size() && _options.brightness !== 1) {
72353 context.background().brightness(_options.brightness);
72359 // modules/ui/settings/custom_background.js
72360 function uiSettingsCustomBackground() {
72361 var dispatch14 = dispatch_default("change");
72362 function render(selection2) {
72363 var _origSettings = {
72364 template: corePreferences("background-custom-template")
72366 var _currSettings = {
72367 template: corePreferences("background-custom-template")
72369 var example = "https://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png";
72370 var modal = uiConfirm(selection2).okButton();
72371 modal.classed("settings-modal settings-custom-background", true);
72372 modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_background.header"));
72373 var textSection = modal.select(".modal-section.message-text");
72374 var instructions = `${_t.html("settings.custom_background.instructions.info")}
72376 #### ${_t.html("settings.custom_background.instructions.wms.tokens_label")}
72377 * ${_t.html("settings.custom_background.instructions.wms.tokens.proj")}
72378 * ${_t.html("settings.custom_background.instructions.wms.tokens.wkid")}
72379 * ${_t.html("settings.custom_background.instructions.wms.tokens.dimensions")}
72380 * ${_t.html("settings.custom_background.instructions.wms.tokens.bbox")}
72382 #### ${_t.html("settings.custom_background.instructions.tms.tokens_label")}
72383 * ${_t.html("settings.custom_background.instructions.tms.tokens.xyz")}
72384 * ${_t.html("settings.custom_background.instructions.tms.tokens.flipped_y")}
72385 * ${_t.html("settings.custom_background.instructions.tms.tokens.switch")}
72386 * ${_t.html("settings.custom_background.instructions.tms.tokens.quadtile")}
72387 * ${_t.html("settings.custom_background.instructions.tms.tokens.scale_factor")}
72389 #### ${_t.html("settings.custom_background.instructions.example")}
72391 textSection.append("div").attr("class", "instructions-template").html(marked(instructions));
72392 textSection.append("textarea").attr("class", "field-template").attr("placeholder", _t("settings.custom_background.template.placeholder")).call(utilNoAuto).property("value", _currSettings.template);
72393 var buttonSection = modal.select(".modal-section.buttons");
72394 buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
72395 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
72396 buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
72397 function isSaveDisabled() {
72400 function clickCancel() {
72401 textSection.select(".field-template").property("value", _origSettings.template);
72402 corePreferences("background-custom-template", _origSettings.template);
72406 function clickSave() {
72407 _currSettings.template = textSection.select(".field-template").property("value");
72408 corePreferences("background-custom-template", _currSettings.template);
72411 dispatch14.call("change", this, _currSettings);
72414 return utilRebind(render, dispatch14, "on");
72417 // modules/ui/sections/background_list.js
72418 function uiSectionBackgroundList(context) {
72419 var _backgroundList = select_default2(null);
72420 var _customSource = context.background().findSource("custom");
72421 var _settingsCustomBackground = uiSettingsCustomBackground(context).on("change", customChanged);
72422 var section = uiSection("background-list", context).label(() => _t.append("background.backgrounds")).disclosureContent(renderDisclosureContent);
72423 function previousBackgroundID() {
72424 return corePreferences("background-last-used-toggle");
72426 function renderDisclosureContent(selection2) {
72427 var container = selection2.selectAll(".layer-background-list").data([0]);
72428 _backgroundList = container.enter().append("ul").attr("class", "layer-list layer-background-list").attr("dir", "auto").merge(container);
72429 var bgExtrasListEnter = selection2.selectAll(".bg-extras-list").data([0]).enter().append("ul").attr("class", "layer-list bg-extras-list");
72430 var minimapLabelEnter = bgExtrasListEnter.append("li").attr("class", "minimap-toggle-item").append("label").call(
72431 uiTooltip().title(() => _t.append("background.minimap.tooltip")).keys([_t("background.minimap.key")]).placement("top")
72433 minimapLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72434 d3_event.preventDefault();
72435 uiMapInMap.toggle();
72437 minimapLabelEnter.append("span").call(_t.append("background.minimap.description"));
72438 var panelLabelEnter = bgExtrasListEnter.append("li").attr("class", "background-panel-toggle-item").append("label").call(
72439 uiTooltip().title(() => _t.append("background.panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.background.key"))]).placement("top")
72441 panelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72442 d3_event.preventDefault();
72443 context.ui().info.toggle("background");
72445 panelLabelEnter.append("span").call(_t.append("background.panel.description"));
72446 var locPanelLabelEnter = bgExtrasListEnter.append("li").attr("class", "location-panel-toggle-item").append("label").call(
72447 uiTooltip().title(() => _t.append("background.location_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.location.key"))]).placement("top")
72449 locPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72450 d3_event.preventDefault();
72451 context.ui().info.toggle("location");
72453 locPanelLabelEnter.append("span").call(_t.append("background.location_panel.description"));
72454 selection2.selectAll(".imagery-faq").data([0]).enter().append("div").attr("class", "imagery-faq").append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/openstreetmap/iD/blob/develop/FAQ.md#how-can-i-report-an-issue-with-background-imagery").append("span").call(_t.append("background.imagery_problem_faq"));
72455 _backgroundList.call(drawListItems, "radio", function(d3_event, d2) {
72456 chooseBackground(d2);
72458 return !d2.isHidden() && !d2.overlay;
72461 function setTooltips(selection2) {
72462 selection2.each(function(d2, i3, nodes) {
72463 var item = select_default2(this).select("label");
72464 var span = item.select("span");
72465 var placement = i3 < nodes.length / 2 ? "bottom" : "top";
72466 var hasDescription = d2.hasDescription();
72467 var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
72468 item.call(uiTooltip().destroyAny);
72469 if (d2.id === previousBackgroundID()) {
72471 uiTooltip().placement(placement).title(() => _t.append("background.switch")).keys([uiCmd("\u2318" + _t("background.key"))])
72473 } else if (hasDescription || isOverflowing) {
72475 uiTooltip().placement(placement).title(() => hasDescription ? d2.description() : d2.label())
72480 function drawListItems(layerList, type2, change, filter2) {
72481 var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2).sort(function(a2, b2) {
72482 return a2.best() && !b2.best() ? -1 : b2.best() && !a2.best() ? 1 : descending(a2.area(), b2.area()) || ascending(a2.name(), b2.name()) || 0;
72484 var layerLinks = layerList.selectAll("li").data(sources, function(d2, i3) {
72485 return d2.id + "---" + i3;
72487 layerLinks.exit().remove();
72488 var enter = layerLinks.enter().append("li").classed("layer-custom", function(d2) {
72489 return d2.id === "custom";
72490 }).classed("best", function(d2) {
72493 var label = enter.append("label");
72494 label.append("input").attr("type", type2).attr("name", "background-layer").attr("value", function(d2) {
72496 }).on("change", change);
72497 label.append("span").each(function(d2) {
72498 d2.label()(select_default2(this));
72500 enter.filter(function(d2) {
72501 return d2.id === "custom";
72502 }).append("button").attr("class", "layer-browse").call(
72503 uiTooltip().title(() => _t.append("settings.custom_background.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
72504 ).on("click", function(d3_event) {
72505 d3_event.preventDefault();
72507 }).call(svgIcon("#iD-icon-more"));
72508 enter.filter(function(d2) {
72510 }).append("div").attr("class", "best").call(
72511 uiTooltip().title(() => _t.append("background.best_imagery")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
72512 ).append("span").text("\u2605");
72513 layerList.call(updateLayerSelections);
72515 function updateLayerSelections(selection2) {
72516 function active(d2) {
72517 return context.background().showsLayer(d2);
72519 selection2.selectAll("li").classed("active", active).classed("switch", function(d2) {
72520 return d2.id === previousBackgroundID();
72521 }).call(setTooltips).selectAll("input").property("checked", active);
72523 function chooseBackground(d2) {
72524 if (d2.id === "custom" && !d2.template()) {
72525 return editCustom();
72527 var previousBackground = context.background().baseLayerSource();
72528 corePreferences("background-last-used-toggle", previousBackground.id);
72529 corePreferences("background-last-used", d2.id);
72530 context.background().baseLayerSource(d2);
72532 function customChanged(d2) {
72533 if (d2 && d2.template) {
72534 _customSource.template(d2.template);
72535 chooseBackground(_customSource);
72537 _customSource.template("");
72538 chooseBackground(context.background().findSource("none"));
72541 function editCustom() {
72542 context.container().call(_settingsCustomBackground);
72544 context.background().on("change.background_list", function() {
72545 _backgroundList.call(updateLayerSelections);
72548 "move.background_list",
72549 debounce_default(function() {
72550 window.requestIdleCallback(section.reRender);
72556 // modules/ui/sections/background_offset.js
72557 function uiSectionBackgroundOffset(context) {
72558 var section = uiSection("background-offset", context).label(() => _t.append("background.fix_misalignment")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
72559 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
72560 var _directions = [
72561 ["top", [0, -0.5]],
72562 ["left", [-0.5, 0]],
72563 ["right", [0.5, 0]],
72564 ["bottom", [0, 0.5]]
72566 function updateValue() {
72567 var meters = geoOffsetToMeters(context.background().offset());
72568 var x2 = +meters[0].toFixed(2);
72569 var y2 = +meters[1].toFixed(2);
72570 context.container().selectAll(".nudge-inner-rect").select("input").classed("error", false).property("value", x2 + ", " + y2);
72571 context.container().selectAll(".nudge-reset").classed("disabled", function() {
72572 return x2 === 0 && y2 === 0;
72575 function resetOffset() {
72576 context.background().offset([0, 0]);
72579 function nudge(d2) {
72580 context.background().nudge(d2, context.map().zoom());
72583 function inputOffset() {
72584 var input = select_default2(this);
72585 var d2 = input.node().value;
72587 return resetOffset();
72588 d2 = d2.replace(/;/g, ",").split(",").map(function(n3) {
72589 return !isNaN(n3) && n3;
72591 if (d2.length !== 2 || !d2[0] || !d2[1]) {
72592 input.classed("error", true);
72595 context.background().offset(geoMetersToOffset(d2));
72598 function dragOffset(d3_event) {
72599 if (d3_event.button !== 0)
72601 var origin = [d3_event.clientX, d3_event.clientY];
72602 var pointerId = d3_event.pointerId || "mouse";
72603 context.container().append("div").attr("class", "nudge-surface");
72604 select_default2(window).on(_pointerPrefix + "move.drag-bg-offset", pointermove).on(_pointerPrefix + "up.drag-bg-offset", pointerup);
72605 if (_pointerPrefix === "pointer") {
72606 select_default2(window).on("pointercancel.drag-bg-offset", pointerup);
72608 function pointermove(d3_event2) {
72609 if (pointerId !== (d3_event2.pointerId || "mouse"))
72611 var latest = [d3_event2.clientX, d3_event2.clientY];
72613 -(origin[0] - latest[0]) / 4,
72614 -(origin[1] - latest[1]) / 4
72619 function pointerup(d3_event2) {
72620 if (pointerId !== (d3_event2.pointerId || "mouse"))
72622 if (d3_event2.button !== 0)
72624 context.container().selectAll(".nudge-surface").remove();
72625 select_default2(window).on(".drag-bg-offset", null);
72628 function renderDisclosureContent(selection2) {
72629 var container = selection2.selectAll(".nudge-container").data([0]);
72630 var containerEnter = container.enter().append("div").attr("class", "nudge-container");
72631 containerEnter.append("div").attr("class", "nudge-instructions").call(_t.append("background.offset"));
72632 var nudgeWrapEnter = containerEnter.append("div").attr("class", "nudge-controls-wrap");
72633 var nudgeEnter = nudgeWrapEnter.append("div").attr("class", "nudge-outer-rect").on(_pointerPrefix + "down", dragOffset);
72634 nudgeEnter.append("div").attr("class", "nudge-inner-rect").append("input").attr("type", "text").attr("aria-label", _t("background.offset_label")).on("change", inputOffset);
72635 nudgeWrapEnter.append("div").selectAll("button").data(_directions).enter().append("button").attr("title", function(d2) {
72636 return _t(`background.nudge.${d2[0]}`);
72637 }).attr("class", function(d2) {
72638 return d2[0] + " nudge";
72639 }).on("click", function(d3_event, d2) {
72642 nudgeWrapEnter.append("button").attr("title", _t("background.reset")).attr("class", "nudge-reset disabled").on("click", function(d3_event) {
72643 d3_event.preventDefault();
72645 }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
72648 context.background().on("change.backgroundOffset-update", updateValue);
72652 // modules/ui/sections/overlay_list.js
72653 function uiSectionOverlayList(context) {
72654 var section = uiSection("overlay-list", context).label(() => _t.append("background.overlays")).disclosureContent(renderDisclosureContent);
72655 var _overlayList = select_default2(null);
72656 function setTooltips(selection2) {
72657 selection2.each(function(d2, i3, nodes) {
72658 var item = select_default2(this).select("label");
72659 var span = item.select("span");
72660 var placement = i3 < nodes.length / 2 ? "bottom" : "top";
72661 var description = d2.description();
72662 var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
72663 item.call(uiTooltip().destroyAny);
72664 if (description || isOverflowing) {
72666 uiTooltip().placement(placement).title(() => description || d2.name())
72671 function updateLayerSelections(selection2) {
72672 function active(d2) {
72673 return context.background().showsLayer(d2);
72675 selection2.selectAll("li").classed("active", active).call(setTooltips).selectAll("input").property("checked", active);
72677 function chooseOverlay(d3_event, d2) {
72678 d3_event.preventDefault();
72679 context.background().toggleOverlayLayer(d2);
72680 _overlayList.call(updateLayerSelections);
72681 document.activeElement.blur();
72683 function drawListItems(layerList, type2, change, filter2) {
72684 var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2);
72685 var layerLinks = layerList.selectAll("li").data(sources, function(d2) {
72688 layerLinks.exit().remove();
72689 var enter = layerLinks.enter().append("li");
72690 var label = enter.append("label");
72691 label.append("input").attr("type", type2).attr("name", "layers").on("change", change);
72692 label.append("span").each(function(d2) {
72693 d2.label()(select_default2(this));
72695 layerList.selectAll("li").sort(sortSources);
72696 layerList.call(updateLayerSelections);
72697 function sortSources(a2, b2) {
72698 return a2.best() && !b2.best() ? -1 : b2.best() && !a2.best() ? 1 : descending(a2.area(), b2.area()) || ascending(a2.name(), b2.name()) || 0;
72701 function renderDisclosureContent(selection2) {
72702 var container = selection2.selectAll(".layer-overlay-list").data([0]);
72703 _overlayList = container.enter().append("ul").attr("class", "layer-list layer-overlay-list").attr("dir", "auto").merge(container);
72704 _overlayList.call(drawListItems, "checkbox", chooseOverlay, function(d2) {
72705 return !d2.isHidden() && d2.overlay;
72709 "move.overlay_list",
72710 debounce_default(function() {
72711 window.requestIdleCallback(section.reRender);
72717 // modules/ui/panes/background.js
72718 function uiPaneBackground(context) {
72719 var backgroundPane = uiPane("background", context).key(_t("background.key")).label(_t.append("background.title")).description(_t.append("background.description")).iconName("iD-icon-layers").sections([
72720 uiSectionBackgroundList(context),
72721 uiSectionOverlayList(context),
72722 uiSectionBackgroundDisplayOptions(context),
72723 uiSectionBackgroundOffset(context)
72725 return backgroundPane;
72728 // modules/ui/panes/help.js
72729 function uiPaneHelp(context) {
72739 "open_source_attribution",
72752 "select_left_click",
72753 "select_right_click",
72757 "multiselect_shift_click",
72758 "multiselect_lasso",
72771 ["feature_editor", [
72778 "fields_all_fields",
72780 "fields_add_field",
72789 "add_point_finish",
72794 "delete_point_command"
72801 "add_line_continue",
72804 "modify_line_dragnode",
72805 "modify_line_addnode",
72808 "connect_line_display",
72809 "connect_line_drag",
72810 "connect_line_tag",
72811 "disconnect_line_h",
72812 "disconnect_line_command",
72814 "move_line_command",
72815 "move_line_connected",
72818 "delete_line_command"
72825 "add_area_command",
72827 "add_area_continue",
72830 "square_area_command",
72832 "modify_area_dragnode",
72833 "modify_area_addnode",
72836 "delete_area_command"
72842 "edit_relation_add",
72843 "edit_relation_delete",
72844 "maintain_relation_h",
72845 "maintain_relation",
72846 "relation_types_h",
72849 "multipolygon_create",
72850 "multipolygon_merge",
72851 "turn_restriction_h",
72852 "turn_restriction",
72853 "turn_restriction_field",
72854 "turn_restriction_editing",
72925 "help.help.open_data_h": 3,
72926 "help.help.before_start_h": 3,
72927 "help.help.open_source_h": 3,
72928 "help.overview.navigation_h": 3,
72929 "help.overview.features_h": 3,
72930 "help.editing.select_h": 3,
72931 "help.editing.multiselect_h": 3,
72932 "help.editing.undo_redo_h": 3,
72933 "help.editing.save_h": 3,
72934 "help.editing.upload_h": 3,
72935 "help.editing.backups_h": 3,
72936 "help.editing.keyboard_h": 3,
72937 "help.feature_editor.type_h": 3,
72938 "help.feature_editor.fields_h": 3,
72939 "help.feature_editor.tags_h": 3,
72940 "help.points.add_point_h": 3,
72941 "help.points.move_point_h": 3,
72942 "help.points.delete_point_h": 3,
72943 "help.lines.add_line_h": 3,
72944 "help.lines.modify_line_h": 3,
72945 "help.lines.connect_line_h": 3,
72946 "help.lines.disconnect_line_h": 3,
72947 "help.lines.move_line_h": 3,
72948 "help.lines.delete_line_h": 3,
72949 "help.areas.point_or_area_h": 3,
72950 "help.areas.add_area_h": 3,
72951 "help.areas.square_area_h": 3,
72952 "help.areas.modify_area_h": 3,
72953 "help.areas.delete_area_h": 3,
72954 "help.relations.edit_relation_h": 3,
72955 "help.relations.maintain_relation_h": 3,
72956 "help.relations.relation_types_h": 2,
72957 "help.relations.multipolygon_h": 3,
72958 "help.relations.turn_restriction_h": 3,
72959 "help.relations.route_h": 3,
72960 "help.relations.boundary_h": 3,
72961 "help.notes.add_note_h": 3,
72962 "help.notes.update_note_h": 3,
72963 "help.notes.save_note_h": 3,
72964 "help.imagery.sources_h": 3,
72965 "help.imagery.offsets_h": 3,
72966 "help.streetlevel.using_h": 3,
72967 "help.gps.using_h": 3,
72968 "help.qa.tools_h": 3,
72969 "help.qa.issues_h": 3
72971 var docs = docKeys.map(function(key) {
72972 var helpkey = "help." + key[0];
72973 var helpPaneReplacements = { version: context.version };
72974 var text2 = key[1].reduce(function(all, part) {
72975 var subkey = helpkey + "." + part;
72976 var depth = headings[subkey];
72977 var hhh = depth ? Array(depth + 1).join("#") + " " : "";
72978 return all + hhh + helpHtml(subkey, helpPaneReplacements) + "\n\n";
72981 title: _t.html(helpkey + ".title"),
72982 content: marked(text2.trim()).replace(/<code>/g, "<kbd>").replace(/<\/code>/g, "</kbd>")
72985 var helpPane = uiPane("help", context).key(_t("help.key")).label(_t.append("help.title")).description(_t.append("help.title")).iconName("iD-icon-help");
72986 helpPane.renderContent = function(content) {
72987 function clickHelp(d2, i3) {
72988 var rtl = _mainLocalizer.textDirection() === "rtl";
72989 content.property("scrollTop", 0);
72990 helpPane.selection().select(".pane-heading h2").html(d2.title);
72991 body.html(d2.content);
72992 body.selectAll("a").attr("target", "_blank");
72993 menuItems.classed("selected", function(m2) {
72994 return m2.title === d2.title;
72998 nav.call(drawNext).call(drawPrevious);
73000 nav.call(drawPrevious).call(drawNext);
73002 function drawNext(selection2) {
73003 if (i3 < docs.length - 1) {
73004 var nextLink = selection2.append("a").attr("href", "#").attr("class", "next").on("click", function(d3_event) {
73005 d3_event.preventDefault();
73006 clickHelp(docs[i3 + 1], i3 + 1);
73008 nextLink.append("span").html(docs[i3 + 1].title).call(svgIcon(rtl ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
73011 function drawPrevious(selection2) {
73013 var prevLink = selection2.append("a").attr("href", "#").attr("class", "previous").on("click", function(d3_event) {
73014 d3_event.preventDefault();
73015 clickHelp(docs[i3 - 1], i3 - 1);
73017 prevLink.call(svgIcon(rtl ? "#iD-icon-forward" : "#iD-icon-backward", "inline")).append("span").html(docs[i3 - 1].title);
73021 function clickWalkthrough(d3_event) {
73022 d3_event.preventDefault();
73023 if (context.inIntro())
73025 context.container().call(uiIntro(context));
73026 context.ui().togglePanes();
73028 function clickShortcuts(d3_event) {
73029 d3_event.preventDefault();
73030 context.container().call(context.ui().shortcuts, true);
73032 var toc = content.append("ul").attr("class", "toc");
73033 var menuItems = toc.selectAll("li").data(docs).enter().append("li").append("a").attr("role", "button").attr("href", "#").html(function(d2) {
73035 }).on("click", function(d3_event, d2) {
73036 d3_event.preventDefault();
73037 clickHelp(d2, docs.indexOf(d2));
73039 var shortcuts = toc.append("li").attr("class", "shortcuts").call(
73040 uiTooltip().title(() => _t.append("shortcuts.tooltip")).keys(["?"]).placement("top")
73041 ).append("a").attr("href", "#").on("click", clickShortcuts);
73042 shortcuts.append("div").call(_t.append("shortcuts.title"));
73043 var walkthrough = toc.append("li").attr("class", "walkthrough").append("a").attr("href", "#").on("click", clickWalkthrough);
73044 walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
73045 walkthrough.append("div").call(_t.append("splash.walkthrough"));
73046 var helpContent = content.append("div").attr("class", "left-content");
73047 var body = helpContent.append("div").attr("class", "body");
73048 var nav = helpContent.append("div").attr("class", "nav");
73049 clickHelp(docs[0], 0);
73054 // modules/ui/sections/validation_issues.js
73055 function uiSectionValidationIssues(id2, severity, context) {
73057 var section = uiSection(id2, context).label(function() {
73060 var issueCountText = _issues.length > 1e3 ? "1000+" : String(_issues.length);
73061 return _t.append("inspector.title_count", { title: _t("issues." + severity + "s.list_title"), count: issueCountText });
73062 }).disclosureContent(renderDisclosureContent).shouldDisplay(function() {
73063 return _issues && _issues.length;
73065 function getOptions() {
73067 what: corePreferences("validate-what") || "edited",
73068 where: corePreferences("validate-where") || "all"
73071 function reloadIssues() {
73072 _issues = context.validator().getIssuesBySeverity(getOptions())[severity];
73074 function renderDisclosureContent(selection2) {
73075 var center = context.map().center();
73076 var graph = context.graph();
73077 var issues = _issues.map(function withDistance(issue) {
73078 var extent = issue.extent(graph);
73079 var dist = extent ? geoSphericalDistance(center, extent.center()) : 0;
73080 return Object.assign(issue, { dist });
73081 }).sort(function byDistance(a2, b2) {
73082 return a2.dist - b2.dist;
73084 issues = issues.slice(0, 1e3);
73085 selection2.call(drawIssuesList, issues);
73087 function drawIssuesList(selection2, issues) {
73088 var list = selection2.selectAll(".issues-list").data([0]);
73089 list = list.enter().append("ul").attr("class", "layer-list issues-list " + severity + "s-list").merge(list);
73090 var items = list.selectAll("li").data(issues, function(d2) {
73093 items.exit().remove();
73094 var itemsEnter = items.enter().append("li").attr("class", function(d2) {
73095 return "issue severity-" + d2.severity;
73097 var labelsEnter = itemsEnter.append("button").attr("class", "issue-label").on("click", function(d3_event, d2) {
73098 context.validator().focusIssue(d2);
73099 }).on("mouseover", function(d3_event, d2) {
73100 utilHighlightEntities(d2.entityIds, true, context);
73101 }).on("mouseout", function(d3_event, d2) {
73102 utilHighlightEntities(d2.entityIds, false, context);
73104 var textEnter = labelsEnter.append("span").attr("class", "issue-text");
73105 textEnter.append("span").attr("class", "issue-icon").each(function(d2) {
73106 var iconName = "#iD-icon-" + (d2.severity === "warning" ? "alert" : "error");
73107 select_default2(this).call(svgIcon(iconName));
73109 textEnter.append("span").attr("class", "issue-message");
73110 items = items.merge(itemsEnter).order();
73111 items.selectAll(".issue-message").text("").each(function(d2) {
73112 return d2.message(context)(select_default2(this));
73115 context.validator().on("validated.uiSectionValidationIssues" + id2, function() {
73116 window.requestIdleCallback(function() {
73118 section.reRender();
73122 "move.uiSectionValidationIssues" + id2,
73123 debounce_default(function() {
73124 window.requestIdleCallback(function() {
73125 if (getOptions().where === "visible") {
73128 section.reRender();
73135 // modules/ui/sections/validation_options.js
73136 function uiSectionValidationOptions(context) {
73137 var section = uiSection("issues-options", context).content(renderContent);
73138 function renderContent(selection2) {
73139 var container = selection2.selectAll(".issues-options-container").data([0]);
73140 container = container.enter().append("div").attr("class", "issues-options-container").merge(container);
73142 { key: "what", values: ["edited", "all"] },
73143 { key: "where", values: ["visible", "all"] }
73145 var options2 = container.selectAll(".issues-option").data(data, function(d2) {
73148 var optionsEnter = options2.enter().append("div").attr("class", function(d2) {
73149 return "issues-option issues-option-" + d2.key;
73151 optionsEnter.append("div").attr("class", "issues-option-title").html(function(d2) {
73152 return _t.html("issues.options." + d2.key + ".title");
73154 var valuesEnter = optionsEnter.selectAll("label").data(function(d2) {
73155 return d2.values.map(function(val) {
73156 return { value: val, key: d2.key };
73158 }).enter().append("label");
73159 valuesEnter.append("input").attr("type", "radio").attr("name", function(d2) {
73160 return "issues-option-" + d2.key;
73161 }).attr("value", function(d2) {
73163 }).property("checked", function(d2) {
73164 return getOptions()[d2.key] === d2.value;
73165 }).on("change", function(d3_event, d2) {
73166 updateOptionValue(d3_event, d2.key, d2.value);
73168 valuesEnter.append("span").html(function(d2) {
73169 return _t.html("issues.options." + d2.key + "." + d2.value);
73172 function getOptions() {
73174 what: corePreferences("validate-what") || "edited",
73176 where: corePreferences("validate-where") || "all"
73177 // 'all', 'visible'
73180 function updateOptionValue(d3_event, d2, val) {
73181 if (!val && d3_event && d3_event.target) {
73182 val = d3_event.target.value;
73184 corePreferences("validate-" + d2, val);
73185 context.validator().validate();
73190 // modules/ui/sections/validation_rules.js
73191 function uiSectionValidationRules(context) {
73193 var MAXSQUARE = 20;
73194 var DEFAULTSQUARE = 5;
73195 var section = uiSection("issues-rules", context).disclosureContent(renderDisclosureContent).label(() => _t.append("issues.rules.title"));
73196 var _ruleKeys = context.validator().getRuleKeys().filter(function(key) {
73197 return key !== "maprules";
73198 }).sort(function(key1, key2) {
73199 return _t("issues." + key1 + ".title") < _t("issues." + key2 + ".title") ? -1 : 1;
73201 function renderDisclosureContent(selection2) {
73202 var container = selection2.selectAll(".issues-rulelist-container").data([0]);
73203 var containerEnter = container.enter().append("div").attr("class", "issues-rulelist-container");
73204 containerEnter.append("ul").attr("class", "layer-list issue-rules-list");
73205 var ruleLinks = containerEnter.append("div").attr("class", "issue-rules-links section-footer");
73206 ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
73207 d3_event.preventDefault();
73208 context.validator().disableRules(_ruleKeys);
73210 ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
73211 d3_event.preventDefault();
73212 context.validator().disableRules([]);
73214 container = container.merge(containerEnter);
73215 container.selectAll(".issue-rules-list").call(drawListItems, _ruleKeys, "checkbox", "rule", toggleRule, isRuleEnabled);
73217 function drawListItems(selection2, data, type2, name, change, active) {
73218 var items = selection2.selectAll("li").data(data);
73219 items.exit().remove();
73220 var enter = items.enter().append("li");
73221 if (name === "rule") {
73223 uiTooltip().title(function(d2) {
73224 return _t.append("issues." + d2 + ".tip");
73225 }).placement("top")
73228 var label = enter.append("label");
73229 label.append("input").attr("type", type2).attr("name", name).on("change", change);
73230 label.append("span").html(function(d2) {
73232 if (d2 === "unsquare_way") {
73233 params.val = { html: '<span class="square-degrees"></span>' };
73235 return _t.html("issues." + d2 + ".title", params);
73237 items = items.merge(enter);
73238 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
73239 var degStr = corePreferences("validate-square-degrees");
73240 if (degStr === null) {
73241 degStr = DEFAULTSQUARE.toString();
73243 var span = items.selectAll(".square-degrees");
73244 var input = span.selectAll(".square-degrees-input").data([0]);
73245 input.enter().append("input").attr("type", "number").attr("min", MINSQUARE.toString()).attr("max", MAXSQUARE.toString()).attr("step", "0.5").attr("class", "square-degrees-input").call(utilNoAuto).on("click", function(d3_event) {
73246 d3_event.preventDefault();
73247 d3_event.stopPropagation();
73249 }).on("keyup", function(d3_event) {
73250 if (d3_event.keyCode === 13) {
73254 }).on("blur", changeSquare).merge(input).property("value", degStr);
73256 function changeSquare() {
73257 var input = select_default2(this);
73258 var degStr = utilGetSetValue(input).trim();
73259 var degNum = Number(degStr);
73260 if (!isFinite(degNum)) {
73261 degNum = DEFAULTSQUARE;
73262 } else if (degNum > MAXSQUARE) {
73263 degNum = MAXSQUARE;
73264 } else if (degNum < MINSQUARE) {
73265 degNum = MINSQUARE;
73267 degNum = Math.round(degNum * 10) / 10;
73268 degStr = degNum.toString();
73269 input.property("value", degStr);
73270 corePreferences("validate-square-degrees", degStr);
73271 context.validator().revalidateUnsquare();
73273 function isRuleEnabled(d2) {
73274 return context.validator().isRuleEnabled(d2);
73276 function toggleRule(d3_event, d2) {
73277 context.validator().toggleRule(d2);
73279 context.validator().on("validated.uiSectionValidationRules", function() {
73280 window.requestIdleCallback(section.reRender);
73285 // modules/ui/sections/validation_status.js
73286 function uiSectionValidationStatus(context) {
73287 var section = uiSection("issues-status", context).content(renderContent).shouldDisplay(function() {
73288 var issues = context.validator().getIssues(getOptions());
73289 return issues.length === 0;
73291 function getOptions() {
73293 what: corePreferences("validate-what") || "edited",
73294 where: corePreferences("validate-where") || "all"
73297 function renderContent(selection2) {
73298 var box = selection2.selectAll(".box").data([0]);
73299 var boxEnter = box.enter().append("div").attr("class", "box");
73300 boxEnter.append("div").call(svgIcon("#iD-icon-apply", "pre-text"));
73301 var noIssuesMessage = boxEnter.append("span");
73302 noIssuesMessage.append("strong").attr("class", "message");
73303 noIssuesMessage.append("br");
73304 noIssuesMessage.append("span").attr("class", "details");
73305 renderIgnoredIssuesReset(selection2);
73306 setNoIssuesText(selection2);
73308 function renderIgnoredIssuesReset(selection2) {
73309 var ignoredIssues = context.validator().getIssues({ what: "all", where: "all", includeDisabledRules: true, includeIgnored: "only" });
73310 var resetIgnored = selection2.selectAll(".reset-ignored").data(ignoredIssues.length ? [0] : []);
73311 resetIgnored.exit().remove();
73312 var resetIgnoredEnter = resetIgnored.enter().append("div").attr("class", "reset-ignored section-footer");
73313 resetIgnoredEnter.append("a").attr("href", "#");
73314 resetIgnored = resetIgnored.merge(resetIgnoredEnter);
73315 resetIgnored.select("a").html(_t.html("inspector.title_count", { title: { html: _t.html("issues.reset_ignored") }, count: ignoredIssues.length }));
73316 resetIgnored.on("click", function(d3_event) {
73317 d3_event.preventDefault();
73318 context.validator().resetIgnoredIssues();
73321 function setNoIssuesText(selection2) {
73322 var opts = getOptions();
73323 function checkForHiddenIssues(cases) {
73324 for (var type2 in cases) {
73325 var hiddenOpts = cases[type2];
73326 var hiddenIssues = context.validator().getIssues(hiddenOpts);
73327 if (hiddenIssues.length) {
73328 selection2.select(".box .details").html("").call(_t.append(
73329 "issues.no_issues.hidden_issues." + type2,
73330 { count: hiddenIssues.length.toString() }
73335 selection2.select(".box .details").html("").call(_t.append("issues.no_issues.hidden_issues.none"));
73338 if (opts.what === "edited" && opts.where === "visible") {
73339 messageType = "edits_in_view";
73340 checkForHiddenIssues({
73341 elsewhere: { what: "edited", where: "all" },
73342 everything_else: { what: "all", where: "visible" },
73343 disabled_rules: { what: "edited", where: "visible", includeDisabledRules: "only" },
73344 everything_else_elsewhere: { what: "all", where: "all" },
73345 disabled_rules_elsewhere: { what: "edited", where: "all", includeDisabledRules: "only" },
73346 ignored_issues: { what: "edited", where: "visible", includeIgnored: "only" },
73347 ignored_issues_elsewhere: { what: "edited", where: "all", includeIgnored: "only" }
73349 } else if (opts.what === "edited" && opts.where === "all") {
73350 messageType = "edits";
73351 checkForHiddenIssues({
73352 everything_else: { what: "all", where: "all" },
73353 disabled_rules: { what: "edited", where: "all", includeDisabledRules: "only" },
73354 ignored_issues: { what: "edited", where: "all", includeIgnored: "only" }
73356 } else if (opts.what === "all" && opts.where === "visible") {
73357 messageType = "everything_in_view";
73358 checkForHiddenIssues({
73359 elsewhere: { what: "all", where: "all" },
73360 disabled_rules: { what: "all", where: "visible", includeDisabledRules: "only" },
73361 disabled_rules_elsewhere: { what: "all", where: "all", includeDisabledRules: "only" },
73362 ignored_issues: { what: "all", where: "visible", includeIgnored: "only" },
73363 ignored_issues_elsewhere: { what: "all", where: "all", includeIgnored: "only" }
73365 } else if (opts.what === "all" && opts.where === "all") {
73366 messageType = "everything";
73367 checkForHiddenIssues({
73368 disabled_rules: { what: "all", where: "all", includeDisabledRules: "only" },
73369 ignored_issues: { what: "all", where: "all", includeIgnored: "only" }
73372 if (opts.what === "edited" && context.history().difference().summary().length === 0) {
73373 messageType = "no_edits";
73375 selection2.select(".box .message").html("").call(_t.append("issues.no_issues.message." + messageType));
73377 context.validator().on("validated.uiSectionValidationStatus", function() {
73378 window.requestIdleCallback(section.reRender);
73381 "move.uiSectionValidationStatus",
73382 debounce_default(function() {
73383 window.requestIdleCallback(section.reRender);
73389 // modules/ui/panes/issues.js
73390 function uiPaneIssues(context) {
73391 var issuesPane = uiPane("issues", context).key(_t("issues.key")).label(_t.append("issues.title")).description(_t.append("issues.title")).iconName("iD-icon-alert").sections([
73392 uiSectionValidationOptions(context),
73393 uiSectionValidationStatus(context),
73394 uiSectionValidationIssues("issues-errors", "error", context),
73395 uiSectionValidationIssues("issues-warnings", "warning", context),
73396 uiSectionValidationRules(context)
73401 // modules/ui/settings/custom_data.js
73402 function uiSettingsCustomData(context) {
73403 var dispatch14 = dispatch_default("change");
73404 function render(selection2) {
73405 var dataLayer = context.layers().layer("data");
73406 var _origSettings = {
73407 fileList: dataLayer && dataLayer.fileList() || null,
73408 url: corePreferences("settings-custom-data-url")
73410 var _currSettings = {
73411 fileList: dataLayer && dataLayer.fileList() || null
73412 // url: prefs('settings-custom-data-url')
73414 var modal = uiConfirm(selection2).okButton();
73415 modal.classed("settings-modal settings-custom-data", true);
73416 modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_data.header"));
73417 var textSection = modal.select(".modal-section.message-text");
73418 textSection.append("pre").attr("class", "instructions-file").call(_t.append("settings.custom_data.file.instructions"));
73419 textSection.append("input").attr("class", "field-file").attr("type", "file").attr("accept", ".gpx,.kml,.geojson,.json,application/gpx+xml,application/vnd.google-earth.kml+xml,application/geo+json,application/json").property("files", _currSettings.fileList).on("change", function(d3_event) {
73420 var files = d3_event.target.files;
73421 if (files && files.length) {
73422 _currSettings.url = "";
73423 textSection.select(".field-url").property("value", "");
73424 _currSettings.fileList = files;
73426 _currSettings.fileList = null;
73429 textSection.append("h4").call(_t.append("settings.custom_data.or"));
73430 textSection.append("pre").attr("class", "instructions-url").call(_t.append("settings.custom_data.url.instructions"));
73431 textSection.append("textarea").attr("class", "field-url").attr("placeholder", _t("settings.custom_data.url.placeholder")).call(utilNoAuto).property("value", _currSettings.url);
73432 var buttonSection = modal.select(".modal-section.buttons");
73433 buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
73434 buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
73435 buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
73436 function isSaveDisabled() {
73439 function clickCancel() {
73440 textSection.select(".field-url").property("value", _origSettings.url);
73441 corePreferences("settings-custom-data-url", _origSettings.url);
73445 function clickSave() {
73446 _currSettings.url = textSection.select(".field-url").property("value").trim();
73447 if (_currSettings.url) {
73448 _currSettings.fileList = null;
73450 if (_currSettings.fileList) {
73451 _currSettings.url = "";
73453 corePreferences("settings-custom-data-url", _currSettings.url);
73456 dispatch14.call("change", this, _currSettings);
73459 return utilRebind(render, dispatch14, "on");
73462 // modules/ui/sections/data_layers.js
73463 function uiSectionDataLayers(context) {
73464 var settingsCustomData = uiSettingsCustomData(context).on("change", customChanged);
73465 var layers = context.layers();
73466 var section = uiSection("data-layers", context).label(() => _t.append("map_data.data_layers")).disclosureContent(renderDisclosureContent);
73467 function renderDisclosureContent(selection2) {
73468 var container = selection2.selectAll(".data-layer-container").data([0]);
73469 container.enter().append("div").attr("class", "data-layer-container").merge(container).call(drawOsmItems).call(drawQAItems).call(drawCustomDataItems).call(drawVectorItems).call(drawPanelItems);
73471 function showsLayer(which) {
73472 var layer = layers.layer(which);
73474 return layer.enabled();
73478 function setLayer(which, enabled) {
73479 var mode = context.mode();
73480 if (mode && /^draw/.test(mode.id))
73482 var layer = layers.layer(which);
73484 layer.enabled(enabled);
73485 if (!enabled && (which === "osm" || which === "notes")) {
73486 context.enter(modeBrowse(context));
73490 function toggleLayer(which) {
73491 setLayer(which, !showsLayer(which));
73493 function drawOsmItems(selection2) {
73494 var osmKeys = ["osm", "notes"];
73495 var osmLayers = layers.all().filter(function(obj) {
73496 return osmKeys.indexOf(obj.id) !== -1;
73498 var ul = selection2.selectAll(".layer-list-osm").data([0]);
73499 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-osm").merge(ul);
73500 var li = ul.selectAll(".list-item").data(osmLayers);
73501 li.exit().remove();
73502 var liEnter = li.enter().append("li").attr("class", function(d2) {
73503 return "list-item list-item-" + d2.id;
73505 var labelEnter = liEnter.append("label").each(function(d2) {
73506 if (d2.id === "osm") {
73507 select_default2(this).call(
73508 uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).keys([uiCmd("\u2325" + _t("area_fill.wireframe.key"))]).placement("bottom")
73511 select_default2(this).call(
73512 uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).placement("bottom")
73516 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73517 toggleLayer(d2.id);
73519 labelEnter.append("span").html(function(d2) {
73520 return _t.html("map_data.layers." + d2.id + ".title");
73522 li.merge(liEnter).classed("active", function(d2) {
73523 return d2.layer.enabled();
73524 }).selectAll("input").property("checked", function(d2) {
73525 return d2.layer.enabled();
73528 function drawQAItems(selection2) {
73529 var qaKeys = ["keepRight", "improveOSM", "osmose"];
73530 var qaLayers = layers.all().filter(function(obj) {
73531 return qaKeys.indexOf(obj.id) !== -1;
73533 var ul = selection2.selectAll(".layer-list-qa").data([0]);
73534 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-qa").merge(ul);
73535 var li = ul.selectAll(".list-item").data(qaLayers);
73536 li.exit().remove();
73537 var liEnter = li.enter().append("li").attr("class", function(d2) {
73538 return "list-item list-item-" + d2.id;
73540 var labelEnter = liEnter.append("label").each(function(d2) {
73541 select_default2(this).call(
73542 uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).placement("bottom")
73545 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73546 toggleLayer(d2.id);
73548 labelEnter.append("span").each(function(d2) {
73549 _t.append("map_data.layers." + d2.id + ".title")(select_default2(this));
73551 li.merge(liEnter).classed("active", function(d2) {
73552 return d2.layer.enabled();
73553 }).selectAll("input").property("checked", function(d2) {
73554 return d2.layer.enabled();
73557 function drawVectorItems(selection2) {
73558 var dataLayer = layers.layer("data");
73561 name: "Detroit Neighborhoods/Parks",
73562 src: "neighborhoods-parks",
73563 tooltip: "Neighborhood boundaries and parks as compiled by City of Detroit in concert with community groups.",
73564 template: "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/jonahadkins.cjksmur6x34562qp9iv1u3ksf-54hev,jonahadkins.cjksmqxdx33jj2wp90xd9x2md-4e5y2/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA"
73567 name: "Detroit Composite POIs",
73568 src: "composite-poi",
73569 tooltip: "Fire Inspections, Business Licenses, and other public location data collated from the City of Detroit.",
73570 template: "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/jonahadkins.cjksmm6a02sli31myxhsr7zf3-2sw8h/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA"
73573 name: "Detroit All-The-Places POIs",
73574 src: "alltheplaces-poi",
73575 tooltip: "Public domain business location data created by web scrapers.",
73576 template: "https://{switch:a,b,c,d}.tiles.mapbox.com/v4/jonahadkins.cjksmswgk340g2vo06p1w9w0j-8fjjc/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA"
73579 var detroit = geoExtent([-83.5, 42.1], [-82.8, 42.5]);
73580 var showVectorItems = context.map().zoom() > 9 && detroit.contains(context.map().center());
73581 var container = selection2.selectAll(".vectortile-container").data(showVectorItems ? [0] : []);
73582 container.exit().remove();
73583 var containerEnter = container.enter().append("div").attr("class", "vectortile-container");
73584 containerEnter.append("h4").attr("class", "vectortile-header").text("Detroit Vector Tiles (Beta)");
73585 containerEnter.append("ul").attr("class", "layer-list layer-list-vectortile");
73586 containerEnter.append("div").attr("class", "vectortile-footer").append("a").attr("target", "_blank").call(svgIcon("#iD-icon-out-link", "inline")).attr("href", "https://github.com/osmus/detroit-mapping-challenge").append("span").text("About these layers");
73587 container = container.merge(containerEnter);
73588 var ul = container.selectAll(".layer-list-vectortile");
73589 var li = ul.selectAll(".list-item").data(vtData);
73590 li.exit().remove();
73591 var liEnter = li.enter().append("li").attr("class", function(d2) {
73592 return "list-item list-item-" + d2.src;
73594 var labelEnter = liEnter.append("label").each(function(d2) {
73595 select_default2(this).call(
73596 uiTooltip().title(d2.tooltip).placement("top")
73599 labelEnter.append("input").attr("type", "radio").attr("name", "vectortile").on("change", selectVTLayer);
73600 labelEnter.append("span").text(function(d2) {
73603 li.merge(liEnter).classed("active", isVTLayerSelected).selectAll("input").property("checked", isVTLayerSelected);
73604 function isVTLayerSelected(d2) {
73605 return dataLayer && dataLayer.template() === d2.template;
73607 function selectVTLayer(d3_event, d2) {
73608 corePreferences("settings-custom-data-url", d2.template);
73610 dataLayer.template(d2.template, d2.src);
73611 dataLayer.enabled(true);
73615 function drawCustomDataItems(selection2) {
73616 var dataLayer = layers.layer("data");
73617 var hasData = dataLayer && dataLayer.hasData();
73618 var showsData = hasData && dataLayer.enabled();
73619 var ul = selection2.selectAll(".layer-list-data").data(dataLayer ? [0] : []);
73620 ul.exit().remove();
73621 var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-data");
73622 var liEnter = ulEnter.append("li").attr("class", "list-item-data");
73623 var labelEnter = liEnter.append("label").call(
73624 uiTooltip().title(() => _t.append("map_data.layers.custom.tooltip")).placement("top")
73626 labelEnter.append("input").attr("type", "checkbox").on("change", function() {
73627 toggleLayer("data");
73629 labelEnter.append("span").call(_t.append("map_data.layers.custom.title"));
73630 liEnter.append("button").attr("class", "open-data-options").call(
73631 uiTooltip().title(() => _t.append("settings.custom_data.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
73632 ).on("click", function(d3_event) {
73633 d3_event.preventDefault();
73635 }).call(svgIcon("#iD-icon-more"));
73636 liEnter.append("button").attr("class", "zoom-to-data").call(
73637 uiTooltip().title(() => _t.append("map_data.layers.custom.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
73638 ).on("click", function(d3_event) {
73639 if (select_default2(this).classed("disabled"))
73641 d3_event.preventDefault();
73642 d3_event.stopPropagation();
73643 dataLayer.fitZoom();
73644 }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
73645 ul = ul.merge(ulEnter);
73646 ul.selectAll(".list-item-data").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
73647 ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
73649 function editCustom() {
73650 context.container().call(settingsCustomData);
73652 function customChanged(d2) {
73653 var dataLayer = layers.layer("data");
73654 if (d2 && d2.url) {
73655 dataLayer.url(d2.url);
73656 } else if (d2 && d2.fileList) {
73657 dataLayer.fileList(d2.fileList);
73660 function drawPanelItems(selection2) {
73661 var panelsListEnter = selection2.selectAll(".md-extras-list").data([0]).enter().append("ul").attr("class", "layer-list md-extras-list");
73662 var historyPanelLabelEnter = panelsListEnter.append("li").attr("class", "history-panel-toggle-item").append("label").call(
73663 uiTooltip().title(() => _t.append("map_data.history_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.history.key"))]).placement("top")
73665 historyPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
73666 d3_event.preventDefault();
73667 context.ui().info.toggle("history");
73669 historyPanelLabelEnter.append("span").call(_t.append("map_data.history_panel.title"));
73670 var measurementPanelLabelEnter = panelsListEnter.append("li").attr("class", "measurement-panel-toggle-item").append("label").call(
73671 uiTooltip().title(() => _t.append("map_data.measurement_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.measurement.key"))]).placement("top")
73673 measurementPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
73674 d3_event.preventDefault();
73675 context.ui().info.toggle("measurement");
73677 measurementPanelLabelEnter.append("span").call(_t.append("map_data.measurement_panel.title"));
73679 context.layers().on("change.uiSectionDataLayers", section.reRender);
73681 "move.uiSectionDataLayers",
73682 debounce_default(function() {
73683 window.requestIdleCallback(section.reRender);
73689 // modules/ui/sections/map_features.js
73690 function uiSectionMapFeatures(context) {
73691 var _features = context.features().keys();
73692 var section = uiSection("map-features", context).label(() => _t.append("map_data.map_features")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73693 function renderDisclosureContent(selection2) {
73694 var container = selection2.selectAll(".layer-feature-list-container").data([0]);
73695 var containerEnter = container.enter().append("div").attr("class", "layer-feature-list-container");
73696 containerEnter.append("ul").attr("class", "layer-list layer-feature-list");
73697 var footer = containerEnter.append("div").attr("class", "feature-list-links section-footer");
73698 footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
73699 d3_event.preventDefault();
73700 context.features().disableAll();
73702 footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
73703 d3_event.preventDefault();
73704 context.features().enableAll();
73706 container = container.merge(containerEnter);
73707 container.selectAll(".layer-feature-list").call(drawListItems, _features, "checkbox", "feature", clickFeature, showsFeature);
73709 function drawListItems(selection2, data, type2, name, change, active) {
73710 var items = selection2.selectAll("li").data(data);
73711 items.exit().remove();
73712 var enter = items.enter().append("li").call(
73713 uiTooltip().title(function(d2) {
73714 var tip = _t.append(name + "." + d2 + ".tooltip");
73715 if (autoHiddenFeature(d2)) {
73716 var msg = showsLayer("osm") ? _t.append("map_data.autohidden") : _t.append("map_data.osmhidden");
73717 return (selection3) => {
73718 selection3.call(tip);
73719 selection3.append("div").call(msg);
73723 }).placement("top")
73725 var label = enter.append("label");
73726 label.append("input").attr("type", type2).attr("name", name).on("change", change);
73727 label.append("span").html(function(d2) {
73728 return _t.html(name + "." + d2 + ".description");
73730 items = items.merge(enter);
73731 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", autoHiddenFeature);
73733 function autoHiddenFeature(d2) {
73734 return context.features().autoHidden(d2);
73736 function showsFeature(d2) {
73737 return context.features().enabled(d2);
73739 function clickFeature(d3_event, d2) {
73740 context.features().toggle(d2);
73742 function showsLayer(id2) {
73743 var layer = context.layers().layer(id2);
73744 return layer && layer.enabled();
73746 context.features().on("change.map_features", section.reRender);
73750 // modules/ui/sections/map_style_options.js
73751 function uiSectionMapStyleOptions(context) {
73752 var section = uiSection("fill-area", context).label(() => _t.append("map_data.style_options")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73753 function renderDisclosureContent(selection2) {
73754 var container = selection2.selectAll(".layer-fill-list").data([0]);
73755 container.enter().append("ul").attr("class", "layer-list layer-fill-list").merge(container).call(drawListItems, context.map().areaFillOptions, "radio", "area_fill", setFill, isActiveFill);
73756 var container2 = selection2.selectAll(".layer-visual-diff-list").data([0]);
73757 container2.enter().append("ul").attr("class", "layer-list layer-visual-diff-list").merge(container2).call(drawListItems, ["highlight_edits"], "checkbox", "visual_diff", toggleHighlightEdited, function() {
73758 return context.surface().classed("highlight-edited");
73761 function drawListItems(selection2, data, type2, name, change, active) {
73762 var items = selection2.selectAll("li").data(data);
73763 items.exit().remove();
73764 var enter = items.enter().append("li").call(
73765 uiTooltip().title(function(d2) {
73766 return _t.append(name + "." + d2 + ".tooltip");
73767 }).keys(function(d2) {
73768 var key = d2 === "wireframe" ? _t("area_fill.wireframe.key") : null;
73769 if (d2 === "highlight_edits")
73770 key = _t("map_data.highlight_edits.key");
73771 return key ? [key] : null;
73772 }).placement("top")
73774 var label = enter.append("label");
73775 label.append("input").attr("type", type2).attr("name", name).on("change", change);
73776 label.append("span").html(function(d2) {
73777 return _t.html(name + "." + d2 + ".description");
73779 items = items.merge(enter);
73780 items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
73782 function isActiveFill(d2) {
73783 return context.map().activeAreaFill() === d2;
73785 function toggleHighlightEdited(d3_event) {
73786 d3_event.preventDefault();
73787 context.map().toggleHighlightEdited();
73789 function setFill(d3_event, d2) {
73790 context.map().activeAreaFill(d2);
73792 context.map().on("changeHighlighting.ui_style, changeAreaFill.ui_style", section.reRender);
73796 // modules/ui/settings/local_photos.js
73797 function uiSettingsLocalPhotos(context) {
73798 var dispatch14 = dispatch_default("change");
73799 var photoLayer = context.layers().layer("local-photos");
73801 function render(selection2) {
73802 modal = uiConfirm(selection2).okButton();
73803 modal.classed("settings-modal settings-local-photos", true);
73804 modal.select(".modal-section.header").append("h3").call(_t.append("local_photos.header"));
73805 modal.select(".modal-section.message-text").append("div").classed("local-photos", true);
73806 var instructionsSection = modal.select(".modal-section.message-text .local-photos").append("div").classed("instructions", true);
73807 instructionsSection.append("p").classed("instructions-local-photos", true).call(_t.append("local_photos.file.instructions"));
73808 instructionsSection.append("input").classed("field-file", true).attr("type", "file").attr("multiple", "multiple").attr("accept", ".jpg,.jpeg,.png,image/png,image/jpeg").style("visibility", "hidden").attr("id", "local-photo-files").on("change", function(d3_event) {
73809 var files = d3_event.target.files;
73810 if (files && files.length) {
73811 photoList.select("ul").append("li").classed("placeholder", true).append("div");
73812 dispatch14.call("change", this, files);
73814 d3_event.target.value = null;
73816 instructionsSection.append("label").attr("for", "local-photo-files").classed("button", true).call(_t.append("local_photos.file.label"));
73817 const photoList = modal.select(".modal-section.message-text .local-photos").append("div").append("div").classed("list-local-photos", true);
73818 photoList.append("ul");
73819 updatePhotoList(photoList.select("ul"));
73820 context.layers().on("change", () => updatePhotoList(photoList.select("ul")));
73822 function updatePhotoList(container) {
73823 function locationUnavailable(d2) {
73824 return !(isArray_default(d2.loc) && isNumber_default(d2.loc[0]) && isNumber_default(d2.loc[1]));
73826 container.selectAll("li.placeholder").remove();
73827 let selection2 = container.selectAll("li").data(photoLayer.getPhotos() ?? [], (d2) => d2.id);
73828 selection2.exit().remove();
73829 const selectionEnter = selection2.enter().append("li");
73830 selectionEnter.append("span").classed("filename", true);
73831 selectionEnter.append("button").classed("form-field-button zoom-to-data", true).attr("title", _t("local_photos.zoom_single")).call(svgIcon("#iD-icon-framed-dot"));
73832 selectionEnter.append("button").classed("form-field-button no-geolocation", true).call(svgIcon("#iD-icon-alert")).call(
73833 uiTooltip().title(() => _t.append("local_photos.no_geolocation.tooltip")).placement("left")
73835 selectionEnter.append("button").classed("form-field-button remove", true).attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
73836 selection2 = selection2.merge(selectionEnter);
73837 selection2.classed("invalid", locationUnavailable);
73838 selection2.select("span.filename").text((d2) => d2.name).attr("title", (d2) => d2.name);
73839 selection2.select("span.filename").on("click", (d3_event, d2) => {
73840 photoLayer.openPhoto(d3_event, d2, false);
73842 selection2.select("button.zoom-to-data").on("click", (d3_event, d2) => {
73843 photoLayer.openPhoto(d3_event, d2, true);
73845 selection2.select("button.remove").on("click", (d3_event, d2) => {
73846 photoLayer.removePhoto(d2.id);
73847 updatePhotoList(container);
73850 return utilRebind(render, dispatch14, "on");
73853 // modules/ui/sections/photo_overlays.js
73854 function uiSectionPhotoOverlays(context) {
73855 var settingsLocalPhotos = uiSettingsLocalPhotos(context).on("change", localPhotosChanged);
73856 var layers = context.layers();
73857 var section = uiSection("photo-overlays", context).label(() => _t.append("photo_overlays.title")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73858 function renderDisclosureContent(selection2) {
73859 var container = selection2.selectAll(".photo-overlay-container").data([0]);
73860 container.enter().append("div").attr("class", "photo-overlay-container").merge(container).call(drawPhotoItems).call(drawPhotoTypeItems).call(drawDateFilter).call(drawUsernameFilter).call(drawLocalPhotos);
73862 function drawPhotoItems(selection2) {
73863 var photoKeys = context.photos().overlayLayerIDs();
73864 var photoLayers = layers.all().filter(function(obj) {
73865 return photoKeys.indexOf(obj.id) !== -1;
73867 var data = photoLayers.filter(function(obj) {
73868 if (!obj.layer.supported())
73870 if (layerEnabled(obj))
73872 if (typeof obj.layer.validHere === "function") {
73873 return obj.layer.validHere(context.map().extent(), context.map().zoom());
73877 function layerSupported(d2) {
73878 return d2.layer && d2.layer.supported();
73880 function layerEnabled(d2) {
73881 return layerSupported(d2) && d2.layer.enabled();
73883 function layerRendered(d2) {
73884 return d2.layer.rendered?.(context.map().zoom()) ?? true;
73886 var ul = selection2.selectAll(".layer-list-photos").data([0]);
73887 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photos").merge(ul);
73888 var li = ul.selectAll(".list-item-photos").data(data);
73889 li.exit().remove();
73890 var liEnter = li.enter().append("li").attr("class", function(d2) {
73891 var classes = "list-item-photos list-item-" + d2.id;
73892 if (d2.id === "mapillary-signs" || d2.id === "mapillary-map-features") {
73893 classes += " indented";
73897 var labelEnter = liEnter.append("label").each(function(d2) {
73899 if (d2.id === "mapillary-signs")
73900 titleID = "mapillary.signs.tooltip";
73901 else if (d2.id === "mapillary")
73902 titleID = "mapillary_images.tooltip";
73903 else if (d2.id === "kartaview")
73904 titleID = "kartaview_images.tooltip";
73906 titleID = d2.id.replace(/-/g, "_") + ".tooltip";
73907 select_default2(this).call(
73908 uiTooltip().title(() => {
73909 if (!layerRendered(d2)) {
73910 return _t.append("street_side.minzoom_tooltip");
73912 return _t.append(titleID);
73914 }).placement("top")
73917 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73918 toggleLayer(d2.id);
73920 labelEnter.append("span").html(function(d2) {
73922 if (id2 === "mapillary-signs")
73923 id2 = "photo_overlays.traffic_signs";
73924 return _t.html(id2.replace(/-/g, "_") + ".title");
73926 li.merge(liEnter).classed("active", layerEnabled).selectAll("input").property("disabled", (d2) => !layerRendered(d2)).property("checked", layerEnabled);
73928 function drawPhotoTypeItems(selection2) {
73929 var data = context.photos().allPhotoTypes();
73930 function typeEnabled(d2) {
73931 return context.photos().showsPhotoType(d2);
73933 var ul = selection2.selectAll(".layer-list-photo-types").data([0]);
73934 ul.exit().remove();
73935 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photo-types").merge(ul);
73936 var li = ul.selectAll(".list-item-photo-types").data(context.photos().shouldFilterByPhotoType() ? data : []);
73937 li.exit().remove();
73938 var liEnter = li.enter().append("li").attr("class", function(d2) {
73939 return "list-item-photo-types list-item-" + d2;
73941 var labelEnter = liEnter.append("label").each(function(d2) {
73942 select_default2(this).call(
73943 uiTooltip().title(() => _t.append("photo_overlays.photo_type." + d2 + ".tooltip")).placement("top")
73946 labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73947 context.photos().togglePhotoType(d2);
73949 labelEnter.append("span").html(function(d2) {
73950 return _t.html("photo_overlays.photo_type." + d2 + ".title");
73952 li.merge(liEnter).classed("active", typeEnabled).selectAll("input").property("checked", typeEnabled);
73954 function drawDateFilter(selection2) {
73955 var data = context.photos().dateFilters();
73956 function filterEnabled(d2) {
73957 return context.photos().dateFilterValue(d2);
73959 var ul = selection2.selectAll(".layer-list-date-filter").data([0]);
73960 ul.exit().remove();
73961 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-date-filter").merge(ul);
73962 var li = ul.selectAll(".list-item-date-filter").data(context.photos().shouldFilterByDate() ? data : []);
73963 li.exit().remove();
73964 var liEnter = li.enter().append("li").attr("class", "list-item-date-filter");
73965 var labelEnter = liEnter.append("label").each(function(d2) {
73966 select_default2(this).call(
73967 uiTooltip().title(() => _t.append("photo_overlays.date_filter." + d2 + ".tooltip")).placement("top")
73970 labelEnter.append("span").each(function(d2) {
73971 _t.append("photo_overlays.date_filter." + d2 + ".title")(select_default2(this));
73973 labelEnter.append("input").attr("type", "date").attr("class", "list-item-input").attr("placeholder", _t("units.year_month_day")).call(utilNoAuto).each(function(d2) {
73974 utilGetSetValue(select_default2(this), context.photos().dateFilterValue(d2) || "");
73975 }).on("change", function(d3_event, d2) {
73976 var value = utilGetSetValue(select_default2(this)).trim();
73977 context.photos().setDateFilter(d2, value, true);
73978 li.selectAll("input").each(function(d4) {
73979 utilGetSetValue(select_default2(this), context.photos().dateFilterValue(d4) || "");
73982 li = li.merge(liEnter).classed("active", filterEnabled);
73984 function drawUsernameFilter(selection2) {
73985 function filterEnabled() {
73986 return context.photos().usernames();
73988 var ul = selection2.selectAll(".layer-list-username-filter").data([0]);
73989 ul.exit().remove();
73990 ul = ul.enter().append("ul").attr("class", "layer-list layer-list-username-filter").merge(ul);
73991 var li = ul.selectAll(".list-item-username-filter").data(context.photos().shouldFilterByUsername() ? ["username-filter"] : []);
73992 li.exit().remove();
73993 var liEnter = li.enter().append("li").attr("class", "list-item-username-filter");
73994 var labelEnter = liEnter.append("label").each(function() {
73995 select_default2(this).call(
73996 uiTooltip().title(() => _t.append("photo_overlays.username_filter.tooltip")).placement("top")
73999 labelEnter.append("span").call(_t.append("photo_overlays.username_filter.title"));
74000 labelEnter.append("input").attr("type", "text").attr("class", "list-item-input").call(utilNoAuto).property("value", usernameValue).on("change", function() {
74001 var value = select_default2(this).property("value");
74002 context.photos().setUsernameFilter(value, true);
74003 select_default2(this).property("value", usernameValue);
74005 li.merge(liEnter).classed("active", filterEnabled);
74006 function usernameValue() {
74007 var usernames = context.photos().usernames();
74009 return usernames.join("; ");
74013 function toggleLayer(which) {
74014 setLayer(which, !showsLayer(which));
74016 function showsLayer(which) {
74017 var layer = layers.layer(which);
74019 return layer.enabled();
74023 function setLayer(which, enabled) {
74024 var layer = layers.layer(which);
74026 layer.enabled(enabled);
74029 function drawLocalPhotos(selection2) {
74030 var photoLayer = layers.layer("local-photos");
74031 var hasData = photoLayer && photoLayer.hasData();
74032 var showsData = hasData && photoLayer.enabled();
74033 var ul = selection2.selectAll(".layer-list-local-photos").data(photoLayer ? [0] : []);
74034 ul.exit().remove();
74035 var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-local-photos");
74036 var localPhotosEnter = ulEnter.append("li").attr("class", "list-item-local-photos");
74037 var localPhotosLabelEnter = localPhotosEnter.append("label").call(uiTooltip().title(() => _t.append("local_photos.tooltip")));
74038 localPhotosLabelEnter.append("input").attr("type", "checkbox").on("change", function() {
74039 toggleLayer("local-photos");
74041 localPhotosLabelEnter.call(_t.append("local_photos.header"));
74042 localPhotosEnter.append("button").attr("class", "open-data-options").call(
74043 uiTooltip().title(() => _t.append("local_photos.tooltip_edit")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
74044 ).on("click", function(d3_event) {
74045 d3_event.preventDefault();
74047 }).call(svgIcon("#iD-icon-more"));
74048 localPhotosEnter.append("button").attr("class", "zoom-to-data").call(
74049 uiTooltip().title(() => _t.append("local_photos.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
74050 ).on("click", function(d3_event) {
74051 if (select_default2(this).classed("disabled"))
74053 d3_event.preventDefault();
74054 d3_event.stopPropagation();
74055 photoLayer.fitZoom();
74056 }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
74057 ul = ul.merge(ulEnter);
74058 ul.selectAll(".list-item-local-photos").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
74059 ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
74061 function editLocalPhotos() {
74062 context.container().call(settingsLocalPhotos);
74064 function localPhotosChanged(d2) {
74065 var localPhotosLayer = layers.layer("local-photos");
74066 localPhotosLayer.fileList(d2);
74068 context.layers().on("change.uiSectionPhotoOverlays", section.reRender);
74069 context.photos().on("change.uiSectionPhotoOverlays", section.reRender);
74071 "move.photo_overlays",
74072 debounce_default(function() {
74073 window.requestIdleCallback(section.reRender);
74079 // modules/ui/panes/map_data.js
74080 function uiPaneMapData(context) {
74081 var mapDataPane = uiPane("map-data", context).key(_t("map_data.key")).label(_t.append("map_data.title")).description(_t.append("map_data.description")).iconName("iD-icon-data").sections([
74082 uiSectionDataLayers(context),
74083 uiSectionPhotoOverlays(context),
74084 uiSectionMapStyleOptions(context),
74085 uiSectionMapFeatures(context)
74087 return mapDataPane;
74090 // modules/ui/panes/preferences.js
74091 function uiPanePreferences(context) {
74092 let preferencesPane = uiPane("preferences", context).key(_t("preferences.key")).label(_t.append("preferences.title")).description(_t.append("preferences.description")).iconName("fas-user-cog").sections([
74093 uiSectionPrivacy(context)
74095 return preferencesPane;
74098 // modules/ui/init.js
74099 function uiInit(context) {
74100 var _initCounter = 0;
74101 var _needWidth = {};
74102 var _lastPointerType;
74103 function render(container) {
74104 container.on("click.ui", function(d3_event) {
74105 if (d3_event.button !== 0)
74107 if (!d3_event.composedPath)
74109 var isOkayTarget = d3_event.composedPath().some(function(node) {
74110 return node.nodeType === 1 && // clicking <input> focuses it and/or changes a value
74111 (node.nodeName === "INPUT" || // clicking <label> affects its <input> by default
74112 node.nodeName === "LABEL" || // clicking <a> opens a hyperlink by default
74113 node.nodeName === "A");
74117 d3_event.preventDefault();
74119 var detected = utilDetect();
74120 if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
74121 // but we only need to do this on desktop Safari anyway. – #7694
74122 !detected.isMobileWebKit) {
74123 container.on("gesturestart.ui gesturechange.ui gestureend.ui", function(d3_event) {
74124 d3_event.preventDefault();
74127 if ("PointerEvent" in window) {
74128 select_default2(window).on("pointerdown.ui pointerup.ui", function(d3_event) {
74129 var pointerType = d3_event.pointerType || "mouse";
74130 if (_lastPointerType !== pointerType) {
74131 _lastPointerType = pointerType;
74132 container.attr("pointer", pointerType);
74136 _lastPointerType = "mouse";
74137 container.attr("pointer", "mouse");
74139 container.attr("lang", _mainLocalizer.localeCode()).attr("dir", _mainLocalizer.textDirection());
74140 container.call(uiFullScreen(context));
74141 var map2 = context.map();
74142 map2.redrawEnable(false);
74143 map2.on("hitMinZoom.ui", function() {
74144 ui.flash.iconName("#iD-icon-no").label(_t.append("cannot_zoom"))();
74146 container.append("svg").attr("id", "ideditor-defs").call(ui.svgDefs);
74147 container.append("div").attr("class", "sidebar").call(ui.sidebar);
74148 var content = container.append("div").attr("class", "main-content active");
74149 content.append("div").attr("class", "top-toolbar-wrap").append("div").attr("class", "top-toolbar fillD").call(uiTopToolbar(context));
74150 content.append("div").attr("class", "main-map").attr("dir", "ltr").call(map2);
74151 var overMap = content.append("div").attr("class", "over-map");
74152 overMap.append("div").attr("class", "select-trap").text("t");
74153 overMap.call(uiMapInMap(context)).call(uiNotice(context));
74154 overMap.append("div").attr("class", "spinner").call(uiSpinner(context));
74155 var controlsWrap = overMap.append("div").attr("class", "map-controls-wrap");
74156 var controls = controlsWrap.append("div").attr("class", "map-controls");
74157 controls.append("div").attr("class", "map-control zoombuttons").call(uiZoom(context));
74158 controls.append("div").attr("class", "map-control zoom-to-selection-control").call(uiZoomToSelection(context));
74159 controls.append("div").attr("class", "map-control geolocate-control").call(uiGeolocate(context));
74160 controlsWrap.on("wheel.mapControls", function(d3_event) {
74161 if (!d3_event.deltaX) {
74162 controlsWrap.node().scrollTop += d3_event.deltaY;
74165 var panes = overMap.append("div").attr("class", "map-panes");
74167 uiPaneBackground(context),
74168 uiPaneMapData(context),
74169 uiPaneIssues(context),
74170 uiPanePreferences(context),
74171 uiPaneHelp(context)
74173 uiPanes.forEach(function(pane) {
74174 controls.append("div").attr("class", "map-control map-pane-control " + pane.id + "-control").call(pane.renderToggleButton);
74175 panes.call(pane.renderPane);
74177 ui.info = uiInfo(context);
74178 overMap.call(ui.info);
74179 overMap.append("div").attr("class", "photoviewer").classed("al", true).classed("hide", true).call(ui.photoviewer);
74180 overMap.append("div").attr("class", "attribution-wrap").attr("dir", "ltr").call(uiAttribution(context));
74181 var about = content.append("div").attr("class", "map-footer");
74182 about.append("div").attr("class", "api-status").call(uiStatus(context));
74183 var footer = about.append("div").attr("class", "map-footer-bar fillD");
74184 footer.append("div").attr("class", "flash-wrap footer-hide");
74185 var footerWrap = footer.append("div").attr("class", "main-footer-wrap footer-show");
74186 footerWrap.append("div").attr("class", "scale-block").call(uiScale(context));
74187 var aboutList = footerWrap.append("div").attr("class", "info-block").append("ul").attr("class", "map-footer-list");
74188 aboutList.append("li").attr("class", "user-list").call(uiContributors(context));
74189 var apiConnections = context.connection().apiConnections();
74190 if (apiConnections && apiConnections.length > 1) {
74191 aboutList.append("li").attr("class", "source-switch").call(
74192 uiSourceSwitch(context).keys(apiConnections)
74195 aboutList.append("li").attr("class", "issues-info").call(uiIssuesInfo(context));
74196 aboutList.append("li").attr("class", "feature-warning").call(uiFeatureInfo(context));
74197 var issueLinks = aboutList.append("li");
74198 issueLinks.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD/issues").attr("aria-label", _t("report_a_bug")).call(svgIcon("#iD-icon-bug", "light")).call(uiTooltip().title(() => _t.append("report_a_bug")).placement("top"));
74199 issueLinks.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD/blob/develop/CONTRIBUTING.md#translating").attr("aria-label", _t("help_translate")).call(svgIcon("#iD-icon-translate", "light")).call(uiTooltip().title(() => _t.append("help_translate")).placement("top"));
74200 aboutList.append("li").attr("class", "version").call(uiVersion(context));
74201 if (!context.embed()) {
74202 aboutList.call(uiAccount(context));
74205 map2.redrawEnable(true);
74206 ui.hash = behaviorHash(context);
74208 if (!ui.hash.hadLocation) {
74209 map2.centerZoom([0, 0], 2);
74211 window.onbeforeunload = function() {
74212 return context.save();
74214 window.onunload = function() {
74215 context.history().unlock();
74217 select_default2(window).on("resize.editor", function() {
74220 var panPixels = 80;
74221 context.keybinding().on("\u232B", function(d3_event) {
74222 d3_event.preventDefault();
74223 }).on([_t("sidebar.key"), "`", "\xB2", "@"], ui.sidebar.toggle).on("\u2190", pan([panPixels, 0])).on("\u2191", pan([0, panPixels])).on("\u2192", pan([-panPixels, 0])).on("\u2193", pan([0, -panPixels])).on(uiCmd("\u2325\u2190"), pan([map2.dimensions()[0], 0])).on(uiCmd("\u2325\u2191"), pan([0, map2.dimensions()[1]])).on(uiCmd("\u2325\u2192"), pan([-map2.dimensions()[0], 0])).on(uiCmd("\u2325\u2193"), pan([0, -map2.dimensions()[1]])).on(uiCmd("\u2318" + _t("background.key")), function quickSwitch(d3_event) {
74225 d3_event.stopImmediatePropagation();
74226 d3_event.preventDefault();
74228 var previousBackground = context.background().findSource(corePreferences("background-last-used-toggle"));
74229 if (previousBackground) {
74230 var currentBackground = context.background().baseLayerSource();
74231 corePreferences("background-last-used-toggle", currentBackground.id);
74232 corePreferences("background-last-used", previousBackground.id);
74233 context.background().baseLayerSource(previousBackground);
74235 }).on(_t("area_fill.wireframe.key"), function toggleWireframe(d3_event) {
74236 d3_event.preventDefault();
74237 d3_event.stopPropagation();
74238 context.map().toggleWireframe();
74239 }).on(uiCmd("\u2325" + _t("area_fill.wireframe.key")), function toggleOsmData(d3_event) {
74240 d3_event.preventDefault();
74241 d3_event.stopPropagation();
74242 var mode = context.mode();
74243 if (mode && /^draw/.test(mode.id))
74245 var layer = context.layers().layer("osm");
74247 layer.enabled(!layer.enabled());
74248 if (!layer.enabled()) {
74249 context.enter(modeBrowse(context));
74252 }).on(_t("map_data.highlight_edits.key"), function toggleHighlightEdited(d3_event) {
74253 d3_event.preventDefault();
74254 context.map().toggleHighlightEdited();
74256 context.on("enter.editor", function(entered) {
74257 container.classed("mode-" + entered.id, true);
74258 }).on("exit.editor", function(exited) {
74259 container.classed("mode-" + exited.id, false);
74261 context.enter(modeBrowse(context));
74262 if (!_initCounter++) {
74263 if (!ui.hash.startWalkthrough) {
74264 context.container().call(uiSplash(context)).call(uiRestore(context));
74266 context.container().call(ui.shortcuts);
74268 var osm = context.connection();
74269 var auth = uiLoading(context).message(_t.html("loading_auth")).blocking(true);
74271 osm.on("authLoading.ui", function() {
74272 context.container().call(auth);
74273 }).on("authDone.ui", function() {
74278 if (ui.hash.startWalkthrough) {
74279 ui.hash.startWalkthrough = false;
74280 context.container().call(uiIntro(context));
74283 return function(d3_event) {
74284 if (d3_event.shiftKey)
74286 if (context.container().select(".combobox").size())
74288 d3_event.preventDefault();
74289 context.map().pan(d2, 100);
74295 ui.ensureLoaded = () => {
74297 return _loadPromise;
74298 return _loadPromise = Promise.all([
74299 // must have strings and presets before loading the UI
74300 _mainLocalizer.ensureLoaded(),
74301 _mainPresetIndex.ensureLoaded()
74303 if (!context.container().empty())
74304 render(context.container());
74305 }).catch((err) => console.error(err));
74307 ui.restart = function() {
74308 context.keybinding().clear();
74309 _loadPromise = null;
74310 context.container().selectAll("*").remove();
74313 ui.lastPointerType = function() {
74314 return _lastPointerType;
74316 ui.svgDefs = svgDefs(context);
74317 ui.flash = uiFlash(context);
74318 ui.sidebar = uiSidebar(context);
74319 ui.photoviewer = uiPhotoviewer(context);
74320 ui.shortcuts = uiShortcuts(context);
74321 ui.onResize = function(withPan) {
74322 var map2 = context.map();
74323 var mapDimensions = utilGetDimensions(context.container().select(".main-content"), true);
74324 utilGetDimensions(context.container().select(".sidebar"), true);
74325 if (withPan !== void 0) {
74326 map2.redrawEnable(false);
74328 map2.redrawEnable(true);
74330 map2.dimensions(mapDimensions);
74331 ui.photoviewer.onMapResize();
74332 ui.checkOverflow(".top-toolbar");
74333 ui.checkOverflow(".map-footer-bar");
74334 var resizeWindowEvent = document.createEvent("Event");
74335 resizeWindowEvent.initEvent("resizeWindow", true, true);
74336 document.dispatchEvent(resizeWindowEvent);
74338 ui.checkOverflow = function(selector, reset) {
74340 delete _needWidth[selector];
74342 var selection2 = context.container().select(selector);
74343 if (selection2.empty())
74345 var scrollWidth = selection2.property("scrollWidth");
74346 var clientWidth = selection2.property("clientWidth");
74347 var needed = _needWidth[selector] || scrollWidth;
74348 if (scrollWidth > clientWidth) {
74349 selection2.classed("narrow", true);
74350 if (!_needWidth[selector]) {
74351 _needWidth[selector] = scrollWidth;
74353 } else if (scrollWidth >= needed) {
74354 selection2.classed("narrow", false);
74357 ui.togglePanes = function(showPane) {
74358 var hidePanes = context.container().selectAll(".map-pane.shown");
74359 var side = _mainLocalizer.textDirection() === "ltr" ? "right" : "left";
74360 hidePanes.classed("shown", false).classed("hide", true);
74361 context.container().selectAll(".map-pane-control button").classed("active", false);
74363 hidePanes.classed("shown", false).classed("hide", true).style(side, "-500px");
74364 context.container().selectAll("." + showPane.attr("pane") + "-control button").classed("active", true);
74365 showPane.classed("shown", true).classed("hide", false);
74366 if (hidePanes.empty()) {
74367 showPane.style(side, "-500px").transition().duration(200).style(side, "0px");
74369 showPane.style(side, "0px");
74372 hidePanes.classed("shown", true).classed("hide", false).style(side, "0px").transition().duration(200).style(side, "-500px").on("end", function() {
74373 select_default2(this).classed("shown", false).classed("hide", true);
74377 var _editMenu = uiEditMenu(context);
74378 ui.editMenu = function() {
74381 ui.showEditMenu = function(anchorPoint, triggerType, operations) {
74382 ui.closeEditMenu();
74383 if (!operations && context.mode().operations)
74384 operations = context.mode().operations();
74385 if (!operations || !operations.length)
74387 if (!context.map().editableDataEnabled())
74389 var surfaceNode = context.surface().node();
74390 if (surfaceNode.focus) {
74391 surfaceNode.focus();
74393 operations.forEach(function(operation) {
74394 if (operation.point)
74395 operation.point(anchorPoint);
74397 _editMenu.anchorLoc(anchorPoint).triggerType(triggerType).operations(operations);
74398 context.map().supersurface.call(_editMenu);
74400 ui.closeEditMenu = function() {
74401 context.map().supersurface.select(".edit-menu").remove();
74403 var _saveLoading = select_default2(null);
74404 context.uploader().on("saveStarted.ui", function() {
74405 _saveLoading = uiLoading(context).message(_t.html("save.uploading")).blocking(true);
74406 context.container().call(_saveLoading);
74407 }).on("saveEnded.ui", function() {
74408 _saveLoading.close();
74409 _saveLoading = select_default2(null);
74418 // modules/core/context.js
74419 function coreContext() {
74420 const dispatch14 = dispatch_default("enter", "exit", "change");
74421 let context = utilRebind({}, dispatch14, "on");
74422 let _deferred2 = /* @__PURE__ */ new Set();
74423 context.version = package_default.version;
74424 context.privacyVersion = "20201202";
74425 context.initialHashParams = window.location.hash ? utilStringQs(window.location.hash) : {};
74426 context.changeset = null;
74427 let _defaultChangesetComment = context.initialHashParams.comment;
74428 let _defaultChangesetSource = context.initialHashParams.source;
74429 let _defaultChangesetHashtags = context.initialHashParams.hashtags;
74430 context.defaultChangesetComment = function(val) {
74431 if (!arguments.length)
74432 return _defaultChangesetComment;
74433 _defaultChangesetComment = val;
74436 context.defaultChangesetSource = function(val) {
74437 if (!arguments.length)
74438 return _defaultChangesetSource;
74439 _defaultChangesetSource = val;
74442 context.defaultChangesetHashtags = function(val) {
74443 if (!arguments.length)
74444 return _defaultChangesetHashtags;
74445 _defaultChangesetHashtags = val;
74448 let _setsDocumentTitle = true;
74449 context.setsDocumentTitle = function(val) {
74450 if (!arguments.length)
74451 return _setsDocumentTitle;
74452 _setsDocumentTitle = val;
74455 let _documentTitleBase = document.title;
74456 context.documentTitleBase = function(val) {
74457 if (!arguments.length)
74458 return _documentTitleBase;
74459 _documentTitleBase = val;
74463 context.ui = () => _ui;
74464 context.lastPointerType = () => _ui.lastPointerType();
74465 let _keybinding = utilKeybinding("context");
74466 context.keybinding = () => _keybinding;
74467 select_default2(document).call(_keybinding);
74468 let _connection = services.osm;
74472 context.connection = () => _connection;
74473 context.history = () => _history;
74474 context.validator = () => _validator;
74475 context.uploader = () => _uploader;
74476 context.preauth = (options2) => {
74478 _connection.switch(options2);
74482 context.locale = function(locale2) {
74483 if (!arguments.length)
74484 return _mainLocalizer.localeCode();
74485 _mainLocalizer.preferredLocaleCodes(locale2);
74488 function afterLoad(cid, callback) {
74489 return (err, result) => {
74491 if (err.status === 400 || err.status === 401 || err.status === 403) {
74493 _connection.logout();
74496 if (typeof callback === "function") {
74500 } else if (_connection && _connection.getConnectionId() !== cid) {
74501 if (typeof callback === "function") {
74502 callback({ message: "Connection Switched", status: -1 });
74506 _history.merge(result.data, result.extent);
74507 if (typeof callback === "function") {
74508 callback(err, result);
74514 context.loadTiles = (projection2, callback) => {
74515 const handle = window.requestIdleCallback(() => {
74516 _deferred2.delete(handle);
74517 if (_connection && context.editableDataEnabled()) {
74518 const cid = _connection.getConnectionId();
74519 _connection.loadTiles(projection2, afterLoad(cid, callback));
74522 _deferred2.add(handle);
74524 context.loadTileAtLoc = (loc, callback) => {
74525 const handle = window.requestIdleCallback(() => {
74526 _deferred2.delete(handle);
74527 if (_connection && context.editableDataEnabled()) {
74528 const cid = _connection.getConnectionId();
74529 _connection.loadTileAtLoc(loc, afterLoad(cid, callback));
74532 _deferred2.add(handle);
74534 context.loadEntity = (entityID, callback) => {
74536 const cid = _connection.getConnectionId();
74537 _connection.loadEntity(entityID, afterLoad(cid, callback));
74538 _connection.loadEntityRelations(entityID, afterLoad(cid, callback));
74541 context.zoomToEntity = (entityID, zoomTo) => {
74542 context.loadEntity(entityID, (err, result) => {
74545 if (zoomTo !== false) {
74546 const entity = result.data.find((e3) => e3.id === entityID);
74548 _map.zoomTo(entity);
74552 _map.on("drawn.zoomToEntity", () => {
74553 if (!context.hasEntity(entityID))
74555 _map.on("drawn.zoomToEntity", null);
74556 context.on("enter.zoomToEntity", null);
74557 context.enter(modeSelect(context, [entityID]));
74559 context.on("enter.zoomToEntity", () => {
74560 if (_mode.id !== "browse") {
74561 _map.on("drawn.zoomToEntity", null);
74562 context.on("enter.zoomToEntity", null);
74566 let _minEditableZoom = 16;
74567 context.minEditableZoom = function(val) {
74568 if (!arguments.length)
74569 return _minEditableZoom;
74570 _minEditableZoom = val;
74572 _connection.tileZoom(val);
74576 context.maxCharsForTagKey = () => 255;
74577 context.maxCharsForTagValue = () => 255;
74578 context.maxCharsForRelationRole = () => 255;
74579 context.cleanTagKey = (val) => utilCleanOsmString(val, context.maxCharsForTagKey());
74580 context.cleanTagValue = (val) => utilCleanOsmString(val, context.maxCharsForTagValue());
74581 context.cleanRelationRole = (val) => utilCleanOsmString(val, context.maxCharsForRelationRole());
74582 let _inIntro = false;
74583 context.inIntro = function(val) {
74584 if (!arguments.length)
74589 context.save = () => {
74590 if (_inIntro || context.container().select(".modal").size())
74593 if (_mode && _mode.id === "save") {
74595 if (services.osm && services.osm.isChangesetInflight()) {
74596 _history.clearSaved();
74600 canSave = context.selectedIDs().every((id2) => {
74601 const entity = context.hasEntity(id2);
74602 return entity && !entity.isDegenerate();
74608 if (_history.hasChanges()) {
74609 return _t("save.unsaved_changes");
74612 context.debouncedSave = debounce_default(context.save, 350);
74613 function withDebouncedSave(fn) {
74614 return function() {
74615 const result = fn.apply(_history, arguments);
74616 context.debouncedSave();
74620 context.hasEntity = (id2) => _history.graph().hasEntity(id2);
74621 context.entity = (id2) => _history.graph().entity(id2);
74623 context.mode = () => _mode;
74624 context.enter = (newMode) => {
74627 dispatch14.call("exit", this, _mode);
74631 dispatch14.call("enter", this, _mode);
74633 context.selectedIDs = () => _mode && _mode.selectedIDs && _mode.selectedIDs() || [];
74634 context.activeID = () => _mode && _mode.activeID && _mode.activeID();
74635 let _selectedNoteID;
74636 context.selectedNoteID = function(noteID) {
74637 if (!arguments.length)
74638 return _selectedNoteID;
74639 _selectedNoteID = noteID;
74642 let _selectedErrorID;
74643 context.selectedErrorID = function(errorID) {
74644 if (!arguments.length)
74645 return _selectedErrorID;
74646 _selectedErrorID = errorID;
74649 context.install = (behavior) => context.surface().call(behavior);
74650 context.uninstall = (behavior) => context.surface().call(behavior.off);
74652 context.copyGraph = () => _copyGraph;
74654 context.copyIDs = function(val) {
74655 if (!arguments.length)
74658 _copyGraph = _history.graph();
74662 context.copyLonLat = function(val) {
74663 if (!arguments.length)
74664 return _copyLonLat;
74669 context.background = () => _background;
74671 context.features = () => _features;
74672 context.hasHiddenConnections = (id2) => {
74673 const graph = _history.graph();
74674 const entity = graph.entity(id2);
74675 return _features.hasHiddenConnections(entity, graph);
74678 context.photos = () => _photos;
74680 context.map = () => _map;
74681 context.layers = () => _map.layers();
74682 context.surface = () => _map.surface;
74683 context.editableDataEnabled = () => _map.editableDataEnabled();
74684 context.surfaceRect = () => _map.surface.node().getBoundingClientRect();
74685 context.editable = () => {
74686 const mode = context.mode();
74687 if (!mode || mode.id === "save")
74689 return _map.editableDataEnabled();
74691 let _debugFlags = {
74695 // label collision bounding boxes
74697 // imagery bounding polygons
74701 // downloaded data from osm
74703 context.debugFlags = () => _debugFlags;
74704 context.getDebug = (flag) => flag && _debugFlags[flag];
74705 context.setDebug = function(flag, val) {
74706 if (arguments.length === 1)
74708 _debugFlags[flag] = val;
74709 dispatch14.call("change");
74712 let _container = select_default2(null);
74713 context.container = function(val) {
74714 if (!arguments.length)
74717 _container.classed("ideditor", true);
74720 context.containerNode = function(val) {
74721 if (!arguments.length)
74722 return context.container().node();
74723 context.container(select_default2(val));
74727 context.embed = function(val) {
74728 if (!arguments.length)
74733 let _assetPath = "";
74734 context.assetPath = function(val) {
74735 if (!arguments.length)
74738 _mainFileFetcher.assetPath(val);
74741 let _assetMap = {};
74742 context.assetMap = function(val) {
74743 if (!arguments.length)
74746 _mainFileFetcher.assetMap(val);
74749 context.asset = (val) => {
74750 if (/^http(s)?:\/\//i.test(val))
74752 const filename = _assetPath + val;
74753 return _assetMap[filename] || filename;
74755 context.imagePath = (val) => context.asset(`img/${val}`);
74756 context.reset = context.flush = () => {
74757 context.debouncedSave.cancel();
74758 Array.from(_deferred2).forEach((handle) => {
74759 window.cancelIdleCallback(handle);
74760 _deferred2.delete(handle);
74762 Object.values(services).forEach((service) => {
74763 if (service && typeof service.reset === "function") {
74764 service.reset(context);
74767 context.changeset = null;
74768 _validator.reset();
74772 context.container().select(".inspector-wrap *").remove();
74775 context.projection = geoRawMercator();
74776 context.curtainProjection = geoRawMercator();
74777 context.init = () => {
74778 instantiateInternal();
74779 initializeDependents();
74781 function instantiateInternal() {
74782 _history = coreHistory(context);
74783 context.graph = _history.graph;
74784 context.pauseChangeDispatch = _history.pauseChangeDispatch;
74785 context.resumeChangeDispatch = _history.resumeChangeDispatch;
74786 context.perform = withDebouncedSave(_history.perform);
74787 context.replace = withDebouncedSave(_history.replace);
74788 context.pop = withDebouncedSave(_history.pop);
74789 context.overwrite = withDebouncedSave(_history.overwrite);
74790 context.undo = withDebouncedSave(_history.undo);
74791 context.redo = withDebouncedSave(_history.redo);
74792 _validator = coreValidator(context);
74793 _uploader = coreUploader(context);
74794 _background = rendererBackground(context);
74795 _features = rendererFeatures(context);
74796 _map = rendererMap(context);
74797 _photos = rendererPhotos(context);
74798 _ui = uiInit(context);
74800 function initializeDependents() {
74801 if (context.initialHashParams.presets) {
74802 _mainPresetIndex.addablePresetIDs(new Set(context.initialHashParams.presets.split(",")));
74804 if (context.initialHashParams.locale) {
74805 _mainLocalizer.preferredLocaleCodes(context.initialHashParams.locale);
74807 _mainLocalizer.ensureLoaded();
74808 _mainPresetIndex.ensureLoaded();
74809 _background.ensureLoaded();
74810 Object.values(services).forEach((service) => {
74811 if (service && typeof service.init === "function") {
74818 if (services.maprules && context.initialHashParams.maprules) {
74819 json_default(context.initialHashParams.maprules).then((mapcss) => {
74820 services.maprules.init();
74821 mapcss.forEach((mapcssSelector) => services.maprules.addRule(mapcssSelector));
74825 if (!context.container().empty()) {
74826 _ui.ensureLoaded().then(() => {
74827 _background.init();
74836 // modules/services/nominatim.js
74837 var apibase = nominatimApiUrl;
74838 var _inflight = {};
74839 var _nominatimCache;
74840 var nominatim_default = {
74843 _nominatimCache = new import_rbush7.default();
74845 reset: function() {
74846 Object.values(_inflight).forEach(function(controller) {
74847 controller.abort();
74850 _nominatimCache = new import_rbush7.default();
74852 countryCode: function(location, callback) {
74853 this.reverse(location, function(err, result) {
74855 return callback(err);
74856 } else if (result.address) {
74857 return callback(null, result.address.country_code);
74859 return callback("Unable to geocode", null);
74863 reverse: function(loc, callback) {
74864 var cached = _nominatimCache.search(
74865 { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] }
74867 if (cached.length > 0) {
74869 callback(null, cached[0].data);
74872 var params = { zoom: 13, format: "json", addressdetails: 1, lat: loc[1], lon: loc[0] };
74873 var url = apibase + "reverse?" + utilQsString(params);
74874 if (_inflight[url])
74876 var controller = new AbortController();
74877 _inflight[url] = controller;
74878 json_default(url, {
74879 signal: controller.signal,
74881 "Accept-Language": _mainLocalizer.localeCodes().join(",")
74883 }).then(function(result) {
74884 delete _inflight[url];
74885 if (result && result.error) {
74886 throw new Error(result.error);
74888 var extent = geoExtent(loc).padByMeters(200);
74889 _nominatimCache.insert(Object.assign(extent.bbox(), { data: result }));
74891 callback(null, result);
74892 }).catch(function(err) {
74893 delete _inflight[url];
74894 if (err.name === "AbortError")
74897 callback(err.message);
74900 search: function(val, callback) {
74906 var url = apibase + "search?" + utilQsString(params);
74907 if (_inflight[url])
74909 var controller = new AbortController();
74910 _inflight[url] = controller;
74911 json_default(url, {
74912 signal: controller.signal,
74914 "Accept-Language": _mainLocalizer.localeCodes().join(",")
74916 }).then(function(result) {
74917 delete _inflight[url];
74918 if (result && result.error) {
74919 throw new Error(result.error);
74922 callback(null, result);
74923 }).catch(function(err) {
74924 delete _inflight[url];
74925 if (err.name === "AbortError")
74928 callback(err.message);
74933 // node_modules/name-suggestion-index/lib/matcher.js
74934 var import_which_polygon4 = __toESM(require_which_polygon(), 1);
74936 // node_modules/name-suggestion-index/lib/simplify.js
74937 var import_diacritics3 = __toESM(require_diacritics(), 1);
74938 function simplify2(str2) {
74939 if (typeof str2 !== "string")
74941 return import_diacritics3.default.remove(
74942 str2.replace(/&/g, "and").replace(/İ/ig, "i").replace(/[\s\-=_!"#%'*{},.\/:;?\(\)\[\]@\\$\^*+<>«»~`’\u00a1\u00a7\u00b6\u00b7\u00bf\u037e\u0387\u055a-\u055f\u0589\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0af0\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f14\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1360-\u1368\u166d\u166e\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u1805\u1807-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cc0-\u1cc7\u1cd3\u2000-\u206f\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e7f\u3001-\u3003\u303d\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uaaf0\uaaf1\uabeb\ufe10-\ufe16\ufe19\ufe30\ufe45\ufe46\ufe49-\ufe4c\ufe50-\ufe52\ufe54-\ufe57\ufe5f-\ufe61\ufe68\ufe6a\ufe6b\ufeff\uff01-\uff03\uff05-\uff07\uff0a\uff0c\uff0e\uff0f\uff1a\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65]+/g, "").toLowerCase()
74946 // node_modules/name-suggestion-index/config/matchGroups.json
74947 var matchGroups_default = {
74949 adult_gaming_centre: [
74951 "amenity/gambling",
74952 "leisure/adult_gaming_centre"
74956 "shop/hairdresser_supply"
74970 "tourism/camp_site",
74971 "tourism/caravan_site"
74982 "healthcare/clinic",
74983 "healthcare/laboratory",
74984 "healthcare/physiotherapist",
74985 "healthcare/sample_collection",
74986 "healthcare/dialysis"
74991 "shop/convenience",
74999 "amenity/coworking_space",
75000 "office/coworking",
75001 "office/coworking_space"
75006 "healthcare/dentist"
75009 "office/telecommunication",
75011 "shop/electronics",
75015 "shop/mobile_phone",
75016 "shop/telecommunication"
75020 "shop/haberdashery",
75024 "shop/accessories",
75028 "shop/department_store",
75030 "shop/fashion_accessories",
75036 "office/accountant",
75037 "office/financial",
75038 "office/financial_advisor",
75039 "office/tax_advisor",
75043 "leisure/fitness_centre",
75044 "leisure/fitness_center",
75045 "leisure/sports_centre",
75046 "leisure/sports_center"
75051 "amenity/fast_food",
75052 "amenity/ice_cream",
75054 "amenity/restaurant",
75059 "shop/confectionary",
75060 "shop/confectionery",
75070 "shop/convenience;gas",
75071 "shop/gas;convenience"
75081 "shop/bathroom_furnishing",
75084 "shop/doityourself",
75089 "shop/hardware_store",
75090 "shop/power_tools",
75097 "shop/health_food",
75099 "shop/nutrition_supplements"
75102 "shop/electronics",
75109 "shop/video_games",
75114 "amenity/hospital",
75115 "healthcare/hospital"
75119 "shop/interior_decoration"
75121 lifeboat_station: [
75122 "amenity/lifeboat_station",
75123 "emergency/lifeboat_station",
75124 "emergency/marine_rescue"
75131 "amenity/money_transfer",
75132 "shop/money_transfer"
75135 "shop/office_supplies",
75145 "amenity/parcel_locker",
75146 "amenity/vending_machine"
75150 "amenity/pharmacy",
75151 "healthcare/pharmacy"
75154 "amenity/theme_park",
75155 "leisure/amusement_arcade",
75156 "leisure/playground"
75159 "amenity/bicycle_rental",
75160 "amenity/boat_rental",
75161 "amenity/car_rental",
75162 "amenity/truck_rental",
75163 "amenity/vehicle_rental",
75168 "amenity/childcare",
75170 "amenity/kindergarten",
75171 "amenity/language_school",
75172 "amenity/prep_school",
75174 "amenity/university"
75177 "shop/storage_units",
75178 "shop/storage_rental"
75182 "power/substation",
75183 "power/sub_station"
75187 "shop/frozen_food",
75188 "shop/greengrocer",
75190 "shop/supermarket",
75194 "shop/variety_store",
75199 "amenity/vending_machine",
75201 "shop/vending_machine"
75206 "amenity/weight_clinic",
75207 "healthcare/counselling",
75208 "leisure/fitness_centre",
75209 "office/therapist",
75213 "shop/health_food",
75216 "shop/nutrition_supplements",
75221 "shop/supermarket",
75222 "shop/department_store"
75227 // node_modules/name-suggestion-index/config/genericWords.json
75228 var genericWords_default = {
75230 "^(barn|bazaa?r|bench|bou?tique|building|casa|church)$",
75231 "^(baseball|basketball|football|soccer|softball|tennis(halle)?)\\s?(field|court)?$",
75232 "^(club|green|out|ware)\\s?house$",
75233 "^(driveway|el \xE1rbol|fountain|generic|golf|government|graveyard)$",
75234 "^(fixme|n\\s?\\/?\\s?a|name|no\\s?name|none|null|temporary|test|unknown)$",
75235 "^(hofladen|librairie|magazine?|maison)$",
75236 "^(mobile home|skate)?\\s?park$",
75237 "^(obuwie|pond|pool|sale|shops?|sklep|stores?)$",
75240 "^tattoo( studio)?$",
75242 "^\u0446\u0435\u0440\u043A\u043E\u0432\u043D\u0430\u044F( \u043B\u0430\u0432\u043A\u0430)?$"
75246 // node_modules/name-suggestion-index/config/trees.json
75247 var trees_default = {
75250 emoji: "\u{1F354}",
75251 mainTag: "brand:wikidata",
75252 sourceTags: ["brand", "name"],
75254 primary: "^(name|name:\\w+)$",
75255 alternate: "^(brand|brand:\\w+|operator|operator:\\w+|\\w+_name|\\w+_name:\\w+)$"
75259 emoji: "\u{1F6A9}",
75260 mainTag: "flag:wikidata",
75262 primary: "^(flag:name|flag:name:\\w+)$",
75263 alternate: "^(country|country:\\w+|flag|flag:\\w+|subject|subject:\\w+)$"
75267 emoji: "\u{1F4BC}",
75268 mainTag: "operator:wikidata",
75269 sourceTags: ["operator"],
75271 primary: "^(name|name:\\w+|operator|operator:\\w+)$",
75272 alternate: "^(brand|brand:\\w+|\\w+_name|\\w+_name:\\w+)$"
75276 emoji: "\u{1F687}",
75277 mainTag: "network:wikidata",
75278 sourceTags: ["network"],
75280 primary: "^network$",
75281 alternate: "^(operator|operator:\\w+|network:\\w+|\\w+_name|\\w+_name:\\w+)$"
75287 // node_modules/name-suggestion-index/lib/matcher.js
75288 var matchGroups = matchGroups_default.matchGroups;
75289 var trees = trees_default.trees;
75290 var Matcher = class {
75293 // initialize the genericWords regexes
75295 this.matchIndex = void 0;
75296 this.genericWords = /* @__PURE__ */ new Map();
75297 (genericWords_default.genericWords || []).forEach((s2) => this.genericWords.set(s2, new RegExp(s2, "i")));
75298 this.itemLocation = void 0;
75299 this.locationSets = void 0;
75300 this.locationIndex = void 0;
75301 this.warnings = [];
75304 // `buildMatchIndex()`
75305 // Call this to prepare the matcher for use
75307 // `data` needs to be an Object indexed on a 'tree/key/value' path.
75308 // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
75310 // 'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
75311 // 'brands/amenity/bar': { properties: {}, items: [ {}, {}, … ] },
75315 buildMatchIndex(data) {
75317 if (that.matchIndex)
75319 that.matchIndex = /* @__PURE__ */ new Map();
75320 const seenTree = /* @__PURE__ */ new Map();
75321 Object.keys(data).forEach((tkv) => {
75322 const category = data[tkv];
75323 const parts = tkv.split("/", 3);
75324 const t2 = parts[0];
75325 const k2 = parts[1];
75326 const v2 = parts[2];
75327 const thiskv = `${k2}/${v2}`;
75328 const tree = trees[t2];
75329 let branch = that.matchIndex.get(thiskv);
75332 primary: /* @__PURE__ */ new Map(),
75333 alternate: /* @__PURE__ */ new Map(),
75334 excludeGeneric: /* @__PURE__ */ new Map(),
75335 excludeNamed: /* @__PURE__ */ new Map()
75337 that.matchIndex.set(thiskv, branch);
75339 const properties = category.properties || {};
75340 const exclude = properties.exclude || {};
75341 (exclude.generic || []).forEach((s2) => branch.excludeGeneric.set(s2, new RegExp(s2, "i")));
75342 (exclude.named || []).forEach((s2) => branch.excludeNamed.set(s2, new RegExp(s2, "i")));
75343 const excludeRegexes = [...branch.excludeGeneric.values(), ...branch.excludeNamed.values()];
75344 let items = category.items;
75345 if (!Array.isArray(items) || !items.length)
75347 const primaryName = new RegExp(tree.nameTags.primary, "i");
75348 const alternateName = new RegExp(tree.nameTags.alternate, "i");
75349 const notName = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
75350 const skipGenericKV = skipGenericKVMatches(t2, k2, v2);
75351 const genericKV = /* @__PURE__ */ new Set([`${k2}/yes`, `building/yes`]);
75352 const matchGroupKV = /* @__PURE__ */ new Set();
75353 Object.values(matchGroups).forEach((matchGroup) => {
75354 const inGroup = matchGroup.some((otherkv) => otherkv === thiskv);
75357 matchGroup.forEach((otherkv) => {
75358 if (otherkv === thiskv)
75360 matchGroupKV.add(otherkv);
75361 const otherk = otherkv.split("/", 2)[0];
75362 genericKV.add(`${otherk}/yes`);
75365 items.forEach((item) => {
75368 if (Array.isArray(item.matchTags) && item.matchTags.length) {
75369 item.matchTags = item.matchTags.filter((matchTag) => !matchGroupKV.has(matchTag) && !genericKV.has(matchTag));
75370 if (!item.matchTags.length)
75371 delete item.matchTags;
75373 let kvTags = [`${thiskv}`].concat(item.matchTags || []);
75374 if (!skipGenericKV) {
75375 kvTags = kvTags.concat(Array.from(genericKV));
75377 Object.keys(item.tags).forEach((osmkey) => {
75378 if (notName.test(osmkey))
75380 const osmvalue = item.tags[osmkey];
75381 if (!osmvalue || excludeRegexes.some((regex) => regex.test(osmvalue)))
75383 if (primaryName.test(osmkey)) {
75384 kvTags.forEach((kv) => insertName("primary", t2, kv, simplify2(osmvalue), item.id));
75385 } else if (alternateName.test(osmkey)) {
75386 kvTags.forEach((kv) => insertName("alternate", t2, kv, simplify2(osmvalue), item.id));
75389 let keepMatchNames = /* @__PURE__ */ new Set();
75390 (item.matchNames || []).forEach((matchName) => {
75391 const nsimple = simplify2(matchName);
75392 kvTags.forEach((kv) => {
75393 const branch2 = that.matchIndex.get(kv);
75394 const primaryLeaf = branch2 && branch2.primary.get(nsimple);
75395 const alternateLeaf = branch2 && branch2.alternate.get(nsimple);
75396 const inPrimary = primaryLeaf && primaryLeaf.has(item.id);
75397 const inAlternate = alternateLeaf && alternateLeaf.has(item.id);
75398 if (!inPrimary && !inAlternate) {
75399 insertName("alternate", t2, kv, nsimple, item.id);
75400 keepMatchNames.add(matchName);
75404 if (keepMatchNames.size) {
75405 item.matchNames = Array.from(keepMatchNames);
75407 delete item.matchNames;
75411 function insertName(which, t2, kv, nsimple, itemID) {
75413 that.warnings.push(`Warning: skipping empty ${which} name for item ${t2}/${kv}: ${itemID}`);
75416 let branch = that.matchIndex.get(kv);
75419 primary: /* @__PURE__ */ new Map(),
75420 alternate: /* @__PURE__ */ new Map(),
75421 excludeGeneric: /* @__PURE__ */ new Map(),
75422 excludeNamed: /* @__PURE__ */ new Map()
75424 that.matchIndex.set(kv, branch);
75426 let leaf = branch[which].get(nsimple);
75428 leaf = /* @__PURE__ */ new Set();
75429 branch[which].set(nsimple, leaf);
75432 if (!/yes$/.test(kv)) {
75433 const kvnsimple = `${kv}/${nsimple}`;
75434 const existing = seenTree.get(kvnsimple);
75435 if (existing && existing !== t2) {
75436 const items = Array.from(leaf);
75437 that.warnings.push(`Duplicate cache key "${kvnsimple}" in trees "${t2}" and "${existing}", check items: ${items}`);
75440 seenTree.set(kvnsimple, t2);
75443 function skipGenericKVMatches(t2, k2, v2) {
75444 return t2 === "flags" || t2 === "transit" || k2 === "landuse" || v2 === "atm" || v2 === "bicycle_parking" || v2 === "car_sharing" || v2 === "caravan_site" || v2 === "charging_station" || v2 === "dog_park" || v2 === "parking" || v2 === "phone" || v2 === "playground" || v2 === "post_box" || v2 === "public_bookcase" || v2 === "recycling" || v2 === "vending_machine";
75448 // `buildLocationIndex()`
75449 // Call this to prepare a which-polygon location index.
75450 // This *resolves* all the locationSets into GeoJSON, which takes some time.
75451 // You can skip this step if you don't care about matching within a location.
75453 // `data` needs to be an Object indexed on a 'tree/key/value' path.
75454 // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
75456 // 'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
75457 // 'brands/amenity/bar': { properties: {}, items: [ {}, {}, … ] },
75461 buildLocationIndex(data, loco) {
75463 if (that.locationIndex)
75465 that.itemLocation = /* @__PURE__ */ new Map();
75466 that.locationSets = /* @__PURE__ */ new Map();
75467 Object.keys(data).forEach((tkv) => {
75468 const items = data[tkv].items;
75469 if (!Array.isArray(items) || !items.length)
75471 items.forEach((item) => {
75472 if (that.itemLocation.has(item.id))
75476 resolved = loco.resolveLocationSet(item.locationSet);
75478 console.warn(`buildLocationIndex: ${err.message}`);
75480 if (!resolved || !resolved.id)
75482 that.itemLocation.set(item.id, resolved.id);
75483 if (that.locationSets.has(resolved.id))
75485 let feature3 = _cloneDeep2(resolved.feature);
75486 feature3.id = resolved.id;
75487 feature3.properties.id = resolved.id;
75488 if (!feature3.geometry.coordinates.length || !feature3.properties.area) {
75489 console.warn(`buildLocationIndex: locationSet ${resolved.id} for ${item.id} resolves to an empty feature:`);
75490 console.warn(JSON.stringify(feature3));
75493 that.locationSets.set(resolved.id, feature3);
75496 that.locationIndex = (0, import_which_polygon4.default)({ type: "FeatureCollection", features: [...that.locationSets.values()] });
75497 function _cloneDeep2(obj) {
75498 return JSON.parse(JSON.stringify(obj));
75503 // Pass parts and return an Array of matches.
75507 // `loc` - optional - [lon,lat] location to search
75509 // 1. If the [k,v,n] tuple matches a canonical item…
75510 // Return an Array of match results.
75511 // Each result will include the area in km² that the item is valid.
75513 // Order of results:
75514 // Primary ordering will be on the "match" column:
75515 // "primary" - where the query matches the `name` tag, followed by
75516 // "alternate" - where the query matches an alternate name tag (e.g. short_name, brand, operator, etc)
75517 // Secondary ordering will be on the "area" column:
75518 // "area descending" if no location was provided, (worldwide before local)
75519 // "area ascending" if location was provided (local before worldwide)
75522 // { match: 'primary', itemID: String, area: Number, kv: String, nsimple: String },
75523 // { match: 'primary', itemID: String, area: Number, kv: String, nsimple: String },
75524 // { match: 'alternate', itemID: String, area: Number, kv: String, nsimple: String },
75525 // { match: 'alternate', itemID: String, area: Number, kv: String, nsimple: String },
75531 // 2. If the [k,v,n] tuple matches an exclude pattern…
75532 // Return an Array with a single exclude result, either
75534 // [ { match: 'excludeGeneric', pattern: String, kv: String } ] // "generic" e.g. "Food Court"
75536 // [ { match: 'excludeNamed', pattern: String, kv: String } ] // "named", e.g. "Kebabai"
75539 // "generic" - a generic word that is probably not really a name.
75540 // For these, iD should warn the user "Hey don't put 'food court' in the name tag".
75541 // "named" - a real name like "Kebabai" that is just common, but not a brand.
75542 // For these, iD should just let it be. We don't include these in NSI, but we don't want to nag users about it either.
75546 // 3. If the [k,v,n] tuple matches nothing of any kind, return `null`
75549 match(k2, v2, n3, loc) {
75551 if (!that.matchIndex) {
75552 throw new Error("match: matchIndex not built.");
75554 let matchLocations;
75555 if (Array.isArray(loc) && that.locationIndex) {
75556 matchLocations = that.locationIndex([loc[0], loc[1], loc[0], loc[1]], true);
75558 const nsimple = simplify2(n3);
75559 let seen = /* @__PURE__ */ new Set();
75561 gatherResults("primary");
75562 gatherResults("alternate");
75563 if (results.length)
75565 gatherResults("exclude");
75566 return results.length ? results : null;
75567 function gatherResults(which) {
75568 const kv = `${k2}/${v2}`;
75569 let didMatch = tryMatch(which, kv);
75572 for (let mg in matchGroups) {
75573 const matchGroup = matchGroups[mg];
75574 const inGroup = matchGroup.some((otherkv) => otherkv === kv);
75577 for (let i3 = 0; i3 < matchGroup.length; i3++) {
75578 const otherkv = matchGroup[i3];
75579 if (otherkv === kv)
75581 didMatch = tryMatch(which, otherkv);
75586 if (which === "exclude") {
75587 const regex = [...that.genericWords.values()].find((regex2) => regex2.test(n3));
75589 results.push({ match: "excludeGeneric", pattern: String(regex) });
75594 function tryMatch(which, kv) {
75595 const branch = that.matchIndex.get(kv);
75598 if (which === "exclude") {
75599 let regex = [...branch.excludeNamed.values()].find((regex2) => regex2.test(n3));
75601 results.push({ match: "excludeNamed", pattern: String(regex), kv });
75604 regex = [...branch.excludeGeneric.values()].find((regex2) => regex2.test(n3));
75606 results.push({ match: "excludeGeneric", pattern: String(regex), kv });
75611 const leaf = branch[which].get(nsimple);
75612 if (!leaf || !leaf.size)
75614 let hits = Array.from(leaf).map((itemID) => {
75615 let area = Infinity;
75616 if (that.itemLocation && that.locationSets) {
75617 const location = that.locationSets.get(that.itemLocation.get(itemID));
75618 area = location && location.properties.area || Infinity;
75620 return { match: which, itemID, area, kv, nsimple };
75622 let sortFn = byAreaDescending;
75623 if (matchLocations) {
75624 hits = hits.filter(isValidLocation);
75625 sortFn = byAreaAscending;
75629 hits.sort(sortFn).forEach((hit) => {
75630 if (seen.has(hit.itemID))
75632 seen.add(hit.itemID);
75636 function isValidLocation(hit) {
75637 if (!that.itemLocation)
75639 return matchLocations.find((props) => props.id === that.itemLocation.get(hit.itemID));
75641 function byAreaAscending(hitA, hitB) {
75642 return hitA.area - hitB.area;
75644 function byAreaDescending(hitA, hitB) {
75645 return hitB.area - hitA.area;
75651 // Return any warnings discovered when buiding the index.
75652 // (currently this does nothing)
75655 return this.warnings;
75659 // modules/services/nsi.js
75660 var import_vparse2 = __toESM(require_vparse());
75661 var _nsiStatus = "loading";
75663 var buildingPreset = {
75664 "building/commercial": true,
75665 "building/government": true,
75666 "building/hotel": true,
75667 "building/retail": true,
75668 "building/office": true,
75669 "building/supermarket": true,
75670 "building/yes": true
75672 var notNames = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
75673 var notBranches = /(coop|express|wireless|factory|outlet)/i;
75674 function setNsiSources() {
75675 const nsiVersion = package_default.dependencies["name-suggestion-index"] || package_default.devDependencies["name-suggestion-index"];
75676 const v2 = (0, import_vparse2.default)(nsiVersion);
75677 const vMinor = `${v2.major}.${v2.minor}`;
75678 const cdn = nsiCdnUrl.replace("{version}", vMinor);
75680 "nsi_data": cdn + "dist/nsi.min.json",
75681 "nsi_dissolved": cdn + "dist/dissolved.min.json",
75682 "nsi_features": cdn + "dist/featureCollection.min.json",
75683 "nsi_generics": cdn + "dist/genericWords.min.json",
75684 "nsi_presets": cdn + "dist/presets/nsi-id-presets.min.json",
75685 "nsi_replacements": cdn + "dist/replacements.min.json",
75686 "nsi_trees": cdn + "dist/trees.min.json"
75688 let fileMap = _mainFileFetcher.fileMap();
75689 for (const k2 in sources) {
75691 fileMap[k2] = sources[k2];
75694 function loadNsiPresets() {
75695 return Promise.all([
75696 _mainFileFetcher.get("nsi_presets"),
75697 _mainFileFetcher.get("nsi_features")
75698 ]).then((vals) => {
75699 Object.values(vals[0].presets).forEach((preset) => preset.suggestion = true);
75700 _mainPresetIndex.merge({
75701 presets: vals[0].presets,
75702 featureCollection: vals[1]
75706 function loadNsiData() {
75707 return Promise.all([
75708 _mainFileFetcher.get("nsi_data"),
75709 _mainFileFetcher.get("nsi_dissolved"),
75710 _mainFileFetcher.get("nsi_replacements"),
75711 _mainFileFetcher.get("nsi_trees")
75712 ]).then((vals) => {
75715 // the raw name-suggestion-index data
75716 dissolved: vals[1].dissolved,
75717 // list of dissolved items
75718 replacements: vals[2].replacements,
75719 // trivial old->new qid replacements
75720 trees: vals[3].trees,
75721 // metadata about trees, main tags
75722 kvt: /* @__PURE__ */ new Map(),
75723 // Map (k -> Map (v -> t) )
75724 qids: /* @__PURE__ */ new Map(),
75725 // Map (wd/wp tag values -> qids)
75726 ids: /* @__PURE__ */ new Map()
75727 // Map (id -> NSI item)
75729 const matcher = _nsi.matcher = new Matcher();
75730 matcher.buildMatchIndex(_nsi.data);
75731 matcher.itemLocation = /* @__PURE__ */ new Map();
75732 matcher.locationSets = /* @__PURE__ */ new Map();
75733 Object.keys(_nsi.data).forEach((tkv) => {
75734 const items = _nsi.data[tkv].items;
75735 if (!Array.isArray(items) || !items.length)
75737 items.forEach((item) => {
75738 if (matcher.itemLocation.has(item.id))
75740 const locationSetID = _sharedLocationManager.locationSetID(item.locationSet);
75741 matcher.itemLocation.set(item.id, locationSetID);
75742 if (matcher.locationSets.has(locationSetID))
75744 const fakeFeature = { id: locationSetID, properties: { id: locationSetID, area: 1 } };
75745 matcher.locationSets.set(locationSetID, fakeFeature);
75748 matcher.locationIndex = (bbox2) => {
75749 const validHere = _sharedLocationManager.locationSetsAt([bbox2[0], bbox2[1]]);
75750 const results = [];
75751 for (const [locationSetID, area] of Object.entries(validHere)) {
75752 const fakeFeature = matcher.locationSets.get(locationSetID);
75754 fakeFeature.properties.area = area;
75755 results.push(fakeFeature);
75760 Object.keys(_nsi.data).forEach((tkv) => {
75761 const category = _nsi.data[tkv];
75762 const parts = tkv.split("/", 3);
75763 const t2 = parts[0];
75764 const k2 = parts[1];
75765 const v2 = parts[2];
75766 let vmap = _nsi.kvt.get(k2);
75768 vmap = /* @__PURE__ */ new Map();
75769 _nsi.kvt.set(k2, vmap);
75772 const tree = _nsi.trees[t2];
75773 const mainTag = tree.mainTag;
75774 const items = category.items || [];
75775 items.forEach((item) => {
75777 item.mainTag = mainTag;
75778 _nsi.ids.set(item.id, item);
75779 const wd = item.tags[mainTag];
75780 const wp = item.tags[mainTag.replace("wikidata", "wikipedia")];
75782 _nsi.qids.set(wd, wd);
75784 _nsi.qids.set(wp, wd);
75789 function gatherKVs(tags) {
75790 let primary = /* @__PURE__ */ new Set();
75791 let alternate = /* @__PURE__ */ new Set();
75792 Object.keys(tags).forEach((osmkey) => {
75793 const osmvalue = tags[osmkey];
75796 if (osmkey === "route_master")
75798 const vmap = _nsi.kvt.get(osmkey);
75801 if (vmap.get(osmvalue)) {
75802 primary.add(`${osmkey}/${osmvalue}`);
75803 } else if (osmvalue === "yes") {
75804 alternate.add(`${osmkey}/${osmvalue}`);
75807 const preset = _mainPresetIndex.matchTags(tags, "area");
75808 if (buildingPreset[preset.id]) {
75809 alternate.add("building/yes");
75811 return { primary, alternate };
75813 function identifyTree(tags) {
75816 Object.keys(tags).forEach((osmkey) => {
75819 const osmvalue = tags[osmkey];
75822 if (osmkey === "route_master")
75824 const vmap = _nsi.kvt.get(osmkey);
75827 if (osmvalue === "yes") {
75828 unknown = "unknown";
75830 t2 = vmap.get(osmvalue);
75833 return t2 || unknown || null;
75835 function gatherNames(tags) {
75836 const empty2 = { primary: /* @__PURE__ */ new Set(), alternate: /* @__PURE__ */ new Set() };
75837 let primary = /* @__PURE__ */ new Set();
75838 let alternate = /* @__PURE__ */ new Set();
75839 let foundSemi = false;
75840 let testNameFragments = false;
75842 let t2 = identifyTree(tags);
75845 if (t2 === "transit") {
75847 primary: /^network$/i,
75848 alternate: /^(operator|operator:\w+|network:\w+|\w+_name|\w+_name:\w+)$/i
75850 } else if (t2 === "flags") {
75852 primary: /^(flag:name|flag:name:\w+)$/i,
75853 alternate: /^(flag|flag:\w+|subject|subject:\w+)$/i
75854 // note: no `country`, we special-case it below
75856 } else if (t2 === "brands") {
75857 testNameFragments = true;
75859 primary: /^(name|name:\w+)$/i,
75860 alternate: /^(brand|brand:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
75862 } else if (t2 === "operators") {
75863 testNameFragments = true;
75865 primary: /^(name|name:\w+|operator|operator:\w+)$/i,
75866 alternate: /^(brand|brand:\w+|\w+_name|\w+_name:\w+)/i
75869 testNameFragments = true;
75871 primary: /^(name|name:\w+)$/i,
75872 alternate: /^(brand|brand:\w+|network|network:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
75875 if (tags.name && testNameFragments) {
75876 const nameParts = tags.name.split(/[\s\-\/,.]/);
75877 for (let split = nameParts.length; split > 0; split--) {
75878 const name = nameParts.slice(0, split).join(" ");
75882 Object.keys(tags).forEach((osmkey) => {
75883 const osmvalue = tags[osmkey];
75886 if (isNamelike(osmkey, "primary")) {
75887 if (/;/.test(osmvalue)) {
75890 primary.add(osmvalue);
75891 alternate.delete(osmvalue);
75893 } else if (!primary.has(osmvalue) && isNamelike(osmkey, "alternate")) {
75894 if (/;/.test(osmvalue)) {
75897 alternate.add(osmvalue);
75901 if (tags.man_made === "flagpole" && !primary.size && !alternate.size && !!tags.country) {
75902 const osmvalue = tags.country;
75903 if (/;/.test(osmvalue)) {
75906 alternate.add(osmvalue);
75912 return { primary, alternate };
75914 function isNamelike(osmkey, which) {
75915 if (osmkey === "old_name")
75917 return patterns2[which].test(osmkey) && !notNames.test(osmkey);
75920 function gatherTuples(tryKVs, tryNames) {
75922 ["primary", "alternate"].forEach((whichName) => {
75923 const arr = Array.from(tryNames[whichName]).sort((a2, b2) => b2.length - a2.length);
75924 arr.forEach((n3) => {
75925 ["primary", "alternate"].forEach((whichKV) => {
75926 tryKVs[whichKV].forEach((kv) => {
75927 const parts = kv.split("/", 2);
75928 const k2 = parts[0];
75929 const v2 = parts[1];
75930 tuples.push({ k: k2, v: v2, n: n3 });
75937 function _upgradeTags(tags, loc) {
75938 let newTags = Object.assign({}, tags);
75939 let changed = false;
75940 Object.keys(newTags).forEach((osmkey) => {
75941 const matchTag = osmkey.match(/^(\w+:)?wikidata$/);
75943 const prefix = matchTag[1] || "";
75944 const wd = newTags[osmkey];
75945 const replace = _nsi.replacements[wd];
75946 if (replace && replace.wikidata !== void 0) {
75948 if (replace.wikidata) {
75949 newTags[osmkey] = replace.wikidata;
75951 delete newTags[osmkey];
75954 if (replace && replace.wikipedia !== void 0) {
75956 const wpkey = `${prefix}wikipedia`;
75957 if (replace.wikipedia) {
75958 newTags[wpkey] = replace.wikipedia;
75960 delete newTags[wpkey];
75965 const isRouteMaster = tags.type === "route_master";
75966 const tryKVs = gatherKVs(tags);
75967 if (!tryKVs.primary.size && !tryKVs.alternate.size) {
75968 return changed ? { newTags, matched: null } : null;
75970 const tryNames = gatherNames(tags);
75971 const foundQID = _nsi.qids.get(tags.wikidata) || _nsi.qids.get(tags.wikipedia);
75973 tryNames.primary.add(foundQID);
75974 if (!tryNames.primary.size && !tryNames.alternate.size) {
75975 return changed ? { newTags, matched: null } : null;
75977 const tuples = gatherTuples(tryKVs, tryNames);
75978 for (let i3 = 0; i3 < tuples.length; i3++) {
75979 const tuple = tuples[i3];
75980 const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n, loc);
75981 if (!hits || !hits.length)
75983 if (hits[0].match !== "primary" && hits[0].match !== "alternate")
75986 for (let j3 = 0; j3 < hits.length; j3++) {
75987 const hit = hits[j3];
75988 itemID = hit.itemID;
75989 if (_nsi.dissolved[itemID])
75991 item = _nsi.ids.get(itemID);
75994 const mainTag = item.mainTag;
75995 const itemQID = item.tags[mainTag];
75996 const notQID = newTags[`not:${mainTag}`];
75998 // Exceptions, skip this hit
75999 !itemQID || itemQID === notQID || // No `*:wikidata` or matched a `not:*:wikidata`
76000 newTags.office && !item.tags.office
76010 item = JSON.parse(JSON.stringify(item));
76011 const tkv = item.tkv;
76012 const parts = tkv.split("/", 3);
76013 const k2 = parts[1];
76014 const v2 = parts[2];
76015 const category = _nsi.data[tkv];
76016 const properties = category.properties || {};
76017 let preserveTags = item.preserveTags || properties.preserveTags || [];
76018 ["building", "emergency", "internet_access", "takeaway"].forEach((osmkey) => {
76020 preserveTags.push(`^${osmkey}$`);
76022 const regexes = preserveTags.map((s2) => new RegExp(s2, "i"));
76024 Object.keys(newTags).forEach((osmkey) => {
76025 if (regexes.some((regex) => regex.test(osmkey))) {
76026 keepTags[osmkey] = newTags[osmkey];
76029 _nsi.kvt.forEach((vmap, k3) => {
76030 if (newTags[k3] === "yes")
76031 delete newTags[k3];
76034 delete newTags.wikipedia;
76035 delete newTags.wikidata;
76037 Object.assign(newTags, item.tags, keepTags);
76038 if (isRouteMaster) {
76039 newTags.route_master = newTags.route;
76040 delete newTags.route;
76042 const origName = tags.name;
76043 const newName = newTags.name;
76044 if (newName && origName && newName !== origName && !newTags.branch) {
76045 const newNames = gatherNames(newTags);
76046 const newSet = /* @__PURE__ */ new Set([...newNames.primary, ...newNames.alternate]);
76047 const isMoved = newSet.has(origName);
76049 const nameParts = origName.split(/[\s\-\/,.]/);
76050 for (let split = nameParts.length; split > 0; split--) {
76051 const name = nameParts.slice(0, split).join(" ");
76052 const branch = nameParts.slice(split).join(" ");
76053 const nameHits = _nsi.matcher.match(k2, v2, name, loc);
76054 if (!nameHits || !nameHits.length)
76056 if (nameHits.some((hit) => hit.itemID === itemID)) {
76058 if (notBranches.test(branch)) {
76059 newTags.name = origName;
76061 const branchHits = _nsi.matcher.match(k2, v2, branch, loc);
76062 if (branchHits && branchHits.length) {
76063 if (branchHits[0].match === "primary" || branchHits[0].match === "alternate") {
76067 newTags.branch = branch;
76076 return { newTags, matched: item };
76078 return changed ? { newTags, matched: null } : null;
76080 function _isGenericName(tags) {
76081 const n3 = tags.name;
76084 const tryNames = { primary: /* @__PURE__ */ new Set([n3]), alternate: /* @__PURE__ */ new Set() };
76085 const tryKVs = gatherKVs(tags);
76086 if (!tryKVs.primary.size && !tryKVs.alternate.size)
76088 const tuples = gatherTuples(tryKVs, tryNames);
76089 for (let i3 = 0; i3 < tuples.length; i3++) {
76090 const tuple = tuples[i3];
76091 const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n);
76092 if (hits && hits.length && hits[0].match === "excludeGeneric")
76097 var nsi_default = {
76099 // On init, start preparing the name-suggestion-index
76103 _mainPresetIndex.ensureLoaded().then(() => loadNsiPresets()).then(() => loadNsiData()).then(() => _nsiStatus = "ok").catch(() => _nsiStatus = "failed");
76106 // Reset is called when user saves data to OSM (does nothing here)
76111 // To let other code know how it's going...
76114 // `String`: 'loading', 'ok', 'failed'
76116 status: () => _nsiStatus,
76117 // `isGenericName()`
76118 // Is the `name` tag generic?
76121 // `tags`: `Object` containing the feature's OSM tags
76123 // `true` if it is generic, `false` if not
76125 isGenericName: (tags) => _isGenericName(tags),
76127 // Suggest tag upgrades.
76128 // This function will not modify the input tags, it makes a copy.
76131 // `tags`: `Object` containing the feature's OSM tags
76132 // `loc`: Location where this feature exists, as a [lon, lat]
76134 // `Object` containing the result, or `null` if no changes needed:
76136 // 'newTags': `Object` - The tags the the feature should have
76137 // 'matched': `Object` - The matched item
76140 upgradeTags: (tags, loc) => _upgradeTags(tags, loc),
76142 // Direct access to the NSI cache, useful for testing or breaking things
76145 // `Object`: the internal NSI cache
76150 // modules/services/kartaview.js
76151 var import_rbush8 = __toESM(require_rbush_min());
76152 var apibase2 = "https://kartaview.org";
76153 var maxResults = 1e3;
76155 var tiler4 = utilTiler().zoomExtent([tileZoom, tileZoom]).skipNullIsland(true);
76156 var dispatch7 = dispatch_default("loadedImages");
76157 var imgZoom2 = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
76159 var _oscSelectedImage;
76160 var _loadViewerPromise2;
76161 function abortRequest4(controller) {
76162 controller.abort();
76164 function maxPageAtZoom(z2) {
76178 function loadTiles2(which, url, projection2) {
76179 var currZoom = Math.floor(geoScaleToZoom(projection2.scale()));
76180 var tiles = tiler4.getTiles(projection2);
76181 var cache = _oscCache[which];
76182 Object.keys(cache.inflight).forEach(function(k2) {
76183 var wanted = tiles.find(function(tile) {
76184 return k2.indexOf(tile.id + ",") === 0;
76187 abortRequest4(cache.inflight[k2]);
76188 delete cache.inflight[k2];
76191 tiles.forEach(function(tile) {
76192 loadNextTilePage(which, currZoom, url, tile);
76195 function loadNextTilePage(which, currZoom, url, tile) {
76196 var cache = _oscCache[which];
76197 var bbox2 = tile.extent.bbox();
76198 var maxPages = maxPageAtZoom(currZoom);
76199 var nextPage = cache.nextPage[tile.id] || 1;
76200 var params = utilQsString({
76203 // client_id: clientId,
76204 bbTopLeft: [bbox2.maxY, bbox2.minX].join(","),
76205 bbBottomRight: [bbox2.minY, bbox2.maxX].join(",")
76207 if (nextPage > maxPages)
76209 var id2 = tile.id + "," + String(nextPage);
76210 if (cache.loaded[id2] || cache.inflight[id2])
76212 var controller = new AbortController();
76213 cache.inflight[id2] = controller;
76216 signal: controller.signal,
76218 headers: { "Content-Type": "application/x-www-form-urlencoded" }
76220 json_default(url, options2).then(function(data) {
76221 cache.loaded[id2] = true;
76222 delete cache.inflight[id2];
76223 if (!data || !data.currentPageItems || !data.currentPageItems.length) {
76224 throw new Error("No Data");
76226 var features = data.currentPageItems.map(function(item) {
76227 var loc = [+item.lng, +item.lat];
76229 if (which === "images") {
76234 captured_at: item.shot_date || item.date_added,
76235 captured_by: item.username,
76236 imagePath: item.lth_name,
76237 sequence_id: item.sequence_id,
76238 sequence_index: +item.sequence_index
76240 var seq = _oscCache.sequences[d2.sequence_id];
76242 seq = { rotation: 0, images: [] };
76243 _oscCache.sequences[d2.sequence_id] = seq;
76245 seq.images[d2.sequence_index] = d2;
76246 _oscCache.images.forImageKey[d2.key] = d2;
76256 cache.rtree.load(features);
76257 if (data.currentPageItems.length === maxResults) {
76258 cache.nextPage[tile.id] = nextPage + 1;
76259 loadNextTilePage(which, currZoom, url, tile);
76261 cache.nextPage[tile.id] = Infinity;
76263 if (which === "images") {
76264 dispatch7.call("loadedImages");
76266 }).catch(function() {
76267 cache.loaded[id2] = true;
76268 delete cache.inflight[id2];
76271 function partitionViewport2(projection2) {
76272 var z2 = geoScaleToZoom(projection2.scale());
76273 var z22 = Math.ceil(z2 * 2) / 2 + 2.5;
76274 var tiler9 = utilTiler().zoomExtent([z22, z22]);
76275 return tiler9.getTiles(projection2).map(function(tile) {
76276 return tile.extent;
76279 function searchLimited2(limit, projection2, rtree) {
76280 limit = limit || 5;
76281 return partitionViewport2(projection2).reduce(function(result, extent) {
76282 var found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
76285 return found.length ? result.concat(found) : result;
76288 var kartaview_default = {
76293 this.event = utilRebind(this, dispatch7, "on");
76295 reset: function() {
76297 Object.values(_oscCache.images.inflight).forEach(abortRequest4);
76300 images: { inflight: {}, loaded: {}, nextPage: {}, rtree: new import_rbush8.default(), forImageKey: {} },
76303 _oscSelectedImage = null;
76305 images: function(projection2) {
76307 return searchLimited2(limit, projection2, _oscCache.images.rtree);
76309 sequences: function(projection2) {
76310 var viewport = projection2.clipExtent();
76311 var min3 = [viewport[0][0], viewport[1][1]];
76312 var max3 = [viewport[1][0], viewport[0][1]];
76313 var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
76314 var sequenceKeys = {};
76315 _oscCache.images.rtree.search(bbox2).forEach(function(d2) {
76316 sequenceKeys[d2.data.sequence_id] = true;
76318 var lineStrings = [];
76319 Object.keys(sequenceKeys).forEach(function(sequenceKey) {
76320 var seq = _oscCache.sequences[sequenceKey];
76321 var images = seq && seq.images;
76324 type: "LineString",
76325 coordinates: images.map(function(d2) {
76327 }).filter(Boolean),
76329 captured_at: images[0] ? images[0].captured_at : null,
76330 captured_by: images[0] ? images[0].captured_by : null,
76336 return lineStrings;
76338 cachedImage: function(imageKey) {
76339 return _oscCache.images.forImageKey[imageKey];
76341 loadImages: function(projection2) {
76342 var url = apibase2 + "/1.0/list/nearby-photos/";
76343 loadTiles2("images", url, projection2);
76345 ensureViewerLoaded: function(context) {
76346 if (_loadViewerPromise2)
76347 return _loadViewerPromise2;
76348 var wrap2 = context.container().select(".photoviewer").selectAll(".kartaview-wrapper").data([0]);
76350 var wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper kartaview-wrapper").classed("hide", true).call(imgZoom2.on("zoom", zoomPan2)).on("dblclick.zoom", null);
76351 wrapEnter.append("div").attr("class", "photo-attribution fillD");
76352 var controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
76353 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
76354 controlsEnter.append("button").on("click.rotate-ccw", rotate(-90)).text("\u293F");
76355 controlsEnter.append("button").on("click.rotate-cw", rotate(90)).text("\u293E");
76356 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
76357 wrapEnter.append("div").attr("class", "kartaview-image-wrap");
76358 context.ui().photoviewer.on("resize.kartaview", function(dimensions) {
76359 imgZoom2.extent([[0, 0], dimensions]).translateExtent([[0, 0], dimensions]);
76361 function zoomPan2(d3_event) {
76362 var t2 = d3_event.transform;
76363 context.container().select(".photoviewer .kartaview-image-wrap").call(utilSetTransform, t2.x, t2.y, t2.k);
76365 function rotate(deg) {
76366 return function() {
76367 if (!_oscSelectedImage)
76369 var sequenceKey = _oscSelectedImage.sequence_id;
76370 var sequence = _oscCache.sequences[sequenceKey];
76373 var r2 = sequence.rotation || 0;
76379 sequence.rotation = r2;
76380 var wrap3 = context.container().select(".photoviewer .kartaview-wrapper");
76381 wrap3.transition().duration(100).call(imgZoom2.transform, identity2);
76382 wrap3.selectAll(".kartaview-image").transition().duration(100).style("transform", "rotate(" + r2 + "deg)");
76385 function step(stepBy) {
76386 return function() {
76387 if (!_oscSelectedImage)
76389 var sequenceKey = _oscSelectedImage.sequence_id;
76390 var sequence = _oscCache.sequences[sequenceKey];
76393 var nextIndex = _oscSelectedImage.sequence_index + stepBy;
76394 var nextImage = sequence.images[nextIndex];
76397 context.map().centerEase(nextImage.loc);
76398 that.selectImage(context, nextImage.key);
76401 _loadViewerPromise2 = Promise.resolve();
76402 return _loadViewerPromise2;
76404 showViewer: function(context) {
76405 var viewer = context.container().select(".photoviewer").classed("hide", false);
76406 var isHidden = viewer.selectAll(".photo-wrapper.kartaview-wrapper.hide").size();
76408 viewer.selectAll(".photo-wrapper:not(.kartaview-wrapper)").classed("hide", true);
76409 viewer.selectAll(".photo-wrapper.kartaview-wrapper").classed("hide", false);
76413 hideViewer: function(context) {
76414 _oscSelectedImage = null;
76415 this.updateUrlImage(null);
76416 var viewer = context.container().select(".photoviewer");
76417 if (!viewer.empty())
76418 viewer.datum(null);
76419 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
76420 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
76421 return this.setStyles(context, null, true);
76423 selectImage: function(context, imageKey) {
76424 var d2 = this.cachedImage(imageKey);
76425 _oscSelectedImage = d2;
76426 this.updateUrlImage(imageKey);
76427 var viewer = context.container().select(".photoviewer");
76428 if (!viewer.empty())
76430 this.setStyles(context, null, true);
76431 context.container().selectAll(".icon-sign").classed("currentView", false);
76434 var wrap2 = context.container().select(".photoviewer .kartaview-wrapper");
76435 var imageWrap = wrap2.selectAll(".kartaview-image-wrap");
76436 var attribution = wrap2.selectAll(".photo-attribution").text("");
76437 wrap2.transition().duration(100).call(imgZoom2.transform, identity2);
76438 imageWrap.selectAll(".kartaview-image").remove();
76440 var sequence = _oscCache.sequences[d2.sequence_id];
76441 var r2 = sequence && sequence.rotation || 0;
76442 imageWrap.append("img").attr("class", "kartaview-image").attr("src", apibase2 + "/" + d2.imagePath).style("transform", "rotate(" + r2 + "deg)");
76443 if (d2.captured_by) {
76444 attribution.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://kartaview.org/user/" + encodeURIComponent(d2.captured_by)).text("@" + d2.captured_by);
76445 attribution.append("span").text("|");
76447 if (d2.captured_at) {
76448 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.captured_at));
76449 attribution.append("span").text("|");
76451 attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", "https://kartaview.org/details/" + d2.sequence_id + "/" + d2.sequence_index).text("kartaview.org");
76454 function localeDateString2(s2) {
76457 var options2 = { day: "numeric", month: "short", year: "numeric" };
76458 var d4 = new Date(s2);
76459 if (isNaN(d4.getTime()))
76461 return d4.toLocaleDateString(_mainLocalizer.localeCode(), options2);
76464 getSelectedImage: function() {
76465 return _oscSelectedImage;
76467 getSequenceKeyForImage: function(d2) {
76468 return d2 && d2.sequence_id;
76470 // Updates the currently highlighted sequence and selected bubble.
76471 // Reset is only necessary when interacting with the viewport because
76472 // this implicitly changes the currently selected bubble/sequence
76473 setStyles: function(context, hovered, reset) {
76475 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
76476 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
76478 var hoveredImageKey = hovered && hovered.key;
76479 var hoveredSequenceKey = this.getSequenceKeyForImage(hovered);
76480 var hoveredSequence = hoveredSequenceKey && _oscCache.sequences[hoveredSequenceKey];
76481 var hoveredImageKeys = hoveredSequence && hoveredSequence.images.map(function(d2) {
76484 var viewer = context.container().select(".photoviewer");
76485 var selected = viewer.empty() ? void 0 : viewer.datum();
76486 var selectedImageKey = selected && selected.key;
76487 var selectedSequenceKey = this.getSequenceKeyForImage(selected);
76488 var selectedSequence = selectedSequenceKey && _oscCache.sequences[selectedSequenceKey];
76489 var selectedImageKeys = selectedSequence && selectedSequence.images.map(function(d2) {
76492 var highlightedImageKeys = utilArrayUnion(hoveredImageKeys, selectedImageKeys);
76493 context.container().selectAll(".layer-kartaview .viewfield-group").classed("highlighted", function(d2) {
76494 return highlightedImageKeys.indexOf(d2.key) !== -1;
76495 }).classed("hovered", function(d2) {
76496 return d2.key === hoveredImageKey;
76497 }).classed("currentView", function(d2) {
76498 return d2.key === selectedImageKey;
76500 context.container().selectAll(".layer-kartaview .sequence").classed("highlighted", function(d2) {
76501 return d2.properties.key === hoveredSequenceKey;
76502 }).classed("currentView", function(d2) {
76503 return d2.properties.key === selectedSequenceKey;
76505 context.container().selectAll(".layer-kartaview .viewfield-group .viewfield").attr("d", viewfieldPath);
76506 function viewfieldPath() {
76507 var d2 = this.parentNode.__data__;
76508 if (d2.pano && d2.key !== selectedImageKey) {
76509 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
76511 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
76516 updateUrlImage: function(imageKey) {
76517 if (!window.mocha) {
76518 var hash = utilStringQs(window.location.hash);
76520 hash.photo = "kartaview/" + imageKey;
76524 window.location.replace("#" + utilQsString(hash, true));
76527 cache: function() {
76532 // modules/services/vegbilder.js
76533 var import_rbush9 = __toESM(require_rbush_min());
76535 // modules/services/pannellum_photo.js
76536 var pannellumViewerCSS = "pannellum/pannellum.css";
76537 var pannellumViewerJS = "pannellum/pannellum.js";
76538 var dispatch8 = dispatch_default("viewerChanged");
76539 var _currScenes = [];
76540 var _pannellumViewer;
76541 var pannellum_photo_default = {
76542 init: async function(context, selection2) {
76543 selection2.append("div").attr("class", "photo-frame pannellum-frame").attr("id", "ideditor-pannellum-viewer").classed("hide", true);
76544 if (!window.pannellum) {
76545 await this.loadPannellum(context);
76548 "default": { firstScene: "" },
76551 _pannellumViewer = window.pannellum.viewer("ideditor-pannellum-viewer", options2);
76552 _pannellumViewer.on("mousedown", () => {
76553 select_default2(window).on("pointermove.pannellum mousemove.pannellum", () => {
76554 dispatch8.call("viewerChanged");
76556 }).on("mouseup", () => {
76557 select_default2(window).on("pointermove.pannellum mousemove.pannellum", null);
76558 }).on("animatefinished", () => {
76559 dispatch8.call("viewerChanged");
76561 context.ui().photoviewer.on("resize.pannellum", () => {
76562 _pannellumViewer.resize();
76564 this.event = utilRebind(this, dispatch8, "on");
76567 loadPannellum: function(context) {
76568 const head = select_default2("head");
76569 return Promise.all([
76570 new Promise((resolve, reject) => {
76571 head.selectAll("#ideditor-pannellum-viewercss").data([0]).enter().append("link").attr("id", "ideditor-pannellum-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(pannellumViewerCSS)).on("load.pannellum", resolve).on("error.pannellum", reject);
76573 new Promise((resolve, reject) => {
76574 head.selectAll("#ideditor-pannellum-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-pannellum-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(pannellumViewerJS)).on("load.pannellum", resolve).on("error.pannellum", reject);
76578 showPhotoFrame: function(context) {
76579 const isHidden = context.selectAll(".photo-frame.pannellum-frame.hide").size();
76581 context.selectAll(".photo-frame:not(.pannellum-frame)").classed("hide", true);
76582 context.selectAll(".photo-frame.pannellum-frame").classed("hide", false);
76586 hidePhotoFrame: function(viewerContext) {
76587 viewerContext.select("photo-frame.pannellum-frame").classed("hide", false);
76590 selectPhoto: function(data, keepOrientation) {
76591 const { key } = data;
76592 if (!(key in _currScenes)) {
76593 let newSceneOptions = {
76594 showFullscreenCtrl: false,
76598 type: "equirectangular",
76599 preview: data.preview_path,
76600 panorama: data.image_path,
76601 northOffset: data.ca
76603 _currScenes.push(key);
76604 _pannellumViewer.addScene(key, newSceneOptions);
76608 if (keepOrientation) {
76609 yaw = this.getYaw();
76610 pitch = _pannellumViewer.getPitch();
76612 _pannellumViewer.loadScene(key, pitch, yaw);
76613 dispatch8.call("viewerChanged");
76614 if (_currScenes.length > 3) {
76615 const old_key = _currScenes.shift();
76616 _pannellumViewer.removeScene(old_key);
76620 getYaw: function() {
76621 return _pannellumViewer.getYaw();
76625 // modules/services/vegbilder.js
76626 var owsEndpoint = "https://www.vegvesen.no/kart/ogc/vegbilder_1_0/ows?";
76627 var tileZoom2 = 14;
76628 var tiler5 = utilTiler().zoomExtent([tileZoom2, tileZoom2]).skipNullIsland(true);
76629 var dispatch9 = dispatch_default("loadedImages", "viewerChanged");
76630 var directionEnum = Object.freeze({
76631 forward: Symbol(0),
76632 backward: Symbol(1)
76635 var _pannellumFrame;
76637 var _loadViewerPromise3;
76638 var _vegbilderCache;
76639 async function fetchAvailableLayers() {
76642 request: "GetCapabilities",
76645 const urlForRequest = owsEndpoint + utilQsString(params);
76646 const response = await xml_default(urlForRequest);
76647 const xPathSelector = "/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType/wfs:Name";
76648 const regexMatcher = /^vegbilder_1_0:Vegbilder(?<image_type>_360)?_(?<year>\d{4})$/;
76649 const NSResolver = response.createNSResolver(response);
76650 const l2 = response.evaluate(
76654 XPathResult.ANY_TYPE
76657 const availableLayers = [];
76658 while ((node = l2.iterateNext()) !== null) {
76659 const match = node.textContent?.match(regexMatcher);
76661 availableLayers.push({
76663 is_sphere: !!match.groups?.image_type,
76664 year: parseInt(match.groups?.year, 10)
76668 return availableLayers;
76670 function filterAvailableLayers(photoContex) {
76671 const fromDateString = photoContex.fromDate();
76672 const toDateString = photoContex.toDate();
76673 const fromYear = fromDateString ? new Date(fromDateString).getFullYear() : 2016;
76674 const toYear = toDateString ? new Date(toDateString).getFullYear() : null;
76675 const showsFlat = photoContex.showsFlat();
76676 const showsPano = photoContex.showsPanoramic();
76677 return Array.from(_vegbilderCache.wfslayers.values()).filter(({ layerInfo }) => layerInfo.year >= fromYear && (!toYear || layerInfo.year <= toYear) && (!layerInfo.is_sphere && showsFlat || layerInfo.is_sphere && showsPano));
76679 function loadWFSLayers(projection2, margin, wfslayers) {
76680 const tiles = tiler5.margin(margin).getTiles(projection2);
76681 for (const cache of wfslayers) {
76682 loadWFSLayer(projection2, cache, tiles);
76685 function loadWFSLayer(projection2, cache, tiles) {
76686 for (const [key, controller] of cache.inflight.entries()) {
76687 const wanted = tiles.some((tile) => key === tile.id);
76689 controller.abort();
76690 cache.inflight.delete(key);
76693 Promise.all(tiles.map(
76694 (tile) => loadTile2(cache, cache.layerInfo.name, tile)
76695 )).then(() => orderSequences(projection2, cache));
76697 async function loadTile2(cache, typename, tile) {
76698 const bbox2 = tile.extent.bbox();
76699 const tileid = tile.id;
76700 if (cache.loaded.get(tileid) === true || cache.inflight.has(tileid))
76704 request: "GetFeature",
76706 typenames: typename,
76707 bbox: [bbox2.minY, bbox2.minX, bbox2.maxY, bbox2.maxX].join(","),
76708 outputFormat: "json"
76710 const controller = new AbortController();
76711 cache.inflight.set(tileid, controller);
76714 signal: controller.signal
76716 const urlForRequest = owsEndpoint + utilQsString(params);
76717 let featureCollection;
76719 featureCollection = await json_default(urlForRequest, options2);
76721 cache.loaded.set(tileid, false);
76724 cache.inflight.delete(tileid);
76726 cache.loaded.set(tileid, true);
76727 if (featureCollection.features.length === 0) {
76730 const features = featureCollection.features.map((feature3) => {
76731 const loc = feature3.geometry.coordinates;
76732 const key = feature3.id;
76733 const properties = feature3.properties;
76736 TIDSPUNKT: captured_at,
76738 URLPREVIEW: preview_path,
76739 BILDETYPE: image_type,
76741 FELTKODE: lane_code
76743 const lane_number = parseInt(lane_code.match(/^[0-9]+/)[0], 10);
76744 const direction = lane_number % 2 === 0 ? directionEnum.backward : directionEnum.forward;
76751 road_reference: roadReference(properties),
76755 captured_at: new Date(captured_at),
76756 is_sphere: image_type === "360"
76758 cache.points.set(key, data);
76767 _vegbilderCache.rtree.load(features);
76768 dispatch9.call("loadedImages");
76770 function orderSequences(projection2, cache) {
76771 const { points } = cache;
76772 const grouped = Array.from(points.values()).reduce((grouped2, image) => {
76773 const key = image.road_reference;
76774 if (grouped2.has(key)) {
76775 grouped2.get(key).push(image);
76777 grouped2.set(key, [image]);
76780 }, /* @__PURE__ */ new Map());
76781 const imageSequences = Array.from(grouped.values()).reduce((imageSequences2, imageGroup) => {
76782 imageGroup.sort((a2, b2) => {
76783 if (a2.captured_at.valueOf() > b2.captured_at.valueOf()) {
76785 } else if (a2.captured_at.valueOf() < b2.captured_at.valueOf()) {
76788 const { direction } = a2;
76789 if (direction === directionEnum.forward) {
76790 return a2.metering - b2.metering;
76792 return b2.metering - a2.metering;
76796 let imageSequence = [imageGroup[0]];
76798 for (const [lastImage, image] of pairs(imageGroup)) {
76799 if (lastImage.ca === null) {
76800 const b2 = projection2(lastImage.loc);
76801 const a2 = projection2(image.loc);
76802 if (!geoVecEqual(a2, b2)) {
76803 angle2 = geoVecAngle(a2, b2);
76804 angle2 *= 180 / Math.PI;
76806 angle2 = angle2 >= 0 ? angle2 : angle2 + 360;
76808 lastImage.ca = angle2;
76810 if (image.direction === lastImage.direction && image.captured_at.valueOf() - lastImage.captured_at.valueOf() <= 2e4) {
76811 imageSequence.push(image);
76813 imageSequences2.push(imageSequence);
76814 imageSequence = [image];
76817 imageSequences2.push(imageSequence);
76818 return imageSequences2;
76820 cache.sequences = imageSequences.map((images) => {
76823 key: images[0].key,
76825 type: "LineString",
76826 coordinates: images.map((image) => image.loc)
76829 for (const image of images) {
76830 _vegbilderCache.image2sequence_map.set(image.key, sequence);
76835 function roadReference(properties) {
76837 FYLKENUMMER: county_number,
76838 VEGKATEGORI: road_class,
76839 VEGSTATUS: road_status,
76840 VEGNUMMER: road_number,
76841 STREKNING: section,
76842 DELSTREKNING: subsection,
76844 KRYSSDEL: junction_part,
76845 SIDEANLEGGSDEL: services_part,
76846 ANKERPUNKT: anker_point,
76850 if (year >= 2020) {
76851 reference = `${road_class}${road_status}${road_number} S${section}D${subsection}`;
76852 if (junction_part) {
76853 reference = `${reference} M${anker_point} KD${junction_part}`;
76854 } else if (services_part) {
76855 reference = `${reference} M${anker_point} SD${services_part}`;
76858 reference = `${county_number}${road_class}${road_status}${road_number} HP${parcel}`;
76862 function localeTimestamp(date) {
76871 return date.toLocaleString(_mainLocalizer.localeCode(), options2);
76873 function partitionViewport3(projection2) {
76874 const zoom = geoScaleToZoom(projection2.scale());
76875 const roundZoom = Math.ceil(zoom * 2) / 2 + 2.5;
76876 const tiler9 = utilTiler().zoomExtent([roundZoom, roundZoom]);
76877 return tiler9.getTiles(projection2).map((tile) => tile.extent);
76879 function searchLimited3(limit, projection2, rtree) {
76881 return partitionViewport3(projection2).reduce((result, extent) => {
76882 const found = rtree.search(extent.bbox()).slice(0, limit).map((d2) => d2.data);
76883 return result.concat(found);
76886 var vegbilder_default = {
76888 this.event = utilRebind(this, dispatch9, "on");
76890 reset: async function() {
76891 if (_vegbilderCache) {
76892 for (const layer of _vegbilderCache.wfslayers.values()) {
76893 for (const controller of layer.inflight.values()) {
76894 controller.abort();
76898 _vegbilderCache = {
76899 wfslayers: /* @__PURE__ */ new Map(),
76900 rtree: new import_rbush9.default(),
76901 image2sequence_map: /* @__PURE__ */ new Map()
76903 const availableLayers = await fetchAvailableLayers();
76904 const { wfslayers } = _vegbilderCache;
76905 for (const layerInfo of availableLayers) {
76908 loaded: /* @__PURE__ */ new Map(),
76909 inflight: /* @__PURE__ */ new Map(),
76910 points: /* @__PURE__ */ new Map(),
76913 wfslayers.set(layerInfo.name, cache);
76916 images: function(projection2) {
76918 return searchLimited3(limit, projection2, _vegbilderCache.rtree);
76920 sequences: function(projection2) {
76921 const viewport = projection2.clipExtent();
76922 const min3 = [viewport[0][0], viewport[1][1]];
76923 const max3 = [viewport[1][0], viewport[0][1]];
76924 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
76925 const seen = /* @__PURE__ */ new Set();
76926 const line_strings = [];
76927 for (const { data } of _vegbilderCache.rtree.search(bbox2)) {
76928 const sequence = _vegbilderCache.image2sequence_map.get(data.key);
76931 const { key, geometry, images } = sequence;
76936 type: "LineString",
76937 coordinates: geometry.coordinates,
76941 line_strings.push(line);
76943 return line_strings;
76945 cachedImage: function(key) {
76946 for (const { points } of _vegbilderCache.wfslayers.values()) {
76947 if (points.has(key))
76948 return points.get(key);
76951 getSequenceForImage: function(image) {
76952 return _vegbilderCache?.image2sequence_map.get(image?.key);
76954 loadImages: async function(context, margin) {
76955 if (!_vegbilderCache) {
76956 await this.reset();
76959 const wfslayers = filterAvailableLayers(context.photos());
76960 loadWFSLayers(context.projection, margin, wfslayers);
76962 photoFrame: function() {
76963 return _currentFrame;
76965 ensureViewerLoaded: function(context) {
76966 if (_loadViewerPromise3)
76967 return _loadViewerPromise3;
76968 const step = (stepBy) => () => {
76969 const viewer = context.container().select(".photoviewer");
76970 const selected = viewer.empty() ? void 0 : viewer.datum();
76973 const sequence = this.getSequenceForImage(selected);
76974 const nextIndex = sequence.images.indexOf(selected) + stepBy;
76975 const nextImage = sequence.images[nextIndex];
76978 context.map().centerEase(nextImage.loc);
76979 this.selectImage(context, nextImage.key, true);
76981 const wrap2 = context.container().select(".photoviewer").selectAll(".vegbilder-wrapper").data([0]);
76982 const wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper vegbilder-wrapper").classed("hide", true);
76983 wrapEnter.append("div").attr("class", "photo-attribution fillD");
76984 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
76985 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
76986 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
76987 _loadViewerPromise3 = Promise.all([
76988 pannellum_photo_default.init(context, wrapEnter),
76989 plane_photo_default.init(context, wrapEnter)
76990 ]).then(([pannellumPhotoFrame, planePhotoFrame]) => {
76991 _pannellumFrame = pannellumPhotoFrame;
76992 _pannellumFrame.event.on("viewerChanged", () => dispatch9.call("viewerChanged"));
76993 _planeFrame = planePhotoFrame;
76994 _planeFrame.event.on("viewerChanged", () => dispatch9.call("viewerChanged"));
76996 return _loadViewerPromise3;
76998 selectImage: function(context, key, keepOrientation) {
76999 const d2 = this.cachedImage(key);
77000 this.updateUrlImage(key);
77001 const viewer = context.container().select(".photoviewer");
77002 if (!viewer.empty()) {
77005 this.setStyles(context, null, true);
77008 const wrap2 = context.container().select(".photoviewer .vegbilder-wrapper");
77009 const attribution = wrap2.selectAll(".photo-attribution").text("");
77010 if (d2.captured_at) {
77011 attribution.append("span").attr("class", "captured_at").text(localeTimestamp(d2.captured_at));
77013 attribution.append("a").attr("target", "_blank").attr("href", "https://vegvesen.no").call(_t.append("vegbilder.publisher"));
77014 attribution.append("a").attr("target", "_blank").attr("href", `https://vegbilder.atlas.vegvesen.no/?year=${d2.captured_at.getFullYear()}&lat=${d2.loc[1]}&lng=${d2.loc[0]}&view=image&imageId=${d2.key}`).call(_t.append("vegbilder.view_on"));
77015 _currentFrame = d2.is_sphere ? _pannellumFrame : _planeFrame;
77016 _currentFrame.selectPhoto(d2, keepOrientation).showPhotoFrame(wrap2);
77019 showViewer: function(context) {
77020 const viewer = context.container().select(".photoviewer").classed("hide", false);
77021 const isHidden = viewer.selectAll(".photo-wrapper.vegbilder-wrapper.hide").size();
77023 viewer.selectAll(".photo-wrapper:not(.vegbilder-wrapper)").classed("hide", true);
77024 viewer.selectAll(".photo-wrapper.vegbilder-wrapper").classed("hide", false);
77028 hideViewer: function(context) {
77029 this.updateUrlImage(null);
77030 const viewer = context.container().select(".photoviewer");
77031 if (!viewer.empty())
77032 viewer.datum(null);
77033 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
77034 context.container().selectAll(".viewfield-group, .sequence").classed("currentView", false);
77035 return this.setStyles(context, null, true);
77037 // Updates the currently highlighted sequence and selected bubble.
77038 // Reset is only necessary when interacting with the viewport because
77039 // this implicitly changes the currently selected bubble/sequence
77040 setStyles: function(context, hovered, reset) {
77042 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
77043 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
77045 const hoveredImageKey = hovered?.key;
77046 const hoveredSequence = this.getSequenceForImage(hovered);
77047 const hoveredSequenceKey = hoveredSequence?.key;
77048 const hoveredImageKeys = hoveredSequence?.images.map((d2) => d2.key) ?? [];
77049 const viewer = context.container().select(".photoviewer");
77050 const selected = viewer.empty() ? void 0 : viewer.datum();
77051 const selectedImageKey = selected?.key;
77052 const selectedSequence = this.getSequenceForImage(selected);
77053 const selectedSequenceKey = selectedSequence?.key;
77054 const selectedImageKeys = selectedSequence?.images.map((d2) => d2.key) ?? [];
77055 const highlightedImageKeys = utilArrayUnion(hoveredImageKeys, selectedImageKeys);
77056 context.container().selectAll(".layer-vegbilder .viewfield-group").classed("highlighted", (d2) => highlightedImageKeys.indexOf(d2.key) !== -1).classed("hovered", (d2) => d2.key === hoveredImageKey).classed("currentView", (d2) => d2.key === selectedImageKey);
77057 context.container().selectAll(".layer-vegbilder .sequence").classed("highlighted", (d2) => d2.key === hoveredSequenceKey).classed("currentView", (d2) => d2.key === selectedSequenceKey);
77058 context.container().selectAll(".layer-vegbilder .viewfield-group .viewfield").attr("d", viewfieldPath);
77059 function viewfieldPath() {
77060 const d2 = this.parentNode.__data__;
77061 if (d2.is_sphere && d2.key !== selectedImageKey) {
77062 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
77064 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
77069 updateUrlImage: function(key) {
77070 if (!window.mocha) {
77071 const hash = utilStringQs(window.location.hash);
77073 hash.photo = "vegbilder/" + key;
77077 window.location.replace("#" + utilQsString(hash, true));
77080 validHere: function(extent) {
77081 const bbox2 = Object.values(extent.bbox());
77082 return iso1A2Codes(bbox2).includes("NO");
77084 cache: function() {
77085 return _vegbilderCache;
77089 // node_modules/osm-auth/src/osm-auth.mjs
77090 var import_store = __toESM(require_store_legacy(), 1);
77091 function osmAuth(o2) {
77093 oauth2.authenticated = function() {
77094 return !!token("oauth2_access_token");
77096 oauth2.logout = function() {
77097 token("oauth2_access_token", "");
77098 token("oauth_token", "");
77099 token("oauth_token_secret", "");
77100 token("oauth_request_token_secret", "");
77103 oauth2.authenticate = function(callback) {
77104 if (oauth2.authenticated()) {
77105 callback(null, oauth2);
77109 _generatePkceChallenge(function(pkce) {
77110 _authenticate(pkce, callback);
77113 oauth2.authenticateAsync = function() {
77114 if (oauth2.authenticated()) {
77115 return Promise.resolve(oauth2);
77118 return new Promise((resolve, reject) => {
77119 var errback = (err, result) => {
77121 reject(new Error(err));
77126 _generatePkceChallenge((pkce) => _authenticate(pkce, errback));
77129 function _authenticate(pkce, callback) {
77130 var state = generateState();
77131 var url = o2.url + "/oauth2/authorize?" + utilQsString2({
77132 client_id: o2.client_id,
77133 redirect_uri: o2.redirect_uri,
77134 response_type: "code",
77137 code_challenge: pkce.code_challenge,
77138 code_challenge_method: pkce.code_challenge_method
77140 if (o2.singlepage) {
77141 if (!import_store.default.enabled) {
77142 var error = new Error("local storage unavailable, but require in singlepage mode");
77143 error.status = "pkce-localstorage-unavailable";
77147 var params = utilStringQs2(window.location.search.slice(1));
77149 oauth2.bootstrapToken(params.code, callback);
77151 token("oauth2_state", state);
77152 token("oauth2_pkce_code_verifier", pkce.code_verifier);
77153 window.location = url;
77161 ["left", window.screen.width / 2 - w2 / 2],
77162 ["top", window.screen.height / 2 - h2 / 2]
77163 ].map(function(x2) {
77164 return x2.join("=");
77166 var popup = window.open("about:blank", "oauth_window", settings);
77167 oauth2.popupWindow = popup;
77168 popup.location = url;
77170 error = new Error("Popup was blocked");
77171 error.status = "popup-blocked";
77175 window.authComplete = function(url2) {
77176 var params2 = utilStringQs2(url2.split("?")[1]);
77177 if (params2.state !== state) {
77178 error = new Error("Invalid state");
77179 error.status = "invalid-state";
77183 _getAccessToken(params2.code, pkce.code_verifier, accessTokenDone);
77184 delete window.authComplete;
77186 function accessTokenDone(err, xhr) {
77192 var access_token = JSON.parse(xhr.response);
77193 token("oauth2_access_token", access_token.access_token);
77194 callback(null, oauth2);
77197 function _getAccessToken(auth_code, code_verifier, accessTokenDone) {
77198 var url = o2.url + "/oauth2/token?" + utilQsString2({
77199 client_id: o2.client_id,
77200 redirect_uri: o2.redirect_uri,
77201 grant_type: "authorization_code",
77205 oauth2.rawxhr("POST", url, null, null, null, accessTokenDone);
77208 oauth2.bringPopupWindowToFront = function() {
77209 var broughtPopupToFront = false;
77211 if (oauth2.popupWindow && !oauth2.popupWindow.closed) {
77212 oauth2.popupWindow.focus();
77213 broughtPopupToFront = true;
77217 return broughtPopupToFront;
77219 oauth2.bootstrapToken = function(auth_code, callback) {
77220 var state = token("oauth2_state");
77221 token("oauth2_state", "");
77222 var params = utilStringQs2(window.location.search.slice(1));
77223 if (params.state !== state) {
77224 var error = new Error("Invalid state");
77225 error.status = "invalid-state";
77229 var code_verifier = token("oauth2_pkce_code_verifier");
77230 token("oauth2_pkce_code_verifier", "");
77231 _getAccessToken(auth_code, code_verifier, accessTokenDone);
77232 function accessTokenDone(err, xhr) {
77238 var access_token = JSON.parse(xhr.response);
77239 token("oauth2_access_token", access_token.access_token);
77240 callback(null, oauth2);
77243 oauth2.fetch = function(resource, options2) {
77244 if (oauth2.authenticated()) {
77248 return oauth2.authenticateAsync().then(_doFetch);
77250 return Promise.reject(new Error("not authenticated"));
77253 function _doFetch() {
77254 options2 = options2 || {};
77255 if (!options2.headers) {
77256 options2.headers = { "Content-Type": "application/x-www-form-urlencoded" };
77258 options2.headers.Authorization = "Bearer " + token("oauth2_access_token");
77259 return fetch(resource, options2);
77262 oauth2.xhr = function(options2, callback) {
77263 if (oauth2.authenticated()) {
77267 oauth2.authenticate(_doXHR);
77270 callback("not authenticated", null);
77274 function _doXHR() {
77275 var url = options2.prefix !== false ? o2.url + options2.path : options2.path;
77276 return oauth2.rawxhr(
77279 token("oauth2_access_token"),
77285 function done(err, xhr) {
77288 } else if (xhr.responseXML) {
77289 callback(err, xhr.responseXML);
77291 callback(err, xhr.response);
77295 oauth2.rawxhr = function(method, url, access_token, data, headers, callback) {
77296 headers = headers || { "Content-Type": "application/x-www-form-urlencoded" };
77297 if (access_token) {
77298 headers.Authorization = "Bearer " + access_token;
77300 var xhr = new XMLHttpRequest();
77301 xhr.onreadystatechange = function() {
77302 if (4 === xhr.readyState && 0 !== xhr.status) {
77303 if (/^20\d$/.test(xhr.status)) {
77304 callback(null, xhr);
77306 callback(xhr, null);
77310 xhr.onerror = function(e3) {
77311 callback(e3, null);
77313 xhr.open(method, url, true);
77314 for (var h2 in headers)
77315 xhr.setRequestHeader(h2, headers[h2]);
77319 oauth2.preauth = function(val) {
77320 if (val && val.access_token) {
77321 token("oauth2_access_token", val.access_token);
77325 oauth2.options = function(val) {
77326 if (!arguments.length)
77329 o2.url = o2.url || "https://www.openstreetmap.org";
77330 o2.auto = o2.auto || false;
77331 o2.singlepage = o2.singlepage || false;
77332 o2.loading = o2.loading || function() {
77334 o2.done = o2.done || function() {
77336 return oauth2.preauth(o2);
77339 if (import_store.default.enabled) {
77340 token = function(x2, y2) {
77341 if (arguments.length === 1)
77342 return import_store.default.get(o2.url + x2);
77343 else if (arguments.length === 2)
77344 return import_store.default.set(o2.url + x2, y2);
77348 token = function(x2, y2) {
77349 if (arguments.length === 1)
77350 return storage[o2.url + x2];
77351 else if (arguments.length === 2)
77352 return storage[o2.url + x2] = y2;
77355 oauth2.options(o2);
77358 function utilQsString2(obj) {
77359 return Object.keys(obj).filter(function(key) {
77360 return obj[key] !== void 0;
77361 }).sort().map(function(key) {
77362 return encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]);
77365 function utilStringQs2(str2) {
77367 while (i3 < str2.length && (str2[i3] === "?" || str2[i3] === "#"))
77369 str2 = str2.slice(i3);
77370 return str2.split("&").reduce(function(obj, pair3) {
77371 var parts = pair3.split("=");
77372 if (parts.length === 2) {
77373 obj[parts[0]] = decodeURIComponent(parts[1]);
77378 function supportsWebCryptoAPI() {
77379 return window && window.crypto && window.crypto.getRandomValues && window.crypto.subtle && window.crypto.subtle.digest;
77381 function _generatePkceChallenge(callback) {
77383 if (supportsWebCryptoAPI()) {
77384 var random = window.crypto.getRandomValues(new Uint8Array(32));
77385 code_verifier = base64(random.buffer);
77386 var verifier = Uint8Array.from(Array.from(code_verifier).map(function(char) {
77387 return char.charCodeAt(0);
77389 window.crypto.subtle.digest("SHA-256", verifier).then(function(hash) {
77390 var code_challenge = base64(hash);
77394 code_challenge_method: "S256"
77398 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
77399 code_verifier = "";
77400 for (var i3 = 0; i3 < 64; i3++) {
77401 code_verifier += chars[Math.floor(Math.random() * chars.length)];
77405 code_challenge: code_verifier,
77406 code_challenge_method: "plain"
77410 function generateState() {
77412 if (supportsWebCryptoAPI()) {
77413 var random = window.crypto.getRandomValues(new Uint8Array(32));
77414 state = base64(random.buffer);
77416 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
77418 for (var i3 = 0; i3 < 64; i3++) {
77419 state += chars[Math.floor(Math.random() * chars.length)];
77424 function base64(buffer) {
77425 return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/[=]/g, "");
77428 // modules/services/osm.js
77429 var import_rbush10 = __toESM(require_rbush_min());
77430 var tiler6 = utilTiler();
77431 var dispatch10 = dispatch_default("apiStatusChange", "authLoading", "authDone", "change", "loading", "loaded", "loadedNotes");
77432 var urlroot = osmApiConnections[0].url;
77433 var redirectPath = window.location.origin + window.location.pathname;
77434 var oauth = osmAuth({
77436 client_id: osmApiConnections[0].client_id,
77437 client_secret: osmApiConnections[0].client_secret,
77438 scope: "read_prefs write_prefs write_api read_gpx write_notes",
77439 redirect_uri: redirectPath + "land.html",
77440 loading: authLoading,
77443 var _apiConnections = osmApiConnections;
77444 var _imageryBlocklists = [/.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/];
77445 var _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new import_rbush10.default() };
77446 var _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new import_rbush10.default() };
77447 var _userCache = { toLoad: {}, user: {} };
77448 var _cachedApiStatus;
77449 var _changeset = {};
77450 var _deferred = /* @__PURE__ */ new Set();
77451 var _connectionID = 1;
77452 var _tileZoom4 = 16;
77453 var _noteZoom = 12;
77454 var _rateLimitError;
77455 var _userChangesets;
77458 var _maxWayNodes = 2e3;
77459 function authLoading() {
77460 dispatch10.call("authLoading");
77462 function authDone() {
77463 dispatch10.call("authDone");
77465 function abortRequest5(controllerOrXHR) {
77466 if (controllerOrXHR) {
77467 controllerOrXHR.abort();
77470 function hasInflightRequests(cache) {
77471 return Object.keys(cache.inflight).length;
77473 function abortUnwantedRequests4(cache, visibleTiles) {
77474 Object.keys(cache.inflight).forEach(function(k2) {
77475 if (cache.toLoad[k2])
77477 if (visibleTiles.find(function(tile) {
77478 return k2 === tile.id;
77481 abortRequest5(cache.inflight[k2]);
77482 delete cache.inflight[k2];
77485 function getLoc(attrs) {
77486 var lon = attrs.lon && attrs.lon.value;
77487 var lat = attrs.lat && attrs.lat.value;
77488 return [Number(lon), Number(lat)];
77490 function getNodes(obj) {
77491 var elems = obj.getElementsByTagName("nd");
77492 var nodes = new Array(elems.length);
77493 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77494 nodes[i3] = "n" + elems[i3].attributes.ref.value;
77498 function getNodesJSON(obj) {
77499 var elems = obj.nodes;
77500 var nodes = new Array(elems.length);
77501 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77502 nodes[i3] = "n" + elems[i3];
77506 function getTags(obj) {
77507 var elems = obj.getElementsByTagName("tag");
77509 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77510 var attrs = elems[i3].attributes;
77511 tags[attrs.k.value] = attrs.v.value;
77515 function getMembers(obj) {
77516 var elems = obj.getElementsByTagName("member");
77517 var members = new Array(elems.length);
77518 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77519 var attrs = elems[i3].attributes;
77521 id: attrs.type.value[0] + attrs.ref.value,
77522 type: attrs.type.value,
77523 role: attrs.role.value
77528 function getMembersJSON(obj) {
77529 var elems = obj.members;
77530 var members = new Array(elems.length);
77531 for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
77532 var attrs = elems[i3];
77534 id: attrs.type[0] + attrs.ref,
77541 function getVisible(attrs) {
77542 return !attrs.visible || attrs.visible.value !== "false";
77544 function parseComments(comments) {
77545 var parsedComments = [];
77546 for (var i3 = 0; i3 < comments.length; i3++) {
77547 var comment = comments[i3];
77548 if (comment.nodeName === "comment") {
77549 var childNodes = comment.childNodes;
77550 var parsedComment = {};
77551 for (var j3 = 0; j3 < childNodes.length; j3++) {
77552 var node = childNodes[j3];
77553 var nodeName = node.nodeName;
77554 if (nodeName === "#text")
77556 parsedComment[nodeName] = node.textContent;
77557 if (nodeName === "uid") {
77558 var uid = node.textContent;
77559 if (uid && !_userCache.user[uid]) {
77560 _userCache.toLoad[uid] = true;
77564 if (parsedComment) {
77565 parsedComments.push(parsedComment);
77569 return parsedComments;
77571 function encodeNoteRtree(note) {
77580 var jsonparsers = {
77581 node: function nodeData(obj, uid) {
77582 return new osmNode({
77584 visible: typeof obj.visible === "boolean" ? obj.visible : true,
77585 version: obj.version && obj.version.toString(),
77586 changeset: obj.changeset && obj.changeset.toString(),
77587 timestamp: obj.timestamp,
77589 uid: obj.uid && obj.uid.toString(),
77590 loc: [Number(obj.lon), Number(obj.lat)],
77594 way: function wayData(obj, uid) {
77595 return new osmWay({
77597 visible: typeof obj.visible === "boolean" ? obj.visible : true,
77598 version: obj.version && obj.version.toString(),
77599 changeset: obj.changeset && obj.changeset.toString(),
77600 timestamp: obj.timestamp,
77602 uid: obj.uid && obj.uid.toString(),
77604 nodes: getNodesJSON(obj)
77607 relation: function relationData(obj, uid) {
77608 return new osmRelation({
77610 visible: typeof obj.visible === "boolean" ? obj.visible : true,
77611 version: obj.version && obj.version.toString(),
77612 changeset: obj.changeset && obj.changeset.toString(),
77613 timestamp: obj.timestamp,
77615 uid: obj.uid && obj.uid.toString(),
77617 members: getMembersJSON(obj)
77620 user: function parseUser(obj, uid) {
77623 display_name: obj.display_name,
77624 account_created: obj.account_created,
77625 image_url: obj.img && obj.img.href,
77626 changesets_count: obj.changesets && obj.changesets.count && obj.changesets.count.toString() || "0",
77627 active_blocks: obj.blocks && obj.blocks.received && obj.blocks.received.active && obj.blocks.received.active.toString() || "0"
77631 function parseJSON(payload, callback, options2) {
77632 options2 = Object.assign({ skipSeen: true }, options2);
77634 return callback({ message: "No JSON", status: -1 });
77636 var json = payload;
77637 if (typeof json !== "object")
77638 json = JSON.parse(payload);
77639 if (!json.elements)
77640 return callback({ message: "No JSON", status: -1 });
77641 var children2 = json.elements;
77642 var handle = window.requestIdleCallback(function() {
77643 _deferred.delete(handle);
77646 for (var i3 = 0; i3 < children2.length; i3++) {
77647 result = parseChild(children2[i3]);
77649 results.push(result);
77651 callback(null, results);
77653 _deferred.add(handle);
77654 function parseChild(child) {
77655 var parser3 = jsonparsers[child.type];
77659 uid = osmEntity.id.fromOSM(child.type, child.id);
77660 if (options2.skipSeen) {
77661 if (_tileCache.seen[uid])
77663 _tileCache.seen[uid] = true;
77665 return parser3(child, uid);
77668 function parseUserJSON(payload, callback, options2) {
77669 options2 = Object.assign({ skipSeen: true }, options2);
77671 return callback({ message: "No JSON", status: -1 });
77673 var json = payload;
77674 if (typeof json !== "object")
77675 json = JSON.parse(payload);
77676 if (!json.users && !json.user)
77677 return callback({ message: "No JSON", status: -1 });
77678 var objs = json.users || [json];
77679 var handle = window.requestIdleCallback(function() {
77680 _deferred.delete(handle);
77683 for (var i3 = 0; i3 < objs.length; i3++) {
77684 result = parseObj(objs[i3]);
77686 results.push(result);
77688 callback(null, results);
77690 _deferred.add(handle);
77691 function parseObj(obj) {
77692 var uid = obj.user.id && obj.user.id.toString();
77693 if (options2.skipSeen && _userCache.user[uid]) {
77694 delete _userCache.toLoad[uid];
77697 var user = jsonparsers.user(obj.user, uid);
77698 _userCache.user[uid] = user;
77699 delete _userCache.toLoad[uid];
77704 node: function nodeData2(obj, uid) {
77705 var attrs = obj.attributes;
77706 return new osmNode({
77708 visible: getVisible(attrs),
77709 version: attrs.version.value,
77710 changeset: attrs.changeset && attrs.changeset.value,
77711 timestamp: attrs.timestamp && attrs.timestamp.value,
77712 user: attrs.user && attrs.user.value,
77713 uid: attrs.uid && attrs.uid.value,
77714 loc: getLoc(attrs),
77718 way: function wayData2(obj, uid) {
77719 var attrs = obj.attributes;
77720 return new osmWay({
77722 visible: getVisible(attrs),
77723 version: attrs.version.value,
77724 changeset: attrs.changeset && attrs.changeset.value,
77725 timestamp: attrs.timestamp && attrs.timestamp.value,
77726 user: attrs.user && attrs.user.value,
77727 uid: attrs.uid && attrs.uid.value,
77728 tags: getTags(obj),
77729 nodes: getNodes(obj)
77732 relation: function relationData2(obj, uid) {
77733 var attrs = obj.attributes;
77734 return new osmRelation({
77736 visible: getVisible(attrs),
77737 version: attrs.version.value,
77738 changeset: attrs.changeset && attrs.changeset.value,
77739 timestamp: attrs.timestamp && attrs.timestamp.value,
77740 user: attrs.user && attrs.user.value,
77741 uid: attrs.uid && attrs.uid.value,
77742 tags: getTags(obj),
77743 members: getMembers(obj)
77746 note: function parseNote(obj, uid) {
77747 var attrs = obj.attributes;
77748 var childNodes = obj.childNodes;
77751 props.loc = getLoc(attrs);
77752 var coincident = false;
77753 var epsilon3 = 1e-5;
77756 props.loc = geoVecAdd(props.loc, [epsilon3, epsilon3]);
77758 var bbox2 = geoExtent(props.loc).bbox();
77759 coincident = _noteCache.rtree.search(bbox2).length;
77760 } while (coincident);
77761 for (var i3 = 0; i3 < childNodes.length; i3++) {
77762 var node = childNodes[i3];
77763 var nodeName = node.nodeName;
77764 if (nodeName === "#text")
77766 if (nodeName === "comments") {
77767 props[nodeName] = parseComments(node.childNodes);
77769 props[nodeName] = node.textContent;
77772 var note = new osmNote(props);
77773 var item = encodeNoteRtree(note);
77774 _noteCache.note[note.id] = note;
77775 _noteCache.rtree.insert(item);
77778 user: function parseUser2(obj, uid) {
77779 var attrs = obj.attributes;
77782 display_name: attrs.display_name && attrs.display_name.value,
77783 account_created: attrs.account_created && attrs.account_created.value,
77784 changesets_count: "0",
77787 var img = obj.getElementsByTagName("img");
77788 if (img && img[0] && img[0].getAttribute("href")) {
77789 user.image_url = img[0].getAttribute("href");
77791 var changesets = obj.getElementsByTagName("changesets");
77792 if (changesets && changesets[0] && changesets[0].getAttribute("count")) {
77793 user.changesets_count = changesets[0].getAttribute("count");
77795 var blocks = obj.getElementsByTagName("blocks");
77796 if (blocks && blocks[0]) {
77797 var received = blocks[0].getElementsByTagName("received");
77798 if (received && received[0] && received[0].getAttribute("active")) {
77799 user.active_blocks = received[0].getAttribute("active");
77802 _userCache.user[uid] = user;
77803 delete _userCache.toLoad[uid];
77807 function parseXML(xml, callback, options2) {
77808 options2 = Object.assign({ skipSeen: true }, options2);
77809 if (!xml || !xml.childNodes) {
77810 return callback({ message: "No XML", status: -1 });
77812 var root3 = xml.childNodes[0];
77813 var children2 = root3.childNodes;
77814 var handle = window.requestIdleCallback(function() {
77815 _deferred.delete(handle);
77818 for (var i3 = 0; i3 < children2.length; i3++) {
77819 result = parseChild(children2[i3]);
77821 results.push(result);
77823 callback(null, results);
77825 _deferred.add(handle);
77826 function parseChild(child) {
77827 var parser3 = parsers[child.nodeName];
77831 if (child.nodeName === "user") {
77832 uid = child.attributes.id.value;
77833 if (options2.skipSeen && _userCache.user[uid]) {
77834 delete _userCache.toLoad[uid];
77837 } else if (child.nodeName === "note") {
77838 uid = child.getElementsByTagName("id")[0].textContent;
77840 uid = osmEntity.id.fromOSM(child.nodeName, child.attributes.id.value);
77841 if (options2.skipSeen) {
77842 if (_tileCache.seen[uid])
77844 _tileCache.seen[uid] = true;
77847 return parser3(child, uid);
77850 function updateRtree4(item, replace) {
77851 _noteCache.rtree.remove(item, function isEql(a2, b2) {
77852 return a2.data.id === b2.data.id;
77855 _noteCache.rtree.insert(item);
77858 function wrapcb(thisArg, callback, cid) {
77859 return function(err, result) {
77861 if (err.status === 400 || err.status === 401 || err.status === 403) {
77864 return callback.call(thisArg, err);
77865 } else if (thisArg.getConnectionId() !== cid) {
77866 return callback.call(thisArg, { message: "Connection Switched", status: -1 });
77868 return callback.call(thisArg, err, result);
77872 var osm_default = {
77874 utilRebind(this, dispatch10, "on");
77876 reset: function() {
77877 Array.from(_deferred).forEach(function(handle) {
77878 window.cancelIdleCallback(handle);
77879 _deferred.delete(handle);
77882 _userChangesets = void 0;
77883 _userDetails = void 0;
77884 _rateLimitError = void 0;
77885 Object.values(_tileCache.inflight).forEach(abortRequest5);
77886 Object.values(_noteCache.inflight).forEach(abortRequest5);
77887 Object.values(_noteCache.inflightPost).forEach(abortRequest5);
77888 if (_changeset.inflight)
77889 abortRequest5(_changeset.inflight);
77890 _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new import_rbush10.default() };
77891 _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new import_rbush10.default() };
77892 _userCache = { toLoad: {}, user: {} };
77893 _cachedApiStatus = void 0;
77897 getConnectionId: function() {
77898 return _connectionID;
77900 getUrlRoot: function() {
77903 changesetURL: function(changesetID) {
77904 return urlroot + "/changeset/" + changesetID;
77906 changesetsURL: function(center, zoom) {
77907 var precision2 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
77908 return urlroot + "/history#map=" + Math.floor(zoom) + "/" + center[1].toFixed(precision2) + "/" + center[0].toFixed(precision2);
77910 entityURL: function(entity) {
77911 return urlroot + "/" + entity.type + "/" + entity.osmId();
77913 historyURL: function(entity) {
77914 return urlroot + "/" + entity.type + "/" + entity.osmId() + "/history";
77916 userURL: function(username) {
77917 return urlroot + "/user/" + encodeURIComponent(username);
77919 noteURL: function(note) {
77920 return urlroot + "/note/" + note.id;
77922 noteReportURL: function(note) {
77923 return urlroot + "/reports/new?reportable_type=Note&reportable_id=" + note.id;
77925 // Generic method to load data from the OSM API
77926 // Can handle either auth or unauth calls.
77927 loadFromAPI: function(path, callback, options2) {
77928 options2 = Object.assign({ skipSeen: true }, options2);
77930 var cid = _connectionID;
77931 function done(err, payload) {
77932 if (that.getConnectionId() !== cid) {
77934 callback({ message: "Connection Switched", status: -1 });
77937 var isAuthenticated = that.authenticated();
77938 if (isAuthenticated && err && err.status && (err.status === 400 || err.status === 401 || err.status === 403)) {
77940 that.loadFromAPI(path, callback, options2);
77942 if (!isAuthenticated && !_rateLimitError && err && err.status && (err.status === 509 || err.status === 429)) {
77943 _rateLimitError = err;
77944 dispatch10.call("change");
77945 that.reloadApiStatus();
77946 } else if (err && _cachedApiStatus === "online" || !err && _cachedApiStatus !== "online") {
77947 that.reloadApiStatus();
77951 return callback(err);
77953 if (path.indexOf(".json") !== -1) {
77954 return parseJSON(payload, callback, options2);
77956 return parseXML(payload, callback, options2);
77962 if (this.authenticated()) {
77963 return oauth.xhr({ method: "GET", path }, done);
77965 var url = urlroot + path;
77966 var controller = new AbortController();
77968 if (path.indexOf(".json") !== -1) {
77973 fn(url, { signal: controller.signal }).then(function(data) {
77975 }).catch(function(err) {
77976 if (err.name === "AbortError")
77978 var match = err.message.match(/^\d{3}/);
77980 done({ status: +match[0], statusText: err.message });
77988 // Load a single entity by id (ways and relations use the `/full` call to include
77989 // nodes and members). Parent relations are not included, see `loadEntityRelations`.
77990 // GET /api/0.6/node/#id
77991 // GET /api/0.6/[way|relation]/#id/full
77992 loadEntity: function(id2, callback) {
77993 var type2 = osmEntity.id.type(id2);
77994 var osmID = osmEntity.id.toOSM(id2);
77995 var options2 = { skipSeen: false };
77997 "/api/0.6/" + type2 + "/" + osmID + (type2 !== "node" ? "/full" : "") + ".json",
77998 function(err, entities) {
78000 callback(err, { data: entities });
78005 // Load a single entity with a specific version
78006 // GET /api/0.6/[node|way|relation]/#id/#version
78007 loadEntityVersion: function(id2, version, callback) {
78008 var type2 = osmEntity.id.type(id2);
78009 var osmID = osmEntity.id.toOSM(id2);
78010 var options2 = { skipSeen: false };
78012 "/api/0.6/" + type2 + "/" + osmID + "/" + version + ".json",
78013 function(err, entities) {
78015 callback(err, { data: entities });
78020 // Load the relations of a single entity with the given.
78021 // GET /api/0.6/[node|way|relation]/#id/relations
78022 loadEntityRelations: function(id2, callback) {
78023 var type2 = osmEntity.id.type(id2);
78024 var osmID = osmEntity.id.toOSM(id2);
78025 var options2 = { skipSeen: false };
78027 "/api/0.6/" + type2 + "/" + osmID + "/relations.json",
78028 function(err, entities) {
78030 callback(err, { data: entities });
78035 // Load multiple entities in chunks
78036 // (note: callback may be called multiple times)
78037 // Unlike `loadEntity`, child nodes and members are not fetched
78038 // GET /api/0.6/[nodes|ways|relations]?#parameters
78039 loadMultiple: function(ids, callback) {
78041 var groups = utilArrayGroupBy(utilArrayUniq(ids), osmEntity.id.type);
78042 Object.keys(groups).forEach(function(k2) {
78043 var type2 = k2 + "s";
78044 var osmIDs = groups[k2].map(function(id2) {
78045 return osmEntity.id.toOSM(id2);
78047 var options2 = { skipSeen: false };
78048 utilArrayChunk(osmIDs, 150).forEach(function(arr) {
78050 "/api/0.6/" + type2 + ".json?" + type2 + "=" + arr.join(),
78051 function(err, entities) {
78053 callback(err, { data: entities });
78060 // Create, upload, and close a changeset
78061 // PUT /api/0.6/changeset/create
78062 // POST /api/0.6/changeset/#id/upload
78063 // PUT /api/0.6/changeset/#id/close
78064 putChangeset: function(changeset, changes, callback) {
78065 var cid = _connectionID;
78066 if (_changeset.inflight) {
78067 return callback({ message: "Changeset already inflight", status: -2 }, changeset);
78068 } else if (_changeset.open) {
78069 return createdChangeset.call(this, null, _changeset.open);
78073 path: "/api/0.6/changeset/create",
78074 headers: { "Content-Type": "text/xml" },
78075 content: JXON.stringify(changeset.asJXON())
78077 _changeset.inflight = oauth.xhr(
78079 wrapcb(this, createdChangeset, cid)
78082 function createdChangeset(err, changesetID) {
78083 _changeset.inflight = null;
78085 return callback(err, changeset);
78087 _changeset.open = changesetID;
78088 changeset = changeset.update({ id: changesetID });
78091 path: "/api/0.6/changeset/" + changesetID + "/upload",
78092 headers: { "Content-Type": "text/xml" },
78093 content: JXON.stringify(changeset.osmChangeJXON(changes))
78095 _changeset.inflight = oauth.xhr(
78097 wrapcb(this, uploadedChangeset, cid)
78100 function uploadedChangeset(err) {
78101 _changeset.inflight = null;
78103 return callback(err, changeset);
78104 window.setTimeout(function() {
78105 callback(null, changeset);
78107 _changeset.open = null;
78108 if (this.getConnectionId() === cid) {
78111 path: "/api/0.6/changeset/" + changeset.id + "/close",
78112 headers: { "Content-Type": "text/xml" }
78119 // Load multiple users in chunks
78120 // (note: callback may be called multiple times)
78121 // GET /api/0.6/users?users=#id1,#id2,...,#idn
78122 loadUsers: function(uids, callback) {
78125 utilArrayUniq(uids).forEach(function(uid) {
78126 if (_userCache.user[uid]) {
78127 delete _userCache.toLoad[uid];
78128 cached.push(_userCache.user[uid]);
78133 if (cached.length || !this.authenticated()) {
78134 callback(void 0, cached);
78135 if (!this.authenticated())
78138 utilArrayChunk(toLoad, 150).forEach(function(arr) {
78140 { method: "GET", path: "/api/0.6/users.json?users=" + arr.join() },
78141 wrapcb(this, done, _connectionID)
78144 function done(err, payload) {
78146 return callback(err);
78147 var options2 = { skipSeen: true };
78148 return parseUserJSON(payload, function(err2, results) {
78150 return callback(err2);
78151 return callback(void 0, results);
78155 // Load a given user by id
78156 // GET /api/0.6/user/#id
78157 loadUser: function(uid, callback) {
78158 if (_userCache.user[uid] || !this.authenticated()) {
78159 delete _userCache.toLoad[uid];
78160 return callback(void 0, _userCache.user[uid]);
78163 { method: "GET", path: "/api/0.6/user/" + uid + ".json" },
78164 wrapcb(this, done, _connectionID)
78166 function done(err, payload) {
78168 return callback(err);
78169 var options2 = { skipSeen: true };
78170 return parseUserJSON(payload, function(err2, results) {
78172 return callback(err2);
78173 return callback(void 0, results[0]);
78177 // Load the details of the logged-in user
78178 // GET /api/0.6/user/details
78179 userDetails: function(callback) {
78180 if (_userDetails) {
78181 return callback(void 0, _userDetails);
78184 { method: "GET", path: "/api/0.6/user/details.json" },
78185 wrapcb(this, done, _connectionID)
78187 function done(err, payload) {
78189 return callback(err);
78190 var options2 = { skipSeen: false };
78191 return parseUserJSON(payload, function(err2, results) {
78193 return callback(err2);
78194 _userDetails = results[0];
78195 return callback(void 0, _userDetails);
78199 // Load previous changesets for the logged in user
78200 // GET /api/0.6/changesets?user=#id
78201 userChangesets: function(callback) {
78202 if (_userChangesets) {
78203 return callback(void 0, _userChangesets);
78206 wrapcb(this, gotDetails, _connectionID)
78208 function gotDetails(err, user) {
78210 return callback(err);
78213 { method: "GET", path: "/api/0.6/changesets?user=" + user.id },
78214 wrapcb(this, done, _connectionID)
78217 function done(err, xml) {
78219 return callback(err);
78221 _userChangesets = Array.prototype.map.call(
78222 xml.getElementsByTagName("changeset"),
78223 function(changeset) {
78224 return { tags: getTags(changeset) };
78226 ).filter(function(changeset) {
78227 var comment = changeset.tags.comment;
78228 return comment && comment !== "";
78230 return callback(void 0, _userChangesets);
78233 // Fetch the status of the OSM API
78234 // GET /api/capabilities
78235 status: function(callback) {
78236 var url = urlroot + "/api/capabilities";
78237 var errback = wrapcb(this, done, _connectionID);
78238 xml_default(url).then(function(data) {
78239 errback(null, data);
78240 }).catch(function(err) {
78241 errback(err.message);
78243 function done(err, xml) {
78245 return callback(err, null);
78247 var elements = xml.getElementsByTagName("blacklist");
78249 for (var i3 = 0; i3 < elements.length; i3++) {
78250 var regexString = elements[i3].getAttribute("regex");
78253 var regex = new RegExp(regexString);
78254 regexes.push(regex);
78259 if (regexes.length) {
78260 _imageryBlocklists = regexes;
78262 if (_rateLimitError) {
78263 return callback(_rateLimitError, "rateLimited");
78265 var waynodes = xml.getElementsByTagName("waynodes");
78266 var maxWayNodes = waynodes.length && parseInt(waynodes[0].getAttribute("maximum"), 10);
78267 if (maxWayNodes && isFinite(maxWayNodes))
78268 _maxWayNodes = maxWayNodes;
78269 var apiStatus = xml.getElementsByTagName("status");
78270 var val = apiStatus[0].getAttribute("api");
78271 return callback(void 0, val);
78275 // Calls `status` and dispatches an `apiStatusChange` event if the returned
78276 // status differs from the cached status.
78277 reloadApiStatus: function() {
78278 if (!this.throttledReloadApiStatus) {
78280 this.throttledReloadApiStatus = throttle_default(function() {
78281 that.status(function(err, status) {
78282 if (status !== _cachedApiStatus) {
78283 _cachedApiStatus = status;
78284 dispatch10.call("apiStatusChange", that, err, status);
78289 this.throttledReloadApiStatus();
78291 // Returns the maximum number of nodes a single way can have
78292 maxWayNodes: function() {
78293 return _maxWayNodes;
78295 // Load data (entities) from the API in tiles
78296 // GET /api/0.6/map?bbox=
78297 loadTiles: function(projection2, callback) {
78300 var tiles = tiler6.zoomExtent([_tileZoom4, _tileZoom4]).getTiles(projection2);
78301 var hadRequests = hasInflightRequests(_tileCache);
78302 abortUnwantedRequests4(_tileCache, tiles);
78303 if (hadRequests && !hasInflightRequests(_tileCache)) {
78304 dispatch10.call("loaded");
78306 tiles.forEach(function(tile) {
78307 this.loadTile(tile, callback);
78310 // Load a single data tile
78311 // GET /api/0.6/map?bbox=
78312 loadTile: function(tile, callback) {
78315 if (_tileCache.loaded[tile.id] || _tileCache.inflight[tile.id])
78317 if (!hasInflightRequests(_tileCache)) {
78318 dispatch10.call("loading");
78320 var path = "/api/0.6/map.json?bbox=";
78321 var options2 = { skipSeen: true };
78322 _tileCache.inflight[tile.id] = this.loadFromAPI(
78323 path + tile.extent.toParam(),
78327 function tileCallback(err, parsed) {
78328 delete _tileCache.inflight[tile.id];
78330 delete _tileCache.toLoad[tile.id];
78331 _tileCache.loaded[tile.id] = true;
78332 var bbox2 = tile.extent.bbox();
78333 bbox2.id = tile.id;
78334 _tileCache.rtree.insert(bbox2);
78337 callback(err, Object.assign({ data: parsed }, tile));
78339 if (!hasInflightRequests(_tileCache)) {
78340 dispatch10.call("loaded");
78344 isDataLoaded: function(loc) {
78345 var bbox2 = { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] };
78346 return _tileCache.rtree.collides(bbox2);
78348 // load the tile that covers the given `loc`
78349 loadTileAtLoc: function(loc, callback) {
78350 if (Object.keys(_tileCache.toLoad).length > 50)
78352 var k2 = geoZoomToScale(_tileZoom4 + 1);
78353 var offset = geoRawMercator().scale(k2)(loc);
78354 var projection2 = geoRawMercator().transform({ k: k2, x: -offset[0], y: -offset[1] });
78355 var tiles = tiler6.zoomExtent([_tileZoom4, _tileZoom4]).getTiles(projection2);
78356 tiles.forEach(function(tile) {
78357 if (_tileCache.toLoad[tile.id] || _tileCache.loaded[tile.id] || _tileCache.inflight[tile.id])
78359 _tileCache.toLoad[tile.id] = true;
78360 this.loadTile(tile, callback);
78363 // Load notes from the API in tiles
78364 // GET /api/0.6/notes?bbox=
78365 loadNotes: function(projection2, noteOptions) {
78366 noteOptions = Object.assign({ limit: 1e4, closed: 7 }, noteOptions);
78370 var path = "/api/0.6/notes?limit=" + noteOptions.limit + "&closed=" + noteOptions.closed + "&bbox=";
78371 var throttleLoadUsers = throttle_default(function() {
78372 var uids = Object.keys(_userCache.toLoad);
78375 that.loadUsers(uids, function() {
78378 var tiles = tiler6.zoomExtent([_noteZoom, _noteZoom]).getTiles(projection2);
78379 abortUnwantedRequests4(_noteCache, tiles);
78380 tiles.forEach(function(tile) {
78381 if (_noteCache.loaded[tile.id] || _noteCache.inflight[tile.id])
78383 var options2 = { skipSeen: false };
78384 _noteCache.inflight[tile.id] = that.loadFromAPI(
78385 path + tile.extent.toParam(),
78387 delete _noteCache.inflight[tile.id];
78389 _noteCache.loaded[tile.id] = true;
78391 throttleLoadUsers();
78392 dispatch10.call("loadedNotes");
78399 // POST /api/0.6/notes?params
78400 postNoteCreate: function(note, callback) {
78401 if (!this.authenticated()) {
78402 return callback({ message: "Not Authenticated", status: -3 }, note);
78404 if (_noteCache.inflightPost[note.id]) {
78405 return callback({ message: "Note update already inflight", status: -2 }, note);
78407 if (!note.loc[0] || !note.loc[1] || !note.newComment)
78409 var comment = note.newComment;
78410 if (note.newCategory && note.newCategory !== "None") {
78411 comment += " #" + note.newCategory;
78413 var path = "/api/0.6/notes?" + utilQsString({ lon: note.loc[0], lat: note.loc[1], text: comment });
78414 _noteCache.inflightPost[note.id] = oauth.xhr(
78415 { method: "POST", path },
78416 wrapcb(this, done, _connectionID)
78418 function done(err, xml) {
78419 delete _noteCache.inflightPost[note.id];
78421 return callback(err);
78423 this.removeNote(note);
78424 var options2 = { skipSeen: false };
78425 return parseXML(xml, function(err2, results) {
78427 return callback(err2);
78429 return callback(void 0, results[0]);
78435 // POST /api/0.6/notes/#id/comment?text=comment
78436 // POST /api/0.6/notes/#id/close?text=comment
78437 // POST /api/0.6/notes/#id/reopen?text=comment
78438 postNoteUpdate: function(note, newStatus, callback) {
78439 if (!this.authenticated()) {
78440 return callback({ message: "Not Authenticated", status: -3 }, note);
78442 if (_noteCache.inflightPost[note.id]) {
78443 return callback({ message: "Note update already inflight", status: -2 }, note);
78446 if (note.status !== "closed" && newStatus === "closed") {
78448 } else if (note.status !== "open" && newStatus === "open") {
78451 action = "comment";
78452 if (!note.newComment)
78455 var path = "/api/0.6/notes/" + note.id + "/" + action;
78456 if (note.newComment) {
78457 path += "?" + utilQsString({ text: note.newComment });
78459 _noteCache.inflightPost[note.id] = oauth.xhr(
78460 { method: "POST", path },
78461 wrapcb(this, done, _connectionID)
78463 function done(err, xml) {
78464 delete _noteCache.inflightPost[note.id];
78466 return callback(err);
78468 this.removeNote(note);
78469 if (action === "close") {
78470 _noteCache.closed[note.id] = true;
78471 } else if (action === "reopen") {
78472 delete _noteCache.closed[note.id];
78474 var options2 = { skipSeen: false };
78475 return parseXML(xml, function(err2, results) {
78477 return callback(err2);
78479 return callback(void 0, results[0]);
78484 /* connection options for source switcher (optional) */
78485 apiConnections: function(val) {
78486 if (!arguments.length)
78487 return _apiConnections;
78488 _apiConnections = val;
78491 switch: function(newOptions) {
78492 urlroot = newOptions.url;
78493 var oldOptions = utilObjectOmit(oauth.options(), "access_token");
78494 oauth.options(Object.assign(oldOptions, newOptions));
78496 this.userChangesets(function() {
78498 dispatch10.call("change");
78501 toggle: function(val) {
78505 isChangesetInflight: function() {
78506 return !!_changeset.inflight;
78508 // get/set cached data
78509 // This is used to save/restore the state when entering/exiting the walkthrough
78510 // Also used for testing purposes.
78511 caches: function(obj) {
78512 function cloneCache(source) {
78514 Object.keys(source).forEach(function(k2) {
78515 if (k2 === "rtree") {
78516 target.rtree = new import_rbush10.default().fromJSON(source.rtree.toJSON());
78517 } else if (k2 === "note") {
78519 Object.keys(source.note).forEach(function(id2) {
78520 target.note[id2] = osmNote(source.note[id2]);
78523 target[k2] = JSON.parse(JSON.stringify(source[k2]));
78528 if (!arguments.length) {
78530 tile: cloneCache(_tileCache),
78531 note: cloneCache(_noteCache),
78532 user: cloneCache(_userCache)
78535 if (obj === "get") {
78543 _tileCache = obj.tile;
78544 _tileCache.inflight = {};
78547 _noteCache = obj.note;
78548 _noteCache.inflight = {};
78549 _noteCache.inflightPost = {};
78552 _userCache = obj.user;
78556 logout: function() {
78557 _userChangesets = void 0;
78558 _userDetails = void 0;
78560 dispatch10.call("change");
78563 authenticated: function() {
78564 return oauth.authenticated();
78566 authenticate: function(callback) {
78568 var cid = _connectionID;
78569 _userChangesets = void 0;
78570 _userDetails = void 0;
78571 function done(err, res) {
78577 if (that.getConnectionId() !== cid) {
78579 callback({ message: "Connection Switched", status: -1 });
78582 _rateLimitError = void 0;
78583 dispatch10.call("change");
78585 callback(err, res);
78586 that.userChangesets(function() {
78589 oauth.authenticate(done);
78591 imageryBlocklists: function() {
78592 return _imageryBlocklists;
78594 tileZoom: function(val) {
78595 if (!arguments.length)
78600 // get all cached notes covering the viewport
78601 notes: function(projection2) {
78602 var viewport = projection2.clipExtent();
78603 var min3 = [viewport[0][0], viewport[1][1]];
78604 var max3 = [viewport[1][0], viewport[0][1]];
78605 var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
78606 return _noteCache.rtree.search(bbox2).map(function(d2) {
78610 // get a single note from the cache
78611 getNote: function(id2) {
78612 return _noteCache.note[id2];
78614 // remove a single note from the cache
78615 removeNote: function(note) {
78616 if (!(note instanceof osmNote) || !note.id)
78618 delete _noteCache.note[note.id];
78619 updateRtree4(encodeNoteRtree(note), false);
78621 // replace a single note in the cache
78622 replaceNote: function(note) {
78623 if (!(note instanceof osmNote) || !note.id)
78625 _noteCache.note[note.id] = note;
78626 updateRtree4(encodeNoteRtree(note), true);
78629 // Get an array of note IDs closed during this session.
78630 // Used to populate `closed:note` changeset tag
78631 getClosedIDs: function() {
78632 return Object.keys(_noteCache.closed).sort();
78636 // modules/services/osm_wikibase.js
78637 var apibase3 = "https://wiki.openstreetmap.org/w/api.php";
78638 var _inflight2 = {};
78639 var _wikibaseCache = {};
78640 var _localeIDs = { en: false };
78641 var debouncedRequest = debounce_default(request, 500, { leading: false });
78642 function request(url, callback) {
78643 if (_inflight2[url])
78645 var controller = new AbortController();
78646 _inflight2[url] = controller;
78647 json_default(url, { signal: controller.signal }).then(function(result) {
78648 delete _inflight2[url];
78650 callback(null, result);
78651 }).catch(function(err) {
78652 delete _inflight2[url];
78653 if (err.name === "AbortError")
78656 callback(err.message);
78659 var osm_wikibase_default = {
78662 _wikibaseCache = {};
78665 reset: function() {
78666 Object.values(_inflight2).forEach(function(controller) {
78667 controller.abort();
78672 * Get the best value for the property, or undefined if not found
78673 * @param entity object from wikibase
78674 * @param property string e.g. 'P4' for image
78675 * @param langCode string e.g. 'fr' for French
78677 claimToValue: function(entity, property, langCode) {
78678 if (!entity.claims[property])
78680 var locale2 = _localeIDs[langCode];
78681 var preferredPick, localePick;
78682 entity.claims[property].forEach(function(stmt) {
78683 if (!preferredPick && stmt.rank === "preferred") {
78684 preferredPick = stmt;
78686 if (locale2 && stmt.qualifiers && stmt.qualifiers.P26 && stmt.qualifiers.P26[0].datavalue.value.id === locale2) {
78690 var result = localePick || preferredPick;
78692 var datavalue = result.mainsnak.datavalue;
78693 return datavalue.type === "wikibase-entityid" ? datavalue.value.id : datavalue.value;
78699 * Convert monolingual property into a key-value object (language -> value)
78700 * @param entity object from wikibase
78701 * @param property string e.g. 'P31' for monolingual wiki page title
78703 monolingualClaimToValueObj: function(entity, property) {
78704 if (!entity || !entity.claims[property])
78706 return entity.claims[property].reduce(function(acc, obj) {
78707 var value = obj.mainsnak.datavalue.value;
78708 acc[value.language] = value.text;
78712 toSitelink: function(key, value) {
78713 var result = value ? "Tag:" + key + "=" + value : "Key:" + key;
78714 return result.replace(/_/g, " ").trim();
78717 // Pass params object of the form:
78720 // value: 'string',
78721 // langCode: 'string'
78724 getEntity: function(params, callback) {
78725 var doRequest = params.debounce ? debouncedRequest : request;
78729 var rtypeSitelink = params.key === "type" && params.value ? ("Relation:" + params.value).replace(/_/g, " ").trim() : false;
78730 var keySitelink = params.key ? this.toSitelink(params.key) : false;
78731 var tagSitelink = params.key && params.value ? this.toSitelink(params.key, params.value) : false;
78732 var localeSitelink;
78733 if (params.langCodes) {
78734 params.langCodes.forEach(function(langCode) {
78735 if (_localeIDs[langCode] === void 0) {
78736 localeSitelink = ("Locale:" + langCode).replace(/_/g, " ").trim();
78737 titles.push(localeSitelink);
78741 if (rtypeSitelink) {
78742 if (_wikibaseCache[rtypeSitelink]) {
78743 result.rtype = _wikibaseCache[rtypeSitelink];
78745 titles.push(rtypeSitelink);
78749 if (_wikibaseCache[keySitelink]) {
78750 result.key = _wikibaseCache[keySitelink];
78752 titles.push(keySitelink);
78756 if (_wikibaseCache[tagSitelink]) {
78757 result.tag = _wikibaseCache[tagSitelink];
78759 titles.push(tagSitelink);
78762 if (!titles.length) {
78763 return callback(null, result);
78766 action: "wbgetentities",
78768 titles: titles.join("|"),
78769 languages: params.langCodes.join("|"),
78770 languagefallback: 1,
78773 // There is an MW Wikibase API bug https://phabricator.wikimedia.org/T212069
78774 // We shouldn't use v1 until it gets fixed, but should switch to it afterwards
78775 // formatversion: 2,
78777 var url = apibase3 + "?" + utilQsString(obj);
78778 doRequest(url, function(err, d2) {
78781 } else if (!d2.success || d2.error) {
78782 callback(d2.error.messages.map(function(v2) {
78783 return v2.html["*"];
78786 var localeID = false;
78787 Object.values(d2.entities).forEach(function(res) {
78788 if (res.missing !== "") {
78789 var title = res.sitelinks.wiki.title;
78790 if (title === rtypeSitelink) {
78791 _wikibaseCache[rtypeSitelink] = res;
78792 result.rtype = res;
78793 } else if (title === keySitelink) {
78794 _wikibaseCache[keySitelink] = res;
78796 } else if (title === tagSitelink) {
78797 _wikibaseCache[tagSitelink] = res;
78799 } else if (title === localeSitelink) {
78802 console.log("Unexpected title " + title);
78806 if (localeSitelink) {
78807 that.addLocale(params.langCodes[0], localeID);
78809 callback(null, result);
78814 // Pass params object of the form:
78816 // key: 'string', // required
78817 // value: 'string' // optional
78820 // Get an result object used to display tag documentation
78822 // title: 'string',
78823 // description: 'string',
78824 // editURL: 'string',
78825 // imageURL: 'string',
78826 // wiki: { title: 'string', text: 'string', url: 'string' }
78829 getDocs: function(params, callback) {
78831 var langCodes = _mainLocalizer.localeCodes().map(function(code) {
78832 return code.toLowerCase();
78834 params.langCodes = langCodes;
78835 this.getEntity(params, function(err, data) {
78840 var entity = data.rtype || data.tag || data.key;
78842 callback("No entity");
78847 for (i3 in langCodes) {
78848 let code2 = langCodes[i3];
78849 if (entity.descriptions[code2] && entity.descriptions[code2].language === code2) {
78850 description = entity.descriptions[code2];
78854 if (!description && Object.values(entity.descriptions).length)
78855 description = Object.values(entity.descriptions)[0];
78857 title: entity.title,
78858 description: description ? description.value : "",
78859 descriptionLocaleCode: description ? description.language : "",
78860 editURL: "https://wiki.openstreetmap.org/wiki/" + entity.title
78862 if (entity.claims) {
78864 var image = that.claimToValue(entity, "P4", langCodes[0]);
78866 imageroot = "https://commons.wikimedia.org/w/index.php";
78868 image = that.claimToValue(entity, "P28", langCodes[0]);
78870 imageroot = "https://wiki.openstreetmap.org/w/index.php";
78873 if (imageroot && image) {
78874 result.imageURL = imageroot + "?" + utilQsString({
78875 title: "Special:Redirect/file/" + image,
78880 var rtypeWiki = that.monolingualClaimToValueObj(data.rtype, "P31");
78881 var tagWiki = that.monolingualClaimToValueObj(data.tag, "P31");
78882 var keyWiki = that.monolingualClaimToValueObj(data.key, "P31");
78883 var wikis = [rtypeWiki, tagWiki, keyWiki];
78884 for (i3 in wikis) {
78885 var wiki = wikis[i3];
78886 for (var j3 in langCodes) {
78887 var code = langCodes[j3];
78888 var referenceId = langCodes[0].split("-")[0] !== "en" && code.split("-")[0] === "en" ? "inspector.wiki_en_reference" : "inspector.wiki_reference";
78889 var info = getWikiInfo(wiki, code, referenceId);
78891 result.wiki = info;
78898 callback(null, result);
78899 function getWikiInfo(wiki2, langCode, tKey) {
78900 if (wiki2 && wiki2[langCode]) {
78902 title: wiki2[langCode],
78904 url: "https://wiki.openstreetmap.org/wiki/" + wiki2[langCode]
78910 addLocale: function(langCode, qid) {
78911 _localeIDs[langCode] = qid;
78913 apibase: function(val) {
78914 if (!arguments.length)
78921 // modules/services/streetside.js
78922 var import_rbush11 = __toESM(require_rbush_min());
78924 // modules/util/jsonp_request.js
78925 var jsonpCache = {};
78926 window.jsonpCache = jsonpCache;
78927 function jsonpRequest(url, callback) {
78929 abort: function() {
78932 if (window.JSONP_FIX) {
78933 if (window.JSONP_DELAY === 0) {
78934 callback(window.JSONP_FIX);
78936 var t2 = window.setTimeout(function() {
78937 callback(window.JSONP_FIX);
78938 }, window.JSONP_DELAY || 0);
78939 request3.abort = function() {
78940 window.clearTimeout(t2);
78946 var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
78950 c2 += chars.charAt(Math.floor(Math.random() * 52));
78953 function create2(url2) {
78954 var e3 = url2.match(/callback=(\w+)/);
78955 var c2 = e3 ? e3[1] : rand();
78956 jsonpCache[c2] = function(data) {
78957 if (jsonpCache[c2]) {
78962 function finalize() {
78963 delete jsonpCache[c2];
78966 request3.abort = finalize;
78967 return "jsonpCache." + c2;
78969 var cb = create2(url);
78970 var script = select_default2("head").append("script").attr("type", "text/javascript").attr("src", url.replace(/(\{|%7B)callback(\}|%7D)/, cb));
78974 // modules/services/streetside.js
78975 var bubbleApi = "https://dev.virtualearth.net/mapcontrol/HumanScaleServices/GetBubbles.ashx?";
78976 var streetsideImagesApi = "https://t.ssl.ak.tiles.virtualearth.net/tiles/";
78977 var bubbleAppKey = "AuftgJsO0Xs8Ts4M1xZUQJQXJNsvmh3IV8DkNieCiy3tCwCUMq76-WpkrBtNAuEm";
78978 var pannellumViewerCSS2 = "pannellum/pannellum.css";
78979 var pannellumViewerJS2 = "pannellum/pannellum.js";
78980 var maxResults2 = 2e3;
78981 var tileZoom3 = 16.5;
78982 var tiler7 = utilTiler().zoomExtent([tileZoom3, tileZoom3]).skipNullIsland(true);
78983 var dispatch11 = dispatch_default("loadedImages", "viewerChanged");
78986 var defaultHfov = 45;
78987 var _hires = false;
78988 var _resolution = 512;
78989 var _currScene = 0;
78991 var _pannellumViewer2;
78992 var _sceneOptions = {
78993 showFullscreenCtrl: false,
79003 var _loadViewerPromise4;
79004 function abortRequest6(i3) {
79007 function localeTimestamp2(s2) {
79010 const options2 = { day: "numeric", month: "short", year: "numeric" };
79011 const d2 = new Date(s2);
79012 if (isNaN(d2.getTime()))
79014 return d2.toLocaleString(_mainLocalizer.localeCode(), options2);
79016 function loadTiles3(which, url, projection2, margin) {
79017 const tiles = tiler7.margin(margin).getTiles(projection2);
79018 const cache = _ssCache[which];
79019 Object.keys(cache.inflight).forEach((k2) => {
79020 const wanted = tiles.find((tile) => k2.indexOf(tile.id + ",") === 0);
79022 abortRequest6(cache.inflight[k2]);
79023 delete cache.inflight[k2];
79026 tiles.forEach((tile) => loadNextTilePage2(which, url, tile));
79028 function loadNextTilePage2(which, url, tile) {
79029 const cache = _ssCache[which];
79030 const nextPage = cache.nextPage[tile.id] || 0;
79031 const id2 = tile.id + "," + String(nextPage);
79032 if (cache.loaded[id2] || cache.inflight[id2])
79034 cache.inflight[id2] = getBubbles(url, tile, (bubbles) => {
79035 cache.loaded[id2] = true;
79036 delete cache.inflight[id2];
79040 const features = bubbles.map((bubble) => {
79041 if (cache.points[bubble.id])
79043 const loc = [bubble.lo, bubble.la];
79048 captured_at: bubble.cd,
79049 captured_by: "microsoft",
79050 // nbn: bubble.nbn,
79051 // pbn: bubble.pbn,
79061 cache.points[bubble.id] = d2;
79062 if (bubble.pr === void 0) {
79063 cache.leaders.push(bubble.id);
79072 }).filter(Boolean);
79073 cache.rtree.load(features);
79074 connectSequences();
79075 if (which === "bubbles") {
79076 dispatch11.call("loadedImages");
79080 function connectSequences() {
79081 let cache = _ssCache.bubbles;
79082 let keepLeaders = [];
79083 for (let i3 = 0; i3 < cache.leaders.length; i3++) {
79084 let bubble = cache.points[cache.leaders[i3]];
79086 let sequence = { key: bubble.key, bubbles: [] };
79087 let complete = false;
79089 sequence.bubbles.push(bubble);
79090 seen[bubble.key] = true;
79091 if (bubble.ne === void 0) {
79094 bubble = cache.points[bubble.ne];
79096 } while (bubble && !seen[bubble.key] && !complete);
79098 _ssCache.sequences[sequence.key] = sequence;
79099 for (let j3 = 0; j3 < sequence.bubbles.length; j3++) {
79100 sequence.bubbles[j3].sequenceKey = sequence.key;
79102 sequence.geojson = {
79103 type: "LineString",
79105 captured_at: sequence.bubbles[0] ? sequence.bubbles[0].captured_at : null,
79106 captured_by: sequence.bubbles[0] ? sequence.bubbles[0].captured_by : null,
79109 coordinates: sequence.bubbles.map((d2) => d2.loc)
79112 keepLeaders.push(cache.leaders[i3]);
79115 cache.leaders = keepLeaders;
79117 function getBubbles(url, tile, callback) {
79118 let rect = tile.extent.rectangle();
79119 let urlForRequest = url + utilQsString({
79125 appkey: bubbleAppKey,
79126 jsCallback: "{callback}"
79128 return jsonpRequest(urlForRequest, (data) => {
79129 if (!data || data.error) {
79136 function partitionViewport4(projection2) {
79137 let z2 = geoScaleToZoom(projection2.scale());
79138 let z22 = Math.ceil(z2 * 2) / 2 + 2.5;
79139 let tiler9 = utilTiler().zoomExtent([z22, z22]);
79140 return tiler9.getTiles(projection2).map((tile) => tile.extent);
79142 function searchLimited4(limit, projection2, rtree) {
79143 limit = limit || 5;
79144 return partitionViewport4(projection2).reduce((result, extent) => {
79145 let found = rtree.search(extent.bbox()).slice(0, limit).map((d2) => d2.data);
79146 return found.length ? result.concat(found) : result;
79149 function loadImage2(imgInfo) {
79150 return new Promise((resolve) => {
79151 let img = new Image();
79152 img.onload = () => {
79153 let canvas = document.getElementById("ideditor-canvas" + imgInfo.face);
79154 let ctx = canvas.getContext("2d");
79155 ctx.drawImage(img, imgInfo.x, imgInfo.y);
79156 resolve({ imgInfo, status: "ok" });
79158 img.onerror = () => {
79159 resolve({ data: imgInfo, status: "error" });
79161 img.setAttribute("crossorigin", "");
79162 img.src = imgInfo.url;
79165 function loadCanvas(imageGroup) {
79166 return Promise.all(imageGroup.map(loadImage2)).then((data) => {
79167 let canvas = document.getElementById("ideditor-canvas" + data[0].imgInfo.face);
79168 const which = { "01": 0, "02": 1, "03": 2, "10": 3, "11": 4, "12": 5 };
79169 let face = data[0].imgInfo.face;
79170 _sceneOptions.cubeMap[which[face]] = canvas.toDataURL("image/jpeg", 1);
79171 return { status: "loadCanvas for face " + data[0].imgInfo.face + "ok" };
79174 function loadFaces(faceGroup) {
79175 return Promise.all(faceGroup.map(loadCanvas)).then(() => {
79176 return { status: "loadFaces done" };
79179 function setupCanvas(selection2, reset) {
79181 selection2.selectAll("#ideditor-stitcher-canvases").remove();
79183 selection2.selectAll("#ideditor-stitcher-canvases").data([0]).enter().append("div").attr("id", "ideditor-stitcher-canvases").attr("display", "none").selectAll("canvas").data(["canvas01", "canvas02", "canvas03", "canvas10", "canvas11", "canvas12"]).enter().append("canvas").attr("id", (d2) => "ideditor-" + d2).attr("width", _resolution).attr("height", _resolution);
79185 function qkToXY(qk) {
79189 for (let i3 = qk.length; i3 > 0; i3--) {
79190 const key = qk[i3 - 1];
79191 x2 += +(key === "1" || key === "3") * scale;
79192 y2 += +(key === "2" || key === "3") * scale;
79197 function getQuadKeys() {
79198 let dim = _resolution / 256;
79459 } else if (dim === 8) {
79526 } else if (dim === 4) {
79555 var streetside_default = {
79557 * init() initialize streetside.
79563 this.event = utilRebind(this, dispatch11, "on");
79566 * reset() reset the cache.
79568 reset: function() {
79570 Object.values(_ssCache.bubbles.inflight).forEach(abortRequest6);
79573 bubbles: { inflight: {}, loaded: {}, nextPage: {}, rtree: new import_rbush11.default(), points: {}, leaders: [] },
79580 bubbles: function(projection2) {
79582 return searchLimited4(limit, projection2, _ssCache.bubbles.rtree);
79584 cachedImage: function(imageKey) {
79585 return _ssCache.bubbles.points[imageKey];
79587 sequences: function(projection2) {
79588 const viewport = projection2.clipExtent();
79589 const min3 = [viewport[0][0], viewport[1][1]];
79590 const max3 = [viewport[1][0], viewport[0][1]];
79591 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
79594 _ssCache.bubbles.rtree.search(bbox2).forEach((d2) => {
79595 const key = d2.data.sequenceKey;
79596 if (key && !seen[key]) {
79598 results.push(_ssCache.sequences[key].geojson);
79606 loadBubbles: function(projection2, margin) {
79607 if (margin === void 0)
79609 loadTiles3("bubbles", bubbleApi, projection2, margin);
79611 viewer: function() {
79612 return _pannellumViewer2;
79614 initViewer: function() {
79615 if (!window.pannellum)
79617 if (_pannellumViewer2)
79620 const sceneID = _currScene.toString();
79622 "default": { firstScene: sceneID },
79625 options2.scenes[sceneID] = _sceneOptions;
79626 _pannellumViewer2 = window.pannellum.viewer("ideditor-viewer-streetside", options2);
79628 ensureViewerLoaded: function(context) {
79629 if (_loadViewerPromise4)
79630 return _loadViewerPromise4;
79631 let wrap2 = context.container().select(".photoviewer").selectAll(".ms-wrapper").data([0]);
79632 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper ms-wrapper").classed("hide", true);
79634 let pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
79635 wrapEnter.append("div").attr("id", "ideditor-viewer-streetside").on(pointerPrefix + "down.streetside", () => {
79636 select_default2(window).on(pointerPrefix + "move.streetside", () => {
79637 dispatch11.call("viewerChanged");
79639 }).on(pointerPrefix + "up.streetside pointercancel.streetside", () => {
79640 select_default2(window).on(pointerPrefix + "move.streetside", null);
79641 let t2 = timer((elapsed) => {
79642 dispatch11.call("viewerChanged");
79643 if (elapsed > 2e3) {
79647 }).append("div").attr("class", "photo-attribution fillD");
79648 let controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
79649 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
79650 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
79651 wrap2 = wrap2.merge(wrapEnter).call(setupCanvas, true);
79652 context.ui().photoviewer.on("resize.streetside", () => {
79653 if (_pannellumViewer2) {
79654 _pannellumViewer2.resize();
79657 _loadViewerPromise4 = new Promise((resolve, reject) => {
79658 let loadedCount = 0;
79659 function loaded() {
79661 if (loadedCount === 2)
79664 const head = select_default2("head");
79665 head.selectAll("#ideditor-streetside-viewercss").data([0]).enter().append("link").attr("id", "ideditor-streetside-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(pannellumViewerCSS2)).on("load.serviceStreetside", loaded).on("error.serviceStreetside", function() {
79668 head.selectAll("#ideditor-streetside-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-streetside-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(pannellumViewerJS2)).on("load.serviceStreetside", loaded).on("error.serviceStreetside", function() {
79671 }).catch(function() {
79672 _loadViewerPromise4 = null;
79674 return _loadViewerPromise4;
79675 function step(stepBy) {
79677 let viewer = context.container().select(".photoviewer");
79678 let selected = viewer.empty() ? void 0 : viewer.datum();
79681 let nextID = stepBy === 1 ? selected.ne : selected.pr;
79682 let yaw = _pannellumViewer2.getYaw();
79683 let ca = selected.ca + yaw;
79684 let origin = selected.loc;
79687 origin[0] + geoMetersToLon(meters / 5, origin[1]),
79691 origin[0] + geoMetersToLon(meters / 2, origin[1]),
79692 origin[1] + geoMetersToLat(meters)
79695 origin[0] - geoMetersToLon(meters / 2, origin[1]),
79696 origin[1] + geoMetersToLat(meters)
79699 origin[0] - geoMetersToLon(meters / 5, origin[1]),
79702 let poly = [p1, p2, p3, p4, p1];
79703 let angle2 = (stepBy === 1 ? ca : ca + 180) * (Math.PI / 180);
79704 poly = geoRotate(poly, -angle2, origin);
79705 let extent = poly.reduce((extent2, point2) => {
79706 return extent2.extend(geoExtent(point2));
79708 let minDist = Infinity;
79709 _ssCache.bubbles.rtree.search(extent.bbox()).forEach((d2) => {
79710 if (d2.data.key === selected.key)
79712 if (!geoPointInPolygon(d2.data.loc, poly))
79714 let dist = geoVecLength(d2.data.loc, selected.loc);
79715 let theta = selected.ca - d2.data.ca;
79716 let minTheta = Math.min(Math.abs(theta), 360 - Math.abs(theta));
79717 if (minTheta > 20) {
79720 if (dist < minDist) {
79721 nextID = d2.data.key;
79725 let nextBubble = nextID && that.cachedImage(nextID);
79728 context.map().centerEase(nextBubble.loc);
79729 that.selectImage(context, nextBubble.key).yaw(yaw).showViewer(context);
79733 yaw: function(yaw) {
79734 if (typeof yaw !== "number")
79736 _sceneOptions.yaw = yaw;
79742 showViewer: function(context) {
79743 let wrap2 = context.container().select(".photoviewer").classed("hide", false);
79744 let isHidden = wrap2.selectAll(".photo-wrapper.ms-wrapper.hide").size();
79746 wrap2.selectAll(".photo-wrapper:not(.ms-wrapper)").classed("hide", true);
79747 wrap2.selectAll(".photo-wrapper.ms-wrapper").classed("hide", false);
79754 hideViewer: function(context) {
79755 let viewer = context.container().select(".photoviewer");
79756 if (!viewer.empty())
79757 viewer.datum(null);
79758 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
79759 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
79760 this.updateUrlImage(null);
79761 return this.setStyles(context, null, true);
79766 selectImage: function(context, key) {
79768 let d2 = this.cachedImage(key);
79769 let viewer = context.container().select(".photoviewer");
79770 if (!viewer.empty())
79772 this.setStyles(context, null, true);
79773 let wrap2 = context.container().select(".photoviewer .ms-wrapper");
79774 let attribution = wrap2.selectAll(".photo-attribution").html("");
79775 wrap2.selectAll(".pnlm-load-box").style("display", "block");
79778 this.updateUrlImage(key);
79779 _sceneOptions.northOffset = d2.ca;
79780 let line1 = attribution.append("div").attr("class", "attribution-row");
79781 const hiresDomId = utilUniqueDomId("streetside-hires");
79782 let label = line1.append("label").attr("for", hiresDomId).attr("class", "streetside-hires");
79783 label.append("input").attr("type", "checkbox").attr("id", hiresDomId).property("checked", _hires).on("click", (d3_event) => {
79784 d3_event.stopPropagation();
79786 _resolution = _hires ? 1024 : 512;
79787 wrap2.call(setupCanvas, true);
79789 yaw: _pannellumViewer2.getYaw(),
79790 pitch: _pannellumViewer2.getPitch(),
79791 hfov: _pannellumViewer2.getHfov()
79793 _sceneOptions = Object.assign(_sceneOptions, viewstate);
79794 that.selectImage(context, d2.key).showViewer(context);
79796 label.append("span").call(_t.append("streetside.hires"));
79797 let captureInfo = line1.append("div").attr("class", "attribution-capture-info");
79798 if (d2.captured_by) {
79799 const yyyy = (/* @__PURE__ */ new Date()).getFullYear();
79800 captureInfo.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://www.microsoft.com/en-us/maps/streetside").text("\xA9" + yyyy + " Microsoft");
79801 captureInfo.append("span").text("|");
79803 if (d2.captured_at) {
79804 captureInfo.append("span").attr("class", "captured_at").text(localeTimestamp2(d2.captured_at));
79806 let line2 = attribution.append("div").attr("class", "attribution-row");
79807 line2.append("a").attr("class", "image-view-link").attr("target", "_blank").attr("href", "https://www.bing.com/maps?cp=" + d2.loc[1] + "~" + d2.loc[0] + "&lvl=17&dir=" + d2.ca + "&style=x&v=2&sV=1").call(_t.append("streetside.view_on_bing"));
79808 line2.append("a").attr("class", "image-report-link").attr("target", "_blank").attr("href", "https://www.bing.com/maps/privacyreport/streetsideprivacyreport?bubbleid=" + encodeURIComponent(d2.key) + "&focus=photo&lat=" + d2.loc[1] + "&lng=" + d2.loc[0] + "&z=17").call(_t.append("streetside.report"));
79809 let bubbleIdQuadKey = d2.key.toString(4);
79810 const paddingNeeded = 16 - bubbleIdQuadKey.length;
79811 for (let i3 = 0; i3 < paddingNeeded; i3++) {
79812 bubbleIdQuadKey = "0" + bubbleIdQuadKey;
79814 const imgUrlPrefix = streetsideImagesApi + "hs" + bubbleIdQuadKey;
79815 const imgUrlSuffix = ".jpg?g=13515&n=z";
79816 const faceKeys = ["01", "02", "03", "10", "11", "12"];
79817 let quadKeys = getQuadKeys();
79818 let faces = faceKeys.map((faceKey) => {
79819 return quadKeys.map((quadKey) => {
79820 const xy = qkToXY(quadKey);
79823 url: imgUrlPrefix + faceKey + quadKey + imgUrlSuffix,
79829 loadFaces(faces).then(function() {
79830 if (!_pannellumViewer2) {
79834 let sceneID = _currScene.toString();
79835 _pannellumViewer2.addScene(sceneID, _sceneOptions).loadScene(sceneID);
79836 if (_currScene > 2) {
79837 sceneID = (_currScene - 1).toString();
79838 _pannellumViewer2.removeScene(sceneID);
79844 getSequenceKeyForBubble: function(d2) {
79845 return d2 && d2.sequenceKey;
79847 // Updates the currently highlighted sequence and selected bubble.
79848 // Reset is only necessary when interacting with the viewport because
79849 // this implicitly changes the currently selected bubble/sequence
79850 setStyles: function(context, hovered, reset) {
79852 context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
79853 context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
79855 let hoveredBubbleKey = hovered && hovered.key;
79856 let hoveredSequenceKey = this.getSequenceKeyForBubble(hovered);
79857 let hoveredSequence = hoveredSequenceKey && _ssCache.sequences[hoveredSequenceKey];
79858 let hoveredBubbleKeys = hoveredSequence && hoveredSequence.bubbles.map((d2) => d2.key) || [];
79859 let viewer = context.container().select(".photoviewer");
79860 let selected = viewer.empty() ? void 0 : viewer.datum();
79861 let selectedBubbleKey = selected && selected.key;
79862 let selectedSequenceKey = this.getSequenceKeyForBubble(selected);
79863 let selectedSequence = selectedSequenceKey && _ssCache.sequences[selectedSequenceKey];
79864 let selectedBubbleKeys = selectedSequence && selectedSequence.bubbles.map((d2) => d2.key) || [];
79865 let highlightedBubbleKeys = utilArrayUnion(hoveredBubbleKeys, selectedBubbleKeys);
79866 context.container().selectAll(".layer-streetside-images .viewfield-group").classed("highlighted", (d2) => highlightedBubbleKeys.indexOf(d2.key) !== -1).classed("hovered", (d2) => d2.key === hoveredBubbleKey).classed("currentView", (d2) => d2.key === selectedBubbleKey);
79867 context.container().selectAll(".layer-streetside-images .sequence").classed("highlighted", (d2) => d2.properties.key === hoveredSequenceKey).classed("currentView", (d2) => d2.properties.key === selectedSequenceKey);
79868 context.container().selectAll(".layer-streetside-images .viewfield-group .viewfield").attr("d", viewfieldPath);
79869 function viewfieldPath() {
79870 let d2 = this.parentNode.__data__;
79871 if (d2.pano && d2.key !== selectedBubbleKey) {
79872 return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
79874 return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
79879 updateUrlImage: function(imageKey) {
79880 if (!window.mocha) {
79881 var hash = utilStringQs(window.location.hash);
79883 hash.photo = "streetside/" + imageKey;
79887 window.location.replace("#" + utilQsString(hash, true));
79893 cache: function() {
79898 // modules/services/taginfo.js
79899 var apibase4 = taginfoApiUrl;
79900 var _inflight3 = {};
79901 var _popularKeys = {};
79902 var _taginfoCache = {};
79904 point: "count_nodes",
79905 vertex: "count_nodes",
79906 area: "count_ways",
79909 var tag_sort_members = {
79910 point: "count_node_members",
79911 vertex: "count_node_members",
79912 area: "count_way_members",
79913 line: "count_way_members",
79914 relation: "count_relation_members"
79916 var tag_filters = {
79922 var tag_members_fractions = {
79923 point: "count_node_members_fraction",
79924 vertex: "count_node_members_fraction",
79925 area: "count_way_members_fraction",
79926 line: "count_way_members_fraction",
79927 relation: "count_relation_members_fraction"
79929 function sets(params, n3, o2) {
79930 if (params.geometry && o2[params.geometry]) {
79931 params[n3] = o2[params.geometry];
79935 function setFilter(params) {
79936 return sets(params, "filter", tag_filters);
79938 function setSort(params) {
79939 return sets(params, "sortname", tag_sorts);
79941 function setSortMembers(params) {
79942 return sets(params, "sortname", tag_sort_members);
79944 function clean(params) {
79945 return utilObjectOmit(params, ["geometry", "debounce"]);
79947 function filterKeys(type2) {
79948 var count_type = type2 ? "count_" + type2 : "count_all";
79949 return function(d2) {
79950 return Number(d2[count_type]) > 2500 || d2.in_wiki;
79953 function filterMultikeys(prefix) {
79954 return function(d2) {
79955 var re3 = new RegExp("^" + prefix + "(.*)$", "i");
79956 var matches = d2.key.match(re3) || [];
79957 return matches.length === 2 && matches[1].indexOf(":") === -1;
79960 function filterValues(allowUpperCase) {
79961 return function(d2) {
79962 if (d2.value.match(/[;,]/) !== null)
79964 if (!allowUpperCase && d2.value.match(/[A-Z*]/) !== null)
79966 return d2.count > 100 || d2.in_wiki;
79969 function filterRoles(geometry) {
79970 return function(d2) {
79971 if (d2.role === "")
79973 if (d2.role.match(/[A-Z*;,]/) !== null)
79975 return Number(d2[tag_members_fractions[geometry]]) > 0;
79978 function valKey(d2) {
79984 function valKeyDescription(d2) {
79987 title: d2.description || d2.value
79991 function roleKey(d2) {
79997 function sortKeys(a2, b2) {
79998 return a2.key.indexOf(":") === -1 && b2.key.indexOf(":") !== -1 ? -1 : a2.key.indexOf(":") !== -1 && b2.key.indexOf(":") === -1 ? 1 : 0;
80000 var debouncedRequest2 = debounce_default(request2, 300, { leading: false });
80001 function request2(url, params, exactMatch, callback, loaded) {
80002 if (_inflight3[url])
80004 if (checkCache(url, params, exactMatch, callback))
80006 var controller = new AbortController();
80007 _inflight3[url] = controller;
80008 json_default(url, { signal: controller.signal }).then(function(result) {
80009 delete _inflight3[url];
80011 loaded(null, result);
80012 }).catch(function(err) {
80013 delete _inflight3[url];
80014 if (err.name === "AbortError")
80017 loaded(err.message);
80020 function checkCache(url, params, exactMatch, callback) {
80021 var rp = params.rp || 25;
80022 var testQuery = params.query || "";
80025 var hit = _taginfoCache[testUrl];
80026 if (hit && (url === testUrl || hit.length < rp)) {
80027 callback(null, hit);
80030 if (exactMatch || !testQuery.length)
80032 testQuery = testQuery.slice(0, -1);
80033 testUrl = url.replace(/&query=(.*?)&/, "&query=" + testQuery + "&");
80034 } while (testQuery.length >= 0);
80037 var taginfo_default = {
80040 _taginfoCache = {};
80042 // manually exclude some keys – #5377, #7485
80048 sorting_name: true,
80053 "bridge:name": true
80057 sortname: "values_all",
80061 lang: _mainLocalizer.languageCode()
80063 this.keys(params, function(err, data) {
80066 data.forEach(function(d2) {
80067 if (d2.value === "opening_hours")
80069 _popularKeys[d2.value] = true;
80073 reset: function() {
80074 Object.values(_inflight3).forEach(function(controller) {
80075 controller.abort();
80079 keys: function(params, callback) {
80080 var doRequest = params.debounce ? debouncedRequest2 : request2;
80081 params = clean(setSort(params));
80082 params = Object.assign({
80084 sortname: "count_all",
80087 lang: _mainLocalizer.languageCode()
80089 var url = apibase4 + "keys/all?" + utilQsString(params);
80090 doRequest(url, params, false, callback, function(err, d2) {
80094 var f3 = filterKeys(params.filter);
80095 var result = d2.data.filter(f3).sort(sortKeys).map(valKey);
80096 _taginfoCache[url] = result;
80097 callback(null, result);
80101 multikeys: function(params, callback) {
80102 var doRequest = params.debounce ? debouncedRequest2 : request2;
80103 params = clean(setSort(params));
80104 params = Object.assign({
80106 sortname: "count_all",
80109 lang: _mainLocalizer.languageCode()
80111 var prefix = params.query;
80112 var url = apibase4 + "keys/all?" + utilQsString(params);
80113 doRequest(url, params, true, callback, function(err, d2) {
80117 var f3 = filterMultikeys(prefix);
80118 var result = d2.data.filter(f3).map(valKey);
80119 _taginfoCache[url] = result;
80120 callback(null, result);
80124 values: function(params, callback) {
80125 var key = params.key;
80126 if (key && _popularKeys[key]) {
80127 callback(null, []);
80130 var doRequest = params.debounce ? debouncedRequest2 : request2;
80131 params = clean(setSort(setFilter(params)));
80132 params = Object.assign({
80134 sortname: "count_all",
80137 lang: _mainLocalizer.languageCode()
80139 var url = apibase4 + "key/values?" + utilQsString(params);
80140 doRequest(url, params, false, callback, function(err, d2) {
80144 var allowUpperCase = allowUpperCaseTagValues.test(params.key);
80145 var f3 = filterValues(allowUpperCase);
80146 var result = d2.data.filter(f3).map(valKeyDescription);
80147 _taginfoCache[url] = result;
80148 callback(null, result);
80152 roles: function(params, callback) {
80153 var doRequest = params.debounce ? debouncedRequest2 : request2;
80154 var geometry = params.geometry;
80155 params = clean(setSortMembers(params));
80156 params = Object.assign({
80158 sortname: "count_all_members",
80161 lang: _mainLocalizer.languageCode()
80163 var url = apibase4 + "relation/roles?" + utilQsString(params);
80164 doRequest(url, params, true, callback, function(err, d2) {
80168 var f3 = filterRoles(geometry);
80169 var result = d2.data.filter(f3).map(roleKey);
80170 _taginfoCache[url] = result;
80171 callback(null, result);
80175 docs: function(params, callback) {
80176 var doRequest = params.debounce ? debouncedRequest2 : request2;
80177 params = clean(setSort(params));
80178 var path = "key/wiki_pages?";
80179 if (params.value) {
80180 path = "tag/wiki_pages?";
80181 } else if (params.rtype) {
80182 path = "relation/wiki_pages?";
80184 var url = apibase4 + path + utilQsString(params);
80185 doRequest(url, params, true, callback, function(err, d2) {
80189 _taginfoCache[url] = d2.data;
80190 callback(null, d2.data);
80194 apibase: function(_2) {
80195 if (!arguments.length)
80202 // modules/services/vector_tile.js
80203 var import_fast_deep_equal11 = __toESM(require_fast_deep_equal());
80204 var import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify());
80205 var import_polygon_clipping2 = __toESM(require_polygon_clipping_umd());
80206 var import_pbf2 = __toESM(require_pbf());
80207 var import_vector_tile2 = __toESM(require_vector_tile());
80208 var tiler8 = utilTiler().tileSize(512).margin(1);
80209 var dispatch12 = dispatch_default("loadedData");
80211 function abortRequest7(controller) {
80212 controller.abort();
80214 function vtToGeoJSON(data, tile, mergeCache) {
80215 var vectorTile = new import_vector_tile2.default.VectorTile(new import_pbf2.default(data));
80216 var layers = Object.keys(vectorTile.layers);
80217 if (!Array.isArray(layers)) {
80221 layers.forEach(function(layerID) {
80222 var layer = vectorTile.layers[layerID];
80224 for (var i3 = 0; i3 < layer.length; i3++) {
80225 var feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
80226 var geometry = feature3.geometry;
80227 if (geometry.type === "Polygon") {
80228 geometry.type = "MultiPolygon";
80229 geometry.coordinates = [geometry.coordinates];
80231 var isClipped = false;
80232 if (geometry.type === "MultiPolygon") {
80233 var featureClip = bboxClip(feature3, tile.extent.rectangle());
80234 if (!(0, import_fast_deep_equal11.default)(feature3.geometry, featureClip.geometry)) {
80237 if (!feature3.geometry.coordinates.length)
80239 if (!feature3.geometry.coordinates[0].length)
80242 var featurehash = utilHashcode((0, import_fast_json_stable_stringify2.default)(feature3));
80243 var propertyhash = utilHashcode((0, import_fast_json_stable_stringify2.default)(feature3.properties || {}));
80244 feature3.__layerID__ = layerID.replace(/[^_a-zA-Z0-9\-]/g, "_");
80245 feature3.__featurehash__ = featurehash;
80246 feature3.__propertyhash__ = propertyhash;
80247 features.push(feature3);
80248 if (isClipped && geometry.type === "MultiPolygon") {
80249 var merged = mergeCache[propertyhash];
80250 if (merged && merged.length) {
80251 var other = merged[0];
80252 var coords = import_polygon_clipping2.default.union(
80253 feature3.geometry.coordinates,
80254 other.geometry.coordinates
80256 if (!coords || !coords.length) {
80259 merged.push(feature3);
80260 for (var j3 = 0; j3 < merged.length; j3++) {
80261 merged[j3].geometry.coordinates = coords;
80262 merged[j3].__featurehash__ = featurehash;
80265 mergeCache[propertyhash] = [feature3];
80273 function loadTile3(source, tile) {
80274 if (source.loaded[tile.id] || source.inflight[tile.id])
80276 var url = source.template.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace(/\{[t-]y\}/, Math.pow(2, tile.xyz[2]) - tile.xyz[1] - 1).replace(/\{z(oom)?\}/, tile.xyz[2]).replace(/\{switch:([^}]+)\}/, function(s2, r2) {
80277 var subdomains = r2.split(",");
80278 return subdomains[(tile.xyz[0] + tile.xyz[1]) % subdomains.length];
80280 var controller = new AbortController();
80281 source.inflight[tile.id] = controller;
80282 fetch(url, { signal: controller.signal }).then(function(response) {
80283 if (!response.ok) {
80284 throw new Error(response.status + " " + response.statusText);
80286 source.loaded[tile.id] = [];
80287 delete source.inflight[tile.id];
80288 return response.arrayBuffer();
80289 }).then(function(data) {
80291 throw new Error("No Data");
80293 var z2 = tile.xyz[2];
80294 if (!source.canMerge[z2]) {
80295 source.canMerge[z2] = {};
80297 source.loaded[tile.id] = vtToGeoJSON(data, tile, source.canMerge[z2]);
80298 dispatch12.call("loadedData");
80299 }).catch(function() {
80300 source.loaded[tile.id] = [];
80301 delete source.inflight[tile.id];
80304 var vector_tile_default = {
80309 this.event = utilRebind(this, dispatch12, "on");
80311 reset: function() {
80312 for (var sourceID in _vtCache) {
80313 var source = _vtCache[sourceID];
80314 if (source && source.inflight) {
80315 Object.values(source.inflight).forEach(abortRequest7);
80320 addSource: function(sourceID, template) {
80321 _vtCache[sourceID] = { template, inflight: {}, loaded: {}, canMerge: {} };
80322 return _vtCache[sourceID];
80324 data: function(sourceID, projection2) {
80325 var source = _vtCache[sourceID];
80328 var tiles = tiler8.getTiles(projection2);
80331 for (var i3 = 0; i3 < tiles.length; i3++) {
80332 var features = source.loaded[tiles[i3].id];
80333 if (!features || !features.length)
80335 for (var j3 = 0; j3 < features.length; j3++) {
80336 var feature3 = features[j3];
80337 var hash = feature3.__featurehash__;
80341 results.push(Object.assign({}, feature3));
80346 loadTiles: function(sourceID, template, projection2) {
80347 var source = _vtCache[sourceID];
80349 source = this.addSource(sourceID, template);
80351 var tiles = tiler8.getTiles(projection2);
80352 Object.keys(source.inflight).forEach(function(k2) {
80353 var wanted = tiles.find(function(tile) {
80354 return k2 === tile.id;
80357 abortRequest7(source.inflight[k2]);
80358 delete source.inflight[k2];
80361 tiles.forEach(function(tile) {
80362 loadTile3(source, tile);
80365 cache: function() {
80370 // modules/services/wikidata.js
80371 var apibase5 = "https://www.wikidata.org/w/api.php?";
80372 var _wikidataCache = {};
80373 var wikidata_default = {
80376 reset: function() {
80377 _wikidataCache = {};
80379 // Search for Wikidata items matching the query
80380 itemsForSearchQuery: function(query, callback, language) {
80383 callback("No query", {});
80386 var lang = this.languagesToQuery()[0];
80387 var url = apibase5 + utilQsString({
80388 action: "wbsearchentities",
80393 // the language to search
80394 language: language || lang,
80395 // the language for the label and description in the result
80400 json_default(url).then((result) => {
80401 if (result && result.error) {
80402 if (result.error.code === "badvalue" && result.error.info.includes(lang) && !language && lang.includes("-")) {
80403 this.itemsForSearchQuery(query, callback, lang.split("-")[0]);
80406 throw new Error(result.error);
80410 callback(null, result.search || {});
80411 }).catch(function(err) {
80413 callback(err.message, {});
80416 // Given a Wikipedia language and article title,
80417 // return an array of corresponding Wikidata entities.
80418 itemsByTitle: function(lang, title, callback) {
80421 callback("No title", {});
80424 lang = lang || "en";
80425 var url = apibase5 + utilQsString({
80426 action: "wbgetentities",
80429 sites: lang.replace(/-/g, "_") + "wiki",
80432 // shrink response by filtering to one language
80435 json_default(url).then(function(result) {
80436 if (result && result.error) {
80437 throw new Error(result.error);
80440 callback(null, result.entities || {});
80441 }).catch(function(err) {
80443 callback(err.message, {});
80446 languagesToQuery: function() {
80447 return _mainLocalizer.localeCodes().map(function(code) {
80448 return code.toLowerCase();
80449 }).filter(function(code) {
80450 return code !== "en-us";
80453 entityByQID: function(qid, callback) {
80455 callback("No qid", {});
80458 if (_wikidataCache[qid]) {
80460 callback(null, _wikidataCache[qid]);
80463 var langs = this.languagesToQuery();
80464 var url = apibase5 + utilQsString({
80465 action: "wbgetentities",
80469 props: "labels|descriptions|claims|sitelinks",
80470 sitefilter: langs.map(function(d2) {
80471 return d2 + "wiki";
80473 languages: langs.join("|"),
80474 languagefallback: 1,
80477 json_default(url).then(function(result) {
80478 if (result && result.error) {
80479 throw new Error(result.error);
80482 callback(null, result.entities[qid] || {});
80483 }).catch(function(err) {
80485 callback(err.message, {});
80488 // Pass `params` object of the form:
80490 // qid: 'string' // brand wikidata (e.g. 'Q37158')
80493 // Get an result object used to display tag documentation
80495 // title: 'string',
80496 // description: 'string',
80497 // editURL: 'string',
80498 // imageURL: 'string',
80499 // wiki: { title: 'string', text: 'string', url: 'string' }
80502 getDocs: function(params, callback) {
80503 var langs = this.languagesToQuery();
80504 this.entityByQID(params.qid, function(err, entity) {
80505 if (err || !entity) {
80506 callback(err || "No entity");
80511 for (i3 in langs) {
80512 let code = langs[i3];
80513 if (entity.descriptions[code] && entity.descriptions[code].language === code) {
80514 description = entity.descriptions[code];
80518 if (!description && Object.values(entity.descriptions).length)
80519 description = Object.values(entity.descriptions)[0];
80522 description: description ? description.value : "",
80523 descriptionLocaleCode: description ? description.language : "",
80524 editURL: "https://www.wikidata.org/wiki/" + entity.id
80526 if (entity.claims) {
80527 var imageroot = "https://commons.wikimedia.org/w/index.php";
80528 var props = ["P154", "P18"];
80530 for (i3 = 0; i3 < props.length; i3++) {
80531 prop = entity.claims[props[i3]];
80532 if (prop && Object.keys(prop).length > 0) {
80533 image = prop[Object.keys(prop)[0]].mainsnak.datavalue.value;
80535 result.imageURL = imageroot + "?" + utilQsString({
80536 title: "Special:Redirect/file/" + image,
80544 if (entity.sitelinks) {
80545 var englishLocale = _mainLocalizer.languageCode().toLowerCase() === "en";
80546 for (i3 = 0; i3 < langs.length; i3++) {
80547 var w2 = langs[i3] + "wiki";
80548 if (entity.sitelinks[w2]) {
80549 var title = entity.sitelinks[w2].title;
80550 var tKey = "inspector.wiki_reference";
80551 if (!englishLocale && langs[i3] === "en") {
80552 tKey = "inspector.wiki_en_reference";
80557 url: "https://" + langs[i3] + ".wikipedia.org/wiki/" + title.replace(/ /g, "_")
80563 callback(null, result);
80568 // modules/services/wikipedia.js
80569 var endpoint = "https://en.wikipedia.org/w/api.php?";
80570 var wikipedia_default = {
80573 reset: function() {
80575 search: function(lang, query, callback) {
80578 callback("No Query", []);
80581 lang = lang || "en";
80582 var url = endpoint.replace("en", lang) + utilQsString({
80586 srinfo: "suggestion",
80591 json_default(url).then(function(result) {
80592 if (result && result.error) {
80593 throw new Error(result.error);
80594 } else if (!result || !result.query || !result.query.search) {
80595 throw new Error("No Results");
80598 var titles = result.query.search.map(function(d2) {
80601 callback(null, titles);
80603 }).catch(function(err) {
80608 suggestions: function(lang, query, callback) {
80614 lang = lang || "en";
80615 var url = endpoint.replace("en", lang) + utilQsString({
80616 action: "opensearch",
80623 json_default(url).then(function(result) {
80624 if (result && result.error) {
80625 throw new Error(result.error);
80626 } else if (!result || result.length < 2) {
80627 throw new Error("No Results");
80630 callback(null, result[1] || []);
80631 }).catch(function(err) {
80633 callback(err.message, []);
80636 translations: function(lang, title, callback) {
80639 callback("No Title");
80642 var url = endpoint.replace("en", lang) + utilQsString({
80650 json_default(url).then(function(result) {
80651 if (result && result.error) {
80652 throw new Error(result.error);
80653 } else if (!result || !result.query || !result.query.pages) {
80654 throw new Error("No Results");
80657 var list = result.query.pages[Object.keys(result.query.pages)[0]];
80658 var translations = {};
80659 if (list && list.langlinks) {
80660 list.langlinks.forEach(function(d2) {
80661 translations[d2.lang] = d2["*"];
80664 callback(null, translations);
80666 }).catch(function(err) {
80668 callback(err.message);
80673 // modules/services/mapilio.js
80674 var import_pbf3 = __toESM(require_pbf());
80675 var import_rbush12 = __toESM(require_rbush_min());
80676 var import_vector_tile3 = __toESM(require_vector_tile());
80677 var apiUrl2 = "https://end.mapilio.com";
80678 var imageBaseUrl = "https://cdn.mapilio.com/im";
80679 var baseTileUrl2 = "https://geo.mapilio.com/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=mapilio:";
80680 var pointLayer = "map_points";
80681 var lineLayer = "map_roads_line";
80682 var tileStyle = "&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/vnd.mapbox-vector-tile&TILECOL={x}&TILEROW={y}";
80684 var dispatch13 = dispatch_default("loadedImages", "loadedLines");
80685 var imgZoom3 = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
80686 var pannellumViewerCSS3 = "pannellum/pannellum.css";
80687 var pannellumViewerJS3 = "pannellum/pannellum.js";
80688 var resolution = 1080;
80689 var _mlyActiveImage2;
80691 var _loadViewerPromise5;
80692 var _pannellumViewer3;
80693 var _mlySceneOptions = {
80694 showFullscreenCtrl: false,
80701 var _currScene2 = 0;
80702 function partitionViewport5(projection2) {
80703 const z2 = geoScaleToZoom(projection2.scale());
80704 const z22 = Math.ceil(z2 * 2) / 2 + 2.5;
80705 const tiler9 = utilTiler().zoomExtent([z22, z22]);
80706 return tiler9.getTiles(projection2).map(function(tile) {
80707 return tile.extent;
80710 function searchLimited5(limit, projection2, rtree) {
80711 limit = limit || 5;
80712 return partitionViewport5(projection2).reduce(function(result, extent) {
80713 const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
80716 return found.length ? result.concat(found) : result;
80719 function loadTiles4(which, url, maxZoom2, projection2) {
80720 const tiler9 = utilTiler().zoomExtent([minZoom3, maxZoom2]).skipNullIsland(true);
80721 const tiles = tiler9.getTiles(projection2);
80722 tiles.forEach(function(tile) {
80723 loadTile4(which, url, tile);
80726 function loadTile4(which, url, tile) {
80727 const cache = _mlyCache2.requests;
80728 const tileId = `${tile.id}-${which}`;
80729 if (cache.loaded[tileId] || cache.inflight[tileId])
80731 const controller = new AbortController();
80732 cache.inflight[tileId] = controller;
80733 const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
80734 fetch(requestUrl, { signal: controller.signal }).then(function(response) {
80735 if (!response.ok) {
80736 throw new Error(response.status + " " + response.statusText);
80738 cache.loaded[tileId] = true;
80739 delete cache.inflight[tileId];
80740 return response.arrayBuffer();
80741 }).then(function(data) {
80742 if (data.byteLength === 0) {
80743 throw new Error("No Data");
80745 loadTileDataToCache2(data, tile, which);
80746 if (which === "images") {
80747 dispatch13.call("loadedImages");
80749 dispatch13.call("loadedLines");
80751 }).catch(function(e3) {
80752 if (e3.message === "No Data") {
80753 cache.loaded[tileId] = true;
80759 function loadTileDataToCache2(data, tile) {
80760 const vectorTile = new import_vector_tile3.VectorTile(new import_pbf3.default(data));
80761 let features, cache, layer, i3, feature3, loc, d2;
80762 if (vectorTile.layers.hasOwnProperty(pointLayer)) {
80764 cache = _mlyCache2.images;
80765 layer = vectorTile.layers[pointLayer];
80766 for (i3 = 0; i3 < layer.length; i3++) {
80767 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
80768 loc = feature3.geometry.coordinates;
80769 let resolutionArr = feature3.properties.resolution.split("x");
80770 let sourceWidth = Math.max(resolutionArr[0], resolutionArr[1]);
80771 let sourceHeight = Math.min(resolutionArr[0], resolutionArr[1]);
80772 let isPano = sourceWidth % sourceHeight === 0;
80775 capture_time: feature3.properties.capture_time,
80776 id: feature3.properties.id,
80777 sequence_id: feature3.properties.sequence_uuid,
80778 heading: feature3.properties.heading,
80779 resolution: feature3.properties.resolution,
80782 cache.forImageId[d2.id] = d2;
80792 cache.rtree.load(features);
80795 if (vectorTile.layers.hasOwnProperty(lineLayer)) {
80796 cache = _mlyCache2.sequences;
80797 layer = vectorTile.layers[lineLayer];
80798 for (i3 = 0; i3 < layer.length; i3++) {
80799 feature3 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
80800 if (cache.lineString[feature3.properties.sequence_uuid]) {
80801 cache.lineString[feature3.properties.sequence_uuid].push(feature3);
80803 cache.lineString[feature3.properties.sequence_uuid] = [feature3];
80808 function getImageData(imageId, sequenceId) {
80809 return fetch(apiUrl2 + `/api/sequence-detail?sequence_uuid=${sequenceId}`, { method: "GET" }).then(function(response) {
80810 if (!response.ok) {
80811 throw new Error(response.status + " " + response.statusText);
80813 return response.json();
80814 }).then(function(data) {
80815 let index = data.data.findIndex((feature3) => feature3.id === imageId);
80816 const { filename, uploaded_hash } = data.data[index];
80817 _mlySceneOptions.panorama = imageBaseUrl + "/" + uploaded_hash + "/" + filename + "/" + resolution;
80820 var mapilio_default = {
80821 // Initialize Mapilio
80826 this.event = utilRebind(this, dispatch13, "on");
80828 // Reset cache and state
80829 reset: function() {
80831 Object.values(_mlyCache2.requests.inflight).forEach(function(request3) {
80836 images: { rtree: new import_rbush12.default(), forImageId: {} },
80837 sequences: { rtree: new import_rbush12.default(), lineString: {} },
80838 requests: { loaded: {}, inflight: {} }
80840 _mlyActiveImage2 = null;
80842 // Get visible images
80843 images: function(projection2) {
80845 return searchLimited5(limit, projection2, _mlyCache2.images.rtree);
80847 cachedImage: function(imageKey) {
80848 return _mlyCache2.images.forImageId[imageKey];
80850 // Load images in the visible area
80851 loadImages: function(projection2) {
80852 let url = baseTileUrl2 + pointLayer + tileStyle;
80853 loadTiles4("images", url, 14, projection2);
80855 // Load line in the visible area
80856 loadLines: function(projection2) {
80857 let url = baseTileUrl2 + lineLayer + tileStyle;
80858 loadTiles4("line", url, 14, projection2);
80860 // Get visible sequences
80861 sequences: function(projection2) {
80862 const viewport = projection2.clipExtent();
80863 const min3 = [viewport[0][0], viewport[1][1]];
80864 const max3 = [viewport[1][0], viewport[0][1]];
80865 const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
80866 const sequenceIds = {};
80867 let lineStrings = [];
80868 _mlyCache2.images.rtree.search(bbox2).forEach(function(d2) {
80869 if (d2.data.sequence_id) {
80870 sequenceIds[d2.data.sequence_id] = true;
80873 Object.keys(sequenceIds).forEach(function(sequenceId) {
80874 if (_mlyCache2.sequences.lineString[sequenceId]) {
80875 lineStrings = lineStrings.concat(_mlyCache2.sequences.lineString[sequenceId]);
80878 return lineStrings;
80880 // Set the currently visible image
80881 setActiveImage: function(image) {
80883 _mlyActiveImage2 = {
80885 sequence_id: image.sequence_id
80888 _mlyActiveImage2 = null;
80891 // Update the currently highlighted sequence and selected bubble.
80892 setStyles: function(context, hovered) {
80893 const hoveredImageId = hovered && hovered.id;
80894 const hoveredSequenceId = hovered && hovered.sequence_id;
80895 const selectedSequenceId = _mlyActiveImage2 && _mlyActiveImage2.sequence_id;
80896 const selectedImageId = _mlyActiveImage2 && _mlyActiveImage2.id;
80897 const markers = context.container().selectAll(".layer-mapilio .viewfield-group");
80898 const sequences = context.container().selectAll(".layer-mapilio .sequence");
80899 markers.classed("highlighted", function(d2) {
80900 return d2.id === hoveredImageId;
80901 }).classed("hovered", function(d2) {
80902 return d2.id === hoveredImageId;
80903 }).classed("currentView", function(d2) {
80904 return d2.id === selectedImageId;
80906 sequences.classed("highlighted", function(d2) {
80907 return d2.properties.sequence_uuid === hoveredSequenceId;
80908 }).classed("currentView", function(d2) {
80909 return d2.properties.sequence_uuid === selectedSequenceId;
80913 updateUrlImage: function(imageKey) {
80914 if (!window.mocha) {
80915 var hash = utilStringQs(window.location.hash);
80917 hash.photo = "mapilio/" + imageKey;
80921 window.location.replace("#" + utilQsString(hash, true));
80924 initViewer: function() {
80925 if (!window.pannellum)
80927 if (_pannellumViewer3)
80930 const sceneID = _currScene2.toString();
80932 "default": { firstScene: sceneID },
80935 options2.scenes[sceneID] = _mlySceneOptions;
80936 _pannellumViewer3 = window.pannellum.viewer("ideditor-viewer-mapilio-pnlm", options2);
80938 selectImage: function(context, id2) {
80940 let d2 = this.cachedImage(id2);
80941 this.setActiveImage(d2);
80942 this.updateUrlImage(d2.id);
80943 let viewer = context.container().select(".photoviewer");
80944 if (!viewer.empty())
80946 this.setStyles(context, null);
80949 let wrap2 = context.container().select(".photoviewer .mapilio-wrapper");
80950 let attribution = wrap2.selectAll(".photo-attribution").text("");
80951 if (d2.capture_time) {
80952 attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.capture_time));
80953 attribution.append("span").text("|");
80955 attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", `https://mapilio.com/app?lat=${d2.loc[1]}&lng=${d2.loc[0]}&zoom=17&pId=${d2.id}`).text("mapilio.com");
80956 wrap2.transition().duration(100).call(imgZoom3.transform, identity2);
80957 wrap2.selectAll("img").remove();
80958 getImageData(d2.id, d2.sequence_id).then(function() {
80960 if (!_pannellumViewer3) {
80964 let sceneID = _currScene2.toString();
80965 _pannellumViewer3.addScene(sceneID, _mlySceneOptions).loadScene(sceneID);
80966 if (_currScene2 > 2) {
80967 sceneID = (_currScene2 - 1).toString();
80968 _pannellumViewer3.removeScene(sceneID);
80972 that.initOnlyPhoto(context);
80975 function localeDateString2(s2) {
80978 var options2 = { day: "numeric", month: "short", year: "numeric" };
80979 var d4 = new Date(s2);
80980 if (isNaN(d4.getTime()))
80982 return d4.toLocaleDateString(_mainLocalizer.localeCode(), options2);
80986 initOnlyPhoto: function(context) {
80987 if (_pannellumViewer3) {
80988 _pannellumViewer3.destroy();
80989 _pannellumViewer3 = null;
80991 let wrap2 = context.container().select("#ideditor-viewer-mapilio-simple");
80992 let imgWrap = wrap2.select("img");
80993 if (!imgWrap.empty()) {
80994 imgWrap.attr("src", _mlySceneOptions.panorama);
80996 wrap2.append("img").attr("src", _mlySceneOptions.panorama);
80999 ensureViewerLoaded: function(context) {
81001 let imgWrap = context.container().select("#ideditor-viewer-mapilio-simple > img");
81002 if (!imgWrap.empty()) {
81005 if (_loadViewerPromise5)
81006 return _loadViewerPromise5;
81007 let wrap2 = context.container().select(".photoviewer").selectAll(".mapilio-wrapper").data([0]);
81008 let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper mapilio-wrapper").classed("hide", true).on("dblclick.zoom", null);
81009 wrapEnter.append("div").attr("class", "photo-attribution fillD");
81010 const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-mapilio");
81011 controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
81012 controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
81013 wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-pnlm");
81014 wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-simple-wrap").call(imgZoom3.on("zoom", zoomPan2)).append("div").attr("id", "ideditor-viewer-mapilio-simple");
81015 context.ui().photoviewer.on("resize.mapilio", () => {
81016 if (_pannellumViewer3) {
81017 _pannellumViewer3.resize();
81020 _loadViewerPromise5 = new Promise((resolve, reject) => {
81021 let loadedCount = 0;
81022 function loaded() {
81024 if (loadedCount === 2)
81027 const head = select_default2("head");
81028 head.selectAll("#ideditor-mapilio-viewercss").data([0]).enter().append("link").attr("id", "ideditor-mapilio-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context.asset(pannellumViewerCSS3)).on("load.serviceMapilio", loaded).on("error.serviceMapilio", function() {
81031 head.selectAll("#ideditor-mapilio-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-mapilio-viewerjs").attr("crossorigin", "anonymous").attr("src", context.asset(pannellumViewerJS3)).on("load.serviceMapilio", loaded).on("error.serviceMapilio", function() {
81034 }).catch(function() {
81035 _loadViewerPromise5 = null;
81037 function step(stepBy) {
81038 return function() {
81039 if (!_mlyActiveImage2)
81041 const imageId = _mlyActiveImage2.id;
81042 const nextIndex = imageId + stepBy;
81045 const nextImage = _mlyCache2.images.forImageId[nextIndex];
81046 context.map().centerEase(nextImage.loc);
81047 that.selectImage(context, nextImage.id);
81050 function zoomPan2(d3_event) {
81051 var t2 = d3_event.transform;
81052 context.container().select(".photoviewer #ideditor-viewer-mapilio-simple").call(utilSetTransform, t2.x, t2.y, t2.k);
81054 return _loadViewerPromise5;
81056 showViewer: function(context) {
81057 let wrap2 = context.container().select(".photoviewer").classed("hide", false);
81058 let isHidden = wrap2.selectAll(".photo-wrapper.mapilio-wrapper.hide").size();
81060 wrap2.selectAll(".photo-wrapper:not(.mapilio-wrapper)").classed("hide", true);
81061 wrap2.selectAll(".photo-wrapper.mapilio-wrapper").classed("hide", false);
81068 hideViewer: function(context) {
81069 let viewer = context.container().select(".photoviewer");
81070 if (!viewer.empty())
81071 viewer.datum(null);
81072 this.updateUrlImage(null);
81073 viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
81074 context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
81075 this.setActiveImage();
81076 return this.setStyles(context, null);
81078 // Return the current cache
81079 cache: function() {
81084 // modules/services/index.js
81086 geocoder: nominatim_default,
81087 keepRight: keepRight_default,
81088 improveOSM: improveOSM_default,
81089 osmose: osmose_default,
81090 mapillary: mapillary_default,
81092 kartaview: kartaview_default,
81093 vegbilder: vegbilder_default,
81095 osmWikibase: osm_wikibase_default,
81096 maprules: maprules_default,
81097 streetside: streetside_default,
81098 taginfo: taginfo_default,
81099 vectorTile: vector_tile_default,
81100 wikidata: wikidata_default,
81101 wikipedia: wikipedia_default,
81102 mapilio: mapilio_default
81105 // modules/modes/drag_note.js
81106 function modeDragNote(context) {
81111 var edit2 = behaviorEdit(context);
81112 var _nudgeInterval;
81115 function startNudge(d3_event, nudge) {
81116 if (_nudgeInterval)
81117 window.clearInterval(_nudgeInterval);
81118 _nudgeInterval = window.setInterval(function() {
81119 context.map().pan(nudge);
81120 doMove(d3_event, nudge);
81123 function stopNudge() {
81124 if (_nudgeInterval) {
81125 window.clearInterval(_nudgeInterval);
81126 _nudgeInterval = null;
81129 function origin(note) {
81130 return context.projection(note.loc);
81132 function start2(d3_event, note) {
81134 var osm = services.osm;
81136 _note = osm.getNote(_note.id);
81138 context.surface().selectAll(".note-" + _note.id).classed("active", true);
81139 context.perform(actionNoop());
81140 context.enter(mode);
81141 context.selectedNoteID(_note.id);
81143 function move(d3_event, entity, point2) {
81144 d3_event.stopPropagation();
81145 _lastLoc = context.projection.invert(point2);
81147 var nudge = geoViewportEdge(point2, context.map().dimensions());
81149 startNudge(d3_event, nudge);
81154 function doMove(d3_event, nudge) {
81155 nudge = nudge || [0, 0];
81156 var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
81157 var currMouse = geoVecSubtract(currPoint, nudge);
81158 var loc = context.projection.invert(currMouse);
81159 _note = _note.move(loc);
81160 var osm = services.osm;
81162 osm.replaceNote(_note);
81164 context.replace(actionNoop());
81167 context.replace(actionNoop());
81168 context.selectedNoteID(_note.id).enter(modeSelectNote(context, _note.id));
81170 var drag = behaviorDrag().selector(".layer-touch.markers .target.note.new").surface(context.container().select(".main-map").node()).origin(origin).on("start", start2).on("move", move).on("end", end);
81171 mode.enter = function() {
81172 context.install(edit2);
81174 mode.exit = function() {
81175 context.ui().sidebar.hover.cancel();
81176 context.uninstall(edit2);
81177 context.surface().selectAll(".active").classed("active", false);
81180 mode.behavior = drag;
81184 // modules/modes/select_data.js
81185 function modeSelectData(context, selectedDatum) {
81190 var keybinding = utilKeybinding("select-data");
81191 var dataEditor = uiDataEditor(context);
81193 behaviorBreathe(context),
81194 behaviorHover(context),
81195 behaviorSelect(context),
81196 behaviorLasso(context),
81197 modeDragNode(context).behavior,
81198 modeDragNote(context).behavior
81200 function selectData(d3_event, drawn) {
81201 var selection2 = context.surface().selectAll(".layer-mapdata .data" + selectedDatum.__featurehash__);
81202 if (selection2.empty()) {
81203 var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
81204 if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
81205 context.enter(modeBrowse(context));
81208 selection2.classed("selected", true);
81212 if (context.container().select(".combobox").size())
81214 context.enter(modeBrowse(context));
81216 mode.zoomToSelected = function() {
81217 var extent = geoExtent(bounds_default(selectedDatum));
81218 context.map().centerZoomEase(extent.center(), context.map().trimmedExtentZoom(extent));
81220 mode.enter = function() {
81221 behaviors.forEach(context.install);
81222 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
81223 select_default2(document).call(keybinding);
81225 var sidebar = context.ui().sidebar;
81226 sidebar.show(dataEditor.datum(selectedDatum));
81227 var extent = geoExtent(bounds_default(selectedDatum));
81228 sidebar.expand(sidebar.intersects(extent));
81229 context.map().on("drawn.select-data", selectData);
81231 mode.exit = function() {
81232 behaviors.forEach(context.uninstall);
81233 select_default2(document).call(keybinding.unbind);
81234 context.surface().selectAll(".layer-mapdata .selected").classed("selected hover", false);
81235 context.map().on("drawn.select-data", null);
81236 context.ui().sidebar.hide();
81241 // modules/behavior/select.js
81242 function behaviorSelect(context) {
81243 var _tolerancePx = 4;
81244 var _lastMouseEvent = null;
81245 var _showMenu = false;
81246 var _downPointers = {};
81247 var _longPressTimeout = null;
81248 var _lastInteractionType = null;
81249 var _multiselectionPointerId = null;
81250 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
81251 function keydown(d3_event) {
81252 if (d3_event.keyCode === 32) {
81253 var activeNode = document.activeElement;
81254 if (activeNode && (/* @__PURE__ */ new Set(["INPUT", "TEXTAREA"])).has(activeNode.nodeName))
81257 if (d3_event.keyCode === 93 || // context menu key
81258 d3_event.keyCode === 32) {
81259 d3_event.preventDefault();
81261 if (d3_event.repeat)
81264 if (d3_event.shiftKey) {
81265 context.surface().classed("behavior-multiselect", true);
81267 if (d3_event.keyCode === 32) {
81268 if (!_downPointers.spacebar && _lastMouseEvent) {
81270 _longPressTimeout = window.setTimeout(didLongPress, 500, "spacebar", "spacebar");
81271 _downPointers.spacebar = {
81272 firstEvent: _lastMouseEvent,
81273 lastEvent: _lastMouseEvent
81278 function keyup(d3_event) {
81280 if (!d3_event.shiftKey) {
81281 context.surface().classed("behavior-multiselect", false);
81283 if (d3_event.keyCode === 93) {
81284 d3_event.preventDefault();
81285 _lastInteractionType = "menukey";
81286 contextmenu(d3_event);
81287 } else if (d3_event.keyCode === 32) {
81288 var pointer = _downPointers.spacebar;
81290 delete _downPointers.spacebar;
81293 d3_event.preventDefault();
81294 _lastInteractionType = "spacebar";
81295 click(pointer.firstEvent, pointer.lastEvent, "spacebar");
81299 function pointerdown(d3_event) {
81300 var id2 = (d3_event.pointerId || "mouse").toString();
81302 if (d3_event.buttons && d3_event.buttons !== 1)
81304 context.ui().closeEditMenu();
81305 if (d3_event.pointerType !== "mouse") {
81306 _longPressTimeout = window.setTimeout(didLongPress, 500, id2, "longdown-" + (d3_event.pointerType || "mouse"));
81308 _downPointers[id2] = {
81309 firstEvent: d3_event,
81310 lastEvent: d3_event
81313 function didLongPress(id2, interactionType) {
81314 var pointer = _downPointers[id2];
81317 for (var i3 in _downPointers) {
81318 _downPointers[i3].done = true;
81320 _longPressTimeout = null;
81321 _lastInteractionType = interactionType;
81323 click(pointer.firstEvent, pointer.lastEvent, id2);
81325 function pointermove(d3_event) {
81326 var id2 = (d3_event.pointerId || "mouse").toString();
81327 if (_downPointers[id2]) {
81328 _downPointers[id2].lastEvent = d3_event;
81330 if (!d3_event.pointerType || d3_event.pointerType === "mouse") {
81331 _lastMouseEvent = d3_event;
81332 if (_downPointers.spacebar) {
81333 _downPointers.spacebar.lastEvent = d3_event;
81337 function pointerup(d3_event) {
81338 var id2 = (d3_event.pointerId || "mouse").toString();
81339 var pointer = _downPointers[id2];
81342 delete _downPointers[id2];
81343 if (_multiselectionPointerId === id2) {
81344 _multiselectionPointerId = null;
81348 click(pointer.firstEvent, d3_event, id2);
81350 function pointercancel(d3_event) {
81351 var id2 = (d3_event.pointerId || "mouse").toString();
81352 if (!_downPointers[id2])
81354 delete _downPointers[id2];
81355 if (_multiselectionPointerId === id2) {
81356 _multiselectionPointerId = null;
81359 function contextmenu(d3_event) {
81360 d3_event.preventDefault();
81361 if (!+d3_event.clientX && !+d3_event.clientY) {
81362 if (_lastMouseEvent) {
81363 d3_event = _lastMouseEvent;
81368 _lastMouseEvent = d3_event;
81369 if (d3_event.pointerType === "touch" || d3_event.pointerType === "pen" || d3_event.mozInputSource && // firefox doesn't give a pointerType on contextmenu events
81370 (d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_TOUCH || d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_PEN)) {
81371 _lastInteractionType = "touch";
81373 _lastInteractionType = "rightclick";
81377 click(d3_event, d3_event);
81379 function click(firstEvent, lastEvent, pointerId) {
81381 var mapNode = context.container().select(".main-map").node();
81382 var pointGetter = utilFastMouse(mapNode);
81383 var p1 = pointGetter(firstEvent);
81384 var p2 = pointGetter(lastEvent);
81385 var dist = geoVecLength(p1, p2);
81386 if (dist > _tolerancePx || !mapContains(lastEvent)) {
81390 var targetDatum = lastEvent.target.__data__;
81391 var multiselectEntityId;
81392 if (!_multiselectionPointerId) {
81393 var selectPointerInfo = pointerDownOnSelection(pointerId);
81394 if (selectPointerInfo) {
81395 _multiselectionPointerId = selectPointerInfo.pointerId;
81396 multiselectEntityId = !selectPointerInfo.selected && selectPointerInfo.entityId;
81397 _downPointers[selectPointerInfo.pointerId].done = true;
81400 var isMultiselect = context.mode().id === "select" && // and shift key is down
81401 (lastEvent && lastEvent.shiftKey || // or we're lasso-selecting
81402 context.surface().select(".lasso").node() || // or a pointer is down over a selected feature
81403 _multiselectionPointerId && !multiselectEntityId);
81404 processClick(targetDatum, isMultiselect, p2, multiselectEntityId);
81405 function mapContains(event) {
81406 var rect = mapNode.getBoundingClientRect();
81407 return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
81409 function pointerDownOnSelection(skipPointerId) {
81410 var mode = context.mode();
81411 var selectedIDs = mode.id === "select" ? mode.selectedIDs() : [];
81412 for (var pointerId2 in _downPointers) {
81413 if (pointerId2 === "spacebar" || pointerId2 === skipPointerId)
81415 var pointerInfo = _downPointers[pointerId2];
81416 var p12 = pointGetter(pointerInfo.firstEvent);
81417 var p22 = pointGetter(pointerInfo.lastEvent);
81418 if (geoVecLength(p12, p22) > _tolerancePx)
81420 var datum2 = pointerInfo.firstEvent.target.__data__;
81421 var entity = datum2 && datum2.properties && datum2.properties.entity || datum2;
81422 if (context.graph().hasEntity(entity.id)) {
81424 pointerId: pointerId2,
81425 entityId: entity.id,
81426 selected: selectedIDs.indexOf(entity.id) !== -1
81433 function processClick(datum2, isMultiselect, point2, alsoSelectId) {
81434 var mode = context.mode();
81435 var showMenu = _showMenu;
81436 var interactionType = _lastInteractionType;
81437 var entity = datum2 && datum2.properties && datum2.properties.entity;
81440 if (datum2 && datum2.type === "midpoint") {
81441 datum2 = datum2.parents[0];
81444 if (datum2 instanceof osmEntity) {
81445 var selectedIDs = context.selectedIDs();
81446 context.selectedNoteID(null);
81447 context.selectedErrorID(null);
81448 if (!isMultiselect) {
81449 if (!showMenu || selectedIDs.length <= 1 || selectedIDs.indexOf(datum2.id) === -1) {
81450 if (alsoSelectId === datum2.id)
81451 alsoSelectId = null;
81452 selectedIDs = (alsoSelectId ? [alsoSelectId] : []).concat([datum2.id]);
81453 newMode = mode.id === "select" ? mode.selectedIDs(selectedIDs) : modeSelect(context, selectedIDs).selectBehavior(behavior);
81454 context.enter(newMode);
81457 if (selectedIDs.indexOf(datum2.id) !== -1) {
81459 selectedIDs = selectedIDs.filter(function(id2) {
81460 return id2 !== datum2.id;
81462 newMode = selectedIDs.length ? mode.selectedIDs(selectedIDs) : modeBrowse(context).selectBehavior(behavior);
81463 context.enter(newMode);
81466 selectedIDs = selectedIDs.concat([datum2.id]);
81467 newMode = mode.selectedIDs(selectedIDs);
81468 context.enter(newMode);
81471 } else if (datum2 && datum2.__featurehash__ && !isMultiselect) {
81472 context.selectedNoteID(null).enter(modeSelectData(context, datum2));
81473 } else if (datum2 instanceof osmNote && !isMultiselect) {
81474 context.selectedNoteID(datum2.id).enter(modeSelectNote(context, datum2.id));
81475 } else if (datum2 instanceof QAItem && !isMultiselect) {
81476 context.selectedErrorID(datum2.id).enter(modeSelectError(context, datum2.id, datum2.service));
81478 context.selectedNoteID(null);
81479 context.selectedErrorID(null);
81480 if (!isMultiselect && mode.id !== "browse") {
81481 context.enter(modeBrowse(context));
81484 context.ui().closeEditMenu();
81486 context.ui().showEditMenu(point2, interactionType);
81489 function cancelLongPress() {
81490 if (_longPressTimeout)
81491 window.clearTimeout(_longPressTimeout);
81492 _longPressTimeout = null;
81494 function resetProperties() {
81497 _lastInteractionType = null;
81499 function behavior(selection2) {
81501 _lastMouseEvent = context.map().lastPointerEvent();
81502 select_default2(window).on("keydown.select", keydown).on("keyup.select", keyup).on(_pointerPrefix + "move.select", pointermove, true).on(_pointerPrefix + "up.select", pointerup, true).on("pointercancel.select", pointercancel, true).on("contextmenu.select-window", function(d3_event) {
81504 if (+e3.clientX === 0 && +e3.clientY === 0) {
81505 d3_event.preventDefault();
81508 selection2.on(_pointerPrefix + "down.select", pointerdown).on("contextmenu.select", contextmenu);
81510 behavior.off = function(selection2) {
81512 select_default2(window).on("keydown.select", null).on("keyup.select", null).on("contextmenu.select-window", null).on(_pointerPrefix + "move.select", null, true).on(_pointerPrefix + "up.select", null, true).on("pointercancel.select", null, true);
81513 selection2.on(_pointerPrefix + "down.select", null).on("contextmenu.select", null);
81514 context.surface().classed("behavior-multiselect", false);
81519 // modules/operations/index.js
81520 var operations_exports = {};
81521 __export(operations_exports, {
81522 operationCircularize: () => operationCircularize,
81523 operationContinue: () => operationContinue,
81524 operationCopy: () => operationCopy,
81525 operationDelete: () => operationDelete,
81526 operationDisconnect: () => operationDisconnect,
81527 operationDowngrade: () => operationDowngrade,
81528 operationExtract: () => operationExtract,
81529 operationMerge: () => operationMerge,
81530 operationMove: () => operationMove,
81531 operationOrthogonalize: () => operationOrthogonalize,
81532 operationPaste: () => operationPaste,
81533 operationReflectLong: () => operationReflectLong,
81534 operationReflectShort: () => operationReflectShort,
81535 operationReverse: () => operationReverse,
81536 operationRotate: () => operationRotate,
81537 operationSplit: () => operationSplit,
81538 operationStraighten: () => operationStraighten
81541 // modules/operations/continue.js
81542 function operationContinue(context, selectedIDs) {
81543 var _entities = selectedIDs.map(function(id2) {
81544 return context.graph().entity(id2);
81546 var _geometries = Object.assign(
81547 { line: [], vertex: [] },
81548 utilArrayGroupBy(_entities, function(entity) {
81549 return entity.geometry(context.graph());
81552 var _vertex = _geometries.vertex.length && _geometries.vertex[0];
81553 function candidateWays() {
81554 return _vertex ? context.graph().parentWays(_vertex).filter(function(parent) {
81555 return parent.geometry(context.graph()) === "line" && !parent.isClosed() && parent.affix(_vertex.id) && (_geometries.line.length === 0 || _geometries.line[0] === parent);
81558 var _candidates = candidateWays();
81559 var operation = function() {
81560 var candidate = _candidates[0];
81562 modeDrawLine(context, candidate.id, context.graph(), "line", candidate.affix(_vertex.id), true)
81565 operation.relatedEntityIds = function() {
81566 return _candidates.length ? [_candidates[0].id] : [];
81568 operation.available = function() {
81569 return _geometries.vertex.length === 1 && _geometries.line.length <= 1 && !context.features().hasHiddenConnections(_vertex, context.graph());
81571 operation.disabled = function() {
81572 if (_candidates.length === 0) {
81573 return "not_eligible";
81574 } else if (_candidates.length > 1) {
81579 operation.tooltip = function() {
81580 var disable = operation.disabled();
81581 return disable ? _t.append("operations.continue." + disable) : _t.append("operations.continue.description");
81583 operation.annotation = function() {
81584 return _t("operations.continue.annotation.line");
81586 operation.id = "continue";
81587 operation.keys = [_t("operations.continue.key")];
81588 operation.title = _t.append("operations.continue.title");
81589 operation.behavior = behaviorOperation(context).which(operation);
81593 // modules/operations/copy.js
81594 function operationCopy(context, selectedIDs) {
81595 function getFilteredIdsToCopy() {
81596 return selectedIDs.filter(function(selectedID) {
81597 var entity = context.graph().hasEntity(selectedID);
81598 return entity.hasInterestingTags() || entity.geometry(context.graph()) !== "vertex";
81601 var operation = function() {
81602 var graph = context.graph();
81603 var selected = groupEntities(getFilteredIdsToCopy(), graph);
81608 for (i3 = 0; i3 < selected.relation.length; i3++) {
81609 entity = selected.relation[i3];
81610 if (!skip[entity.id] && entity.isComplete(graph)) {
81611 canCopy.push(entity.id);
81612 skip = getDescendants(entity.id, graph, skip);
81615 for (i3 = 0; i3 < selected.way.length; i3++) {
81616 entity = selected.way[i3];
81617 if (!skip[entity.id]) {
81618 canCopy.push(entity.id);
81619 skip = getDescendants(entity.id, graph, skip);
81622 for (i3 = 0; i3 < selected.node.length; i3++) {
81623 entity = selected.node[i3];
81624 if (!skip[entity.id]) {
81625 canCopy.push(entity.id);
81628 context.copyIDs(canCopy);
81629 if (_point && (canCopy.length !== 1 || graph.entity(canCopy[0]).type !== "node")) {
81630 context.copyLonLat(context.projection.invert(_point));
81632 context.copyLonLat(null);
81635 function groupEntities(ids, graph) {
81636 var entities = ids.map(function(id2) {
81637 return graph.entity(id2);
81639 return Object.assign(
81640 { relation: [], way: [], node: [] },
81641 utilArrayGroupBy(entities, "type")
81644 function getDescendants(id2, graph, descendants) {
81645 var entity = graph.entity(id2);
81647 descendants = descendants || {};
81648 if (entity.type === "relation") {
81649 children2 = entity.members.map(function(m2) {
81652 } else if (entity.type === "way") {
81653 children2 = entity.nodes;
81657 for (var i3 = 0; i3 < children2.length; i3++) {
81658 if (!descendants[children2[i3]]) {
81659 descendants[children2[i3]] = true;
81660 descendants = getDescendants(children2[i3], graph, descendants);
81663 return descendants;
81665 operation.available = function() {
81666 return getFilteredIdsToCopy().length > 0;
81668 operation.disabled = function() {
81669 var extent = utilTotalExtent(getFilteredIdsToCopy(), context.graph());
81670 if (extent.percentContainedIn(context.map().extent()) < 0.8) {
81671 return "too_large";
81675 operation.availableForKeypress = function() {
81676 var selection2 = window.getSelection && window.getSelection();
81677 return !selection2 || !selection2.toString();
81679 operation.tooltip = function() {
81680 var disable = operation.disabled();
81681 return disable ? _t.append("operations.copy." + disable, { n: selectedIDs.length }) : _t.append("operations.copy.description", { n: selectedIDs.length });
81683 operation.annotation = function() {
81684 return _t("operations.copy.annotation", { n: selectedIDs.length });
81687 operation.point = function(val) {
81691 operation.id = "copy";
81692 operation.keys = [uiCmd("\u2318C")];
81693 operation.title = _t.append("operations.copy.title");
81694 operation.behavior = behaviorOperation(context).which(operation);
81698 // modules/operations/disconnect.js
81699 function operationDisconnect(context, selectedIDs) {
81700 var _vertexIDs = [];
81702 var _otherIDs = [];
81704 selectedIDs.forEach(function(id2) {
81705 var entity = context.entity(id2);
81706 if (entity.type === "way") {
81708 } else if (entity.geometry(context.graph()) === "vertex") {
81709 _vertexIDs.push(id2);
81711 _otherIDs.push(id2);
81714 var _coords, _descriptionID = "", _annotationID = "features";
81715 var _disconnectingVertexIds = [];
81716 var _disconnectingWayIds = [];
81717 if (_vertexIDs.length > 0) {
81718 _disconnectingVertexIds = _vertexIDs;
81719 _vertexIDs.forEach(function(vertexID) {
81720 var action = actionDisconnect(vertexID);
81721 if (_wayIDs.length > 0) {
81722 var waysIDsForVertex = _wayIDs.filter(function(wayID) {
81723 var way = context.entity(wayID);
81724 return way.nodes.indexOf(vertexID) !== -1;
81726 action.limitWays(waysIDsForVertex);
81728 _actions.push(action);
81729 _disconnectingWayIds = _disconnectingWayIds.concat(context.graph().parentWays(context.graph().entity(vertexID)).map((d2) => d2.id));
81731 _disconnectingWayIds = utilArrayUniq(_disconnectingWayIds).filter(function(id2) {
81732 return _wayIDs.indexOf(id2) === -1;
81734 _descriptionID += _actions.length === 1 ? "single_point." : "multiple_points.";
81735 if (_wayIDs.length === 1) {
81736 _descriptionID += "single_way." + context.graph().geometry(_wayIDs[0]);
81738 _descriptionID += _wayIDs.length === 0 ? "no_ways" : "multiple_ways";
81740 } else if (_wayIDs.length > 0) {
81741 var ways = _wayIDs.map(function(id2) {
81742 return context.entity(id2);
81744 var nodes = utilGetAllNodes(_wayIDs, context.graph());
81745 _coords = nodes.map(function(n3) {
81748 var sharedActions = [];
81749 var sharedNodes = [];
81750 var unsharedActions = [];
81751 var unsharedNodes = [];
81752 nodes.forEach(function(node) {
81753 var action = actionDisconnect(node.id).limitWays(_wayIDs);
81754 if (action.disabled(context.graph()) !== "not_connected") {
81756 for (var i3 in ways) {
81757 var way = ways[i3];
81758 if (way.nodes.indexOf(node.id) !== -1) {
81765 sharedActions.push(action);
81766 sharedNodes.push(node);
81768 unsharedActions.push(action);
81769 unsharedNodes.push(node);
81773 _descriptionID += "no_points.";
81774 _descriptionID += _wayIDs.length === 1 ? "single_way." : "multiple_ways.";
81775 if (sharedActions.length) {
81776 _actions = sharedActions;
81777 _disconnectingVertexIds = sharedNodes.map((node) => node.id);
81778 _descriptionID += "conjoined";
81779 _annotationID = "from_each_other";
81781 _actions = unsharedActions;
81782 _disconnectingVertexIds = unsharedNodes.map((node) => node.id);
81783 if (_wayIDs.length === 1) {
81784 _descriptionID += context.graph().geometry(_wayIDs[0]);
81786 _descriptionID += "separate";
81790 var _extent = utilTotalExtent(_disconnectingVertexIds, context.graph());
81791 var operation = function() {
81792 context.perform(function(graph) {
81793 return _actions.reduce(function(graph2, action) {
81794 return action(graph2);
81796 }, operation.annotation());
81797 context.validator().validate();
81799 operation.relatedEntityIds = function() {
81800 if (_vertexIDs.length) {
81801 return _disconnectingWayIds;
81803 return _disconnectingVertexIds;
81805 operation.available = function() {
81806 if (_actions.length === 0)
81808 if (_otherIDs.length !== 0)
81810 if (_vertexIDs.length !== 0 && _wayIDs.length !== 0 && !_wayIDs.every(function(wayID) {
81811 return _vertexIDs.some(function(vertexID) {
81812 var way = context.entity(wayID);
81813 return way.nodes.indexOf(vertexID) !== -1;
81819 operation.disabled = function() {
81821 for (var actionIndex in _actions) {
81822 reason = _actions[actionIndex].disabled(context.graph());
81826 if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
81827 return "too_large." + ((_vertexIDs.length ? _vertexIDs : _wayIDs).length === 1 ? "single" : "multiple");
81828 } else if (_coords && someMissing()) {
81829 return "not_downloaded";
81830 } else if (selectedIDs.some(context.hasHiddenConnections)) {
81831 return "connected_to_hidden";
81834 function someMissing() {
81835 if (context.inIntro())
81837 var osm = context.connection();
81839 var missing = _coords.filter(function(loc) {
81840 return !osm.isDataLoaded(loc);
81842 if (missing.length) {
81843 missing.forEach(function(loc) {
81844 context.loadTileAtLoc(loc);
81852 operation.tooltip = function() {
81853 var disable = operation.disabled();
81854 return disable ? _t.append("operations.disconnect." + disable) : _t.append("operations.disconnect.description." + _descriptionID);
81856 operation.annotation = function() {
81857 return _t("operations.disconnect.annotation." + _annotationID);
81859 operation.id = "disconnect";
81860 operation.keys = [_t("operations.disconnect.key")];
81861 operation.title = _t.append("operations.disconnect.title");
81862 operation.behavior = behaviorOperation(context).which(operation);
81866 // modules/operations/downgrade.js
81867 function operationDowngrade(context, selectedIDs) {
81868 var _affectedFeatureCount = 0;
81869 var _downgradeType = downgradeTypeForEntityIDs(selectedIDs);
81870 var _multi = _affectedFeatureCount === 1 ? "single" : "multiple";
81871 function downgradeTypeForEntityIDs(entityIds) {
81873 _affectedFeatureCount = 0;
81874 for (var i3 in entityIds) {
81875 var entityID = entityIds[i3];
81876 var type2 = downgradeTypeForEntityID(entityID);
81878 _affectedFeatureCount += 1;
81879 if (downgradeType && type2 !== downgradeType) {
81880 if (downgradeType !== "generic" && type2 !== "generic") {
81881 downgradeType = "building_address";
81883 downgradeType = "generic";
81886 downgradeType = type2;
81890 return downgradeType;
81892 function downgradeTypeForEntityID(entityID) {
81893 var graph = context.graph();
81894 var entity = graph.entity(entityID);
81895 var preset = _mainPresetIndex.match(entity, graph);
81896 if (!preset || preset.isFallback())
81898 if (entity.type === "node" && preset.id !== "address" && Object.keys(entity.tags).some(function(key) {
81899 return key.match(/^addr:.{1,}/);
81903 var geometry = entity.geometry(graph);
81904 if (geometry === "area" && entity.tags.building && !preset.tags.building) {
81907 if (geometry === "vertex" && Object.keys(entity.tags).length) {
81912 var buildingKeysToKeep = ["architect", "building", "height", "layer", "source", "type", "wheelchair"];
81913 var addressKeysToKeep = ["source"];
81914 var operation = function() {
81915 context.perform(function(graph) {
81916 for (var i3 in selectedIDs) {
81917 var entityID = selectedIDs[i3];
81918 var type2 = downgradeTypeForEntityID(entityID);
81921 var tags = Object.assign({}, graph.entity(entityID).tags);
81922 for (var key in tags) {
81923 if (type2 === "address" && addressKeysToKeep.indexOf(key) !== -1)
81925 if (type2 === "building") {
81926 if (buildingKeysToKeep.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/))
81929 if (type2 !== "generic") {
81930 if (key.match(/^addr:.{1,}/) || key.match(/^source:.{1,}/))
81935 graph = actionChangeTags(entityID, tags)(graph);
81938 }, operation.annotation());
81939 context.validator().validate();
81940 context.enter(modeSelect(context, selectedIDs));
81942 operation.available = function() {
81943 return _downgradeType;
81945 operation.disabled = function() {
81946 if (selectedIDs.some(hasWikidataTag)) {
81947 return "has_wikidata_tag";
81950 function hasWikidataTag(id2) {
81951 var entity = context.entity(id2);
81952 return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
81955 operation.tooltip = function() {
81956 var disable = operation.disabled();
81957 return disable ? _t.append("operations.downgrade." + disable + "." + _multi) : _t.append("operations.downgrade.description." + _downgradeType);
81959 operation.annotation = function() {
81961 if (_downgradeType === "building_address") {
81962 suffix = "generic";
81964 suffix = _downgradeType;
81966 return _t("operations.downgrade.annotation." + suffix, { n: _affectedFeatureCount });
81968 operation.id = "downgrade";
81969 operation.keys = [uiCmd("\u232B")];
81970 operation.title = _t.append("operations.downgrade.title");
81971 operation.behavior = behaviorOperation(context).which(operation);
81975 // modules/operations/extract.js
81976 function operationExtract(context, selectedIDs) {
81977 var _amount = selectedIDs.length === 1 ? "single" : "multiple";
81978 var _geometries = utilArrayUniq(selectedIDs.map(function(entityID) {
81979 return context.graph().hasEntity(entityID) && context.graph().geometry(entityID);
81980 }).filter(Boolean));
81981 var _geometryID = _geometries.length === 1 ? _geometries[0] : "feature";
81983 var _actions = selectedIDs.map(function(entityID) {
81984 var graph = context.graph();
81985 var entity = graph.hasEntity(entityID);
81986 if (!entity || !entity.hasInterestingTags())
81988 if (entity.type === "node" && graph.parentWays(entity).length === 0)
81990 if (entity.type !== "node") {
81991 var preset = _mainPresetIndex.match(entity, graph);
81992 if (preset.geometry.indexOf("point") === -1)
81995 _extent = _extent ? _extent.extend(entity.extent(graph)) : entity.extent(graph);
81996 return actionExtract(entityID, context.projection);
81997 }).filter(Boolean);
81998 var operation = function() {
81999 var combinedAction = function(graph) {
82000 _actions.forEach(function(action) {
82001 graph = action(graph);
82005 context.perform(combinedAction, operation.annotation());
82006 var extractedNodeIDs = _actions.map(function(action) {
82007 return action.getExtractedNodeID();
82009 context.enter(modeSelect(context, extractedNodeIDs));
82011 operation.available = function() {
82012 return _actions.length && selectedIDs.length === _actions.length;
82014 operation.disabled = function() {
82015 if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
82016 return "too_large";
82017 } else if (selectedIDs.some(function(entityID) {
82018 return context.graph().geometry(entityID) === "vertex" && context.hasHiddenConnections(entityID);
82020 return "connected_to_hidden";
82024 operation.tooltip = function() {
82025 var disableReason = operation.disabled();
82026 if (disableReason) {
82027 return _t.append("operations.extract." + disableReason + "." + _amount);
82029 return _t.append("operations.extract.description." + _geometryID + "." + _amount);
82032 operation.annotation = function() {
82033 return _t("operations.extract.annotation", { n: selectedIDs.length });
82035 operation.id = "extract";
82036 operation.keys = [_t("operations.extract.key")];
82037 operation.title = _t.append("operations.extract.title");
82038 operation.behavior = behaviorOperation(context).which(operation);
82042 // modules/operations/merge.js
82043 function operationMerge(context, selectedIDs) {
82044 var _action = getAction();
82045 function getAction() {
82046 var join = actionJoin(selectedIDs);
82047 if (!join.disabled(context.graph()))
82049 var merge2 = actionMerge(selectedIDs);
82050 if (!merge2.disabled(context.graph()))
82052 var mergePolygon = actionMergePolygon(selectedIDs);
82053 if (!mergePolygon.disabled(context.graph()))
82054 return mergePolygon;
82055 var mergeNodes = actionMergeNodes(selectedIDs);
82056 if (!mergeNodes.disabled(context.graph()))
82058 if (join.disabled(context.graph()) !== "not_eligible")
82060 if (merge2.disabled(context.graph()) !== "not_eligible")
82062 if (mergePolygon.disabled(context.graph()) !== "not_eligible")
82063 return mergePolygon;
82066 var operation = function() {
82067 if (operation.disabled())
82069 context.perform(_action, operation.annotation());
82070 context.validator().validate();
82071 var resultIDs = selectedIDs.filter(context.hasEntity);
82072 if (resultIDs.length > 1) {
82073 var interestingIDs = resultIDs.filter(function(id2) {
82074 return context.entity(id2).hasInterestingTags();
82076 if (interestingIDs.length)
82077 resultIDs = interestingIDs;
82079 context.enter(modeSelect(context, resultIDs));
82081 operation.available = function() {
82082 return selectedIDs.length >= 2;
82084 operation.disabled = function() {
82085 var actionDisabled = _action.disabled(context.graph());
82086 if (actionDisabled)
82087 return actionDisabled;
82088 var osm = context.connection();
82089 if (osm && _action.resultingWayNodesLength && _action.resultingWayNodesLength(context.graph()) > osm.maxWayNodes()) {
82090 return "too_many_vertices";
82094 operation.tooltip = function() {
82095 var disabled = operation.disabled();
82097 if (disabled === "conflicting_relations") {
82098 return _t.append("operations.merge.conflicting_relations");
82100 if (disabled === "restriction" || disabled === "connectivity") {
82102 "operations.merge.damage_relation",
82103 { relation: _mainPresetIndex.item("type/" + disabled).name() }
82106 return _t.append("operations.merge." + disabled);
82108 return _t.append("operations.merge.description");
82110 operation.annotation = function() {
82111 return _t("operations.merge.annotation", { n: selectedIDs.length });
82113 operation.id = "merge";
82114 operation.keys = [_t("operations.merge.key")];
82115 operation.title = _t.append("operations.merge.title");
82116 operation.behavior = behaviorOperation(context).which(operation);
82120 // modules/operations/paste.js
82121 function operationPaste(context) {
82123 var operation = function() {
82126 var oldIDs = context.copyIDs();
82127 if (!oldIDs.length)
82129 var projection2 = context.projection;
82130 var extent = geoExtent();
82131 var oldGraph = context.copyGraph();
82133 var action = actionCopyEntities(oldIDs, oldGraph);
82134 context.perform(action);
82135 var copies = action.copies();
82136 var originals = /* @__PURE__ */ new Set();
82137 Object.values(copies).forEach(function(entity) {
82138 originals.add(entity.id);
82140 for (var id2 in copies) {
82141 var oldEntity = oldGraph.entity(id2);
82142 var newEntity = copies[id2];
82143 extent._extend(oldEntity.extent(oldGraph));
82144 var parents = context.graph().parentWays(newEntity);
82145 var parentCopied = parents.some(function(parent) {
82146 return originals.has(parent.id);
82148 if (!parentCopied) {
82149 newIDs.push(newEntity.id);
82152 var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
82153 var delta = geoVecSubtract(_pastePoint, copyPoint);
82154 context.replace(actionMove(newIDs, delta, projection2), operation.annotation());
82155 context.enter(modeSelect(context, newIDs));
82157 operation.point = function(val) {
82161 operation.available = function() {
82162 return context.mode().id === "browse";
82164 operation.disabled = function() {
82165 return !context.copyIDs().length;
82167 operation.tooltip = function() {
82168 var oldGraph = context.copyGraph();
82169 var ids = context.copyIDs();
82171 return _t.append("operations.paste.nothing_copied");
82173 return _t.append("operations.paste.description", { feature: utilDisplayLabel(oldGraph.entity(ids[0]), oldGraph), n: ids.length });
82175 operation.annotation = function() {
82176 var ids = context.copyIDs();
82177 return _t("operations.paste.annotation", { n: ids.length });
82179 operation.id = "paste";
82180 operation.keys = [uiCmd("\u2318V")];
82181 operation.title = _t.append("operations.paste.title");
82185 // modules/operations/reverse.js
82186 function operationReverse(context, selectedIDs) {
82187 var operation = function() {
82188 context.perform(function combinedReverseAction(graph) {
82189 actions().forEach(function(action) {
82190 graph = action(graph);
82193 }, operation.annotation());
82194 context.validator().validate();
82196 function actions(situation) {
82197 return selectedIDs.map(function(entityID) {
82198 var entity = context.hasEntity(entityID);
82201 if (situation === "toolbar") {
82202 if (entity.type === "way" && (!entity.isOneWay() && !entity.isSided()))
82205 var geometry = entity.geometry(context.graph());
82206 if (entity.type !== "node" && geometry !== "line")
82208 var action = actionReverse(entityID);
82209 if (action.disabled(context.graph()))
82212 }).filter(Boolean);
82214 function reverseTypeID() {
82215 var acts = actions();
82216 var nodeActionCount = acts.filter(function(act) {
82217 var entity = context.hasEntity(act.entityID());
82218 return entity && entity.type === "node";
82220 if (nodeActionCount === 0)
82222 if (nodeActionCount === acts.length)
82226 operation.available = function(situation) {
82227 return actions(situation).length > 0;
82229 operation.disabled = function() {
82232 operation.tooltip = function() {
82233 return _t.append("operations.reverse.description." + reverseTypeID());
82235 operation.annotation = function() {
82236 var acts = actions();
82237 return _t("operations.reverse.annotation." + reverseTypeID(), { n: acts.length });
82239 operation.id = "reverse";
82240 operation.keys = [_t("operations.reverse.key")];
82241 operation.title = _t.append("operations.reverse.title");
82242 operation.behavior = behaviorOperation(context).which(operation);
82246 // modules/operations/split.js
82247 function operationSplit(context, selectedIDs) {
82248 var _vertexIds = selectedIDs.filter(function(id2) {
82249 return context.graph().geometry(id2) === "vertex";
82251 var _selectedWayIds = selectedIDs.filter(function(id2) {
82252 var entity = context.graph().hasEntity(id2);
82253 return entity && entity.type === "way";
82255 var _isAvailable = _vertexIds.length > 0 && _vertexIds.length + _selectedWayIds.length === selectedIDs.length;
82256 var _action = actionSplit(_vertexIds);
82258 var _geometry = "feature";
82259 var _waysAmount = "single";
82260 var _nodesAmount = _vertexIds.length === 1 ? "single" : "multiple";
82261 if (_isAvailable) {
82262 if (_selectedWayIds.length)
82263 _action.limitWays(_selectedWayIds);
82264 _ways = _action.ways(context.graph());
82265 var geometries = {};
82266 _ways.forEach(function(way) {
82267 geometries[way.geometry(context.graph())] = true;
82269 if (Object.keys(geometries).length === 1) {
82270 _geometry = Object.keys(geometries)[0];
82272 _waysAmount = _ways.length === 1 ? "single" : "multiple";
82274 var operation = function() {
82275 var difference = context.perform(_action, operation.annotation());
82276 var idsToSelect = _vertexIds.concat(difference.extantIDs().filter(function(id2) {
82277 return context.entity(id2).type === "way";
82279 context.enter(modeSelect(context, idsToSelect));
82281 operation.relatedEntityIds = function() {
82282 return _selectedWayIds.length ? [] : _ways.map((way) => way.id);
82284 operation.available = function() {
82285 return _isAvailable;
82287 operation.disabled = function() {
82288 var reason = _action.disabled(context.graph());
82291 } else if (selectedIDs.some(context.hasHiddenConnections)) {
82292 return "connected_to_hidden";
82296 operation.tooltip = function() {
82297 var disable = operation.disabled();
82298 return disable ? _t.append("operations.split." + disable) : _t.append("operations.split.description." + _geometry + "." + _waysAmount + "." + _nodesAmount + "_node");
82300 operation.annotation = function() {
82301 return _t("operations.split.annotation." + _geometry, { n: _ways.length });
82303 operation.icon = function() {
82304 if (_waysAmount === "multiple") {
82305 return "#iD-operation-split-multiple";
82307 return "#iD-operation-split";
82310 operation.id = "split";
82311 operation.keys = [_t("operations.split.key")];
82312 operation.title = _t.append("operations.split.title");
82313 operation.behavior = behaviorOperation(context).which(operation);
82317 // modules/operations/straighten.js
82318 function operationStraighten(context, selectedIDs) {
82319 var _wayIDs = selectedIDs.filter(function(id2) {
82320 return id2.charAt(0) === "w";
82322 var _nodeIDs = selectedIDs.filter(function(id2) {
82323 return id2.charAt(0) === "n";
82325 var _amount = (_wayIDs.length ? _wayIDs : _nodeIDs).length === 1 ? "single" : "multiple";
82326 var _nodes = utilGetAllNodes(selectedIDs, context.graph());
82327 var _coords = _nodes.map(function(n3) {
82330 var _extent = utilTotalExtent(selectedIDs, context.graph());
82331 var _action = chooseAction();
82333 function chooseAction() {
82334 if (_wayIDs.length === 0 && _nodeIDs.length > 2) {
82335 _geometry = "point";
82336 return actionStraightenNodes(_nodeIDs, context.projection);
82337 } else if (_wayIDs.length > 0 && (_nodeIDs.length === 0 || _nodeIDs.length === 2)) {
82338 var startNodeIDs = [];
82339 var endNodeIDs = [];
82340 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
82341 var entity = context.entity(selectedIDs[i3]);
82342 if (entity.type === "node") {
82344 } else if (entity.type !== "way" || entity.isClosed()) {
82347 startNodeIDs.push(entity.first());
82348 endNodeIDs.push(entity.last());
82350 startNodeIDs = startNodeIDs.filter(function(n3) {
82351 return startNodeIDs.indexOf(n3) === startNodeIDs.lastIndexOf(n3);
82353 endNodeIDs = endNodeIDs.filter(function(n3) {
82354 return endNodeIDs.indexOf(n3) === endNodeIDs.lastIndexOf(n3);
82356 if (utilArrayDifference(startNodeIDs, endNodeIDs).length + utilArrayDifference(endNodeIDs, startNodeIDs).length !== 2)
82358 var wayNodeIDs = utilGetAllNodes(_wayIDs, context.graph()).map(function(node) {
82361 if (wayNodeIDs.length <= 2)
82363 if (_nodeIDs.length === 2 && (wayNodeIDs.indexOf(_nodeIDs[0]) === -1 || wayNodeIDs.indexOf(_nodeIDs[1]) === -1))
82365 if (_nodeIDs.length) {
82366 _extent = utilTotalExtent(_nodeIDs, context.graph());
82368 _geometry = "line";
82369 return actionStraightenWay(selectedIDs, context.projection);
82373 function operation() {
82376 context.perform(_action, operation.annotation());
82377 window.setTimeout(function() {
82378 context.validator().validate();
82381 operation.available = function() {
82382 return Boolean(_action);
82384 operation.disabled = function() {
82385 var reason = _action.disabled(context.graph());
82388 } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
82389 return "too_large";
82390 } else if (someMissing()) {
82391 return "not_downloaded";
82392 } else if (selectedIDs.some(context.hasHiddenConnections)) {
82393 return "connected_to_hidden";
82396 function someMissing() {
82397 if (context.inIntro())
82399 var osm = context.connection();
82401 var missing = _coords.filter(function(loc) {
82402 return !osm.isDataLoaded(loc);
82404 if (missing.length) {
82405 missing.forEach(function(loc) {
82406 context.loadTileAtLoc(loc);
82414 operation.tooltip = function() {
82415 var disable = operation.disabled();
82416 return disable ? _t.append("operations.straighten." + disable + "." + _amount) : _t.append("operations.straighten.description." + _geometry + (_wayIDs.length === 1 ? "" : "s"));
82418 operation.annotation = function() {
82419 return _t("operations.straighten.annotation." + _geometry, { n: _wayIDs.length ? _wayIDs.length : _nodeIDs.length });
82421 operation.id = "straighten";
82422 operation.keys = [_t("operations.straighten.key")];
82423 operation.title = _t.append("operations.straighten.title");
82424 operation.behavior = behaviorOperation(context).which(operation);
82428 // modules/modes/select.js
82429 function modeSelect(context, selectedIDs) {
82434 var keybinding = utilKeybinding("select");
82435 var _breatheBehavior = behaviorBreathe(context);
82436 var _modeDragNode = modeDragNode(context);
82437 var _selectBehavior;
82438 var _behaviors = [];
82439 var _operations = [];
82440 var _newFeature = false;
82441 var _follow = false;
82442 var _focusedParentWayId;
82443 var _focusedVertexIds;
82444 function singular() {
82445 if (selectedIDs && selectedIDs.length === 1) {
82446 return context.hasEntity(selectedIDs[0]);
82449 function selectedEntities() {
82450 return selectedIDs.map(function(id2) {
82451 return context.hasEntity(id2);
82452 }).filter(Boolean);
82454 function checkSelectedIDs() {
82456 if (Array.isArray(selectedIDs)) {
82457 ids = selectedIDs.filter(function(id2) {
82458 return context.hasEntity(id2);
82462 context.enter(modeBrowse(context));
82464 } else if (selectedIDs.length > 1 && ids.length === 1 || selectedIDs.length === 1 && ids.length > 1) {
82465 context.enter(modeSelect(context, ids));
82471 function parentWaysIdsOfSelection(onlyCommonParents) {
82472 var graph = context.graph();
82474 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
82475 var entity = context.hasEntity(selectedIDs[i3]);
82476 if (!entity || entity.geometry(graph) !== "vertex") {
82479 var currParents = graph.parentWays(entity).map(function(w2) {
82482 if (!parents.length) {
82483 parents = currParents;
82486 parents = (onlyCommonParents ? utilArrayIntersection : utilArrayUnion)(parents, currParents);
82487 if (!parents.length) {
82493 function childNodeIdsOfSelection(onlyCommon) {
82494 var graph = context.graph();
82496 for (var i3 = 0; i3 < selectedIDs.length; i3++) {
82497 var entity = context.hasEntity(selectedIDs[i3]);
82498 if (!entity || !["area", "line"].includes(entity.geometry(graph))) {
82501 var currChilds = graph.childNodes(entity).map(function(node) {
82504 if (!childs.length) {
82505 childs = currChilds;
82508 childs = (onlyCommon ? utilArrayIntersection : utilArrayUnion)(childs, currChilds);
82509 if (!childs.length) {
82515 function checkFocusedParent() {
82516 if (_focusedParentWayId) {
82517 var parents = parentWaysIdsOfSelection(true);
82518 if (parents.indexOf(_focusedParentWayId) === -1)
82519 _focusedParentWayId = null;
82522 function parentWayIdForVertexNavigation() {
82523 var parentIds = parentWaysIdsOfSelection(true);
82524 if (_focusedParentWayId && parentIds.indexOf(_focusedParentWayId) !== -1) {
82525 return _focusedParentWayId;
82527 return parentIds.length ? parentIds[0] : null;
82529 mode.selectedIDs = function(val) {
82530 if (!arguments.length)
82531 return selectedIDs;
82535 mode.zoomToSelected = function() {
82536 context.map().zoomToEase(selectedEntities());
82538 mode.newFeature = function(val) {
82539 if (!arguments.length)
82540 return _newFeature;
82544 mode.selectBehavior = function(val) {
82545 if (!arguments.length)
82546 return _selectBehavior;
82547 _selectBehavior = val;
82550 mode.follow = function(val) {
82551 if (!arguments.length)
82556 function loadOperations() {
82557 _operations.forEach(function(operation) {
82558 if (operation.behavior) {
82559 context.uninstall(operation.behavior);
82562 _operations = Object.values(operations_exports).map(function(o2) {
82563 return o2(context, selectedIDs);
82564 }).filter(function(o2) {
82565 return o2.id !== "delete" && o2.id !== "downgrade" && o2.id !== "copy";
82567 // group copy/downgrade/delete operation together at the end of the list
82568 operationCopy(context, selectedIDs),
82569 operationDowngrade(context, selectedIDs),
82570 operationDelete(context, selectedIDs)
82571 ]).filter(function(operation) {
82572 return operation.available();
82574 _operations.forEach(function(operation) {
82575 if (operation.behavior) {
82576 context.install(operation.behavior);
82579 context.ui().closeEditMenu();
82581 mode.operations = function() {
82582 return _operations;
82584 mode.enter = function() {
82585 if (!checkSelectedIDs())
82587 context.features().forceVisible(selectedIDs);
82588 _modeDragNode.restoreSelectedIDs(selectedIDs);
82590 if (!_behaviors.length) {
82591 if (!_selectBehavior)
82592 _selectBehavior = behaviorSelect(context);
82594 behaviorPaste(context),
82596 behaviorHover(context).on("hover", context.ui().sidebar.hoverModeSelect),
82598 behaviorLasso(context),
82599 _modeDragNode.behavior,
82600 modeDragNote(context).behavior
82603 _behaviors.forEach(context.install);
82604 keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on(["[", "pgup"], previousVertex).on(["]", "pgdown"], nextVertex).on(["{", uiCmd("\u2318["), "home"], firstVertex).on(["}", uiCmd("\u2318]"), "end"], lastVertex).on(uiCmd("\u21E7\u2190"), nudgeSelection([-10, 0])).on(uiCmd("\u21E7\u2191"), nudgeSelection([0, -10])).on(uiCmd("\u21E7\u2192"), nudgeSelection([10, 0])).on(uiCmd("\u21E7\u2193"), nudgeSelection([0, 10])).on(uiCmd("\u21E7\u2325\u2190"), nudgeSelection([-100, 0])).on(uiCmd("\u21E7\u2325\u2191"), nudgeSelection([0, -100])).on(uiCmd("\u21E7\u2325\u2192"), nudgeSelection([100, 0])).on(uiCmd("\u21E7\u2325\u2193"), nudgeSelection([0, 100])).on(utilKeybinding.plusKeys.map((key) => uiCmd("\u21E7" + key)), scaleSelection(1.05)).on(utilKeybinding.plusKeys.map((key) => uiCmd("\u21E7\u2325" + key)), scaleSelection(Math.pow(1.05, 5))).on(utilKeybinding.minusKeys.map((key) => uiCmd("\u21E7" + key)), scaleSelection(1 / 1.05)).on(utilKeybinding.minusKeys.map((key) => uiCmd("\u21E7\u2325" + key)), scaleSelection(1 / Math.pow(1.05, 5))).on(["\\", "pause"], focusNextParent).on(uiCmd("\u2318\u2191"), selectParent).on(uiCmd("\u2318\u2193"), selectChild).on("\u238B", esc, true);
82605 select_default2(document).call(keybinding);
82606 context.ui().sidebar.select(selectedIDs, _newFeature);
82607 context.history().on("change.select", function() {
82610 }).on("undone.select", checkSelectedIDs).on("redone.select", checkSelectedIDs);
82611 context.map().on("drawn.select", selectElements).on("crossEditableZoom.select", function() {
82613 _breatheBehavior.restartIfNeeded(context.surface());
82615 context.map().doubleUpHandler().on("doubleUp.modeSelect", didDoubleUp);
82618 var extent = geoExtent();
82619 var graph = context.graph();
82620 selectedIDs.forEach(function(id2) {
82621 var entity = context.entity(id2);
82622 extent._extend(entity.extent(graph));
82624 var loc = extent.center();
82625 context.map().centerEase(loc);
82628 function nudgeSelection(delta) {
82629 return function() {
82630 if (!context.map().withinEditableZoom())
82632 var moveOp = operationMove(context, selectedIDs);
82633 if (moveOp.disabled()) {
82634 context.ui().flash.duration(4e3).iconName("#iD-operation-" + moveOp.id).iconClass("operation disabled").label(moveOp.tooltip())();
82636 context.perform(actionMove(selectedIDs, delta, context.projection), moveOp.annotation());
82637 context.validator().validate();
82641 function scaleSelection(factor) {
82642 return function() {
82643 if (!context.map().withinEditableZoom())
82645 let nodes = utilGetAllNodes(selectedIDs, context.graph());
82646 let isUp = factor > 1;
82647 if (nodes.length <= 1)
82649 let extent2 = utilTotalExtent(selectedIDs, context.graph());
82650 function scalingDisabled() {
82652 return "too_small";
82653 } else if (extent2.percentContainedIn(context.map().extent()) < 0.8) {
82654 return "too_large";
82655 } else if (someMissing() || selectedIDs.some(incompleteRelation)) {
82656 return "not_downloaded";
82657 } else if (selectedIDs.some(context.hasHiddenConnections)) {
82658 return "connected_to_hidden";
82661 function tooSmall() {
82664 let dLon = Math.abs(extent2[1][0] - extent2[0][0]);
82665 let dLat = Math.abs(extent2[1][1] - extent2[0][1]);
82666 return dLon < geoMetersToLon(1, extent2[1][1]) && dLat < geoMetersToLat(1);
82668 function someMissing() {
82669 if (context.inIntro())
82671 let osm = context.connection();
82673 let missing = nodes.filter(function(n3) {
82674 return !osm.isDataLoaded(n3.loc);
82676 if (missing.length) {
82677 missing.forEach(function(loc2) {
82678 context.loadTileAtLoc(loc2);
82685 function incompleteRelation(id2) {
82686 let entity = context.entity(id2);
82687 return entity.type === "relation" && !entity.isComplete(context.graph());
82690 const disabled = scalingDisabled();
82692 let multi = selectedIDs.length === 1 ? "single" : "multiple";
82693 context.ui().flash.duration(4e3).iconName("#iD-icon-no").iconClass("operation disabled").label(_t.append("operations.scale." + disabled + "." + multi))();
82695 const pivot = context.projection(extent2.center());
82696 const annotation = _t("operations.scale.annotation." + (isUp ? "up" : "down") + ".feature", { n: selectedIDs.length });
82697 context.perform(actionScale(selectedIDs, pivot, factor, context.projection), annotation);
82698 context.validator().validate();
82702 function didDoubleUp(d3_event, loc2) {
82703 if (!context.map().withinEditableZoom())
82705 var target = select_default2(d3_event.target);
82706 var datum2 = target.datum();
82707 var entity = datum2 && datum2.properties && datum2.properties.entity;
82710 if (entity instanceof osmWay && target.classed("target")) {
82711 var choice = geoChooseEdge(context.graph().childNodes(entity), loc2, context.projection);
82712 var prev = entity.nodes[choice.index - 1];
82713 var next = entity.nodes[choice.index];
82715 actionAddMidpoint({ loc: choice.loc, edge: [prev, next] }, osmNode()),
82716 _t("operations.add.annotation.vertex")
82718 context.validator().validate();
82719 } else if (entity.type === "midpoint") {
82721 actionAddMidpoint({ loc: entity.loc, edge: entity.edge }, osmNode()),
82722 _t("operations.add.annotation.vertex")
82724 context.validator().validate();
82727 function selectElements() {
82728 if (!checkSelectedIDs())
82730 var surface = context.surface();
82731 surface.selectAll(".selected-member").classed("selected-member", false);
82732 surface.selectAll(".selected").classed("selected", false);
82733 surface.selectAll(".related").classed("related", false);
82734 checkFocusedParent();
82735 if (_focusedParentWayId) {
82736 surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
82738 if (context.map().withinEditableZoom()) {
82739 surface.selectAll(utilDeepMemberSelector(
82743 /* skipMultipolgonMembers */
82744 )).classed("selected-member", true);
82745 surface.selectAll(utilEntityOrDeepMemberSelector(selectedIDs, context.graph())).classed("selected", true);
82749 if (context.container().select(".combobox").size())
82751 context.enter(modeBrowse(context));
82753 function firstVertex(d3_event) {
82754 d3_event.preventDefault();
82755 var entity = singular();
82756 var parentId = parentWayIdForVertexNavigation();
82758 if (entity && entity.type === "way") {
82760 } else if (parentId) {
82761 way = context.entity(parentId);
82763 _focusedParentWayId = way && way.id;
82766 mode.selectedIDs([way.first()]).follow(true)
82770 function lastVertex(d3_event) {
82771 d3_event.preventDefault();
82772 var entity = singular();
82773 var parentId = parentWayIdForVertexNavigation();
82775 if (entity && entity.type === "way") {
82777 } else if (parentId) {
82778 way = context.entity(parentId);
82780 _focusedParentWayId = way && way.id;
82783 mode.selectedIDs([way.last()]).follow(true)
82787 function previousVertex(d3_event) {
82788 d3_event.preventDefault();
82789 var parentId = parentWayIdForVertexNavigation();
82790 _focusedParentWayId = parentId;
82793 var way = context.entity(parentId);
82794 var length = way.nodes.length;
82795 var curr = way.nodes.indexOf(selectedIDs[0]);
82799 } else if (way.isClosed()) {
82800 index = length - 2;
82802 if (index !== -1) {
82804 mode.selectedIDs([way.nodes[index]]).follow(true)
82808 function nextVertex(d3_event) {
82809 d3_event.preventDefault();
82810 var parentId = parentWayIdForVertexNavigation();
82811 _focusedParentWayId = parentId;
82814 var way = context.entity(parentId);
82815 var length = way.nodes.length;
82816 var curr = way.nodes.indexOf(selectedIDs[0]);
82818 if (curr < length - 1) {
82820 } else if (way.isClosed()) {
82823 if (index !== -1) {
82825 mode.selectedIDs([way.nodes[index]]).follow(true)
82829 function focusNextParent(d3_event) {
82830 d3_event.preventDefault();
82831 var parents = parentWaysIdsOfSelection(true);
82832 if (!parents || parents.length < 2)
82834 var index = parents.indexOf(_focusedParentWayId);
82835 if (index < 0 || index > parents.length - 2) {
82836 _focusedParentWayId = parents[0];
82838 _focusedParentWayId = parents[index + 1];
82840 var surface = context.surface();
82841 surface.selectAll(".related").classed("related", false);
82842 if (_focusedParentWayId) {
82843 surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
82846 function selectParent(d3_event) {
82847 d3_event.preventDefault();
82848 var currentSelectedIds = mode.selectedIDs();
82849 var parentIds = _focusedParentWayId ? [_focusedParentWayId] : parentWaysIdsOfSelection(false);
82850 if (!parentIds.length)
82853 mode.selectedIDs(parentIds)
82855 _focusedVertexIds = currentSelectedIds;
82857 function selectChild(d3_event) {
82858 d3_event.preventDefault();
82859 var currentSelectedIds = mode.selectedIDs();
82860 var childIds = _focusedVertexIds ? _focusedVertexIds.filter((id2) => context.hasEntity(id2)) : childNodeIdsOfSelection(true);
82861 if (!childIds || !childIds.length)
82863 if (currentSelectedIds.length === 1)
82864 _focusedParentWayId = currentSelectedIds[0];
82866 mode.selectedIDs(childIds)
82870 mode.exit = function() {
82871 _newFeature = false;
82872 _focusedVertexIds = null;
82873 _operations.forEach(function(operation) {
82874 if (operation.behavior) {
82875 context.uninstall(operation.behavior);
82879 _behaviors.forEach(context.uninstall);
82880 select_default2(document).call(keybinding.unbind);
82881 context.ui().closeEditMenu();
82882 context.history().on("change.select", null).on("undone.select", null).on("redone.select", null);
82883 var surface = context.surface();
82884 surface.selectAll(".selected-member").classed("selected-member", false);
82885 surface.selectAll(".selected").classed("selected", false);
82886 surface.selectAll(".highlighted").classed("highlighted", false);
82887 surface.selectAll(".related").classed("related", false);
82888 context.map().on("drawn.select", null);
82889 context.ui().sidebar.hide();
82890 context.features().forceVisible([]);
82891 var entity = singular();
82892 if (_newFeature && entity && entity.type === "relation" && // no tags
82893 Object.keys(entity.tags).length === 0 && // no parent relations
82894 context.graph().parentRelations(entity).length === 0 && // no members or one member with no role
82895 (entity.members.length === 0 || entity.members.length === 1 && !entity.members[0].role)) {
82896 var deleteAction = actionDeleteRelation(
82899 /* don't delete untagged members */
82901 context.perform(deleteAction, _t("operations.delete.annotation.relation"));
82902 context.validator().validate();
82908 // modules/behavior/lasso.js
82909 function behaviorLasso(context) {
82910 var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
82911 var behavior = function(selection2) {
82913 function pointerdown(d3_event) {
82915 if (d3_event.button === button && d3_event.shiftKey === true) {
82917 select_default2(window).on(_pointerPrefix + "move.lasso", pointermove).on(_pointerPrefix + "up.lasso", pointerup);
82918 d3_event.stopPropagation();
82921 function pointermove() {
82923 lasso = uiLasso(context);
82924 context.surface().call(lasso);
82926 lasso.p(context.map().mouse());
82928 function normalize2(a2, b2) {
82930 [Math.min(a2[0], b2[0]), Math.min(a2[1], b2[1])],
82931 [Math.max(a2[0], b2[0]), Math.max(a2[1], b2[1])]
82934 function lassoed() {
82937 var graph = context.graph();
82939 if (context.map().editableDataEnabled(
82941 /* skipZoomCheck */
82942 ) && context.map().isInWideSelection()) {
82943 limitToNodes = new Set(utilGetAllNodes(context.selectedIDs(), graph));
82944 } else if (!context.map().editableDataEnabled()) {
82947 var bounds = lasso.extent().map(context.projection.invert);
82948 var extent = geoExtent(normalize2(bounds[0], bounds[1]));
82949 var intersects = context.history().intersects(extent).filter(function(entity) {
82950 return entity.type === "node" && (!limitToNodes || limitToNodes.has(entity)) && geoPointInPolygon(context.projection(entity.loc), lasso.coordinates) && !context.features().isHidden(entity, graph, entity.geometry(graph));
82952 intersects.sort(function(node1, node2) {
82953 var parents1 = graph.parentWays(node1);
82954 var parents2 = graph.parentWays(node2);
82955 if (parents1.length && parents2.length) {
82956 var sharedParents = utilArrayIntersection(parents1, parents2);
82957 if (sharedParents.length) {
82958 var sharedParentNodes = sharedParents[0].nodes;
82959 return sharedParentNodes.indexOf(node1.id) - sharedParentNodes.indexOf(node2.id);
82961 return Number(parents1[0].id.slice(1)) - Number(parents2[0].id.slice(1));
82963 } else if (parents1.length || parents2.length) {
82964 return parents1.length - parents2.length;
82966 return node1.loc[0] - node2.loc[0];
82968 return intersects.map(function(entity) {
82972 function pointerup() {
82973 select_default2(window).on(_pointerPrefix + "move.lasso", null).on(_pointerPrefix + "up.lasso", null);
82976 var ids = lassoed();
82979 context.enter(modeSelect(context, ids));
82982 selection2.on(_pointerPrefix + "down.lasso", pointerdown);
82984 behavior.off = function(selection2) {
82985 selection2.on(_pointerPrefix + "down.lasso", null);
82990 // modules/modes/browse.js
82991 function modeBrowse(context) {
82995 title: _t.append("modes.browse.title"),
82996 description: _t.append("modes.browse.description")
82999 var _selectBehavior;
83000 var _behaviors = [];
83001 mode.selectBehavior = function(val) {
83002 if (!arguments.length)
83003 return _selectBehavior;
83004 _selectBehavior = val;
83007 mode.enter = function() {
83008 if (!_behaviors.length) {
83009 if (!_selectBehavior)
83010 _selectBehavior = behaviorSelect(context);
83012 behaviorPaste(context),
83013 behaviorHover(context).on("hover", context.ui().sidebar.hover),
83015 behaviorLasso(context),
83016 modeDragNode(context).behavior,
83017 modeDragNote(context).behavior
83020 _behaviors.forEach(context.install);
83021 if (document.activeElement && document.activeElement.blur) {
83022 document.activeElement.blur();
83025 context.ui().sidebar.show(sidebar);
83027 context.ui().sidebar.select(null);
83030 mode.exit = function() {
83031 context.ui().sidebar.hover.cancel();
83032 _behaviors.forEach(context.uninstall);
83034 context.ui().sidebar.hide();
83037 mode.sidebar = function(_2) {
83038 if (!arguments.length)
83043 mode.operations = function() {
83044 return [operationPaste(context)];
83049 // modules/behavior/add_way.js
83050 function behaviorAddWay(context) {
83051 var dispatch14 = dispatch_default("start", "startFromWay", "startFromNode");
83052 var draw = behaviorDraw(context);
83053 function behavior(surface) {
83054 draw.on("click", function() {
83055 dispatch14.apply("start", this, arguments);
83056 }).on("clickWay", function() {
83057 dispatch14.apply("startFromWay", this, arguments);
83058 }).on("clickNode", function() {
83059 dispatch14.apply("startFromNode", this, arguments);
83060 }).on("cancel", behavior.cancel).on("finish", behavior.cancel);
83061 context.map().dblclickZoomEnable(false);
83062 surface.call(draw);
83064 behavior.off = function(surface) {
83065 surface.call(draw.off);
83067 behavior.cancel = function() {
83068 window.setTimeout(function() {
83069 context.map().dblclickZoomEnable(true);
83071 context.enter(modeBrowse(context));
83073 return utilRebind(behavior, dispatch14, "on");
83076 // modules/behavior/hash.js
83077 function behaviorHash(context) {
83078 var _cachedHash = null;
83079 var _latitudeLimit = 90 - 1e-8;
83080 function computedHashParameters() {
83081 var map2 = context.map();
83082 var center = map2.center();
83083 var zoom = map2.zoom();
83084 var precision2 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
83085 var oldParams = utilObjectOmit(
83086 utilStringQs(window.location.hash),
83087 ["comment", "source", "hashtags", "walkthrough"]
83089 var newParams = {};
83090 delete oldParams.id;
83091 var selected = context.selectedIDs().filter(function(id2) {
83092 return context.hasEntity(id2);
83094 if (selected.length) {
83095 newParams.id = selected.join(",");
83097 newParams.map = zoom.toFixed(2) + "/" + center[1].toFixed(precision2) + "/" + center[0].toFixed(precision2);
83098 return Object.assign(oldParams, newParams);
83100 function computedHash() {
83101 return "#" + utilQsString(computedHashParameters(), true);
83103 function computedTitle(includeChangeCount) {
83104 var baseTitle = context.documentTitleBase() || "iD";
83108 var selected = context.selectedIDs().filter(function(id2) {
83109 return context.hasEntity(id2);
83111 if (selected.length) {
83112 var firstLabel = utilDisplayLabel(context.entity(selected[0]), context.graph());
83113 if (selected.length > 1) {
83114 contextual = _t("title.labeled_and_more", {
83115 labeled: firstLabel,
83116 count: selected.length - 1
83119 contextual = firstLabel;
83121 titleID = "context";
83123 if (includeChangeCount) {
83124 changeCount = context.history().difference().summary().length;
83125 if (changeCount > 0) {
83126 titleID = contextual ? "changes_context" : "changes";
83130 return _t("title.format." + titleID, {
83131 changes: changeCount,
83133 context: contextual
83138 function updateTitle(includeChangeCount) {
83139 if (!context.setsDocumentTitle())
83141 var newTitle = computedTitle(includeChangeCount);
83142 if (document.title !== newTitle) {
83143 document.title = newTitle;
83146 function updateHashIfNeeded() {
83147 if (context.inIntro())
83149 var latestHash = computedHash();
83150 if (_cachedHash !== latestHash) {
83151 _cachedHash = latestHash;
83152 window.history.replaceState(null, computedTitle(
83154 /* includeChangeCount */
83158 /* includeChangeCount */
83160 const q2 = utilStringQs(latestHash);
83162 corePreferences("map-location", q2.map);
83166 var _throttledUpdate = throttle_default(updateHashIfNeeded, 500);
83167 var _throttledUpdateTitle = throttle_default(function() {
83170 /* includeChangeCount */
83173 function hashchange() {
83174 if (window.location.hash === _cachedHash)
83176 _cachedHash = window.location.hash;
83177 var q2 = utilStringQs(_cachedHash);
83178 var mapArgs = (q2.map || "").split("/").map(Number);
83179 if (mapArgs.length < 3 || mapArgs.some(isNaN)) {
83180 updateHashIfNeeded();
83182 if (_cachedHash === computedHash())
83184 var mode = context.mode();
83185 context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
83186 if (q2.id && mode) {
83187 var ids = q2.id.split(",").filter(function(id2) {
83188 return context.hasEntity(id2);
83190 if (ids.length && (mode.id === "browse" || mode.id === "select" && !utilArrayIdentical(mode.selectedIDs(), ids))) {
83191 context.enter(modeSelect(context, ids));
83195 var center = context.map().center();
83196 var dist = geoSphericalDistance(center, [mapArgs[2], mapArgs[1]]);
83198 if (mode && mode.id.match(/^draw/) !== null && dist > maxdist) {
83199 context.enter(modeBrowse(context));
83204 function behavior() {
83205 context.map().on("move.behaviorHash", _throttledUpdate);
83206 context.history().on("change.behaviorHash", _throttledUpdateTitle);
83207 context.on("enter.behaviorHash", _throttledUpdate);
83208 select_default2(window).on("hashchange.behaviorHash", hashchange);
83209 var q2 = utilStringQs(window.location.hash);
83211 context.zoomToEntity(q2.id.split(",")[0], !q2.map);
83213 if (q2.walkthrough === "true") {
83214 behavior.startWalkthrough = true;
83217 behavior.hadLocation = true;
83218 } else if (!q2.id && corePreferences("map-location")) {
83219 const mapArgs = corePreferences("map-location").split("/").map(Number);
83220 context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
83221 updateHashIfNeeded();
83222 behavior.hadLocation = true;
83225 updateTitle(false);
83227 behavior.off = function() {
83228 _throttledUpdate.cancel();
83229 _throttledUpdateTitle.cancel();
83230 context.map().on("move.behaviorHash", null);
83231 context.on("enter.behaviorHash", null);
83232 select_default2(window).on("hashchange.behaviorHash", null);
83233 window.location.hash = "";
83238 // node_modules/d3-brush/src/brush.js
83239 var { abs: abs2, max: max2, min: min2 } = Math;
83240 function number1(e3) {
83241 return [+e3[0], +e3[1]];
83243 function number22(e3) {
83244 return [number1(e3[0]), number1(e3[1])];
83248 handles: ["w", "e"].map(type),
83249 input: function(x2, e3) {
83250 return x2 == null ? null : [[+x2[0], e3[0][1]], [+x2[1], e3[1][1]]];
83252 output: function(xy) {
83253 return xy && [xy[0][0], xy[1][0]];
83258 handles: ["n", "s"].map(type),
83259 input: function(y2, e3) {
83260 return y2 == null ? null : [[e3[0][0], +y2[0]], [e3[1][0], +y2[1]]];
83262 output: function(xy) {
83263 return xy && [xy[0][1], xy[1][1]];
83268 handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
83269 input: function(xy) {
83270 return xy == null ? null : number22(xy);
83272 output: function(xy) {
83276 function type(t2) {
83277 return { type: t2 };
83280 // modules/index.js
83283 dispatch: dispatch_default,
83284 geoMercator: mercator_default,
83285 geoProjection: projection,
83286 polygonArea: area_default3,
83287 polygonCentroid: centroid_default2,
83288 select: select_default2,
83289 selectAll: selectAll_default2,
83294 window.requestIdleCallback = window.requestIdleCallback || function(cb) {
83295 var start2 = Date.now();
83296 return window.requestAnimationFrame(function() {
83299 timeRemaining: function() {
83300 return Math.max(0, 50 - (Date.now() - start2));
83305 window.cancelIdleCallback = window.cancelIdleCallback || function(id2) {
83306 window.cancelAnimationFrame(id2);
83308 window.iD = modules_exports;
83310 //# sourceMappingURL=iD.js.map